diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-12-23 05:55:37 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-01-14 14:49:41 +0100 |
commit | 9301b8a9c69d112b98c7d60e074c845d80342b4e (patch) | |
tree | fa9f8d98fc7eca29eb6283fa303f8e71976fbb03 /src/node_crypto.h | |
parent | 02fef8ad5a6c0e5c1ce0d4b46aa3a762935c981c (diff) | |
download | android-node-v8-9301b8a9c69d112b98c7d60e074c845d80342b4e.tar.gz android-node-v8-9301b8a9c69d112b98c7d60e074c845d80342b4e.tar.bz2 android-node-v8-9301b8a9c69d112b98c7d60e074c845d80342b4e.zip |
tls: make deprecated tls.createSecurePair() use public API
Make the deprecated `tls.createSecurePair()` method use other public
APIs only (`TLSSocket` in particular).
Since `tls.createSecurePair()` has been runtime-deprecated only
since Node 8, it probably isn’t quite time to remove it yet,
but this patch removes almost all of the code complexity that
is retained by it.
The API, as it is documented, is retained. However, it is very likely
that some users have come to rely on parts of undocumented API
of the `SecurePair` class, especially since some of the existing
tests checked for those. Therefore, this should definitely be
considered a breaking change.
PR-URL: https://github.com/nodejs/node/pull/17882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r-- | src/node_crypto.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h index b866117f84..7ce40697d4 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -328,7 +328,6 @@ class SSLWrap { void* arg); static int TLSExtStatusCallback(SSL* s, void* arg); static int SSLCertCallback(SSL* s, void* arg); - static void SSLGetter(const v8::FunctionCallbackInfo<v8::Value>& info); void DestroySSL(); void WaitForCertCb(CertCb cb, void* arg); @@ -364,87 +363,6 @@ class SSLWrap { friend class SecureContext; }; -// Connection inherits from AsyncWrap because SSLWrap makes calls to -// MakeCallback, but SSLWrap doesn't store the handle itself. Instead it -// assumes that any args.This() called will be the handle from Connection. -class Connection : public AsyncWrap, public SSLWrap<Connection> { - public: - ~Connection() override { -#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB - sniObject_.Reset(); - servername_.Reset(); -#endif - } - - static void Initialize(Environment* env, v8::Local<v8::Object> target); - void NewSessionDoneCb(); - -#ifndef OPENSSL_NO_NEXTPROTONEG - v8::Persistent<v8::Object> npnProtos_; - v8::Persistent<v8::Value> selectedNPNProto_; -#endif - -#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB - v8::Persistent<v8::Object> sniObject_; - v8::Persistent<v8::String> servername_; -#endif - - size_t self_size() const override { return sizeof(*this); } - - protected: - static void New(const v8::FunctionCallbackInfo<v8::Value>& args); - static void EncIn(const v8::FunctionCallbackInfo<v8::Value>& args); - static void ClearOut(const v8::FunctionCallbackInfo<v8::Value>& args); - static void ClearPending(const v8::FunctionCallbackInfo<v8::Value>& args); - static void EncPending(const v8::FunctionCallbackInfo<v8::Value>& args); - static void EncOut(const v8::FunctionCallbackInfo<v8::Value>& args); - static void ClearIn(const v8::FunctionCallbackInfo<v8::Value>& args); - static void Start(const v8::FunctionCallbackInfo<v8::Value>& args); - static void Close(const v8::FunctionCallbackInfo<v8::Value>& args); - -#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB - // SNI - static void GetServername(const v8::FunctionCallbackInfo<v8::Value>& args); - static void SetSNICallback(const v8::FunctionCallbackInfo<v8::Value>& args); - static int SelectSNIContextCallback_(SSL* s, int* ad, void* arg); -#endif - - static void OnClientHelloParseEnd(void* arg); - - int HandleBIOError(BIO* bio, const char* func, int rv); - - enum ZeroStatus { - kZeroIsNotAnError, - kZeroIsAnError - }; - - enum SyscallStatus { - kIgnoreSyscall, - kSyscallError - }; - - int HandleSSLError(const char* func, int rv, ZeroStatus zs, SyscallStatus ss); - - void SetShutdownFlags(); - - Connection(Environment* env, - v8::Local<v8::Object> wrap, - SecureContext* sc, - SSLWrap<Connection>::Kind kind); - - private: - static void SSLInfoCallback(const SSL *ssl, int where, int ret); - - BIO *bio_read_; - BIO *bio_write_; - - uint8_t hello_data_[18432]; - size_t hello_offset_; - - friend class ClientHelloParser; - friend class SecureContext; -}; - class CipherBase : public BaseObject { public: ~CipherBase() override { |