mirror of
https://github.com/php/php-src.git
synced 2026-03-27 09:42:22 +01:00
Bug fixes in light of failing bcrypt tests
This commit is contained in:
@@ -196,7 +196,6 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt,
|
||||
} else if (
|
||||
salt[0] == '$' &&
|
||||
salt[1] == '2' &&
|
||||
salt[2] >= 'a' && salt[2] <= 'z' &&
|
||||
salt[3] == '$' &&
|
||||
salt[4] >= '0' && salt[4] <= '3' &&
|
||||
salt[5] >= '0' && salt[5] <= '9' &&
|
||||
@@ -219,7 +218,7 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt,
|
||||
_crypt_extended_init_r();
|
||||
|
||||
crypt_res = _crypt_extended_r(password, salt, &buffer);
|
||||
if (!crypt_res) {
|
||||
if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
|
||||
return FAILURE;
|
||||
} else {
|
||||
*result = estrdup(crypt_res);
|
||||
|
||||
@@ -105,3 +105,6 @@ foreach($tests2 as $test) {
|
||||
29. OK
|
||||
30. OK
|
||||
31. OK
|
||||
32. OK
|
||||
33. OK
|
||||
34. OK
|
||||
|
||||
Reference in New Issue
Block a user