Skip to content

Probe identity-from-keys failure paths in the matrix - #32

Open
lann wants to merge 1 commit into
mainfrom
identity-negative-probe
Open

Probe identity-from-keys failure paths in the matrix#32
lann wants to merge 1 commit into
mainfrom
identity-negative-probe

Conversation

@lann

@lann lann commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #31, closing its newest untested branch: from-keys' rejections had no coverage — nothing ever constructed a bad pair.

The demo grows identity-negative, an in-guest probe asserting:

  • a mismatched Ed25519 pair (signing key of one pair, verifying key of another) fails invalid-argument — the possession probe's judgment, exercised;
  • a non-Ed25519 pair (ECDSA P-256, matched halves) fails invalid-argument — the algorithm check;
  • a matched control pair constructs, and the identity reports the pair's public key — proving the rejections are judgments, not environmental failures.

Error shape is asserted, not just failure: any wrong variant fails the probe with the observed error in the message. The matrix gains endpoint-negative-identity-from-keys, a single process with no bind, relay traffic, or peer.

Not covered, deliberately: the can-sign: false check inside from-keys is untestable by construction — every webcrypto mint path requires the sole usage enabled ("an untouched options resource fails not-permitted"), so a no-sign signing key is unobtainable today. That check guards keystore-loaded keys that arrive with usages disabled (the webcrypto#97/#128 direction); it becomes testable when such a mint path exists.

Gates: fmt, clippy, validate-wit, test, probes, full matrix (all 19 rows, new probe included), bench, transpile — green.

from-keys' rejections were untested: nothing constructed a bad pair.
The demo grows identity-negative, an in-guest probe asserting the
constructor rejects a mismatched Ed25519 pair (the possession probe's
judgment) and a non-Ed25519 (ECDSA P-256) pair, each specifically with
invalid-argument, and accepts a matched control pair whose identity
reports the pair's public key — proving the rejections are judgments,
not environmental failures. The matrix gains
endpoint-negative-identity-from-keys running it as a single process:
no bind, no relay traffic, no peer.

The third from-keys check, a signing key without the sign usage, stays
untestable by construction: every webcrypto mint path requires the
sole usage enabled, so such a key is unobtainable today (the check
guards keystore-loaded keys that arrive with usages disabled).
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