diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-03-27 12:10:48 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-03-28 14:03:25 -0700 |
commit | 8c69e06972b5b0aa7e45163f860fb63d90203289 (patch) | |
tree | 7c3260ada43e49a4c867f7e37fb693ec01de0a4a /src | |
parent | bcbd35a48d00c915690682b546e6c282bd15150b (diff) | |
download | android-node-v8-8c69e06972b5b0aa7e45163f860fb63d90203289.tar.gz android-node-v8-8c69e06972b5b0aa7e45163f860fb63d90203289.tar.bz2 android-node-v8-8c69e06972b5b0aa7e45163f860fb63d90203289.zip |
tls: return an OpenSSL error from renegotiate
A generic error lacks any of the context or detail of the underlying
OpenSSL error, so throw from C++, and report the OpenSSL error to the
callback.
PR-URL: https://github.com/nodejs/node/pull/26868
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_crypto.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index c86414fc62..649ef9d5b4 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2339,9 +2339,9 @@ void SSLWrap<Base>::Renegotiate(const FunctionCallbackInfo<Value>& args) { ClearErrorOnReturn clear_error_on_return; - // TODO(@sam-github) Return/throw an error, don't discard the SSL error info. - bool yes = SSL_renegotiate(w->ssl_.get()) == 1; - args.GetReturnValue().Set(yes); + if (SSL_renegotiate(w->ssl_.get()) != 1) { + return ThrowCryptoError(w->ssl_env(), ERR_get_error()); + } } |