| Index: runtime/bin/tls_socket_patch.dart
|
| diff --git a/runtime/bin/tls_socket_patch.dart b/runtime/bin/tls_socket_patch.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..caa986be10e3b64239326f2bbc8ad13c3b19ef4d
|
| --- /dev/null
|
| +++ b/runtime/bin/tls_socket_patch.dart
|
| @@ -0,0 +1,48 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +patch class TlsSocket {
|
| + /* patch */ static void setCertificateDatabase(String pkcertDirectory)
|
| + native "TlsSocket_SetCertificateDatabase";
|
| +}
|
| +
|
| +
|
| +patch class TlsFilter {
|
| + /* patch */ factory TlsFilter() => new _TlsFilter();
|
| +}
|
| +
|
| +
|
| +/**
|
| + * _TlsFilter wraps a filter that encrypts and decrypts data travelling
|
| + * over a TLS encrypted socket. The filter also handles the handshaking
|
| + * and certificate verification.
|
| + *
|
| + * The filter exposes its input and output buffers as Dart objects that
|
| + * are backed by an external C array of bytes, so that both Dart code and
|
| + * native code can access the same data.
|
| + */
|
| +class _TlsFilter extends NativeFieldWrapperClass1 implements TlsFilter {
|
| + _TlsFilter() {
|
| + buffers = new List<_TlsExternalBuffer>(_TlsSocket.kNumBuffers);
|
| + for (int i = 0; i < _TlsSocket.kNumBuffers; ++i) {
|
| + buffers[i] = new _TlsExternalBuffer();
|
| + }
|
| + }
|
| +
|
| + void connect(String hostName) native "TlsSocket_Connect";
|
| +
|
| + void destroy() native "TlsSocket_Destroy";
|
| +
|
| + void handshake() native "TlsSocket_Handshake";
|
| +
|
| + void init() native "TlsSocket_Init";
|
| +
|
| + int processBuffer(int bufferIndex) native "TlsSocket_ProcessBuffer";
|
| +
|
| + void registerHandshakeCallbacks(Function startHandshakeHandler,
|
| + Function finishHandshakeHandler)
|
| + native "TlsSocket_RegisterHandshakeCallbacks";
|
| +
|
| + List<_TlsExternalBuffer> buffers;
|
| +}
|
|
|