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

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

Issue 1097773003: Clean up NPN/ALPN-related SSLClientSocket bits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const Created 5 years, 8 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
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 <errno.h> 10 #include <errno.h>
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 397
398 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( 398 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo(
399 SSLCertRequestInfo* cert_request_info) { 399 SSLCertRequestInfo* cert_request_info) {
400 cert_request_info->host_and_port = host_and_port_; 400 cert_request_info->host_and_port = host_and_port_;
401 cert_request_info->cert_authorities = cert_authorities_; 401 cert_request_info->cert_authorities = cert_authorities_;
402 cert_request_info->cert_key_types = cert_key_types_; 402 cert_request_info->cert_key_types = cert_key_types_;
403 } 403 }
404 404
405 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto( 405 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto(
406 std::string* proto) { 406 std::string* proto) const {
407 *proto = npn_proto_; 407 *proto = npn_proto_;
408 return npn_status_; 408 return npn_status_;
409 } 409 }
410 410
411 ChannelIDService* 411 ChannelIDService*
412 SSLClientSocketOpenSSL::GetChannelIDService() const { 412 SSLClientSocketOpenSSL::GetChannelIDService() const {
413 return channel_id_service_; 413 return channel_id_service_;
414 } 414 }
415 415
416 int SSLClientSocketOpenSSL::ExportKeyingMaterial( 416 int SSLClientSocketOpenSSL::ExportKeyingMaterial(
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 const uint8_t* alpn_proto = NULL; 932 const uint8_t* alpn_proto = NULL;
933 unsigned alpn_len = 0; 933 unsigned alpn_len = 0;
934 SSL_get0_alpn_selected(ssl_, &alpn_proto, &alpn_len); 934 SSL_get0_alpn_selected(ssl_, &alpn_proto, &alpn_len);
935 if (alpn_len > 0) { 935 if (alpn_len > 0) {
936 npn_proto_.assign(reinterpret_cast<const char*>(alpn_proto), alpn_len); 936 npn_proto_.assign(reinterpret_cast<const char*>(alpn_proto), alpn_len);
937 npn_status_ = kNextProtoNegotiated; 937 npn_status_ = kNextProtoNegotiated;
938 set_negotiation_extension(kExtensionALPN); 938 set_negotiation_extension(kExtensionALPN);
939 } 939 }
940 } 940 }
941 941
942 RecordNegotiationExtension();
942 RecordChannelIDSupport(channel_id_service_, 943 RecordChannelIDSupport(channel_id_service_,
943 channel_id_xtn_negotiated_, 944 channel_id_xtn_negotiated_,
944 ssl_config_.channel_id_enabled, 945 ssl_config_.channel_id_enabled,
945 crypto::ECPrivateKey::IsSupported()); 946 crypto::ECPrivateKey::IsSupported());
946 947
947 // Only record OCSP histograms if OCSP was requested. 948 // Only record OCSP histograms if OCSP was requested.
948 if (ssl_config_.signed_cert_timestamps_enabled || 949 if (ssl_config_.signed_cert_timestamps_enabled ||
949 IsOCSPStaplingSupported()) { 950 IsOCSPStaplingSupported()) {
950 const uint8_t* ocsp_response; 951 const uint8_t* ocsp_response;
951 size_t ocsp_response_len; 952 size_t ocsp_response_len;
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 1917
1917 return result; 1918 return result;
1918 } 1919 }
1919 1920
1920 scoped_refptr<X509Certificate> 1921 scoped_refptr<X509Certificate>
1921 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { 1922 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const {
1922 return server_cert_; 1923 return server_cert_;
1923 } 1924 }
1924 1925
1925 } // namespace net 1926 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698