summaryrefslogtreecommitdiffstats
path: root/source/cServer.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-04 12:17:27 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-04 12:17:27 +0200
commit49f682883437d85ae2a59eeec221912df698c7b1 (patch)
treece61dc8cb31b62978204b8d42ee7e5d6573d5cb3 /source/cServer.cpp
parentProtocol proxy now decrypts the data (but doesn't understand the packets yet) (diff)
downloadcuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar.gz
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar.bz2
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar.lz
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar.xz
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.tar.zst
cuberite-49f682883437d85ae2a59eeec221912df698c7b1.zip
Diffstat (limited to '')
-rw-r--r--source/cServer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/cServer.cpp b/source/cServer.cpp
index 157de2388..b294842b7 100644
--- a/source/cServer.cpp
+++ b/source/cServer.cpp
@@ -291,7 +291,10 @@ void cServer::PrepareKeys(void)
// But generating the key takes only a moment, do we even need that?
LOG("Generating protocol encryption keypair...");
- CryptoPP::AutoSeededRandomPool rng;
+
+ 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;