Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: runtime/bin/secure_socket.h

Issue 1746363002: Fixes error handling, leaks in secure sockets. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Added comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/secure_socket.cc » ('j') | runtime/bin/secure_socket.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifdef DART_IO_SECURE_SOCKET_DISABLED 8 #ifdef DART_IO_SECURE_SOCKET_DISABLED
9 #error "secure_socket.h can only be included on builds with SSL enabled" 9 #error "secure_socket.h can only be included on builds with SSL enabled"
10 #endif 10 #endif
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 : callback_error(NULL), 55 : callback_error(NULL),
56 ssl_(NULL), 56 ssl_(NULL),
57 socket_side_(NULL), 57 socket_side_(NULL),
58 string_start_(NULL), 58 string_start_(NULL),
59 string_length_(NULL), 59 string_length_(NULL),
60 handshake_complete_(NULL), 60 handshake_complete_(NULL),
61 bad_certificate_callback_(NULL), 61 bad_certificate_callback_(NULL),
62 in_handshake_(false), 62 in_handshake_(false),
63 hostname_(NULL) { } 63 hostname_(NULL) { }
64 64
65 void Init(Dart_Handle dart_this); 65 ~SSLFilter();
66
67 Dart_Handle Init(Dart_Handle dart_this);
66 void Connect(const char* hostname, 68 void Connect(const char* hostname,
67 SSL_CTX* context, 69 SSL_CTX* context,
68 bool is_server, 70 bool is_server,
69 bool request_client_certificate, 71 bool request_client_certificate,
70 bool require_client_certificate, 72 bool require_client_certificate,
71 Dart_Handle protocols_handle); 73 Dart_Handle protocols_handle);
72 void Destroy(); 74 void Destroy();
73 void Handshake(); 75 void Handshake();
74 void GetSelectedProtocol(Dart_NativeArguments args); 76 void GetSelectedProtocol(Dart_NativeArguments args);
75 void Renegotiate(bool use_session_cache, 77 void Renegotiate(bool use_session_cache,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Dart_PersistentHandle dart_buffer_objects_[kNumBuffers]; 115 Dart_PersistentHandle dart_buffer_objects_[kNumBuffers];
114 Dart_PersistentHandle handshake_complete_; 116 Dart_PersistentHandle handshake_complete_;
115 Dart_PersistentHandle bad_certificate_callback_; 117 Dart_PersistentHandle bad_certificate_callback_;
116 bool in_handshake_; 118 bool in_handshake_;
117 bool is_server_; 119 bool is_server_;
118 char* hostname_; 120 char* hostname_;
119 121
120 static bool isBufferEncrypted(int i) { 122 static bool isBufferEncrypted(int i) {
121 return static_cast<BufferIndex>(i) >= kFirstEncrypted; 123 return static_cast<BufferIndex>(i) >= kFirstEncrypted;
122 } 124 }
123 void InitializeBuffers(Dart_Handle dart_this); 125 Dart_Handle InitializeBuffers(Dart_Handle dart_this);
124 void InitializePlatformData(); 126 void InitializePlatformData();
125 127
126 DISALLOW_COPY_AND_ASSIGN(SSLFilter); 128 DISALLOW_COPY_AND_ASSIGN(SSLFilter);
127 }; 129 };
128 130
129 } // namespace bin 131 } // namespace bin
130 } // namespace dart 132 } // namespace dart
131 133
132 #endif // BIN_SECURE_SOCKET_H_ 134 #endif // BIN_SECURE_SOCKET_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/secure_socket.cc » ('j') | runtime/bin/secure_socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698