don't use crypt directly
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "NetworkSyncManager.h"
|
#include "NetworkSyncManager.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
#include "crypto/CryptMD5.h"
|
|
||||||
#include "LocalizedString.h"
|
#include "LocalizedString.h"
|
||||||
|
|
||||||
NetworkSyncManager *NSMAN;
|
NetworkSyncManager *NSMAN;
|
||||||
@@ -41,6 +40,7 @@ void NetworkSyncManager::GetListOfLANServers( vector<NetServerInfo>& AllServers
|
|||||||
#include "GameManager.h"
|
#include "GameManager.h"
|
||||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||||
#include "PlayerState.h"
|
#include "PlayerState.h"
|
||||||
|
#include "CryptManager.h"
|
||||||
|
|
||||||
AutoScreenMessage( SM_AddToChat )
|
AutoScreenMessage( SM_AddToChat )
|
||||||
AutoScreenMessage( SM_ChangeSong );
|
AutoScreenMessage( SM_ChangeSong );
|
||||||
@@ -830,22 +830,10 @@ RString NetworkSyncManager::MD5Hex( const RString &sInput )
|
|||||||
RString HashedName;
|
RString HashedName;
|
||||||
RString PreHashedName;
|
RString PreHashedName;
|
||||||
|
|
||||||
unsigned char Output[16];
|
RString sOutput = CryptManager::GetMD5ForString( sInput );
|
||||||
const unsigned char *Input = (unsigned char *)sInput.c_str();
|
|
||||||
|
|
||||||
MD5Context BASE;
|
|
||||||
|
|
||||||
memset(&BASE,0,sizeof(MD5Context));
|
|
||||||
memset(&Output,0,16);
|
|
||||||
|
|
||||||
MD5Init( &BASE );
|
|
||||||
|
|
||||||
MD5Update( &BASE, Input, sInput.length());
|
|
||||||
|
|
||||||
MD5Final( Output, &BASE );
|
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
PreHashedName += ssprintf( "%2X", Output[i] );
|
PreHashedName += ssprintf( "%2X", sOutput[i] );
|
||||||
|
|
||||||
//XXX: Yuck. Convert spaces to 0's better. (will fix soon)
|
//XXX: Yuck. Convert spaces to 0's better. (will fix soon)
|
||||||
for (int i = 0; i < 32; i++)
|
for (int i = 0; i < 32; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user