Commit Graph

62 Commits

Author SHA1 Message Date
Zachary Anderson 98771a083f Adds SecurityContext.usePrivateKeyBytes
This is the first step toward removing blocking IO calls from
the implementation of the SecurityContext API.

Using a buffer rather than a file name API will probably be needed
for implementing SecurityContext and SecureSocket with platform
specific built-in APIs on iOS/Mac/Windows rather than BoringSSL.

related #8227

R=whesse@google.com

Review URL: https://codereview.chromium.org/1616073004 .
2016-01-29 08:52:18 -08:00
William Hesse 169b132a63 Add unique serial numbers to sample X509 certificates. Remove the "sendClientCertificate" parameter from SecureSocket.connect.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1420923006 .
2015-10-29 13:17:22 +01:00
Ryan Macnak 371a5dc932 Get tools/test.py --noopt green.
More specifically ./tools/test.py --noopt -mall -ax64,simarm,simarm64,simmips --exclude-suite=pkg

 - Add missing dart:io entry point.
 - Add checks that Dart_FinalizeLoading, Dart_Precompile, Dart_CreatePrecompiledSnapshot are called in order.
 - Add checks for --precompilation flag.
 - Add checks for dropped class in Dart_New/Allocate/AllocateWithNativeFields.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1407393005 .
2015-10-21 10:35:01 -07:00
William Hesse b519e4c000 Add support for client certificates to Secure[Server]Socket
BUG=https://github.com/dart-lang/sdk/issues/24069
BUG=https://github.com/dart-lang/sdk/issues/24070
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1416843003 .
2015-10-20 17:18:57 +02:00
William Hesse 2fe4005dc3 Pass BoringSSL error messages from C++ IO threads back into to Dart.
BUG=https://github.com/dart-lang/sdk/issues/24185
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1397343002 .
2015-10-12 15:06:29 +02:00
William Hesse 0b5fcedaaa Use strlen rather than strnlen, which is missing on Mac OS.
BUG=

Review URL: https://codereview.chromium.org/1390793002 .
2015-10-06 16:48:47 +02:00
William Hesse da574129a8 Add full BoringSSL error information to Dart exceptions it throws.
Fix error in http_proxy_advanced_test.

BUG=https://github.com/dart-lang/sdk/issues/24183
BUG=https://github.com/dart-lang/sdk/issues/24068
BUG=https://github.com/dart-lang/sdk/issues/24074
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1386023003 .
2015-10-06 16:30:10 +02:00
William Hesse 0c2bea237f Add check for password length in SecurityContext. Check return values from BoringSSL functions, throw exceptions.
BUG=https://github.com/dart-lang/sdk/issues/24182
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1384533002 .
2015-10-05 13:51:01 +02:00
William Hesse e5ebc9c630 Free copy of hostname in SecureSocket implementation.
BUG=https://github.com/dart-lang/sdk/issues/24186
BUG=https://github.com/dart-lang/sdk/issues/24225
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1383713002 .
2015-10-01 17:28:32 +02:00
William Hesse 1b5e4cc506 Enable SNI hostname extension in SecureSocket.
BUG=https://github.com/dart-lang/sdk/issues/24330
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1384463003 .
2015-10-01 17:28:06 +02:00
William Hesse 322a735424 Allow X509 certificate chains where we trust a certificate in the middle of the chain.
BUG=https://github.com/dart-lang/sdk/issues/24330
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1381673002 .
2015-09-30 15:25:45 +02:00
William Hesse 2a091441a1 Fix two memory leaks in SecureSocket.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1308953007 .
2015-09-03 10:43:16 +02:00
William Hesse db97aa7e96 Fix hostname checking problem in SecureSocket
BUG=https://github.com/dart-lang/sdk/issues/24071
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1308773005 .
2015-08-28 10:08:34 +02:00
William Hesse 891c36a8e0 Do not request a client certificate as the default for SSL.
BUG=

