diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-04-16 11:00:27 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-04-16 11:00:27 +0400 |
commit | 1b2efc5633397c40766389d56f0267fd94579b28 (patch) | |
tree | 9a8ea01535b46f43b3c4ac3df3b20e324d79150b /core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java | |
parent | d4ced6ae037cc2301b9abe4776b2af45027407b4 (diff) |
Deprecate TlsClientProtocol auto-creation of SecureRandom
Refactor all uses of SecureRandom to be via TlsContext
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java index ed23230b..cf98ddb9 100644 --- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java +++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java @@ -43,6 +43,9 @@ public class TlsClientProtocol return random; } + /** + * @deprecated use alternate constructor taking an explicit {@link SecureRandom} + */ public TlsClientProtocol(InputStream input, OutputStream output) { this(input, output, createSecureRandom()); @@ -74,10 +77,12 @@ public class TlsClientProtocol this.securityParameters = new SecurityParameters(); this.securityParameters.entity = ConnectionEnd.client; - this.securityParameters.clientRandom = createRandomBlock(tlsClient.shouldUseGMTUnixTime(), secureRandom, - ExporterLabel.client_random); this.tlsClientContext = new TlsClientContextImpl(secureRandom, securityParameters); + + this.securityParameters.clientRandom = createRandomBlock(tlsClient.shouldUseGMTUnixTime(), + tlsClientContext.getSecureRandom(), ExporterLabel.client_random); + this.tlsClient.init(tlsClientContext); this.recordStream.init(tlsClientContext); |