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

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

Issue 11467004: Enable client certificates in SecureSocket and SecureServerSocket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/secure_socket.cc » ('j') | no next file with comments »
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 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 string_length_(NULL), 67 string_length_(NULL),
68 handshake_complete_(NULL), 68 handshake_complete_(NULL),
69 bad_certificate_callback_(NULL), 69 bad_certificate_callback_(NULL),
70 in_handshake_(false), 70 in_handshake_(false),
71 filter_(NULL) { } 71 filter_(NULL) { }
72 72
73 void Init(Dart_Handle dart_this); 73 void Init(Dart_Handle dart_this);
74 void Connect(const char* host, 74 void Connect(const char* host,
75 int port, 75 int port,
76 bool is_server, 76 bool is_server,
77 const char* certificate_name); 77 const char* certificate_name,
78 bool request_client_certificate,
79 bool require_client_certificate,
80 bool send_client_certificate);
78 void Destroy(); 81 void Destroy();
79 void Handshake(); 82 void Handshake();
80 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); 83 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete);
81 void RegisterBadCertificateCallback(Dart_Handle callback); 84 void RegisterBadCertificateCallback(Dart_Handle callback);
85 Dart_Handle bad_certificate_callback() { return bad_certificate_callback_; }
82 static void InitializeLibrary(const char* certificate_database, 86 static void InitializeLibrary(const char* certificate_database,
83 const char* password, 87 const char* password,
84 bool use_builtin_root_certificates); 88 bool use_builtin_root_certificates);
85
86 intptr_t ProcessBuffer(int bufferIndex); 89 intptr_t ProcessBuffer(int bufferIndex);
87 90 Dart_Handle PeerCertificate();
88 SECStatus HandleBadCertificate(PRFileDesc* fd);
89 91
90 private: 92 private:
91 static const int kMemioBufferSize = 20 * KB; 93 static const int kMemioBufferSize = 20 * KB;
92 static bool library_initialized_; 94 static bool library_initialized_;
93 static const char* password_; 95 static const char* password_;
94 static dart::Mutex mutex_; // To protect library initialization. 96 static dart::Mutex mutex_; // To protect library initialization.
95 97
96 uint8_t* buffers_[kNumBuffers]; 98 uint8_t* buffers_[kNumBuffers];
97 int64_t buffer_size_; 99 int64_t buffer_size_;
98 Dart_Handle string_start_; 100 Dart_Handle string_start_;
99 Dart_Handle string_length_; 101 Dart_Handle string_length_;
100 Dart_Handle dart_buffer_objects_[kNumBuffers]; 102 Dart_Handle dart_buffer_objects_[kNumBuffers];
101 Dart_Handle handshake_complete_; 103 Dart_Handle handshake_complete_;
102 Dart_Handle bad_certificate_callback_; 104 Dart_Handle bad_certificate_callback_;
103 bool in_handshake_; 105 bool in_handshake_;
104 bool is_server_; 106 bool is_server_;
105 PRFileDesc* filter_; 107 PRFileDesc* filter_;
106 108
107 void InitializeBuffers(Dart_Handle dart_this); 109 void InitializeBuffers(Dart_Handle dart_this);
108 void InitializePlatformData(); 110 void InitializePlatformData();
109 111
110 DISALLOW_COPY_AND_ASSIGN(SSLFilter); 112 DISALLOW_COPY_AND_ASSIGN(SSLFilter);
111 }; 113 };
112 114
113 #endif // BIN_SECURE_SOCKET_H_ 115 #endif // BIN_SECURE_SOCKET_H_
OLDNEW
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/secure_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698