diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-06 22:00:33 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-06 22:00:33 +0000 |
commit | be292b70b38536aed4e45bd4a0718ad9a0ac0029 (patch) | |
tree | e0adc09436237517263b0aeaaf3fefa2722d2432 | |
parent | c6b153e65a2312e5d03628b95e4bbea2165e9dbf (diff) | |
download | pfsense-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).
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 2 |
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) |