AsyncSSLSocket::getSSLClientCiphers using static map
authorAnirudh Ramachandran <avr@fb.com>
Mon, 26 Sep 2016 20:14:55 +0000 (13:14 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Mon, 26 Sep 2016 20:23:36 +0000 (13:23 -0700)
commit67dac89cc0d3f35c4646537ec8f01a22b20e253d
treed783ea64878e224f222e2bf9945eb116cb194cd0
parent8bed062637f2af0e85fb5fd4365476e28e18d078
AsyncSSLSocket::getSSLClientCiphers using static map

Summary:
OpenSSL SSL_METHOD->get_cipher_by_char is not present in either OpenSSL
1.1.0 or BoringSSL. In addition, knekritz reports that time's being spent in
binary searching for cipher names.

Since the ciphercodes and names are (fairly) static, we store these in a static
hash map.

Reviewed By: siyengar

Differential Revision: D3275185

fbshipit-source-id: 08b36f3e73239b415b74c6ecc30ed65832d9ebd0
folly/io/async/AsyncSSLSocket.cpp
folly/io/async/AsyncSSLSocket.h
folly/io/async/ssl/OpenSSLUtils.cpp
folly/io/async/ssl/OpenSSLUtils.h
folly/io/async/ssl/TLSDefinitions.h
folly/io/async/test/AsyncSSLSocketTest.cpp