| 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 #endif // SSL_USE_OPENSSL && !SSL_USE_SCHANNEL | 27 #elif SSL_USE_NSS // && !SSL_USE_CHANNEL && !SSL_USE_OPENSSL |
| 28 |
| 29 #include "nssstreamadapter.h" |
| 30 |
| 31 #endif // SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS |
| 28 | 32 |
| 29 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
| 30 | 34 |
| 31 namespace rtc { | 35 namespace rtc { |
| 32 | 36 |
| 33 SSLAdapter* | 37 SSLAdapter* |
| 34 SSLAdapter::Create(AsyncSocket* socket) { | 38 SSLAdapter::Create(AsyncSocket* socket) { |
| 35 #if SSL_USE_SCHANNEL | 39 #if SSL_USE_SCHANNEL |
| 36 return new SChannelAdapter(socket); | 40 return new SChannelAdapter(socket); |
| 37 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL | 41 #elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 } | 55 } |
| 52 | 56 |
| 53 bool InitializeSSLThread() { | 57 bool InitializeSSLThread() { |
| 54 return OpenSSLAdapter::InitializeSSLThread(); | 58 return OpenSSLAdapter::InitializeSSLThread(); |
| 55 } | 59 } |
| 56 | 60 |
| 57 bool CleanupSSL() { | 61 bool CleanupSSL() { |
| 58 return OpenSSLAdapter::CleanupSSL(); | 62 return OpenSSLAdapter::CleanupSSL(); |
| 59 } | 63 } |
| 60 | 64 |
| 61 #else // !SSL_USE_OPENSSL | 65 #elif SSL_USE_NSS // !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 |
| 62 | 80 |
| 63 bool InitializeSSL(VerificationCallback callback) { | 81 bool InitializeSSL(VerificationCallback callback) { |
| 64 return true; | 82 return true; |
| 65 } | 83 } |
| 66 | 84 |
| 67 bool InitializeSSLThread() { | 85 bool InitializeSSLThread() { |
| 68 return true; | 86 return true; |
| 69 } | 87 } |
| 70 | 88 |
| 71 bool CleanupSSL() { | 89 bool CleanupSSL() { |
| 72 return true; | 90 return true; |
| 73 } | 91 } |
| 74 | 92 |
| 75 #endif // !SSL_USE_OPENSSL | 93 #endif // !SSL_USE_OPENSSL && !SSL_USE_NSS |
| 76 | 94 |
| 77 /////////////////////////////////////////////////////////////////////////////// | 95 /////////////////////////////////////////////////////////////////////////////// |
| 78 | 96 |
| 79 } // namespace rtc | 97 } // namespace rtc |
| OLD | NEW |