From: Roland Häder Date: Thu, 20 Apr 2017 18:16:53 +0000 (+0200) Subject: unencrypted ... better clear-text ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=af72ef26885e9622bc507d4fcf9f98f505fb0c88;p=juser-core.git unencrypted ... better clear-text ... Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jusercore/container/login/UserLoginContainer.java b/src/org/mxchange/jusercore/container/login/UserLoginContainer.java index baffc20..a3fb254 100644 --- a/src/org/mxchange/jusercore/container/login/UserLoginContainer.java +++ b/src/org/mxchange/jusercore/container/login/UserLoginContainer.java @@ -36,15 +36,15 @@ public class UserLoginContainer implements LoginContainer { private User user; /** - * Unencrypted password + * Clear-text password */ private String userPassword; /** - * Constructor with user instance and unencrypted password + * Constructor with user instance and clear-text password *

* @param user User instance - * @param userPassword Unencrypted password + * @param userPassword Clear-text password */ public UserLoginContainer (final User user, final String userPassword) { // Is both set? diff --git a/src/org/mxchange/jusercore/model/user/UserUtils.java b/src/org/mxchange/jusercore/model/user/UserUtils.java index 27326a7..ce04147 100644 --- a/src/org/mxchange/jusercore/model/user/UserUtils.java +++ b/src/org/mxchange/jusercore/model/user/UserUtils.java @@ -456,26 +456,26 @@ public class UserUtils implements Serializable { /** * Checks if direct password the updatedUser's password *

- * @param unencryptedPassword Clear-text (direct) password + * @param clear-textPassword Clear-text (direct) password * @param updatedUser Updated user instance from database *

* @return Whether the password matches */ - public static boolean ifPasswordMatches (final String unencryptedPassword, final User updatedUser) { + public static boolean ifPasswordMatches (final String clear-textPassword, final User updatedUser) { // Validate parameters - if (null == unencryptedPassword) { + if (null == clear-textPassword) { // Throw NPE - throw new NullPointerException("unencryptedPassword is null"); //NOI18N - } else if (unencryptedPassword.isEmpty()) { + throw new NullPointerException("clear-textPassword is null"); //NOI18N + } else if (clear-textPassword.isEmpty()) { // NPE for user in container - throw new NullPointerException("unencryptedPassword is empty."); //NOI18N + throw new NullPointerException("clear-textPassword is empty."); //NOI18N } else if (null == updatedUser) { // And again NPE ... throw new NullPointerException("updatedUser is null"); //NOI18N } // First encrypt password - String encryptedPassword = Crypt.crypt(unencryptedPassword, updatedUser.getUserEncryptedPassword()); + String encryptedPassword = Crypt.crypt(clear-textPassword, updatedUser.getUserEncryptedPassword()); // Is it matching? return encryptedPassword.equals(updatedUser.getUserEncryptedPassword()); @@ -484,7 +484,7 @@ public class UserUtils implements Serializable { /** * Checks if password from container matches with from user instance. *

- * @param container Container holding user instance and unencrypted password + * @param container Container holding user instance and clear-text password *

* @return Whether it maches */