From cef27cd07cf570ef10f6bee27024f5335f3489eb Mon Sep 17 00:00:00 2001
From: Zonr Chang <zonr.net@gmail.com>
Date: Wed, 12 Oct 2016 13:16:27 -0700
Subject: [PATCH] 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
---
 folly/io/async/ssl/OpenSSLUtils.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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<uint16_t, std::string> 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
-- 
2.34.1