fix(store): bind chat AEAD to row AAD #5

Merged
sirius merged 1 commit from wt/t_69a6b3f9 into main 2026-09-10 23:41:58 +00:00
Owner

Summary

  • Bind at-rest ChaCha20-Poly1305 to AAD owmsg1 || friend_id_le64 || dir || 0x00 || row_id_le64 so swapped messages.plaintext blobs fail closed (audit F2).
  • list_messages decrypts only with that AAD (no empty-AAD fallback).
  • Existing DBs: one-shot rewrap of empty-AAD v0.2 blobs on unlock; then swap fails.
  • Wrong passphrase still fail-closed; honest reopen still decrypts.

Tests

cargo test --locked 107 passed / 3 ignored. cargo clippy --locked --all-targets -- -D warnings clean.

Do not merge unless Lance says so.

## Summary - Bind at-rest ChaCha20-Poly1305 to AAD `owmsg1 || friend_id_le64 || dir || 0x00 || row_id_le64` so swapped `messages.plaintext` blobs fail closed (audit F2). - `list_messages` decrypts only with that AAD (no empty-AAD fallback). - Existing DBs: one-shot rewrap of empty-AAD v0.2 blobs on unlock; then swap fails. - Wrong passphrase still fail-closed; honest reopen still decrypts. ## Tests `cargo test --locked` 107 passed / 3 ignored. `cargo clippy --locked --all-targets -- -D warnings` clean. Do not merge unless Lance says so.
sirius added 1 commit 2026-09-10 23:39:18 +00:00
[verified] fix(store): bind chat AEAD to row AAD
Some checks failed
ci / test (pull_request) Failing after 2m59s
f75c434db7
ChaCha20-Poly1305 at rest now MACs owmsg1||friend_id_le64||dir||0x00||row_id_le64.
Swapped ciphertext fails closed. Empty-AAD v0.2 blobs rewrap once on unlock;
list_messages never falls back to empty AAD.
sirius merged commit b1427041c2 into main 2026-09-10 23:41:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sirius/onionwire#5
No description provided.