1--TEST--
2Test Blowfish crypt() with invalid rounds
3--SKIPIF--
4<?php
5if (!function_exists('crypt') || !defined("CRYPT_BLOWFISH")) {
6    die("SKIP crypt()-blowfish is not available");
7}
8?>
9--FILE--
10<?php
11
12$salts = array(b'32' => b'$2a$32$CCCCCCCCCCCCCCCCCCCCCC$',
13               b'33' => b'$2a$33$CCCCCCCCCCCCCCCCCCCCCC$',
14               b'34' => b'$2a$34$CCCCCCCCCCCCCCCCCCCCCC$',
15               b'35' => b'$2a$35$CCCCCCCCCCCCCCCCCCCCCC$',
16               b'36' => b'$2a$36$CCCCCCCCCCCCCCCCCCCCCC$',
17               b'37' => b'$2a$37$CCCCCCCCCCCCCCCCCCCCCC$',
18               b'38' => b'$2a$38$CCCCCCCCCCCCCCCCCCCCCC$',);
19
20foreach($salts as $i=>$salt) {
21  $crypt = crypt(b'U*U', $salt);
22  if ($crypt === b'*0' || $crypt === b'*1') {
23    echo "$i. OK\n";
24  } else {
25    echo "$i. Not OK\n";
26  }
27}
28
29?>
30--EXPECT--
3132. OK
3233. OK
3334. OK
3435. OK
3536. OK
3637. OK
3738. OK
38