From c01ff56f61b28d0a909f46b95182b5a26aaa6cd3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 4 Feb 2008 20:34:37 +0000 Subject: fixed bug @ sync key gets updatet @ sync --- connectionList.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'connectionList.cpp') diff --git a/connectionList.cpp b/connectionList.cpp index 3b1c528..f4d9cde 100644 --- a/connectionList.cpp +++ b/connectionList.cpp @@ -69,12 +69,25 @@ const ConnectionMap::iterator ConnectionList::getConnection(u_int16_t mux) ConnectionParam & ConnectionList::getOrNewConnection(u_int16_t mux) { Lock lock(mutex_); + ConnectionMap::iterator it = connections_.find(mux); if(it!=connections_.end()) return it->second; + + uint8_t key[] = { + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p' + }; + + uint8_t salt[] = { + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n' + }; + SeqWindow * seq= new SeqWindow(0); seq_nr_t seq_nr_=0; KeyDerivation * kd = new KeyDerivation; + kd->init(Buffer(key, sizeof(key)), Buffer(salt, sizeof(salt))); ConnectionParam conn ( (*kd), (*seq), seq_nr_, "", 0); connections_.insert(ConnectionMap::value_type(mux, conn)); it = connections_.find(mux); @@ -92,3 +105,8 @@ bool ConnectionList::empty() Lock lock(mutex_); return connections_.empty(); } + +Mutex& ConnectionList::getMutex() +{ + return mutex_; +} -- cgit v1.2.3