Skip to content

Commit

Permalink
tls: use SSL_get_peer_tmp_key
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tniessen authored and bmeck committed Jun 22, 2024
1 parent 298b942 commit 1fd7491
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,7 @@ MaybeLocal<Object> GetEphemeralKey(Environment* env, const SSLPointer& ssl) {

EscapableHandleScope scope(env->isolate());
Local<Object> 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> context = env->context();
crypto::EVPKeyPointer key(raw_key);
Expand Down

0 comments on commit 1fd7491

Please sign in to comment.