SteamKit icon indicating copy to clipboard operation
SteamKit copied to clipboard

Silent exceptions in TcpConnection

Open xPaw opened this issue 4 years ago • 1 comments

Specifically here: https://github.com/SteamRE/SteamKit/blob/12d90d60ba613c2c7139662252ae9980eb959a62/SteamKit2/SteamKit2/Networking/Steam3/TcpConnection.cs#L255-L262

I'm trying NET6 preview 6, and for whatever reason it's throwing here:

NetFilterEncryptionWithHMAC Unable to decrypt incoming packet: NetFilterEncryption was unable to decrypt packet: HMAC from server did not match computed HMAC.
TcpConnection Unexpected exception propogated back to NetLoop: System.IO.IOException: Unable to decrypt incoming packet
 ---> System.Security.Cryptography.CryptographicException: NetFilterEncryption was unable to decrypt packet: HMAC from server did not match computed HMAC.

The problem is that this exception is being hidden by TcpConnection and only visible in DebugLog. Should it be rethrown/not caught?

xPaw avatar Jul 22 '21 15:07 xPaw

Since EnvelopeEncryptedConnection is already responsible for shutting down connections based on the connection setup state, and is directly responsible for calling ProcessIncoming, it should probably also catch this IOException (or a subclass of it) and abort the connection.

https://github.com/SteamRE/SteamKit/blob/12d90d60ba613c2c7139662252ae9980eb959a62/SteamKit2/SteamKit2/Networking/Steam3/EnvelopeEncryptedConnection.cs#L70-L77

azuisleet avatar Jul 22 '21 21:07 azuisleet