OLD | NEW |
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 // 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 cert_request_info->client_certs = client_certs_; | 522 cert_request_info->client_certs = client_certs_; |
523 LeaveFunction(cert_request_info->client_certs.size()); | 523 LeaveFunction(cert_request_info->client_certs.size()); |
524 } | 524 } |
525 | 525 |
526 int SSLClientSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, | 526 int SSLClientSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, |
527 const base::StringPiece& context, | 527 const base::StringPiece& context, |
528 unsigned char *out, | 528 unsigned char *out, |
529 unsigned int outlen) { | 529 unsigned int outlen) { |
530 if (!IsConnected()) | 530 if (!IsConnected()) |
531 return ERR_SOCKET_NOT_CONNECTED; | 531 return ERR_SOCKET_NOT_CONNECTED; |
532 std::string label_string(label.data(), label.length()); | |
533 SECStatus result = SSL_ExportKeyingMaterial( | 532 SECStatus result = SSL_ExportKeyingMaterial( |
534 nss_fd_, label_string.c_str(), | 533 nss_fd_, label.data(), label.size(), |
535 reinterpret_cast<const unsigned char*>(context.data()), | 534 reinterpret_cast<const unsigned char*>(context.data()), |
536 context.length(), out, outlen); | 535 context.length(), out, outlen); |
537 if (result != SECSuccess) { | 536 if (result != SECSuccess) { |
538 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); | 537 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); |
539 return MapNSSError(PORT_GetError()); | 538 return MapNSSError(PORT_GetError()); |
540 } | 539 } |
541 return OK; | 540 return OK; |
542 } | 541 } |
543 | 542 |
544 SSLClientSocket::NextProtoStatus | 543 SSLClientSocket::NextProtoStatus |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 valid_thread_id_ = base::PlatformThread::CurrentId(); | 2307 valid_thread_id_ = base::PlatformThread::CurrentId(); |
2309 } | 2308 } |
2310 | 2309 |
2311 bool SSLClientSocketNSS::CalledOnValidThread() const { | 2310 bool SSLClientSocketNSS::CalledOnValidThread() const { |
2312 EnsureThreadIdAssigned(); | 2311 EnsureThreadIdAssigned(); |
2313 base::AutoLock auto_lock(lock_); | 2312 base::AutoLock auto_lock(lock_); |
2314 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2313 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
2315 } | 2314 } |
2316 | 2315 |
2317 } // namespace net | 2316 } // namespace net |
OLD | NEW |