mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-07 18:49:14 +00:00
ARTEMIS-786 Using RandomUtil instead of SecureRandom..
This was introducing several performance hits. I was running the examples and they were not completing at all on my environment.
This commit is contained in:
parent
e89f6a1bfd
commit
5965a45894
@ -22,7 +22,6 @@ import javax.crypto.spec.PBEKeySpec;
|
|||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.security.spec.InvalidKeySpecException;
|
import java.security.spec.InvalidKeySpecException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -189,10 +188,7 @@ public class DefaultSensitiveStringCodec implements SensitiveDataCodec<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getSalt() throws NoSuchAlgorithmException {
|
public byte[] getSalt() throws NoSuchAlgorithmException {
|
||||||
byte[] salt = new byte[this.saltLength];
|
byte[] salt = RandomUtil.randomBytes(this.saltLength);
|
||||||
|
|
||||||
SecureRandom sr = SecureRandom.getInstance(this.randomScheme);
|
|
||||||
sr.nextBytes(salt);
|
|
||||||
return salt;
|
return salt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user