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

Fix deserialization of enums and add fuzzer #4

Merged
merged 8 commits into from
Sep 13, 2024

Conversation

sosthene-nitrokey
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey commented Feb 20, 2023

This patch runs cargo fmt, fixes cilppy warnings, fixes a bug preventing the deserialization of enums with struct variants, and a bug affecting tuple variants.

It also adds some basic fuzzing infrastructure, which didn't find any crash (outside of the ones fixed by this PR) in 20min

  • struct like variants of enums were deserialized as tuples instead of maps
  • tuple-like enums were not supported
  • u64 were deserialized as u32, which meant some data would not deserialize properly

@sosthene-nitrokey sosthene-nitrokey force-pushed the fixes branch 2 times, most recently from 7b3e2b0 to 522c6df Compare February 20, 2023 15:07
Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

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

Maybe add unit tests for the fixed enum and u64 deserialization, otherwise LGTM.

@sosthene-nitrokey
Copy link
Contributor Author

Good idea.

@sosthene-nitrokey sosthene-nitrokey merged commit f177481 into trussed-dev:main Sep 13, 2024
1 check passed
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