diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-22 00:34:26 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-22 00:34:26 +0700 |
commit | 93cf36b2759f68aa680e5eed37be0a29f039a6c2 (patch) | |
tree | 5afeb9cce7be5d0e0dd59024cb86a2d5164c994e /crypto/src/tsp | |
parent | Hold boolean instead of the parser (diff) | |
download | BouncyCastle.NET-ed25519-93cf36b2759f68aa680e5eed37be0a29f039a6c2.tar.xz |
Refactoring
Diffstat (limited to 'crypto/src/tsp')
-rw-r--r-- | crypto/src/tsp/TimeStampToken.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crypto/src/tsp/TimeStampToken.cs b/crypto/src/tsp/TimeStampToken.cs index 1245589b4..9b2a7a40b 100644 --- a/crypto/src/tsp/TimeStampToken.cs +++ b/crypto/src/tsp/TimeStampToken.cs @@ -180,16 +180,12 @@ namespace Org.BouncyCastle.Tsp certID.GetHashAlgorithmName(), cert.GetEncoded()); if (!Arrays.ConstantTimeAreEqual(certID.GetCertHash(), hash)) - { throw new TspValidationException("certificate hash does not match certID hash."); - } if (certID.IssuerSerial != null) { - if (!certID.IssuerSerial.Serial.Value.Equals(cert.SerialNumber)) - { + if (!certID.IssuerSerial.Serial.HasValue(cert.SerialNumber)) throw new TspValidationException("certificate serial number does not match certID for signature."); - } GeneralName[] names = certID.IssuerSerial.Issuer.GetNames(); X509Name principal = PrincipalUtilities.GetIssuerX509Principal(cert); |