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/test/src/tls | |
parent | Primes improvements (diff) | |
download | BouncyCastle.NET-ed25519-a8a17fd70fc8df3ca7402323ad5c4f36b25cb806.tar.xz |
Dispose cleanup
- IDisposable for PemReader, PemWriter, IStreamGenerator
Diffstat (limited to 'crypto/test/src/tls')
-rw-r--r-- | crypto/test/src/tls/test/TlsTestUtilities.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/test/src/tls/test/TlsTestUtilities.cs b/crypto/test/src/tls/test/TlsTestUtilities.cs index a3526ab6b..3baf233c7 100644 --- a/crypto/test/src/tls/test/TlsTestUtilities.cs +++ b/crypto/test/src/tls/test/TlsTestUtilities.cs @@ -371,13 +371,12 @@ namespace Org.BouncyCastle.Tls.Tests } internal static PemObject LoadPemResource(string resource) - { Stream s = SimpleTest.GetTestDataAsStream("tls." + resource); - PemReader p = new PemReader(new StreamReader(s)); - PemObject o = p.ReadPemObject(); - p.Reader.Close(); - return o; + using (var p = new PemReader(new StreamReader(s))) + { + return p.ReadPemObject(); + } } internal static bool AreSameCertificate(TlsCrypto crypto, TlsCertificate cert, string resource) |