summaryrefslogtreecommitdiff
path: root/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-03-03 18:37:34 +0000
committerChristian Pointner <equinox@anytun.org>2008-03-03 18:37:34 +0000
commit5680eef9744eb898ebf00df12747ef068650e8f2 (patch)
tree99d13aba44b2fc8c71b3c5d59527fde38bd1bbce /anytun.cpp
parentfixed param short code collision (diff)
bugfix @ authentication
Diffstat (limited to 'anytun.cpp')
-rw-r--r--anytun.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 0a63a01..5983962 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -123,7 +123,9 @@ void* sender(void* p)
while(1)
{
plain_packet.setLength(MAX_PACKET_LENGTH);
+ encrypted_packet.withAuthTag(false);
encrypted_packet.setLength(MAX_PACKET_LENGTH);
+
// read packet from device
u_int32_t len = param->dev.read(plain_packet.getPayload(), plain_packet.getPayloadLength());
plain_packet.setPayloadLength(len);
@@ -227,6 +229,7 @@ void* receiver(void* p)
u_int16_t remote_port;
plain_packet.setLength(MAX_PACKET_LENGTH);
+ encrypted_packet.withAuthTag(false);
encrypted_packet.setLength(MAX_PACKET_LENGTH);
// read packet from socket
@@ -248,6 +251,7 @@ void* receiver(void* p)
// check whether auth tag is ok or not
if(a->getMaxLength()) {
+ encrypted_packet.withAuthTag(true);
conn.kd_.generate(LABEL_SATP_MSG_AUTH, encrypted_packet.getSeqNr(), session_auth_key);
a->setKey(session_auth_key);
if(!a->checkTag(encrypted_packet)) {