aboutsummaryrefslogtreecommitdiff
path: root/src/getcode.php
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2018-08-27 14:34:30 +0000
committercassio <cassiopc@gmail.com>2018-08-27 14:34:30 +0000
commite2a898ab9f88010a14da14b54a9809ba2c6e17ab (patch)
tree4c8a953ad0d77a8ea9a9a10d016bfaaa6e811b4d /src/getcode.php
parent6ca67b9f36309001cdc149d7746b7a9b3a171bc6 (diff)
downloadboca-e2a898ab9f88010a14da14b54a9809ba2c6e17ab.tar.gz
boca-e2a898ab9f88010a14da14b54a9809ba2c6e17ab.zip
bug in openssl_encrypt? options cannot take padding
Diffstat (limited to 'src/getcode.php')
-rw-r--r--src/getcode.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/getcode.php b/src/getcode.php
index 90e8b58..fcc45cd 100644
--- a/src/getcode.php
+++ b/src/getcode.php
@@ -1,5 +1,6 @@
<?php
ob_start();
+require_once('globals.php');
header ("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
@@ -22,9 +23,9 @@ function make_seed()
}
srand(make_seed());
-function myhash($k) {
- return hash('sha256',$k);
-}
+//function myhash($k) {
+// return hash('sha256',$k);
+//}
if(!function_exists('openssl_cipher_iv_length')) {
MSGError("Encryption error -- php openssl not installed -- contact an admin (" . getFunctionName() .")");
LogError("Encryption error -- php openssl not installed -- contact an admin (" . getFunctionName() .")");
@@ -53,8 +54,8 @@ if(isset($_GET["name"]) && $_GET["name"] != "" ) {
"chmod 600 /root/submissions/code\n";
if(($str = @file_get_contents("/var/www/boca/src/private/run-past.code")) !== false) $txt .= $str;
- echo $iv . ":" . $clen . ":\n" . openssl_encrypt($txt, "aes-256-cbc", substr($secret[1],0,32), OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv); //OPENSSL_RAW_DATA, $iv); //php 5.4.0
- @file_put_contents("/var/www/boca/src/private/run-past.log", $name . "|" . $cc . "|" . date(DATE_RFC2822) . "\n", LOCK_EX | FILE_APPEND);
+ echo $iv . ":" . $clen . ":\n" . openssl_encrypt($txt, "aes-256-cbc", substr($secret[1],0,32), OPENSSL_RAW_DATA, $iv);
+ @file_put_contents("/var/www/boca/src/private/run-past.log", $name . "|" . $cc . "|" . getIP() . "|" . date(DATE_RFC2822) . "\n", LOCK_EX | FILE_APPEND);
exit;
}
}