activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [07/50] [abbrv] activemq-artemis git commit: ARTEMIS-786 Using RandomUtil instead of SecureRandom..
Date Mon, 07 Nov 2016 16:36:27 GMT
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.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5965a458
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5965a458
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5965a458

Branch: refs/heads/ARTEMIS-780
Commit: 5965a458945c98f61f1e1e3db418082b68e9df62
Parents: e89f6a1
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Nov 2 18:09:25 2016 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Nov 2 19:00:13 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/utils/DefaultSensitiveStringCodec.java    | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5965a458/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
index 227a60b..1861d0e 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
@@ -22,7 +22,6 @@ import javax.crypto.spec.PBEKeySpec;
 import javax.crypto.spec.SecretKeySpec;
 import java.math.BigInteger;
 import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
 import java.security.spec.InvalidKeySpecException;
 import java.util.Arrays;
 import java.util.Collections;
@@ -189,10 +188,7 @@ public class DefaultSensitiveStringCodec implements SensitiveDataCodec<String>
{
       }
 
       public byte[] getSalt() throws NoSuchAlgorithmException {
-         byte[] salt = new byte[this.saltLength];
-
-         SecureRandom sr = SecureRandom.getInstance(this.randomScheme);
-         sr.nextBytes(salt);
+         byte[] salt = RandomUtil.randomBytes(this.saltLength);
          return salt;
       }
 


Mime
View raw message