Repository navigation
Verify Fulcio's embedded certificate timestamp before signing - #3129
konsti-openai wants to merge 21 commits into
Conversation
734a1c9 to
b3fc8e8
Compare
1d00f61 to
170db12
Compare
| let [sct] = timestamps.as_slice() else { | ||
| return Err(TimestampError::Count(timestamps.len())); |
There was a problem hiding this comment.
[P2] Require the SCT parser to consume the entire list
timestamps.as_slice() counts the entries x509-parser successfully parsed, not necessarily all the bytes in the list. A valid SCT followed by a truncated second entry is returned as a one-element vector, while Python’s cryptography parser rejects that list. The merge base did not check SCTs; the new check still lets this malformed certificate reach Rekor. Use a decoder that consumes the full list and each entry, such as the sct feature of the newly added x509-cert dependency, before enforcing the one-SCT rule. (docs.rs)
| let token = format!("header.{claims}.signature"); | ||
| "ctlogs": [log("https://ct.example", CT_KEY)], | ||
| "tlogs": [ | ||
| log(super::REKOR_ORIGIN, CT_KEY), |
There was a problem hiding this comment.
[P3] Keep the CT key out of the Rekor test keyring
Both signing tests put CT_KEY in ctlogs and tlogs. If the signing path used Rekor keys to verify the SCT, the success test would still pass and the corrupted-signature test would still fail as expected. The validity test calls ct_key directly, so it cannot catch that wiring error. Use a distinct key for the first Rekor rotation candidate, as the merge-base fixture did; no additional test is needed.
| // A retired key may verify old releases, but must not vouch for a new signature. | ||
| .filter(|log| log.public_key.valid_for.contains(signed_at)) | ||
| .filter(|log| log.public_key.valid_for.contains(now)) | ||
| .filter_map(|log| log.public_key.decode().ok()) |
There was a problem hiding this comment.
[P3] Preserve the cause when no CT key can be decoded
If the only eligible CT key contains invalid base64, .decode().ok() discards the cause and the caller reports the same error as for an unknown log ID. That leaves no indication that the trust document, rather than the certificate, needs attention. As rekor_keys already does, retain the decode error while trying other candidates and surface it if none can be decoded. This diagnostic improvement can follow separately.
…te-timestamp # Conflicts: # crates/uv-sigstore/src/lib.rs
…te-timestamp # Conflicts: # crates/uv-sigstore/src/lib.rs
…te-timestamp # Conflicts: # crates/uv-sigstore/src/lib.rs
…te-timestamp # Conflicts: # crates/uv-sigstore/src/lib.rs
…tion in the signer
…te-timestamp # Conflicts: # crates/uv-sigstore/src/lib.rs
453f25f to
c060c07
Compare
a599699 to
156fce9
Compare
Verify the timestamp embedded in Fulcio's leaf certificate before signing a statement. If no current certificate transparency log signed it, uv stops before sending anything to Rekor. Valid attestations are unchanged.
The check reconstructs the RFC 6962 precertificate from the leaf and issuer returned by Fulcio and uses the CT keys from the same Sigstore document already fetched for Rekor. No extra network request is needed.
Stacked on #3125.