-
Notifications
You must be signed in to change notification settings - Fork 521
bolt12: Add test vector for missing offer_amount with offer_currency #1279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds a test case to verify that offers with offer_currency set but offer_amount missing are correctly rejected, as required by BOLT 12 specification section "Requirements For Offers": "if `offer_currency` is set and `offer_amount` is not set: - MUST NOT respond to the offer."
|
Thanks. |
t-bast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 96938ce
Adds check and corresponding test from lightning/bolts#1279
|
@rustyrussell could you fix this on the |
vincenzopalazzo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 96938ce
ziggie1984
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
|
I think this PR is ready to go, but since it found a bug in |
Rusty is taking some well deserved PTO but this is definitely on the list for 5 Jan! Thanks for your patience @t-bast |
During differential fuzzing between C-lightning and rust-lightning, discovered that C-lightning incorrectly accepts offers with offer_currency set but offer_amount missing, while rust-lightning rejects them.
The BOLT 12 specification states in "Requirements For Offers":
This pr adds a test vector for the invalid offer:
lno1qcp4256ypgx9getnwss8vetrw3hhyuckyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxgWhich contains CURRENCY=USD but no amount field, and should be rejected by all compliant implementations.
I got this test vector from:
https://github.com/ElementsProject/lightning/blob/c3362b057c2174589024254f4cab9eb8d955a26f/common/test/run-bolt12-encode-test.c#L439