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 | 485 // SSL_ClearSessionCache can't be called before NSS is initialized. Don't |
486 // initializes the NSS base library. | 486 // bother initializing NSS just to clear an empty SSL session cache. |
487 EnsureNSSSSLInit(); | |
488 if (!NSS_IsInitialized()) | 487 if (!NSS_IsInitialized()) |
489 return; | 488 return; |
490 | 489 |
491 SSL_ClearSessionCache(); | 490 SSL_ClearSessionCache(); |
492 } | 491 } |
493 | 492 |
494 void SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) { | 493 void SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) { |
495 EnterFunction(""); | 494 EnterFunction(""); |
496 ssl_info->Reset(); | 495 ssl_info->Reset(); |
497 if (!server_cert_nss_) | 496 if (!server_cert_nss_) |
(...skipping 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 valid_thread_id_ = base::PlatformThread::CurrentId(); | 2753 valid_thread_id_ = base::PlatformThread::CurrentId(); |
2755 } | 2754 } |
2756 | 2755 |
2757 bool SSLClientSocketNSS::CalledOnValidThread() const { | 2756 bool SSLClientSocketNSS::CalledOnValidThread() const { |
2758 EnsureThreadIdAssigned(); | 2757 EnsureThreadIdAssigned(); |
2759 base::AutoLock auto_lock(lock_); | 2758 base::AutoLock auto_lock(lock_); |
2760 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2759 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
2761 } | 2760 } |
2762 | 2761 |
2763 } // namespace net | 2762 } // namespace net |
OLD | NEW |