summary refs log tree commit diff
path: root/crypto/src/tls/TlsClientProtocol.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-05-30 00:36:32 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-05-30 00:36:32 +0700
commit2cb589c0cbd7188ef3f2f70305f13d2eab9ffe60 (patch)
tree203822e7e601694d5f9ccaece3657c56581c4bb3 /crypto/src/tls/TlsClientProtocol.cs
parentbzip2 fixes and perf. opts. (diff)
downloadBouncyCastle.NET-ed25519-2cb589c0cbd7188ef3f2f70305f13d2eab9ffe60.tar.xz
Set randoms before extensions processing
- see https://github.com/bcgit/bc-java/issues/1167
Diffstat (limited to 'crypto/src/tls/TlsClientProtocol.cs')
-rw-r--r--crypto/src/tls/TlsClientProtocol.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/src/tls/TlsClientProtocol.cs b/crypto/src/tls/TlsClientProtocol.cs
index ba2b565ca..399d8c9b8 100644
--- a/crypto/src/tls/TlsClientProtocol.cs
+++ b/crypto/src/tls/TlsClientProtocol.cs
@@ -1638,6 +1638,12 @@ namespace Org.BouncyCastle.Tls
             bool offeringTlsV12Minus = ProtocolVersion.TLSv12.IsEqualOrLaterVersionOf(earliestVersion);
             bool offeringTlsV13Plus = ProtocolVersion.TLSv13.IsEqualOrEarlierVersionOf(latestVersion);
 
+            {
+                bool useGmtUnixTime = !offeringTlsV13Plus && m_tlsClient.ShouldUseGmtUnixTime();
+
+                securityParameters.m_clientRandom = CreateRandomBlock(useGmtUnixTime, m_tlsClientContext);
+            }
+
             EstablishSession(offeringTlsV12Minus ? m_tlsClient.GetSessionToResume() : null);
             m_tlsClient.NotifySessionToResume(m_tlsSession);
 
@@ -1710,12 +1716,6 @@ namespace Org.BouncyCastle.Tls
                 throw new TlsFatalAlert(AlertDescription.internal_error);
             }
 
-            {
-                bool useGmtUnixTime = !offeringTlsV13Plus && m_tlsClient.ShouldUseGmtUnixTime();
-
-                securityParameters.m_clientRandom = CreateRandomBlock(useGmtUnixTime, m_tlsClientContext);
-            }
-
             // NOT renegotiating
             {
                 /*