feat: add zeroizing_alloc

This commit is contained in:
2025-06-28 00:24:58 +08:00
parent 4c7008ce26
commit a8d3f6dadb
3 changed files with 353 additions and 269 deletions

614
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,7 @@ log = "0.4"
env_logger = "0.11"
log4rs = "1.3"
pinentry-util = "0.1.1"
zeroizing-alloc = "0.1.0"
[target.'cfg(target_os = "linux")'.dependencies]
procfs = { version = "0.13", optional = true }

View File

@@ -2,6 +2,11 @@ use clap::{App, AppSettings, ArgMatches};
use rust_util::util_clap::{Command, CommandError};
use rust_util::{failure_and_exit, information, success, warning};
use zeroizing_alloc::ZeroAlloc;
#[global_allocator]
static ALLOC: ZeroAlloc<std::alloc::System> = ZeroAlloc(std::alloc::System);
mod db;
mod proc;
mod jose;
@@ -85,4 +90,4 @@ fn inner_main() -> CommandError {
}
}
DefaultCommandImpl::run(&matches)
}
}