Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0C7EB2009F3 for ; Fri, 6 May 2016 00:09:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0B08C160A0A; Thu, 5 May 2016 22:09:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 50BBA160A04 for ; Fri, 6 May 2016 00:09:13 +0200 (CEST) Received: (qmail 97829 invoked by uid 500); 5 May 2016 22:09:12 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 97797 invoked by uid 99); 5 May 2016 22:09:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 22:09:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 22BD7DFC77; Thu, 5 May 2016 22:09:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmckenzie@apache.org To: commits@cassandra.apache.org Date: Thu, 05 May 2016 22:09:12 -0000 Message-Id: <00572f152ff941ce9bd2f81dba143d6a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] cassandra git commit: CASSANDRA-11518, use SecureRandom instead of java.util.Random to initialize UUIDGen clock sequence. archived-at: Thu, 05 May 2016 22:09:14 -0000 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 Authored: Wed Apr 6 17:05:39 2016 -0400 Committer: Josh McKenzie 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)