diff --git a/src/Cedar/Connection.c b/src/Cedar/Connection.c index 772463a8..fd063244 100644 --- a/src/Cedar/Connection.c +++ b/src/Cedar/Connection.c @@ -1171,7 +1171,7 @@ void ConnectionSend(CONNECTION *c, UINT64 now) UINT j; QUEUE *q; - if (s->UdpAccel != NULL) + if (s != NULL && s->UdpAccel != NULL) { UdpAccelSetTick(s->UdpAccel, now); } @@ -2857,34 +2857,6 @@ TCPSOCK *NewTcpSock(SOCK *s) return ts; } -// Set a encryption key for the TCP socket -void InitTcpSockRc4Key(TCPSOCK *ts, bool server_mode) -{ - RC4_KEY_PAIR *pair; - CRYPT *c1, *c2; - // Validate arguments - if (ts == NULL) - { - return; - } - - pair = &ts->Rc4KeyPair; - - c1 = NewCrypt(pair->ClientToServerKey, sizeof(pair->ClientToServerKey)); - c2 = NewCrypt(pair->ServerToClientKey, sizeof(pair->ServerToClientKey)); - - if (server_mode) - { - ts->RecvKey = c1; - ts->SendKey = c2; - } - else - { - ts->SendKey = c1; - ts->RecvKey = c2; - } -} - // Release of TCP socket void FreeTcpSock(TCPSOCK *ts) { diff --git a/src/Cedar/Connection.h b/src/Cedar/Connection.h index 1c95e088..2b2c570c 100644 --- a/src/Cedar/Connection.h +++ b/src/Cedar/Connection.h @@ -351,7 +351,6 @@ void DisconnectUDPSockets(CONNECTION *c); void PutUDPPacketData(CONNECTION *c, void *data, UINT size); void SendDataWithUDP(SOCK *s, CONNECTION *c); void InsertReceivedBlockToQueue(CONNECTION *c, BLOCK *block, bool no_lock); -void InitTcpSockRc4Key(TCPSOCK *ts, bool server_mode); UINT TcpSockRecv(SESSION *s, TCPSOCK *ts, void *data, UINT size); UINT TcpSockSend(SESSION *s, TCPSOCK *ts, void *data, UINT size); void WriteSendFifo(SESSION *s, TCPSOCK *ts, void *data, UINT size);