From af72ef26885e9622bc507d4fcf9f98f505fb0c88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 20:16:53 +0200 Subject: [PATCH] unencrypted ... better clear-text ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../container/login/UserLoginContainer.java | 6 +++--- .../mxchange/jusercore/model/user/UserUtils.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) 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 */ -- 2.39.5