diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-04-12 19:42:38 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-04-12 19:42:38 +0300 |
commit | 085dc09462c0eb84726713fb8d691a75d30b30d0 (patch) | |
tree | 64910b446afe53a4f09141424ae9670ff2394d46 /src/main/java/net | |
parent | 756c1107de7babeb37583b74b55e431f13dc0f45 (diff) | |
download | LimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.tar.gz LimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.tar.bz2 LimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.zip |
Even more migration hashes...
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/Settings.java | 2 | ||||
-rw-r--r-- | src/main/java/net/elytrium/limboauth/migration/MigrationHash.java | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java index 447d6a7..badc906 100644 --- a/src/main/java/net/elytrium/limboauth/Settings.java +++ b/src/main/java/net/elytrium/limboauth/Settings.java @@ -85,6 +85,8 @@ public class Settings extends Config { "MD5 - Basic md5 hash", "ARGON2 - Argon2 hash that looks like $argon2i$v=1234$m=1234,t=1234,p=1234$hash", "MOON_SHA256 - Moon SHA256(SHA256(password)) that looks like $SHA$hash (no salt)", + "SHA256_NO_SALT - SHA256(password) that looks like $SHA$hash (NexAuth)", + "SHA512_NO_SALT - SHA512(password) that looks like $SHA$hash (NexAuth)", }) public String MIGRATION_HASH = ""; @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 add41ca..669a82d 100644 --- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java +++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java @@ -63,6 +63,14 @@ public enum MigrationHash { MOON_SHA256((hash, password) -> { String[] arr = hash.split("\\$"); // $SHA$hash return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-256"), "SHA-256")); + }), + SHA256_NO_SALT((hash, password) -> { + String[] arr = hash.split("\\$"); // $SHA$hash + return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(password, "SHA-256")); + }), + SHA512_NO_SALT((hash, password) -> { + String[] arr = hash.split("\\$"); // $SHA$hash + return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(password, "SHA-512")); }); final MigrationHashVerifier verifier; |