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

Side by Side Diff: net/socket/ssl_client_socket_openssl.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_openssl.h ('k') | net/socket/ssl_client_socket_pool_unittest.cc » ('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 // OpenSSL binding for SSLClientSocket. The class layout and general principle 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle
6 // of operation is derived from SSLClientSocketNSS. 6 // of operation is derived from SSLClientSocketNSS.
7 7
8 #include "net/socket/ssl_client_socket_openssl.h" 8 #include "net/socket/ssl_client_socket_openssl.h"
9 9
10 #include <openssl/ssl.h> 10 #include <openssl/ssl.h>
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 } 584 }
585 LOG(WARNING) << "Client cert found without private key"; 585 LOG(WARNING) << "Client cert found without private key";
586 } 586 }
587 587
588 // Send no client certificate. 588 // Send no client certificate.
589 return 0; 589 return 0;
590 } 590 }
591 591
592 // SSLClientSocket methods 592 // SSLClientSocket methods
593 593
594 void SSLClientSocketOpenSSL::GetSSLInfo(SSLInfo* ssl_info) { 594 bool SSLClientSocketOpenSSL::GetSSLInfo(SSLInfo* ssl_info) {
595 ssl_info->Reset(); 595 ssl_info->Reset();
596 if (!server_cert_) 596 if (!server_cert_)
597 return; 597 return false;
598 598
599 ssl_info->cert = server_cert_verify_result_.verified_cert; 599 ssl_info->cert = server_cert_verify_result_.verified_cert;
600 ssl_info->cert_status = server_cert_verify_result_.cert_status; 600 ssl_info->cert_status = server_cert_verify_result_.cert_status;
601 ssl_info->is_issued_by_known_root = 601 ssl_info->is_issued_by_known_root =
602 server_cert_verify_result_.is_issued_by_known_root; 602 server_cert_verify_result_.is_issued_by_known_root;
603 ssl_info->public_key_hashes = 603 ssl_info->public_key_hashes =
604 server_cert_verify_result_.public_key_hashes; 604 server_cert_verify_result_.public_key_hashes;
605 ssl_info->client_cert_sent = 605 ssl_info->client_cert_sent =
606 ssl_config_.send_client_cert && ssl_config_.client_cert; 606 ssl_config_.send_client_cert && ssl_config_.client_cert;
607 ssl_info->channel_id_sent = WasChannelIDSent(); 607 ssl_info->channel_id_sent = WasChannelIDSent();
(...skipping 16 matching lines...) Expand all
624 624
625 if (ssl_config_.version_fallback) 625 if (ssl_config_.version_fallback)
626 ssl_info->connection_status |= SSL_CONNECTION_VERSION_FALLBACK; 626 ssl_info->connection_status |= SSL_CONNECTION_VERSION_FALLBACK;
627 627
628 DVLOG(3) << "Encoded connection status: cipher suite = " 628 DVLOG(3) << "Encoded connection status: cipher suite = "
629 << SSLConnectionStatusToCipherSuite(ssl_info->connection_status) 629 << SSLConnectionStatusToCipherSuite(ssl_info->connection_status)
630 << " compression = " 630 << " compression = "
631 << SSLConnectionStatusToCompression(ssl_info->connection_status) 631 << SSLConnectionStatusToCompression(ssl_info->connection_status)
632 << " version = " 632 << " version = "
633 << SSLConnectionStatusToVersion(ssl_info->connection_status); 633 << SSLConnectionStatusToVersion(ssl_info->connection_status);
634 return true;
634 } 635 }
635 636
636 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( 637 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo(
637 SSLCertRequestInfo* cert_request_info) { 638 SSLCertRequestInfo* cert_request_info) {
638 cert_request_info->host_and_port = host_and_port_.ToString(); 639 cert_request_info->host_and_port = host_and_port_.ToString();
639 cert_request_info->client_certs = client_certs_; 640 cert_request_info->client_certs = client_certs_;
640 } 641 }
641 642
642 int SSLClientSocketOpenSSL::ExportKeyingMaterial( 643 int SSLClientSocketOpenSSL::ExportKeyingMaterial(
643 const base::StringPiece& label, 644 const base::StringPiece& label,
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, 1317 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv,
1317 user_write_buf_->data()); 1318 user_write_buf_->data());
1318 return rv; 1319 return rv;
1319 } 1320 }
1320 1321
1321 int err = SSL_get_error(ssl_, rv); 1322 int err = SSL_get_error(ssl_, rv);
1322 return MapOpenSSLError(err, err_tracer); 1323 return MapOpenSSLError(err, err_tracer);
1323 } 1324 }
1324 1325
1325 } // namespace net 1326 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_openssl.h ('k') | net/socket/ssl_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698