46 references to _buffer
System.Net.Security (46)
System\Net\Security\SslStream.cs (3)
754
if (
_buffer
.DecryptedLength > 0)
756
int b =
_buffer
.DecryptedSpan[0];
757
_buffer
.Discard(1);
System\Net\Security\SslStream.IO.cs (43)
68
_buffer
.ReturnBuffer();
71
if (!
_buffer
.IsValid)
217
if (
_buffer
.ActiveLength > 0)
265
if (
_buffer
.ActiveLength == 0)
267
_buffer
.ReturnBuffer();
328
_buffer
.EnsureAvailableSpace(InitialHandshakeBufferSize);
424
if (TlsFrameHelper.TryGetFrameInfo(
_buffer
.EncryptedReadOnlySpan, ref _lastFrame))
431
if (!_isRenego &&
_buffer
.EncryptedReadOnlySpan[_lastFrame.Header.Version == SslProtocols.Ssl2 ? HandshakeTypeOffsetSsl2 : HandshakeTypeOffsetTls] == (byte)TlsHandshakeType.ClientHello &&
446
if (!TlsFrameHelper.TryGetFrameInfo(
_buffer
.EncryptedReadOnlySpan, ref _lastFrame, options))
492
ReadOnlySpan<byte> availableData =
_buffer
.EncryptedReadOnlySpan;
495
while (
_buffer
.EncryptedLength - chunkSize > TlsFrameHelper.HeaderSize)
518
_buffer
.DiscardEncrypted(consumed);
719
if (
_buffer
.ActiveLength == 0)
721
_buffer
.ReturnBuffer();
727
frameSize = GetFrameSize(
_buffer
.EncryptedReadOnlySpan);
728
return
_buffer
.EncryptedLength >= frameSize;
745
_buffer
.EnsureAvailableSpace(frameSize == UnknownTlsFrameLength ?
747
frameSize -
_buffer
.EncryptedLength);
749
while (
_buffer
.EncryptedLength < frameSize)
752
Debug.Assert(
_buffer
.AvailableLength > 0, "_buffer.AvailableBytes > 0");
755
int bytesRead = await TIOAdapter.ReadAsync(InnerStream,
_buffer
.AvailableMemory, cancellationToken).ConfigureAwait(false);
758
if (
_buffer
.EncryptedLength != 0)
767
_buffer
.Commit(bytesRead);
768
if (frameSize == int.MaxValue &&
_buffer
.EncryptedLength > TlsFrameHelper.HeaderSize)
771
frameSize = GetFrameSize(
_buffer
.EncryptedReadOnlySpan);
772
_buffer
.EnsureAvailableSpace(frameSize -
_buffer
.EncryptedLength);
788
status = Decrypt(
_buffer
.EncryptedSpanSliced(frameSize), out int decryptedOffset, out int decryptedCount);
789
_buffer
.OnDecrypted(decryptedOffset, decryptedCount, frameSize);
839
if (
_buffer
.DecryptedLength != 0)
854
Debug.Assert(
_buffer
.EncryptedLength == 0);
859
Debug.Assert(
_buffer
.DecryptedLength == 0);
874
if (
_buffer
.DecryptedLength != 0)
876
extraBuffer = new byte[
_buffer
.DecryptedLength];
877
_buffer
.DecryptedSpan.CopyTo(extraBuffer);
879
_buffer
.Discard(
_buffer
.DecryptedLength);
905
if (
_buffer
.DecryptedLength > 0)
932
TlsFrameHelper.TryGetFrameHeader(
_buffer
.EncryptedReadOnlySpan, ref _lastFrame.Header);
999
Debug.Assert(
_buffer
.DecryptedLength > 0);
1001
int copyBytes = Math.Min(
_buffer
.DecryptedLength, buffer.Length);
1004
_buffer
.DecryptedReadOnlySpanSliced(copyBytes).CopyTo(buffer.Span);
1005
_buffer
.Discard(copyBytes);