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

V1 certificates are rejected with BadDER instead of UnsupportedCertVersion #53

Open
briansmith opened this issue Jun 1, 2017 · 4 comments

Comments

@briansmith
Copy link
Owner

Either return a different error code, or document somewhere that the most likely cause of BadDER is a non-v3 certificate.

@jonas-schievink
Copy link
Contributor

There's now an UnsupportedCertVersion, and I'm able to trigger it for a v2 and v4 version field.

@jonas-schievink
Copy link
Contributor

Ah, but apparently the error returned when the version field is missing completely is still BadDER, so this is still relevant.

@briansmith
Copy link
Owner Author

Ah, but apparently the error returned when the version field is missing completely is still BadDER, so this is still relevant.

Right. The way to encode "version 1" is by not encoding the version at all, unfortunately. The best way to fix that would be to change ring's DER parser to return different errors for "the tag isn't what was expected" vs. other errors. I would take PRs to ring and to webpki to do that.

@briansmith briansmith changed the title Deal with non-V3 certificates better V1 certificates are rejected with BadDER instead of UnsupportedCertVersion Jan 28, 2019
@briansmith
Copy link
Owner Author

The best way to fix that would be to change ring's DER parser to return different errors for "the tag isn't what was expected" vs. other errors. I would take PRs to ring and to webpki to do that.

#90 is a very similar problem and the best solution seems to be similar to what I suggested above.

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

No branches or pull requests

2 participants