feat: v1.13.10

This commit is contained in:
2025-05-17 22:08:46 +08:00
parent d42bfd4bcc
commit b23f4a3a69
3 changed files with 6 additions and 3 deletions

View File

@@ -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 {