summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 34ee066cb..3f9f8a4ac 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -194,7 +194,7 @@ bool cServer::InitServer(cIniFile & a_SettingsIni)
m_PlayerCount = 0;
m_PlayerCountDiff = 0;
- m_FaviconData = Base64Encode(cFile::ReadWholeFile("favicon.png")); // Will return empty string if file nonexistant; client doesn't mind
+ m_FaviconData = Base64Encode(cFile::ReadWholeFile(FILE_IO_PREFIX + AString("favicon.png"))); // Will return empty string if file nonexistant; client doesn't mind
if (m_bIsConnected)
{
@@ -284,17 +284,9 @@ int cServer::GetNumPlayers(void)
void cServer::PrepareKeys(void)
{
- // TODO: Save and load key for persistence across sessions
- // But generating the key takes only a moment, do we even need that?
-
LOGD("Generating protocol encryption keypair...");
-
- time_t CurTime = time(NULL);
- CryptoPP::RandomPool rng;
- rng.Put((const byte *)&CurTime, sizeof(CurTime));
- m_PrivateKey.GenerateRandomWithKeySize(rng, 1024);
- CryptoPP::RSA::PublicKey pk(m_PrivateKey);
- m_PublicKey = pk;
+ VERIFY(m_PrivateKey.Generate(1024));
+ m_PublicKeyDER = m_PrivateKey.GetPubKeyDER();
}