Skip to content
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

fuzz: bolt12 decoding #6820

Merged
merged 6 commits into from
Jan 23, 2024
Merged

Conversation

morehouse
Copy link
Contributor

Fuzz targets for decoding of bolt12 offers, invoice requests, and invoices. Based on the existing target for bolt11.

common/bolt12.c Outdated
Comment on lines 110 to 113
STATIC_UNLESS_FUZZING const u8 *string_to_data(const tal_t *ctx,
const char *str, size_t str_len,
const char *hrp_expected,
size_t *dlen, char **fail)
Copy link
Contributor

Choose a reason for hiding this comment

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

I really dislike this level of intrusiveness; we go to great lengths to avoid this in unit tests, we should do the same for fuzz tests.

In particular, fuzzing should not be afraid to include raw C files to get this kind of access. It may mean you need to use generated mocks, like unit tests do, though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, PTAL.

@rustyrussell rustyrussell added this to the v24.02 milestone Jan 22, 2024
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Ack 4a14e4d

@rustyrussell rustyrussell merged commit 3260d7d into ElementsProject:master Jan 23, 2024
33 of 38 checks passed
@morehouse morehouse deleted the fuzz_bolt12 branch January 23, 2024 16:25
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