diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-26 21:30:34 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-26 21:30:34 +0700 |
commit | b2e186669793e61ec36a50ec35c00f781fa5d3c8 (patch) | |
tree | 8bf97cc9d55b35b0cff76e19a94a1cadf3326e70 /crypto/src/tls/TlsClientProtocol.cs | |
parent | ClientHello 'splitting' to handle PSK binders (diff) | |
download | BouncyCastle.NET-ed25519-b2e186669793e61ec36a50ec35c00f781fa5d3c8.tar.xz |
More work on PSK binders
Diffstat (limited to 'crypto/src/tls/TlsClientProtocol.cs')
-rw-r--r-- | crypto/src/tls/TlsClientProtocol.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/src/tls/TlsClientProtocol.cs b/crypto/src/tls/TlsClientProtocol.cs index 7a92220dc..8fb1a39b7 100644 --- a/crypto/src/tls/TlsClientProtocol.cs +++ b/crypto/src/tls/TlsClientProtocol.cs @@ -1474,6 +1474,8 @@ namespace Org.BouncyCastle.Tls /// <exception cref="IOException"/> protected virtual void Send13ClientHelloRetry() { + // TODO[tls13-psk] Create a new ClientHello object and handle any changes to the bindersSize + IDictionary clientHelloExtensions = m_clientHello.Extensions; clientHelloExtensions.Remove(ExtensionType.cookie); @@ -1679,8 +1681,12 @@ namespace Org.BouncyCastle.Tls + // TODO[tls13-psk] Calculate the total length of the binders that will be added. + int bindersSize = 0; + //int bindersSize = 2 + lengthOfBindersList; + this.m_clientHello = new ClientHello(legacy_version, securityParameters.ClientRandom, legacy_session_id, - null, offeredCipherSuites, m_clientExtensions); + null, offeredCipherSuites, m_clientExtensions, bindersSize); SendClientHelloMessage(); } @@ -1691,14 +1697,11 @@ namespace Org.BouncyCastle.Tls HandshakeMessageOutput message = new HandshakeMessageOutput(HandshakeType.client_hello); m_clientHello.Encode(m_tlsClientContext, message); - // TODO[tls13-psk] Calculate the total length of the binders that will be added. - int totalBindersLength = 0; - - message.PrepareClientHello(m_handshakeHash, totalBindersLength); + message.PrepareClientHello(m_handshakeHash, m_clientHello.BindersSize); // TODO[tls13-psk] Calculate any PSK binders and write them to 'message' here. - message.SendClientHello(this, m_handshakeHash, totalBindersLength); + message.SendClientHello(this, m_handshakeHash, m_clientHello.BindersSize); } /// <exception cref="IOException"/> |