Skip to content

Commit

Permalink
1.1.4: SHA512_NLOGIN migration hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hevav committed Jan 21, 2023
1 parent 208f32c commit 0cacf83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.3
1.1.4
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

setGroup("net.elytrium")
setVersion("1.1.3")
setVersion("1.1.4")

java {
setSourceCompatibility(JavaVersion.VERSION_11)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/elytrium/limboauth/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public static class MAIN {
"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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0cacf83

Please sign in to comment.