summaryrefslogtreecommitdiff
path: root/anytun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'anytun.cpp')
-rw-r--r--anytun.cpp48
1 files changed, 11 insertions, 37 deletions
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));