Host_LockSession(); // we use the session ID here
- SV_LockThreadMutex();
-
// load keys
// note: we are just a CLIENT
// so we load:
}
if(crypto_keyfp_recommended_length < 7)
crypto_keyfp_recommended_length = 7;
-
- SV_UnlockThreadMutex();
}
static void Crypto_UnloadKeys(void)
{
int i;
- SV_LockThreadMutex();
-
keygen_i = -1;
for(i = 0; i < MAX_PUBKEYS; ++i)
{
challenge_append_length = 0;
}
crypto_idstring = NULL;
-
- SV_UnlockThreadMutex();
}
static mempool_t *cryptomempool;
void Crypto_Init(void);
void Crypto_Init_Commands(void);
-void Crypto_LoadKeys(void);
+void Crypto_LoadKeys(void); // NOTE: when this is called, the SV_LockThreadMutex MUST be active
void Crypto_Shutdown(void);
qboolean Crypto_Available(void);
void sha256(unsigned char *out, const unsigned char *in, int n); // may ONLY be called if Crypto_Available()
int port;
NetConn_CloseClientPorts();
+ SV_LockThreadMutex(); // FIXME recursive?
Crypto_LoadKeys(); // client sockets
+ SV_UnlockThreadMutex();
port = bound(0, cl_netport.integer, 65535);
if (cl_netport.integer != port)
int port;
NetConn_CloseServerPorts();
+ SV_LockThreadMutex(); // FIXME recursive?
Crypto_LoadKeys(); // server sockets
+ CSV_UnlockThreadMutex();
NetConn_UpdateSockets();
port = bound(0, sv_netport.integer, 65535);