Commit Graph

37 Commits

Author SHA1 Message Date
489a7ba365 Merge branch 'legacy/pm4' into stable 2023-07-14 13:03:14 +01:00
4e646d19a4 Harden login EC key validation 2023-07-14 11:55:47 +01:00
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
31465525e3 Fixed PHP-CS-Fixer not import global constants. (#5449) 2022-12-12 17:12:33 +00:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
df3a69dcb7 Modernize private property declarations in Threaded classes
I previously avoided this due to being unsure of the effects; however, it's clear that we already use typed properties on Threaded things in other places anyway, and the only known issues are with uninit properties, and arrays.
2022-05-17 22:42:18 +01:00
6eac2ea7a5 Modernize private property declarations in src/network 2022-05-17 21:22:33 +01:00
7ddd547190 Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-06 23:55:52 +00:00
2a4111868c Fixed incorrect doc for EncryptionContext (#4791)
* Fixed incorrect doc for EncryptionContext

* Update src/network/mcpe/encryption/EncryptionContext.php

Co-authored-by: Dylan T <odigiman@gmail.com>
2022-02-02 13:12:33 +00:00
1ab285f573 PrepareEncryptionTask: remove usage of no-op function 2021-12-16 18:47:50 +00:00
889d048ca3 Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
2b5667a56b Move PHP minimum to 8.0 2021-07-26 20:29:39 +01:00
09eac0e129 Merge remote-tracking branch 'origin/stable' 2021-07-26 20:14:33 +01:00
f89e10e684 Silence openssl_free_key() deprecation warnings on 8.0
we don't give a shit and these calls are currently needed for 7.4.
2021-07-23 16:30:22 +01:00
0eb4231b51 Use OpenSSL for ECDH during client login, drop mdanter/ecc (#4328)
This brings a significant performance improvement to login sequence handling, reducing CPU cost of `PrepareEncryptionTask` by over 90% and `ProcessLoginTask` by over 60%. It also allows us to shed a dependency.
2021-07-22 23:04:00 +01:00
04a6e89d6f Change encryption to use CTR instead of GCM
despite MCPE claiming to use GCM, it omits the auth tag, which defeats the whole point of using GCM.
CTR can be used instead, with the final 4 bytes of the IV being 0002.
2021-06-13 21:57:23 +01:00
0df2677464 EncryptionContext: Allow passing encryption algo as a constructor parameter 2021-06-13 19:57:48 +01:00
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
e23379c34b EncryptionContext: provide the packet ID in the exception message 2020-11-10 14:45:19 +00:00
222399d178 EncryptionContext: fix exception message 2020-06-18 11:52:05 +01:00
95114dcc1e EncryptionContext: fixed a phpstan level 7 error (openssl_digest() might return false for god knows what reason) 2020-06-18 11:50:43 +01:00
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
d7eb4f9651 Extract more general-purpose logic to JwtUtils
this code could now be reused for creating custom login packets.
2020-05-13 20:46:01 +01:00
ed757c7207 consolidate some JWT handling into one class 2020-05-06 21:32:22 +01:00
e392a6a807 PrepareEncryptionTask: do not store onCompletion as a field
pthreads will screw around with it and make it do things it's not supposed to, which is the exact reason why we have thread-local storage to begin with.
2020-05-06 13:32:18 +01:00
ff53ddd3ad PrepareEncryptionTask: fix wrongly-specified nullability of serverPrivateKey 2020-05-06 13:29:58 +01:00
0397204c68 network/mcpe: imports cleanup 2020-04-27 12:56:28 +01:00
b2636161f7 PrepareEncryptionTask: move a bunch of stuff out of the AsyncTask class 2020-04-23 16:27:49 +01:00
dd37d286f0 use a dedicated exception class for throwing exceptions on decrypt failure 2020-04-22 09:40:26 +01:00
3d3a487422 PrepareEncryptionTask: remove cyclic dependency on NetworkSession 2020-04-18 11:25:29 +01:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
aba71762e9 master-specific @var annotations 2020-01-09 17:50:01 +00:00
4651bcf8c3 master: imports cleanup
it was easier to make an empty merge and re-run php-cs-fixer afterwards.
2019-12-11 23:23:03 +00:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00