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

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

Issue 10823084: Add a new GetTlsUniqueChannelBinding method to SSLSocket, and implement nss version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
2817 nss_fd_, label.data(), label.size(), has_context, 2817 nss_fd_, label.data(), label.size(), has_context,
2818 reinterpret_cast<const unsigned char*>(context.data()), 2818 reinterpret_cast<const unsigned char*>(context.data()),
2819 context.length(), out, outlen); 2819 context.length(), out, outlen);
2820 if (result != SECSuccess) { 2820 if (result != SECSuccess) {
2821 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); 2821 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", "");
2822 return MapNSSError(PORT_GetError()); 2822 return MapNSSError(PORT_GetError());
2823 } 2823 }
2824 return OK; 2824 return OK;
2825 } 2825 }
2826 2826
2827 int SSLClientSocketNSS::GetTlsUniqueChannelBinding(unsigned char* out,
2828 unsigned int *outlen,
2829 unsigned int outlen_max) {
2830 if (!IsConnected())
2831 return ERR_SOCKET_NOT_CONNECTED;
2832 SECStatus result = SSL_GetChannelBinding(nss_fd_,
2833 SSL_CHANNEL_BINDING_TLS_UNIQUE,
2834 out, outlen, outlen_max);
2835 if (result != SECSuccess) {
2836 LogFailedNSSFunction(net_log_, "SSL_GetChannelBinding", "");
2837 return MapNSSError(PORT_GetError());
2838 }
2839 return OK;
2840 }
2841
2827 SSLClientSocket::NextProtoStatus 2842 SSLClientSocket::NextProtoStatus
2828 SSLClientSocketNSS::GetNextProto(std::string* proto, 2843 SSLClientSocketNSS::GetNextProto(std::string* proto,
2829 std::string* server_protos) { 2844 std::string* server_protos) {
2830 *proto = core_->state().next_proto; 2845 *proto = core_->state().next_proto;
2831 *server_protos = core_->state().server_protos; 2846 *server_protos = core_->state().server_protos;
2832 return core_->state().next_proto_status; 2847 return core_->state().next_proto_status;
2833 } 2848 }
2834 2849
2835 int SSLClientSocketNSS::Connect(const CompletionCallback& callback) { 2850 int SSLClientSocketNSS::Connect(const CompletionCallback& callback) {
2836 EnterFunction(""); 2851 EnterFunction("");
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3503 EnsureThreadIdAssigned(); 3518 EnsureThreadIdAssigned();
3504 base::AutoLock auto_lock(lock_); 3519 base::AutoLock auto_lock(lock_);
3505 return valid_thread_id_ == base::PlatformThread::CurrentId(); 3520 return valid_thread_id_ == base::PlatformThread::CurrentId();
3506 } 3521 }
3507 3522
3508 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3523 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3509 return server_bound_cert_service_; 3524 return server_bound_cert_service_;
3510 } 3525 }
3511 3526
3512 } // namespace net 3527 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698