Skip to content

Commit 3418024

Browse files
authored
_internal/trust: Fix bug in rekor key lookup (#1350)
* _internal/trust: Fix bug in rekor key lookup Rekor keyring can (and in future will) have multiple keys: logs not only get sharded but once rekor-tiles is integrated in the public good instance, there will be two writable logs for a while. As far as I can tell all calling code is already capable of handling the keyring. Signed-off-by: Jussi Kukkonen <[email protected]> * CHANGELOG: Mention fix for multiple rekor keys Signed-off-by: Jussi Kukkonen <[email protected]> --------- Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent c9c603a commit 3418024

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ All versions prior to 0.9.0 are untracked.
88

99
## [Unreleased]
1010

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

1317
### Fixed

sigstore/_internal/trust.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ def rekor_keyring(self, purpose: KeyringPurpose) -> RekorKeyring:
382382
"""Return keyring with keys for Rekor."""
383383

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

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

0 commit comments

Comments
 (0)