literl hash algo

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
Ramon Petgrave
2024-06-20 19:56:21 +00:00
parent 00fed87dbc
commit e47312f593
3 changed files with 3 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ func (c *VerifyVSACommand) Exec(ctx context.Context) (*utils.TrustedAttesterID,
VerificationOpts := &options.VerificationOpts{
PublicKey: &pubKey,
PublicKeyID: c.PublicKeyID,
PublicKeyHashAlgo: &hashHalgo,
PublicKeyHashAlgo: hashHalgo,
}
attestations, err := os.ReadFile(*c.AttestationsPath)
if err != nil {

View File

@@ -63,5 +63,5 @@ type VerificationOpts struct {
PublicKeyID *string
// PublicKeyHashAlgo is the hash algorithm used to hash the signature
PublicKeyHashAlgo *crypto.Hash
PublicKeyHashAlgo crypto.Hash
}

View File

@@ -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.PublicKeyHashAlgo)
signatureVerifier, err := sigstoreSignature.LoadVerifier(*verificationOpts.PublicKey, verificationOpts.PublicKeyHashAlgo)
if err != nil {
return fmt.Errorf("%w: loading sigstore DSSE envolope verifier %w", serrors.ErrorInvalidPublicKey, err)
}