mirror of
https://github.com/php/php-src.git
synced 2026-04-19 14:01:01 +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
20 lines
599 B
PHP
20 lines
599 B
PHP
--TEST--
|
|
Test BCRYPT with invalid cost
|
|
--FILE--
|
|
<?php
|
|
var_dump(crypt("test", "$2a$4$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$00$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$01$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$02$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$03$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$32$1234567891234567891234567"));
|
|
var_dump(crypt("test", "$2a$40$1234567891234567891234567"));
|
|
?>
|
|
--EXPECTF--
|
|
string(2) "*0"
|
|
string(2) "*0"
|
|
string(2) "*0"
|
|
string(2) "*0"
|
|
string(2) "*0"
|
|
string(2) "*0"
|
|
string(2) "*0"
|