]> source.dussan.org Git - gitblit.git/commitdiff
Replaced duplicated strings by using constant
authorMartin Spielmann <martin.spielmann@pingunaut.com>
Sat, 7 Jan 2017 12:53:36 +0000 (13:53 +0100)
committerMartin Spielmann <martin.spielmann@pingunaut.com>
Sat, 7 Jan 2017 12:53:36 +0000 (13:53 +0100)
src/main/java/com/gitblit/client/EditUserDialog.java
src/main/java/com/gitblit/wicket/pages/ChangePasswordPage.java

index fcbb41ef2499cfd868aafe5881789cb4a62728f2..141f233b9535b597cdc1258f73efe6387125eb02 100644 (file)
@@ -335,7 +335,7 @@ public class EditUserDialog extends JDialog {
                        // 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
@@ -343,7 +343,7 @@ public class EditUserDialog extends JDialog {
                                // 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
index afc4058b2bc9a71121558c6ea0b81d179c537abe..4c074abcdca30d002c30e414ddf58295947d4a42 100644 (file)
@@ -87,7 +87,7 @@ public class ChangePasswordPage extends RootSubPage {
                                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
@@ -95,7 +95,7 @@ public class ChangePasswordPage extends RootSubPage {
                                        // 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