Primarily an issue with php 7.0.0 - 7.1.0RC3 and hhvm, where the result of JUserHelper::getCryptedPassword()
could be *0
and/or Deprecated: crypt(): Supplied salt is not valid for DES
indicating a failure when the salt is malformed or too short
Use the following
$encryption = 'crypt-blowfish';
$plaintext = 'mySuperSecretPassword';
$salt = '';
$newSalt = JUserHelper::getSalt($encryption, $salt, $plaintext);
The salt for crypt-blowfish should be correctly formed as per the php manual crypt()
instructions
The expected size is at least 30 characters in the form
prefix | cost parameter - a base-2 logarithm of the hashing iteration count | string |
---|---|---|
$2y$ |
$[04-31] |
$ . 22 characters from the alphabet [./0-9A-Za-z]
|
For example, a complete salt should look like '$2a$07$usesomesillystringforsalt$'
The salt generated for crypt-blowfish is only 16 characters in length. and is missing necessary information.
mock examples with failures of a mocked version of JUserHelper::getCryptedPassword()
https://3v4l.org/Is24j
Primarily an issue with php 7.0.0 - 7.1.0RC3 and hhvm, php less than 5.6 seems to not have an issue with 16 char salts
salt generated at these lines https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/user/helper.php#L569-L578
We also need to adjust the unit test JUserHelperTest::testGetCryptedPassword to expect 60 characters rather than 13 characters
There maybe BC issues for anything previously stored with the old method
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-10-17 16:29:10 |
Closed_By | ⇒ | photodude |
Labels |
Added:
?
|
closing the issue since I opened a PR