Raise VerificationError when the trusted root has no tlogs - #1880
Open
theadsingh wants to merge 2 commits into
Open
Raise VerificationError when the trusted root has no tlogs#1880theadsingh wants to merge 2 commits into
theadsingh wants to merge 2 commits into
Conversation
Signed-off-by: Amandeep Singh <mr.ad.iitd@gmail.com>
Signed-off-by: Amandeep Singh <mr.ad.iitd@gmail.com>
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.
Verifier.__init__readstrusted_root._inner.tlogs[0].base_urlto pick a Rekorinstance. If the trusted root carries no transparency log instances, that indexes an
empty list and the caller gets a bare
IndexError, which is not part of the documentedsurface:
This raises
VerificationErrorinstead, so a caller catching the documented exceptiontype sees it. Same shape as the checkpoint fix in #1826.
Worth noting the empty-tlog case is only reachable with the certificate authorities
still populated:
get_fulcio_certs()runs one line earlier and already raisesMetadataErrorfor a trusted root that is empty across the board. My first attempt at areproducer blanked everything and never reached the tlog lookup at all, so the test
keeps the CAs intact and asserts that before exercising the constructor.
I have not changed
TrustedRoot._verify(), which felt like the other candidate spot.Rejecting tlog-less roots at construction would also affect paths that never touch
Rekor, and I could not convince myself that was safe, so this stays scoped to the
verifier. Happy to move it if you would rather the validation lived there.
Closes #1822