diff options
author | Petr Ilin <hevav@hevav.dev> | 2023-01-21 07:57:23 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2023-01-21 07:57:23 +0300 |
commit | 0cacf83f84c88d018670c508a6d886166bd8af83 (patch) | |
tree | 4ff1ce51bae752b0de244d96ca3b29b4a1abfb9a | |
parent | 208f32c795852e1885d337c947af62ed44668c0e (diff) | |
download | LimboAuth-0cacf83f84c88d018670c508a6d886166bd8af83.tar.gz LimboAuth-0cacf83f84c88d018670c508a6d886166bd8af83.tar.bz2 LimboAuth-0cacf83f84c88d018670c508a6d886166bd8af83.zip |
1.1.4: SHA512_NLOGIN migration hash
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | src/main/java/net/elytrium/limboauth/Settings.java | 1 | ||||
-rw-r--r-- | src/main/java/net/elytrium/limboauth/migration/MigrationHash.java | 4 |
4 files changed, 7 insertions, 2 deletions
@@ -1 +1 @@ -1.1.3 +1.1.4 diff --git a/build.gradle b/build.gradle index ce179a4..aec7f92 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { } setGroup("net.elytrium") -setVersion("1.1.3") +setVersion("1.1.4") java { setSourceCompatibility(JavaVersion.VERSION_11) diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java index 15e7db0..96687ca 100644 --- a/src/main/java/net/elytrium/limboauth/Settings.java +++ b/src/main/java/net/elytrium/limboauth/Settings.java @@ -122,6 +122,7 @@ public class Settings extends YamlConfig { "SHA256_NO_SALT - SHA256(password) that looks like $SHA$hash (NexAuth)", "SHA512_NO_SALT - SHA512(password) that looks like $SHA$hash (NexAuth)", "SHA512_P_REVERSED_HASH - SHA512(password) that looks like $SHA$hash$salt (nLogin)", + "SHA512_NLOGIN - SHA512(SHA512(password) + salt) that looks like $SHA$hash$salt (nLogin)", }) public MigrationHash MIGRATION_HASH = MigrationHash.AUTHME; @Comment("Available dimensions: OVERWORLD, NETHER, THE_END") diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java index caa4e5f..31949b0 100644 --- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java +++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java @@ -73,6 +73,10 @@ public enum MigrationHash { SHA512_P_REVERSED_HASH((hash, password) -> { String[] args = hash.split("\\$"); // $SHA$hash$salt return args.length == 4 && args[2].equals(getDigest(password + args[3], "SHA-512")); + }), + SHA512_NLOGIN((hash, password) -> { + String[] args = hash.split("\\$"); // $SHA$hash$salt + return args.length == 4 && args[2].equals(getDigest(getDigest(password, "SHA-512") + args[3], "SHA-512")); }); private final MigrationHashVerifier verifier; |