OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ | 5 #ifndef RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ |
6 #define RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ | 6 #define RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ |
7 | 7 |
8 #if !defined(RUNTIME_BIN_SECURE_SOCKET_H_) | 8 #if !defined(RUNTIME_BIN_SECURE_SOCKET_H_) |
9 #error Do not include secure_socket_boringssl.h directly. Use secure_socket.h. | 9 #error Do not include secure_socket_boringssl.h directly. Use secure_socket.h. |
10 #endif | 10 #endif |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace dart { | 29 namespace dart { |
30 namespace bin { | 30 namespace bin { |
31 | 31 |
32 /* These are defined in root_certificates.cc. */ | 32 /* These are defined in root_certificates.cc. */ |
33 extern const unsigned char* root_certificates_pem; | 33 extern const unsigned char* root_certificates_pem; |
34 extern unsigned int root_certificates_pem_length; | 34 extern unsigned int root_certificates_pem_length; |
35 | 35 |
36 class SSLContext { | 36 class SSLContext { |
37 public: | 37 public: |
38 explicit SSLContext(SSL_CTX* context) : | 38 explicit SSLContext(SSL_CTX* context) |
39 context_(context), | 39 : context_(context), alpn_protocol_string_(NULL) {} |
40 alpn_protocol_string_(NULL) { | |
41 } | |
42 | 40 |
43 ~SSLContext() { | 41 ~SSLContext() { |
44 SSL_CTX_free(context_); | 42 SSL_CTX_free(context_); |
45 if (alpn_protocol_string_ != NULL) { | 43 if (alpn_protocol_string_ != NULL) { |
46 free(alpn_protocol_string_); | 44 free(alpn_protocol_string_); |
47 } | 45 } |
48 } | 46 } |
49 | 47 |
50 SSL_CTX* context() const { return context_; } | 48 SSL_CTX* context() const { return context_; } |
51 | 49 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 83 |
86 SSLFilter() | 84 SSLFilter() |
87 : callback_error(NULL), | 85 : callback_error(NULL), |
88 ssl_(NULL), | 86 ssl_(NULL), |
89 socket_side_(NULL), | 87 socket_side_(NULL), |
90 string_start_(NULL), | 88 string_start_(NULL), |
91 string_length_(NULL), | 89 string_length_(NULL), |
92 handshake_complete_(NULL), | 90 handshake_complete_(NULL), |
93 bad_certificate_callback_(NULL), | 91 bad_certificate_callback_(NULL), |
94 in_handshake_(false), | 92 in_handshake_(false), |
95 hostname_(NULL) { } | 93 hostname_(NULL) {} |
96 | 94 |
97 ~SSLFilter(); | 95 ~SSLFilter(); |
98 | 96 |
99 Dart_Handle Init(Dart_Handle dart_this); | 97 Dart_Handle Init(Dart_Handle dart_this); |
100 void Connect(const char* hostname, | 98 void Connect(const char* hostname, |
101 SSL_CTX* context, | 99 SSL_CTX* context, |
102 bool is_server, | 100 bool is_server, |
103 bool request_client_certificate, | 101 bool request_client_certificate, |
104 bool require_client_certificate, | 102 bool require_client_certificate, |
105 Dart_Handle protocols_handle); | 103 Dart_Handle protocols_handle); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 Dart_Handle InitializeBuffers(Dart_Handle dart_this); | 154 Dart_Handle InitializeBuffers(Dart_Handle dart_this); |
157 void InitializePlatformData(); | 155 void InitializePlatformData(); |
158 | 156 |
159 DISALLOW_COPY_AND_ASSIGN(SSLFilter); | 157 DISALLOW_COPY_AND_ASSIGN(SSLFilter); |
160 }; | 158 }; |
161 | 159 |
162 } // namespace bin | 160 } // namespace bin |
163 } // namespace dart | 161 } // namespace dart |
164 | 162 |
165 #endif // RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ | 163 #endif // RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_ |
OLD | NEW |