diff options
author | Sara Golemon <pollita@php.net> | 2019-06-27 19:00:32 -0400 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2019-06-27 19:26:03 -0400 |
commit | 27f1f3ed1a040a7f20bd9bb16af7bf219f4df97f (patch) | |
tree | 0deab34b50d0d12d20530ac7ae2927e7f79e7a37 /ext/standard/tests/password/password_needs_rehash.phpt | |
parent | 35b6a9f75a5de21bc0d7c311fbf7b5c3f255420b (diff) | |
download | php-git-27f1f3ed1a040a7f20bd9bb16af7bf219f4df97f.tar.gz |
Bugfix #78208 Needs rehash with an unknown algo should always return true.
Diffstat (limited to 'ext/standard/tests/password/password_needs_rehash.phpt')
-rw-r--r-- | ext/standard/tests/password/password_needs_rehash.phpt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/standard/tests/password/password_needs_rehash.phpt b/ext/standard/tests/password/password_needs_rehash.phpt index 688d57ed32..d88270884e 100644 --- a/ext/standard/tests/password/password_needs_rehash.phpt +++ b/ext/standard/tests/password/password_needs_rehash.phpt @@ -33,7 +33,11 @@ var_dump(password_needs_rehash('$2y$'.$cost.'$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.o // Should Issue Needs Rehash, Since Foo is cast to 0... var_dump(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 'foo'))); +// CRYPT_MD5 +var_dump(password_needs_rehash(crypt('Example', '$1$'), PASSWORD_DEFAULT)); +// CRYPT_SHA512 with 5000 +var_dump(password_needs_rehash(crypt('Example', '$6$rounds=5000$aa$'), PASSWORD_DEFAULT)); echo "OK!"; ?> @@ -41,13 +45,15 @@ echo "OK!"; bool(true) bool(true) bool(true) -bool(false) -bool(false) -bool(false) +bool(true) +bool(true) +bool(true) bool(false) bool(false) bool(true) bool(true) bool(false) bool(true) +bool(true) +bool(true) OK! |