fix(store): fail closed on decrypt failure in decrypt_text_at_rest #264

Merged
KofTwentyTwo merged 1 commits from story/m6-decrypt-fail-closed into dev 2026-07-31 16:07:11 +00:00
1 Commits
Author SHA1 Message Date
James Maes 4066ff1832 fix(store): fail closed on decrypt failure in decrypt_text_at_rest
decrypt_text_at_rest previously swallowed any hex-decode, AEAD-decrypt,
or UTF-8 failure with a fallback to an empty string, so a corrupted or
tampered body column read back as an empty body instead of surfacing
an error -- defeating the AEAD's integrity guarantee exactly where it
matters: detecting tampering on read. Change its signature to return
Result<String, CipherError> and propagate failures through every read
call site in db.rs as the new DatabaseError::Decryption variant.

Refs #237 #162
2026-07-31 11:03:27 -05:00