feat: v1.13.3

This commit is contained in:
2025-05-09 23:47:10 +08:00
parent fdf02bc976
commit 58f665823d
3 changed files with 5 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -508,7 +508,7 @@ dependencies = [
[[package]] [[package]]
name = "card-cli" name = "card-cli"
version = "1.13.2" version = "1.13.3"
dependencies = [ dependencies = [
"aes-gcm-stream", "aes-gcm-stream",
"authenticator 0.3.1", "authenticator 0.3.1",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "card-cli" name = "card-cli"
version = "1.13.2" version = "1.13.3"
authors = ["Hatter Jiang <jht5945@gmail.com>"] authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018" edition = "2018"

View File

@@ -21,6 +21,7 @@ impl Command for CommandImpl {
.required(true) .required(true)
.help("Plaintext"), .help("Plaintext"),
) )
.arg(Arg::with_name("password").long("password").takes_value(true).help("Password"))
.arg(cmdutil::build_with_pbe_encrypt_arg()) .arg(cmdutil::build_with_pbe_encrypt_arg())
.arg(cmdutil::build_double_pin_check_arg()) .arg(cmdutil::build_double_pin_check_arg())
.arg(cmdutil::build_pbe_iteration_arg()) .arg(cmdutil::build_pbe_iteration_arg())
@@ -31,7 +32,8 @@ impl Command for CommandImpl {
let json_output = cmdutil::check_json_output(sub_arg_matches); let json_output = cmdutil::check_json_output(sub_arg_matches);
let text = sub_arg_matches.value_of("plaintext").unwrap().to_string(); let text = sub_arg_matches.value_of("plaintext").unwrap().to_string();
let ciphertext = do_encrypt(&text, &mut None, sub_arg_matches)?; let mut pin_opt = sub_arg_matches.value_of("password").map(|p| p.to_string());
let ciphertext = do_encrypt(&text, &mut pin_opt, sub_arg_matches)?;
let ciphertext = hmacutil::hmac_encrypt_from_string(&ciphertext)?; let ciphertext = hmacutil::hmac_encrypt_from_string(&ciphertext)?;
if json_output { if json_output {