feat: v1.13.10
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -508,7 +508,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "card-cli"
|
||||
version = "1.13.9"
|
||||
version = "1.13.10"
|
||||
dependencies = [
|
||||
"aes-gcm-stream",
|
||||
"authenticator 0.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "card-cli"
|
||||
version = "1.13.9"
|
||||
version = "1.13.10"
|
||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -25,12 +25,15 @@ impl Command for CommandImpl {
|
||||
|
||||
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
|
||||
let json_output = cmdutil::check_json_output(sub_arg_matches);
|
||||
let without_hmac_encrypt = sub_arg_matches.is_present("without-hmac-encrypt");
|
||||
if without_hmac_encrypt && !sub_arg_matches.is_present("with-pbe-encrypt") {
|
||||
return simple_error!("hmac and pbe encryption must present at least one");
|
||||
}
|
||||
|
||||
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 ciphertext = do_encrypt(&text, &mut pin_opt, sub_arg_matches)?;
|
||||
|
||||
let without_hmac_encrypt = sub_arg_matches.is_present("without-hmac-encrypt");
|
||||
let ciphertext = if without_hmac_encrypt {
|
||||
ciphertext
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user