feat: v1.13.10
This commit is contained in:
@@ -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