Skip to content

_internal/trust: Fix bug in rekor key lookup #1350

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

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All versions prior to 0.9.0 are untracked.

## [Unreleased]

* Fixed issue where a trust root with multiple rekor keys was not considered valid:
Now any rekor key listed in the trust root is considered good to verify entries
[#1350](https://github.com/sigstore/sigstore-python/pull/1350)

## [3.6.1]

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions sigstore/_internal/trust.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ def rekor_keyring(self, purpose: KeyringPurpose) -> RekorKeyring:
"""Return keyring with keys for Rekor."""

keys: list[_PublicKey] = list(self._get_tlog_keys(self._inner.tlogs, purpose))
if len(keys) != 1:
raise MetadataError("Did not find one Rekor key in trusted root")
if len(keys) == 0:
raise MetadataError("Did not find any Rekor keys in trusted root")
return RekorKeyring(Keyring(keys))

def ct_keyring(self, purpose: KeyringPurpose) -> CTKeyring:
Expand Down