lint: no pointer for crypto.publickkey

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
Ramon Petgrave
2024-06-20 22:10:46 +00:00
parent 942d8bbe3d
commit 73c9884da6
4 changed files with 5 additions and 5 deletions

View File

@@ -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,
}

View File

@@ -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

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)
}

View File

@@ -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 {