Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 10690122: Change SpdySession::GetSSLInfo to get the SSLInfo from the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FIx curvercp Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_nss.h ('k') | net/socket/ssl_client_socket_openssl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 // static 2743 // static
2744 void SSLClientSocket::ClearSessionCache() { 2744 void SSLClientSocket::ClearSessionCache() {
2745 // SSL_ClearSessionCache can't be called before NSS is initialized. Don't 2745 // SSL_ClearSessionCache can't be called before NSS is initialized. Don't
2746 // bother initializing NSS just to clear an empty SSL session cache. 2746 // bother initializing NSS just to clear an empty SSL session cache.
2747 if (!NSS_IsInitialized()) 2747 if (!NSS_IsInitialized())
2748 return; 2748 return;
2749 2749
2750 SSL_ClearSessionCache(); 2750 SSL_ClearSessionCache();
2751 } 2751 }
2752 2752
2753 void SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) { 2753 bool SSLClientSocketNSS::GetSSLInfo(SSLInfo* ssl_info) {
2754 EnterFunction(""); 2754 EnterFunction("");
2755 ssl_info->Reset(); 2755 ssl_info->Reset();
2756 if (core_->state().server_cert_chain.empty() || 2756 if (core_->state().server_cert_chain.empty() ||
2757 !core_->state().server_cert_chain[0]) { 2757 !core_->state().server_cert_chain[0]) {
2758 return; 2758 return false;
2759 } 2759 }
2760 2760
2761 ssl_info->cert_status = server_cert_verify_result_.cert_status; 2761 ssl_info->cert_status = server_cert_verify_result_.cert_status;
2762 ssl_info->cert = server_cert_verify_result_.verified_cert; 2762 ssl_info->cert = server_cert_verify_result_.verified_cert;
2763 ssl_info->connection_status = 2763 ssl_info->connection_status =
2764 core_->state().ssl_connection_status; 2764 core_->state().ssl_connection_status;
2765 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; 2765 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes;
2766 for (std::vector<SHA1Fingerprint>::const_iterator 2766 for (std::vector<SHA1Fingerprint>::const_iterator
2767 i = side_pinned_public_keys_.begin(); 2767 i = side_pinned_public_keys_.begin();
2768 i != side_pinned_public_keys_.end(); i++) { 2768 i != side_pinned_public_keys_.end(); i++) {
(...skipping 15 matching lines...) Expand all
2784 } else { 2784 } else {
2785 ssl_info->security_bits = -1; 2785 ssl_info->security_bits = -1;
2786 LOG(DFATAL) << "SSL_GetCipherSuiteInfo returned " << PR_GetError() 2786 LOG(DFATAL) << "SSL_GetCipherSuiteInfo returned " << PR_GetError()
2787 << " for cipherSuite " << cipher_suite; 2787 << " for cipherSuite " << cipher_suite;
2788 } 2788 }
2789 2789
2790 ssl_info->handshake_type = core_->state().resumed_handshake ? 2790 ssl_info->handshake_type = core_->state().resumed_handshake ?
2791 SSLInfo::HANDSHAKE_RESUME : SSLInfo::HANDSHAKE_FULL; 2791 SSLInfo::HANDSHAKE_RESUME : SSLInfo::HANDSHAKE_FULL;
2792 2792
2793 LeaveFunction(""); 2793 LeaveFunction("");
2794 return true;
2794 } 2795 }
2795 2796
2796 void SSLClientSocketNSS::GetSSLCertRequestInfo( 2797 void SSLClientSocketNSS::GetSSLCertRequestInfo(
2797 SSLCertRequestInfo* cert_request_info) { 2798 SSLCertRequestInfo* cert_request_info) {
2798 EnterFunction(""); 2799 EnterFunction("");
2799 // TODO(rch): switch SSLCertRequestInfo.host_and_port to a HostPortPair 2800 // TODO(rch): switch SSLCertRequestInfo.host_and_port to a HostPortPair
2800 cert_request_info->host_and_port = host_and_port_.ToString(); 2801 cert_request_info->host_and_port = host_and_port_.ToString();
2801 cert_request_info->client_certs = core_->state().client_certs; 2802 cert_request_info->client_certs = core_->state().client_certs;
2802 LeaveFunction(cert_request_info->client_certs.size()); 2803 LeaveFunction(cert_request_info->client_certs.size());
2803 } 2804 }
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
3502 EnsureThreadIdAssigned(); 3503 EnsureThreadIdAssigned();
3503 base::AutoLock auto_lock(lock_); 3504 base::AutoLock auto_lock(lock_);
3504 return valid_thread_id_ == base::PlatformThread::CurrentId(); 3505 return valid_thread_id_ == base::PlatformThread::CurrentId();
3505 } 3506 }
3506 3507
3507 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3508 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3508 return server_bound_cert_service_; 3509 return server_bound_cert_service_;
3509 } 3510 }
3510 3511
3511 } // namespace net 3512 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_nss.h ('k') | net/socket/ssl_client_socket_openssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698