diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-09 01:13:27 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-09 01:13:27 +0700 |
commit | a8a17fd70fc8df3ca7402323ad5c4f36b25cb806 (patch) | |
tree | 9b276b62885505abbb899d17744b65b912072140 /crypto/src/x509/X509Crl.cs | |
parent | Primes improvements (diff) | |
download | BouncyCastle.NET-ed25519-a8a17fd70fc8df3ca7402323ad5c4f36b25cb806.tar.xz |
Dispose cleanup
- IDisposable for PemReader, PemWriter, IStreamGenerator
Diffstat (limited to 'crypto/src/x509/X509Crl.cs')
-rw-r--r-- | crypto/src/x509/X509Crl.cs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crypto/src/x509/X509Crl.cs b/crypto/src/x509/X509Crl.cs index 265c2293c..db13f4f2f 100644 --- a/crypto/src/x509/X509Crl.cs +++ b/crypto/src/x509/X509Crl.cs @@ -130,17 +130,15 @@ namespace Org.BouncyCastle.X509 if (!c.SignatureAlgorithm.Equals(c.TbsCertList.Signature)) throw new CrlException("Signature algorithm on CertificateList does not match TbsCertList."); - Asn1Encodable parameters = c.SignatureAlgorithm.Parameters; + byte[] b = GetTbsCertList(); IStreamCalculator<IVerifier> streamCalculator = verifier.CreateCalculator(); + using (var stream = streamCalculator.Stream) + { + stream.Write(b, 0, b.Length); + } - byte[] b = this.GetTbsCertList(); - - streamCalculator.Stream.Write(b, 0, b.Length); - - Platform.Dispose(streamCalculator.Stream); - - if (!streamCalculator.GetResult().IsVerified(this.GetSignature())) + if (!streamCalculator.GetResult().IsVerified(GetSignature())) throw new InvalidKeyException("CRL does not verify with supplied public key."); } |