Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.37
diff -u -9 -p -r1.37 openid.inc
--- modules/openid/openid.inc	28 Oct 2010 02:27:09 -0000	1.37
+++ modules/openid/openid.inc	3 Dec 2010 21:28:21 -0000
@@ -414,29 +414,19 @@ function _openid_signature($association,
 
   $message = _openid_create_message($sign_data);
   $secret = base64_decode($association->mac_key);
   $signature = _openid_hmac($secret, $message);
 
   return base64_encode($signature);
 }
 
 function _openid_hmac($key, $text) {
-  if (strlen($key) > OPENID_SHA1_BLOCKSIZE) {
-    $key = sha1($key, TRUE);
-  }
-
-  $key = str_pad($key, OPENID_SHA1_BLOCKSIZE, chr(0x00));
-  $ipad = str_repeat(chr(0x36), OPENID_SHA1_BLOCKSIZE);
-  $opad = str_repeat(chr(0x5c), OPENID_SHA1_BLOCKSIZE);
-  $hash1 = sha1(($key ^ $ipad) . $text, TRUE);
-  $hmac = sha1(($key ^ $opad) . $hash1, TRUE);
-
-  return $hmac;
+  return hash_hmac('sha1', $text, $key, TRUE);
 }
 
 function _openid_dh_base64_to_long($str) {
   $b64 = base64_decode($str);
 
   return _openid_dh_binary_to_long($b64);
 }
 
 function _openid_dh_long_to_base64($str) {
