Skip to content

rekor: migrate v2 transparency entries from dsse to hashedrekord - #231

Merged
jialez0 merged 2 commits into
mainfrom
rekor-hashedrekord
Sep 16, 2026
Merged

jialez0 merged 2 commits into
mainfrom
rekor-hashedrekord

Conversation

@imlk0

@imlk0 imlk0 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

log2025-1.rekor.sigstore.dev now rejects new dsseRequestV002 entries with "invalid type, must be hashedrekord", breaking rv-release-tool and any flow that writes a DSSE entry to the v2 log. This PR migrates the v2 write and read paths to hashedRekordRequestV002.

Reproduce (pre-fix fails with the error; post-fix returns HTTP 201 and a hashedrekord/0.0.2 entry):

openssl ecparam -genkey -name prime256v1 -noout -out /tmp/k.pem
printf hi > /tmp/a
./tools/slsa/rv-release-tool --artifact-type binary --artifact /tmp/a \
       --artifact-id t --artifact-version 1 --sign-key /tmp/k.pem \
       --rekor-url https://log2025-1.rekor.sigstore.dev --rekor-api-version 2

Add rvps/rustfmt.toml so rustfmt does not reformat
src/rvps_api/reference.rs (@generated by prost-build). Each prost-build
regen diverges from rustfmt's style, so reformatting the committed file
produces noisy diffs. `ignore` is an unstable rustfmt option that takes
effect under the nightly rustfmt used in CI (.github/workflows/rust-check.yml)
and is a no-op (with a warning) on stable.

Assisted-by: Claude:glm-5.2
…rekord

log2025-1.rekor.sigstore.dev (Rekor v2) now rejects the deprecated
dsseRequestV002 entry type with "invalid type, must be hashedrekord",
breaking make test-dep-as and any flow that writes a DSSE entry to the
v2 log. Per Rekor's deprecation note ("use the hash of the DSSE PAE"),
post a hashedRekordRequestV002 entry whose digest is sha256(DSSE PAE)
and whose signature is the existing DSSE signature (ECDSA-SHA256 over
the PAE equals a signature over sha256(PAE)). No re-signing or
trust-model change; the DSSE envelope and its verification are
unchanged.

- rv-release-tool upload_rekor_v2 and as-signer-transparency
  upload_rekor_v2: post hashedRekordRequestV002 (digest = sha256(PAE),
  reuse the DSSE signature, same SPKI public key).
- as-signer-transparency: embed rekor.pae_sha256 (= sha256(PAE)) in the
  signer_transparency bundle and set request_type to
  hashedRekordRequestV002, so the verifier can bind the entry without
  reconstructing the PAE bytes (the bundle carries the parsed payload,
  not the raw signed bytes).
- rvps verify_rekor_v2_consistency (lib.rs and release_manifest.rs):
  add a hashedrekord branch that reconstructs the PAE from the
  dsseEnvelope's payloadType + payload and compares sha256(PAE) to the
  entry's hashedRekordV002.data.digest. The legacy dsse branch is kept.
- New dsse_pae helper in rvps/src/lib.rs.

Tests: verify_rekor_v2_consistency hashedrekord accept/reject in both
lib.rs and release_manifest.rs, plus a real-fixture test against a
genuine log2025-1 hashedrekord/0.0.2 entry
(rvps/tests/fixtures/rekor_v2_hashedrekord_bundle.json); both uploads
verified live against log2025-1 (HTTP 201, hashedrekord/0.0.2).

Assisted-by: Claude:glm-5.2
@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@jialez0
jialez0 merged commit 3089a70 into main Sep 16, 2026
24 checks passed
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.

3 participants