Commit Graph

39 Commits

Author SHA1 Message Date
Zach Anderson 522ce88fe6 Implements remaining SecurityContext calls for iOS
BUG=
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1852783003 .
2016-04-13 10:27:39 -07:00
Zachary Anderson 7308e58c3f Really remove io support when dart:io is unsupported.
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.

R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1839463002 .
2016-03-29 11:22:03 -07:00
Zachary Anderson b10f3e7be9 Some build file cleanup
R=iposva@google.com

Review URL: https://codereview.chromium.org/1824053002 .
2016-03-22 13:29:26 -07:00
Zach Anderson e900b1b944 Implements secure sockets on Mac OS with SecureTransport API
R=iposva@google.com

Review URL: https://codereview.chromium.org/1721283002 .
2016-03-21 15:46:29 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
Zachary Anderson a28bfa9879 Fixes error handling, leaks in secure sockets.
- Peer certificate was leaked, cert passed to bad cert callback could
  could become stale.
  - Added finalizer.
- Failing to call Destroy would leak various things.
  - Added finalizer.
- ThrowIfError in initialization would fail to deallocate various
  things on an error.
  - Replaced with explicit checks, and deallocation where needed.

R=iposva@google.com, whesse@google.com

Review URL: https://codereview.chromium.org/1746363002 .
2016-03-01 22:12:20 -08:00
Zachary Anderson 53dec5d35f Fix PEM error checking
While reading PEM data, if we encounter PEM_R_NO_START_LINE, and some
data has been read successfully, we assume that we have reached the
end of the data.

If we encounter PEM_R_NO_START_LINE, and no data has been read
successfully, we assume that the data is not PEM, and we try instead
to read it as PKCS12.

Otherwise, we assume it is malformed PEM, and propagate an error.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1689873003 .
2016-02-12 19:01:47 -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
William Hesse b033893060 Initialize member to NULL in SecureSocket.
BUG=

Review URL: https://codereview.chromium.org//1318843005 .
2015-09-03 11:32:06 +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
johnmccutchan@google.com 172baa03ff Service isolate rework take 2
Review URL: https://codereview.chromium.org//889443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +00:00
johnmccutchan@google.com db271b0477 Revert r43217, r43215, r43208, r43207, and r43202.
Reverting because of some isolate spawn issues (on Windows, and pub bots).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00
johnmccutchan@google.com 66aa470fc6 * Create vm-service isolate at Dart_Initialize time.
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.

performance changes:

no service isolate:

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

always start service isolate (as a thread pool task):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | -    0]

service does I/O (calls to Dart_LoadScript block until service is running):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +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
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
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
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 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
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
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
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 7244fff5b4 dart:io | Improve NSS and SSL error messages for secure networking.
BUG=dartbug.com/9688
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23586 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 11:06:00 +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
asiva@google.com 89ef11e004 Final step towards loading core library scripts directly from the sources
- Modify bin.gypi to ensure that the io library and patch files are read
  directly from the sources. Remove the source buffer generation step in
  the gypi files for all the io library and patch files.

- Restructure the code a bit to eliminate some code duplication.

- Delete runtime/tools/concat_library.py

R=ager@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22514 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-08 16:42:46 +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
whesse@google.com 62a9af5ae9 Speed up secure sockets by increasing encrypted buffer size.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16921 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 14:24:57 +00:00
whesse@google.com ee2a8fe7d6 Add automatic initialization of SecureSocket library.
BUG=dart:7541

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16384 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-20 18:17:07 +00:00
whesse@google.com ff80433b70 Add client certificates to HttpsServer and HttpClient.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16097 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 10:10:17 +00:00
whesse@google.com f542f14380 Enable client certificates in SecureSocket and SecureServerSocket
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15957 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 09:26:23 +00:00
whesse@google.com 4eeedf0cab Add a callback to SecureSocket for certificates that fail to be authenticated.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15734 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 14:31:51 +00:00
whesse@google.com 7bc0bbd284 Add built-in root certificates to dart:io SecureSocket.
Add flag that allows them to disabled at runtime.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15634 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-03 13:15:51 +00:00
whesse@google.com 15d5c6b582 Rename TlsSocket to SecureSocket, and all other Tls... items to Secure....
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15274 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-23 09:21:48 +00:00