From 24567dac5495765904ac8bc2462fcc8e81db81c5 Mon Sep 17 00:00:00 2001 From: "Dylan T." Date: Fri, 3 Oct 2025 23:32:51 +0100 Subject: [PATCH 1/2] CONTRIBUTING: maybe this makes this huge doc slightly less scary? lol This thing should probably be restructured. It's way too long --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 799c9d99c..f34245e8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,6 +85,13 @@ Note that there might be a long wait time before a reviewer looks at your PR. Depending on the changes, maintainers might ask you to make changes to the PR to fix problems or to improve the code. **Do not delete your fork** while your pull request remains open, otherwise you won't be able to make any requested changes and the PR will end up being declined. +> [!TIP] +> Don't worry about getting a PR perfect on the first try. +> In fact, it's quite unusual for a PR to be perfect when it's first submitted, and most PRs will get changes requested by reviewers, even when the PR is made by one of our team members. +> +> Mistakes are normal, and PMMP team members will review your code and suggest changes to your code as needed. +> Just make sure to stick with it so you can communicate with reviewers and/or make changes. + ### Requirements The following are required as a minimum for pull requests. PRs that don't meet these requirements will be declined unless updated to meet them. From 05a71d8cc5185aa9e46ef5f9754bb862464c13e0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 4 Oct 2025 12:48:29 +0100 Subject: [PATCH 2/2] PrepareEncryptionTask: verify client key before entering task this ensures that whoever's giving invalid keys to the task gets properly blamed --- src/network/mcpe/encryption/PrepareEncryptionTask.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/mcpe/encryption/PrepareEncryptionTask.php b/src/network/mcpe/encryption/PrepareEncryptionTask.php index 5c982bad0..5167b7aea 100644 --- a/src/network/mcpe/encryption/PrepareEncryptionTask.php +++ b/src/network/mcpe/encryption/PrepareEncryptionTask.php @@ -51,6 +51,9 @@ class PrepareEncryptionTask extends AsyncTask{ private string $clientPub, \Closure $onCompletion ){ + //make sure the key is valid before we break the stack trace + //TODO: maybe in the future we should require OpenSSLAsymmetricKey here instead of string + JwtUtils::parseDerPublicKey($this->clientPub); if(self::$SERVER_PRIVATE_KEY === null){ $serverPrivateKey = openssl_pkey_new(["ec" => ["curve_name" => "secp384r1"]]); if($serverPrivateKey === false){