go-mc icon indicating copy to clipboard operation
go-mc copied to clipboard

some enhancement for Mojang login

Open cs8425 opened this issue 1 year ago • 1 comments

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.

cs8425 avatar Jul 20 '22 01:07 cs8425

Thanks for the idea. It makes sense. Just do it.

Tnze avatar Jul 20 '22 02:07 Tnze

We cached keys now.

Tnze avatar Jan 06 '23 13:01 Tnze