Skip to content

Commit

Permalink
crypto: improve GetECGroupBits signature
Browse files Browse the repository at this point in the history
Remove the unused ECPointer argument and rename the function since the
current name is misleading.  The remaining changes are mandated by
format-cpp.
  • Loading branch information
tniessen committed Jun 6, 2024
1 parent 1aab854 commit aeaab54
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -433,18 +433,11 @@ MaybeLocal<Value> GetECPubKey(
if (pubkey == nullptr)
return Undefined(env->isolate());

return ECPointToBuffer(
env,
group,
pubkey,
EC_KEY_get_conv_form(ec.get()),
nullptr).FromMaybe(Local<Object>());
return ECPointToBuffer(env, group, pubkey, EC_KEY_get_conv_form(ec), nullptr)
.FromMaybe(Local<Object>());
}

MaybeLocal<Value> GetECGroup(
Environment* env,
const EC_GROUP* group,
const ECPointer& ec) {
MaybeLocal<Value> GetECGroupBits(Environment* env, const EC_GROUP* group) {
if (group == nullptr)
return Undefined(env->isolate());

Expand Down Expand Up @@ -1324,14 +1317,10 @@ MaybeLocal<Object> X509ToObject(
} else if (ec) {
const EC_GROUP* group = EC_KEY_get0_group(ec.get());

if (!Set<Value>(context,
info,
env->bits_string(),
GetECGroup(env, group, ec)) ||
!Set<Value>(context,
info,
env->pubkey_string(),
GetECPubKey(env, group, ec))) {
if (!Set<Value>(
context, info, env->bits_string(), GetECGroupBits(env, group)) ||
!Set<Value>(
context, info, env->pubkey_string(), GetECPubKey(env, group, ec))) {
return MaybeLocal<Object>();
}

Expand Down

0 comments on commit aeaab54

Please sign in to comment.