You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2020/09/12 21:30:40 UTC

[qpid-broker-j] 07/17: QPID-8461: Repace Random with SecureRandom

This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit a9ee4a7c4bb819f9549f508f7eb5b12862e8cb48
Author: YYTVicky <61...@users.noreply.github.com>
AuthorDate: Wed Apr 29 22:07:25 2020 -0400

    QPID-8461: Repace Random with SecureRandom
    
    This closes #47
    This closes #46
    
    (cherry picked from commit be89e42fb6cd1629d17fae8ddb35a9efeeda85c3)
---
 broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java b/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java
index 8f785d1..a93ec9c 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java
@@ -24,6 +24,7 @@ import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.Random;
+import java.security.SecureRandom;
 
 public class StringUtil
 {
@@ -33,7 +34,8 @@ public class StringUtil
     private static final char[] CHARACTERS = (NUMBERS + LETTERS + LETTERS.toUpperCase() + OTHERS).toCharArray();
     private static final char[] HEX = "0123456789ABCDEF".toCharArray();
 
-    private Random _random = new Random();
+   
+    private Random _random = new SecureRandom();
 
     public static String elideDataUrl(final String path)
     {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org