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

Unified Diff: sdk/lib/io/secure_socket.dart

Issue 18984008: dart:io | Support connection renegotiation (rehandshake) on SecureSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/secure_socket_patch.dart ('k') | tests/standalone/io/secure_socket_renegotiate_client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 417534a5d7f632b50484bb4cbe2749b63754361b..6da8ec67348a4004e24d91cec986fce2a4eb6d30 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -150,6 +150,17 @@ abstract class SecureSocket implements Socket {
X509Certificate get peerCertificate;
/**
+ * Renegotiate an existing secure connection, renewing the session keys
+ * and possibly changing the connection properties.
+ *
+ * This repeats the SSL or TLS handshake, with options that allow clearing
+ * the session cache and requesting a client certificate.
+ */
+ void renegotiate({bool useSessionCache: true,
+ bool requestClientCertificate: false,
+ bool requireClientCertificate: false});
+
+ /**
* Initializes the NSS library. If [initialize] is not called, the library
* is automatically initialized as if [initialize] were called with no
* arguments. If [initialize] is called more than once, or called after
@@ -334,6 +345,17 @@ abstract class RawSecureSocket implements RawSocket {
}
/**
+ * Renegotiate an existing secure connection, renewing the session keys
+ * and possibly changing the connection properties.
+ *
+ * This repeats the SSL or TLS handshake, with options that allow clearing
+ * the session cache and requesting a client certificate.
+ */
+ void renegotiate({bool useSessionCache: true,
+ bool requestClientCertificate: false,
+ bool requireClientCertificate: false});
+
+ /**
* Get the peer certificate for a connected RawSecureSocket. If this
* RawSecureSocket is the server end of a secure socket connection,
* [peerCertificate] will return the client certificate, or null, if no
@@ -785,6 +807,21 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
}
+ void renegotiate({bool useSessionCache: true,
+ bool requestClientCertificate: false,
+ bool requireClientCertificate: false}) {
+ if (_status != CONNECTED) {
+ throw new HandshakeException(
+ "Called renegotiate on a non-connected socket");
+ }
+ _secureFilter.renegotiate(useSessionCache,
+ requestClientCertificate,
+ requireClientCertificate);
+ _status = HANDSHAKE;
+ _filterStatus.writeEmpty = false;
+ _scheduleFilter();
+ }
+
void _secureHandshakeCompleteHandler() {
_status = CONNECTED;
if (_connectPending) {
@@ -1158,6 +1195,10 @@ abstract class _SecureFilter {
bool sendClientCertificate);
void destroy();
void handshake();
+ void rehandshake();
+ void renegotiate(bool useSessionCache,
+ bool requestClientCertificate,
+ bool requireClientCertificate);
void init();
X509Certificate get peerCertificate;
int processBuffer(int bufferIndex);
« no previous file with comments | « runtime/bin/secure_socket_patch.dart ('k') | tests/standalone/io/secure_socket_renegotiate_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698