From 3ae9918192308c7d8ff691ca6a09b54aa14f68ff Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 15 Jan 2009 13:44:22 +0000 Subject: auth algo now stores direction as well --- src/anytun.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/anytun.cpp') diff --git a/src/anytun.cpp b/src/anytun.cpp index c94a260..c4339dc 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -153,7 +153,7 @@ void sender(void* p) ThreadParam* param = reinterpret_cast(p); std::auto_ptr c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND)); - std::auto_ptr a(AuthAlgoFactory::create(gOpt.getAuthAlgo()) ); + std::auto_ptr a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_OUTBOUND) ); PlainPacket plain_packet(MAX_PACKET_LENGTH); EncryptedPacket encrypted_packet(MAX_PACKET_LENGTH); @@ -213,7 +213,7 @@ void sender(void* p) conn.seq_nr_++; // add authentication tag - a->generate(conn.kd_, KD_OUTBOUND, encrypted_packet); + a->generate(conn.kd_, encrypted_packet); try { @@ -242,7 +242,7 @@ void receiver(void* p) ThreadParam* param = reinterpret_cast(p); std::auto_ptr c( CipherFactory::create(gOpt.getCipher(), KD_INBOUND) ); - std::auto_ptr a( AuthAlgoFactory::create(gOpt.getAuthAlgo()) ); + std::auto_ptr a( AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_INBOUND) ); EncryptedPacket encrypted_packet(MAX_PACKET_LENGTH); PlainPacket plain_packet(MAX_PACKET_LENGTH); @@ -273,7 +273,7 @@ void receiver(void* p) ConnectionParam & conn = cit->second; // check whether auth tag is ok or not - if(!a->checkTag(conn.kd_, KD_INBOUND, encrypted_packet)) { + if(!a->checkTag(conn.kd_, encrypted_packet)) { cLog.msg(Log::PRIO_NOTICE) << "wrong Authentication Tag!" << std::endl; continue; } -- cgit v1.2.3