summary refs log tree commit diff
path: root/crypto/src/crypto/tls/TlsProtocol.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2017-03-22 22:47:04 +1030
committerPeter Dettman <peter.dettman@bouncycastle.org>2017-03-22 22:47:04 +1030
commitf3d758b0f79743e17123560508cd59a63b8607c1 (patch)
tree83d1726b8e5d0e0399ba84bba6e1d3afcee7a3d8 /crypto/src/crypto/tls/TlsProtocol.cs
parentSimple refactoring to follow bc-java code (diff)
downloadBouncyCastle.NET-ed25519-f3d758b0f79743e17123560508cd59a63b8607c1.tar.xz
Use new TlsNoCloseNotifyException instead of generic EndOfStreamException
- New exception only used for this specific case, which should simplify
the handling of possible truncations in application code.
Diffstat (limited to '')
-rw-r--r--crypto/src/crypto/tls/TlsProtocol.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/src/crypto/tls/TlsProtocol.cs b/crypto/src/crypto/tls/TlsProtocol.cs
index 6d5c93f40..98c6399d3 100644
--- a/crypto/src/crypto/tls/TlsProtocol.cs
+++ b/crypto/src/crypto/tls/TlsProtocol.cs
@@ -488,9 +488,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             {
                 if (!mRecordStream.ReadRecord())
                 {
-                    // TODO It would be nicer to allow graceful connection close if between records
-    //                this.FailWithError(AlertLevel.warning, AlertDescription.close_notify);
-                    throw new EndOfStreamException();
+                    throw new TlsNoCloseNotifyException();
                 }
             }
             catch (TlsFatalAlert e)