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

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

Issue 8787011: Log server advertised protos and the selected (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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
OLDNEW
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 // 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 cert_request_info->client_certs = client_certs_; 598 cert_request_info->client_certs = client_certs_;
599 } 599 }
600 600
601 int SSLClientSocketOpenSSL::ExportKeyingMaterial( 601 int SSLClientSocketOpenSSL::ExportKeyingMaterial(
602 const base::StringPiece& label, const base::StringPiece& context, 602 const base::StringPiece& label, const base::StringPiece& context,
603 unsigned char *out, unsigned int outlen) { 603 unsigned char *out, unsigned int outlen) {
604 return ERR_NOT_IMPLEMENTED; 604 return ERR_NOT_IMPLEMENTED;
605 } 605 }
606 606
607 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto( 607 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto(
608 std::string* proto) { 608 std::string* proto, std::string* server_proto) {
609 *proto = npn_proto_; 609 *proto = npn_proto_;
610 *server_proto = protos_;
610 return npn_status_; 611 return npn_status_;
611 } 612 }
612 613
613 void SSLClientSocketOpenSSL::DoReadCallback(int rv) { 614 void SSLClientSocketOpenSSL::DoReadCallback(int rv) {
614 // Since Run may result in Read being called, clear |user_read_callback_| 615 // Since Run may result in Read being called, clear |user_read_callback_|
615 // up front. 616 // up front.
616 OldCompletionCallback* c = user_read_callback_; 617 OldCompletionCallback* c = user_read_callback_;
617 user_read_callback_ = NULL; 618 user_read_callback_ = NULL;
618 user_read_buf_ = NULL; 619 user_read_buf_ = NULL;
619 user_read_buf_len_ = 0; 620 user_read_buf_len_ = 0;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 *outlen = in[i]; 820 *outlen = in[i];
820 status = OPENSSL_NPN_NEGOTIATED; 821 status = OPENSSL_NPN_NEGOTIATED;
821 break; 822 break;
822 } 823 }
823 } 824 }
824 if (status == OPENSSL_NPN_NEGOTIATED) 825 if (status == OPENSSL_NPN_NEGOTIATED)
825 break; 826 break;
826 } 827 }
827 828
828 npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen); 829 npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen);
830 protos_.assign(reinterpret_cast<const char*>(in), inlen);
829 switch (status) { 831 switch (status) {
830 case OPENSSL_NPN_NEGOTIATED: 832 case OPENSSL_NPN_NEGOTIATED:
831 npn_status_ = SSLClientSocket::kNextProtoNegotiated; 833 npn_status_ = SSLClientSocket::kNextProtoNegotiated;
832 break; 834 break;
833 case OPENSSL_NPN_NO_OVERLAP: 835 case OPENSSL_NPN_NO_OVERLAP:
834 npn_status_ = SSLClientSocket::kNextProtoNoOverlap; 836 npn_status_ = SSLClientSocket::kNextProtoNoOverlap;
835 break; 837 break;
836 default: 838 default:
837 NOTREACHED() << status; 839 NOTREACHED() << status;
838 break; 840 break;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, 1247 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv,
1246 user_write_buf_->data()); 1248 user_write_buf_->data());
1247 return rv; 1249 return rv;
1248 } 1250 }
1249 1251
1250 int err = SSL_get_error(ssl_, rv); 1252 int err = SSL_get_error(ssl_, rv);
1251 return MapOpenSSLError(err, err_tracer); 1253 return MapOpenSSLError(err, err_tracer);
1252 } 1254 }
1253 1255
1254 } // namespace net 1256 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698