wallet: actually open the wallet file, and remember its passphrase
`monero-wallet-rpc` starts with no wallet open and keeps one only for the life of its process, so a restart, a Lock/unlock or a wallet re-point left a live child answering `-13 No wallet file` to every read while the file sat on disk. The app now opens the configured catalogue file itself (`Wallet::open_wallet`, over RPC — never `--wallet-file`/`--password` on argv, which `ps` exposes) after the child is up, and keeps the passphrase that does it, sealed with the store data key beside the RPC creds under its own AAD. - core: `Wallet::open_wallet`, `WalletConfig::wallet_passphrase` (+ `with_wallet_passphrase`, redacted Debug, kept out of the endpoint config), `Error::is_unreachable` for the one retryable class (the port binds a moment after spawn; a timeout is not a start in progress). - store: `wallet_config.sealed_passphrase` column (additive, AAD `onionwire-store-v1:wallet-passphrase`), read-modify-written so the endpoint/login survive; `wallet_save_config` keeps the stored one. - node: `start_wallet_child` opens the file, `open_wallet_with_passphrase` opens a file with a passphrase the user just typed and seals it only once a live daemon accepted it, `wallet_status` grows `wallet_open` and `needs_passphrase`. A child the RPC refuses is stopped rather than left inert; an install with no stored passphrase still starts, and says so. - tui: one-shot prompt (`WalletSetup::UnlockPass`) on a wallet that needs it, reachable from the saved-wallet picker and from `s`. - sdk: `openWalletWithPassphrase`, the two status fields, README flow. - docs: WALLET/THREAT_MODEL/README — the passphrase is kept, and the consequence (the store passphrase is sufficient to spend) is stated rather than implied. Tests: 4 new node tests drive a real child lifecycle against a loopback wallet RPC (open on restart, no open without a passphrase, refused passphrase, sealed-on-success), a `tests/wallet.rs` test asserts the bytes sent (`open_wallet` + filename + password), and `tests/store.rs` covers the sealed column and the plaintext->encrypted upgrade with it set. Mutation-checked: stubbing the two open paths fails all four.
This commit is contained in:
parent
c5725856ad
commit
ed29131a67
12 changed files with 1262 additions and 54 deletions
|
|
@ -171,6 +171,17 @@ watch-only wallet detected over RPC via `query_key spend_key` → `-29`).
|
|||
seed-backed spend-capable wallet makes OnionWire a **local spend authority**
|
||||
for that file: anyone with the wallet passphrase or the wallet-RPC credentials
|
||||
can move the balance, and `/tip` is a supported way for a chat peer to get paid.
|
||||
Those credentials are sealed with the store data key (SQLCipher plus a per-row
|
||||
AEAD), and so is the **wallet-file passphrase**: it is kept in the same sealed
|
||||
row, because `monero-wallet-rpc` holds a wallet only for the life of one process
|
||||
and reopening the file needs it. That is a deliberate decision with a real
|
||||
consequence — **whoever can unlock the store can spend**: the store passphrase
|
||||
(or its Keystore wrapper) is now sufficient, and there is no second secret
|
||||
standing between a seized unlocked device and the wallet's balance. Nothing else
|
||||
changes: `/tip` still refuses on a view-only wallet before any dial, the
|
||||
spend-authority warning is still unavoidable at create/restore, the passphrase is
|
||||
never logged, never in an error string and never on a process argv, and `/wipe`
|
||||
keeps the wallet file and its passphrase exactly as it kept the file before.
|
||||
The spend-authority warning is unavoidable at that create/restore step. Loopback
|
||||
binding is not an authorization boundary. Back up the seed; do not leave a
|
||||
spend-capable wallet on a device you do not trust; a separate hot wallet with a
|
||||
|
|
|
|||
Loading…
Reference in a new issue