From faa5cac18c1f77e795e3545adac5873040b8dd21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 13 Jun 2024 16:37:36 +0200 Subject: [PATCH] tls: use SSL_get_peer_tmp_key Both OpenSSL 1.1.1 and 3.x support SSL_get_peer_tmp_key as a replacement for SSL_get_server_tmp_key. While the old function name still exists as an alias, it does not accurately reflect the function's behavior (anymore). Hence, use the new function name here. PR-URL: https://github.com/nodejs/node/pull/53366 Reviewed-By: Filip Skokan Reviewed-By: Tim Perry Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli --- src/crypto/crypto_common.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index db6e389dbadde7..ccfb51fe745d6a 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -1101,8 +1101,7 @@ MaybeLocal GetEphemeralKey(Environment* env, const SSLPointer& ssl) { EscapableHandleScope scope(env->isolate()); Local info = Object::New(env->isolate()); - if (!SSL_get_server_tmp_key(ssl.get(), &raw_key)) - return scope.Escape(info); + if (!SSL_get_peer_tmp_key(ssl.get(), &raw_key)) return scope.Escape(info); Local context = env->context(); crypto::EVPKeyPointer key(raw_key);