| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 SSLClientSocketNSS::~SSLClientSocketNSS() { | 477 SSLClientSocketNSS::~SSLClientSocketNSS() { |
| 478 EnterFunction(""); | 478 EnterFunction(""); |
| 479 Disconnect(); | 479 Disconnect(); |
| 480 LeaveFunction(""); | 480 LeaveFunction(""); |
| 481 } | 481 } |
| 482 | 482 |
| 483 // static | 483 // static |
| 484 void SSLClientSocketNSS::ClearSessionCache() { | 484 void SSLClientSocketNSS::ClearSessionCache() { |
| 485 // Initialize the NSS SSL library in a threadsafe way. This also |
| 486 // initializes the NSS base library. |
| 487 EnsureNSSSSLInit(); |
| 488 if (!NSS_IsInitialized()) |
| 489 return; |
| 490 |
| 485 SSL_ClearSessionCache(); | 491 SSL_ClearSessionCache(); |
| 486 } | 492 } |
| 487 | 493 |
| 488 void SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) { | 494 void SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) { |
| 489 EnterFunction(""); | 495 EnterFunction(""); |
| 490 ssl_info->Reset(); | 496 ssl_info->Reset(); |
| 491 if (!server_cert_nss_) | 497 if (!server_cert_nss_) |
| 492 return; | 498 return; |
| 493 | 499 |
| 494 ssl_info->cert_status = server_cert_verify_result_->cert_status; | 500 ssl_info->cert_status = server_cert_verify_result_->cert_status; |
| (...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 valid_thread_id_ = base::PlatformThread::CurrentId(); | 2624 valid_thread_id_ = base::PlatformThread::CurrentId(); |
| 2619 } | 2625 } |
| 2620 | 2626 |
| 2621 bool SSLClientSocketNSS::CalledOnValidThread() const { | 2627 bool SSLClientSocketNSS::CalledOnValidThread() const { |
| 2622 EnsureThreadIdAssigned(); | 2628 EnsureThreadIdAssigned(); |
| 2623 base::AutoLock auto_lock(lock_); | 2629 base::AutoLock auto_lock(lock_); |
| 2624 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2630 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
| 2625 } | 2631 } |
| 2626 | 2632 |
| 2627 } // namespace net | 2633 } // namespace net |
| OLD | NEW |