Commit a156c466 authored by Ad Schellevis's avatar Ad Schellevis

reformat tag line of encrypted backup

parent a453bfe8
......@@ -448,6 +448,7 @@ function backup_to_google_drive() {
// backup source data to local strings (plain/encrypted)
$confdata = file_get_contents('/conf/config.xml') ;
$confdata_enc = encrypt_data($confdata, $config->system->remotebackup->GDrivePassword->__toString()) ;
tagfile_reformat($confdata_enc, $confdata_enc, "config.xml");
// read filelist (config-*.xml) and cleanup old files
......
......@@ -291,7 +291,6 @@ if ($_POST) {
if ($_POST['decrypt']) {
if (!tagfile_deformat($data, $data, "config.xml")) {
$input_errors[] = gettext("The uploaded file does not appear to contain an encrypted OPNsense configuration.");
return 1;
}
$data = decrypt_data($data, $_POST['decrypt_password']);
}
......@@ -321,7 +320,7 @@ if ($_POST) {
}
}
} else {
if(true) {
if(!$input_errors) {
/* restore the entire configuration */
$filename = $_FILES['conffile']['tmp_name'];
file_put_contents($filename, $data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment