From 62c5dcfa2dd117fd7b388d13ab8f33c5867a9636 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Tue, 11 Dec 2007 12:31:46 +0000 Subject: fixed many sync things fixed warning (multiple key) --- anytun.cpp | 48 +++++++++++------------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'anytun.cpp') diff --git a/anytun.cpp b/anytun.cpp index 8ea3d75..a165534 100644 --- a/anytun.cpp +++ b/anytun.cpp @@ -66,22 +66,21 @@ struct Param ConnectionList& cl; }; +uint8_t key[] = { + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't' +}; + +uint8_t salt[] = { + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n' +}; + void createConnection(const std::string & remote_host , u_int16_t remote_port, ConnectionList & cl, u_int16_t seqSize) { SeqWindow seq(seqSize); - - uint8_t key[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't' - }; - - uint8_t salt[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n' - }; - seq_nr_t seq_nr_=0; KeyDerivation kd; // kd.init(Buffer(key, sizeof(key)), Buffer(salt, sizeof(salt))); @@ -100,18 +99,6 @@ void encryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn, void* p) // conn.kd_.generate(label_satp_encryption, conn.seq_nr_, tmp_key, tmp_key.getLength()); // conn.kd_.generate(label_satp_salt, conn.seq_nr_, tmp_salt, tmp_salt.getLength()); - - uint8_t key[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't' - }; - - uint8_t salt[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n' - }; - Buffer tmp_key(key, sizeof(key)); Buffer tmp_salt(salt, sizeof(salt)); @@ -135,19 +122,6 @@ bool decryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn) // conn.kd_.generate(label_satp_encryption, seq, tmp_key, tmp_key.getLength()); // conn.kd_.generate(label_satp_salt, seq, tmp_salt, tmp_salt.getLength()); - - - uint8_t key[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't' - }; - - uint8_t salt[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n' - }; - Buffer tmp_key(key, sizeof(key)); Buffer tmp_salt(salt, sizeof(salt)); -- cgit v1.2.3