diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-05-05 01:22:38 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-05-05 01:22:38 +0700 |
commit | c49b23e895313210ed9b53855f873c7650018773 (patch) | |
tree | 9071f994a7e5ea88477790104b8736fce54492a0 | |
parent | TLS PSS raw signatures (diff) | |
download | BouncyCastle.NET-ed25519-c49b23e895313210ed9b53855f873c7650018773.tar.xz |
Followup fix for PSS changes
-rw-r--r-- | crypto/src/tls/TlsUtilities.cs | 10 |
1 files changed, 9 insertions, 1 deletions
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); + } + /// <exception cref="IOException"/> private static TlsKeyExchange CreateKeyExchangeClient(TlsClient client, int keyExchange) { |