Index: net/socket/ssl_client_socket_nss.cc |
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc |
index 7366c166fb788ead37d83937a4121f82bfa02c47..bd132208dd229e286ee685fd4f4def68f5f78f0d 100644 |
--- a/net/socket/ssl_client_socket_nss.cc |
+++ b/net/socket/ssl_client_socket_nss.cc |
@@ -94,7 +94,7 @@ |
#include "net/cert/asn1_util.h" |
#include "net/cert/cert_status_flags.h" |
#include "net/cert/cert_verifier.h" |
-#include "net/cert/ct_objects_extractor.h" |
+#include "net/cert/ct_ev_whitelist.h" |
#include "net/cert/ct_verifier.h" |
#include "net/cert/ct_verify_result.h" |
#include "net/cert/scoped_nss_types.h" |
@@ -3488,6 +3488,21 @@ int SSLClientSocketNSS::DoVerifyCertComplete(int result) { |
result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN; |
} |
+ scoped_refptr<ct::EVCertsWhitelist> ev_whitelist = |
+ SSLConfigService::GetEVCertsWhitelist(); |
+ if (server_cert_verify_result_.cert_status & CERT_STATUS_IS_EV) { |
+ if (ev_whitelist.get() && ev_whitelist->IsValid()) { |
+ const SHA256HashValue fingerprint( |
+ X509Certificate::CalculateFingerprint256( |
+ server_cert_verify_result_.verified_cert->os_cert_handle())); |
+ |
+ UMA_HISTOGRAM_BOOLEAN( |
+ "Net.SSL_EVCertificateInWhitelist", |
+ ev_whitelist->ContainsCertificateHash( |
+ std::string(reinterpret_cast<const char*>(fingerprint.data), 8))); |
+ } |
+ } |
+ |
if (result == OK) { |
// Only check Certificate Transparency if there were no other errors with |
// the connection. |