aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fextdata.php4
-rw-r--r--src/hex.php3
-rw-r--r--src/site/getsite.php2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/fextdata.php b/src/fextdata.php
index da893e5..774d9f0 100644
--- a/src/fextdata.php
+++ b/src/fextdata.php
@@ -247,7 +247,7 @@ function getMainXML() {
// LOGError("ok=" . $ok);
if(substr($ok,strlen($ok)-strlen('TRANSFER OK'),strlen('TRANSFER OK')) == 'TRANSFER OK') {
- $data = encryptData(generateSiteXML($contest, $localsite, $updatetime-30),myhash (trim($sitedata[2])));
+ $data = encryptData(generateSiteXML($contest, $localsite, $updatetime-30),myhash(myhash(trim($sitedata[2]))));
$data_url = http_build_query(array('xml' => $data, 'updatetime' => ($updatetime-30)
));
@@ -275,7 +275,7 @@ function getMainXML() {
LOGError("xmltransfer: failed (" . $ok . ")");
}
- $s = decryptData($s,myhash (trim($sitedata[2])));
+ $s = decryptData($s,myhash (trim($sitedata[2])),'xml from main not ok');
if(strtoupper(substr($s,0,5)) != "<XML>") {
return false;
}
diff --git a/src/hex.php b/src/hex.php
index 2e0e7f8..104b331 100644
--- a/src/hex.php
+++ b/src/hex.php
@@ -66,7 +66,8 @@ function decryptData($crypttext,$key,$txt='') {
if($test1 != $test2) {
if($txt=='')
MSGError("Decryption error -- contact an admin now (" . getFunctionName() .")");
-// LogError("Decryption error -- contact an admin, possibly password wrong (" . getFunctionName() .",$txt)");
+ else
+ LogError("Decryption error (" . getFunctionName() .",$txt)");
return "";
}
if($iscompressed) return unzipstr($decrypttext);
diff --git a/src/site/getsite.php b/src/site/getsite.php
index 2476392..66e04e5 100644
--- a/src/site/getsite.php
+++ b/src/site/getsite.php
@@ -33,7 +33,7 @@ if($ct["contestlocalsite"]==$ct["contestmainsite"]) {
if(isset($_POST)) {
if(isset($_POST['xml'])) {
// $fp=fopen('/tmp/aaa',"w"); fwrite($fp,$_POST['xml']); fclose($fp);
- $s = decryptData(rawurldecode($_POST['xml']),myhash($_SESSION["usertable"]["userpassword"]));
+ $s = decryptData(rawurldecode($_POST['xml']),myhash($_SESSION["usertable"]["userpassword"]),'xml from local not ok');
// $fp=fopen('/tmp/aaa1',"w"); fwrite($fp,$s); fclose($fp);
if(strtoupper(substr($s,0,5)) != "<XML>") {
echo "<!-- <ERROR8> ".session_id() . " " . session_id() . " -->\n";