| 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 #include "net/socket/ssl_server_socket_nss.h" | 5 #include "net/socket/ssl_server_socket_nss.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 return rv > OK ? OK : rv; | 126 return rv > OK ? OK : rv; |
| 127 } | 127 } |
| 128 | 128 |
| 129 int SSLServerSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, | 129 int SSLServerSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, |
| 130 const base::StringPiece& context, | 130 const base::StringPiece& context, |
| 131 unsigned char *out, | 131 unsigned char *out, |
| 132 unsigned int outlen) { | 132 unsigned int outlen) { |
| 133 if (!IsConnected()) | 133 if (!IsConnected()) |
| 134 return ERR_SOCKET_NOT_CONNECTED; | 134 return ERR_SOCKET_NOT_CONNECTED; |
| 135 std::string label_string(label.data(), label.length()); | |
| 136 SECStatus result = SSL_ExportKeyingMaterial( | 135 SECStatus result = SSL_ExportKeyingMaterial( |
| 137 nss_fd_, label_string.c_str(), | 136 nss_fd_, label.data(), label.size(), |
| 138 reinterpret_cast<const unsigned char*>(context.data()), | 137 reinterpret_cast<const unsigned char*>(context.data()), |
| 139 context.length(), out, outlen); | 138 context.length(), out, outlen); |
| 140 if (result != SECSuccess) { | 139 if (result != SECSuccess) { |
| 141 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); | 140 LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); |
| 142 return MapNSSError(PORT_GetError()); | 141 return MapNSSError(PORT_GetError()); |
| 143 } | 142 } |
| 144 return OK; | 143 return OK; |
| 145 } | 144 } |
| 146 | 145 |
| 147 int SSLServerSocketNSS::Connect(CompletionCallback* callback) { | 146 int SSLServerSocketNSS::Connect(CompletionCallback* callback) { |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop | 766 // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop |
| 768 // by MessageLoopForIO::current(). | 767 // by MessageLoopForIO::current(). |
| 769 // X509Certificate::Verify() runs on a worker thread of CertVerifier. | 768 // X509Certificate::Verify() runs on a worker thread of CertVerifier. |
| 770 EnsureOCSPInit(); | 769 EnsureOCSPInit(); |
| 771 #endif | 770 #endif |
| 772 | 771 |
| 773 return OK; | 772 return OK; |
| 774 } | 773 } |
| 775 | 774 |
| 776 } // namespace net | 775 } // namespace net |
| OLD | NEW |