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

Unified Diff: net/socket/ssl_client_socket_pool.cc

Issue 1312363004: Add histogram for key exchange strength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 5 years, 4 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_pool.cc
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index a80df57d0be4a8d084e62c5d09f1040ee458c962..d06d96d9d54394d619d27a3e245179ee43f86c15 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -21,6 +21,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/socket/transport_client_socket_pool.h"
#include "net/ssl/ssl_cert_request_info.h"
+#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "net/ssl/ssl_info.h"
@@ -371,9 +372,29 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
ssl_info.connection_status),
SSL_CONNECTION_VERSION_MAX);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite",
- SSLConnectionStatusToCipherSuite(
- ssl_info.connection_status));
+ uint16 cipher_suite =
+ SSLConnectionStatusToCipherSuite(ssl_info.connection_status);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite", cipher_suite);
+
+ const char *str, *cipher_str, *mac_str;
+ bool is_aead;
+ SSLCipherSuiteToStrings(&str, &cipher_str, &mac_str, &is_aead,
+ cipher_suite);
+ // UMA_HISTOGRAM_... macros cache the Histogram instance and thus only work
+ // if the histogram name is constant, so don't generate it dynamically.
+ if (strncmp(str, "RSA", 3) == 0) {
davidben 2015/09/15 14:35:35 I think you an exact match (strcmp) here.
sigbjorn 2015/09/15 15:35:05 Right now all comparisons use strncmp against the
davidben 2015/09/15 15:41:54 We do not support RSA_EXPORT and I can quite confi
sigbjorn 2015/09/15 16:30:25 Done.
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.RSA",
+ ssl_info.key_exchange_info);
+ } else if (strncmp(str, "DHE", 3) == 0) {
davidben 2015/09/15 14:35:35 Nit: I'd do DHE_ and ECDHE_ to make sure you get t
sigbjorn 2015/09/15 16:30:25 Done.
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.DHE",
+ ssl_info.key_exchange_info);
+ } else if (strncmp(str, "ECDHE", 5) == 0) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.ECDHE",
+ ssl_info.key_exchange_info);
+ } else {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.Unknown",
+ ssl_info.key_exchange_info);
+ }
if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) {
UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake",
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698