summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bug73058.phpt
blob: 35ab932dd9fc4d6c8d9012d2344be151b65ae087 (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
--TEST--
Bug #73058 crypt broken when salt is 'too' long
--SKIPIF--
<?php
if (!function_exists('crypt'))) {
	die("SKIP crypt() is not available");
}
?>
--FILE--
<?php
$pass = 'secret';

$salt = '$2y$07$usesomesillystringforsalt$';
var_dump(crypt($pass, $salt));

$salt = '$2y$07$usesomesillystringforsaltzzzzzzzzzzzzz$';
var_dump(crypt($pass, $salt));

$salt = '$2y$07$usesomesillystringforx';
var_dump(crypt($pass, $salt));

?>
==OK==
--EXPECT--
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO"
string(60) "$2y$07$usesomesillystringforuw2Gm1ef7lMsvtzSK2p/14F0q1e8uOCO"
==OK==