From e1a84448a2f5ac6c4bfed6fb938901eda8c375b6 Mon Sep 17 00:00:00 2001
From: Xephi59
* Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping
* as well as erroneous ones, as communicated with {@link FoundResultStatus}.
- *
* PermissionsManager. - *
+ ** A permissions manager, to manage and use various permissions systems. * This manager supports dynamic plugin hooking and various other features. - *
+ ** Written by Tim Visée. - * + *
* @author Tim Visée, http://timvisee.com * @version 0.2.1 */ 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 b7602e7f..850a6f01 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java +++ b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java @@ -13,56 +13,57 @@ // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. package fr.xephi.authme.security.crypts; -import fr.xephi.authme.ConsoleLogger; -import fr.xephi.authme.security.crypts.description.HasSalt; -import fr.xephi.authme.security.crypts.description.Usage; -import fr.xephi.authme.security.crypts.description.Recommendation; -import fr.xephi.authme.security.crypts.description.SaltType; -import fr.xephi.authme.settings.Settings; -import fr.xephi.authme.util.StringUtils; - import java.io.UnsupportedEncodingException; import java.security.SecureRandom; +import fr.xephi.authme.ConsoleLogger; +import fr.xephi.authme.security.crypts.description.HasSalt; +import fr.xephi.authme.security.crypts.description.Recommendation; +import fr.xephi.authme.security.crypts.description.SaltType; +import fr.xephi.authme.security.crypts.description.Usage; +import fr.xephi.authme.settings.Settings; +import fr.xephi.authme.util.StringUtils; + /** + ** BCrypt implements OpenBSD-style Blowfish password hashing using the scheme * described in "A Future-Adaptable Password Scheme" by Niels Provos and David * Mazieres. - *
+ ** This password hashing system tries to thwart off-line password cracking using * a computationally-intensive hashing algorithm, based on Bruce Schneier's * Blowfish cipher. The work factor of the algorithm is parameterised, so it can * be increased as computers get faster. - *
+ ** Usage is really simple. To hash a password for the first time, call the * hashpw method with a random salt, like this: - *
+ *
*
- * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
- *
+ * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
*
* To check whether a plaintext password matches one that has been hashed * previously, use the checkpw method: - *
+ *
*
- * if (BCrypt.checkpw(candidate_password, stored_hash))
- *
- * System.out.println("It matches");
- * else
- * System.out.println("It does not match");
+ * if (BCrypt.checkpw(candidate_password, stored_hash))
+ * System.out.println("It matches");
+ * else
+ * System.out.println("It does not match");
*
* The gensalt() method takes an optional parameter (log_rounds) that determines * the computational complexity of the hashing: - *
+ *
*
- * String strong_salt = BCrypt.gensalt(10)
- *
- * String stronger_salt = BCrypt.gensalt(12)
+ * String strong_salt = BCrypt.gensalt(10)
+ * String stronger_salt = BCrypt.gensalt(12)
*
* The amount of work increases exponentially (2**log_rounds), so each increment * is twice as much work. The default log_rounds is 10, and the valid range is 4 * to 31. - * + *
* @author Damien Miller * @version 0.2 */ 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 0169d192..72d8e8fb 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java @@ -241,8 +241,9 @@ public class WHIRLPOOL extends UnsaltedMethod { * * @param source plaintext data to hash. * @param sourceBits how many bits of plaintext to process. - * - * This method maintains the invariant: bufferBits < 512 + *+ * This method maintains the invariant: bufferBits < 512 + *
*/ public void NESSIEadd(byte[] source, long sourceBits) { /* @@ -322,10 +323,12 @@ public class WHIRLPOOL extends UnsaltedMethod { } /** + ** Get the hash value from the hashing state. - *
- * This method uses the invariant: bufferBits < 512 - * + * + *+ * This method uses the invariant: bufferBits < 512 + *
* @param digest byte[] */ public void NESSIEfinalize(byte[] digest) { @@ -367,7 +370,7 @@ public class WHIRLPOOL extends UnsaltedMethod { * Delivers string input data to the hashing algorithm. * * @param source plaintext data to hash (ASCII text string). - * This method maintains the invariant: bufferBits < 512 + * This method maintains the invariant: bufferBits < 512 */ public void NESSIEadd(String source) { if (source.length() > 0) { diff --git a/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java b/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java index 1baf1e19..85ad0608 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java +++ b/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java @@ -13,10 +13,14 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface HasSalt { - /** The type of the salt. */ + /** The type of the salt. + * @return salttype The SaltType + */ SaltType value(); - /** For text salts, the length of the salt. */ + /** For text salts, the length of the salt. + * @return int Integer + */ int length() default 0; } diff --git a/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java b/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java index f37c3eac..e57a0c40 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java +++ b/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java @@ -12,7 +12,9 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface Recommendation { - /** The recommendation for using the hash algorithm. */ + /** The recommendation for using the hash algorithm. + * @return Usage The Usage + */ Usage value(); } 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 5b0268c1..88ff11bf 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java @@ -1,15 +1,16 @@ package fr.xephi.authme.security.pbkdf2; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + /** - * Default PRF implementation based on standard javax.crypt.Mac mechanisms. *- *
* A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java index d1dab302..59bc96df 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java @@ -75,7 +75,7 @@ public interface PBKDF2 { /** * Allow setting of configured parameters. * - * @param parameters + * @param parameters PBKDF2Parameters */ void setParameters(PBKDF2Parameters parameters); 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 c78f786a..d32b8752 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java @@ -8,20 +8,17 @@ import java.security.SecureRandom; /** *
* Request for Comments: 2898 PKCS #5: Password-Based Cryptography Specification - *
+ *
* Version 2.0 - *
+ *
** PBKDF2 (P, S, c, dkLen) - *
- *
+ *
* Options: *- *
* Input: *
- *
* Output: *
- *
* A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner *
@@ -115,13 +108,14 @@ public class PBKDF2Engine implements PBKDF2 { * ISO-8559-1 encoding. Output result as * "Salt:iteration-count:PBKDF2" with binary data in hexadecimal * encoding. - * + ** Example: Password "password" (without the quotes) leads to * 48290A0B96C426C3:1000:973899B1D4AFEB3ED371060D0797E0EE0142BD04 - * + *
* @param args Supply the password as argument. * - * @throws IOException * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException + * @throws IOException an ioexception occured + * @throws NoSuchAlgorithmException a NoSuchAlgorithmException occured */ public static void main(String[] args) throws IOException, NoSuchAlgorithmException { @@ -266,8 +260,8 @@ public class PBKDF2Engine implements PBKDF2 { /** * Integer division with ceiling function. * - * @param a - * @param b + * @param a Integer + * @param b Integer * * @return ceil(a/b) * @see RFC 2898 5.2 Step * 2. @@ -288,7 +282,7 @@ public class PBKDF2Engine implements PBKDF2 { * @param prf Pseudo Random Function * @param S Salt as array of bytes * @param c Iteration count - * @param blockIndex + * @param blockIndex Integer * * @see RFC 2898 5.2 Step * 3. @@ -314,8 +308,8 @@ public class PBKDF2Engine implements PBKDF2 { * Block-Xor. Xor source bytes into destination byte buffer. Destination * buffer must be same length or less than source buffer. * - * @param dest - * @param src + * @param dest byte array + * @param src byte array */ protected void xor(byte[] dest, byte[] src) { for (int i = 0; i < dest.length; i++) { @@ -326,9 +320,9 @@ public class PBKDF2Engine implements PBKDF2 { /** * Four-octet encoding of the integer i, most significant octet first. * - * @param dest - * @param offset - * @param i + * @param dest byte array + * @param offset Integer + * @param i Integer * * @see RFC 2898 5.2 Step * 3. 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 b7b158a0..04abaa9f 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java @@ -5,8 +5,6 @@ package fr.xephi.authme.security.pbkdf2; * Parameter data holder for PBKDF2 configuration. * *- *
* A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner *
diff --git a/src/main/java/fr/xephi/authme/settings/OtherAccounts.java b/src/main/java/fr/xephi/authme/settings/OtherAccounts.java index 063e6af6..6e2796a3 100644 --- a/src/main/java/fr/xephi/authme/settings/OtherAccounts.java +++ b/src/main/java/fr/xephi/authme/settings/OtherAccounts.java @@ -1,13 +1,13 @@ package fr.xephi.authme.settings; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + /** * @author Xephi59 * @version $Revision: 1.0 $ @@ -88,7 +88,7 @@ public class OtherAccounts extends CustomConfiguration { * * @param uuid UUID * - * @return List