| 92 | } |
| 93 | |
| 94 | static char *check_signature(const tal_t *ctx, |
| 95 | const struct tlv_field *fields, |
| 96 | const char *messagename, |
| 97 | const char *fieldname, |
| 98 | const struct pubkey *node_id, |
| 99 | const struct bip340sig *sig) |
| 100 | { |
| 101 | if (!node_id) |
| 102 | return tal_fmt(ctx, "Missing node_id"); |
| 103 | if (!sig) |
| 104 | return tal_fmt(ctx, "Missing signature"); |
| 105 | |
| 106 | if (!bolt12_check_signature(fields, |
| 107 | messagename, fieldname, node_id, sig)) |
| 108 | return tal_fmt(ctx, "Invalid signature"); |
| 109 | return NULL; |
| 110 | } |
| 111 | |
| 112 | const u8 *b12_string_to_data(const tal_t *ctx, |
| 113 | const char *str, |
no test coverage detected