Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DecryptData()

SecurityStatusPal System.Net.Security.SslStream.DecryptData ( int frameSize)
inlineprivate

Definition at line 1524 of file SslStream.cs.

1525 {
1527 _decryptedBytesCount = frameSize;
1528 SecurityStatusPal result;
1529 lock (_handshakeLock)
1530 {
1532 result = _context.Decrypt(new Span<byte>(_internalBuffer, _internalOffset, frameSize), out var outputOffset, out var outputCount);
1533 _decryptedBytesCount = outputCount;
1534 if (outputCount > 0)
1535 {
1536 _decryptedBytesOffset = _internalOffset + outputOffset;
1537 }
1538 if (result.ErrorCode == SecurityStatusPalErrorCode.Renegotiate && (_sslAuthenticationOptions.AllowRenegotiation || SslProtocol == SslProtocols.Tls13 || _nestedAuth != 0))
1539 {
1540 _handshakeWaiter = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
1541 }
1542 }
1543 ConsumeBufferedBytes(frameSize);
1544 return result;
1545 }
SecurityStatusPal Decrypt(Span< byte > buffer, out int outputOffset, out int outputCount)
void ConsumeBufferedBytes(int byteCount)
volatile TaskCompletionSource< bool > _handshakeWaiter
Definition SslStream.cs:72
SslAuthenticationOptions _sslAuthenticationOptions
Definition SslStream.cs:62
virtual SslProtocols SslProtocol
Definition SslStream.cs:135

References System.Net.Security.SslStream._context, System.Net.Security.SslStream._decryptedBytesCount, System.Net.Security.SslStream._decryptedBytesOffset, System.Net.Security.SslStream._handshakeLock, System.Net.Security.SslStream._handshakeWaiter, System.Net.Security.SslStream._internalBuffer, System.Net.Security.SslStream._internalOffset, System.Net.Security.SslStream._nestedAuth, System.Net.Security.SslStream._sslAuthenticationOptions, System.Net.Security.SslAuthenticationOptions.AllowRenegotiation, System.Net.Security.SslStream.ConsumeBufferedBytes(), System.Net.Security.SecureChannel.Decrypt(), System.Net.SecurityStatusPal.ErrorCode, System.Net.Security.SslStream.SslProtocol, and System.Net.Security.SslStream.ThrowIfExceptionalOrNotAuthenticated().

Referenced by System.Net.Security.SslStream.ReadAsyncInternal< TIOAdapter >().