Skip to content

Commit

Permalink
Use empty publicKeySignature in dummy ProfileKeyFilter response
Browse files Browse the repository at this point in the history
If we send an invalid signature here (`AA==`), then the vanilla server
will throw an error while handling the LoginHelloC2S packet, even if
`enforce-secure-profile` is `false` in `server.properties`. The client
will be disconnected with the message "Invalid signature for profile
public key. Try restarting your game."

It's better to send an empty string; the server will simply ignore the
missing publicKeySignature if `enforce-secure-profile` is false.

Resolves unmojang/drasl#109.
  • Loading branch information
evan-goode committed Oct 24, 2024
1 parent cf9248b commit c30c3ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ private JSONObject makeDummyResponse() {
keyPairObj.put("privateKey", privateKeyPEM);
keyPairObj.put("publicKey", publicKeyPEM);
response.put("keyPair", keyPairObj);
response.put("publicKeySignature", "AA==");
response.put("publicKeySignatureV2", "AA==");
response.put("publicKeySignature", "");
response.put("publicKeySignatureV2", "");
response.put("expiresAt", DateTimeFormatter.ISO_INSTANT.format(expiresAt));
response.put("refreshedAfter", DateTimeFormatter.ISO_INSTANT.format(refreshedAfter));
return response;
Expand Down

0 comments on commit c30c3ee

Please sign in to comment.