| 184 | } |
| 185 | |
| 186 | static struct tlv_encrypted_data_tlv *decrypt_encmsg(const tal_t *ctx, |
| 187 | const struct pubkey *blinding, |
| 188 | const struct secret *ss, |
| 189 | const u8 *enctlv) |
| 190 | { |
| 191 | const u8 *cursor = decrypt_encmsg_raw(tmpctx, blinding, ss, enctlv); |
| 192 | size_t maxlen = tal_bytelen(cursor); |
| 193 | |
| 194 | /* BOLT-onion-message #4: |
| 195 | * |
| 196 | * - if the `enctlv` is not a valid TLV... |
| 197 | * - MUST drop the message. |
| 198 | */ |
| 199 | return fromwire_tlv_encrypted_data_tlv(ctx, &cursor, &maxlen); |
| 200 | } |
| 201 | |
| 202 | bool decrypt_enctlv(const struct pubkey *blinding, |
| 203 | const struct secret *ss, |
no test coverage detected