crypto: avoid generating control-like packets
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 Apr 2011 15:31:26 +0000 (15:31 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 Apr 2011 15:31:26 +0000 (15:31 +0000)
commit294762940c3d8fb26989ce5fa0f8d2588d5e5a2e
tree9a826a8facd432f7d97b30385085f49e26ba1b2b
parentab196f09c6afcfa263e249640662cc9599ed7f4d
crypto: avoid generating control-like packets

In non-AES mode, we now replace packets whose hash starts with FFFFFFFF by
7FFFFFFF, and 8000LLLL by 0000LLLL. When decoding, packets with these prefixes
have two attempts.

AES encrypted mode is unaffected by this, as there packets always start with a
byte from 00 to 0F.

Also, no longer whine about receiving packets that fail the HMAC test when the
packets look like control packets (the NQ CONNECT packet DP sends when
connecting sometimes was received in time for this to match).

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11068 d7cf8633-e32d-0410-b094-e92efae38249
crypto.c