ssh kitten: Fix failure when remote system has no base64 but does have openssl

This commit is contained in:
Kovid Goyal 2023-03-17 08:36:52 +05:30
parent c8fe0712e6
commit f7b735d5ab
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -47,7 +47,7 @@ if command -v base64 > /dev/null 2> /dev/null; then
base64_decode() { command base64 -d; } base64_decode() { command base64 -d; }
elif command -v openssl > /dev/null 2> /dev/null; then elif command -v openssl > /dev/null 2> /dev/null; then
base64_encode() { command openssl enc -A -base64; } base64_encode() { command openssl enc -A -base64; }
base64_decode() { command openssl enc -d -base64; } base64_decode() { command openssl enc -A -d -base64; }
elif command -v b64encode > /dev/null 2> /dev/null; then elif command -v b64encode > /dev/null 2> /dev/null; then
base64_encode() { command b64encode - | command sed '1d;$d' | command tr -d \\n\\r; } base64_encode() { command b64encode - | command sed '1d;$d' | command tr -d \\n\\r; }
base64_decode() { command fold -w 76 | command b64decode -r; } base64_decode() { command fold -w 76 | command b64decode -r; }