Project

General

Profile

Bug #21465 ยป openid-hash.diff

Administrator Admin, 2009-11-05 13:35

View differences:

typo3/sysext/openid/lib/php-openid/Auth/OpenID/HMAC.php (working copy)
*/
function Auth_OpenID_HMACSHA1($key, $text)
{
if (Auth_OpenID::bytes($key) > Auth_OpenID_SHA1_BLOCKSIZE) {
if (function_exists('hash_hmac') && function_exists('hash_algos') && in_array('sha1', hash_algos())) {
return hash_hmac('sha1', $text, $key, true);
}
// Home-made solution
if (Auth_OpenID::bytes($key) > Auth_OpenID_SHA1_BLOCKSIZE) {
$key = Auth_OpenID_SHA1($key, true);
}
    (1-1/1)