feat(store): encrypt chat bodies at rest; Ctrl-Q CLEAR/QUIT
All checks were successful
ci / test (pull_request) Successful in 3m13s
All checks were successful
ci / test (pull_request) Successful in 3m13s
Wrap a random 32-byte message key with Argon2id+ChaCha20-Poly1305. sqlite messages.plaintext is nonce||ciphertext; identity keys stay plaintext. Empty/wrong passphrase fails closed. Ctrl-Q types CLEAR or QUIT then Enter (Esc cancels).
This commit is contained in:
parent
1d7f8e1f35
commit
6323619d80
16 changed files with 461 additions and 35 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
|
||||
use onionwire::qr;
|
||||
use onionwire::Store;
|
||||
use onionwire::qr;
|
||||
|
||||
static ENV_LOCK: Mutex<()> = Mutex::new(());
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ impl TempHome {
|
|||
let guard = ENV_LOCK.lock().expect("env lock");
|
||||
unsafe {
|
||||
std::env::set_var("ONIONWIRE_HOME", dir.path());
|
||||
std::env::set_var("ONIONWIRE_STORE_PASSPHRASE", "onionwire-test");
|
||||
}
|
||||
Self {
|
||||
_dir: dir,
|
||||
|
|
@ -30,6 +31,7 @@ impl Drop for TempHome {
|
|||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
std::env::remove_var("ONIONWIRE_HOME");
|
||||
std::env::remove_var("ONIONWIRE_STORE_PASSPHRASE");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue