mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] DoubleDigestPasswordVerifier
This commit is contained in:
parent
b09cd5c456
commit
5abc456c3b
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -16,7 +17,8 @@ public class DoubleDigestPasswordVerifier extends PasswordVerifier {
|
|||
|
||||
private byte[] digest(String text) throws NoSuchAlgorithmException {
|
||||
MessageDigest digest = MessageDigest.getInstance(algo);
|
||||
byte[] firstDigest = digest.digest();
|
||||
byte[] firstDigest = digest.digest(text.getBytes(StandardCharsets.UTF_8));
|
||||
LogHelper.info("HEX %s", SecurityHelper.toHex(firstDigest));
|
||||
return toHexMode ? digest.digest(SecurityHelper.toHex(firstDigest).getBytes(StandardCharsets.UTF_8)) : digest.digest(firstDigest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue