Skip to content

fix(test): realign round-trip Rust helper to affinidi-messaging-didcomm 0.15 (unblocks CI) - #7

Merged
stormer78 merged 1 commit into
mainfrom
fix/roundtrip-helper-didcomm-0.15
Jul 16, 2026
Merged

fix(test): realign round-trip Rust helper to affinidi-messaging-didcomm 0.15 (unblocks CI)#7
stormer78 merged 1 commit into
mainfrom
fix/roundtrip-helper-didcomm-0.15

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Why CI is red (and has been since #3)

main has failed CI since PR #3 (ecdh-1pu-kdf-length-prefix) — the last green
push was #2. Every failing test is a roundtrip-rust interop vector
(JS-pack → Rust-unpack) dying with key unwrap failed: key unwrap integrity check failed. These run only in CI, where the Rust didcomm-unpack helper is
built; locally they skip. This is not caused by any library change — PRs #5
and #6 inherit the same pre-existing red.

Root cause (the repo's own 0.5.0 CHANGELOG flags it): #3 made JS authcrypt
spec-correct by length-prefixing the ECDH-1PU Concat-KDF cc_tag (upstream
#322). JS unpack also got a dual-KEK fallback. But tools/roundtrip-helper
still pinned the pre-fix affinidi-messaging-didcomm 0.13, whose legacy
(unprefixed) KDF computes a different KEK and can't unwrap JS's now-correct
key-wrap — and the helper has no fallback. So JS→Rust authcrypt broke. The 0.5.0
notes even say the vectors "should be regenerated against a Rust [impl with the
fix]."

The VTA + mediator have since moved to affinidi-messaging-didcomm 0.15; only
this test helper lagged at 0.13.

Fix

  • Bump tools/roundtrip-helper to affinidi-messaging-didcomm 0.15 (matching
    the workspace, which carries #322).
  • 0.15 moved the key-agreement types out of affinidi_messaging_didcomm::crypto
    into affinidi_crypto::jose::key_agreement — updated the imports and added the
    affinidi-crypto dep.
  • Handle the 0.15 UnpackResult::Encrypted additions: surface legacy_kek_used
    (it is false for a spec-correct JS ≥0.5.0 pack — exactly the interop this
    harness verifies) and add the wildcard arm the now-#[non_exhaustive] enum
    requires.

Result

With the rebuilt helper the vectors run and pass:

  • forward + mediator-auth + roundtrip-rust: 19/19, 0 skipped.
  • Full suite: 206 pass / 0 fail, 4 skipped (unrelated did:webvh
    fixture-cache tests). Helper builds clean.

Test-only tooling (publish = false), so no npm package version bump.

Merge order

Merge this first — it turns main green again. PRs #5 (D8-F2 auth) and
#6 (D8-F3 transport) then just need a rebase to pick up the working helper;
their own new tests already pass. Part of D8 / R4.1 (hand-maintained clients
drifting from the Rust side).

…mm 0.15

The roundtrip-rust interop vectors (JS pack -> Rust unpack) had been red
in CI since the 0.5.0 ECDH-1PU cc_tag length-prefix fix (#322): JS pack
became spec-correct while tools/roundtrip-helper still pinned the pre-fix
affinidi-messaging-didcomm 0.13, whose legacy (unprefixed) Concat-KDF KEK
could no longer unwrap JS's authcrypt (key unwrap integrity check failed).
The helper-vs-JS mismatch, not any library code, was the failure.

- bump the helper to 0.15 (matching the VTA + mediator pin, which carries
  the #322 fix);
- move the key-agreement imports to their new home in 0.15
  (affinidi_crypto::jose::key_agreement) and add the affinidi-crypto dep;
- handle the new UnpackResult::Encrypted fields (surface legacy_kek_used,
  which is false for a spec-correct JS >=0.5.0 pack) and the now
  #[non_exhaustive] enum.

All previously-failing vectors pass: forward + mediator-auth +
roundtrip-rust are 19/19; full suite 206 pass / 0 fail (4 unrelated
did:webvh fixture-cache skips). Test-only tooling (publish = false), so
no npm package version bump.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 52fc560 into main Jul 16, 2026
2 checks passed
@stormer78
stormer78 deleted the fix/roundtrip-helper-didcomm-0.15 branch July 16, 2026 03:29
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.

1 participant