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: #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 targos committed Jun 20, 2024
1 parent ec5364f commit ac8adeb
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 ac8adeb

Please sign in to comment.