Commit graph

79 commits

Author SHA1 Message Date
whesse@google.com 7c2cc61e30 Fix type error in r37647
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//349403003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37654 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 11:30:15 +00:00
whesse@google.com cd2b96afd8 Add _owner setter to RawSecureSocket.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//354593002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37647 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 09:40:48 +00:00
ajohnsen@google.com e362db67d1 Clean up secure socket connect.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//262923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35686 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 09:25:09 +00:00
ajohnsen@google.com 29ff79cff3 Use Socket::connect for SecureSocket as well.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//262833002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35679 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 06:52:11 +00:00
ajohnsen@google.com 59feb2f848 Fix secure socket filter after edge-triggering.
The read events would happen through the microtask-queue, thus blocking
the filter from returning. We now pause for read events when buffer is
full, and continue when the filter is done processing.

BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org//170843010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32782 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 10:46:45 +00:00
ajohnsen@google.com 140fddd06e Make event-handlers edge-triggered and move socket-state to Dart.
This eliminates to pause/resume calls made in the previous one-shot based model.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//169383003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32780 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 09:44:26 +00:00
sgjesse@google.com e8c1b76526 Change RawSocket.secureServer and RawSoccket.secure to fail on paused subscriptions
R=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//158773002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32499 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 13:43:28 +00:00
lrn@google.com a6d4c0b996 Code cleanup (mostly io lib and some http lib).
- Unused function removed,
- Make properties always appear before methods,
- Use dart idioms where possible.

BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//124753002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31602 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 12:03:11 +00:00
sgjesse@google.com 4ca4f0db07 Only store the address bytes for an internet address in Dart
We used to store the full C "struct sockaddr_storage" in the Dart
internet address. Changed this to be only the bytes for the
address. This removes opaque platform specific binary data from Dart
(e.g. on Mac OS the "struct sockaddr" has an initial length byte).

R=ajohnsen@google.com
BUG=

Review URL: https://codereview.chromium.org//113923004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31191 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-17 15:35:11 +00:00
ajohnsen@google.com 57d8b90fe1 Rename remoteHost to remoteAddress on *Socket.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//59213003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29904 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 13:24:49 +00:00
floitsch@google.com 4be547c705 Adapt streams for additional stackTrace argument.
R=lrn@google.com

Review URL: https://codereview.chromium.org//25094002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28511 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 12:02:20 +00:00
ajohnsen@google.com 3e0a59b920 Clean up IOService implementation to be shared between patched and non-patched code.
BUG=

Review URL: https://codereview.chromium.org//24596003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27888 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:53:54 +00:00
ajohnsen@google.com 6a58b2fc67 Remove unused library patch code.
BUG=

Review URL: https://codereview.chromium.org//24479004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27887 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:39:27 +00:00
ajohnsen@google.com a347038cd7 Merge services into a shared IOService in dart:io, and use a native port.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//24395013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27883 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:03:24 +00:00
whesse@google.com 30aaf877c6 Fix error in SecureSocket, remove failing status from tests.
BUG=dartbug.com/12451
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23253004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26350 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 12:53:52 +00:00
sgjesse@google.com affa849184 Remove the certificate management methods from dart:io
Certificate management functions where added to dart:io in r25610 and
r26002. However these functions where mutating the NSS database for
the whole Dart process, and some functions where also persisting the
changes to the database.

This might cause issues when running multiple isolates as changes in
one isolate will affect other isolates and could lead to unexpected
results.

These functions are removed from dart:io for now.

BUG=http://dartbug.com/8227
TBR=ager@google.com

Review URL: https://codereview.chromium.org//22887014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26194 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 14:55:53 +00:00
whesse@google.com 292f34bdb3 dart:io | Add SecureSocket.importPrivateCertificates, that reads a PKCS#12 file.
Add private key with certificate to SecureSocket

BUG=
R=sgjesse@google.com, wtc@chromium.org

