diff --git a/cli/slsa-verifier/verify.go b/cli/slsa-verifier/verify.go index d34c3e9..4a5d557 100644 --- a/cli/slsa-verifier/verify.go +++ b/cli/slsa-verifier/verify.go @@ -202,7 +202,7 @@ func verifyVSACmd() *cobra.Command { PrintAttestation: &o.PrintAttestation, PublicKeyPath: &o.PublicKeyPath, PublicKeyID: &o.PublicKeyID, - SignatureHashAlgo: &o.SignatureHashAlgo, + PublicKeyHashAlgo: &o.SignatureHashAlgo, } if _, err := v.Exec(cmd.Context()); err != nil { fmt.Fprintf(os.Stderr, "%s: %v\n", FAILURE, err) diff --git a/cli/slsa-verifier/verify/verify_vsa.go b/cli/slsa-verifier/verify/verify_vsa.go index ffc2f1b..77b7917 100644 --- a/cli/slsa-verifier/verify/verify_vsa.go +++ b/cli/slsa-verifier/verify/verify_vsa.go @@ -38,7 +38,7 @@ type VerifyVSACommand struct { PrintAttestation *bool PublicKeyPath *string PublicKeyID *string - SignatureHashAlgo *string + PublicKeyHashAlgo *string } var hashAlgos = map[string]crypto.Hash{ @@ -72,16 +72,16 @@ func (c *VerifyVSACommand) Exec(ctx context.Context) (*utils.TrustedAttesterID, printFailed(err) return nil, err } - hashHalgo, ok := hashAlgos[*c.SignatureHashAlgo] + hashHalgo, ok := hashAlgos[*c.PublicKeyHashAlgo] if !ok { - err := fmt.Errorf("%w: %s", serrors.ErrorInvalidHashAlgo, *c.SignatureHashAlgo) + err := fmt.Errorf("%w: %s", serrors.ErrorInvalidHashAlgo, *c.PublicKeyHashAlgo) printFailed(err) return nil, err } VerificationOpts := &options.VerificationOpts{ PublicKey: pubKey, PublicKeyID: *c.PublicKeyID, - SignatureHashAlgo: hashHalgo, + PublicKeyHashAlgo: hashHalgo, } attestations, err := os.ReadFile(*c.AttestationsPath) if err != nil { diff --git a/options/options.go b/options/options.go index c16bd73..c408e13 100644 --- a/options/options.go +++ b/options/options.go @@ -62,6 +62,6 @@ type VerificationOpts struct { // PublicKeyID is the ID of the public key PublicKeyID string - // SignatureHashAlgo is the hash algorithm used to hash the signature - SignatureHashAlgo crypto.Hash + // PublicKeyHashAlgo is the hash algorithm used to hash the signature + PublicKeyHashAlgo crypto.Hash } diff --git a/verifiers/internal/vsa/verifier.go b/verifiers/internal/vsa/verifier.go index 9420364..edd2418 100644 --- a/verifiers/internal/vsa/verifier.go +++ b/verifiers/internal/vsa/verifier.go @@ -72,7 +72,7 @@ func VerifyVSA(ctx context.Context, // verifyEnvelopeSignature verifies the signature of the envelope. func verifyEnvelopeSignature(ctx context.Context, sigstoreEnvelope *sigstoreBundle.Envelope, verificationOpts *options.VerificationOpts) error { - signatureVerifier, err := sigstoreSignature.LoadVerifier(verificationOpts.PublicKey, verificationOpts.SignatureHashAlgo) + signatureVerifier, err := sigstoreSignature.LoadVerifier(verificationOpts.PublicKey, verificationOpts.PublicKeyHashAlgo) if err != nil { return fmt.Errorf("%w: loading sigstore DSSE envolope verifier %w", serrors.ErrorInvalidPublicKey, err) }