summaryrefslogtreecommitdiff
path: root/connectionList.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-04 20:34:37 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-04 20:34:37 +0000
commitc01ff56f61b28d0a909f46b95182b5a26aaa6cd3 (patch)
tree0192e862cc9e71d260d64daf1f6fd2e4a379e80f /connectionList.cpp
parentsorry for not working checkin ;) (diff)
fixed bug @ sync
key gets updatet @ sync
Diffstat (limited to 'connectionList.cpp')
-rw-r--r--connectionList.cpp18
1 files changed, 18 insertions, 0 deletions
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_;
+}