blob: ba24e618ec3c158fa4266466d4b535703712a430 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000011#include "webrtc/base/ssladapter.h"
12
13#include "webrtc/base/sslconfig.h"
14
torbjorng172f0092015-10-07 04:57:55 -070015#if SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000016
17#include "openssladapter.h"
18
torbjorng172f0092015-10-07 04:57:55 -070019#endif
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000020
21///////////////////////////////////////////////////////////////////////////////
22
23namespace rtc {
24
25SSLAdapter*
26SSLAdapter::Create(AsyncSocket* socket) {
torbjorng172f0092015-10-07 04:57:55 -070027#if SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000028 return new OpenSSLAdapter(socket);
torbjorng172f0092015-10-07 04:57:55 -070029#else // !SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000030 delete socket;
31 return NULL;
torbjorng172f0092015-10-07 04:57:55 -070032#endif // SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000033}
34
35///////////////////////////////////////////////////////////////////////////////
36
37#if SSL_USE_OPENSSL
38
39bool InitializeSSL(VerificationCallback callback) {
40 return OpenSSLAdapter::InitializeSSL(callback);
41}
42
Torbjorn Granlund9adc91d2016-03-24 14:05:06 +010043bool InitializeSSLThread() {
44 return OpenSSLAdapter::InitializeSSLThread();
45}
46
47bool CleanupSSL() {
48 return OpenSSLAdapter::CleanupSSL();
49}
50
torbjorng07d09362015-09-22 11:58:04 -070051#else // !SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000052
53bool InitializeSSL(VerificationCallback callback) {
54 return true;
55}
56
57bool InitializeSSLThread() {
58 return true;
59}
60
61bool CleanupSSL() {
62 return true;
63}
64
Torbjorn Granlund9adc91d2016-03-24 14:05:06 +010065#endif // SSL_USE_OPENSSL
66
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000067///////////////////////////////////////////////////////////////////////////////
68
69} // namespace rtc