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 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 int BeginSSL(); | 60 int BeginSSL(); |
61 int ContinueSSL(); | 61 int ContinueSSL(); |
62 void Error(const char* context, int err, bool signal = true); | 62 void Error(const char* context, int err, bool signal = true); |
63 void Cleanup(); | 63 void Cleanup(); |
64 | 64 |
65 void OnMessage(Message* msg) override; | 65 void OnMessage(Message* msg) override; |
66 | 66 |
67 static bool VerifyServerName(SSL* ssl, const char* host, | 67 static bool VerifyServerName(SSL* ssl, const char* host, |
68 bool ignore_bad_cert); | 68 bool ignore_bad_cert); |
69 bool SSLPostConnectionCheck(SSL* ssl, const char* host); | 69 bool SSLPostConnectionCheck(SSL* ssl, const char* host); |
70 #if _DEBUG | 70 #if !defined(NDEBUG) |
71 static void SSLInfoCallback(const SSL* s, int where, int ret); | 71 static void SSLInfoCallback(const SSL* s, int where, int ret); |
72 #endif // !_DEBUG | 72 #endif |
73 static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); | 73 static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); |
74 static VerificationCallback custom_verify_callback_; | 74 static VerificationCallback custom_verify_callback_; |
75 friend class OpenSSLStreamAdapter; // for custom_verify_callback_; | 75 friend class OpenSSLStreamAdapter; // for custom_verify_callback_; |
76 | 76 |
77 static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx); | 77 static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx); |
78 SSL_CTX* SetupSSLContext(); | 78 SSL_CTX* SetupSSLContext(); |
79 | 79 |
80 SSLState state_; | 80 SSLState state_; |
81 bool ssl_read_needs_write_; | 81 bool ssl_read_needs_write_; |
82 bool ssl_write_needs_read_; | 82 bool ssl_write_needs_read_; |
83 // If true, socket will retain SSL configuration after Close. | 83 // If true, socket will retain SSL configuration after Close. |
84 bool restartable_; | 84 bool restartable_; |
85 | 85 |
86 SSL* ssl_; | 86 SSL* ssl_; |
87 SSL_CTX* ssl_ctx_; | 87 SSL_CTX* ssl_ctx_; |
88 std::string ssl_host_name_; | 88 std::string ssl_host_name_; |
89 // Do DTLS or not | 89 // Do DTLS or not |
90 SSLMode ssl_mode_; | 90 SSLMode ssl_mode_; |
91 | 91 |
92 bool custom_verification_succeeded_; | 92 bool custom_verification_succeeded_; |
93 }; | 93 }; |
94 | 94 |
95 ///////////////////////////////////////////////////////////////////////////// | 95 ///////////////////////////////////////////////////////////////////////////// |
96 | 96 |
97 } // namespace rtc | 97 } // namespace rtc |
98 | 98 |
99 #endif // WEBRTC_BASE_OPENSSLADAPTER_H__ | 99 #endif // WEBRTC_BASE_OPENSSLADAPTER_H__ |
OLD | NEW |