| 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 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 return verifier_->Verify(server_cert_, host_and_port_.host(), flags, | 2323 return verifier_->Verify(server_cert_, host_and_port_.host(), flags, |
| 2324 &local_server_cert_verify_result_, | 2324 &local_server_cert_verify_result_, |
| 2325 &handshake_io_callback_); | 2325 &handshake_io_callback_); |
| 2326 } | 2326 } |
| 2327 | 2327 |
| 2328 // Derived from AuthCertificateCallback() in | 2328 // Derived from AuthCertificateCallback() in |
| 2329 // mozilla/source/security/manager/ssl/src/nsNSSCallbacks.cpp. | 2329 // mozilla/source/security/manager/ssl/src/nsNSSCallbacks.cpp. |
| 2330 int SSLClientSocketNSS::DoVerifyCertComplete(int result) { | 2330 int SSLClientSocketNSS::DoVerifyCertComplete(int result) { |
| 2331 verifier_.reset(); | 2331 verifier_.reset(); |
| 2332 | 2332 |
| 2333 | |
| 2334 if (!start_cert_verification_time_.is_null()) { | 2333 if (!start_cert_verification_time_.is_null()) { |
| 2335 base::TimeDelta verify_time = | 2334 base::TimeDelta verify_time = |
| 2336 base::TimeTicks::Now() - start_cert_verification_time_; | 2335 base::TimeTicks::Now() - start_cert_verification_time_; |
| 2337 if (result == OK) | 2336 if (result == OK) |
| 2338 UMA_HISTOGRAM_TIMES("Net.SSLCertVerificationTime", verify_time); | 2337 UMA_HISTOGRAM_TIMES("Net.SSLCertVerificationTime", verify_time); |
| 2339 else | 2338 else |
| 2340 UMA_HISTOGRAM_TIMES("Net.SSLCertVerificationTimeError", verify_time); | 2339 UMA_HISTOGRAM_TIMES("Net.SSLCertVerificationTimeError", verify_time); |
| 2341 } | 2340 } |
| 2342 | 2341 |
| 2342 if (ssl_host_info_.get()) |
| 2343 ssl_host_info_->set_cert_verification_finished_time(); |
| 2344 |
| 2343 // We used to remember the intermediate CA certs in the NSS database | 2345 // We used to remember the intermediate CA certs in the NSS database |
| 2344 // persistently. However, NSS opens a connection to the SQLite database | 2346 // persistently. However, NSS opens a connection to the SQLite database |
| 2345 // during NSS initialization and doesn't close the connection until NSS | 2347 // during NSS initialization and doesn't close the connection until NSS |
| 2346 // shuts down. If the file system where the database resides is gone, | 2348 // shuts down. If the file system where the database resides is gone, |
| 2347 // the database connection goes bad. What's worse, the connection won't | 2349 // the database connection goes bad. What's worse, the connection won't |
| 2348 // recover when the file system comes back. Until this NSS or SQLite bug | 2350 // recover when the file system comes back. Until this NSS or SQLite bug |
| 2349 // is fixed, we need to avoid using the NSS database for non-essential | 2351 // is fixed, we need to avoid using the NSS database for non-essential |
| 2350 // purposes. See https://bugzilla.mozilla.org/show_bug.cgi?id=508081 and | 2352 // purposes. See https://bugzilla.mozilla.org/show_bug.cgi?id=508081 and |
| 2351 // http://crbug.com/15630 for more info. | 2353 // http://crbug.com/15630 for more info. |
| 2352 | 2354 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2483 case SSL_CONNECTION_VERSION_TLS1_1: | 2485 case SSL_CONNECTION_VERSION_TLS1_1: |
| 2484 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); | 2486 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); |
| 2485 break; | 2487 break; |
| 2486 case SSL_CONNECTION_VERSION_TLS1_2: | 2488 case SSL_CONNECTION_VERSION_TLS1_2: |
| 2487 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); | 2489 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); |
| 2488 break; | 2490 break; |
| 2489 }; | 2491 }; |
| 2490 } | 2492 } |
| 2491 | 2493 |
| 2492 } // namespace net | 2494 } // namespace net |
| OLD | NEW |