-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
change x509 validation to allow parsing of some "bad" certs #3862
Conversation
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.
Please put the vector in a separate PR.
You also seem to not be handling these validations in CSR, CRL, and whatever-the-hell-else builders.
fcb13ea
to
3db524f
Compare
This is ready for review again. Still outstanding: whether we want to switch to adding |
3db524f
to
9142359
Compare
c1991de
to
0638dc3
Compare
I have a dataset of about 20 certificates (and still growing) which break the validation steps in this library. All were harvested in the wild. If there's some way to publish these examples for you conveniently, I'd love to contribute. Currently, I just monkey patch the init methods on lots of the Extension and Name classes to remove the validation checks. |
Is this PR abandoned? |
@2rs2ts what timing. I just released (a few hours ago) the library I use which does the monkeypatching to allow loading of certs which don't always follow best practices. |
@jcrowgey nice... I am not sure your library solves my problem, but it is indeed cool! 😄 |
8bb4e69
to
cf3f2ae
Compare
We now validate on these fields when adding the objects to the various builders
cf3f2ae
to
607b85b
Compare
This has been pushed 5 times now and is no less problematic now than it was 3 years ago. I think to get "bad" cert parsing we're going to need to have someone commit to the large amount of work necessary for a hazmat x509 parsing API. When that gets implemented we can have this. In the meantime the monkeypatching model is probably the best path to bypass this type of validation if needed. |
We now validate on these fields when adding the objects to the CertificateBuilder.
This PR does not attempt to migrate all validation logic. Each extension has logic that may be specific to Python or enforcement of an RFC restriction. Before migrating more logic I'd like to see examples of certificates that encode things in that specific invalid way.
Fixes #3857 and #3856