summary refs log tree commit diff
path: root/crypto/src/tls/DtlsServerProtocol.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/DtlsServerProtocol.cs
parentImprove HMac reset (diff)
downloadBouncyCastle.NET-ed25519-dbeaae6ba4f8b709246d1f67bfb675f4133ffb8f.tar.xz
Improve anon suites
Diffstat (limited to 'crypto/src/tls/DtlsServerProtocol.cs')
-rw-r--r--crypto/src/tls/DtlsServerProtocol.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/src/tls/DtlsServerProtocol.cs b/crypto/src/tls/DtlsServerProtocol.cs
index c019eb9fb..b01c6e34f 100644
--- a/crypto/src/tls/DtlsServerProtocol.cs
+++ b/crypto/src/tls/DtlsServerProtocol.cs
@@ -155,7 +155,13 @@ namespace Org.BouncyCastle.Tls
             }
 
             state.keyExchange = TlsUtilities.InitKeyExchangeServer(state.serverContext, state.server);
-            state.serverCredentials = TlsUtilities.EstablishServerCredentials(state.server);
+
+            state.serverCredentials = null;
+
+            if (!KeyExchangeAlgorithm.IsAnonymous(securityParameters.KeyExchangeAlgorithm))
+            {
+                state.serverCredentials = TlsUtilities.EstablishServerCredentials(state.server);
+            }
 
             // Server certificate
             {