Skip to content

feat(encryption): v2 key wrap envelope - #534

Merged
samgbafa merged 5 commits into
mainfrom
skgbafa/tc-2518-wrap-v2
Nov 10, 2026
Merged

samgbafa merged 5 commits into
mainfrom
skgbafa/tc-2518-wrap-v2

Conversation

@samgbafa

@samgbafa samgbafa commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Read v1 and TCW2 key-wrap envelopes for network and named keys.
  • Add HKDF-SHA256 v2 wrapping with canonical authenticated context.
  • Keep v1 response writes by default; opt in with [global.encryption_network] key_wrap_v2 = true or TINYCLOUD_ENCRYPTION_NETWORK__KEY_WRAP_V2=true.
  • Keep network/key descriptor and payload schemas unchanged.
  • Add shared SDK interoperability fixtures and version-matrix coverage.

Verification

  • cargo test -p tinycloud-core encryption_network: 229 passed; 10 existing PostgreSQL-gated paths did not connect locally.
  • Final backend regression run: 22 passed.
  • cargo test -p tinycloud-node encryption_network_: 3 passed.
  • cargo build -p tinycloud-node --bin tinycloud: passed.
  • cargo clippy -p tinycloud-core -p tinycloud-node --all-targets -- -D warnings: passed.
  • cargo fmt --all -- --check: passed.
  • Actual local SDK→Rust→SDK HTTP roundtrips passed all four request/response wrap-version combinations, including signature verification.

Companion SDK PR: TinyCloudLabs/js-sdk#906 (593f05173d52dd3f1b9424c7638ca7591cb9d589).
Phase 1 only: writers remain v1 by default. No data migration or deployment included.

Details: TC-2518

@samgbafa
samgbafa merged commit 9b54bf5 into main Nov 10, 2026
30 checks passed
@samgbafa samgbafa mentioned this pull request Nov 10, 2026
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