Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.java7
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;