ottoka commented on a change in pull request #753:
URL: https://github.com/apache/james-project/pull/753#discussion_r752108520
##########
File path:
server/data/data-library/src/main/java/org/apache/james/user/lib/model/DefaultUser.java
##########
@@ -86,7 +87,8 @@ public boolean verifyPassword(String pass) {
@Override
public boolean setPassword(String newPass) {
try {
- hashedPassword = DigestUtil.digestString(newPass, algorithm);
+ String newCredentials = algorithm.isSalted() ? userName.asString()
+ newPass : newPass;
Review comment:
In general you are right, a random value is even better (more entropy).
But then you have to store the salt together with the password in the database.
If someone steals the database, it is no big difference whether they have to
calculate the hash from the username or the random salt. The point is that they
DO have to calculate the hashes anew, instead of simply comparing against a
table of pre-computed hash values ("rainbow table").
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]