go-mc
go-mc copied to clipboard
some enhancement for Mojang login
Is your feature request related to a problem? Please describe.
Should we cache or reuse RSA key in auth.Encrypt()
?
Currently the RSA keypair will regenerate when a client try to join,
this will need lot of entropy and will slow down the speed when player join.
https://github.com/Tnze/go-mc/blob/2d6dd8c40823ca1fdf2157e363ac6ffff5b50917/server/auth/auth.go#L30-L41
And maybe add a option for prevent-proxy-connections: true
:
https://github.com/Tnze/go-mc/blob/2d6dd8c40823ca1fdf2157e363ac6ffff5b50917/server/auth/auth.go#L149-L165
Describe the solution you'd like Some option/method cache/reuse RSA keypair, and may need regenerate/update when needed.
for prevent-proxy-connections: true
, need a option and add the ip field in request.
see: https://wiki.vg/Protocol_Encryption#Server
Describe alternatives you've considered no
Additional context Maybe I will make a PR to for this.
Thanks for the idea. It makes sense. Just do it.
We cached keys now.