mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-05-21 07:52:50 +00:00
lint: no pointer for crypto.publickkey
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ func (c *VerifyVSACommand) Exec(ctx context.Context) (*utils.TrustedAttesterID,
|
||||
return nil, err
|
||||
}
|
||||
VerificationOpts := &options.VerificationOpts{
|
||||
PublicKey: &pubKey,
|
||||
PublicKey: pubKey,
|
||||
PublicKeyID: c.PublicKeyID,
|
||||
PublicKeyHashAlgo: hashHalgo,
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ type VSAOpts struct {
|
||||
|
||||
type VerificationOpts struct {
|
||||
// PublicKey is the public key used to verify the signature on the Envelope
|
||||
PublicKey *crypto.PublicKey
|
||||
PublicKey crypto.PublicKey
|
||||
|
||||
// PublicKeyID is the ID of the public key
|
||||
PublicKeyID *string
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ func Test_VerifyVSA(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func mustPublicKey(path string) *crypto.PublicKey {
|
||||
func mustPublicKey(path string) crypto.PublicKey {
|
||||
pubKeyBytes, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -179,7 +179,7 @@ func mustPublicKey(path string) *crypto.PublicKey {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &pubKey
|
||||
return pubKey
|
||||
}
|
||||
|
||||
func PointerTo[K any](object K) *K {
|
||||
|
||||
Reference in New Issue
Block a user