From: Zonr Chang Date: Wed, 12 Oct 2016 20:16:27 +0000 (-0700) Subject: Access SSL cipher info with a const reference. X-Git-Tag: v2016.10.17.00~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cef27cd07cf570ef10f6bee27024f5335f3489eb;p=folly.git Access SSL cipher info with a const reference. Summary: BoringSSL returns `const SSL_CIPHER*` from sk_SSL_CIPHER_value(). Closes https://github.com/facebook/folly/pull/492 Reviewed By: yfeldblum Differential Revision: D4009712 Pulled By: Orvid fbshipit-source-id: cca2e8cb6aab0a459dca55b8f23ef57fa5c8251f --- diff --git a/folly/io/async/ssl/OpenSSLUtils.cpp b/folly/io/async/ssl/OpenSSLUtils.cpp index 309327ed..7d38cc3a 100644 --- a/folly/io/async/ssl/OpenSSLUtils.cpp +++ b/folly/io/async/ssl/OpenSSLUtils.cpp @@ -170,9 +170,7 @@ static std::unordered_map getOpenSSLCipherNames() { STACK_OF(SSL_CIPHER)* sk = SSL_get_ciphers(ssl); for (size_t i = 0; i < (size_t)sk_SSL_CIPHER_num(sk); i++) { - SSL_CIPHER* c; - - c = sk_SSL_CIPHER_value(sk, i); + const SSL_CIPHER* c = sk_SSL_CIPHER_value(sk, i); unsigned long id = SSL_CIPHER_get_id(c); // OpenSSL 1.0.2 and prior does weird things such as stuff the SSL/TLS // version into the top 16 bits. Let's ignore those for now. This is