diff options
author | Leigh <leight@gmail.com> | 2014-10-07 12:27:57 +0100 |
---|---|---|
committer | Leigh <leight@gmail.com> | 2014-10-07 12:27:57 +0100 |
commit | 4e8c8761206f595691eaeee8a179fa9be286dcf3 (patch) | |
tree | 4f89ebe124cd7ec3bd2d34e5baa45ee342dead67 /ext/standard/crypt.c | |
parent | a0420a72afe064d3cb04735c0966eba053a868a7 (diff) | |
download | php-git-4e8c8761206f595691eaeee8a179fa9be286dcf3.tar.gz |
Bug fixes in light of failing bcrypt tests
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r-- | ext/standard/crypt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 8750378b53..f9920426ea 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -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); |