From 550af6d72fcbbfdca7b774ddf64b77d6d625060a Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 25 Jan 2019 10:38:41 -0800 Subject: [PATCH] src: remove unnecessary call to SSL_get_mode SSL_set_mode() bit-ORs its argument into the current mode, its not necessary for to do it ourself (though it doesn't cause harm). See: - https://www.openssl.org/docs/man1.1.0/ssl/SSL_set_mode.html - https://github.com/nodejs/node/blob/0ce615c4af/deps/openssl/openssl/ssl/ssl_lib.c#L2176-L2177 PR-URL: https://github.com/nodejs/node/pull/25711 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- src/tls_wrap.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 0ec66fc467e799..f510b20488b1bd 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -112,8 +112,7 @@ void TLSWrap::InitSSL() { SSL_set_verify(ssl_.get(), SSL_VERIFY_NONE, crypto::VerifyCallback); #ifdef SSL_MODE_RELEASE_BUFFERS - long mode = SSL_get_mode(ssl_.get()); // NOLINT(runtime/int) - SSL_set_mode(ssl_.get(), mode | SSL_MODE_RELEASE_BUFFERS); + SSL_set_mode(ssl_.get(), SSL_MODE_RELEASE_BUFFERS); #endif // SSL_MODE_RELEASE_BUFFERS SSL_set_app_data(ssl_.get(), this);