[fix] retry matching chain from trust-store and skip expired intermediate certs early#240
Closed
[fix] retry matching chain from trust-store and skip expired intermediate certs early#240
Conversation
an attempt to retrofit verification to consider alt-chains
in case or a store.verify failure - report error as before
Member
Author
|
unfortunately, I was following the reproducer from #236 and that case the PR actually resolves the issue ... but trying out another real-world scenario we start out with these 'untrusted' certificates (from the server):
thus relying on being able to check all paths once we reach the trust-store isn't enough - we need to be able to built an alternate chain earlier ... |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR represent a very concrete (and "minimalistic") update to try building alternative chain trust chains with cert verification.
The code is inspired by OpenSSL 1.1.1's alt verification logic (namely
(search & S_DOALTERNATE)) but does not allow arbitrary chain unrolling and retry, thus being somehow less flexible. Instead the retry is hard-coded at the level when the initial chain is built looking up certificates from the trust store.This, and a few extra checks on expiry dates (ported over from OpenSSL 1.1.1), is expected to be sufficient to resolve issues such as #236.
TODO:
(if retry logic is off problematic chains should also veridy with expired CAs removed from the trust store?)
HINT: The #236 work started as a OpenSSL 1.1.1 port #239 but was put to ice due (even after a week) requiring more porting/reviewing of OpenSSL C code.