summaryrefslogtreecommitdiff
path: root/framework/Security/TSecurityManager.php
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-10 23:51:14 +0000
committerctrlaltca <>2012-07-10 23:51:14 +0000
commite1c9b061bcfacf0ff731086a509894a07049d9ef (patch)
treefc8bacea564142b3333be45b75ce060fcd2fa194 /framework/Security/TSecurityManager.php
parent37c4c3b158994707ab502b1b9bf4994872deeace (diff)
small fix to previous commit
Diffstat (limited to 'framework/Security/TSecurityManager.php')
-rw-r--r--framework/Security/TSecurityManager.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php
index d5c43238..3b2a7274 100644
--- a/framework/Security/TSecurityManager.php
+++ b/framework/Security/TSecurityManager.php
@@ -232,7 +232,7 @@ class TSecurityManager extends TModule
$ivSize = mcrypt_enc_get_iv_size($module);
$iv = $this->substr($data, 0, $ivSize);
mcrypt_generic_init($module, $key, $iv);
- $decrypted = mdecrypt_generic($module, $this->substr($data, $ivSize));
+ $decrypted = mdecrypt_generic($module, $this->substr($data, $ivSize, $this->strlen($data)));
mcrypt_generic_deinit($module);
mcrypt_module_close($module);
return $decrypted;
@@ -287,7 +287,7 @@ class TSecurityManager extends TModule
return false;
$hmac = $this->substr($data, 0, $len);
- $data2 = $this->substr($data, $len);
+ $data2=$this->substr($data, $len, $this->strlen($data));
return $hmac === $this->computeHMAC($data2) ? $data2 : false;
}
@@ -311,6 +311,7 @@ class TSecurityManager extends TModule
$pack = 'H32';
$func = 'md5';
}
+
$key = str_pad($func($key), 64, chr(0));
return $func((str_repeat(chr(0x5C), 64) ^ substr($key, 0, 64)) . pack($pack, $func((str_repeat(chr(0x36), 64) ^ substr($key, 0, 64)) . $data)));
}