diff options
author | Erwin Nindl <nine@wirdorange.org> | 2007-12-11 14:23:53 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2007-12-11 14:23:53 +0000 |
commit | 823af1bc3a10e1df0b3d86856dfcd652d5d6b881 (patch) | |
tree | 4960f160029ce5d2a850cc555518e3a9af9eede5 /anytun.cpp | |
parent | fixed sync crash, when no active connections (diff) |
recever gets seq and sid now
Diffstat (limited to 'anytun.cpp')
-rw-r--r-- | anytun.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -106,7 +106,7 @@ void encryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn, void* p) c.setSalt(tmp_salt); cLog.msg(Log::PRIO_NOTICE) << "Send Package: seq: " << conn.seq_nr_ - << "sID: " << param->opt.getSenderId(); + << ", sID: " << param->opt.getSenderId(); //cLog.msg(Log::PRIO_NOTICE) << "Package dump: " << pack.getHexDump(); c.cypher(pack, conn.seq_nr_, param->opt.getSenderId()); @@ -117,6 +117,8 @@ bool decryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn) u_int16_t sid = pack.getSenderId(); u_int16_t seq = pack.getSeqNr(); + pack.removeHeader(); + // decypher the packet //Buffer tmp_key(16), tmp_salt(14); // conn.kd_.generate(label_satp_encryption, seq, tmp_key, tmp_key.getLength()); @@ -125,7 +127,6 @@ bool decryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn) Buffer tmp_key(key, sizeof(key)); Buffer tmp_salt(salt, sizeof(salt)); - c.setKey(tmp_key); c.setSalt(tmp_salt); c.cypher(pack, seq, sid); @@ -281,7 +282,6 @@ void* receiver(void* p) //Replay Protection //if (!checkPacketSeqNr(pack,conn)) // continue; - pack.removeHeader(); if (!decryptPacket(pack, c, conn)) continue; |