Move lobby encryption code to third_party/encryption and add tests. Fixes #2308

This was SVN commit r14595.
This commit is contained in:
JoshuaJB
2014-01-17 20:14:41 +00:00
parent d80967111d
commit 32258b2ba3
9 changed files with 186 additions and 6 deletions
+4 -4
View File
@@ -22,8 +22,8 @@
#include "gui/GUIManager.h"
#include "lib/utf8.h"
#include "lobby/IXmppClient.h"
#include "lobby/pkcs5_pbkdf2.h"
#include "lobby/sha.h"
#include "third_party/encryption/pkcs5_pbkdf2.h"
#include "third_party/encryption/sha.h"
#include "scriptinterface/ScriptInterface.h"
@@ -246,8 +246,8 @@ std::string JSI_Lobby::EncryptPassword(const std::string& password, const std::s
char hex[2 * DIGESTSIZE];
for (int i = 0; i < DIGESTSIZE; ++i)
{
hex[i*2] = base16[encrypted[i] >> 4]; // 4 high bits
hex[i*2 + 1] = base16[encrypted[i] & 0x0F];// 4 low bits
hex[i*2] = base16[encrypted[i] >> 4]; // 4 high bits
hex[i*2 + 1] = base16[encrypted[i] & 0x0F]; // 4 low bits
}
return std::string(hex, sizeof(hex));
}