mas-bandwidth / netcode

Secure client/server connections over UDP
BSD 3-Clause "New" or "Revised" License
2.43k stars 191 forks source link

Fix incorrect expected connection request packet length in error message #127

Closed dbechrd closed 2 months ago

dbechrd commented 2 months ago

Connection tokens use big nonces, which are 24 bytes. I'm not sure where the hard-coded "8" came from. Maybe stale code, or copy/paste error. The expected length used in the error message should include NETCODE_CONNECT_TOKEN_NONCE_BYTES to match the if statement.

dbechrd commented 2 months ago

@SirLynix for review, since you introduced big nonces for connect tokens.

SirLynix commented 2 months ago

Yes indeed it looks like I forgot to change this line as well, the nonce was 8bytes before my change