moved temp hard coded key out of crypto class.

This commit is contained in:
Nick Bolton 2013-04-08 13:04:20 +00:00
parent b2746bc1b2
commit 323285a931
3 changed files with 14 additions and 8 deletions

View File

@ -36,6 +36,10 @@
#include "IPlatformScreen.h"
#include "CCryptoStream.h"
// TODO: these are just for testing -- make sure they're gone by release!
const byte g_key[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const byte g_iv[] = "aaaaaaaaaaaaaaa";
//
// CClient
//
@ -149,7 +153,9 @@ CClient::connect()
m_stream = new CPacketStreamFilter(m_stream, true);
if (s_cryptoEnabled) {
m_stream = new CCryptoStream(*EVENTQUEUE, m_stream, true);
CCryptoStream* cryptoStream = new CCryptoStream(*EVENTQUEUE, m_stream, true);
cryptoStream->setKeyWithIV(g_key, sizeof(g_key), g_iv);
m_stream = cryptoStream;
}
// connect

View File

@ -30,6 +30,10 @@
#include "TMethodEventJob.h"
#include "CCryptoStream.h"
// TODO: these are just for testing -- make sure they're gone by release!
const byte g_key[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const byte g_iv[] = "aaaaaaaaaaaaaaa";
//
// CClientListener
//
@ -146,7 +150,9 @@ CClientListener::handleClientConnecting(const CEvent&, void*)
stream = new CPacketStreamFilter(stream, true);
if (s_cryptoEnabled) {
stream = new CCryptoStream(*EVENTQUEUE, stream, true);
CCryptoStream* cryptoStream = new CCryptoStream(*EVENTQUEUE, stream, true);
cryptoStream->setKeyWithIV(g_key, sizeof(g_key), g_iv);
stream = cryptoStream;
}
assert(m_server != NULL);

View File

@ -20,12 +20,6 @@
#include <sstream>
#include <string>
// TODO: these are just for testing -- make sure they're gone by release!
const byte g_key1[] = "aaaaaaaaaaaaaaa";
const byte g_key2[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const byte g_iv1[] = "aaaaaaaaaaaaaaa";
const byte g_iv2[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
using namespace CryptoPP;
CCryptoStream::CCryptoStream(IEventQueue& eventQueue, synergy::IStream* stream, bool adoptStream) :