aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium/limboauth
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/elytrium/limboauth')
-rw-r--r--src/main/java/net/elytrium/limboauth/Settings.java1
-rw-r--r--src/main/java/net/elytrium/limboauth/migration/MigrationHash.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java
index f584e21..bc1bae4 100644
--- a/src/main/java/net/elytrium/limboauth/Settings.java
+++ b/src/main/java/net/elytrium/limboauth/Settings.java
@@ -80,6 +80,7 @@ public class Settings extends Config {
"SHA256_P - SHA256(password) that looks like $SHA$salt$hash",
"SHA512_NP - SHA512(password) that looks like SHA$salt$hash",
"SHA512_P - SHA512(password) that looks like $SHA$salt$hash",
+ "SHA512_DBA - DBA plugin SHA512(SHA512(password) + salt) that looks like SHA$salt$hash",
"MD5 - Basic md5 hash",
"Argon2 - Argon2 hash that looks like $argon2i$v=1234$m=1234,t=1234,p=1234$hash",
})
diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
index 4f7ae24..a93f231 100644
--- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
+++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
@@ -32,6 +32,10 @@ public enum MigrationHash {
&& arr[3].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-256") + arr[2], "SHA-256"));
}),
ARGON2(new Argon2Verifier()),
+ SHA512_DBA((hash, password) -> {
+ String[] arr = hash.split("\\$"); // SHA$salt$hash
+ return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-512") + arr[1], "SHA-512"));
+ }),
SHA512_NP((hash, password) -> {
String[] arr = hash.split("\\$"); // SHA$salt$hash
return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(password + arr[1], "SHA-512"));