From: michael at squiloople dot com
Operating system: Windows Vista SP2
PHP version: 5.5.0
Package: hash related
Bug Type: Bug
Bug description:password_hash ignores salts with spaces
Description:
------------
When manually setting a salt which contains spaces the function ignores it
and
automatically generates its own.
Test script:
---------------
echo password_hash('this is a test', PASSWORD_DEFAULT, array('salt' =>
'thisisatestthisisatest'));
echo '<br>';
echo password_hash('this is a test', PASSWORD_DEFAULT, array('salt' =>
'thisisatestthisis test'));
Expected result:
----------------
$2y$10$thisisatestthisisateseLNFJ7M2ONUSijVBKli7sVFN6rQm7o36
$2y$10$thisisatestthisis tesOZPioeRNSLNeG3cuJW56OSusfQ5SjKdO
(with the part after the salt being whatever it would be)
Actual result:
--------------
$2y$10$thisisatestthisisateseLNFJ7M2ONUSijVBKli7sVFN6rQm7o36
$2y$10$dGhpc2lzYXRlc3R0aGlzaOZPioeRNSLNeG3cuJW56OSusfQ5SjKdO
--
Edit bug report at https://bugs.php.net/bug.php?id=65093&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65093&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65093&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65093&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65093&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65093&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65093&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65093&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65093&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65093&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65093&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65093&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65093&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65093&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65093&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65093&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65093&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65093&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65093&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65093&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65093&r=mysqlcfg