diff --git a/test/Unit/Password/Implementation/SHA256Test.php b/test/Unit/Password/Implementation/SHA256Test.php index 120d88c..636a6d3 100644 --- a/test/Unit/Password/Implementation/SHA256Test.php +++ b/test/Unit/Password/Implementation/SHA256Test.php @@ -20,15 +20,15 @@ public static function provideTestDetect() { array('$2$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), array(SHA256::getPrefix() . '07$usesome illystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), array(SHA256::getPrefix() . '01$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), - + array(SHA256::getPrefix() . "\xE4\"|\xF5|\x08\xC8'\xF054:>\x13\xCB\xED\$6I5JMX./GN9KGHTtvHwvp3mxkNv/Ni7/jomOEBgsiM.", true) ); } public static function provideTestCreate() { return array( - array(1000, 'foo', SHA256::getPrefix() . 'rounds=1000$................$expjG7P4AN4svmCMHxzkAc.s8gNGp0fu4bYVVY8iQo1'), - array(1000, 'bar', SHA256::getPrefix() . 'rounds=1000$................$NYlBKYVTrvSD1CYbsBDngbAm7kyAJk/D9XX.3528r05'), - array(1000, 'baz', SHA256::getPrefix() . 'rounds=1000$................$sN32z5PIeyCOerA52tXRmNvbdcwPd/FqWAmZelaX9z6'), + array(1000, 'foo', SHA256::getPrefix() . "rounds=1000\$\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\$AaIctt3o2mZFLme8WGmPB4yQUd7uV7PT7spV8CJvXA1"), + array(1000, 'bar', SHA256::getPrefix() . "rounds=1000\$\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\$3MGN/aM/1YdTG3AV4IyJq5QEM6zNBDDaLh.rGS/nHI8"), + array(1000, 'baz', SHA256::getPrefix() . "rounds=1000\$\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\$BhLh/zh5GXbIIqmxFpzISUtZbRy9bhefHr9pc.4ri3A"), ); } @@ -149,7 +149,7 @@ public function testVerifyFailException($iterations, $pass, $expect) { protected function getSHA256MockInstance($iterations) { $gen = $this->getRandomGenerator(function($size) { - return str_repeat(chr(0), $size); + return str_repeat(chr(1), $size); }); return new SHA256(array('rounds' => $iterations), $gen); } diff --git a/test/Unit/Password/Implementation/SHA512Test.php b/test/Unit/Password/Implementation/SHA512Test.php index ff4274d..ee8ce17 100644 --- a/test/Unit/Password/Implementation/SHA512Test.php +++ b/test/Unit/Password/Implementation/SHA512Test.php @@ -20,15 +20,15 @@ public static function provideTestDetect() { array('$2$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), array(SHA512::getPrefix() . '07$usesome illystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), array(SHA512::getPrefix() . '01$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', false), - + array(SHA512::getPrefix() . "\xC2?getRandomGenerator(function($size) { - return str_repeat(chr(0), $size); + return str_repeat(chr(1), $size); }); return new SHA512(array('rounds' => $iterations), $gen); }