Skip to content

Commit f5d2e7b

Browse files
orlitzkyarnaud-lb
authored andcommitted
ext/standard/tests/crypt/des_fallback_invalid_salt.phpt: less valid salt
Musl's crypt() implementation of DES tries to handle invalid salts and can make this test fail because it returns an answer and not an error. Even musl however will reject a salt with a ':' in it, so we can make this test cross-platform by supplying an even less valid salt.
1 parent 8a71200 commit f5d2e7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/standard/tests/crypt/des_fallback_invalid_salt.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ Test DES with invalid fallback
33
--FILE--
44
<?php
55

6-
var_dump(crypt("test", "$#"));
7-
var_dump(crypt("test", "$5zd$01"));
6+
// musl tries to support invalid DES salts unless they would violate
7+
// the /etc/passwd format, so we include colons to ensure that musl
8+
// crypt() will fail on these inputs as well.
9+
var_dump(crypt("test", "$:#"));
10+
var_dump(crypt("test", "$:5zd$01\n"));
811

912
?>
1013
--EXPECT--

0 commit comments

Comments
 (0)