summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/tls/TlsUtilities.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs
index 424fca133..4a89d6708 100644
--- a/crypto/src/tls/TlsUtilities.cs
+++ b/crypto/src/tls/TlsUtilities.cs
@@ -2157,8 +2157,6 @@ namespace Org.BouncyCastle.Tls
             }
 
             buf.CopyInputTo(output);
-
-            output.Dispose();
         }
 
         internal static DigitallySigned GenerateCertificateVerifyClient(TlsClientContext clientContext,
@@ -2399,7 +2397,10 @@ namespace Org.BouncyCastle.Tls
             byte[] signature;
             if (streamSigner != null)
             {
-                SendSignatureInput(context, extraSignatureInput, digestBuffer, streamSigner.Stream);
+                using (var output = streamSigner.Stream)
+                {
+                    SendSignatureInput(context, extraSignatureInput, digestBuffer, output);
+                }
                 signature = streamSigner.GetSignature();
             }
             else
@@ -2445,7 +2446,10 @@ namespace Org.BouncyCastle.Tls
             bool verified;
             if (streamVerifier != null)
             {
-                SendSignatureInput(context, null, digestBuffer, streamVerifier.Stream);
+                using (var output = streamVerifier.Stream)
+                {
+                    SendSignatureInput(context, null, digestBuffer, output);
+                }
                 verified = streamVerifier.IsVerified();
             }
             else