summaryrefslogtreecommitdiffstats
path: root/Tools/ProtoProxy/Server.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-25 19:19:37 +0100
committermadmaxoft <github@xoft.cz>2014-01-25 19:19:37 +0100
commit8f1890e877467bd458910e4b7e5d8dcaceb25854 (patch)
tree52c1423f766626dd94bfb948e1f14c480c529313 /Tools/ProtoProxy/Server.cpp
parentAdded RSA encryption to crypto wrappers. (diff)
downloadcuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar.gz
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar.bz2
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar.lz
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar.xz
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.tar.zst
cuberite-8f1890e877467bd458910e4b7e5d8dcaceb25854.zip
Diffstat (limited to '')
-rw-r--r--Tools/ProtoProxy/Server.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Tools/ProtoProxy/Server.cpp b/Tools/ProtoProxy/Server.cpp
index 71b5ecb94..bb042b259 100644
--- a/Tools/ProtoProxy/Server.cpp
+++ b/Tools/ProtoProxy/Server.cpp
@@ -34,12 +34,8 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort)
#endif // _WIN32
printf("Generating protocol encryption keypair...\n");
- time_t CurTime = time(NULL);
- RandomPool rng;
- rng.Put((const byte *)&CurTime, sizeof(CurTime));
- m_PrivateKey.GenerateRandomWithKeySize(rng, 1024);
- RSA::PublicKey pk(m_PrivateKey);
- m_PublicKey = pk;
+ m_PrivateKey.Generate();
+ m_PublicKeyDER = m_PrivateKey.GetPubKeyDER();
m_ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
sockaddr_in local;