--- Crypt_CHAP/tests/chaptest.php.orig 2007-03-11 18:59:25.000000000 +0100
+++ Crypt_CHAP/tests/chaptest.php 2007-03-11 18:59:47.000000000 +0100
@@ -31,8 +31,7 @@
$Id: chaptest.php,v 1.6 2004/03/25 15:39:32 mbretter Exp $
*/
-
-if ($argv[1] == 'pearcvs') {
+if ($_SERVER["argc"]>1 && $_SERVER["argv"][1] == 'pearcvs') {
ini_set('include_path', '..:' . ini_get('include_path'));
require_once 'CHAP.php';
} else {
@@ -63,7 +62,7 @@
echo "MS-CHAPv1 TEST\n";
$crpt->password = 'MyPw';
$crpt->challenge = pack('H*', '102DB5DF085D3041');
-$unipw = $crpt->str2unicode($pass);
+$unipw = $crpt->str2unicode($crpt->password);
printf ("Unicode PW: %s\nexpected : 4d00790050007700\n", bin2hex($unipw));
printf ("NT HASH : %s\nexpected : fc156af7edcd6c0edde3337d427f4eac\n", bin2hex($crpt->ntPasswordHash()));
printf ("NT Resp : %s\nexpected : 4e9d3c8f9cfd385d5bf4d3246791956ca4c351ab409a3d61\n", bin2hex($crpt->challengeResponse()));