Skip to content
Snippets Groups Projects
Commit c12bb26f authored by Bob Mottram's avatar Bob Mottram
Browse files

Fix symmetric encryption of backup keys

parent d37e7a4d
No related branches found
No related tags found
No related merge requests found
......@@ -360,6 +360,7 @@ function simple_store_backup_keys {
exit 35683
fi
simple_keys_file=/root/simplebackupkeys.tar.gz
simple_keys_file_encrypted=/root/simplebackupkeys.gpg
cd "/home/${ADMIN_USERNAME}" || return
tar -czvf $simple_keys_file .gnupg
if [ ! -f $simple_keys_file ]; then
......@@ -367,9 +368,14 @@ function simple_store_backup_keys {
rm -rf $USB_MOUNT
exit 563535
fi
if [ -f $simple_keys_file_encrypted ]; then
rm $simple_keys_file_encrypted
fi
echo -n "$simple_backup_password" | gpg --batch --passphrase-fd 0 --output $USB_MOUNT/config.dat --symmetric --armor $simple_keys_file
echo -n "$simple_backup_password" | gpg --batch --passphrase-fd 0 --armor --output $simple_keys_file_encrypted --symmetric $simple_keys_file
cp $simple_keys_file_encrypted $USB_MOUNT/config.dat
rm $simple_keys_file_encrypted
rm $simple_keys_file
simple_backup_password=
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment