summary refs log tree commit diff
path: root/crypto/src/tls/TlsUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-07-26 21:30:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-07-26 21:30:34 +0700
commitb2e186669793e61ec36a50ec35c00f781fa5d3c8 (patch)
tree8bf97cc9d55b35b0cff76e19a94a1cadf3326e70 /crypto/src/tls/TlsUtilities.cs
parentClientHello 'splitting' to handle PSK binders (diff)
downloadBouncyCastle.NET-ed25519-b2e186669793e61ec36a50ec35c00f781fa5d3c8.tar.xz
More work on PSK binders
Diffstat (limited to '')
-rw-r--r--crypto/src/tls/TlsUtilities.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs
index c0ccfe9be..72c41ef05 100644
--- a/crypto/src/tls/TlsUtilities.cs
+++ b/crypto/src/tls/TlsUtilities.cs
@@ -1504,21 +1504,20 @@ namespace Org.BouncyCastle.Tls
             return Prf(sp, preMasterSecret, asciiLabel, seed, 48);
         }
 
-        internal static byte[] CalculatePskBinder(TlsCrypto crypto, bool isExternalPsk, int pskPRFAlgorithm,
+        internal static byte[] CalculatePskBinder(TlsCrypto crypto, bool isExternalPsk, int pskCryptoHashAlgorithm,
             TlsSecret earlySecret, byte[] transcriptHash)
         {
-            int prfCryptoHashAlgorithm = TlsCryptoUtilities.GetHashForPrf(pskPRFAlgorithm);
-            int prfHashLength = TlsCryptoUtilities.GetHashOutputSize(prfCryptoHashAlgorithm);
+            int prfHashLength = TlsCryptoUtilities.GetHashOutputSize(pskCryptoHashAlgorithm);
 
             string label = isExternalPsk ? "ext binder" : "res binder";
-            byte[] emptyTranscriptHash = crypto.CreateHash(prfCryptoHashAlgorithm).CalculateHash();
+            byte[] emptyTranscriptHash = crypto.CreateHash(pskCryptoHashAlgorithm).CalculateHash();
 
-            TlsSecret binderKey = DeriveSecret(prfCryptoHashAlgorithm, prfHashLength, earlySecret, label,
+            TlsSecret binderKey = DeriveSecret(pskCryptoHashAlgorithm, prfHashLength, earlySecret, label,
                 emptyTranscriptHash);
 
             try
             {
-                return CalculateFinishedHmac(prfCryptoHashAlgorithm, prfHashLength, binderKey, transcriptHash);
+                return CalculateFinishedHmac(pskCryptoHashAlgorithm, prfHashLength, binderKey, transcriptHash);
             }
             finally
             {