Files
VoelinClient/docs
faumarayandClaude Sonnet 5.5 248955b85c Overwrite a deleted key and truncate the log after it
SQLite's secure_delete was off: a deleted row stayed in the free space of its
page, and the frame of the write-ahead log that held that page kept the key
until the log was reset. Every connection (Store::init) now sets
secure_delete = ON next to foreign_keys, and Store::delete_identity and
KeyStore::remove (how a sign-out deletes the device key, the synced copies and
the account record) run PRAGMA wal_checkpoint(TRUNCATE) after a row was
deleted, so the page with the overwritten row is copied into client.db and the
log is empty.

The truncate is best effort: the delete has happened and a sign-out must still
finish, so a checkpoint that another connection blocks, or that fails, only
logs a warning that the bytes stay in the log until the next checkpoint.
Keys deleted before this change stay in the free pages until a VACUUM; the
architecture notes say so.

Tests read client.db and client.db-wal as bytes: the PKCS#8 text of a Voelin
device key (sign-out with Auto, and with Forget), a synced TeamSpeak copy's key,
a TeamSpeak identity deleted by Store::delete_identity and a key removed
through KeyStore::remove are present before and in neither file after, another
key is still stored and the log is empty; and secure_delete reads 1 on every
connection. Each raw-file test fails with either measure taken out.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 08:27:56 +03:00
..
2026-10-04 19:15:42 +03:00
2026-10-04 19:11:37 +03:00
2026-10-14 15:01:24 +03:00