From c597afc9f59af4d4596068d042f467127311bfed Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 24 Feb 2008 19:10:34 +0000 Subject: added NullKeyDerivation added KeyDerivationFactory --- anytun.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'anytun.cpp') diff --git a/anytun.cpp b/anytun.cpp index 69ea165..f560428 100644 --- a/anytun.cpp +++ b/anytun.cpp @@ -46,6 +46,7 @@ #include "authTag.h" #include "cipherFactory.h" #include "authAlgoFactory.h" +#include "keyDerivationFactory.h" #include "signalController.h" #include "packetSource.h" #include "tunDevice.h" @@ -53,9 +54,6 @@ #include "seqWindow.h" #include "connectionList.h" -#include "mpi.h" // TODO: remove after debug - - #include "syncQueue.h" #include "syncSocketHandler.h" #include "syncListenSocket.h" @@ -77,6 +75,7 @@ void createConnection(const std::string & remote_host, u_int16_t remote_port, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue) { + // TODO: use key exchange for master key/salt uint8_t key[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p' @@ -89,7 +88,7 @@ void createConnection(const std::string & remote_host, u_int16_t remote_port, Co SeqWindow * seq= new SeqWindow(seqSize); seq_nr_t seq_nr_=0; - KeyDerivation * kd = new KeyDerivation; + KeyDerivation * kd = KeyDerivationFactory::create("aes-ctr"); // TODO: get value from options kd->init(Buffer(key, sizeof(key)), Buffer(salt, sizeof(salt))); cLog.msg(Log::PRIO_NOTICE) << "added connection remote host " << remote_host << ":" << remote_port; ConnectionParam connparam ( (*kd), (*seq), seq_nr_, remote_host, remote_port); @@ -312,7 +311,6 @@ void* receiver(void* p) } #define MIN_GCRYPT_VERSION "1.2.3" -//#define GCRYPT_SEC_MEM 32768 // 32k secure memory // make libgcrypt thread safe extern "C" { GCRY_THREAD_OPTION_PTHREAD_IMPL; @@ -341,7 +339,7 @@ bool initLibGCrypt() cLog.msg(Log::PRIO_NOTICE) << "initLibGCrypt: libgcrypt init finished"; return true; } - + int main(int argc, char* argv[]) { std::cout << "anytun - secure anycast tunneling protocol" << std::endl; -- cgit v1.2.3