From b79df269c8a6c71f5fc8a1160473559c129ba5fd Mon Sep 17 00:00:00 2001 From: gustavo panizzo Date: Thu, 27 Feb 2020 01:47:43 +0100 Subject: [PATCH] fix shell redirection bug --- sshenc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sshenc.sh b/sshenc.sh index 4d0c083..466075b 100755 --- a/sshenc.sh +++ b/sshenc.sh @@ -120,7 +120,7 @@ elif [[ -e "$private_key" ]]; then decrypted=false for key in "${keys[@]}"; do - if ((echo "$key" | openssl base64 -d -A | openssl rsautl -decrypt -oaep -inkey "$temp_dir/private_key" >"$temp_file") >/dev/null 2>&1); then + if $(echo "$key" | openssl base64 -d -A | openssl rsautl -decrypt -oaep -inkey "$temp_dir/private_key" >"$temp_file" 2>/dev/null); then if echo "$cypher" | openssl base64 -d -A | openssl aes-256-cbc -pbkdf2 -iter 100000 -d -pass file:"$temp_file"; then decrypted=true fi