aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2022-04-12 19:42:38 +0300
committerPetr Ilin <hevav@hevav.dev>2022-04-12 19:42:38 +0300
commit085dc09462c0eb84726713fb8d691a75d30b30d0 (patch)
tree64910b446afe53a4f09141424ae9670ff2394d46 /src/main
parent756c1107de7babeb37583b74b55e431f13dc0f45 (diff)
downloadLimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.tar.gz
LimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.tar.bz2
LimboAuth-085dc09462c0eb84726713fb8d691a75d30b30d0.zip
Even more migration hashes...
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/elytrium/limboauth/Settings.java2
-rw-r--r--src/main/java/net/elytrium/limboauth/migration/MigrationHash.java8
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;