diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-23 21:08:34 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-23 21:08:34 +0700 |
commit | 29a112bef25c63c03da142e665f027f00bd496b0 (patch) | |
tree | f5e2d730f84fc9f720a1e20b6b381c2bdefbee71 /crypto/src/tsp | |
parent | Round 4 modifications to HQC + removed some redundancy (diff) | |
download | BouncyCastle.NET-ed25519-29a112bef25c63c03da142e665f027f00bd496b0.tar.xz |
Use FixedTimeEquals
Diffstat (limited to 'crypto/src/tsp')
-rw-r--r-- | crypto/src/tsp/TSPUtil.cs | 2 | ||||
-rw-r--r-- | crypto/src/tsp/TimeStampResponse.cs | 2 | ||||
-rw-r--r-- | crypto/src/tsp/TimeStampToken.cs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/tsp/TSPUtil.cs b/crypto/src/tsp/TSPUtil.cs index 1ba289ae6..6f1d07b0a 100644 --- a/crypto/src/tsp/TSPUtil.cs +++ b/crypto/src/tsp/TSPUtil.cs @@ -99,7 +99,7 @@ namespace Org.BouncyCastle.Tsp GetDigestAlgName(tstInfo.MessageImprintAlgOid), signerInfo.GetSignature()); - if (!Arrays.ConstantTimeAreEqual(expectedDigest, tstInfo.GetMessageImprintDigest())) + if (!Arrays.FixedTimeEquals(expectedDigest, tstInfo.GetMessageImprintDigest())) throw new TspValidationException("Incorrect digest in message imprint"); timestamps.Add(timeStampToken); diff --git a/crypto/src/tsp/TimeStampResponse.cs b/crypto/src/tsp/TimeStampResponse.cs index 069521111..702194911 100644 --- a/crypto/src/tsp/TimeStampResponse.cs +++ b/crypto/src/tsp/TimeStampResponse.cs @@ -136,7 +136,7 @@ namespace Org.BouncyCastle.Tsp throw new TspValidationException("time stamp token found in failed request."); } - if (!Arrays.ConstantTimeAreEqual(request.GetMessageImprintDigest(), tstInfo.GetMessageImprintDigest())) + if (!Arrays.FixedTimeEquals(request.GetMessageImprintDigest(), tstInfo.GetMessageImprintDigest())) { throw new TspValidationException("response for different message imprint digest."); } diff --git a/crypto/src/tsp/TimeStampToken.cs b/crypto/src/tsp/TimeStampToken.cs index 93b372720..f2f86da67 100644 --- a/crypto/src/tsp/TimeStampToken.cs +++ b/crypto/src/tsp/TimeStampToken.cs @@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Tsp byte[] hash = DigestUtilities.CalculateDigest( certID.GetHashAlgorithmName(), cert.GetEncoded()); - if (!Arrays.ConstantTimeAreEqual(certID.GetCertHash(), hash)) + if (!Arrays.FixedTimeEquals(certID.GetCertHash(), hash)) throw new TspValidationException("certificate hash does not match certID hash."); if (certID.IssuerSerial != null) |