未验证 提交 1724c464 编写于 作者: B Ben Adams 提交者: GitHub

Increase SslStream Frameoverhead estimation for newer TLS protocols (#51320)

上级 333a6c79
...@@ -37,7 +37,9 @@ private enum Framing ...@@ -37,7 +37,9 @@ private enum Framing
private object _handshakeLock => _sslAuthenticationOptions!; private object _handshakeLock => _sslAuthenticationOptions!;
private volatile TaskCompletionSource<bool>? _handshakeWaiter; private volatile TaskCompletionSource<bool>? _handshakeWaiter;
private const int FrameOverhead = 32; // FrameOverhead = 5 byte header + HMAC trailer + padding (if block cipher)
// HMAC: 32 bytes for SHA-256 or 20 bytes for SHA-1 or 16 bytes for the MD5
private const int FrameOverhead = 64;
private const int ReadBufferSize = 4096 * 4 + FrameOverhead; // We read in 16K chunks + headers. private const int ReadBufferSize = 4096 * 4 + FrameOverhead; // We read in 16K chunks + headers.
private const int InitialHandshakeBufferSize = 4096 + FrameOverhead; // try to fit at least 4K ServerCertificate private const int InitialHandshakeBufferSize = 4096 + FrameOverhead; // try to fit at least 4K ServerCertificate
private ArrayBuffer _handshakeBuffer; private ArrayBuffer _handshakeBuffer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册