Skip to content

Return error instead of panics on invalid ASN.1#9

Merged
acw merged 4 commits intoacw:masterfrom
Flakebi:master
Mar 29, 2019
Merged

Return error instead of panics on invalid ASN.1#9
acw merged 4 commits intoacw:masterfrom
Flakebi:master

Conversation

@Flakebi
Copy link
Copy Markdown
Contributor

@Flakebi Flakebi commented Mar 29, 2019

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 + Error bound to the error types.

@acw
Copy link
Copy Markdown
Owner

acw commented Mar 29, 2019

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.

@Flakebi
Copy link
Copy Markdown
Contributor Author

Flakebi commented Mar 29, 2019

Thanks!

One thing I forgot to mention: The GeneralizedTime parser previously inserted the dot at position 15, 14 should be the right position :)

@acw
Copy link
Copy Markdown
Owner

acw commented Mar 29, 2019

Yes, I saw that and that was one of the things I wanted to look at (and maybe write a test case for). :)

@acw acw merged commit 800f165 into acw:master Mar 29, 2019
@acw
Copy link
Copy Markdown
Owner

acw commented Mar 29, 2019

This version has been pushed as 0.4.0.

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