summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-18 13:08:59 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-18 13:08:59 +0000
commitd97760a781a793d35dfe75367dd8d80ab59bbb49 (patch)
tree362e1f7f198e2549b56dab7bf1eb564d15b48b91 /src/anytun.cpp
parentstatic build mostly fixed (diff)
added anytun02 compat runtime switch
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index ab847a8..cfe80d1 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -83,7 +83,7 @@ void createConnection(const PacketSourceEndpoint & remote_end, window_size_t seq
{
SeqWindow* seq = new SeqWindow(seqSize);
seq_nr_t seq_nr_=0;
- KeyDerivation * kd = KeyDerivationFactory::create(gOpt.getKdPrf());
+ KeyDerivation * kd = KeyDerivationFactory::create(gOpt.getKdPrf(), gOpt.getAnytun02Compat());
kd->init(gOpt.getKey(), gOpt.getSalt(), gOpt.getPassphrase());
kd->setLogKDRate(gOpt.getLdKdr());
cLog.msg(Log::PRIO_NOTICE) << "added connection remote host " << remote_end;
@@ -143,7 +143,7 @@ void sender(void* p)
{
ThreadParam* param = reinterpret_cast<ThreadParam*>(p);
- std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND));
+ std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND, gOpt.getAnytun02Compat()));
std::auto_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_OUTBOUND) );
PlainPacket plain_packet(MAX_PACKET_LENGTH);
@@ -225,8 +225,8 @@ void receiver(void* p)
{
ThreadParam* param = reinterpret_cast<ThreadParam*>(p);
- std::auto_ptr<Cipher> c( CipherFactory::create(gOpt.getCipher(), KD_INBOUND) );
- std::auto_ptr<AuthAlgo> a( AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_INBOUND) );
+ std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_INBOUND, gOpt.getAnytun02Compat()));
+ std::auto_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_INBOUND));
EncryptedPacket encrypted_packet(MAX_PACKET_LENGTH);
PlainPacket plain_packet(MAX_PACKET_LENGTH);
@@ -352,6 +352,9 @@ int main(int argc, char* argv[])
#endif
#ifndef NO_CRYPT
+ if(gOpt.getAnytun02Compat())
+ cLog.msg(Log::PRIO_NOTICE) << "enabling anytun 0.2.x crypto compatiblity mode";
+
#ifndef USE_SSL_CRYPTO
// this must be called before any other libgcrypt call
if(!initLibGCrypt())