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

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

Issue 9663043: Add a boolean |had_context| argument to the TLS ExportKeyingMaterial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 void SSLClientSocketNSS::GetSSLCertRequestInfo( 532 void SSLClientSocketNSS::GetSSLCertRequestInfo(
533 SSLCertRequestInfo* cert_request_info) { 533 SSLCertRequestInfo* cert_request_info) {
534 EnterFunction(""); 534 EnterFunction("");
535 // TODO(rch): switch SSLCertRequestInfo.host_and_port to a HostPortPair 535 // TODO(rch): switch SSLCertRequestInfo.host_and_port to a HostPortPair
536 cert_request_info->host_and_port = host_and_port_.ToString(); 536 cert_request_info->host_and_port = host_and_port_.ToString();
537 cert_request_info->client_certs = client_certs_; 537 cert_request_info->client_certs = client_certs_;
538 LeaveFunction(cert_request_info->client_certs.size()); 538 LeaveFunction(cert_request_info->client_certs.size());
539 } 539 }
540 540
541 int SSLClientSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, 541 int SSLClientSocketNSS::ExportKeyingMaterial(const base::StringPiece& label,
542 bool has_context,
542 const base::StringPiece& context, 543 const base::StringPiece& context,
543 unsigned char *out, 544 unsigned char *out,
Ryan Sleevi 2012/03/10 04:23:31 nit: "unsigned char *" -> "unsigned char* "
544 unsigned int outlen) { 545 unsigned int outlen) {
545 if (!IsConnected()) 546 if (!IsConnected())
546 return ERR_SOCKET_NOT_CONNECTED; 547 return ERR_SOCKET_NOT_CONNECTED;
547 SECStatus result = SSL_ExportKeyingMaterial( 548 SECStatus result = SSL_ExportKeyingMaterial(
548 nss_fd_, label.data(), label.size(), 549 nss_fd_, label.data(), label.size(), has_context,
549 reinterpret_cast<const unsigned char*>(context.data()), 550 reinterpret_cast<const unsigned char*>(context.data()),
550 context.length(), out, outlen); 551 context.length(), out, outlen);
551 if (result != SECSuccess) { 552 if (result != SECSuccess) {
552 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); 553 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", "");
553 return MapNSSError(PORT_GetError()); 554 return MapNSSError(PORT_GetError());
554 } 555 }
555 return OK; 556 return OK;
556 } 557 }
557 558
558 SSLClientSocket::NextProtoStatus 559 SSLClientSocket::NextProtoStatus
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 EnsureThreadIdAssigned(); 2707 EnsureThreadIdAssigned();
2707 base::AutoLock auto_lock(lock_); 2708 base::AutoLock auto_lock(lock_);
2708 return valid_thread_id_ == base::PlatformThread::CurrentId(); 2709 return valid_thread_id_ == base::PlatformThread::CurrentId();
2709 } 2710 }
2710 2711
2711 OriginBoundCertService* SSLClientSocketNSS::GetOriginBoundCertService() const { 2712 OriginBoundCertService* SSLClientSocketNSS::GetOriginBoundCertService() const {
2712 return origin_bound_cert_service_; 2713 return origin_bound_cert_service_;
2713 } 2714 }
2714 2715
2715 } // namespace net 2716 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698