blob: 2548c9accb8056fbb6e2b6696cfe3b5b66993537 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
--TEST--
Test error operation of password_hash() with bcrypt hashing
--FILE--
<?php
//-=-=-=-
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3)));
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32)));
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "foo")));
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "123456789012345678901")));
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => 123)));
var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => "foo")));
?>
--EXPECTF--
Warning: password_hash(): Invalid bcrypt cost parameter specified: 3 in %s on line %d
NULL
Warning: password_hash(): Invalid bcrypt cost parameter specified: 32 in %s on line %d
NULL
Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d
NULL
Warning: password_hash(): Provided salt is too short: 21 expecting 22 in %s on line %d
NULL
Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d
NULL
Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in %s on line %d
NULL
|