Skip to content

docs: fix offline lease sealing flow and specify encryption primitive in ADR 006 - #110

Merged
thiras merged 1 commit into
mainfrom
docs/006-offline-lease-encryption-primitive
Apr 2, 2026
Merged

thiras merged 1 commit into
mainfrom
docs/006-offline-lease-encryption-primitive

Conversation

@thiras

@thiras thiras commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix incorrect flow where app server sealed leases with a non-exportable device key — server now builds the lease and returns it; the client seals locally using the platform keystore
  • Replace underspecified encrypt(device_key, lease) with AEAD_Seal(device_key, lease) reflecting opaque key handles and platform-dependent primitives (typically AES-256-GCM)
  • Make TLS requirement normative for lease transit (plaintext K_blobs in transit)
  • Clarify desktop keystore security downgrade (key returned to user-space)
  • Update architecture.md app server responsibilities to reflect client-side sealing

Supersedes #109 (accidentally merged before review fixes).

Test plan

  • Verify lease issuance pseudocode correctly separates server steps (build + return) from client steps (seal + store)
  • Confirm device_key is never referenced in a server-side context across all ADRs
  • Check architecture.md summary is consistent with the updated ADR 006 flow
  • Verify TLS requirement is stated normatively in the authenticated channel comment

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 2, 2026 03:52

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the offline lease issuance process, shifting the responsibility of sealing the lease from the app server to the client using a device-bound key. The review feedback highlights a potential security downgrade by sending keys in plaintext over TLS compared to the online flow, suggests including a nonce in the AEAD pseudocode for completeness, and points out a contradiction regarding hardware-backed key isolation on desktop platforms.

Comment thread adr/006-e2e-encryption.md Resolved
Comment thread adr/006-e2e-encryption.md Resolved
Comment thread adr/006-e2e-encryption.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the design documentation around offline playback lease issuance in ADR 006 to ensure leases are constructed server-side but sealed client-side using the device keystore, and aligns the higher-level architecture summary accordingly.

Changes:

  • Correct the offline lease flow so the server builds/returns the lease and the client seals it locally via the platform keystore.
  • Replace the underspecified encrypt(device_key, lease) step with an explicit AEAD sealing operation and expand keystore/primitive notes.
  • Update adr/architecture.md app server responsibilities to match the revised client-side sealing model.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
adr/architecture.md Updates app server responsibility wording to reflect client-side lease sealing.
adr/006-e2e-encryption.md Fixes the offline lease issuance pseudocode and clarifies the intended encryption primitive and TLS requirement for lease transit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adr/006-e2e-encryption.md Resolved
Comment thread adr/006-e2e-encryption.md Resolved
… in ADR 006 (#110)

- Fix incorrect flow where app server sealed leases with non-exportable
  device key — server now builds the lease and returns it over HTTPS;
  the client seals locally using the platform keystore
- Replace underspecified encrypt(device_key, lease) with AEAD_Seal
  reflecting opaque key handles and platform-dependent primitives
- Scope device_key isolation per platform: non-exportable on mobile,
  zeroize-after-use on desktop
- Update architecture.md app server responsibilities accordingly

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@thiras
thiras force-pushed the docs/006-offline-lease-encryption-primitive branch from 40b1e70 to bafc4cf Compare April 2, 2026 04:01
@thiras
thiras merged commit 6ffc58e into main Apr 2, 2026
@thiras
thiras deleted the docs/006-offline-lease-encryption-primitive branch April 2, 2026 04:01
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.

2 participants