20 Commits

Author SHA1 Message Date
Dylan K. Taylor
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
Dylan K. Taylor
0df2677464
EncryptionContext: Allow passing encryption algo as a constructor parameter 2021-06-13 19:57:48 +01:00
Dylan K. Taylor
1e6d97a157
Merge branch 'stable' 2021-04-07 21:25:39 +01:00
Dylan K. Taylor
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
Dylan K. Taylor
e23379c34b EncryptionContext: provide the packet ID in the exception message 2020-11-10 14:45:19 +00:00
Dylan K. Taylor
222399d178 EncryptionContext: fix exception message 2020-06-18 11:52:05 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
ed757c7207 consolidate some JWT handling into one class 2020-05-06 21:32:22 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
ff53ddd3ad PrepareEncryptionTask: fix wrongly-specified nullability of serverPrivateKey 2020-05-06 13:29:58 +01:00
Dylan K. Taylor
0397204c68 network/mcpe: imports cleanup 2020-04-27 12:56:28 +01:00
Dylan K. Taylor
b2636161f7 PrepareEncryptionTask: move a bunch of stuff out of the AsyncTask class 2020-04-23 16:27:49 +01:00
Dylan K. Taylor
dd37d286f0 use a dedicated exception class for throwing exceptions on decrypt failure 2020-04-22 09:40:26 +01:00
Dylan K. Taylor
3d3a487422 PrepareEncryptionTask: remove cyclic dependency on NetworkSession 2020-04-18 11:25:29 +01:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
aba71762e9 master-specific @var annotations 2020-01-09 17:50:01 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00