Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing images with cosign fails with KDF error #1322

Closed
ThomasVitale opened this issue Sep 8, 2023 · 3 comments
Closed

Signing images with cosign fails with KDF error #1322

ThomasVitale opened this issue Sep 8, 2023 · 3 comments

Comments

@ThomasVitale
Copy link
Contributor

ThomasVitale commented Sep 8, 2023

What happened

When using kpack to sign the built images with Cosign, the signing step fails if the key pair has been created with the Cosing CLI 2.2.0 (the latest version at the moment). It works when using the previous version of the CLI (2.1.1).

I can see there's an open Dependabot PR (#1318) to update the Cosign version to 2.2.0 (the latest one). I assume the defect would be fixed by updating the Cosign dependencies in that pull request.

Logs

This is the error log I get from the kpack build.

cosign sign: unable to sign image with /var/build-secrets/cosign/supply-chain-cosign-key-pair/cosign.key: getting signer: reading key: decrypt: encrypted: unexpected kdf parameters

Versions

I tried both using the latest kpack version (0.12.0) and the previous one (0.11.2). Same result.

@ThomasVitale ThomasVitale changed the title Signing images with cosign fails due to KDF error Signing images with cosign fails with KDF error Sep 8, 2023
@chenbh
Copy link
Contributor

chenbh commented Sep 11, 2023

Root cause is that the keys generated by Cosign v2.2.0 has a higher default scrypt iteration count than what Cosign v2.1.1 supported.

The PR that did this is sigstore/cosign#3183, but the actual discussion occurred in sigstore/cosign#3128. Bit of a bummer that it wasn't called out in the release notes, but yeah a dependency bump will fix this issue.

@ThomasVitale
Copy link
Contributor Author

@chenbh thanks for the information. I've been trying to find the root cause, but couldn't find anything in the release notes and related issues. Now I see why. It's unfortunate to have such a breaking change in a minor upgrade without info.

I can see the PR upgrading cosign in kpack is now green: #1318. Once it's merged, I guess we can close this issue.

@chenbh
Copy link
Contributor

chenbh commented Sep 20, 2023

v0.12.1 released with the fix

@chenbh chenbh closed this as completed Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants