From 3708781390271e9a3481f7aad137922f348bd556 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 18 Oct 2025 14:32:06 +0800 Subject: [PATCH] feat: v1.9.18 --- Cargo.lock | 9 ++++++++- Cargo.toml | 3 ++- src/main.rs | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c516d1..0f67065 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "tiny-encrypt" -version = "1.9.17" +version = "1.9.18" dependencies = [ "aes-gcm-stream", "base64 0.22.1", @@ -2118,6 +2118,7 @@ dependencies = [ "x509-parser", "yubikey", "zeroize", + "zeroizing-alloc", ] [[package]] @@ -2688,3 +2689,9 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zeroizing-alloc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebff5e6b81c1c7dca2d0bd333b2006da48cb37dbcae5a8da888f31fcb3c19934" diff --git a/Cargo.toml b/Cargo.toml index 53a0472..5628176 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tiny-encrypt" -version = "1.9.17" +version = "1.9.18" edition = "2021" license = "MIT" description = "A simple and tiny file encrypt tool" @@ -56,6 +56,7 @@ json5 = "0.4" external-command-rs = "0.1" percent-encoding = "2.3" ml-kem = { version = "0.2.1", features = ["zeroize"] } +zeroizing-alloc = "0.1.0" [profile.release] codegen-units = 1 diff --git a/src/main.rs b/src/main.rs index 48ae5db..594a527 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,11 @@ use tiny_encrypt::CmdInitKeychain; use tiny_encrypt::CmdInitPiv; use tiny_encrypt::{init_tiny_encrypt_log, CmdConfig, CmdDirectDecrypt, CmdEncrypt, CmdInfo, CmdSimpleDecrypt, CmdSimpleEncrypt, CmdVersion}; +use zeroizing_alloc::ZeroAlloc; + +#[global_allocator] +static ALLOC: ZeroAlloc = ZeroAlloc(std::alloc::System); + #[derive(Debug, Parser)] #[command(name = "tiny-encrypt-rs")] #[command(about = "A tiny encrypt client in Rust", long_about = None)]