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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 user_write_buf_len_(0), | 96 user_write_buf_len_(0), |
97 nss_fd_(NULL), | 97 nss_fd_(NULL), |
98 nss_bufs_(NULL), | 98 nss_bufs_(NULL), |
99 transport_socket_(transport_socket), | 99 transport_socket_(transport_socket), |
100 ssl_config_(ssl_config), | 100 ssl_config_(ssl_config), |
101 cert_(cert), | 101 cert_(cert), |
102 next_handshake_state_(STATE_NONE), | 102 next_handshake_state_(STATE_NONE), |
103 completed_handshake_(false) { | 103 completed_handshake_(false) { |
104 ssl_config_.false_start_enabled = false; | 104 ssl_config_.false_start_enabled = false; |
105 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; | 105 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; |
106 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1; | 106 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1; |
107 | 107 |
108 // TODO(hclam): Need a better way to clone a key. | 108 // TODO(hclam): Need a better way to clone a key. |
109 std::vector<uint8> key_bytes; | 109 std::vector<uint8> key_bytes; |
110 CHECK(key->ExportPrivateKey(&key_bytes)); | 110 CHECK(key->ExportPrivateKey(&key_bytes)); |
111 key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes)); | 111 key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes)); |
112 CHECK(key_.get()); | 112 CHECK(key_.get()); |
113 } | 113 } |
114 | 114 |
115 SSLServerSocketNSS::~SSLServerSocketNSS() { | 115 SSLServerSocketNSS::~SSLServerSocketNSS() { |
116 if (nss_fd_ != NULL) { | 116 if (nss_fd_ != NULL) { |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 // initializes the NSS base library. | 821 // initializes the NSS base library. |
822 EnsureNSSSSLInit(); | 822 EnsureNSSSSLInit(); |
823 if (!NSS_IsInitialized()) | 823 if (!NSS_IsInitialized()) |
824 return ERR_UNEXPECTED; | 824 return ERR_UNEXPECTED; |
825 | 825 |
826 EnableSSLServerSockets(); | 826 EnableSSLServerSockets(); |
827 return OK; | 827 return OK; |
828 } | 828 } |
829 | 829 |
830 } // namespace net | 830 } // namespace net |
OLD | NEW |