-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
cspp:phase:2CSPP Phase 2: Master Key Infrastructure & Local EncryptionCSPP Phase 2: Master Key Infrastructure & Local Encryption
Milestone
Description
Integrate EncryptedBackend into database startup with detection, migration triggering, and .bak cleanup.
Startup sequence:
- Check for interrupted migration: if
.bakand.enc.tmpexist → resume (finish rename) - Detect if DB is encrypted via
EncryptedBackend::is_encrypted(path)- Encrypted: open with
EncryptedBackendusing Sensitive Data Key - Plaintext: open without encryption (legacy, pre-master-key)
- Encrypted: open with
- If encrypted DB opened successfully and
.bakexists → delete.bak - If migration needed (master key exists but DB is still plaintext) → run migration → restart DB init
Integration points:
database.rs:get_or_create_main_database()— add encrypted pathdatabase/wallet_data.rs:get_or_create_database()— add encrypted path- Both functions gain an
Option<[u8; 32]>key parameter:None→ plaintext (backwards compatible),Some(key)→ open/create withEncryptedBackend
Files: rust/src/database.rs, rust/src/database/wallet_data.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cspp:phase:2CSPP Phase 2: Master Key Infrastructure & Local EncryptionCSPP Phase 2: Master Key Infrastructure & Local Encryption