Set default cipher in only one place
This commit is contained in:
parent
d9adc80209
commit
6098f76616
1 changed files with 10 additions and 11 deletions
21
yadm
21
yadm
|
@ -922,16 +922,20 @@ function _get_openssl_ciphername() {
|
||||||
echo "$OPENSSL_CIPHERNAME"
|
echo "$OPENSSL_CIPHERNAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _decrypt_from() {
|
function _get_cipher() {
|
||||||
|
|
||||||
local output_archive
|
|
||||||
output_archive="$1"
|
output_archive="$1"
|
||||||
|
|
||||||
local yadm_cipher
|
|
||||||
yadm_cipher="$(config yadm.cipher)"
|
yadm_cipher="$(config yadm.cipher)"
|
||||||
if [ -z "$yadm_cipher" ]; then
|
if [ -z "$yadm_cipher" ]; then
|
||||||
yadm_cipher="gpg"
|
yadm_cipher="gpg"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _decrypt_from() {
|
||||||
|
|
||||||
|
local output_archive
|
||||||
|
local yadm_cipher
|
||||||
|
_get_cipher "$1"
|
||||||
|
|
||||||
case "$yadm_cipher" in
|
case "$yadm_cipher" in
|
||||||
gpg)
|
gpg)
|
||||||
|
@ -958,13 +962,8 @@ function _decrypt_from() {
|
||||||
function _encrypt_to() {
|
function _encrypt_to() {
|
||||||
|
|
||||||
local output_archive
|
local output_archive
|
||||||
output_archive="$1"
|
|
||||||
|
|
||||||
local yadm_cipher
|
local yadm_cipher
|
||||||
yadm_cipher="$(config yadm.cipher)"
|
_get_cipher "$1"
|
||||||
if [ -z "$yadm_cipher" ]; then
|
|
||||||
yadm_cipher="gpg"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$yadm_cipher" in
|
case "$yadm_cipher" in
|
||||||
gpg)
|
gpg)
|
||||||
|
|
Loading…
Reference in a new issue