Skip to content

Commit cb9aa6c

Browse files
committed
Fix LoadPrivateKey API breaking change for cosign v2.6.0
- Add LoadOption parameter to LoadPrivateKey calls in x509.go and clients.go - Pass nil for defaultLoadOptions to use sensible defaults (ED25519ph) - Update both production code and test code to match new API The LoadPrivateKey function signature changed in cosign v2.6.0 to include a third parameter for LoadOption configuration. Passing nil uses the default ED25519ph behavior which is appropriate for this use case. Co-authored-by: Claude Sonnet <claude@anthropic.com> Signed-off-by: arewm <arewm@users.noreply.github.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent 886b07d commit cb9aa6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/chains/signing/x509/x509.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func cosignSigner(ctx context.Context, secretPath string, privateKey []byte) (*S
202202
if err != nil {
203203
return nil, errors.Wrap(err, "reading cosign.password file")
204204
}
205-
signer, err := cosign.LoadPrivateKey(privateKey, password)
205+
signer, err := cosign.LoadPrivateKey(privateKey, password, nil)
206206
if err != nil {
207207
return nil, err
208208
}

test/clients.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func setupSecret(ctx context.Context, t *testing.T, c kubernetes.Interface, opts
237237
}
238238
s.StringData[p] = string(b)
239239
}
240-
cosignPriv, err := cosign.LoadPrivateKey([]byte(s.StringData["cosign.key"]), []byte(s.StringData["cosign.password"]))
240+
cosignPriv, err := cosign.LoadPrivateKey([]byte(s.StringData["cosign.key"]), []byte(s.StringData["cosign.password"]), nil)
241241
if err != nil {
242242
t.Fatal(err)
243243
}

0 commit comments

Comments
 (0)