blob: 454a56637d7b9de76f5125968cf91a6cd59362f0 [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
11#if HAVE_CONFIG_H
12#include "config.h"
13#endif // HAVE_CONFIG_H
14
15#include "webrtc/base/ssladapter.h"
16
17#include "webrtc/base/sslconfig.h"
18
torbjorng172f0092015-10-07 04:57:55 -070019#if SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000020
21#include "openssladapter.h"
22
torbjorng172f0092015-10-07 04:57:55 -070023#endif
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000024
25///////////////////////////////////////////////////////////////////////////////
26
27namespace rtc {
28
29SSLAdapter*
30SSLAdapter::Create(AsyncSocket* socket) {
torbjorng172f0092015-10-07 04:57:55 -070031#if SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000032 return new OpenSSLAdapter(socket);
torbjorng172f0092015-10-07 04:57:55 -070033#else // !SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000034 delete socket;
35 return NULL;
torbjorng172f0092015-10-07 04:57:55 -070036#endif // SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000037}
38
39///////////////////////////////////////////////////////////////////////////////
40
41#if SSL_USE_OPENSSL
42
43bool InitializeSSL(VerificationCallback callback) {
44 return OpenSSLAdapter::InitializeSSL(callback);
45}
46
47bool InitializeSSLThread() {
48 return OpenSSLAdapter::InitializeSSLThread();
49}
50
51bool CleanupSSL() {
52 return OpenSSLAdapter::CleanupSSL();
53}
54
torbjorng07d09362015-09-22 11:58:04 -070055#else // !SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000056
57bool InitializeSSL(VerificationCallback callback) {
58 return true;
59}
60
61bool InitializeSSLThread() {
62 return true;
63}
64
65bool CleanupSSL() {
66 return true;
67}
68
torbjorng172f0092015-10-07 04:57:55 -070069#endif // SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000070
71///////////////////////////////////////////////////////////////////////////////
72
73} // namespace rtc