OLD | NEW |
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 #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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 transport_recv_busy_(false), | 94 transport_recv_busy_(false), |
95 nss_fd_(NULL), | 95 nss_fd_(NULL), |
96 nss_bufs_(NULL), | 96 nss_bufs_(NULL), |
97 transport_socket_(transport_socket), | 97 transport_socket_(transport_socket), |
98 ssl_config_(ssl_config), | 98 ssl_config_(ssl_config), |
99 cert_(cert), | 99 cert_(cert), |
100 next_handshake_state_(STATE_NONE), | 100 next_handshake_state_(STATE_NONE), |
101 completed_handshake_(false) { | 101 completed_handshake_(false) { |
102 ssl_config_.false_start_enabled = false; | 102 ssl_config_.false_start_enabled = false; |
103 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; | 103 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; |
104 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1; | 104 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1; |
105 | 105 |
106 // TODO(hclam): Need a better way to clone a key. | 106 // TODO(hclam): Need a better way to clone a key. |
107 std::vector<uint8> key_bytes; | 107 std::vector<uint8> key_bytes; |
108 CHECK(key->ExportPrivateKey(&key_bytes)); | 108 CHECK(key->ExportPrivateKey(&key_bytes)); |
109 key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes)); | 109 key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes)); |
110 CHECK(key_.get()); | 110 CHECK(key_.get()); |
111 } | 111 } |
112 | 112 |
113 SSLServerSocketNSS::~SSLServerSocketNSS() { | 113 SSLServerSocketNSS::~SSLServerSocketNSS() { |
114 if (nss_fd_ != NULL) { | 114 if (nss_fd_ != NULL) { |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 // initializes the NSS base library. | 794 // initializes the NSS base library. |
795 EnsureNSSSSLInit(); | 795 EnsureNSSSSLInit(); |
796 if (!NSS_IsInitialized()) | 796 if (!NSS_IsInitialized()) |
797 return ERR_UNEXPECTED; | 797 return ERR_UNEXPECTED; |
798 | 798 |
799 EnableSSLServerSockets(); | 799 EnableSSLServerSockets(); |
800 return OK; | 800 return OK; |
801 } | 801 } |
802 | 802 |
803 } // namespace net | 803 } // namespace net |
OLD | NEW |