Review URL: https://codereview.chromium.org//21716004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26002 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-12 13:50:53 +00:00
whesse@google.com 9e27f1b98b Add SecureSocket.addCertificate.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//18097007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25610 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 10:01:07 +00:00
whesse@google.com de49b902db dart:io | Ensure that close() returns a Future<this> on all (Raw)?(Secure)?(Server)?Socket classes and implementations.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//20722003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25520 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 13:45:50 +00:00
whesse@google.com e550079125 dart:io | Fix handling of exceptions from onBadCertificate callback.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//20316002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25519 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 13:39:18 +00:00
whesse@google.com c256ddfe10 dart:io | Support connection renegotiation (rehandshake) on SecureSocket.
BUG=dartbug.com/11384
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//18984008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24916 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-11 14:02:49 +00:00
whesse@google.com 686724212d dart:io | Pass errors from multithreaded encryption back to Dart.
BUG=dartbug.com/11383
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//18500006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24765 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-04 09:21:01 +00:00
whesse@google.com 35a1ad2519 dart:io | Fix error in RawSecureSocket.read.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//18608007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24724 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-03 13:31:50 +00:00
whesse@google.com 7db2572902 dart:io | Change names for SecureSocket exceptions.
BUG=
R=ajohnsen@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//17589007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24405 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 13:54:42 +00:00
whesse@google.com 91deb19914 dart:io | Enable multithreaded secure networking encryption.
BUG=
R=ajohnsen@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//16858011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24233 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 15:06:43 +00:00
sgjesse@google.com 54f6939ffc Ensure that there is no "hidden" DNS lookup in secure socket code
The required setting of the internet adddress of the peer for NSS is
now using the internet address which have already been looked up in
Dart code for normal secure socket connect.

In the cases where SecureSocket.secure and RawSecureSocket.secure is
used with a host name, the internet address of the already connected
socket will be used. If that is not sufficient an IntetnetAddress from
DNS lookup in Dart can be passed instead of just a host name.

R=ajohnsen@google.com, whesse@google.com
BUG=http://dartbug.com/11103

Review URL: https://codereview.chromium.org//17381012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24174 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 09:07:43 +00:00
whesse@google.com 23b00f5d01 Fix function renaming typo - change CarryOver to Buffered.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16924009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23996 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 16:25:55 +00:00
whesse@google.com b5af633ff8 dart:io | Rename optional carryOverData argument to SecureSocket.secureServer to bufferedData.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16952005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23992 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:59:44 +00:00
ajohnsen@google.com 5ce3b9ddea Clean up dart:io exceptions.
- Introduce IOException.
- Remove HttpParserException.
- Merge RedirectLimitExceededException and RedirectLoopException into
RedirectException.
- Remove 'IO' from FileIOException, DirectoryIOException, LinkIOException
and SocketIOException.

BUG=https://code.google.com/p/dart/issues/detail?id=9955
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16123036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23848 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:15:46 +00:00
whesse@google.com 9f4ce201ce dart:io | Add documentation for the default root certificate database for secure networking.
BUG=dartbug.com/8229, dartbug.com/8250
R=lrn@google.com

Review URL: https://codereview.chromium.org//16081005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23460 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 09:08:51 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
ajohnsen@google.com 954ba85c7a Always connect using HOST_NAME, but swicth on host source on secure upgrade, in secure_upgrade test.
BUG=

Review URL: https://codereview.chromium.org//14771007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22247 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 14:27:57 +00:00
ajohnsen@google.com 9def654ef1 Use correct address host for NSS.
BUG=

Review URL: https://codereview.chromium.org//14766005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22244 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 13:19:41 +00:00
sgjesse@google.com c10ddafcd0 Fix upgrade to secure issue
Ensure that no raw socket events go to the raw socket being upgraded to a secure socket.

R=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//14641002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22177 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 12:01:37 +00:00
sgjesse@google.com 329e876f24 Add HTTP proxy tunnel support
The HTTP client will now use the CONNECT method with a proxy
server for all HTTPS requests. The CONNECT method will establish
a tunnel and a TLS end-to-end connection will then be created
through that tunnel.

The previous method of sending a HTTPS url as the request URI is no
longer supported. Also it is not possible to configure normal HTTP
requests to go through a tunnel created with CONNECT. All HTTP
requests use the normal procedure when going through a proxy.

