{
int wantserverid = -1;
Crypto_RetrieveHostKey(&cls.connect_address, &wantserverid, NULL, 0, NULL, 0, NULL);
- if(!crypto || !crypto->authenticated)
+ //if(!crypto || !crypto->authenticated)
{
if(wantserverid >= 0)
return Crypto_ClientError(data_out, len_out, "Server tried an unauthenticated connection even though a host key is present");
}
return CRYPTO_NOMATCH;
}
- else if (len_in >= 1 && string[0] == 'j' && cls.connect_trying && d0_rijndael_dll && crypto_aeslevel.integer >= 3)
+ else if (len_in >= 1 && string[0] == 'j' && cls.connect_trying && d0_rijndael_dll)
{
int wantserverid = -1;
Crypto_RetrieveHostKey(&cls.connect_address, &wantserverid, NULL, 0, NULL, 0, NULL);
- if(!crypto || !crypto->authenticated)
+ //if(!crypto || !crypto->authenticated)
+ {
+ if(wantserverid >= 0)
+ return Crypto_ClientError(data_out, len_out, "Server tried an unauthenticated connection even though a host key is present");
+ if(crypto_aeslevel.integer >= 3)
+ return Crypto_ClientError(data_out, len_out, "This server requires encryption to be not required (crypto_aeslevel <= 2)");
+ }
+ return CRYPTO_NOMATCH;
+ }
+ else if (len_in >= 5 && BuffLittleLong((unsigned char *) string) == ((int)NETFLAG_CTL | (int)len_in))
+ {
+ int wantserverid = -1;
+
+ // these three are harmless
+ if(string[4] == CCREP_SERVER_INFO)
+ return CRYPTO_NOMATCH;
+ if(string[4] == CCREP_PLAYER_INFO)
+ return CRYPTO_NOMATCH;
+ if(string[4] == CCREP_RULE_INFO)
+ return CRYPTO_NOMATCH;
+
+ Crypto_RetrieveHostKey(&cls.connect_address, &wantserverid, NULL, 0, NULL, 0, NULL);
+ //if(!crypto || !crypto->authenticated)
{
if(wantserverid >= 0)
return Crypto_ClientError(data_out, len_out, "Server tried an unauthenticated connection even though a host key is present");
static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *data, int length, lhnetaddress_t *peeraddress)
{
qboolean fromserver;
- int ret, c, control;
+ int ret, c;
const char *s;
char *string, addressstring2[128], ipstring[32];
char stringbuf[16384];
return ret;
}
// netquake control packets, supported for compatibility only
- if (length >= 5 && (control = BuffBigLong(data)) && (control & (~NETFLAG_LENGTH_MASK)) == (int)NETFLAG_CTL && (control & NETFLAG_LENGTH_MASK) == length && !ENCRYPTION_REQUIRED)
+ if (length >= 5 && BuffBigLong(data) == ((int)NETFLAG_CTL | length) && !ENCRYPTION_REQUIRED)
{
int n;
serverlist_info_t *info;