Index: net/ssl/ssl_cipher_suite_names.cc |
diff --git a/net/ssl/ssl_cipher_suite_names.cc b/net/ssl/ssl_cipher_suite_names.cc |
index 271ccdfd90f7d6ef6116e99a625556d5f9fe94fd..0b21edb521778994056e70e9ddf83db3913c0627 100644 |
--- a/net/ssl/ssl_cipher_suite_names.cc |
+++ b/net/ssl/ssl_cipher_suite_names.cc |
@@ -4,6 +4,9 @@ |
#include "net/ssl/ssl_cipher_suite_names.h" |
+#if defined(USE_OPENSSL) |
+#include <openssl/ssl.h> |
+#endif |
#include <stdlib.h> |
#include "base/logging.h" |
@@ -419,4 +422,22 @@ bool IsFalseStartableTLSCipherSuite(uint16 cipher_suite) { |
return true; |
} |
+const char* ECCurveName(uint16 cipher_suite, int key_exchange_info) { |
+#if defined(USE_OPENSSL) |
+ int key_exchange, cipher, mac; |
+ if (!GetCipherProperties(cipher_suite, &key_exchange, &cipher, &mac)) |
+ return nullptr; |
+ switch (key_exchange) { |
+ case 14: // ECDHE_ECDSA |
+ case 16: // ECDHE_RSA |
+ break; |
+ default: |
+ return nullptr; |
+ } |
+ return SSL_get_curve_name(key_exchange_info); |
+#else |
+ return nullptr; |
+#endif |
+} |
+ |
} // namespace net |