// change the cookie\r
user.cookie = user.createCookie();\r
\r
- String type = settings.get(Keys.realm.passwordStorage).getString("PBKDF2WithHmacSHA256");\r
+ String type = settings.get(Keys.realm.passwordStorage).getString(SecurePasswordHashUtils.PBKDF2WITHHMACSHA256);\r
if (type.equalsIgnoreCase("md5")) {\r
// store MD5 digest of password\r
user.password = StringUtils.MD5_TYPE + StringUtils.getMD5(password);\r
// store MD5 digest of username+password\r
user.password = StringUtils.COMBINED_MD5_TYPE\r
+ StringUtils.getMD5(user.username + password);\r
- } else if (type.equalsIgnoreCase("PBKDF2WithHmacSHA256")) {\r
+ } else if (type.equalsIgnoreCase(SecurePasswordHashUtils.PBKDF2WITHHMACSHA256)) {\r
// store PBKDF2WithHmacSHA256 digest of password\r
user.password = SecurePasswordHashUtils.get().createStoredPasswordFromPassword(password);\r
} else {\r
UserModel user = GitBlitWebSession.get().getUser();\r
\r
// convert to MD5 digest, if appropriate\r
- String type = app().settings().getString(Keys.realm.passwordStorage, "PBKDF2WithHmacSHA256");\r
+ String type = app().settings().getString(Keys.realm.passwordStorage, SecurePasswordHashUtils.PBKDF2WITHHMACSHA256);\r
if (type.equalsIgnoreCase("md5")) {\r
// store MD5 digest of password\r
password = StringUtils.MD5_TYPE + StringUtils.getMD5(password);\r
// store MD5 digest of username+password\r
password = StringUtils.COMBINED_MD5_TYPE\r
+ StringUtils.getMD5(user.username.toLowerCase() + password);\r
- } else if (type.equalsIgnoreCase("PBKDF2WithHmacSHA256")) {\r
+ } else if (type.equalsIgnoreCase(SecurePasswordHashUtils.PBKDF2WITHHMACSHA256)) {\r
// store PBKDF2WithHmacSHA256 digest of password\r
user.password = SecurePasswordHashUtils.get().createStoredPasswordFromPassword(password);\r
}\r