blob: 68c3840b5b9de9db290eab1c6ff7ad89dc41ca64 [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
torbjorng07d09362015-09-22 11:58:04 -070047#else // !SSL_USE_OPENSSL
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000048
49bool InitializeSSL(VerificationCallback callback) {
50 return true;
51}
52
torbjorng4cd331b2016-03-17 11:53:14 -070053#endif // SSL_USE_OPENSSL
54
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000055bool InitializeSSLThread() {
56 return true;
57}
58
59bool CleanupSSL() {
60 return true;
61}
62
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000063///////////////////////////////////////////////////////////////////////////////
64
65} // namespace rtc