Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: net/ssl/ssl_cipher_suite_names.cc

Issue 1313363003: Expose OpenSSL's key_exchange_info in the content API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Proper #ifdef fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.h ('k') | net/ssl/ssl_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.h ('k') | net/ssl/ssl_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698