Skip to content

Handle non-standard onion reply size#5698

Merged
cdecker merged 3 commits intoElementsProject:masterfrom
rustyrussell:guilt/onion-reply-size
Nov 8, 2022
Merged

Handle non-standard onion reply size#5698
cdecker merged 3 commits intoElementsProject:masterfrom
rustyrussell:guilt/onion-reply-size

Conversation

@rustyrussell
Copy link
Contributor

Turns out we didn't handle this correctly, sorry Joost!

See lightning/bolts#1021

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1. Remove the very concept of ONION_REPLY_SIZE, instead make it a
   local variable in create_onionreply().

2. Use the proper fromwire_ primitives in unwrap_onionreply() so we
   don't have to do explicit length checks.

3. Make fromwire_tal_arrn() return NULL if it fails to pull, instead of
   a zero-length allocation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Protocol: we now correctly decrypt non-256-length onion errors (we always forwarded them fine, now we actually can parse them).
@rustyrussell rustyrussell requested a review from cdecker November 8, 2022 01:20
@cdecker cdecker added this to the v22.11 milestone Nov 8, 2022
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f15613a

@cdecker cdecker merged commit a4c482d into ElementsProject:master Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants