Brooklyn-ers,

This PR--now merged--fixed a bug where Brooklyn would generate erroneous SHA256 password hashes.

It's worth noting that any previously-generated hash values are most likely buggy, and so authentication will fail now that the fix is in. If you're using SHA256 hashes and you suddenly start experiencing login failures, please regenerate the necessary configuration by running:

  $ brooklyn generate-password --user <username>

A.
--
Alasdair Hodge
Principal Engineer,
Cloudsoft Corporation


On 11/06/2015 13:18, alasdairhodge wrote:
GitHub user alasdairhodge opened a pull request:

     https://github.com/apache/incubator-brooklyn/pull/687

     Tweak PasswordHasher to avoid potentially misleading use of 
ByteBuffer.array()

     Using `ByteBuffer.array()` to convert a salted password to its constituent 
bytes frequently results in an indeterminate number of spurious bytes to be 
included, due to the fact that the buffer's raw backing array is usually larger 
than the space consumed just by the values written to it. This causes 
Brooklyn-generated hashes to deviate from the expected `sha256(salt + 
password)` values.

     Even though Brooklyn itself can generate hashes, it is desirable for the 
algorithm to be sufficiently predictable to permit generation by simple 
external mechanisms.

You can merge this pull request into a Git repository by running:

     $ git pull https://github.com/alasdairhodge/incubator-brooklyn 
password-hash-bytearray-fix

Alternatively you can review and apply these changes as the patch at:

     https://github.com/apache/incubator-brooklyn/pull/687.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

     This closes #687

----
commit 599b239bd4cda0870acd36747189b1221c727e02
Author: Alasdair Hodge <[email protected]>
Date:   2015-06-11T12:03:53Z

     Tweak PasswordHasher.sha256() to avoid potentially misleading use of 
ByteBuffer.array().

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---



--
Cloudsoft Corporation Limited, Registered in Scotland No: SC349230. Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP

This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. Cloudsoft Corporation Limited does not accept responsibility for changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by Cloudsoft Corporation Limited in this regard and the recipient should carry out such virus and other checks as it considers appropriate.

Reply via email to