Skip to content

Conversation

haydentherapper
Copy link
Contributor

sigstore-go now handles non-ECDSA-P-256 signatures with Rekor v2. To support verification, we also need a way to provide alternative hash algorithms to the default SHA-256. cosign verify already had a flag for this, so I added the flag to all verify commands. In the future, when we are only processing bundles, we can lookup the default hash algorithm given the key.

Summary

Release Note

Documentation

@haydentherapper
Copy link
Contributor Author

Tested with:

openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
cosign import-key-pair --key ecdsa-p521-private.pem
cosign sign-blob --new-bundle-format --bundle artifact.sigstore.json --yes --use-signing-config --key cosign.key README.md
cosign verify-blob --new-bundle-format --bundle artifact.sigstore.json --key cosign.pub --signature-digest-algorithm sha512 README.md

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 41.30435% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.35%. Comparing base (2ef6022) to head (5701322).
⚠️ Report is 514 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cosign/cli/verify.go 0.00% 15 Missing ⚠️
cmd/cosign/cli/sign/sign.go 0.00% 4 Missing ⚠️
internal/key/svkeypair.go 55.55% 3 Missing and 1 partial ⚠️
cmd/cosign/cli/options/verify.go 0.00% 3 Missing ⚠️
cmd/cosign/cli/verify/verify_attestation.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4386      +/-   ##
==========================================
- Coverage   40.10%   34.35%   -5.76%     
==========================================
  Files         155      217      +62     
  Lines       10044    15537    +5493     
==========================================
+ Hits         4028     5337    +1309     
- Misses       5530     9508    +3978     
- Partials      486      692     +206     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@steiza
Copy link
Member

steiza commented Sep 8, 2025

So in sigstore/sigstore-go#520 (comment) we decided to not support ed25519ph with Fulcio for now, but with #4050 we implemented adaptSignerVerifierToFulcio in cmd/cosign/cli/sign/sign.go.

As part of these changes, should we partially roll back the adaptSignerVerifierToFulcio changes that were made in #4050? cc @ret2libc

@haydentherapper
Copy link
Contributor Author

So in sigstore/sigstore-go#520 (comment) we decided to not support ed25519ph with Fulcio for now, but with #4050 we implemented adaptSignerVerifierToFulcio in cmd/cosign/cli/sign/sign.go.

As part of these changes, should we partially roll back the adaptSignerVerifierToFulcio changes that were made in #4050? cc @ret2libc

I'm fine with leaving this in, and documenting this is a change between Cosign v2 and v3 when we switch over signing to sigstore-go.

@steiza
Copy link
Member

steiza commented Sep 9, 2025

The test coverage shows up as high, but I don't think we have an automated test that covers verifying with a SHA512 digest? We should have at least one test that covers that case (if we don't already!)

I'm fine with leaving this in, and documenting this is a change between Cosign v2 and v3 when we switch over signing to sigstore-go.

I'm not wild about releasing a feature we plan to immediately deprecate 🙃 but I'm also not sure how easy it is to untangle these things.

@haydentherapper
Copy link
Contributor Author

Oh sorry, I was thinking we had merged the adapter in an earlier PR and it was already in a released version. Lemme take a pass at this tomorrow.

sigstore-go now handles non-ECDSA-P-256 signatures with Rekor v2. To
support verification, we also need a way to provide alternative hash
algorithms to the default SHA-256. cosign verify already had a flag for
this, so I added the flag to all verify commands. In the future, when we
are only processing bundles, we can lookup the default hash algorithm
given the key.

Signed-off-by: Hayden <[email protected]>
Signed-off-by: Hayden <[email protected]>
We've chosen to not support this in sigstore-go, so we'll also remove
this from Cosign. This is a niche edge case where a user provides an
ed25519 key or algorithm and requests a cert and logs it to Rekor. We'll
revisit this if there's demand or when we support the prehash variant in
Fulcio.

Signed-off-by: Hayden <[email protected]>
Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great - thanks!

