OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 GotoState(STATE_VERIFY_CERT_COMPLETE); | 1639 GotoState(STATE_VERIFY_CERT_COMPLETE); |
1640 | 1640 |
1641 // If the certificate is expected to be bad we can use the | 1641 // If the certificate is expected to be bad we can use the |
1642 // expectation as the cert status. Don't use |server_cert_| here | 1642 // expectation as the cert status. Don't use |server_cert_| here |
1643 // because it can be set to NULL in case we failed to create | 1643 // because it can be set to NULL in case we failed to create |
1644 // X509Certificate in UpdateServerCert(). This may happen when this | 1644 // X509Certificate in UpdateServerCert(). This may happen when this |
1645 // code is used inside sandbox. | 1645 // code is used inside sandbox. |
1646 base::StringPiece der_cert( | 1646 base::StringPiece der_cert( |
1647 reinterpret_cast<char*>(server_cert_nss_->derCert.data), | 1647 reinterpret_cast<char*>(server_cert_nss_->derCert.data), |
1648 server_cert_nss_->derCert.len); | 1648 server_cert_nss_->derCert.len); |
1649 int cert_status; | 1649 CertStatus cert_status; |
1650 if (ssl_config_.IsAllowedBadCert(der_cert, &cert_status)) { | 1650 if (ssl_config_.IsAllowedBadCert(der_cert, &cert_status)) { |
1651 DCHECK(start_cert_verification_time_.is_null()); | 1651 DCHECK(start_cert_verification_time_.is_null()); |
1652 VLOG(1) << "Received an expected bad cert with status: " << cert_status; | 1652 VLOG(1) << "Received an expected bad cert with status: " << cert_status; |
1653 server_cert_verify_result_ = &local_server_cert_verify_result_; | 1653 server_cert_verify_result_ = &local_server_cert_verify_result_; |
1654 local_server_cert_verify_result_.Reset(); | 1654 local_server_cert_verify_result_.Reset(); |
1655 local_server_cert_verify_result_.cert_status = cert_status; | 1655 local_server_cert_verify_result_.cert_status = cert_status; |
1656 local_server_cert_verify_result_.verified_cert = server_cert_; | 1656 local_server_cert_verify_result_.verified_cert = server_cert_; |
1657 return OK; | 1657 return OK; |
1658 } | 1658 } |
1659 | 1659 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 valid_thread_id_ = base::PlatformThread::CurrentId(); | 2441 valid_thread_id_ = base::PlatformThread::CurrentId(); |
2442 } | 2442 } |
2443 | 2443 |
2444 bool SSLClientSocketNSS::CalledOnValidThread() const { | 2444 bool SSLClientSocketNSS::CalledOnValidThread() const { |
2445 EnsureThreadIdAssigned(); | 2445 EnsureThreadIdAssigned(); |
2446 base::AutoLock auto_lock(lock_); | 2446 base::AutoLock auto_lock(lock_); |
2447 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2447 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
2448 } | 2448 } |
2449 | 2449 |
2450 } // namespace net | 2450 } // namespace net |
OLD | NEW |