1
0
Fork 0
mirror of synced 2024-11-04 17:08:56 -05:00

Set default cipher in only one place

This commit is contained in:
Tim Byrne 2020-07-17 14:43:29 -05:00
parent d9adc80209
commit 6098f76616
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12

21
yadm
View file

@ -922,16 +922,20 @@ function _get_openssl_ciphername() {
echo "$OPENSSL_CIPHERNAME"
}
function _decrypt_from() {
local output_archive
function _get_cipher() {
output_archive="$1"
local yadm_cipher
yadm_cipher="$(config yadm.cipher)"
if [ -z "$yadm_cipher" ]; then
yadm_cipher="gpg"
fi
}
function _decrypt_from() {
local output_archive
local yadm_cipher
_get_cipher "$1"
case "$yadm_cipher" in
gpg)
@ -958,13 +962,8 @@ function _decrypt_from() {
function _encrypt_to() {
local output_archive
output_archive="$1"
local yadm_cipher
yadm_cipher="$(config yadm.cipher)"
if [ -z "$yadm_cipher" ]; then
yadm_cipher="gpg"
fi
_get_cipher "$1"
case "$yadm_cipher" in
gpg)