summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-01-31 14:34:00 -0800
committerSam Roberts <vieuxtech@gmail.com>2019-02-05 15:16:58 -0800
commitcccc33b0b4b4ee719fedc5291934d490e50893c3 (patch)
tree5b420d1ff238e6f0ef82e15767fb8934d647c768 /src/tls_wrap.cc
parent80f92cf9af77916113bafae457231615101dbd2b (diff)
downloadandroid-node-v8-cccc33b0b4b4ee719fedc5291934d490e50893c3.tar.gz
android-node-v8-cccc33b0b4b4ee719fedc5291934d490e50893c3.tar.bz2
android-node-v8-cccc33b0b4b4ee719fedc5291934d490e50893c3.zip
src: const_cast is necessary for 1.1.1, not 0.9.7
The const_cast used to be necessary for SSL_get_app_data() in OpenSSL 0.9.7, but node doesn't compile against OpenSSL versions that old. However, now it's needed for the recently introduced SSL_renegotiate_pending(), which is not const-correct as of 1.1.1a. PR-URL: https://github.com/nodejs/node/pull/25861 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index da18522d37..ff2f53f15c 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -210,10 +210,9 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
if (!(where & (SSL_CB_HANDSHAKE_START | SSL_CB_HANDSHAKE_DONE)))
return;
- // Be compatible with older versions of OpenSSL. SSL_get_app_data() wants
- // a non-const SSL* in OpenSSL <= 0.9.7e.
+ // SSL_renegotiate_pending() should take `const SSL*`, but it does not.
SSL* ssl = const_cast<SSL*>(ssl_);
- TLSWrap* c = static_cast<TLSWrap*>(SSL_get_app_data(ssl));
+ TLSWrap* c = static_cast<TLSWrap*>(SSL_get_app_data(ssl_));
Environment* env = c->env();
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());