1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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.
This commit is contained in:
Michael Orlitzky
2024-11-04 18:47:46 -05:00
committed by Arnaud Le Blanc
parent 8a712003aa
commit f5d2e7b779

View File

@@ -3,8 +3,11 @@ Test DES with invalid fallback
--FILE--
<?php
var_dump(crypt("test", "$#"));
var_dump(crypt("test", "$5zd$01"));
// musl tries to support invalid DES salts unless they would violate
// the /etc/passwd format, so we include colons to ensure that musl
// crypt() will fail on these inputs as well.
var_dump(crypt("test", "$:#"));
var_dump(crypt("test", "$:5zd$01\n"));
?>
--EXPECT--