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.
  • Loading branch information
tniessen committed Jun 7, 2024
1 parent 5c3ecbe commit 80105b0
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 @@ -1104,8 +1104,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 80105b0

Please sign in to comment.