OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 // X509Certificate::Verify() runs on a worker thread of CertVerifier. | 3104 // X509Certificate::Verify() runs on a worker thread of CertVerifier. |
3105 EnsureNSSHttpIOInit(); | 3105 EnsureNSSHttpIOInit(); |
3106 } | 3106 } |
3107 #endif | 3107 #endif |
3108 | 3108 |
3109 LeaveFunction(""); | 3109 LeaveFunction(""); |
3110 return OK; | 3110 return OK; |
3111 } | 3111 } |
3112 | 3112 |
3113 void SSLClientSocketNSS::InitCore() { | 3113 void SSLClientSocketNSS::InitCore() { |
3114 core_ = new Core(base::ThreadTaskRunnerHandle::Get(), | 3114 core_ = new Core(base::ThreadTaskRunnerHandle::Get().get(), |
3115 nss_task_runner_.get(), | 3115 nss_task_runner_.get(), |
3116 transport_.get(), | 3116 transport_.get(), |
3117 host_and_port_, | 3117 host_and_port_, |
3118 ssl_config_, | 3118 ssl_config_, |
3119 &net_log_, | 3119 &net_log_, |
3120 server_bound_cert_service_); | 3120 server_bound_cert_service_); |
3121 } | 3121 } |
3122 | 3122 |
3123 int SSLClientSocketNSS::InitializeSSLOptions() { | 3123 int SSLClientSocketNSS::InitializeSSLOptions() { |
3124 // Transport connected, now hook it up to nss | 3124 // Transport connected, now hook it up to nss |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3412 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED; | 3412 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED; |
3413 if (ssl_config_.verify_ev_cert) | 3413 if (ssl_config_.verify_ev_cert) |
3414 flags |= CertVerifier::VERIFY_EV_CERT; | 3414 flags |= CertVerifier::VERIFY_EV_CERT; |
3415 if (ssl_config_.cert_io_enabled) | 3415 if (ssl_config_.cert_io_enabled) |
3416 flags |= CertVerifier::VERIFY_CERT_IO_ENABLED; | 3416 flags |= CertVerifier::VERIFY_CERT_IO_ENABLED; |
3417 verifier_.reset(new SingleRequestCertVerifier(cert_verifier_)); | 3417 verifier_.reset(new SingleRequestCertVerifier(cert_verifier_)); |
3418 return verifier_->Verify( | 3418 return verifier_->Verify( |
3419 core_->state().server_cert.get(), | 3419 core_->state().server_cert.get(), |
3420 host_and_port_.host(), | 3420 host_and_port_.host(), |
3421 flags, | 3421 flags, |
3422 SSLConfigService::GetCRLSet(), | 3422 SSLConfigService::GetCRLSet().get(), |
3423 &server_cert_verify_result_, | 3423 &server_cert_verify_result_, |
3424 base::Bind(&SSLClientSocketNSS::OnHandshakeIOComplete, | 3424 base::Bind(&SSLClientSocketNSS::OnHandshakeIOComplete, |
3425 base::Unretained(this)), | 3425 base::Unretained(this)), |
3426 net_log_); | 3426 net_log_); |
3427 } | 3427 } |
3428 | 3428 |
3429 // Derived from AuthCertificateCallback() in | 3429 // Derived from AuthCertificateCallback() in |
3430 // mozilla/source/security/manager/ssl/src/nsNSSCallbacks.cpp. | 3430 // mozilla/source/security/manager/ssl/src/nsNSSCallbacks.cpp. |
3431 int SSLClientSocketNSS::DoVerifyCertComplete(int result) { | 3431 int SSLClientSocketNSS::DoVerifyCertComplete(int result) { |
3432 verifier_.reset(); | 3432 verifier_.reset(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3554 EnsureThreadIdAssigned(); | 3554 EnsureThreadIdAssigned(); |
3555 base::AutoLock auto_lock(lock_); | 3555 base::AutoLock auto_lock(lock_); |
3556 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3556 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
3557 } | 3557 } |
3558 | 3558 |
3559 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3559 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3560 return server_bound_cert_service_; | 3560 return server_bound_cert_service_; |
3561 } | 3561 } |
3562 | 3562 |
3563 } // namespace net | 3563 } // namespace net |
OLD | NEW |