]> git.bitcoin.ninja Git - rust-lightning/commit
Error if onion payloads exceed max length on packet construction.
authorValentine Wallace <vwallace@protonmail.com>
Fri, 8 Dec 2023 22:23:01 +0000 (17:23 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 8 Dec 2023 22:33:40 +0000 (17:33 -0500)
commit80ba9acd775852d1bfa6166a7ec64e8625586a6d
treed492d7f85db4cb0df6a7d4905fa3513ae3d1ad54
parente9bd893447d77e417ab7fed49365076ba390c495
Error if onion payloads exceed max length on packet construction.

Ensure that if we call construct_onion_packet and friends where payloads are
too large for the allotted packet length, we'll fail to construct. Previously,
senders would happily construct invalid packets by array-shifting the final
node's HMAC out of the packet when adding an intermediate onion layer, causing
the receiver to error with "final payload provided for us as an intermediate
node."
lightning/src/ln/onion_payment.rs
lightning/src/ln/onion_utils.rs