Annotation of embedaddon/php/ext/standard/tests/strings/crypt_blowfish_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test Blowfish crypt() with invalid rounds
3: --SKIPIF--
4: <?php
5: if (!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:
20: foreach($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--
31: 32. OK
32: 33. OK
33: 34. OK
34: 35. OK
35: 36. OK
36: 37. OK
37: 38. OK
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>