summary refs log tree commit diff
path: root/crypto/src/tls/TlsUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-05-11 19:09:20 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-05-11 19:09:20 +0700
commitdbeaae6ba4f8b709246d1f67bfb675f4133ffb8f (patch)
tree265595215c41b436b3fd3c67aca4f0e2abd48c90 /crypto/src/tls/TlsUtilities.cs
parentImprove HMac reset (diff)
downloadBouncyCastle.NET-ed25519-dbeaae6ba4f8b709246d1f67bfb675f4133ffb8f.tar.xz
Improve anon suites
Diffstat (limited to 'crypto/src/tls/TlsUtilities.cs')
-rw-r--r--crypto/src/tls/TlsUtilities.cs5
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();