caioavidal / OpenCoreMMO

Modern MMORPG server emulator written in C#
https://opencoremmo.gitbook.io/opencoremmo/
GNU General Public License v3.0
330 stars 63 forks source link

RSA Cipher too large if other client than 8.6 (10.98 for example) #480

Closed IntinteDAO closed 1 year ago

IntinteDAO commented 1 year ago

Describe the bug Server may crash if authentication is done with another Tibia client (10.98)

To Reproduce Steps to reproduce the behavior:

  1. Set Tibia 10.98 on OTClient
  2. Try to authorize
  3. Crash

Expected behavior Error / Information about not supported version etc. Display: "Client version not supported"

Desktop (please complete the following information):

Unhandled exception. Org.BouncyCastle.Crypto.DataLengthException: input too large for RSA cipher. at Org.BouncyCastle.Crypto.Engines.RsaCoreEngine.ConvertInput(Byte[] inBuf, Int32 inOff, Int32 inLen) at Org.BouncyCastle.Crypto.Engines.RsaEngine.ProcessBlock(Byte[] inBuf, Int32 inOff, Int32 inLen) at NeoServer.Server.Security.Rsa.Decrypt(Byte[] data) in /home/fervi/Intinte/LibreTibia/Jenkinson8.6/OpenCoreMMO/src/ApplicationServer/NeoServer.Server.Security/RSA.cs:line 17 at NeoServer.Networking.Packets.Incoming.AccountLoginPacket..ctor(IReadOnlyNetworkMessage message) in /home/fervi/Intinte/LibreTibia/Jenkinson8.6/OpenCoreMMO/src/NetworkingServer/NeoServer.Networking.Packets/Incoming/AccountLoginPacket.cs:line 23 at NeoServer.Networking.Handlers.LogIn.AccountLoginHandler.HandleMessage(IReadOnlyNetworkMessage message, IConnection connection) in /home/fervi/Intinte/LibreTibia/Jenkinson8.6/OpenCoreMMO/src/NetworkingServer/NeoServer.Networking.Handlers/LogIn/AccountLoginHandler.cs:line 22 at System.Threading.Tasks.Task.<>c.b__128_1(Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback()

MarcusViniciusSS commented 1 year ago

@IntinteDAO thank you for report.

image image