BOLT-offers #12: * - MUST fail the request if `signature` is not correct. */
| 424 | * - MUST fail the request if `signature` is not correct. |
| 425 | */ |
| 426 | static bool check_payer_sig(struct command *cmd, |
| 427 | const struct tlv_invoice_request *invreq, |
| 428 | const struct point32 *payer_key, |
| 429 | const struct bip340sig *sig) |
| 430 | { |
| 431 | struct sha256 merkle, sighash; |
| 432 | merkle_tlv(invreq->fields, &merkle); |
| 433 | sighash_from_merkle("invoice_request", "signature", &merkle, &sighash); |
| 434 | |
| 435 | return secp256k1_schnorrsig_verify(secp256k1_ctx, |
| 436 | sig->u8, |
| 437 | sighash.u.u8, |
| 438 | sizeof(sighash.u.u8), |
| 439 | &payer_key->pubkey) == 1; |
| 440 | } |
| 441 | |
| 442 | static struct command_result *invreq_amount_by_quantity(struct command *cmd, |
| 443 | const struct invreq *ir, |
no test coverage detected