aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup/autoconfigbackup.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-12-06 22:00:33 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-12-06 22:00:33 +0000
commitbe292b70b38536aed4e45bd4a0718ad9a0ac0029 (patch)
treee0adc09436237517263b0aeaaf3fefa2722d2432 /packages/autoconfigbackup/autoconfigbackup.php
parentc6b153e65a2312e5d03628b95e4bbea2165e9dbf (diff)
downloadpfsense-packages-be292b70b38536aed4e45bd4a0718ad9a0ac0029.tar.gz
pfsense-packages-be292b70b38536aed4e45bd4a0718ad9a0ac0029.tar.bz2
pfsense-packages-be292b70b38536aed4e45bd4a0718ad9a0ac0029.zip
If the decrypted file is under 50 characters then something went wrong(TM).
Diffstat (limited to 'packages/autoconfigbackup/autoconfigbackup.php')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index 2a02bd82..cc3740ca 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -114,6 +114,8 @@ if($_REQUEST['newver'] != "") {
$fd = fopen("/tmp/config_restore.xml", "w");
fwrite($fd, $data);
fclose($fd);
+ if(count($data) < 50)
+ $input_errors[] = "The decrypted config.xml is under 50 characters, something went wrong. Aborting.";
$ondisksha256 = trim(`/sbin/sha256 /tmp/config_restore.xml | awk '{ print $4 }'`);
if($sha256 != "0" || $sha256 != "") // we might not have a sha256 on file for older backups
if($ondisksha256 <> $sha256)