Skip to content

Commit 1fd7491

Browse files
tniessenbmeck
authored andcommitted
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: nodejs#53366 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
1 parent 298b942 commit 1fd7491

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/crypto/crypto_common.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,7 @@ MaybeLocal<Object> GetEphemeralKey(Environment* env, const SSLPointer& ssl) {
11011101

11021102
EscapableHandleScope scope(env->isolate());
11031103
Local<Object> info = Object::New(env->isolate());
1104-
if (!SSL_get_server_tmp_key(ssl.get(), &raw_key))
1105-
return scope.Escape(info);
1104+
if (!SSL_get_peer_tmp_key(ssl.get(), &raw_key)) return scope.Escape(info);
11061105

11071106
Local<Context> context = env->context();
11081107
crypto::EVPKeyPointer key(raw_key);

0 commit comments

Comments
 (0)