mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-13 17:57:04 +01:00
vault: a password change brings a new master key
:passwd used to wrap the same master key under the new password, so an old diary.db (a pre-* snapshot, an old revision on Proton Drive) and the old password still opened every sealed file. It now makes a new master key. The old password opens nothing from that moment; the old master key is kept, sealed under the new one, in two new vault columns, only until every sealed file has been re-sealed. A background worker does that while the vault is open, without holding it open. Each file gets a new id with its file key wrapped under the new master key; its records are copied as they are. The move goes through the same repointing as :encrypt, so the old id is put on backup_retired and the mirror purges it from Drive. Which files are left is read off their headers, so a lock or a restart halfway only pauses the work until the next unlock. Once none is left, the old key is dropped. Readers take a Keyring that tries the current key, then the retired one. A second :passwd is refused until the first has finished. :vault shows the progress. Every sealed file is uploaded to Proton once more.
This commit is contained in:
1 parent
947cc2ba96
commit
3387db1c4d
13 files changed
+724
-143
No files matched your search
@@ -137,6 +137,7 @@ async fn main() -> Result<()> {
|
||||
epoch: Arc::new(std::sync::atomic::AtomicI64::new(epoch)),
|
||||
sessions,
|
||||
};
|
||||
routes::seal::spawn_rekey(state.clone());
|
||||
|
||||
if let Some(sftp_bind) = config.sftp.bind {
|
||||
let sftp_state = state.clone();
|
||||
|
||||
Reference in new issue
Block a user