MCPcopy Create free account
hub / github.com/ElementsProject/lightning / decrypt_final_onionmsg

Function decrypt_final_onionmsg

common/onion_message_parse.c:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <wire/peer_wire.h>
11
12static 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
37static bool decrypt_forwarding_onionmsg(const struct pubkey *path_key,
38 const struct secret *ss,

Callers 1

onion_message_parseFunction · 0.85

Calls 3

blindedpath_get_aliasFunction · 0.85
tal_bytelenFunction · 0.85
decrypt_encrypted_dataFunction · 0.70

Tested by

no test coverage detected