php-src/ext/standard/tests/strings/crypt_blowfish_invalid_rounds.phpt
Pierre Joye c402adc3b2 - Corrected the sanity check of the "setting" string in _crypt_blowfish_rn() to
reject iteration counts encoded as 36 through 39.  Previously, these would be
  misinterpreted as being the same as 04 through 07. (Solar Designer)
2010-02-21 23:47:14 +00:00

23 lines
295 B
PHP

--TEST--
Test Blowfish crypt() with invalid rounds
--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