diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-09-18 12:32:49 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-09-18 12:32:49 +0400 |
commit | 45b9ccb3ef11ac9fb67a254e756876d9d988b436 (patch) | |
tree | 4738ac18d058d4759b11372c4013b6ab9f18282f /core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java | |
parent | 60f3b606af063cb5ceadb3b107bc0df0caf3cc4e (diff) |
At least seed the random source with current time
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java index 795986b7..8dd2a5be 100644 --- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java +++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java @@ -839,11 +839,14 @@ public abstract class TlsProtocol protected static byte[] createRandomBlock(SecureRandom random) { + random.setSeed(System.currentTimeMillis()); + byte[] result = new byte[32]; random.nextBytes(result); /* - * The consensus seems to be that using the time here is neither useful, nor secure. Perhaps - * there could be an option to (re-)enable it. + * The consensus seems to be that using the time here is neither all that useful, nor + * secure. Perhaps there could be an option to (re-)enable it. Instead, we seed the random + * source with the current time to retain it's main benefit. */ // TlsUtils.writeGMTUnixTime(result, 0); return result; |