Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/687#discussion_r32219471
  
    --- Diff: 
usage/rest-server/src/main/java/brooklyn/rest/security/PasswordHasher.java ---
    @@ -24,8 +24,9 @@
     
     public class PasswordHasher {
         public static String sha256(String salt, String password) {
    -        byte[] salted = Charsets.UTF_8.encode((salt == null ? "" : salt) + 
password).array();
    -        HashCode hash = Hashing.sha256().hashBytes(salted);
    +        if (salt == null) salt = "";
    +        byte[] bytes = (salt + password).getBytes(Charsets.UTF_8);
    --- End diff --
    
    On looking at the context I think the existing behaviour is ok - it will 
only be acting on user input in a request. If it were being used elsewhere I 
think the existing comment would stand.


---
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.
---

Reply via email to