Now using openssl on windows instead of ms crypto api. Can't stand all these handles for the crypto api, openssl will be required later anyway. MD5 sums will be used when transfering avatars for efficient caching - avatars are identified by their MD5 sum.
Sorry for making it even harder to compile on windows...
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <net/sendercallback.h>
|
||||
#include <net/receiverhelper.h>
|
||||
#include <net/socket_msg.h>
|
||||
#include <core/rand.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
|
||||
@@ -490,7 +490,12 @@ ServerLobbyThread::HandleNewConnection(boost::shared_ptr<ConnectData> connData)
|
||||
// Create a random session id.
|
||||
// This id can be used to reconnect to the server if the connection was lost.
|
||||
unsigned sessionId;
|
||||
RandomBytes((unsigned char *)&sessionId, sizeof(sessionId)); // TODO: check for collisions.
|
||||
|
||||
// TODO: check for collisions.
|
||||
if(!RAND_bytes((unsigned char *)&sessionId, sizeof(sessionId)))
|
||||
{
|
||||
RAND_pseudo_bytes((unsigned char *)&sessionId, sizeof(sessionId));
|
||||
}
|
||||
|
||||
// Create a new session.
|
||||
boost::shared_ptr<SessionData> sessionData(new SessionData(connData->ReleaseSocket(), sessionId));
|
||||
|
||||
Reference in New Issue
Block a user