Index: mollom.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.inc,v
retrieving revision 1.10
diff -u -p -r1.10 mollom.inc
--- mollom.inc	22 Dec 2010 17:54:53 -0000	1.10
+++ mollom.inc	15 Feb 2011 18:08:59 -0000
@@ -45,12 +45,10 @@ function _mollom_authentication($public_
   // Generate a random number:
   $nonce = md5(mt_rand());
 
-  // Calculate a HMAC-SHA1 according to RFC2104 (http://www.ietf.org/rfc/rfc2104.txt):
-  $hash = base64_encode(
-    pack('H*', sha1((str_pad($private_key, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .
-    pack('H*', sha1((str_pad($private_key, 64, chr(0x00)) ^ (str_repeat(chr(0x36), 64))) .
-    $time . ':' . $nonce . ':' . $private_key))))
-  );
+  // Calculate a HMAC-SHA1 according to RFC 2104.
+  // @see http://www.ietf.org/rfc/rfc2104.txt
+  $request_data = $time . ':' . $nonce . ':' . $private_key;
+  $hash = base64_encode(hash_hmac('sha1', $request_data, $private_key, TRUE));
 
   // Store everything in an array.  Elsewhere in the code, we'll add the
   // actual data before we pass it onto the XML-RPC library:
