mirror of
https://github.com/php/php-src.git
synced 2026-04-17 13:01:02 +02:00
This will cause an error in the case where invalid salts are provided for other algorithms. Currently, these invalid salts will silently fall back to STD_DES which is extremely weak. By detecting invalid DES salts, we can alert the user that there is a bug in their code. The error is currently E_DEPRECATED as this has potential to break currently working (yet insecure) code. In the future it should be changed to an E_WARNING and return *0
15 lines
417 B
PHP
15 lines
417 B
PHP
--TEST--
|
|
Test DES with invalid fallback
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(crypt("test", "$#"));
|
|
var_dump(crypt("test", "$5zd$01"));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: crypt(): Supplied salt is not valid for DES. Possible bug in provided salt format. in %s on line %d
|
|
string(13) "$#8MWASl5pGIk"
|
|
|
|
Deprecated: crypt(): Supplied salt is not valid for DES. Possible bug in provided salt format. in %s on line %d
|
|
string(13) "$54mkQyGCLvHs"
|