From 7e6abf044132d27c60fbcd839f6e991b4449ba26 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 18 Dec 2015 17:10:57 +0100 Subject: [PATCH 1/4] Clean permission/group providers --- pom.xml | 57 ++++++++++++++----- .../executable/authme/ResetNameCommand.java | 1 - .../authme/UnregisterAdminCommand.java | 1 - .../xephi/authme/hooks/BungeeCordMessage.java | 1 - .../authme/permission/PermissionsManager.java | 41 ------------- 5 files changed, 42 insertions(+), 59 deletions(-) diff --git a/pom.xml b/pom.xml index e92495db1..1cead9507 100644 --- a/pom.xml +++ b/pom.xml @@ -439,10 +439,15 @@ de.bananaco - bpermissions - 1.12-DEV - system - ${basedir}/lib/bPermissions-2.12-DEV.jar + bPermissions + 2.12-DEV + provided + + + org.bukkit + bukkit + + @@ -450,17 +455,33 @@ org.tyrannyofheaven.bukkit zPermissions 1.3-SNAPSHOT - system - ${basedir}/lib/zPermissions-1.3beta1.jar - - - - - com.nijiko - permissions - 3.1.6 - system - ${basedir}/lib/Permission-3.1.6.jar + provided + + + org.bukkit + bukkit + + + com.sk89q + worldguard + + + com.sk89q + worldedit + + + VaultAPI + net.milkbowl.vault + + + uuidprovider + net.kaikk.mc + + + ToHPluginUtils + org.tyrannyofheaven.bukkit + + @@ -692,6 +713,12 @@ test 2.0.5-beta true + + + hamcrest-core + org.hamcrest + + diff --git a/src/main/java/fr/xephi/authme/command/executable/authme/ResetNameCommand.java b/src/main/java/fr/xephi/authme/command/executable/authme/ResetNameCommand.java index 0029104fb..dc8849977 100644 --- a/src/main/java/fr/xephi/authme/command/executable/authme/ResetNameCommand.java +++ b/src/main/java/fr/xephi/authme/command/executable/authme/ResetNameCommand.java @@ -4,7 +4,6 @@ import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.command.CommandParts; import fr.xephi.authme.command.ExecutableCommand; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import java.util.List; diff --git a/src/main/java/fr/xephi/authme/command/executable/authme/UnregisterAdminCommand.java b/src/main/java/fr/xephi/authme/command/executable/authme/UnregisterAdminCommand.java index 46625aa1b..5615061f4 100644 --- a/src/main/java/fr/xephi/authme/command/executable/authme/UnregisterAdminCommand.java +++ b/src/main/java/fr/xephi/authme/command/executable/authme/UnregisterAdminCommand.java @@ -12,7 +12,6 @@ import fr.xephi.authme.settings.Settings; import fr.xephi.authme.task.MessageTask; import fr.xephi.authme.task.TimeoutTask; import fr.xephi.authme.util.Utils; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; diff --git a/src/main/java/fr/xephi/authme/hooks/BungeeCordMessage.java b/src/main/java/fr/xephi/authme/hooks/BungeeCordMessage.java index f8a1b8d55..5b19348b8 100644 --- a/src/main/java/fr/xephi/authme/hooks/BungeeCordMessage.java +++ b/src/main/java/fr/xephi/authme/hooks/BungeeCordMessage.java @@ -6,7 +6,6 @@ import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; -import fr.xephi.authme.datasource.CacheDataSource; import org.bukkit.entity.Player; import org.bukkit.plugin.messaging.PluginMessageListener; diff --git a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java index 63d755e86..a70230c1e 100644 --- a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java +++ b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java @@ -1,8 +1,5 @@ package fr.xephi.authme.permission; -import com.nijiko.permissions.Group; -import com.nijiko.permissions.PermissionHandler; -import com.nijikokun.bukkit.Permissions.Permissions; import de.bananaco.bpermissions.api.ApiLayer; import de.bananaco.bpermissions.api.CalculableType; import fr.xephi.authme.command.CommandDescription; @@ -67,10 +64,6 @@ public class PermissionsManager implements PermissionsService { * Essentials group manager instance. */ private GroupManager groupManagerPerms; - /** - * Permissions manager instance for the legacy permissions system. - */ - private PermissionHandler defaultPerms; /** * zPermissions service instance. */ @@ -213,20 +206,6 @@ public class PermissionsManager implements PermissionsService { System.out.println("[" + plugin.getName() + "] Error while hooking into Vault Permissions!"); } - // Permissions, check if it's available - try { - Plugin testPerms = pm.getPlugin("Permissions"); - if (testPerms != null) { - permsType = PermissionsSystemType.PERMISSIONS; - this.defaultPerms = ((Permissions) testPerms).getHandler(); - System.out.println("[" + plugin.getName() + "] Hooked into Permissions!"); - return PermissionsSystemType.PERMISSIONS; - } - } catch (Exception ex) { - // An error occurred, show a warning message - System.out.println("[" + plugin.getName() + "] Error while hooking into Permissions!"); - } - // No recognized permissions system found permsType = PermissionsSystemType.NONE; System.out.println("[" + plugin.getName() + "] No supported permissions system found! Permissions disabled!"); @@ -398,10 +377,6 @@ public class PermissionsManager implements PermissionsService { // Vault return vaultPerms.has(player, permsNode); - case PERMISSIONS: - // Permissions - return this.defaultPerms.has(player, permsNode); - case NONE: // Not hooked into any permissions system, return default return def; @@ -493,18 +468,6 @@ public class PermissionsManager implements PermissionsService { // Vault return Arrays.asList(vaultPerms.getPlayerGroups(player)); - case PERMISSIONS: - // Permissions - // Create a list to put the groups in - List groups = new ArrayList<>(); - - // Get the groups and add each to the list - for (Group group : this.defaultPerms.getGroups(player.getName())) - groups.add(group.getName()); - - // Return the groups - return groups; - case NONE: // Not hooked into any permissions system, return an empty list return new ArrayList<>(); @@ -612,10 +575,6 @@ public class PermissionsManager implements PermissionsService { // Vault return vaultPerms.playerInGroup(player, groupName); - case PERMISSIONS: - // Permissions - return this.defaultPerms.inGroup(player.getWorld().getName(), player.getName(), groupName); - case NONE: // Not hooked into any permissions system, return an empty list return false; From feac0c6c49d541e78f98838e45f53a6d382ac293 Mon Sep 17 00:00:00 2001 From: games647 Date: Fri, 18 Dec 2015 18:27:42 +0100 Subject: [PATCH 2/4] Properly restore walk and flight speed (Fixes Xephi/AuthMeReloaded#356) --- .../process/login/ProcessSyncronousPlayerLogin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java index 8c8280741..b22c8f60a 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java @@ -98,6 +98,13 @@ public class ProcessSyncronousPlayerLogin implements Runnable { } } + protected void restoreSpeedEffects() { + if (Settings.isRemoveSpeedEnabled) { + player.setWalkSpeed(0.2F); + player.setFlySpeed(0.1F); + } + } + protected void restoreInventory() { RestoreInventoryEvent event = new RestoreInventoryEvent(player); pm.callEvent(event); @@ -133,7 +140,6 @@ public class ProcessSyncronousPlayerLogin implements Runnable { public void run() { // Limbo contains the State of the Player before /login if (limbo != null) { - // Restore Op state and Permission Group restoreOpState(); Utils.setGroup(player, GroupType.LOGGEDIN); @@ -161,7 +167,6 @@ public class ProcessSyncronousPlayerLogin implements Runnable { } restoreFlyghtState(); - if (Settings.protectInventoryBeforeLogInEnabled) { restoreInventory(); } @@ -185,6 +190,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable { AuthMePlayerListener.joinMessage.remove(name); } + restoreSpeedEffects(); if (Settings.applyBlindEffect) { player.removePotionEffect(PotionEffectType.BLINDNESS); } From 7b2be4ca47cd84bf6fe3a8e866b223c68577b1dd Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 19 Dec 2015 09:52:16 +0100 Subject: [PATCH 3/4] Remove redundant JavaDoc in security package - Remove all JavaDoc in security package that has no additional information than in the code - Reduce visibility of class members where appropriate --- .../xephi/authme/security/HashAlgorithm.java | 7 +- .../authme/security/PasswordSecurity.java | 36 +------ .../xephi/authme/security/RandomString.java | 11 -- .../xephi/authme/security/crypts/BCRYPT.java | 26 ----- .../authme/security/crypts/BCRYPT2Y.java | 18 ---- .../authme/security/crypts/CRAZYCRYPT1.java | 22 ---- .../authme/security/crypts/CryptPBKDF2.java | 18 ---- .../security/crypts/CryptPBKDF2Django.java | 18 ---- .../authme/security/crypts/DOUBLEMD5.java | 25 ----- .../security/crypts/EncryptionMethod.java | 7 +- .../fr/xephi/authme/security/crypts/IPB3.java | 25 ----- .../xephi/authme/security/crypts/JOOMLA.java | 25 ----- .../fr/xephi/authme/security/crypts/MD5.java | 25 ----- .../xephi/authme/security/crypts/MD5VB.java | 25 ----- .../fr/xephi/authme/security/crypts/MYBB.java | 25 ----- .../xephi/authme/security/crypts/PHPBB.java | 102 +----------------- .../authme/security/crypts/PHPFUSION.java | 25 ----- .../authme/security/crypts/PLAINTEXT.java | 18 ---- .../authme/security/crypts/ROYALAUTH.java | 26 ----- .../authme/security/crypts/SALTED2MD5.java | 25 ----- .../authme/security/crypts/SALTEDSHA512.java | 25 ----- .../fr/xephi/authme/security/crypts/SHA1.java | 25 ----- .../xephi/authme/security/crypts/SHA256.java | 25 ----- .../xephi/authme/security/crypts/SHA512.java | 25 ----- .../fr/xephi/authme/security/crypts/SMF.java | 25 ----- .../fr/xephi/authme/security/crypts/WBB3.java | 25 ----- .../fr/xephi/authme/security/crypts/WBB4.java | 18 ---- .../authme/security/crypts/WHIRLPOOL.java | 17 --- .../authme/security/crypts/WORDPRESS.java | 48 --------- .../xephi/authme/security/crypts/XAUTH.java | 25 ----- .../fr/xephi/authme/security/crypts/XF.java | 39 +------ .../authme/security/pbkdf2/BinTools.java | 31 +++--- .../authme/security/pbkdf2/MacBasedPRF.java | 28 +---- .../authme/security/pbkdf2/PBKDF2Engine.java | 55 ++-------- .../security/pbkdf2/PBKDF2HexFormatter.java | 17 +-- .../security/pbkdf2/PBKDF2Parameters.java | 50 --------- 36 files changed, 38 insertions(+), 949 deletions(-) diff --git a/src/main/java/fr/xephi/authme/security/HashAlgorithm.java b/src/main/java/fr/xephi/authme/security/HashAlgorithm.java index 999991c29..49a011341 100644 --- a/src/main/java/fr/xephi/authme/security/HashAlgorithm.java +++ b/src/main/java/fr/xephi/authme/security/HashAlgorithm.java @@ -40,17 +40,12 @@ public enum HashAlgorithm { /** * Constructor for HashAlgorithm. * - * @param classe Class + * @param classe The class of the hash implementation. */ HashAlgorithm(Class classe) { this.classe = classe; } - /** - * Method getclasse. - * - * @return Class - */ public Class getclasse() { return classe; } diff --git a/src/main/java/fr/xephi/authme/security/PasswordSecurity.java b/src/main/java/fr/xephi/authme/security/PasswordSecurity.java index 571c83fb8..9f96083f6 100644 --- a/src/main/java/fr/xephi/authme/security/PasswordSecurity.java +++ b/src/main/java/fr/xephi/authme/security/PasswordSecurity.java @@ -21,13 +21,6 @@ public class PasswordSecurity { public static final HashMap userSalt = new HashMap<>(); private static final SecureRandom rnd = new SecureRandom(); - /** - * Method createSalt. - * - * @param length int - * - * @return String * @throws NoSuchAlgorithmException - */ public static String createSalt(int length) throws NoSuchAlgorithmException { byte[] msg = new byte[40]; @@ -38,15 +31,6 @@ public class PasswordSecurity { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)).substring(0, length); } - /** - * Method getHash. - * - * @param alg HashAlgorithm - * @param password String - * @param playerName String - * - * @return String * @throws NoSuchAlgorithmException - */ public static String getHash(HashAlgorithm alg, String password, String playerName) throws NoSuchAlgorithmException { EncryptionMethod method; @@ -55,7 +39,7 @@ public class PasswordSecurity { method = (EncryptionMethod) alg.getclasse().newInstance(); else method = null; } catch (InstantiationException | IllegalAccessException e) { - throw new NoSuchAlgorithmException("Problem with this hash algorithm"); + throw new NoSuchAlgorithmException("Problem with hash algorithm '" + alg + "'", e); } String salt = ""; switch (alg) { @@ -142,15 +126,6 @@ public class PasswordSecurity { return method.getHash(password, salt, playerName); } - /** - * Method comparePasswordWithHash. - * - * @param password String - * @param hash String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException - */ public static boolean comparePasswordWithHash(String password, String hash, String playerName) throws NoSuchAlgorithmException { HashAlgorithm algorithm = Settings.getPasswordHash; @@ -181,15 +156,6 @@ public class PasswordSecurity { return false; } - /** - * Method compareWithAllEncryptionMethod. - * - * @param password String - * @param hash String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException - */ private static boolean compareWithAllEncryptionMethod(String password, String hash, String playerName) { for (HashAlgorithm algo : HashAlgorithm.values()) { diff --git a/src/main/java/fr/xephi/authme/security/RandomString.java b/src/main/java/fr/xephi/authme/security/RandomString.java index d9f58bfc8..daab18e6b 100644 --- a/src/main/java/fr/xephi/authme/security/RandomString.java +++ b/src/main/java/fr/xephi/authme/security/RandomString.java @@ -5,7 +5,6 @@ import java.util.Random; /** * @author Xephi59 - * @version $Revision: 1.0 $ */ public class RandomString { @@ -22,11 +21,6 @@ public class RandomString { private final char[] buf; - /** - * Constructor for RandomString. - * - * @param length int - */ public RandomString(int length) { if (length < 1) throw new IllegalArgumentException("length < 1: " + length); @@ -34,11 +28,6 @@ public class RandomString { random.setSeed(Calendar.getInstance().getTimeInMillis()); } - /** - * Method nextString. - * - * @return String - */ public String nextString() { for (int idx = 0; idx < buf.length; ++idx) buf[idx] = chars[random.nextInt(chars.length)]; diff --git a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java index 72fec9f0a..ebec319c1 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java +++ b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java @@ -359,14 +359,6 @@ public class BCRYPT implements EncryptionMethod { return matched; } - /** - * Method getDoubleHash. - * - * @param text String - * @param salt String - * - * @return String - */ public static String getDoubleHash(String text, String salt) { String hash = hashpw(text, salt); return hashpw(text, hash); @@ -514,30 +506,12 @@ public class BCRYPT implements EncryptionMethod { return ret; } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return hashpw(password, salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT2Y.java b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT2Y.java index 63d10985e..19ad553ff 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT2Y.java +++ b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT2Y.java @@ -6,15 +6,6 @@ import java.security.NoSuchAlgorithmException; */ public class BCRYPT2Y implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -23,15 +14,6 @@ public class BCRYPT2Y implements EncryptionMethod { return (BCRYPT.hashpw(password, salt)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/CRAZYCRYPT1.java b/src/main/java/fr/xephi/authme/security/crypts/CRAZYCRYPT1.java index 45845229c..e62818104 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/CRAZYCRYPT1.java +++ b/src/main/java/fr/xephi/authme/security/crypts/CRAZYCRYPT1.java @@ -11,11 +11,6 @@ public class CRAZYCRYPT1 implements EncryptionMethod { private static final char[] CRYPTCHARS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; protected final Charset charset = Charset.forName("UTF-8"); - /** - * Method byteArrayToHexString. - * - * @param args byte[]String * @return String - */ public static String byteArrayToHexString(final byte... args) { final char[] chars = new char[args.length * 2]; @@ -26,15 +21,6 @@ public class CRAZYCRYPT1 implements EncryptionMethod { return new String(chars); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -48,14 +34,6 @@ public class CRAZYCRYPT1 implements EncryptionMethod { } } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName Stringooleaneptiontring) * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ - @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2.java b/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2.java index cdf256a99..eeb6cfad3 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2.java +++ b/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2.java @@ -10,15 +10,6 @@ import java.util.Arrays; */ public class CryptPBKDF2 implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -29,15 +20,6 @@ public class CryptPBKDF2 implements EncryptionMethod { return result + Arrays.toString(engine.deriveKey(password, 64)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2Django.java b/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2Django.java index 98ff78836..f6bbf8636 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2Django.java +++ b/src/main/java/fr/xephi/authme/security/crypts/CryptPBKDF2Django.java @@ -10,15 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class CryptPBKDF2Django implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -29,15 +20,6 @@ public class CryptPBKDF2Django implements EncryptionMethod { return result + String.valueOf(DatatypeConverter.printBase64Binary(engine.deriveKey(password, 32))); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/DOUBLEMD5.java b/src/main/java/fr/xephi/authme/security/crypts/DOUBLEMD5.java index 349929868..eacf600b0 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/DOUBLEMD5.java +++ b/src/main/java/fr/xephi/authme/security/crypts/DOUBLEMD5.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class DOUBLEMD5 implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -24,30 +17,12 @@ public class DOUBLEMD5 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(getMD5(password)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java b/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java index 16635fa7c..97da85d3f 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java +++ b/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java @@ -13,9 +13,6 @@ import java.security.NoSuchAlgorithmException; *

* The comparePassword is called when we need to match password (/login usually) *

- * - * @author Gabriele - * @version $Revision: 1.0 $ */ public interface EncryptionMethod { @@ -25,7 +22,7 @@ public interface EncryptionMethod { * etc... for customs methods) * @param name String * - * @return Hashing password * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException + * @return Hashing password */ String getHash(String password, String salt, String name) throws NoSuchAlgorithmException; @@ -35,7 +32,7 @@ public interface EncryptionMethod { * @param password * @param playerName * - * @return true if password match, false else * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException + * @return true if password match, false else */ boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException; diff --git a/src/main/java/fr/xephi/authme/security/crypts/IPB3.java b/src/main/java/fr/xephi/authme/security/crypts/IPB3.java index ecfc459e7..090303119 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/IPB3.java +++ b/src/main/java/fr/xephi/authme/security/crypts/IPB3.java @@ -10,13 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class IPB3 implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -26,30 +19,12 @@ public class IPB3 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(getMD5(salt) + getMD5(password)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/JOOMLA.java b/src/main/java/fr/xephi/authme/security/crypts/JOOMLA.java index d4eb0f7f0..8e2dc7b8d 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/JOOMLA.java +++ b/src/main/java/fr/xephi/authme/security/crypts/JOOMLA.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class JOOMLA implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -24,30 +17,12 @@ public class JOOMLA implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(password + salt) + ":" + salt; } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/MD5.java b/src/main/java/fr/xephi/authme/security/crypts/MD5.java index a4e0bc131..b2e9116a8 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/MD5.java +++ b/src/main/java/fr/xephi/authme/security/crypts/MD5.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class MD5 implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -24,30 +17,12 @@ public class MD5 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(password); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/MD5VB.java b/src/main/java/fr/xephi/authme/security/crypts/MD5VB.java index 79892c284..90ea7fc31 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/MD5VB.java +++ b/src/main/java/fr/xephi/authme/security/crypts/MD5VB.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class MD5VB implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -24,30 +17,12 @@ public class MD5VB implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return "$MD5vb$" + salt + "$" + getMD5(getMD5(password) + salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/MYBB.java b/src/main/java/fr/xephi/authme/security/crypts/MYBB.java index 501a591ae..444bac47d 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/MYBB.java +++ b/src/main/java/fr/xephi/authme/security/crypts/MYBB.java @@ -10,13 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class MYBB implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -26,30 +19,12 @@ public class MYBB implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(getMD5(salt) + getMD5(password)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/PHPBB.java b/src/main/java/fr/xephi/authme/security/crypts/PHPBB.java index e852dd6d1..abac87636 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/PHPBB.java +++ b/src/main/java/fr/xephi/authme/security/crypts/PHPBB.java @@ -11,19 +11,11 @@ import java.security.NoSuchAlgorithmException; /** * @author stefano - * @version $Revision: 1.0 $ */ public class PHPBB implements EncryptionMethod { - private final String itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + private static final String itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - /** - * Method md5. - * - * @param data String - * - * @return String - */ public static String md5(String data) { try { byte[] bytes = data.getBytes("ISO-8859-1"); @@ -35,14 +27,7 @@ public class PHPBB implements EncryptionMethod { } } - /** - * Method hexToInt. - * - * @param ch char - * - * @return int - */ - static int hexToInt(char ch) { + private static int hexToInt(char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; ch = Character.toUpperCase(ch); @@ -51,13 +36,6 @@ public class PHPBB implements EncryptionMethod { throw new IllegalArgumentException("Not a hex character: " + ch); } - /** - * Method bytes2hex. - * - * @param bytes byte[] - * - * @return String - */ private static String bytes2hex(byte[] bytes) { StringBuilder r = new StringBuilder(32); for (byte b : bytes) { @@ -69,14 +47,7 @@ public class PHPBB implements EncryptionMethod { return r.toString(); } - /** - * Method pack. - * - * @param hex String - * - * @return String - */ - static String pack(String hex) { + private static String pack(String hex) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < hex.length(); i += 2) { char c1 = hex.charAt(i); @@ -87,14 +58,6 @@ public class PHPBB implements EncryptionMethod { return buf.toString(); } - /** - * Method phpbb_hash. - * - * @param password String - * @param salt String - * - * @return String - */ public String phpbb_hash(String password, String salt) { String random_state = salt; StringBuilder random = new StringBuilder(); @@ -110,27 +73,10 @@ public class PHPBB implements EncryptionMethod { return md5(password); } - /** - * Method _hash_gensalt_private. - * - * @param input String - * @param itoa64 String - * - * @return String - */ private String _hash_gensalt_private(String input, String itoa64) { return _hash_gensalt_private(input, itoa64, 6); } - /** - * Method _hash_gensalt_private. - * - * @param input String - * @param itoa64 String - * @param iteration_count_log2 int - * - * @return String - */ private String _hash_gensalt_private(String input, String itoa64, int iteration_count_log2) { if (iteration_count_log2 < 4 || iteration_count_log2 > 31) { @@ -142,14 +88,6 @@ public class PHPBB implements EncryptionMethod { return output; } - /** - * Encode hash - * - * @param input String - * @param count int - * - * @return String - */ private String _hash_encode64(String input, int count) { StringBuilder output = new StringBuilder(); int i = 0; @@ -171,14 +109,6 @@ public class PHPBB implements EncryptionMethod { return output.toString(); } - /** - * Method _hash_crypt_private. - * - * @param password String - * @param setting String - * - * @return String - */ String _hash_crypt_private(String password, String setting) { String output = "*"; if (!setting.substring(0, 3).equals("$H$")) @@ -200,44 +130,18 @@ public class PHPBB implements EncryptionMethod { return output; } - /** - * Method phpbb_check_hash. - * - * @param password String - * @param hash String - * - * @return boolean - */ public boolean phpbb_check_hash(String password, String hash) { if (hash.length() == 34) return _hash_crypt_private(password, hash).equals(hash); else return md5(password).equals(hash); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return phpbb_hash(password, salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/PHPFUSION.java b/src/main/java/fr/xephi/authme/security/crypts/PHPFUSION.java index fc9440a6b..2d7bc047e 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/PHPFUSION.java +++ b/src/main/java/fr/xephi/authme/security/crypts/PHPFUSION.java @@ -14,13 +14,6 @@ import java.security.NoSuchAlgorithmException; */ public class PHPFUSION implements EncryptionMethod { - /** - * Method getSHA1. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA1(String message) throws NoSuchAlgorithmException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); @@ -30,15 +23,6 @@ public class PHPFUSION implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -66,15 +50,6 @@ public class PHPFUSION implements EncryptionMethod { return digest; } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/PLAINTEXT.java b/src/main/java/fr/xephi/authme/security/crypts/PLAINTEXT.java index def0e1af7..0e8117868 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/PLAINTEXT.java +++ b/src/main/java/fr/xephi/authme/security/crypts/PLAINTEXT.java @@ -6,30 +6,12 @@ import java.security.NoSuchAlgorithmException; */ public class PLAINTEXT implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return password; } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/ROYALAUTH.java b/src/main/java/fr/xephi/authme/security/crypts/ROYALAUTH.java index 242a88317..76303d3fc 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/ROYALAUTH.java +++ b/src/main/java/fr/xephi/authme/security/crypts/ROYALAUTH.java @@ -7,15 +7,6 @@ import java.security.NoSuchAlgorithmException; */ public class ROYALAUTH implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -24,14 +15,6 @@ public class ROYALAUTH implements EncryptionMethod { return password; } - /** - * Method hash. - * - * @param password String - * @param salt String - * - * @return String * @throws NoSuchAlgorithmException - */ public String hash(String password, String salt) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-512"); @@ -43,15 +26,6 @@ public class ROYALAUTH implements EncryptionMethod { return sb.toString(); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SALTED2MD5.java b/src/main/java/fr/xephi/authme/security/crypts/SALTED2MD5.java index 5b29db9ed..24075b728 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SALTED2MD5.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SALTED2MD5.java @@ -10,13 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class SALTED2MD5 implements EncryptionMethod { - /** - * Method getMD5. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getMD5(String message) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); @@ -26,30 +19,12 @@ public class SALTED2MD5 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getMD5(getMD5(password) + salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SALTEDSHA512.java b/src/main/java/fr/xephi/authme/security/crypts/SALTEDSHA512.java index 27d3cc8db..02ae097e8 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SALTEDSHA512.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SALTEDSHA512.java @@ -10,13 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class SALTEDSHA512 implements EncryptionMethod { - /** - * Method getSHA512. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA512(String message) throws NoSuchAlgorithmException { MessageDigest sha512 = MessageDigest.getInstance("SHA-512"); @@ -26,30 +19,12 @@ public class SALTEDSHA512 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getSHA512(password + salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SHA1.java b/src/main/java/fr/xephi/authme/security/crypts/SHA1.java index 360cfaf37..47ae5ca0e 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SHA1.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SHA1.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class SHA1 implements EncryptionMethod { - /** - * Method getSHA1. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA1(String message) throws NoSuchAlgorithmException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); @@ -24,30 +17,12 @@ public class SHA1 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getSHA1(password); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SHA256.java b/src/main/java/fr/xephi/authme/security/crypts/SHA256.java index ff25dd2f4..e14fac4f2 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SHA256.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SHA256.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class SHA256 implements EncryptionMethod { - /** - * Method getSHA256. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA256(String message) throws NoSuchAlgorithmException { MessageDigest sha256 = MessageDigest.getInstance("SHA-256"); @@ -24,30 +17,12 @@ public class SHA256 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return "$SHA$" + salt + "$" + getSHA256(getSHA256(password) + salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SHA512.java b/src/main/java/fr/xephi/authme/security/crypts/SHA512.java index 3e7b93451..ae752b418 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SHA512.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SHA512.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class SHA512 implements EncryptionMethod { - /** - * Method getSHA512. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA512(String message) throws NoSuchAlgorithmException { MessageDigest sha512 = MessageDigest.getInstance("SHA-512"); @@ -24,30 +17,12 @@ public class SHA512 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getSHA512(password); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/SMF.java b/src/main/java/fr/xephi/authme/security/crypts/SMF.java index 16f19cf7e..d4f9bcc1e 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/SMF.java +++ b/src/main/java/fr/xephi/authme/security/crypts/SMF.java @@ -8,13 +8,6 @@ import java.security.NoSuchAlgorithmException; */ public class SMF implements EncryptionMethod { - /** - * Method getSHA1. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA1(String message) throws NoSuchAlgorithmException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); @@ -24,30 +17,12 @@ public class SMF implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getSHA1(name.toLowerCase() + password); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/WBB3.java b/src/main/java/fr/xephi/authme/security/crypts/WBB3.java index c1ea4276e..992f62808 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WBB3.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WBB3.java @@ -10,13 +10,6 @@ import java.security.NoSuchAlgorithmException; */ public class WBB3 implements EncryptionMethod { - /** - * Method getSHA1. - * - * @param message String - * - * @return String * @throws NoSuchAlgorithmException - */ private static String getSHA1(String message) throws NoSuchAlgorithmException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); @@ -26,30 +19,12 @@ public class WBB3 implements EncryptionMethod { return String.format("%0" + (digest.length << 1) + "x", new BigInteger(1, digest)); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return getSHA1(salt.concat(getSHA1(salt.concat(getSHA1(password))))); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/WBB4.java b/src/main/java/fr/xephi/authme/security/crypts/WBB4.java index 41b528899..5a49e06d9 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WBB4.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WBB4.java @@ -6,30 +6,12 @@ import java.security.NoSuchAlgorithmException; */ public class WBB4 implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { return BCRYPT.getDoubleHash(password, salt); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java b/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java index 6bf5d9f3b..0e27a04af 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java @@ -164,13 +164,6 @@ public class WHIRLPOOL implements EncryptionMethod { public WHIRLPOOL() { } - /** - * Method display. - * - * @param array byte[] - * - * @return String - */ protected static String display(byte[] array) { char[] val = new char[2 * array.length]; String hex = "0123456789ABCDEF"; @@ -377,7 +370,6 @@ public class WHIRLPOOL implements EncryptionMethod { * Delivers string input data to the hashing algorithm. * * @param source plaintext data to hash (ASCII text string). - *

* This method maintains the invariant: bufferBits < 512 */ public void NESSIEadd(String source) { @@ -409,15 +401,6 @@ public class WHIRLPOOL implements EncryptionMethod { return display(digest); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/WORDPRESS.java b/src/main/java/fr/xephi/authme/security/crypts/WORDPRESS.java index c3e79627d..1817d9754 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WORDPRESS.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WORDPRESS.java @@ -13,14 +13,6 @@ public class WORDPRESS implements EncryptionMethod { private static final String itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private final SecureRandom randomGen = new SecureRandom(); - /** - * Method encode64. - * - * @param src byte[] - * @param count int - * - * @return String - */ private String encode64(byte[] src, int count) { int i, value; StringBuilder output = new StringBuilder(); @@ -55,14 +47,6 @@ public class WORDPRESS implements EncryptionMethod { return output.toString(); } - /** - * Method crypt. - * - * @param password String - * @param setting String - * - * @return String - */ private String crypt(String password, String setting) { String output = "*0"; if (((setting.length() < 2) ? setting : setting.substring(0, 2)).equalsIgnoreCase(output)) { @@ -101,13 +85,6 @@ public class WORDPRESS implements EncryptionMethod { return output; } - /** - * Method gensaltPrivate. - * - * @param input byte[] - * - * @return String - */ private String gensaltPrivate(byte[] input) { String output = "$P$"; int iterationCountLog2 = 8; @@ -116,13 +93,6 @@ public class WORDPRESS implements EncryptionMethod { return output; } - /** - * Method stringToUtf8. - * - * @param string String - * - * @return byte[] - */ private byte[] stringToUtf8(String string) { try { return string.getBytes("UTF-8"); @@ -131,15 +101,6 @@ public class WORDPRESS implements EncryptionMethod { } } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -148,15 +109,6 @@ public class WORDPRESS implements EncryptionMethod { return crypt(password, gensaltPrivate(stringToUtf8(new String(random)))); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/XAUTH.java b/src/main/java/fr/xephi/authme/security/crypts/XAUTH.java index 49500ddb5..f648677f3 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/XAUTH.java +++ b/src/main/java/fr/xephi/authme/security/crypts/XAUTH.java @@ -6,13 +6,6 @@ import java.security.NoSuchAlgorithmException; */ public class XAUTH implements EncryptionMethod { - /** - * Method getWhirlpool. - * - * @param message String - * - * @return String - */ public static String getWhirlpool(String message) { WHIRLPOOL w = new WHIRLPOOL(); byte[] digest = new byte[WHIRLPOOL.DIGESTBYTES]; @@ -22,15 +15,6 @@ public class XAUTH implements EncryptionMethod { return WHIRLPOOL.display(digest); } - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { @@ -39,15 +23,6 @@ public class XAUTH implements EncryptionMethod { return hash.substring(0, saltPos) + salt + hash.substring(saltPos); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { diff --git a/src/main/java/fr/xephi/authme/security/crypts/XF.java b/src/main/java/fr/xephi/authme/security/crypts/XF.java index a1fc45ce2..0125a6a7c 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/XF.java +++ b/src/main/java/fr/xephi/authme/security/crypts/XF.java @@ -13,30 +13,12 @@ import java.util.regex.Pattern; */ public class XF implements EncryptionMethod { - /** - * Method getHash. - * - * @param password String - * @param salt String - * @param name String - * - * @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) - */ @Override public String getHash(String password, String salt, String name) throws NoSuchAlgorithmException { - return getSHA256(getSHA256(password) + regmatch("\"salt\";.:..:\"(.*)\";.:.:\"hashFunc\"", salt)); + return getSha256(getSha256(password) + regmatch("\"salt\";.:..:\"(.*)\";.:.:\"hashFunc\"", salt)); } - /** - * Method comparePassword. - * - * @param hash String - * @param password String - * @param playerName String - * - * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) - */ @Override public boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException { @@ -44,14 +26,7 @@ public class XF implements EncryptionMethod { return hash.equals(regmatch("\"hash\";.:..:\"(.*)\";.:.:\"salt\"", salt)); } - /** - * Method getSHA256. - * - * @param password String - * - * @return String * @throws NoSuchAlgorithmException - */ - public String getSHA256(String password) throws NoSuchAlgorithmException { + private String getSha256(String password) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(password.getBytes()); byte byteData[] = md.digest(); @@ -70,15 +45,7 @@ public class XF implements EncryptionMethod { return hexString.toString(); } - /** - * Method regmatch. - * - * @param pattern String - * @param line String - * - * @return String - */ - public String regmatch(String pattern, String line) { + private String regmatch(String pattern, String line) { List allMatches = new ArrayList<>(); Matcher m = Pattern.compile(pattern).matcher(line); while (m.find()) { diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/BinTools.java b/src/main/java/fr/xephi/authme/security/pbkdf2/BinTools.java index 0631bd5ae..003b50bdd 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/BinTools.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/BinTools.java @@ -32,7 +32,10 @@ package fr.xephi.authme.security.pbkdf2; */ public class BinTools { - public static final String hex = "0123456789ABCDEF"; + private static final String HEX_CHARS = "0123456789ABCDEF"; + + private BinTools() { + } /** * Simple binary-to-hexadecimal conversion. @@ -49,8 +52,8 @@ public class BinTools { StringBuffer stringBuffer = new StringBuffer(2 * b.length); for (byte aB : b) { int v = (256 + aB) % 256; - stringBuffer.append(hex.charAt((v / 16) & 15)); - stringBuffer.append(hex.charAt((v % 16) & 15)); + stringBuffer.append(HEX_CHARS.charAt((v / 16) & 15)); + stringBuffer.append(HEX_CHARS.charAt((v % 16) & 15)); } return stringBuffer.toString(); } @@ -58,11 +61,11 @@ public class BinTools { /** * Convert hex string to array of bytes. * - * @param s String containing hexadecimal digits. May be null - * . On odd length leading zero will be assumed. + * @param s String containing hexadecimal digits. May be null. + * On odd length leading zero will be assumed. * - * @return Array on bytes, non-null. * @throws IllegalArgumentException - * when string contains non-hex character + * @return Array on bytes, non-null. + * @throws IllegalArgumentException when string contains non-hex character */ public static byte[] hex2bin(final String s) { String m = s; @@ -85,10 +88,10 @@ public class BinTools { /** * Convert hex digit to numerical value. * - * @param c 0-9, a-f, A-F allowd. + * @param c 0-9, a-f, A-F allowed. * - * @return 0-15 * @throws IllegalArgumentException - * on non-hex character + * @return 0-15 + * @throws IllegalArgumentException on non-hex character */ public static int hex2bin(char c) { if (c >= '0' && c <= '9') { @@ -103,12 +106,8 @@ public class BinTools { throw new IllegalArgumentException("Input string may only contain hex digits, but found '" + c + "'"); } - /** - * Method main. - * - * @param args String[] - */ - public static void main(String[] args) { + // TODO ljacqu 20151219: Move to a BinToolsTest class + private static void testUtils(String[] args) { byte b[] = new byte[256]; byte bb = 0; for (int i = 0; i < 256; i++) { diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java b/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java index 95651c02e..5b0268c18 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java @@ -63,12 +63,6 @@ public class MacBasedPRF implements PRF { } } - /** - * Constructor for MacBasedPRF. - * - * @param macAlgorithm String - * @param provider String - */ public MacBasedPRF(String macAlgorithm, String provider) { this.macAlgorithm = macAlgorithm; try { @@ -79,34 +73,18 @@ public class MacBasedPRF implements PRF { } } - /** - * Method doFinal. - * - * @param M byte[] - * - * @return byte[] * @see fr.xephi.authme.security.pbkdf2.PRF#doFinal(byte[]) - */ + @Override public byte[] doFinal(byte[] M) { byte[] r = mac.doFinal(M); return r; } - /** - * Method getHLen. - * - * @return int * @see fr.xephi.authme.security.pbkdf2.PRF#getHLen() - */ + @Override public int getHLen() { return hLen; } - /** - * Method init. - * - * @param P byte[] - * - * @see fr.xephi.authme.security.pbkdf2.PRF#init(byte[]) - */ + @Override public void init(byte[] P) { try { mac.init(new SecretKeySpec(P, macAlgorithm)); diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java index 1ca3f4ce3..c78f786ad 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java @@ -159,28 +159,15 @@ public class PBKDF2Engine implements PBKDF2 { } } - /** - * Method deriveKey. - * - * @param inputPassword String - * - * @return byte[] * @see fr.xephi.authme.security.pbkdf2.PBKDF2#deriveKey(String) - */ + @Override public byte[] deriveKey(String inputPassword) { return deriveKey(inputPassword, 0); } - /** - * Method deriveKey. - * - * @param inputPassword String - * @param dkLen int - * - * @return byte[] * @see fr.xephi.authme.security.pbkdf2.PBKDF2#deriveKey(String, int) - */ + @Override public byte[] deriveKey(String inputPassword, int dkLen) { byte[] r = null; - byte P[] = null; + byte[] P = null; String charset = parameters.getHashCharset(); if (inputPassword == null) { inputPassword = ""; @@ -202,13 +189,7 @@ public class PBKDF2Engine implements PBKDF2 { return r; } - /** - * Method verifyKey. - * - * @param inputPassword String - * - * @return boolean * @see fr.xephi.authme.security.pbkdf2.PBKDF2#verifyKey(String) - */ + @Override public boolean verifyKey(String inputPassword) { byte[] referenceKey = getParameters().getDerivedKey(); if (referenceKey == null || referenceKey.length == 0) { @@ -240,22 +221,12 @@ public class PBKDF2Engine implements PBKDF2 { prf.init(P); } - /** - * Method getPseudoRandomFunction. - * - * @return PRF * @see fr.xephi.authme.security.pbkdf2.PBKDF2#getPseudoRandomFunction() - */ + @Override public PRF getPseudoRandomFunction() { return prf; } - /** - * Method setPseudoRandomFunction. - * - * @param prf PRF - * - * @see fr.xephi.authme.security.pbkdf2.PBKDF2#setPseudoRandomFunction(PRF) - */ + @Override public void setPseudoRandomFunction(PRF prf) { this.prf = prf; } @@ -369,22 +340,12 @@ public class PBKDF2Engine implements PBKDF2 { dest[offset + 3] = (byte) (i); } - /** - * Method getParameters. - * - * @return PBKDF2Parameters * @see fr.xephi.authme.security.pbkdf2.PBKDF2#getParameters() - */ + @Override public PBKDF2Parameters getParameters() { return parameters; } - /** - * Method setParameters. - * - * @param parameters PBKDF2Parameters - * - * @see fr.xephi.authme.security.pbkdf2.PBKDF2#setParameters(PBKDF2Parameters) - */ + @Override public void setParameters(PBKDF2Parameters parameters) { this.parameters = parameters; } diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2HexFormatter.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2HexFormatter.java index 2309d77f1..54544a4c2 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2HexFormatter.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2HexFormatter.java @@ -33,14 +33,7 @@ package fr.xephi.authme.security.pbkdf2; */ public class PBKDF2HexFormatter implements PBKDF2Formatter { - /** - * Method fromString. - * - * @param p PBKDF2Parameters - * @param s String - * - * @return boolean * @see fr.xephi.authme.security.pbkdf2.PBKDF2Formatter#fromString(PBKDF2Parameters, String) - */ + @Override public boolean fromString(PBKDF2Parameters p, String s) { if (p == null || s == null) { return true; @@ -61,13 +54,7 @@ public class PBKDF2HexFormatter implements PBKDF2Formatter { return false; } - /** - * Method toString. - * - * @param p PBKDF2Parameters - * - * @return String * @see fr.xephi.authme.security.pbkdf2.PBKDF2Formatter#toString(PBKDF2Parameters) - */ + @Override public String toString(PBKDF2Parameters p) { String s = BinTools.bin2hex(p.getSalt()) + ":" + String.valueOf(p.getIterationCount()) + ":" + BinTools.bin2hex(p.getDerivedKey()); return s; diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java index d962648b2..b7b158a0c 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java @@ -99,92 +99,42 @@ public class PBKDF2Parameters { this.derivedKey = derivedKey; } - /** - * Method getIterationCount. - * - * @return int - */ public int getIterationCount() { return iterationCount; } - /** - * Method setIterationCount. - * - * @param iterationCount int - */ public void setIterationCount(int iterationCount) { this.iterationCount = iterationCount; } - /** - * Method getSalt. - * - * @return byte[] - */ public byte[] getSalt() { return salt; } - /** - * Method setSalt. - * - * @param salt byte[] - */ public void setSalt(byte[] salt) { this.salt = salt; } - /** - * Method getDerivedKey. - * - * @return byte[] - */ public byte[] getDerivedKey() { return derivedKey; } - /** - * Method setDerivedKey. - * - * @param derivedKey byte[] - */ public void setDerivedKey(byte[] derivedKey) { this.derivedKey = derivedKey; } - /** - * Method getHashAlgorithm. - * - * @return String - */ public String getHashAlgorithm() { return hashAlgorithm; } - /** - * Method setHashAlgorithm. - * - * @param hashAlgorithm String - */ public void setHashAlgorithm(String hashAlgorithm) { this.hashAlgorithm = hashAlgorithm; } - /** - * Method getHashCharset. - * - * @return String - */ public String getHashCharset() { return hashCharset; } - /** - * Method setHashCharset. - * - * @param hashCharset String - */ public void setHashCharset(String hashCharset) { this.hashCharset = hashCharset; } From 268cc03321e909c91070ed482570fa0f567779cc Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 19 Dec 2015 09:53:28 +0100 Subject: [PATCH 4/4] Minor - update AuthMe version in tools setvars.bat --- src/tools/bathelpers/setvars.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/bathelpers/setvars.bat b/src/tools/bathelpers/setvars.bat index 463f6080e..e8ba9ba1b 100644 --- a/src/tools/bathelpers/setvars.bat +++ b/src/tools/bathelpers/setvars.bat @@ -2,7 +2,7 @@ SET batdir=C:\your\path\AUTHME_DEV\bathelpers\ : The location of the generated JAR file -SET jarfile=C:\Users\yourname\IdeaProjects\AuthMeReloaded\target\AuthMe-5.1-SNAPSHOT.jar +SET jarfile=C:\Users\yourname\IdeaProjects\AuthMeReloaded\target\AuthMe-5.2-SNAPSHOT.jar : The location of the pom.xml file of the project SET pomfile=C:\Users\yourname\IdeaProjects\AuthMeReloaded\pom.xml