Repository navigation
Suites in the signed handshake; hybrid encryption for pushes (10.10.0) - #24
Merged
Merged
Conversation
… to the browser
Protocol change (hard cut; server and npm client must move together).
Server
- ChannelSuites: "sc2" = ECDSA P-384 + SHA-512, RSA-OAEP-256 (2048+ bits)
wrapping per-message AES-256-GCM keys. The only suite.
- The browser names its suite inside the signed registration blob
(EncryptionPublicKeyWithTimestampRequest.Suite). The handshake refuses a missing
or unknown suite, another signing curve and another encryption alg.
- ChannelSessionRecord.Suite is stored; a session without one (pre-10.10) or on a
switched-off suite gets 401 and the browser re-registers.
- SignedChannelOptions.AllowedSuites (default: all known) can only narrow; an
unknown id or empty list fails startup.
- Handshake answer and pushes are PublicKeyUtils 10.3.0 HybridEnvelopes: no more
190-byte limit.
Client
- Sends Suite: CHANNEL_SUITE ("sc2") inside the signed blob.
- RSA private key has the unwrapKey usage only; each AES key is unwrapped
straight into a non-extractable CryptoKey. CryptoCore.decryptMessage opens
envelopes and rejects malformed, altered or other-version ones.
Tests: 67 server (14 new SuiteTests), 19 client (4 new). Checked the built
client opens envelopes sealed by PublicKeyUtils 10.3.0 (.NET).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Crypto hardening step 2, SignedChannel half. It builds on PublicKeyUtils 10.3.0 (prmeyn/PublicKeyUtils#7), which is live on nuget.org.
This is a protocol hard cut, as decided. SignedChannel has no outside users, and the one project using it isn't live. A 10.9 browser can't register with a 10.10 server, or the other way round. Ship the NuGet packages and the npm client together.
Server
ChannelSuitesdefines one suite,"sc2":EncryptionPublicKeyWithTimestampRequest.Suite), so it can't be downgraded in transit. The handshake refuses:SC2is refused);alg.ChannelSessionRecord.Suite, auto-mapped in MongoDB). A session without one (written before 10.10) or on a switched-off suite gets401, and the browser registers again.SignedChannelOptions.AllowedSuitesdefaults to every known suite and can only narrow the list. An unknown id or an empty list fails at startup.HybridEnvelopes, which removes the 190-byte push limit.IOptions<SignedChannelOptions>; they're registered automatically.Client (npm)
Suite: CHANNEL_SUITE("sc2") inside the signed blob.CHANNEL_SUITEis exported.unwrapKeyusage only (the public JWK still haskey_ops: ["encrypt"]). Each AES key is unwrapped straight into a non-extractableCryptoKey, so no key material ever reaches JavaScript.CryptoCore.decryptMessageopens version 1 envelopes and rejects malformed, truncated, altered or other-version ones.Tests
Server: 67, 14 new in
SuiteTests. They cover:401, new registration gets400);401;The 53 existing tests pass unchanged, with the test helper now opening envelopes.
Client: 19, 4 new. They cover:
unwrapKeyusage only;null;Cross-check: the built client opened envelopes sealed by PublicKeyUtils 10.3.0 in .NET (21 and 4,010 characters).
Release
Minor: 10.9.0 → 10.10.0 for SignedChannel, SignedChannel.MongoDb and npm
signed-channel-client. No prmeyn package depends on SignedChannel. README has the 10.10.0 release notes, and the client README is updated. Tag only after merge and the go-ahead.🤖 Generated with Claude Code