Add the ability to specify a host name when creating a secure
sonnection on top of a non-secure one. This is required for a
proxy tunnel as the initial connection is to a different host as
the one the TLS connection will be with.

R=ager@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=5468

Review URL: https://codereview.chromium.org//14493015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22119 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-29 13:30:12 +00:00
ajohnsen@google.com 55963a1a6d Add new InternetAddress class with a static lookup function (including IPv6
results).

Reapply of https://codereview.chromium.org/13880029/ with fixes.

BUG=

Review URL: https://codereview.chromium.org//14469002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21934 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 09:26:58 +00:00
ajohnsen@google.com 60946b53fc Revert "Add new InternetAddress class with a static lookup function (including IPv6 results)."
Revert "Attempt to fix strict align issue."
Revert "Trying another fix."

BUG=

Review URL: https://codereview.chromium.org//14036017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21928 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 08:10:00 +00:00
ajohnsen@google.com 20d1f5ddda Add new InternetAddress class with a static lookup function (including IPv6 results).
Reapply of https://codereview.chromium.org/14083007/ with fixes.

BUG=

Review URL: https://codereview.chromium.org//13880029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21923 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 07:12:05 +00:00
sgjesse@google.com afcb3ce69e Revert "Add new InternetAddress class with a static lookup function (including IPv6 results)"
TBR=ajohnsen@google.com

Review URL: https://codereview.chromium.org//14081024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21865 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 10:07:03 +00:00
ajohnsen@google.com b33d142414 Add new InternetAddress class with a static lookup function (including IPv6 results).
Socket.connect/ServerSocket.bind now accepts IPv6 host names. If a new ServerSocket is connected to an IPv6 interface, it will (if possible) support incoming IPv4 connections as well.

BUG=

Review URL: https://codereview.chromium.org//14083007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21862 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 09:36:18 +00:00
sgjesse@google.com efcd056ebe Support upgrading sockets to secure sockets
This build on the support for upgrading raw sockets to raw secure sockets.

R=ajohnsen@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=8789

Review URL: https://codereview.chromium.org//14034012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21859 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 06:50:59 +00:00
sgjesse@google.com 9216562647 Try to fix flakiness of test standalone/io/raw_secure_server_socket_test
The test tests/standalone/io/raw_secure_server_socket_test.dart could
complete the same future twice. This should fix that.

R=ager@google.com
BUG=

Review URL: https://codereview.chromium.org//14189020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21739 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 12:27:58 +00:00
sgjesse@google.com e1aa202b58 Add the ability to secure an already established raw socket connection
The static methods secure and secureServer can be used to start
TLS handshake as eihter client or server.

This CL only implement the securing of RawSocket.

This also changes the semantics of cancelling a subscription on a
RawSocket from closing the socket to just pausing.

R=ager@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=8789

Review URL: https://codereview.chromium.org//13502004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21719 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 07:37:37 +00:00
floitsch@google.com 466d6670c1 Refactor Future constructors.
BUG=

Review URL: https://codereview.chromium.org//14070010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21517 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 21:24:27 +00:00
floitsch@google.com 255cd36428 Fixes.
Review URL: https://codereview.chromium.org//14113017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21504 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 19:45:46 +00:00
floitsch@google.com 5431a5af54 Remove AsyncError with Expando.
Review URL: https://codereview.chromium.org//14251006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21498 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:32 +00:00
floitsch@google.com f553392322 Change StreamController constructor.
Review URL: https://codereview.chromium.org//14196003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21472 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:34:26 +00:00
floitsch@google.com e2ee353940 Rename unsubscribeOnError to cancelOnError.
Review URL: https://codereview.chromium.org//14251013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21469 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:07:36 +00:00
floitsch@google.com bebe3ac2cd Refactor List.setRange function.
Review URL: https://codereview.chromium.org//13863012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21452 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 13:52:29 +00:00
floitsch@google.com 285849c801 Change hasSubscribers to hasListener.
Review URL: https://codereview.chromium.org//14103010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21337 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 09:30:05 +00:00