No Chat Reports

No Chat Reports

43M Downloads

Client leaves server when encrypting long messages

festino opened this issue ยท 0 comments

commented

Modloader

Fabric

Minecraft Version

1.20.1

Modloader Version

Fabric: Loader 0.14.21 + API 0.83.1

No Chat Reports Version

1.20.1-v2.2.2

Modpack Info

No response

The latest.log File

https://gist.github.com/festino/885c98c1af71d2ae8aaca3703b19ff43

Bug Description

If the encrypted message length exceeds 256, the message is not sent to the server and the client leaves the server, displaying an error like
io.netty.handler.codec.EncoderException: String too big (was 268 characters, max 256)

On 1.19.3 (NCR v 2.0.0, Fabric Loader 0.14.22 + API 0.76.0) the bug is also reproduced.
On 1.19.2 (NCR v1.13.11, Fabric Loader 0.14.9 + API 0.60.0) the message is truncated so that the length does not exceed 256 after encryption. But sometimes <?> character appears at the end of decrypted message (as I understand it, for characters that are encoded with 2+ bytes).

Steps to Reproduce

  1. Join Vanilla or Spigot 1.20.1 server (singleplayer will not do, even open to LAN)
  2. Open chat
  3. Enable AES/CFB8 or AES/GCM or AES/ECB encryption with "TestTestTestTestTestTe" encryption key
  4. Send message "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"

Other Information

The client checks for the number of characters, not bytes. For example, 256 cyrillic characters can be sent, and they take up 512 bytes.