| 10 | #include <wire/peer_wire.h> |
| 11 | |
| 12 | static bool decrypt_final_onionmsg(const tal_t *ctx, |
| 13 | const struct secret *ss, |
| 14 | const u8 *enctlv, |
| 15 | const struct pubkey *my_id, |
| 16 | struct pubkey *alias, |
| 17 | struct secret **path_id) |
| 18 | { |
| 19 | struct tlv_encrypted_data_tlv *encmsg; |
| 20 | |
| 21 | if (!blindedpath_get_alias(ss, my_id, alias)) |
| 22 | return false; |
| 23 | |
| 24 | encmsg = decrypt_encrypted_data(tmpctx, ss, enctlv); |
| 25 | if (!encmsg) |
| 26 | return false; |
| 27 | |
| 28 | if (tal_bytelen(encmsg->path_id) == sizeof(**path_id)) { |
| 29 | *path_id = tal(ctx, struct secret); |
| 30 | memcpy(*path_id, encmsg->path_id, sizeof(**path_id)); |
| 31 | } else |
| 32 | *path_id = NULL; |
| 33 | |
| 34 | return true; |
| 35 | } |
| 36 | |
| 37 | static bool decrypt_forwarding_onionmsg(const struct pubkey *path_key, |
| 38 | const struct secret *ss, |
no test coverage detected