### Eclipse Workspace Patch 1.0
#P drupal-head
Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.11
diff -u -r1.11 openid.inc
--- modules/openid/openid.inc	26 May 2008 17:12:55 -0000	1.11
+++ modules/openid/openid.inc	1 Sep 2008 14:43:49 -0000
@@ -266,28 +266,11 @@
 }
 
 function _openid_hmac($key, $text) {
-  if (strlen($key) > OPENID_SHA1_BLOCKSIZE) {
-    $key = _openid_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 = _openid_sha1(($key ^ $ipad) . $text, true);
-  $hmac = _openid_sha1(($key ^ $opad) . $hash1, true);
-
-  return $hmac;
+  return hash_hmac('sha1', $text, $key, TRUE);
 }
 
 function _openid_sha1($text) {
-  $hex = sha1($text);
-  $raw = '';
-  for ($i = 0; $i < 40; $i += 2) {
-    $hexcode = substr($hex, $i, 2);
-    $charcode = (int)base_convert($hexcode, 16, 10);
-    $raw .= chr($charcode);
-  }
-  return $raw;
+  return sha1($text, TRUE);
 }
 
 function _openid_dh_base64_to_long($str) {
