summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-04-20 18:24:53 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-04-20 18:24:53 +0700
commit74b8406de0eeae6e9a4546505a0d9058e19c48db (patch)
tree5736de0b3f206e3a790a7ab22c748cff5916ef92
parentRefactoring (diff)
downloadBouncyCastle.NET-ed25519-74b8406de0eeae6e9a4546505a0d9058e19c48db.tar.xz
No HMacDsaKCalculator for verification
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsDsaVerifier.cs4
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsDssVerifier.cs8
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsECDsa13Verifier.cs3
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsECDsaVerifier.cs4
4 files changed, 7 insertions, 12 deletions
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsDsaVerifier.cs b/crypto/src/tls/crypto/impl/bc/BcTlsDsaVerifier.cs
index bc8395ac5..57bbc09cd 100644
--- a/crypto/src/tls/crypto/impl/bc/BcTlsDsaVerifier.cs
+++ b/crypto/src/tls/crypto/impl/bc/BcTlsDsaVerifier.cs
@@ -16,9 +16,9 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
         {
         }
 
-        protected override IDsa CreateDsaImpl(int cryptoHashAlgorithm)
+        protected override IDsa CreateDsaImpl()
         {
-            return new DsaSigner(new HMacDsaKCalculator(m_crypto.CreateDigest(cryptoHashAlgorithm)));
+            return new DsaSigner();
         }
 
         protected override short SignatureAlgorithm
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsDssVerifier.cs b/crypto/src/tls/crypto/impl/bc/BcTlsDssVerifier.cs
index f2e371067..01f9265cc 100644
--- a/crypto/src/tls/crypto/impl/bc/BcTlsDssVerifier.cs
+++ b/crypto/src/tls/crypto/impl/bc/BcTlsDssVerifier.cs
@@ -16,7 +16,7 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
         {
         }
 
-        protected abstract IDsa CreateDsaImpl(int cryptoHashAlgorithm);
+        protected abstract IDsa CreateDsaImpl();
 
         protected abstract short SignatureAlgorithm { get; }
 
@@ -26,11 +26,7 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
             if (algorithm != null && algorithm.Signature != SignatureAlgorithm)
                 throw new InvalidOperationException("Invalid algorithm: " + algorithm);
 
-            int cryptoHashAlgorithm = (null == algorithm)
-                ? CryptoHashAlgorithm.sha1
-                : TlsCryptoUtilities.GetHash(algorithm.Hash);
-
-            ISigner signer = new DsaDigestSigner(CreateDsaImpl(cryptoHashAlgorithm), new NullDigest());
+            ISigner signer = new DsaDigestSigner(CreateDsaImpl(), new NullDigest());
             signer.Init(false, m_publicKey);
             if (algorithm == null)
             {
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsECDsa13Verifier.cs b/crypto/src/tls/crypto/impl/bc/BcTlsECDsa13Verifier.cs
index 8488dc8d2..8a45c23ad 100644
--- a/crypto/src/tls/crypto/impl/bc/BcTlsECDsa13Verifier.cs
+++ b/crypto/src/tls/crypto/impl/bc/BcTlsECDsa13Verifier.cs
@@ -29,8 +29,7 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
             if (algorithm == null || SignatureScheme.From(algorithm) != m_signatureScheme)
                 throw new InvalidOperationException("Invalid algorithm: " + algorithm);
 
-            int cryptoHashAlgorithm = SignatureScheme.GetCryptoHashAlgorithm(m_signatureScheme);
-            IDsa dsa = new ECDsaSigner(new HMacDsaKCalculator(m_crypto.CreateDigest(cryptoHashAlgorithm)));
+            IDsa dsa = new ECDsaSigner();
 
             ISigner signer = new DsaDigestSigner(dsa, new NullDigest());
             signer.Init(false, m_publicKey);
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsECDsaVerifier.cs b/crypto/src/tls/crypto/impl/bc/BcTlsECDsaVerifier.cs
index 1cd6ff1ea..4d6f893d7 100644
--- a/crypto/src/tls/crypto/impl/bc/BcTlsECDsaVerifier.cs
+++ b/crypto/src/tls/crypto/impl/bc/BcTlsECDsaVerifier.cs
@@ -16,9 +16,9 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
         {
         }
 
-        protected override IDsa CreateDsaImpl(int cryptoHashAlgorithm)
+        protected override IDsa CreateDsaImpl()
         {
-            return new ECDsaSigner(new HMacDsaKCalculator(m_crypto.CreateDigest(cryptoHashAlgorithm)));
+            return new ECDsaSigner();
         }
 
         protected override short SignatureAlgorithm