mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-08 09:02:53 +08:00
fix(auth): Skip further decryption if encrypted password fails to decrypt
this should only occur if the wrong RSA key is used on the client, otherwise the patch probably forgot to set `is_crypto` to false
This commit is contained in:
parent
446e994ff0
commit
4ced11d567
@ -112,8 +112,14 @@ public final class DefaultAuthenticators {
|
|||||||
cipher.doFinal(Utils.base64Decode(request.getPasswordRequest().password)),
|
cipher.doFinal(Utils.base64Decode(request.getPasswordRequest().password)),
|
||||||
StandardCharsets.UTF_8);
|
StandardCharsets.UTF_8);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
|
if (requestData.is_crypto) {
|
||||||
|
response.retcode = -201;
|
||||||
|
response.message = translate("messages.dispatch.account.password_crypto_error");
|
||||||
|
return response;
|
||||||
|
} else {
|
||||||
decryptedPassword = request.getPasswordRequest().password;
|
decryptedPassword = request.getPasswordRequest().password;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (decryptedPassword == null) {
|
if (decryptedPassword == null) {
|
||||||
successfulLogin = false;
|
successfulLogin = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user