summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-01-25 22:05:16 +0100
committerMattes D <github@xoft.cz>2014-01-25 22:05:16 +0100
commit437a9c8d1f13cc7770a95534dbf71b78685edfe7 (patch)
tree68b0e13a46f3936bb772106c0ca8d8e74aba2b8e /src/Server.cpp
parentMerge pull request #581 from worktycho/strerror (diff)
parentProtoProxy: Modified to use PolarSSL. (diff)
downloadcuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar.gz
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar.bz2
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar.lz
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar.xz
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.tar.zst
cuberite-437a9c8d1f13cc7770a95534dbf71b78685edfe7.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 34ee066cb..f64af62eb 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -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();
}