feat: v1.13.9
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -508,7 +508,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.13.8"
|
version = "1.13.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm-stream",
|
"aes-gcm-stream",
|
||||||
"authenticator 0.3.1",
|
"authenticator 0.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.13.8"
|
version = "1.13.9"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ impl Command for CommandImpl {
|
|||||||
.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())
|
||||||
|
.arg(Arg::with_name("without-hmac-encrypt").long("without-hmac-encrypt").help("Without HMAC encrypt"))
|
||||||
.arg(cmdutil::build_json_arg())
|
.arg(cmdutil::build_json_arg())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +29,13 @@ impl Command for CommandImpl {
|
|||||||
let text = sub_arg_matches.value_of("plaintext").unwrap().to_string();
|
let text = sub_arg_matches.value_of("plaintext").unwrap().to_string();
|
||||||
let mut pin_opt = sub_arg_matches.value_of("password").map(|p| p.to_string());
|
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 = do_encrypt(&text, &mut pin_opt, sub_arg_matches)?;
|
||||||
let ciphertext = hmacutil::hmac_encrypt_from_string(&ciphertext)?;
|
|
||||||
|
let without_hmac_encrypt = sub_arg_matches.is_present("without-hmac-encrypt");
|
||||||
|
let ciphertext = if without_hmac_encrypt {
|
||||||
|
ciphertext
|
||||||
|
} else {
|
||||||
|
hmacutil::hmac_encrypt_from_string(&ciphertext)?
|
||||||
|
};
|
||||||
|
|
||||||
if json_output {
|
if json_output {
|
||||||
let mut json = BTreeMap::<&'_ str, String>::new();
|
let mut json = BTreeMap::<&'_ str, String>::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user