From: Kyle Nekritz Date: Tue, 16 Aug 2016 16:53:26 +0000 (-0700) Subject: Fix extension length counter in client hello parsing. X-Git-Tag: v2016.08.22.00~31 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=930cf1629bae8e6e2619d101f4a576aad2488e68;p=folly.git 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 --- diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp index b398e31c..721fb295 100644 --- a/folly/io/async/AsyncSSLSocket.cpp +++ b/folly/io/async/AsyncSSLSocket.cpp @@ -1651,6 +1651,7 @@ void AsyncSSLSocket::clientHelloParsingCallback(int written, extensionsLength -= 2; uint16_t extensionDataLength = cursor.readBE(); 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; } } }