diff options
author | deniszykov <deniszykov@gmail.com> | 2019-05-09 15:29:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-09 15:29:40 +0300 |
commit | b232d995a81fa027106024aa74a5abbcda9fa3a0 (patch) | |
tree | 3d9e5883f5a4372a836a33fc4ac0d79fa7e576e6 | |
parent | Merge branch 'kakkerlakgly-patch-3' (diff) | |
download | BouncyCastle.NET-ed25519-b232d995a81fa027106024aa74a5abbcda9fa3a0.tar.xz |
Update TlsProtocol.cs
added `TlsProtocol.OfferInput()` overload which specify _offset_ and _length_ of input buffer like in java source https://www.bouncycastle.org/docs/tlsdocs1.5on/org/bouncycastle/tls/TlsProtocol.html
-rw-r--r-- | crypto/src/crypto/tls/TlsProtocol.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/src/crypto/tls/TlsProtocol.cs b/crypto/src/crypto/tls/TlsProtocol.cs index 394967c37..103f6af0f 100644 --- a/crypto/src/crypto/tls/TlsProtocol.cs +++ b/crypto/src/crypto/tls/TlsProtocol.cs @@ -748,12 +748,17 @@ namespace Org.BouncyCastle.Crypto.Tls */ public virtual void OfferInput(byte[] input) { + this.OfferInput(input, 0, input.Length); + } + + public virtual void OfferInput(byte[] input, int offset, int length) + { if (mBlocking) throw new InvalidOperationException("Cannot use OfferInput() in blocking mode! Use Stream instead."); if (mClosed) throw new IOException("Connection is closed, cannot accept any more input"); - mInputBuffers.Write(input); + mInputBuffers.Write(input, offset, length); // loop while there are enough bytes to read the length of the next record while (mInputBuffers.Available >= RecordStream.TLS_HEADER_SIZE) |