summary refs log tree commit diff
path: root/crypto/src/tls/TlsClientProtocol.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-28 18:57:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-28 18:57:30 +0700
commit558aef70537b3882e5616e9d0e7b40d971e2dd42 (patch)
tree1ac43c975f414e69a268dca315a10a87fa406ea8 /crypto/src/tls/TlsClientProtocol.cs
parentAdd Xoodyak to the master branch (diff)
downloadBouncyCastle.NET-ed25519-558aef70537b3882e5616e9d0e7b40d971e2dd42.tar.xz
Misc. cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/tls/TlsClientProtocol.cs')
-rw-r--r--crypto/src/tls/TlsClientProtocol.cs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/src/tls/TlsClientProtocol.cs b/crypto/src/tls/TlsClientProtocol.cs
index ec1cd28d5..6aa1acf2f 100644
--- a/crypto/src/tls/TlsClientProtocol.cs
+++ b/crypto/src/tls/TlsClientProtocol.cs
@@ -1001,8 +1001,7 @@ namespace Org.BouncyCastle.Tls
                         throw new TlsFatalAlert(AlertDescription.illegal_parameter);
                     }
 
-                    TlsAgreement agreement = (TlsAgreement)m_clientAgreements[keyShareEntry.NamedGroup];
-                    if (null == agreement)
+                    if (!m_clientAgreements.TryGetValue(keyShareEntry.NamedGroup, out var agreement))
                         throw new TlsFatalAlert(AlertDescription.illegal_parameter);
 
                     agreement.ReceivePeerValue(keyShareEntry.KeyExchange);