From c49b23e895313210ed9b53855f873c7650018773 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 5 May 2022 01:22:38 +0700 Subject: Followup fix for PSS changes --- crypto/src/tls/TlsUtilities.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crypto') diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs index 05d38c59c..df098e20b 100644 --- a/crypto/src/tls/TlsUtilities.cs +++ b/crypto/src/tls/TlsUtilities.cs @@ -2088,7 +2088,7 @@ namespace Org.BouncyCastle.Tls TlsHash h = algorithm == null ? new CombinedHash(crypto) - : CreateHash(crypto, algorithm.Hash); + : CreateHash(crypto, algorithm); SecurityParameters sp = context.SecurityParameters; // NOTE: The implicit copy here is intended (and important) @@ -4255,6 +4255,14 @@ namespace Org.BouncyCastle.Tls return crypto.CreateHash(cryptoHashAlgorithm); } + private static TlsHash CreateHash(TlsCrypto crypto, SignatureAndHashAlgorithm signatureAndHashAlgorithm) + { + int signatureScheme = SignatureScheme.From(signatureAndHashAlgorithm); + int cryptoHashAlgorithm = SignatureScheme.GetCryptoHashAlgorithm(signatureScheme); + + return crypto.CreateHash(cryptoHashAlgorithm); + } + /// private static TlsKeyExchange CreateKeyExchangeClient(TlsClient client, int keyExchange) { -- cgit 1.4.1