| 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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 } | 831 } |
| 832 | 832 |
| 833 int SSLClientSocketNSS::Init() { | 833 int SSLClientSocketNSS::Init() { |
| 834 EnterFunction(""); | 834 EnterFunction(""); |
| 835 // Initialize the NSS SSL library in a threadsafe way. This also | 835 // Initialize the NSS SSL library in a threadsafe way. This also |
| 836 // initializes the NSS base library. | 836 // initializes the NSS base library. |
| 837 EnsureNSSSSLInit(); | 837 EnsureNSSSSLInit(); |
| 838 if (!NSS_IsInitialized()) | 838 if (!NSS_IsInitialized()) |
| 839 return ERR_UNEXPECTED; | 839 return ERR_UNEXPECTED; |
| 840 #if !defined(OS_MACOSX) && !defined(OS_WIN) | 840 #if !defined(OS_MACOSX) && !defined(OS_WIN) |
| 841 // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop | 841 if (ssl_config_.rev_checking_enabled) { |
| 842 // by MessageLoopForIO::current(). | 842 // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop |
| 843 // X509Certificate::Verify() runs on a worker thread of CertVerifier. | 843 // by MessageLoopForIO::current(). |
| 844 EnsureOCSPInit(); | 844 // X509Certificate::Verify() runs on a worker thread of CertVerifier. |
| 845 EnsureOCSPInit(); |
| 846 } |
| 845 #endif | 847 #endif |
| 846 | 848 |
| 847 LeaveFunction(""); | 849 LeaveFunction(""); |
| 848 return OK; | 850 return OK; |
| 849 } | 851 } |
| 850 | 852 |
| 851 int SSLClientSocketNSS::InitializeSSLOptions() { | 853 int SSLClientSocketNSS::InitializeSSLOptions() { |
| 852 // Transport connected, now hook it up to nss | 854 // Transport connected, now hook it up to nss |
| 853 // TODO(port): specify rx and tx buffer sizes separately | 855 // TODO(port): specify rx and tx buffer sizes separately |
| 854 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize); | 856 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize); |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 valid_thread_id_ = base::PlatformThread::CurrentId(); | 2445 valid_thread_id_ = base::PlatformThread::CurrentId(); |
| 2444 } | 2446 } |
| 2445 | 2447 |
| 2446 bool SSLClientSocketNSS::CalledOnValidThread() const { | 2448 bool SSLClientSocketNSS::CalledOnValidThread() const { |
| 2447 EnsureThreadIdAssigned(); | 2449 EnsureThreadIdAssigned(); |
| 2448 base::AutoLock auto_lock(lock_); | 2450 base::AutoLock auto_lock(lock_); |
| 2449 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2451 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
| 2450 } | 2452 } |
| 2451 | 2453 |
| 2452 } // namespace net | 2454 } // namespace net |
| OLD | NEW |