--- CHAP.php.orig 2010-08-27 20:30:08.742934457 +0200 +++ CHAP.php 2010-08-27 20:31:48.033933802 +0200 @@ -148,7 +148,7 @@ * Generate MS-CHAPv1 Packets. MS-CHAP doesen't use the plaintext password, it uses the * NT-HASH wich is stored in the SAM-Database or in the smbpasswd, if you are using samba. * The NT-HASH is MD4(str2unicode(plaintextpass)). - * You need the mhash extension for this class. + * You need the hash extension for this class. * * @package Crypt_CHAP */ @@ -164,13 +164,13 @@ /** * Constructor * - * Loads the mhash extension + * Loads the hash extension * @return void */ function Crypt_CHAP_MSv1() { $this->Crypt_CHAP(); - $this->loadExtension('mhash'); + $this->loadExtension('hash'); } /** @@ -182,9 +182,9 @@ function ntPasswordHash($password = null) { if (isset($password)) { - return mhash(MHASH_MD4, $this->str2unicode($password)); + return pack('H*',hash('md4', $this->str2unicode($password))); } else { - return mhash(MHASH_MD4, $this->str2unicode($this->password)); + return pack('H*',hash('md4', $this->str2unicode($this->password))); } } @@ -431,7 +431,7 @@ */ function ntPasswordHashHash($nthash) { - return mhash(MHASH_MD4, $nthash); + return pack('H*',hash('md4', $nthash)); } /** @@ -443,7 +443,7 @@ */ function challengeHash() { - return substr(mhash(MHASH_SHA1, $this->peerChallenge . $this->authChallenge . $this->username), 0, 8); + return substr(pack('H*',hash('sha1', $this->peerChallenge . $this->authChallenge . $this->username)), 0, 8); } /**