@haydentherapper haydentherapper merged commit 11163ae into sigstore:main Sep 11, 2025
29 checks passed
@haydentherapper haydentherapper deleted the bump-sgo branch September 11, 2025 15:32
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 16, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cosign](https://github.com/sigstore/cosign) | minor | `2.5.3` -> `2.6.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sigstore/cosign (cosign)</summary>

### [`v2.6.0`](https://github.com/sigstore/cosign/blob/HEAD/CHANGELOG.md#v260)

[Compare Source](sigstore/cosign@v2.5.3...v2.6.0)

v2.6.0 introduces a number of new features, including:

- Signing an in-toto statement rather than Cosign constructing one from a predicate, along with verifying a statement's subject using a digest and digest algorithm rather than providing a file reference ([#&#8203;4306](sigstore/cosign#4306))
- Uploading a signature and its verification material (a ["bundle"](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto)) as an OCI Image 1.1 referring artifact, completing [#&#8203;3927](sigstore/cosign#3927) ([#&#8203;4316](sigstore/cosign#4316))
- Providing service URLs for signing and attesting using a [SigningConfig](https://github.com/sigstore/protobuf-specs/blob/4df5baadcdb582a70c2bc032e042c0a218eb3841/protos/sigstore_trustroot.proto#L185). Note that this is required when using a [Rekor v2](https://github.com/sigstore/rekor-tiles) instance ([#&#8203;4319](sigstore/cosign#4319))

Example generation and verification of a signed in-toto statement:

```
cosign attest-blob --new-bundle-format=true --bundle="digest-key-test.sigstore.json" --key="cosign.key" --statement="../sigstore-go/examples/sigstore-go-signing/intoto.txt"
cosign verify-blob-attestation --bundle="digest-key-test.sigstore.json" --key=cosign.pub --type=unused --digest="b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" --digestAlg="sha256"
```

Example container signing and verification using the new bundle format and referring artifacts:

```
cosign sign --new-bundle-format=true ghcr.io/user/alpine@sha256:a19367999603840546b8612572e338ec076c6d1f2fec61760a9e11410f546733
cosign verify --new-bundle-format=true ghcr.io/user/alpine@sha256:a19367999603840546b8612572e338ec076c6d1f2fec61760a9e11410f546733
```

Example usage of a signing config provided by the public good instance's TUF repository:

```
cosign sign-blob --use-signing-config --bundle sigstore.json README.md
cosign verify-blob --new-bundle-format --bundle sigstore.json --certificate-identity $EMAIL --certificate-oidc-issuer $ISSUER --use-signed-timestamps README.md
```

v2.6.0 leverages sigstore-go's signing and verification APIs gated behind these new flags. In an upcoming major release, we will be
updating Cosign to default to producing and consuming bundles to align with all other Sigstore SDKs.

#### Features

- Add to `attest-blob` the ability to supply a complete in-toto statement, and add to `verify-blob-attestation` the ability to verify with just a digest ([#&#8203;4306](sigstore/cosign#4306))
- Have cosign sign support bundle format ([#&#8203;4316](sigstore/cosign#4316))
- Add support for SigningConfig for sign-blob/attest-blob, support Rekor v2 ([#&#8203;4319](sigstore/cosign#4319))
- Add support for SigningConfig in sign/attest ([#&#8203;4371](sigstore/cosign#4371))
- Support self-managed keys when signing with sigstore-go ([#&#8203;4368](sigstore/cosign#4368))
- Don't require timestamps when verifying with a key ([#&#8203;4337](sigstore/cosign#4337))
- Don't load content from TUF if trusted root path is specified ([#&#8203;4347](sigstore/cosign#4347))
- Add a terminal spinner while signing with sigstore-go ([#&#8203;4402](sigstore/cosign#4402))
- Require exclusively a SigningConfig or service URLs when signing ([#&#8203;4403](sigstore/cosign#4403))
- Remove SHA256 assumption in sign-blob/verify-blob ([#&#8203;4050](sigstore/cosign#4050))
- Bump sigstore-go, support alternative hash algorithms with keys ([#&#8203;4386](sigstore/cosign#4386))

#### Breaking API Changes

- `sign.SignerFromKeyOpts` no longer generates a key. Instead, it returns whether or not the client needs to generate a key, and if so, clients
  should call `sign.KeylessSigner`. This allows clients to more easily manage key generation.

#### Bug Fixes

- Verify subject with bundle only when checking claims ([#&#8203;4320](sigstore/cosign#4320))
- Fixes to cosign sign / verify for the new bundle format ([#&#8203;4346](sigstore/cosign#4346))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTMuNSIsInVwZGF0ZWRJblZlciI6IjQxLjExMy41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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

Successfully merging this pull request may close these issues.

2 participants