diff options
author | madmaxoft <github@xoft.cz> | 2014-01-23 23:35:23 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-01-23 23:35:23 +0100 |
commit | 5f34c78091a7c884a9c27c0f0691cd1f03174dfe (patch) | |
tree | 0162e472332c09c3841bd46656ae8b2ec7f87b0e /src/Server.cpp | |
parent | Fixed a bug in LeakFinder. (diff) | |
download | cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar.gz cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar.bz2 cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar.lz cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar.xz cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.tar.zst cuberite-5f34c78091a7c884a9c27c0f0691cd1f03174dfe.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Server.cpp | 12 |
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(); } |