From 51b94f79bc49038646ed7d131724dda99b1afce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 10 Jun 2024 23:28:03 +0200 Subject: [PATCH] crypto: improve GetECGroupBits signature Remove the unused ECPointer argument and rename the function since the current name is misleading. PR-URL: https://github.com/nodejs/node/pull/53364 Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- src/crypto/crypto_common.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index ee1c7931a5c83e..db6e389dbadde7 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -441,10 +441,7 @@ MaybeLocal GetECPubKey( nullptr).FromMaybe(Local()); } -MaybeLocal GetECGroup( - Environment* env, - const EC_GROUP* group, - const ECPointer& ec) { +MaybeLocal GetECGroupBits(Environment* env, const EC_GROUP* group) { if (group == nullptr) return Undefined(env->isolate()); @@ -1324,14 +1321,10 @@ MaybeLocal X509ToObject( } else if (ec) { const EC_GROUP* group = EC_KEY_get0_group(ec.get()); - if (!Set(context, - info, - env->bits_string(), - GetECGroup(env, group, ec)) || - !Set(context, - info, - env->pubkey_string(), - GetECPubKey(env, group, ec))) { + if (!Set( + context, info, env->bits_string(), GetECGroupBits(env, group)) || + !Set( + context, info, env->pubkey_string(), GetECPubKey(env, group, ec))) { return MaybeLocal(); }