mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-05-16 21:46:40 +00:00
rename to PublicKeyHashAlgo
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user