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