MFH crypt() tests

This commit is contained in:
Joey Smith 2010-02-20 19:13:09 +00:00
parent 116e217799
commit 7a0b1e55d8
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,13 @@
--TEST--
Bug #51059 crypt() segfaults on certain salts
--XFAIL--
Needs a patch from Pierre
--FILE--
<?php
if (crypt('a', '_') === FALSE) echo 'OK';
else echo 'Not OK';
?>
--EXPECT--
OK

View File

@ -0,0 +1,24 @@
--TEST--
Test Blowfish crypt() with invalid rounds
--XFAIL--
Needs a patch from Pierre
--FILE--
<?php
foreach(range(32, 38) as $i) {
if (crypt('U*U', '$2a$'.$i.'$CCCCCCCCCCCCCCCCCCCCCC$') === FALSE) {
echo "$i. OK\n";
} else {
echo "$i. Not OK\n";
}
}
?>
--EXPECT--
32. OK
33. OK
34. OK
35. OK
36. OK
37. OK
38. OK