Alexander Aprelev
340f78eab3
[vm/io] Add a test for nonblocking ssl certification evaluation.
...
This is follow-up to a6dafabb88 .
Fixes https://github.com/dart-lang/sdk/issues/43674
Change-Id: I4da732ab08235a1f549d45c7fa5fb87db672e2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166701
Commit-Queue: Alexander Aprelev <aam@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-10-12 15:06:52 +00:00
Alexander Aprelev
a6dafabb88
[vm/io/mac] On macos/ios run trust evaluation part of ssl certification validation on separate worker thread.
...
Running trust evaluation system api call on worker thread effectively unblocks main isolate when it attempts to establish https connection.
Execution of the worker thread is implemented via dart native port infrastructure which allows to run C++ code as a dart message handler.
TrustEvaluateHandlerFunc (if provided by platform-dependent SSLCertContext) is that handler, only mac(ios) implementation provides it.
Asynchrony of CertificateVerificationCallback (for mac/ios) is implemented via [ssl_verify_retry] return code which allows to suspend ssl handshake until certificate trust is confirmed.
When dart's _RawSecureSocket.secureHandshake() method that initiated ssl's handshake received this return code it knows it has to wait for a future that is completed by another callback([rpEvaluteResponse]) that waits for trust evaluation handler response.
rpEvaluateResponse purpose is to listen for response from TrustEvaluateHandler and also invoke user-provided [badCertficateCallback] that can override trust decision for a given connection request, for a given certificate.
Once that future is completed and CertificateVerificationCallback knows whether to trust a certificate or not, _secureHandshake retries ssl handshake.
Bug: https://github.com/dart-lang/sdk/issues/41519
Change-Id: Ifee18639c78099ec77cad50000444bc6c7b9369b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165520
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Alexander Aprelev <aam@google.com >
2020-10-01 23:40:16 +00:00
Zichang Guo
d5a1b84997
Add certs from Windows root stores to SSL trust store
...
Bug: https://github.com/dart-lang/sdk/issues/32131
Change-Id: I5f5890e8c6d0c4ff8c51ef7017f204d73ff9c4bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159202
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Zach Anderson <zra@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-08-20 02:14:08 +00:00
Ben Konyi
3224a6633b
[ VM / dart:io ] Replace usage of SecTrustEvaluate with SecTrustEvaluateWithError on MacOS >= 10.14
...
SecTrustEvaluate is now deprecated as of 10.15.
Fixes https://github.com/dart-lang/sdk/issues/38887
Change-Id: Id057ef47d4c4be0ad012203dbabc0266be58ad8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123556
Commit-Queue: Ben Konyi <bkonyi@google.com >
Reviewed-by: Zach Anderson <zra@google.com >
2019-10-31 22:17:17 +00:00
Dan Field
034fce1e39
[dart:io] unbreak build
...
Change-Id: Ia8965e62f4b89a80aeb6db1489ca45c6db321adc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102640
Reviewed-by: Régis Crelier <regis@google.com >
Auto-Submit: Dan Field <dnfield@google.com >
Commit-Queue: Régis Crelier <regis@google.com >
2019-05-15 19:13:29 +00:00
Dan Field
7f323feefe
[dart:io] Fix iOS https leaks
...
Add move constructor and equality operators to
ScopedCFType, add specialized destructor for arrays.
Add release to ScopedCFType.
Use ScopedCFType for SecCertificateRef.
Bug: https://github.com/dart-lang/sdk/issues/36935
Change-Id: I7b40f23fb8f0d7ab0835587e040362f883f86bd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102560
Reviewed-by: Zach Anderson <zra@google.com >
Auto-Submit: Dan Field <dnfield@google.com >
Commit-Queue: Zach Anderson <zra@google.com >
2019-05-15 17:53:49 +00:00
Ben Konyi
1dabf0d19c
[ VM / dart:io ] Removed usage of std::make_unique as C++14 is not supported in google3
...
Change-Id: I615bcb89ef2dec2e745a4d321a13a0a131ba7485
Reviewed-on: https://dart-review.googlesource.com/c/83230
Commit-Queue: Ben Konyi <bkonyi@google.com >
Commit-Queue: Siva Annamalai <asiva@google.com >
Auto-Submit: Ben Konyi <bkonyi@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2018-11-07 01:07:23 +00:00
Ben Konyi
7aacf7e188
[ VM / dart:io ] Fixed memory leak in SecurityContext on MacOS.
...
Fixes #33114 .
Change-Id: I6e2272c6d63b11bbd82c3d5b7c3aedf75306ba05
Reviewed-on: https://dart-review.googlesource.com/55523
Commit-Queue: Ben Konyi <bkonyi@google.com >
Reviewed-by: Zach Anderson <zra@google.com >
2018-05-18 20:17:49 +00:00
Zach Anderson
c117aeea3b
[dart:io] Check hostname when validating cert chains on MacOS
...
fixes #32936
Change-Id: Ic79ce7151cbeff1cf1d28908715c07c4e3b422d9
Reviewed-on: https://dart-review.googlesource.com/52342
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Zach Anderson <zra@google.com >
2018-04-23 22:39:32 +00:00
Zachary Anderson
d7845c6a6f
[standalone] Clean up command line argument parsing
...
fixes #30534
Change-Id: I5e721e5d24de32f0cb85f7bd96890913cf788f81
Reviewed-on: https://dart-review.googlesource.com/4608
Commit-Queue: Zach Anderson <zra@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2017-09-11 18:58:39 +00:00
Zachary Anderson
747868f2b1
[dart:io] Remove DART_IO_DISABLED
...
This was only used by Dartium.
Review-Url: https://codereview.chromium.org/3009523002 .
2017-08-24 11:17:52 -07:00
Zachary Anderson
6cd8a79078
VM: Re-format to use at most one newline between functions
...
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Alexander Aprelev
d86cb763b9
Add comma to the license so it matches license header in other files, doesn't result in new license text added in Flutter license inventory.
...
See https://github.com/flutter/engine/pull/3755 .
BUG=
R=bkonyi@google.com
Review-Url: https://codereview.chromium.org/2927703007 .
2017-06-08 12:19:30 -07:00
Ben Konyi
644862bf96
Ported SecureSocket to use BoringSSL on OSX and iOS. This included registering a callback with BoringSSL using SSL_CTX_set_cert_verify_callback, which overrides the BoringSSL certificate verification process, in order to verify certificates against the system's root certificates and then proceed to let BoringSSL handle the rest of the SSL session. In addition, this change includes refactoring to share BoringSSL code that used on all platforms.
...
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2903743002 .
2017-06-06 12:52:57 -07:00