feat: v1.12.10
This commit is contained in:
@@ -32,7 +32,11 @@ impl Command for CommandImpl {
|
||||
let ciphertext = sub_arg_matches.value_of("ciphertext").unwrap();
|
||||
let auto_pbe = sub_arg_matches.is_present("auto-pbe");
|
||||
|
||||
let text = hmac_decrypt(ciphertext, auto_pbe)?;
|
||||
let text = if pbeutil::is_simple_pbe_encrypted(ciphertext) {
|
||||
pbeutil::simple_pbe_decrypt_with_prompt_to_string(&ciphertext)?
|
||||
} else {
|
||||
hmac_decrypt(ciphertext, auto_pbe)?
|
||||
};
|
||||
|
||||
if json_output {
|
||||
let mut json = BTreeMap::<&'_ str, String>::new();
|
||||
@@ -47,9 +51,11 @@ impl Command for CommandImpl {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn try_hmac_decrypt(ciphertext: &str) -> XResult<String> {
|
||||
pub fn try_decrypt(ciphertext: &str) -> XResult<String> {
|
||||
if is_hmac_encrypted(ciphertext) {
|
||||
hmac_decrypt(ciphertext, true)
|
||||
} else if pbeutil::is_simple_pbe_encrypted(ciphertext) {
|
||||
pbeutil::simple_pbe_decrypt_with_prompt_to_string(&ciphertext)
|
||||
} else {
|
||||
Ok(ciphertext.to_string())
|
||||
}
|
||||
@@ -58,7 +64,7 @@ pub fn try_hmac_decrypt(ciphertext: &str) -> XResult<String> {
|
||||
pub fn hmac_decrypt(ciphertext: &str, auto_pbe: bool) -> XResult<String> {
|
||||
let text = hmac_decrypt_to_string(ciphertext)?;
|
||||
if auto_pbe && pbeutil::is_simple_pbe_encrypted(&text) {
|
||||
Ok(pbeutil::simple_pbe_decrypt_with_prompt_to_string(&text)?)
|
||||
pbeutil::simple_pbe_decrypt_with_prompt_to_string(&text)
|
||||
} else {
|
||||
Ok(text)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user