diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-05-11 19:09:20 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-05-11 19:09:20 +0700 |
commit | dbeaae6ba4f8b709246d1f67bfb675f4133ffb8f (patch) | |
tree | 265595215c41b436b3fd3c67aca4f0e2abd48c90 /crypto/src/tls/TlsUtilities.cs | |
parent | Improve HMac reset (diff) | |
download | BouncyCastle.NET-ed25519-dbeaae6ba4f8b709246d1f67bfb675f4133ffb8f.tar.xz |
Improve anon suites
Diffstat (limited to 'crypto/src/tls/TlsUtilities.cs')
-rw-r--r-- | crypto/src/tls/TlsUtilities.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs index f6e509b7d..72ff92271 100644 --- a/crypto/src/tls/TlsUtilities.cs +++ b/crypto/src/tls/TlsUtilities.cs @@ -4799,8 +4799,11 @@ namespace Org.BouncyCastle.Tls MemoryStream buf) { SecurityParameters securityParameters = clientContext.SecurityParameters; - if (null != securityParameters.PeerCertificate) + if (KeyExchangeAlgorithm.IsAnonymous(securityParameters.KeyExchangeAlgorithm) + || null != securityParameters.PeerCertificate) + { throw new TlsFatalAlert(AlertDescription.unexpected_message); + } MemoryStream endPointHash = new MemoryStream(); |