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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #include "base/callback_helpers.h" | 32 #include "base/callback_helpers.h" |
33 #include "base/lazy_instance.h" | 33 #include "base/lazy_instance.h" |
34 #include "base/memory/ref_counted.h" | 34 #include "base/memory/ref_counted.h" |
35 #include "crypto/rsa_private_key.h" | 35 #include "crypto/rsa_private_key.h" |
36 #include "crypto/nss_util_internal.h" | 36 #include "crypto/nss_util_internal.h" |
37 #include "net/base/io_buffer.h" | 37 #include "net/base/io_buffer.h" |
38 #include "net/base/net_errors.h" | 38 #include "net/base/net_errors.h" |
39 #include "net/base/net_log.h" | 39 #include "net/base/net_log.h" |
40 #include "net/socket/nss_ssl_util.h" | 40 #include "net/socket/nss_ssl_util.h" |
41 #include "net/socket/ssl_error_params.h" | |
42 | 41 |
43 // SSL plaintext fragments are shorter than 16KB. Although the record layer | 42 // SSL plaintext fragments are shorter than 16KB. Although the record layer |
44 // overhead is allowed to be 2K + 5 bytes, in practice the overhead is much | 43 // overhead is allowed to be 2K + 5 bytes, in practice the overhead is much |
45 // smaller than 1KB. So a 17KB buffer should be large enough to hold an | 44 // smaller than 1KB. So a 17KB buffer should be large enough to hold an |
46 // entire SSL record. | 45 // entire SSL record. |
47 static const int kRecvBufferSize = 17 * 1024; | 46 static const int kRecvBufferSize = 17 * 1024; |
48 static const int kSendBufferSize = 17 * 1024; | 47 static const int kSendBufferSize = 17 * 1024; |
49 | 48 |
50 #define GotoState(s) next_handshake_state_ = s | 49 #define GotoState(s) next_handshake_state_ = s |
51 | 50 |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // initializes the NSS base library. | 830 // initializes the NSS base library. |
832 EnsureNSSSSLInit(); | 831 EnsureNSSSSLInit(); |
833 if (!NSS_IsInitialized()) | 832 if (!NSS_IsInitialized()) |
834 return ERR_UNEXPECTED; | 833 return ERR_UNEXPECTED; |
835 | 834 |
836 EnableSSLServerSockets(); | 835 EnableSSLServerSockets(); |
837 return OK; | 836 return OK; |
838 } | 837 } |
839 | 838 |
840 } // namespace net | 839 } // namespace net |
OLD | NEW |