From a5982a7c1bb31b16fb7d4b7bb3236e15e2d4960d Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 12 Nov 2026 19:30:09 -0600 Subject: [PATCH] S025: cookies encrypted at rest with a key in the OS keyring (R1-19) servo-net hands its public cookie jar to Nacre instead of writing plain cookie_jar.json; store::cookies seals it in cookies.bin (XChaCha20-Poly1305) with a keyring-held key, saves on change and at exit, migrates the old plain jar. No keyring: cookies for the run only, Settings says so (D-019). Smokes with a throwaway GNOME Keyring (SMOKE_KEYRING=1). Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 +- Cargo.lock | 625 ++++++++++++++++++++- Cargo.toml | 2 + Plans/06 Privacy/S025-cookie-encryption.md | 14 +- Plans/INDEX.md | 2 +- docs/DECISIONS.md | 1 + docs/DESIGN.md | 13 + docs/PROGRESS.md | 7 + src/app.rs | 2 + src/selftest.rs | 1 + src/store/cookies.rs | 271 +++++++++ src/store/mod.rs | 1 + src/store/vault.rs | 20 +- src/ui/pages/settings.rs | 3 + tests/smoke/cookies-cleared.txt | 7 + tests/smoke/cookies-nokeyring.txt | 20 + tests/smoke/cookies-restart.txt | 13 + tests/smoke/cookies.txt | 18 + tests/smoke/net/server.py | 11 + tools/smoke.sh | 32 +- vendor/servo-net/Cargo.toml | 4 + vendor/servo-net/nacre.rs | 66 ++- vendor/servo-net/resource_thread.rs | 20 +- 23 files changed, 1109 insertions(+), 46 deletions(-) create mode 100644 src/store/cookies.rs create mode 100644 tests/smoke/cookies-cleared.txt create mode 100644 tests/smoke/cookies-nokeyring.txt create mode 100644 tests/smoke/cookies-restart.txt create mode 100644 tests/smoke/cookies.txt diff --git a/CLAUDE.md b/CLAUDE.md index defa5de..c06194e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -65,7 +65,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl | `nice cargo build --release -j 2` | compile check, produces `target/release/nacre` | now | | `nice cargo test --release -j 2` | unit tests (44, ~16 s test-profile build then <1 s run; shares the S001 build) (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme, ui::widgets input, ui::paint, ui::pages::newtab) | first successful build; not alongside a build | | `src/selftest.rs` | in-app self test: `NACRE_SCRIPT=` runs script commands (listed at its top) | now | -| `tools/smoke.sh