Repository navigation
docs: fix offline lease sealing flow and specify encryption primitive in ADR 006 - #109
Conversation
Replace underspecified encrypt(device_key, lease) with explicit XChaCha20-Poly1305 AEAD and document platform keystore constraints (AES-256-GCM fallback where secure elements lack XChaCha20 support). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the end-to-end encryption architecture document to specify XChaCha20-Poly1305 for sealing leases, with a fallback to AES-256-GCM on certain platforms. Review feedback identifies a logical contradiction where the server is tasked with using non-exportable hardware-backed keys and highlights the critical need for unique nonces when falling back to AES-GCM to prevent key compromise.
There was a problem hiding this comment.
Pull request overview
This PR updates ADR 006’s offline lease sealing pseudocode to specify a concrete AEAD primitive (XChaCha20-Poly1305) and documents a platform-keystore-driven fallback (AES-256-GCM), clarifying the intended “device-bound key” security property.
Changes:
- Replace underspecified
encrypt(device_key, lease)withXChaCha20-Poly1305(device_key, lease)in the offline lease flow. - Add documentation about keystore-backed AEAD execution and a potential AES-256-GCM substitution.
- Explicitly state the invariant that
device_keyshould not leave the keystore in plaintext.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback on #109: - Make TLS requirement normative for lease transit (plaintext K_blobs) - Clarify desktop keystore returns key to user-space - Use precise verb in architecture.md (builds/returns, not issues) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
encrypt(device_key, lease)withAEAD_Seal(device_key, lease)reflecting opaque key handles and platform-dependent primitives (typically AES-256-GCM)architecture.mdapp server responsibilities to clarify client-side sealingTest plan
device_keyis never referenced in a server-side context across all ADRsarchitecture.mdsummary is consistent with the updated ADR 006 flow🤖 Generated with Claude Code