web/lib/Zend/OpenId.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * obtain it through the world-wide-web, please send an email
    13  * obtain it through the world-wide-web, please send an email
    14  * to license@zend.com so we can send you a copy immediately.
    14  * to license@zend.com so we can send you a copy immediately.
    15  *
    15  *
    16  * @category   Zend
    16  * @category   Zend
    17  * @package    Zend_OpenId
    17  * @package    Zend_OpenId
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: OpenId.php 24842 2012-05-31 18:31:28Z rob $
    20  * @version    $Id$
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Controller_Response_Abstract
    24  * @see Zend_Controller_Response_Abstract
    25  */
    25  */
    33  * Consumer and Provider. They include functions for Diffie-Hellman keys
    33  * Consumer and Provider. They include functions for Diffie-Hellman keys
    34  * generation and exchange, URL normalization, HTTP redirection and some others.
    34  * generation and exchange, URL normalization, HTTP redirection and some others.
    35  *
    35  *
    36  * @category   Zend
    36  * @category   Zend
    37  * @package    Zend_OpenId
    37  * @package    Zend_OpenId
    38  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    38  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    39  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    39  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    40  */
    40  */
    41 class Zend_OpenId
    41 class Zend_OpenId
    42 {
    42 {
    43     /**
    43     /**
   527     static public function hashHmac($macFunc, $data, $secret)
   527     static public function hashHmac($macFunc, $data, $secret)
   528     {
   528     {
   529 //        require_once "Zend/Crypt/Hmac.php";
   529 //        require_once "Zend/Crypt/Hmac.php";
   530 //        return Zend_Crypt_Hmac::compute($secret, $macFunc, $data, Zend_Crypt_Hmac::BINARY);
   530 //        return Zend_Crypt_Hmac::compute($secret, $macFunc, $data, Zend_Crypt_Hmac::BINARY);
   531         if (function_exists('hash_hmac')) {
   531         if (function_exists('hash_hmac')) {
   532             return hash_hmac($macFunc, $data, $secret, 1);
   532             return hash_hmac($macFunc, $data, $secret, true);
   533         } else {
   533         } else {
   534             if (Zend_OpenId::strlen($secret) > 64) {
   534             if (Zend_OpenId::strlen($secret) > 64) {
   535                 $secret = self::digest($macFunc, $secret);
   535                 $secret = self::digest($macFunc, $secret);
   536             }
   536             }
   537             $secret = str_pad($secret, 64, chr(0x00));
   537             $secret = str_pad($secret, 64, chr(0x00));