summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-01-15 13:44:22 +0000
committerChristian Pointner <equinox@anytun.org>2009-01-15 13:44:22 +0000
commit3ae9918192308c7d8ff691ca6a09b54aa14f68ff (patch)
treef36f81bf8f3dc6f238b8432aec1a264529ffd92b /src/anytun.cpp
parentcipher now stores kd direction (diff)
auth algo now stores direction as well
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp8
1 files changed, 4 insertions, 4 deletions
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<ThreadParam*>(p);
std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND));
- std::auto_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo()) );
+ std::auto_ptr<AuthAlgo> 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<ThreadParam*>(p);
std::auto_ptr<Cipher> c( CipherFactory::create(gOpt.getCipher(), KD_INBOUND) );
- std::auto_ptr<AuthAlgo> a( AuthAlgoFactory::create(gOpt.getAuthAlgo()) );
+ std::auto_ptr<AuthAlgo> 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;
}