OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #if HAVE_CONFIG_H | 11 #if HAVE_CONFIG_H |
12 #include "config.h" | 12 #include "config.h" |
13 #endif // HAVE_CONFIG_H | 13 #endif // HAVE_CONFIG_H |
14 | 14 |
15 #include "webrtc/base/ssladapter.h" | 15 #include "webrtc/base/ssladapter.h" |
16 | 16 |
17 #include "webrtc/base/sslconfig.h" | 17 #include "webrtc/base/sslconfig.h" |
18 | 18 |
19 #if SSL_USE_SCHANNEL | 19 #if SSL_USE_SCHANNEL |
20 | 20 |
21 #include "schanneladapter.h" | 21 #include "schanneladapter.h" |
22 | 22 |
23 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL | 23 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL |
24 | 24 |
25 #include "openssladapter.h" | 25 #include "openssladapter.h" |
26 | 26 |
27 #elif SSL_USE_NSS // && !SSL_USE_CHANNEL && !SSL_USE_OPENSSL | 27 #endif // SSL_USE_OPENSSL && !SSL_USE_SCHANNEL |
28 | |
29 #include "nssstreamadapter.h" | |
30 | |
31 #endif // SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS | |
32 | 28 |
33 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
34 | 30 |
35 namespace rtc { | 31 namespace rtc { |
36 | 32 |
37 SSLAdapter* | 33 SSLAdapter* |
38 SSLAdapter::Create(AsyncSocket* socket) { | 34 SSLAdapter::Create(AsyncSocket* socket) { |
39 #if SSL_USE_SCHANNEL | 35 #if SSL_USE_SCHANNEL |
40 return new SChannelAdapter(socket); | 36 return new SChannelAdapter(socket); |
41 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL | 37 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL |
(...skipping 13 matching lines...) Expand all Loading... |
55 } | 51 } |
56 | 52 |
57 bool InitializeSSLThread() { | 53 bool InitializeSSLThread() { |
58 return OpenSSLAdapter::InitializeSSLThread(); | 54 return OpenSSLAdapter::InitializeSSLThread(); |
59 } | 55 } |
60 | 56 |
61 bool CleanupSSL() { | 57 bool CleanupSSL() { |
62 return OpenSSLAdapter::CleanupSSL(); | 58 return OpenSSLAdapter::CleanupSSL(); |
63 } | 59 } |
64 | 60 |
65 #elif SSL_USE_NSS // !SSL_USE_OPENSSL | 61 #else // !SSL_USE_OPENSSL |
66 | |
67 bool InitializeSSL(VerificationCallback callback) { | |
68 return NSSContext::InitializeSSL(callback); | |
69 } | |
70 | |
71 bool InitializeSSLThread() { | |
72 return NSSContext::InitializeSSLThread(); | |
73 } | |
74 | |
75 bool CleanupSSL() { | |
76 return NSSContext::CleanupSSL(); | |
77 } | |
78 | |
79 #else // !SSL_USE_OPENSSL && !SSL_USE_NSS | |
80 | 62 |
81 bool InitializeSSL(VerificationCallback callback) { | 63 bool InitializeSSL(VerificationCallback callback) { |
82 return true; | 64 return true; |
83 } | 65 } |
84 | 66 |
85 bool InitializeSSLThread() { | 67 bool InitializeSSLThread() { |
86 return true; | 68 return true; |
87 } | 69 } |
88 | 70 |
89 bool CleanupSSL() { | 71 bool CleanupSSL() { |
90 return true; | 72 return true; |
91 } | 73 } |
92 | 74 |
93 #endif // !SSL_USE_OPENSSL && !SSL_USE_NSS | 75 #endif // !SSL_USE_OPENSSL |
94 | 76 |
95 /////////////////////////////////////////////////////////////////////////////// | 77 /////////////////////////////////////////////////////////////////////////////// |
96 | 78 |
97 } // namespace rtc | 79 } // namespace rtc |
OLD | NEW |