[TEST] Golden-vector interop test for the JS connect-widget crypto - #94
Merged
Merged
Conversation
Locks the Rust decrypt path against a ciphertext produced by canopy-admin's src/connect-widget/main.ts, so a protocol drift between the two repos (curve, HKDF info string, AEAD choice, byte layout) fails loudly. That drift is otherwise silent: the browser keeps encrypting, this install just stops being able to decrypt. The vector was generated by importing the real encryptToInstance under Node, against a throwaway recipient keypair made for the vector alone — it has never been a real instance key and decrypts only a dummy string. - WEB_CONNECTIONS.md: how to regenerate the vector, and why the recipient key must never be a real one - .gitleaks.toml: allowlist the vector's literal, scoped to that exact value so any other secret in the file is still caught Rescued from an uncommitted change that had sat in a local worktree for five days; rebased onto current master. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
Author
|
Fixed in #97 — this goes green once that merges. Nothing to change here. (That config has carried the Privacy transaction fixture allowlist since Aug 10 without ever taking effect in CI either; this PR just happens to be the first whose finding lands on a changed line.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Locks the Rust decrypt path against a ciphertext produced by canopy-admin's
src/connect-widget/main.ts, so a protocol drift between the two repos (curve, HKDF info string, AEAD choice, byte layout) fails loudly.That drift is otherwise silent: the browser keeps encrypting, this install just stops being able to decrypt.
The golden vector
Generated by importing the real
encryptToInstanceunder Node (the module only callsmain()when a DOM exists), against a throwaway recipient keypair created for the vector alone. It has never been a real instance key and decrypts only a dummy string.WEB_CONNECTIONS.md— how to regenerate, and why the recipient key must never be a real one.gitleaks.toml— allowlists the vector's literal, scoped to that exact value. Verified a different secret in the same file is still caught.Verification
cargo test --lib web_connections→ 6 passed. The JS half (connect-widget.test.js, canopy-admin) is wired into its npm test script in a companion PR.Rescued from an uncommitted change that sat in a local worktree for five days; rebased onto current master.
🤖 Generated with Claude Code