TBR=kustermann@google.com

Review URL: https://codereview.chromium.org//1313393003 .
2015-08-26 18:48:24 +02:00
William Hesse 13bf8ff9f8 Breaking Change: merge BoringSSL branch into master
This replaces the NSS secure networking library from Mozilla
with the BoringSSL library from Google. This library, based
on OpenSSL, reads certificates from files in PEM format, rather
than storing certificates and keys in a SQLite database, the
way NSS does. There will be a blog post, changelog entries,
and other documentation of the breaking changes.

Review URL: https://codereview.chromium.org//1319703002 .
2015-08-26 14:42:12 +02:00
sgjesse@google.com 3fe2af43d1 Reafctor to use 'const RawAddr&' or 'RawAddr*' in the eventhandler code
Also pass the port as part of RawAddr instead of in a separate argument
when both addr and port are passed.

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43722 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 11:39:20 +00:00
kustermann@google.com 53cc8c512d Support for the ALPN extension of the TLS protocol for Client and Server
This CL uses the NSS support for the ALPN extension of the TLS protocol
(see RFC 7301).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41628 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 12:31:02 +00:00
whesse@google.com 0b9b34eb7f Update NSS to 3.16.4. Updated to Chromium's copy of NSS at revision 291806
Includes a fix for an Android L issue.

R=ricow@google.com, sgjesse@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40430 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 10:40:40 +00:00
iposva@google.com 5a383e7add - Make sure that the threads for dart::bin are in the correct namespace.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39233 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 00:06:04 +00:00
iposva@google.com 14ecdbd66a - Separate the thread implementation used in bin/ and vm/
to allow us to make VM specific changes.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
whesse@google.com 3529ba0a7e Modify secure_socket.cc to use new NSS memio api.
R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34236 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 09:25:36 +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
whesse@google.com dd65cd9c50 Enable more ciphers, and TLS 1.2, in SecureSocket.
BUG=dartbug.com/14646
R=ajohnsen@google.com, wtc@chromium.org

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30897 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 16:26:48 +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 9981feb28b dart:io | Enable connection cache for secure networking clients.
BUG=dartbug.com/7230

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27875 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 11:20:05 +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
asiva@google.com b4d9e0d620 Auto create ApiLocalScope before calling native functions, this ensures that
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.

Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.

R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +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 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 62700f8b0a dart:io | Fix SecureSocket client certificate problem with database password.
BUG=
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24907 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-11 10:02:11 +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
ajohnsen@google.com 900dba8e03 Remove static mutexes/monitors from dart:io.
BUG=
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24576 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 08:44:15 +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
ajohnsen@google.com 4624420914 Add NetworkAdaptor to dart:io.
NetworkAdaptor contains a static method, list, that will query the
underlaying system for active network adaptors.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24267 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:58:48 +00:00
asiva@google.com 45445820da Replace uses of Dart_GetClass with Dart_GetType and Dart_InstanceGetClass with Dart_InstanceGetType (The idea is to deprecate Dart_GetClass and Dart_InstanceGetClass from the API)
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24244 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 18:11:47 +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
iposva@google.com 1836035266 - Modify dart_api.h to be a proper C API.
- Verify that dart_api.h can be used from C
  by changing the test_extension to be a pure C file.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +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
whesse@google.com 5d0200609b dart:io | Change the way SecureSocket initializes the NSS library with an empty database.
BUG=dartbug.com/7104

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21363 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 15:22:45 +00:00
asiva@google.com f930e3856b Add typed data interface to Dart API, this only changes the C++ API as dicussed in a previous email. The dart code in the library has not been changed yet.
Review URL: https://codereview.chromium.org//12255018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18846 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:43:44 +00:00
sgjesse@google.com 488b016a2f Merge IO v2 branch to bleeding edge
R=ager@google.com, ajohnsen@google.com, whesse@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00