cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [1/6] cassandra git commit: CASSANDRA-11518, use SecureRandom instead of java.util.Random to initialize UUIDGen clock sequence.
Date Thu, 05 May 2016 22:09:12 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 b8f201172 -> c19066ee0
  refs/heads/cassandra-3.7 022edf436 -> 4e364d71e
  refs/heads/trunk 95df20929 -> 89eb3e58b


CASSANDRA-11518, use SecureRandom instead of java.util.Random to initialize UUIDGen clock
sequence.


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c19066ee
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c19066ee
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c19066ee

Branch: refs/heads/cassandra-3.0
Commit: c19066ee0251fc9d3d7d8217949b93a65088a8e9
Parents: b8f2011
Author: Ariel Weisberg <ariel.weisberg@datastax.com>
Authored: Wed Apr 6 17:05:39 2016 -0400
Committer: Josh McKenzie <josh.mckenzie@datastax.com>
Committed: Thu May 5 18:08:27 2016 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/utils/UUIDGen.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c19066ee/src/java/org/apache/cassandra/utils/UUIDGen.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/UUIDGen.java b/src/java/org/apache/cassandra/utils/UUIDGen.java
index df07e1f..f50545b 100644
--- a/src/java/org/apache/cassandra/utils/UUIDGen.java
+++ b/src/java/org/apache/cassandra/utils/UUIDGen.java
@@ -21,6 +21,7 @@ import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
 import java.util.Collection;
 import java.util.Random;
 import java.util.UUID;
@@ -239,7 +240,7 @@ public class UUIDGen
 
     private static long makeClockSeqAndNode()
     {
-        long clock = new Random(System.currentTimeMillis()).nextLong();
+        long clock = new SecureRandom().nextLong();
 
         long lsb = 0;
         lsb |= 0x8000000000000000L;                 // variant (2 bits)


Mime
View raw message