From 3660c8a9a43dba35fb107ec9f58690c80625c87a Mon Sep 17 00:00:00 2001 From: jomu Date: Sat, 21 Feb 2015 19:53:36 +0000 Subject: [PATCH] fixed getRandomStringNullPrefix --- .../de/muehlencord/shared/security/PasswordUtil.java | 2 +- .../de/muehlencord/shared/security/PasswordUtilTest.java | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/security/src/main/java/de/muehlencord/shared/security/PasswordUtil.java b/security/src/main/java/de/muehlencord/shared/security/PasswordUtil.java index 01f6379..aa37795 100644 --- a/security/src/main/java/de/muehlencord/shared/security/PasswordUtil.java +++ b/security/src/main/java/de/muehlencord/shared/security/PasswordUtil.java @@ -102,7 +102,7 @@ public abstract class PasswordUtil { String usedPrefix = (prefix == null ? "" : prefix); int idLength = length - usedPrefix.length(); - return prefix + createSaltString(idLength); + return usedPrefix + createSaltString(idLength); } diff --git a/security/src/test/java/de/muehlencord/shared/security/PasswordUtilTest.java b/security/src/test/java/de/muehlencord/shared/security/PasswordUtilTest.java index b433561..3e097f3 100644 --- a/security/src/test/java/de/muehlencord/shared/security/PasswordUtilTest.java +++ b/security/src/test/java/de/muehlencord/shared/security/PasswordUtilTest.java @@ -1,16 +1,7 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package de.muehlencord.shared.security; import static de.muehlencord.shared.security.PasswordUtil.getScryptHash; import static de.muehlencord.shared.security.PasswordUtil.validateScryptHash; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*;