Document origin of signing keys

This commit is contained in:
games647
2022-06-18 15:55:45 +02:00
parent dac5cd7639
commit 0f17fe18f9

View File

@ -153,6 +153,7 @@ class EncryptionUtil {
}
Signature verifier = Signature.getInstance("SHA1withRSA");
// key of the signer
verifier.initVerify(mojangSessionKey);
verifier.update(toSignable(clientKey).getBytes(StandardCharsets.US_ASCII));
return verifier.verify(clientKey.getSignature());
@ -161,6 +162,7 @@ class EncryptionUtil {
public static boolean verifySignedNonce(byte[] nonce, PublicKey clientKey, long signatureSalt, byte[] signature)
throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
Signature verifier = Signature.getInstance("SHA256withRSA");
// key of the signer
verifier.initVerify(clientKey);
verifier.update(nonce);