-
Notifications
You must be signed in to change notification settings - Fork 912
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
fuzz: bolt12 decoding #6820
Conversation
common/bolt12.c
Outdated
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) |
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.
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?
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.
Done, PTAL.
Add fuzz targets for decoding of offers, invoice requests, and invoices. Mutators are shared in bolt12.h.
3bc2c8a
to
4a14e4d
Compare
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 4a14e4d
Fuzz targets for decoding of bolt12 offers, invoice requests, and invoices. Based on the existing target for bolt11.