Skip to content

Commit

Permalink
Add warning when verifying with artifact digest
Browse files Browse the repository at this point in the history
This discourages using an artifact digest to verify an in-toto
attestation, and mentions that it breaks Ed25519 verification.

Fixes #444

Signed-off-by: Hayden Blauzvern <[email protected]>
  • Loading branch information
haydentherapper committed Jan 8, 2025
1 parent 1e0daec commit 5a05c3e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gen/jsonschema/schemas/Artifact.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"artifactDigest": {
"$ref": "#/definitions/dev.sigstore.common.v1.HashOutput",
"additionalProperties": false,
"description": "Digest of the artifact"
"description": "Digest of the artifact. SHOULD NOT be used when verifying an in-toto attestation as the subject digest cannot be reconstructed. This option will not work with Ed25519 signatures, use Ed25519Ph or another algorithm instead."
}
},
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion gen/jsonschema/schemas/Input.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
"artifactDigest": {
"$ref": "#/definitions/dev.sigstore.common.v1.HashOutput",
"additionalProperties": false,
"description": "Digest of the artifact"
"description": "Digest of the artifact. SHOULD NOT be used when verifying an in-toto attestation as the subject digest cannot be reconstructed. This option will not work with Ed25519 signatures, use Ed25519Ph or another algorithm instead."
}
},
"additionalProperties": false,
Expand Down
5 changes: 4 additions & 1 deletion gen/pb-go/verification/v1/sigstore_verification.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ pub mod artifact {
/// The raw bytes of the artifact
#[prost(bytes, tag = "2")]
Artifact(::prost::alloc::vec::Vec<u8>),
/// Digest of the artifact
/// Digest of the artifact. SHOULD NOT be used when verifying an
/// in-toto attestation as the subject digest cannot be
/// reconstructed. This option will not work with Ed25519
/// signatures, use Ed25519Ph or another algorithm instead.
#[prost(message, tag = "3")]
ArtifactDigest(super::super::super::common::v1::HashOutput),
}
Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion protos/sigstore_verification.proto
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ message Artifact {
string artifact_uri = 1;
// The raw bytes of the artifact
bytes artifact = 2;
// Digest of the artifact
// Digest of the artifact. SHOULD NOT be used when verifying an
// in-toto attestation as the subject digest cannot be
// reconstructed. This option will not work with Ed25519
// signatures, use Ed25519Ph or another algorithm instead.
dev.sigstore.common.v1.HashOutput artifact_digest = 3;
}
}
Expand Down

0 comments on commit 5a05c3e

Please sign in to comment.