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 #ifndef WEBRTC_BASE_OPENSSLADAPTER_H__ | 11 #ifndef WEBRTC_BASE_OPENSSLADAPTER_H__ |
12 #define WEBRTC_BASE_OPENSSLADAPTER_H__ | 12 #define WEBRTC_BASE_OPENSSLADAPTER_H__ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include "webrtc/base/messagehandler.h" | 15 #include "webrtc/base/messagehandler.h" |
16 #include "webrtc/base/messagequeue.h" | 16 #include "webrtc/base/messagequeue.h" |
17 #include "webrtc/base/ssladapter.h" | 17 #include "webrtc/base/ssladapter.h" |
18 | 18 |
19 typedef struct ssl_st SSL; | 19 typedef struct ssl_st SSL; |
20 typedef struct ssl_ctx_st SSL_CTX; | 20 typedef struct ssl_ctx_st SSL_CTX; |
21 typedef struct x509_store_ctx_st X509_STORE_CTX; | 21 typedef struct x509_store_ctx_st X509_STORE_CTX; |
22 | 22 |
23 namespace rtc { | 23 namespace rtc { |
24 | 24 |
25 /////////////////////////////////////////////////////////////////////////////// | 25 /////////////////////////////////////////////////////////////////////////////// |
26 | 26 |
27 class OpenSSLAdapter : public SSLAdapter, public MessageHandler { | 27 class OpenSSLAdapter : public SSLAdapter, public MessageHandler { |
28 public: | 28 public: |
29 static bool InitializeSSL(VerificationCallback callback); | 29 static bool InitializeSSL(VerificationCallback callback); |
| 30 static bool InitializeSSLThread(); |
| 31 static bool CleanupSSL(); |
30 | 32 |
31 OpenSSLAdapter(AsyncSocket* socket); | 33 OpenSSLAdapter(AsyncSocket* socket); |
32 ~OpenSSLAdapter() override; | 34 ~OpenSSLAdapter() override; |
33 | 35 |
34 void SetMode(SSLMode mode) override; | 36 void SetMode(SSLMode mode) override; |
35 int StartSSL(const char* hostname, bool restartable) override; | 37 int StartSSL(const char* hostname, bool restartable) override; |
36 int Send(const void* pv, size_t cb) override; | 38 int Send(const void* pv, size_t cb) override; |
37 int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; | 39 int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; |
38 int Recv(void* pv, size_t cb) override; | 40 int Recv(void* pv, size_t cb) override; |
39 int RecvFrom(void* pv, size_t cb, SocketAddress* paddr) override; | 41 int RecvFrom(void* pv, size_t cb, SocketAddress* paddr) override; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 SSLMode ssl_mode_; | 90 SSLMode ssl_mode_; |
89 | 91 |
90 bool custom_verification_succeeded_; | 92 bool custom_verification_succeeded_; |
91 }; | 93 }; |
92 | 94 |
93 ///////////////////////////////////////////////////////////////////////////// | 95 ///////////////////////////////////////////////////////////////////////////// |
94 | 96 |
95 } // namespace rtc | 97 } // namespace rtc |
96 | 98 |
97 #endif // WEBRTC_BASE_OPENSSLADAPTER_H__ | 99 #endif // WEBRTC_BASE_OPENSSLADAPTER_H__ |
OLD | NEW |