#1188 Create and keep encryption method instance (#1191)

- Avoid creating the same object over and over; instead keep it and only change it on settings reload
This commit is contained in:
ljacqu
2017-04-30 17:41:51 +02:00
committed by Gabriele C
parent e0e4cd112d
commit c803822fa8
5 changed files with 35 additions and 48 deletions
@@ -61,10 +61,6 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<HashAlgorithm> PASSWORD_HASH =
newProperty(HashAlgorithm.class, "settings.security.passwordHash", HashAlgorithm.SHA256);
@Comment("Salt length for the SALTED2MD5 MD5(MD5(password)+salt)")
public static final Property<Integer> DOUBLE_MD5_SALT_LENGTH =
newProperty("settings.security.doubleMD5SaltLength", 8);
@Comment({
"If a password check fails, AuthMe will also try to check with the following hash methods.",
"Use this setting when you change from one hash method to another.",
@@ -75,6 +71,10 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Set<HashAlgorithm>> LEGACY_HASHES =
new EnumSetProperty<>(HashAlgorithm.class, "settings.security.legacyHashes");
@Comment("Salt length for the SALTED2MD5 MD5(MD5(password)+salt)")
public static final Property<Integer> DOUBLE_MD5_SALT_LENGTH =
newProperty("settings.security.doubleMD5SaltLength", 8);
@Comment("Number of rounds to use if passwordHash is set to PBKDF2. Default is 10000")
public static final Property<Integer> PBKDF2_NUMBER_OF_ROUNDS =
newProperty("settings.security.pbkdf2Rounds", 10000);