summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2014-10-01 16:40:54 +0000
committerOthmar Gsenger <otti@anytun.org>2014-10-01 16:40:54 +0000
commita0ab05f36eca2834384443b980a911d357dfb513 (patch)
tree395c7c80c65c6e53edcdd1d4108c3dcd474b3413
parentrefactored crypto interface. linking fails, needs fixing (diff)
fixed linker error
-rw-r--r--src/crypto/interface.cpp4
-rw-r--r--src/crypto/interface.h2
-rw-r--r--src/crypto/openssl.cpp6
-rw-r--r--src/crypto/openssl.h2
4 files changed, 12 insertions, 2 deletions
diff --git a/src/crypto/interface.cpp b/src/crypto/interface.cpp
index fab3565..3ed929e 100644
--- a/src/crypto/interface.cpp
+++ b/src/crypto/interface.cpp
@@ -47,6 +47,10 @@
namespace crypto {
+Interface::~Interface()
+{
+}
+
void Interface::encrypt(PlainPacket& in, EncryptedPacket& out, const Buffer& masterkey, const Buffer& mastersalt, role_t role, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux)
{
uint32_t len = cipher(in, in.getLength(), out.getPayload(), out.getPayloadLength(), masterkey, mastersalt, role, seq_nr, sender_id, mux);
diff --git a/src/crypto/interface.h b/src/crypto/interface.h
index 9438912..6d25b5a 100644
--- a/src/crypto/interface.h
+++ b/src/crypto/interface.h
@@ -70,7 +70,6 @@ namespace crypto {
class Interface
{
public:
- virtual ~Interface() {};
// implemented
void encrypt(PlainPacket& in, EncryptedPacket& out, const Buffer& masterkey, const Buffer& mastersalt, role_t role, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux);
void decrypt(EncryptedPacket& in, PlainPacket& out, const Buffer& masterkey, const Buffer& mastersalt, role_t role);
@@ -81,6 +80,7 @@ namespace crypto {
virtual uint32_t decipher(uint8_t* in, uint32_t ilen, uint8_t* out, uint32_t olen, const Buffer& masterkey, const Buffer& mastersalt, role_t role, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux) = 0;
// virtual
+ virtual ~Interface();
virtual std::string printType();
//static
diff --git a/src/crypto/openssl.cpp b/src/crypto/openssl.cpp
index cde1d24..088e2b5 100644
--- a/src/crypto/openssl.cpp
+++ b/src/crypto/openssl.cpp
@@ -48,6 +48,12 @@
namespace crypto {
+Openssl::~Openssl()
+{
+
+}
+
+
void Openssl::calcMasterKeySalt(std::string passphrase, uint16_t length, Buffer& masterkey , Buffer& mastersalt)
{
diff --git a/src/crypto/openssl.h b/src/crypto/openssl.h
index b86550e..2f3704e 100644
--- a/src/crypto/openssl.h
+++ b/src/crypto/openssl.h
@@ -53,13 +53,13 @@ namespace crypto {
class Openssl : Interface
{
public:
- virtual ~Openssl() {};
// pure virtual
virtual void calcMasterKeySalt(std::string passphrase, uint16_t length, Buffer& masterkey , Buffer& mastersalt);
virtual uint32_t cipher(uint8_t* in, uint32_t ilen, uint8_t* out, uint32_t olen, const Buffer& masterkey, const Buffer& mastersalt, role_t role, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux);
virtual uint32_t decipher(uint8_t* in, uint32_t ilen, uint8_t* out, uint32_t olen, const Buffer& masterkey, const Buffer& mastersalt, role_t role, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux);
// virtual
+ virtual ~Openssl();
virtual std::string printType();
//static
static bool init();