sigstore / sigstore-go

Go library for Sigstore signing and verification
Apache License 2.0
49 stars 26 forks source link

Check if entry has inclusion proof rather than entity #310

Closed adityasaky closed 1 month ago

adityasaky commented 1 month ago

Summary

I stumbled upon an inconsistency when verifying an entry's inclusion proof (for offline verification). I think it should be checking if the specific entry has an inclusion proof instead of going by the entity (eg. a bundle). A bundle could have entries with inclusion proofs and without, and the bundle returns true for this check if even one entry has an inclusion proof, so this could lead to an error when verifying an entry without the proof.

Release Note

Fixed check for whether a tlog entry has an inclusion proof

Documentation

NONE

adityasaky commented 1 month ago

Amending my original message: right now, this should never be a problem because of how online vs offline verification is decided. If WithOnlineVerification() is not used, then all entries must have the inclusion proof (meaning no mix of entries with and without the proof) or fail indicating the entry doesn't have the proof (as it currently would). If WithOnlineVerification() is used, we don't hit this at all. Overall, it might be okay to leave it as is?

This can change if the online vs offline control becomes a per-log control, though I don't know of contexts where that makes sense.