Skip to content

Commit 0f1889b

Browse files
committed
Fixed sizeof parameter references
1 parent d9c2290 commit 0f1889b

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

common/bolt12.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool bolt12_check_signature(const struct tlv_field *fields,
8383
return secp256k1_schnorrsig_verify(secp256k1_ctx,
8484
sig->u8,
8585
shash.u.u8,
86-
sizeof(shash.u.u8),
86+
sizeof(shash),
8787
&key->pubkey) == 1;
8888
}
8989

devtools/bolt12-cli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static bool print_signature(const char *messagename,
321321
if (secp256k1_schnorrsig_verify(secp256k1_ctx,
322322
sig->u8,
323323
shash.u.u8,
324-
sizeof(shash.u.u8),
324+
sizeof(shash),
325325
&node_id->pubkey) != 1) {
326326
fprintf(stderr, "%s: INVALID\n", fieldname);
327327
return false;

lightningd/offer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void hsm_sign_b12(struct lightningd *ld,
7777
/* Now we sanity-check! */
7878
sighash_from_merkle(messagename, fieldname, merkle, &sighash);
7979
if (secp256k1_schnorrsig_verify(secp256k1_ctx, sig->u8,
80-
sighash.u.u8, sizeof(sighash.u.u8), &key->pubkey) != 1)
80+
sighash.u.u8, sizeof(sighash), &key->pubkey) != 1)
8181
fatal("HSM gave bad signature %s for pubkey %s",
8282
type_to_string(tmpctx, struct bip340sig, sig),
8383
type_to_string(tmpctx, struct point32, key));

plugins/fetchinvoice.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static struct command_result *handle_invreq_response(struct command *cmd,
218218

219219
if (!inv->signature
220220
|| secp256k1_schnorrsig_verify(secp256k1_ctx, inv->signature->u8,
221-
sighash.u.u8, sizeof(sighash.u.u8), &inv->node_id->pubkey) != 1) {
221+
sighash.u.u8, sizeof(sighash), &inv->node_id->pubkey) != 1) {
222222
badfield = "signature";
223223
goto badinv;
224224
}

plugins/offers_inv_hook.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ struct command_result *handle_invoice(struct command *cmd,
387387
if (secp256k1_schnorrsig_verify(secp256k1_ctx,
388388
inv->inv->signature->u8,
389389
shash.u.u8,
390-
sizeof(shash.u.u8),
390+
sizeof(shash),
391391
&inv->inv->node_id->pubkey) != 1) {
392392
return fail_inv(cmd, inv, "Bad signature");
393393
}

plugins/offers_invreq_hook.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static bool check_payer_sig(struct command *cmd,
433433

434434
if (secp256k1_schnorrsig_verify(secp256k1_ctx,
435435
sig->u8,
436-
sighash.u.u8, sizeof(sighash.u.u8), &payer_key->pubkey) == 1)
436+
sighash.u.u8, sizeof(sighash), &payer_key->pubkey) == 1)
437437
return true;
438438

439439
if (!deprecated_apis)
@@ -447,7 +447,7 @@ static bool check_payer_sig(struct command *cmd,
447447

448448
return secp256k1_schnorrsig_verify(secp256k1_ctx,
449449
sig->u8,
450-
sighash.u.u8, sizeof(sighash.u.u8), &payer_key->pubkey) == 1;
450+
sighash.u.u8, sizeof(sighash), &payer_key->pubkey) == 1;
451451
}
452452

453453
static struct command_result *invreq_amount_by_quantity(struct command *cmd,

0 commit comments

Comments
 (0)