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

Side by Side Diff: sdk/lib/io/secure_socket.dart

Issue 12385024: Make sure that no decrypted text gets stuck in the plaintext buffer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * A high-level class for communicating securely over a TCP socket, using 8 * A high-level class for communicating securely over a TCP socket, using
9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an
10 * [IOSink] interface, making it ideal for using together with 10 * [IOSink] interface, making it ideal for using together with
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 Timer.run(() => _controller.add(RawSocketEvent.WRITE)); 397 Timer.run(() => _controller.add(RawSocketEvent.WRITE));
398 } else { 398 } else {
399 _writeEventsEnabled = value; 399 _writeEventsEnabled = value;
400 } 400 }
401 } 401 }
402 402
403 bool get readEventsEnabled => _readEventsEnabled; 403 bool get readEventsEnabled => _readEventsEnabled;
404 404
405 void set readEventsEnabled(bool value) { 405 void set readEventsEnabled(bool value) {
406 _readEventsEnabled = value; 406 _readEventsEnabled = value;
407 if (_socketClosedRead) { 407 if (value &&
408 if (value) { 408 ((_secureFilter != null &&
409 // We have no underlying socket to set off read events. 409 _secureFilter.buffers[READ_PLAINTEXT].length > 0) ||
410 Timer.run(_readHandler); 410 _socketClosedRead)) {
411 } 411 // We might not have no underlying socket to set off read events.
412 Timer.run(_readHandler);
412 } 413 }
413 } 414 }
414 415
415 List<int> read([int len]) { 416 List<int> read([int len]) {
416 if (_closedRead) { 417 if (_closedRead) {
417 throw new SocketIOException("Reading from a closed socket"); 418 throw new SocketIOException("Reading from a closed socket");
418 } 419 }
419 if (_status != CONNECTED) { 420 if (_status != CONNECTED) {
420 return null; 421 return null;
421 } 422 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 void destroy(); 748 void destroy();
748 void handshake(); 749 void handshake();
749 void init(); 750 void init();
750 X509Certificate get peerCertificate; 751 X509Certificate get peerCertificate;
751 int processBuffer(int bufferIndex); 752 int processBuffer(int bufferIndex);
752 void registerBadCertificateCallback(Function callback); 753 void registerBadCertificateCallback(Function callback);
753 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); 754 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler);
754 755
755 List<_ExternalBuffer> get buffers; 756 List<_ExternalBuffer> get buffers;
756 } 757 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698