From 930cf1629bae8e6e2619d101f4a576aad2488e68 Mon Sep 17 00:00:00 2001 From: Kyle Nekritz Date: Tue, 16 Aug 2016 09:53:26 -0700 Subject: [PATCH] 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 --- folly/io/async/AsyncSSLSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } } -- 2.34.1