summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--anytun.cpp10
-rw-r--r--seqWindow.cpp2
2 files changed, 7 insertions, 5 deletions
diff --git a/anytun.cpp b/anytun.cpp
index ebff073..1b69b11 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -164,9 +164,9 @@ void* sender(void* p)
plain_packet.setPayloadType(0);
// encrypt packet
- conn.kd_.generate(LABEL_SATP_ENCRYPTION, conn.seq_nr_, session_key, session_key.getLength());
- conn.kd_.generate(LABEL_SATP_SALT, conn.seq_nr_, session_salt, session_salt.getLength());
- conn.kd_.generate(LABEL_SATP_MSG_AUTH, packet.getSeqNr(), session_auth_key, session_auth_key.getLength());
+// conn.kd_.generate(LABEL_SATP_ENCRYPTION, conn.seq_nr_, session_key, session_key.getLength());
+// conn.kd_.generate(LABEL_SATP_SALT, conn.seq_nr_, session_salt, session_salt.getLength());
+// conn.kd_.generate(LABEL_SATP_MSG_AUTH, packet.getSeqNr(), session_auth_key, session_auth_key.getLength());
c->setKey(session_key);
c->setSalt(session_salt);
@@ -274,8 +274,8 @@ void* receiver(void* p)
continue;
// decrypt packet
- conn.kd_.generate(LABEL_SATP_ENCRYPTION, packet.getSeqNr(), session_key, session_key.getLength());
- conn.kd_.generate(LABEL_SATP_SALT, packet.getSeqNr(), session_salt, session_salt.getLength());
+// conn.kd_.generate(LABEL_SATP_ENCRYPTION, packet.getSeqNr(), session_key, session_key.getLength());
+// conn.kd_.generate(LABEL_SATP_SALT, packet.getSeqNr(), session_salt, session_salt.getLength());
c->setKey(session_key);
c->setSalt(session_salt);
c->decrypt(packet, plain_packet);
diff --git a/seqWindow.cpp b/seqWindow.cpp
index 20973b5..cf4cf1c 100644
--- a/seqWindow.cpp
+++ b/seqWindow.cpp
@@ -71,6 +71,8 @@ bool SeqWindow::hasSeqNr(sender_id_t sender, seq_nr_t seq)
void SeqWindow::addSeqNr(sender_id_t sender, seq_nr_t seq)
{
Lock lock(mutex_);
+ if (!window_size_)
+ return;
if(sender_[sender].size() >= window_size_)
sender_[sender].pop_front();
sender_[sender].push_back(seq);