Commit 930cf162 authored by Kyle Nekritz's avatar Kyle Nekritz Committed by Facebook Github Bot 0

Fix extension length counter in client hello parsing.

Summary: Orvid noticed this was always throwing on a properly formated client hello, since the sig algs extension length isn't subtracted from the counter. This doesn't actually affect any behavior (except possibly a slight perf hit), but is pretty clowny.

Reviewed By: anirudhvr

Differential Revision: D3722887

fbshipit-source-id: 579993caac96da24fb567ab977b09fca519750a0
parent 6a287baa
......@@ -1651,6 +1651,7 @@ void AsyncSSLSocket::clientHelloParsingCallback(int written,
extensionsLength -= 2;
uint16_t extensionDataLength = cursor.readBE<uint16_t>();
extensionsLength -= 2;
extensionsLength -= extensionDataLength;
if (extensionType == ssl::TLSExtension::SIGNATURE_ALGORITHMS) {
cursor.skip(2);
......@@ -1666,7 +1667,6 @@ void AsyncSSLSocket::clientHelloParsingCallback(int written,
}
} else {
cursor.skip(extensionDataLength);
extensionsLength -= extensionDataLength;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment