feat(core): zeroize in-memory secret material (Noise/Ed25519/X25519/store key)
All checks were successful
ci / test (pull_request) Successful in 3m50s
All checks were successful
ci / test (pull_request) Successful in 3m50s
Wrap every secret this crate holds in zeroize: the local identity and prekey secrets (Keys), the backup bundle and its derived Argon2id wrap key, the store data key and the SQLCipher key material, the identity secret handed out by Store::self_identity, the raw identity-secret copies in pay/qr signing, and the wallet RPC password plus the user:realm:password digest input.
This commit is contained in:
parent
e7b37ccb40
commit
fc7378596d
12 changed files with 297 additions and 71 deletions
|
|
@ -8,6 +8,7 @@ use futures::StreamExt;
|
|||
use futures::io::{AsyncRead, AsyncWrite};
|
||||
use tor_cell::relaycell::msg::Connected;
|
||||
use tor_hsservice::{RunningOnionService, handle_rend_requests};
|
||||
use zeroize::Zeroizing;
|
||||
|
||||
use crate::dispatch::{self, Kind};
|
||||
use crate::file;
|
||||
|
|
@ -53,12 +54,14 @@ pub struct Node {
|
|||
|
||||
impl Node {
|
||||
pub async fn start(home: PathBuf) -> Result<Arc<Self>, String> {
|
||||
let pass = std::env::var("ONIONWIRE_STORE_PASSPHRASE")
|
||||
.map_err(|_| "ONIONWIRE_STORE_PASSPHRASE required".to_string())?;
|
||||
let pass = Zeroizing::new(
|
||||
std::env::var("ONIONWIRE_STORE_PASSPHRASE")
|
||||
.map_err(|_| "ONIONWIRE_STORE_PASSPHRASE required".to_string())?,
|
||||
);
|
||||
if pass.is_empty() {
|
||||
return Err("empty passphrase".into());
|
||||
}
|
||||
Self::start_with_passphrase(home, &pass).await
|
||||
Self::start_with_passphrase(home, pass.as_str()).await
|
||||
}
|
||||
|
||||
pub async fn start_with_passphrase(
|
||||
|
|
|
|||
Loading…
Reference in a new issue