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

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

Issue 590513002: Add histogram to track NPN/ALPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shorten enum descriptions. Created 6 years, 2 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
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_pool.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 <errno.h> 10 #include <errno.h>
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 } 908 }
909 909
910 // SSL handshake is completed. If NPN wasn't negotiated, see if ALPN was. 910 // SSL handshake is completed. If NPN wasn't negotiated, see if ALPN was.
911 if (npn_status_ == kNextProtoUnsupported) { 911 if (npn_status_ == kNextProtoUnsupported) {
912 const uint8_t* alpn_proto = NULL; 912 const uint8_t* alpn_proto = NULL;
913 unsigned alpn_len = 0; 913 unsigned alpn_len = 0;
914 SSL_get0_alpn_selected(ssl_, &alpn_proto, &alpn_len); 914 SSL_get0_alpn_selected(ssl_, &alpn_proto, &alpn_len);
915 if (alpn_len > 0) { 915 if (alpn_len > 0) {
916 npn_proto_.assign(reinterpret_cast<const char*>(alpn_proto), alpn_len); 916 npn_proto_.assign(reinterpret_cast<const char*>(alpn_proto), alpn_len);
917 npn_status_ = kNextProtoNegotiated; 917 npn_status_ = kNextProtoNegotiated;
918 set_negotiation_extension(kExtensionALPN);
918 } 919 }
919 } 920 }
920 921
921 RecordChannelIDSupport(channel_id_service_, 922 RecordChannelIDSupport(channel_id_service_,
922 channel_id_xtn_negotiated_, 923 channel_id_xtn_negotiated_,
923 ssl_config_.channel_id_enabled, 924 ssl_config_.channel_id_enabled,
924 crypto::ECPrivateKey::IsSupported()); 925 crypto::ECPrivateKey::IsSupported());
925 926
926 uint8_t* ocsp_response; 927 uint8_t* ocsp_response;
927 size_t ocsp_response_len; 928 size_t ocsp_response_len;
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 1663
1663 // If we didn't find a protocol, we select the first one from our list. 1664 // If we didn't find a protocol, we select the first one from our list.
1664 if (npn_status_ == kNextProtoNoOverlap) { 1665 if (npn_status_ == kNextProtoNoOverlap) {
1665 *out = reinterpret_cast<uint8*>(const_cast<char*>( 1666 *out = reinterpret_cast<uint8*>(const_cast<char*>(
1666 ssl_config_.next_protos[0].data())); 1667 ssl_config_.next_protos[0].data()));
1667 *outlen = ssl_config_.next_protos[0].size(); 1668 *outlen = ssl_config_.next_protos[0].size();
1668 } 1669 }
1669 1670
1670 npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen); 1671 npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen);
1671 DVLOG(2) << "next protocol: '" << npn_proto_ << "' status: " << npn_status_; 1672 DVLOG(2) << "next protocol: '" << npn_proto_ << "' status: " << npn_status_;
1673 set_negotiation_extension(kExtensionNPN);
1672 return SSL_TLSEXT_ERR_OK; 1674 return SSL_TLSEXT_ERR_OK;
1673 } 1675 }
1674 1676
1675 long SSLClientSocketOpenSSL::MaybeReplayTransportError( 1677 long SSLClientSocketOpenSSL::MaybeReplayTransportError(
1676 BIO *bio, 1678 BIO *bio,
1677 int cmd, 1679 int cmd,
1678 const char *argp, int argi, long argl, 1680 const char *argp, int argi, long argl,
1679 long retvalue) { 1681 long retvalue) {
1680 if (cmd == (BIO_CB_READ|BIO_CB_RETURN) && retvalue <= 0) { 1682 if (cmd == (BIO_CB_READ|BIO_CB_RETURN) && retvalue <= 0) {
1681 // If there is no more data in the buffer, report any pending errors that 1683 // If there is no more data in the buffer, report any pending errors that
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 ct::SCT_STATUS_LOG_UNKNOWN)); 1766 ct::SCT_STATUS_LOG_UNKNOWN));
1765 } 1767 }
1766 } 1768 }
1767 1769
1768 scoped_refptr<X509Certificate> 1770 scoped_refptr<X509Certificate>
1769 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { 1771 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const {
1770 return server_cert_; 1772 return server_cert_;
1771 } 1773 }
1772 1774
1773 } // namespace net 1775 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698