1--TEST--
2Test Blowfish crypt() with invalid rounds
3--FILE--
4<?php
5
6$salts = array('32' => '$2a$32$CCCCCCCCCCCCCCCCCCCCCC$',
7               '33' => '$2a$33$CCCCCCCCCCCCCCCCCCCCCC$',
8               '34' => '$2a$34$CCCCCCCCCCCCCCCCCCCCCC$',
9               '35' => '$2a$35$CCCCCCCCCCCCCCCCCCCCCC$',
10               '36' => '$2a$36$CCCCCCCCCCCCCCCCCCCCCC$',
11               '37' => '$2a$37$CCCCCCCCCCCCCCCCCCCCCC$',
12               '38' => '$2a$38$CCCCCCCCCCCCCCCCCCCCCC$',);
13
14foreach($salts as $i=>$salt) {
15  $crypt = crypt('U*U', $salt);
16  if ($crypt === '*0' || $crypt === '*1') {
17    echo "$i. OK\n";
18  } else {
19    echo "$i. Not OK\n";
20  }
21}
22
23?>
24--EXPECT--
2532. OK
2633. OK
2734. OK
2835. OK
2936. OK
3037. OK
3138. OK
32