OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 start_cert_verification_time_ = base::TimeTicks::Now(); | 2441 start_cert_verification_time_ = base::TimeTicks::Now(); |
2442 | 2442 |
2443 if (ssl_host_info_.get() && !ssl_host_info_->state().certs.empty() && | 2443 if (ssl_host_info_.get() && !ssl_host_info_->state().certs.empty() && |
2444 predicted_cert_chain_correct_) { | 2444 predicted_cert_chain_correct_) { |
2445 // If the SSLHostInfo had a prediction for the certificate chain of this | 2445 // If the SSLHostInfo had a prediction for the certificate chain of this |
2446 // server then it will have optimistically started a verification of that | 2446 // server then it will have optimistically started a verification of that |
2447 // chain. So, if the prediction was correct, we should wait for that | 2447 // chain. So, if the prediction was correct, we should wait for that |
2448 // verification to finish rather than start our own. | 2448 // verification to finish rather than start our own. |
2449 net_log_.AddEvent(NetLog::TYPE_SSL_VERIFICATION_MERGED, NULL); | 2449 net_log_.AddEvent(NetLog::TYPE_SSL_VERIFICATION_MERGED, NULL); |
2450 UMA_HISTOGRAM_ENUMERATION("Net.SSLVerificationMerged", 1 /* true */, 2); | 2450 UMA_HISTOGRAM_ENUMERATION("Net.SSLVerificationMerged", 1 /* true */, 2); |
2451 base::TimeTicks now = base::TimeTicks::Now(); | 2451 base::TimeTicks end_time = ssl_host_info_->verification_end_time(); |
| 2452 if (end_time.is_null()) |
| 2453 end_time = base::TimeTicks::Now(); |
2452 UMA_HISTOGRAM_TIMES("Net.SSLVerificationMergedMsSaved", | 2454 UMA_HISTOGRAM_TIMES("Net.SSLVerificationMergedMsSaved", |
2453 now - ssl_host_info_->verification_start_time()); | 2455 end_time - ssl_host_info_->verification_start_time()); |
2454 server_cert_verify_result_ = &ssl_host_info_->cert_verify_result(); | 2456 server_cert_verify_result_ = &ssl_host_info_->cert_verify_result(); |
2455 return ssl_host_info_->WaitForCertVerification(&handshake_io_callback_); | 2457 return ssl_host_info_->WaitForCertVerification(&handshake_io_callback_); |
2456 } else { | 2458 } else { |
2457 UMA_HISTOGRAM_ENUMERATION("Net.SSLVerificationMerged", 0 /* false */, 2); | 2459 UMA_HISTOGRAM_ENUMERATION("Net.SSLVerificationMerged", 0 /* false */, 2); |
2458 } | 2460 } |
2459 | 2461 |
2460 int flags = 0; | 2462 int flags = 0; |
2461 if (ssl_config_.rev_checking_enabled) | 2463 if (ssl_config_.rev_checking_enabled) |
2462 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED; | 2464 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED; |
2463 if (ssl_config_.verify_ev_cert) | 2465 if (ssl_config_.verify_ev_cert) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 case SSL_CONNECTION_VERSION_TLS1_1: | 2628 case SSL_CONNECTION_VERSION_TLS1_1: |
2627 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); | 2629 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); |
2628 break; | 2630 break; |
2629 case SSL_CONNECTION_VERSION_TLS1_2: | 2631 case SSL_CONNECTION_VERSION_TLS1_2: |
2630 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); | 2632 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); |
2631 break; | 2633 break; |
2632 }; | 2634 }; |
2633 } | 2635 } |
2634 | 2636 |
2635 } // namespace net | 2637 } // namespace net |
OLD | NEW |