Return error instead of panics on invalid ASN.1 #9
Reference in New Issue
Block a user
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
I use this library to find out if something is ASN.1 or not, unfortunately it often panics on invalid input.
To find all panics I added a cargo-fuzz project and fixed all the panics it found.
With the final version, the fuzzer did not find any panic for half an hour.
Unfortunately this pr currently includes a breaking change because it adds error variants. So I’m not sure if you want to implement this someway else, e.g. return some of the existing errors instead.
Edit: I found this commit which also adds a
+ Errorbound to the error types.This is awesome, and I'm always happy to add more (and more helpful) error variants. Let me check a couple things and then I'll merge it.
Thanks!
One thing I forgot to mention: The GeneralizedTime parser previously inserted the dot at position 15, 14 should be the right position :)
Yes, I saw that and that was one of the things I wanted to look at (and maybe write a test case for). :)
This version has been pushed as 0.4.0.