| 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 BIN_SECURE_SOCKET_H_ | 5 #ifndef BIN_SECURE_SOCKET_H_ |
| 6 #define BIN_SECURE_SOCKET_H_ | 6 #define BIN_SECURE_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 bool request_client_certificate, | 79 bool request_client_certificate, |
| 80 bool require_client_certificate, | 80 bool require_client_certificate, |
| 81 bool send_client_certificate); | 81 bool send_client_certificate); |
| 82 void Destroy(); | 82 void Destroy(); |
| 83 void Handshake(); | 83 void Handshake(); |
| 84 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); | 84 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); |
| 85 void RegisterBadCertificateCallback(Dart_Handle callback); | 85 void RegisterBadCertificateCallback(Dart_Handle callback); |
| 86 Dart_Handle bad_certificate_callback() { return bad_certificate_callback_; } | 86 Dart_Handle bad_certificate_callback() { return bad_certificate_callback_; } |
| 87 static void InitializeLibrary(const char* certificate_database, | 87 static void InitializeLibrary(const char* certificate_database, |
| 88 const char* password, | 88 const char* password, |
| 89 bool use_builtin_root_certificates); | 89 bool use_builtin_root_certificates, |
| 90 bool report_duplicate_initialization = true); |
| 90 intptr_t ProcessBuffer(int bufferIndex); | 91 intptr_t ProcessBuffer(int bufferIndex); |
| 91 Dart_Handle PeerCertificate(); | 92 Dart_Handle PeerCertificate(); |
| 92 | 93 |
| 93 private: | 94 private: |
| 94 static const int kMemioBufferSize = 20 * KB; | 95 static const int kMemioBufferSize = 20 * KB; |
| 95 static bool library_initialized_; | 96 static bool library_initialized_; |
| 96 static const char* password_; | 97 static const char* password_; |
| 97 static dart::Mutex mutex_; // To protect library initialization. | 98 static dart::Mutex mutex_; // To protect library initialization. |
| 98 | 99 |
| 99 uint8_t* buffers_[kNumBuffers]; | 100 uint8_t* buffers_[kNumBuffers]; |
| 100 int64_t buffer_size_; | 101 int64_t buffer_size_; |
| 101 Dart_Handle string_start_; | 102 Dart_Handle string_start_; |
| 102 Dart_Handle string_length_; | 103 Dart_Handle string_length_; |
| 103 Dart_Handle dart_buffer_objects_[kNumBuffers]; | 104 Dart_Handle dart_buffer_objects_[kNumBuffers]; |
| 104 Dart_Handle handshake_complete_; | 105 Dart_Handle handshake_complete_; |
| 105 Dart_Handle bad_certificate_callback_; | 106 Dart_Handle bad_certificate_callback_; |
| 106 bool in_handshake_; | 107 bool in_handshake_; |
| 107 bool is_server_; | 108 bool is_server_; |
| 108 char* client_certificate_name_; | 109 char* client_certificate_name_; |
| 109 PRFileDesc* filter_; | 110 PRFileDesc* filter_; |
| 110 | 111 |
| 111 void InitializeBuffers(Dart_Handle dart_this); | 112 void InitializeBuffers(Dart_Handle dart_this); |
| 112 void InitializePlatformData(); | 113 void InitializePlatformData(); |
| 113 | 114 |
| 114 DISALLOW_COPY_AND_ASSIGN(SSLFilter); | 115 DISALLOW_COPY_AND_ASSIGN(SSLFilter); |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 #endif // BIN_SECURE_SOCKET_H_ | 118 #endif // BIN_SECURE_SOCKET_H_ |
| OLD | NEW |