Add a dictionary for Encryption public keys (#1862)

This commit is contained in:
lilmayofuksu
2022-10-15 17:06:37 +03:00
committed by GitHub
parent f3a5bc16a8
commit a4747abfc9
7 changed files with 17 additions and 10 deletions

View File

@@ -114,8 +114,7 @@ public class HandlerGetPlayerTokenReq extends PacketHandler {
.putLong(Crypto.ENCRYPT_SEED ^ client_seed)
.array();
//Kind of a hack, but whatever
cipher.init(Cipher.ENCRYPT_MODE, req.getKeyId() == 3 ? Crypto.CUR_OS_ENCRYPT_KEY : Crypto.CUR_CN_ENCRYPT_KEY);
cipher.init(Cipher.ENCRYPT_MODE, Crypto.EncryptionKeys.get(req.getKeyId()));
var seed_encrypted = cipher.doFinal(seed_bytes);
Signature privateSignature = Signature.getInstance("SHA256withRSA");