Simple Voice Chat

Simple Voice Chat

31M Downloads

BadPaddingException in every seconds after player login

XiaoHuiHui233 opened this issue ยท 3 comments

commented

Bug description
I installed and set up this mod on both the server and the client. But any player connecting to this server cannot use the voice function normally. Even worse, when a player who installs this mod on the client enters the server, the server will report a BadPaddingException every second.

I also see #242 #243 . I tried several unbind ports, but it still reports exceptions. And I am sure that no traffic from any other applications will pass through these ports.

When I check the client log I found that the mod keeps trying to authenticate voice connection. I think this is the reason why the server keeps receiving abnormal packets. So the question is why these authenticated packets will fail to be decrypted? Log details see below.

Log files
On server (it shows this content in a loop every second):

[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at javax.crypto.Cipher.doFinal(Cipher.java:2168)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at de.maxhenkel.voicechat.voice.common.AES.decrypt(AES.java:65)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at de.maxhenkel.voicechat.voice.common.NetworkMessage.readFromBytes(NetworkMessage.java:96)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at de.maxhenkel.voicechat.voice.common.NetworkMessage.readPacketServer(NetworkMessage.java:92)
[Server] [10:38:51] [VoiceChatPacketProcessingThread/INFO]: [STDERR]:   at de.maxhenkel.voicechat.voice.server.Server$ProcessThread.run(Server.java:130)

On client (it shows this content in a loop every second either):

[10:38:46] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection
[10:38:47] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection
[10:38:48] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection
[10:38:49] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection
[10:38:50] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection
[10:38:51] [VoiceChatAuthenticationThread/INFO]: Trying to authenticate voice connection

Versions

  • Minecraft version 1.16.5
  • Fabric loader 0.11.6 with api version 0.37.0
  • Mod version 1.6.4

There are some additions that may need attention:

  • BungeeCord latest with viaVersion 4.0.1 and viaBackward 4.0.1
    But even if I configure ViaVersion for cross-version login, I'm sure I'm using the 1.16.5 client login server.

Other mods
Our server is an original survival server. The only mods available on the server are the carpet, the masa series and the elements series like Lithium. After testing, this is not and should not be a conflict with any other mod.

commented

You most likely get these errors, because you are using an incompatible mod version on your client. Normally you will get kicked when trying to connect with an outdated version, but bungee prevents the login networking packets to get sent to the server.

If you have the same mod version, this issue is still not related to the error messages.
If you need help configuring and setting up the mod, please visit the discord. But the issues you are having are no bugs, you just didn't set it up correctly.

commented

I found that I was running an older version, the latest version is 1.8.9. Therefore, I updated both the client and server mods to 1.8.9. The problem still occurs, and the client still keeps trying to authenticate voice connection. The server no longer explicitly reports an exception, but prompts a warning:

[Server] [13:03:12] [VoiceChatPacketProcessingThread/WARN]: Failed to read packet from /175.0.38.128:59091
commented

In addition, I conducted some new tests, and the tests showed that when I directly connected to the server (without through BC proxy) everything was functioning normally. And when I connect to the server through BC, this problem occurs. Does this mean that the mod does not support BC group servers?