summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2015-03-07 11:59:47 (GMT)
committerOthmar Gsenger <otti@anytun.org>2015-03-07 11:59:47 (GMT)
commit973496b50cb614d1ce646182c011200adbdab568 (patch)
treec37a1a89f7f34e709c6d2e40f8e0555755d10ded
parentf1ef7b2a3875e13de3a6b835951ec319a4513f81 (diff)
fixed buffer pointernewcrypt
-rw-r--r--src/cipher.cpp4
-rw-r--r--src/crypto/interface.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cipher.cpp b/src/cipher.cpp
index 8a1aba4..52a2543 100644
--- a/src/cipher.cpp
+++ b/src/cipher.cpp
@@ -61,7 +61,7 @@
void Cipher::encrypt(KeyDerivation& kd, PlainPacket& in, EncryptedPacket& out, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux)
{
- uint32_t len = cipher(kd, in.getPayload(), in.getLength(), out.getPayload(), out.getPayloadLength(), seq_nr, sender_id, mux);
+ uint32_t len = cipher(kd, in, in.getLength(), out.getPayload(), out.getPayloadLength(), seq_nr, sender_id, mux);
out.setSenderId(sender_id);
out.setSeqNr(seq_nr);
out.setMux(mux);
@@ -70,7 +70,7 @@ void Cipher::encrypt(KeyDerivation& kd, PlainPacket& in, EncryptedPacket& out, s
void Cipher::decrypt(KeyDerivation& kd, EncryptedPacket& in, PlainPacket& out)
{
- uint32_t len = decipher(kd, in.getPayload() , in.getPayloadLength(), out.getPayload(), out.getLength(), in.getSeqNr(), in.getSenderId(), in.getMux());
+ uint32_t len = decipher(kd, in.getPayload() , in.getPayloadLength(), out, out.getLength(), in.getSeqNr(), in.getSenderId(), in.getMux());
out.setLength(len);
}
diff --git a/src/crypto/interface.cpp b/src/crypto/interface.cpp
index 3afa03d..c11e382 100644
--- a/src/crypto/interface.cpp
+++ b/src/crypto/interface.cpp
@@ -55,7 +55,7 @@ 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.getPayload(), in.getLength(), out.getPayload(), out.getPayloadLength(), masterkey, mastersalt, role, seq_nr, sender_id, mux);
+ uint32_t len = cipher(in, in.getLength(), out.getPayload(), out.getPayloadLength(), masterkey, mastersalt, role, seq_nr, sender_id, mux);
out.setSenderId(sender_id);
out.setSeqNr(seq_nr);
out.setMux(mux);
@@ -64,7 +64,7 @@ void Interface::encrypt(PlainPacket& in, EncryptedPacket& out, const Buffer& mas
void Interface::decrypt(EncryptedPacket& in, PlainPacket& out, const Buffer& masterkey, const Buffer& mastersalt, role_t role)
{
- uint32_t len = decipher(in.getPayload() , in.getPayloadLength(), out.getPayload(), out.getLength(), masterkey, mastersalt, role, in.getSeqNr(), in.getSenderId(), in.getMux());
+ uint32_t len = decipher(in.getPayload() , in.getPayloadLength(), out, out.getLength(), masterkey, mastersalt, role, in.getSeqNr(), in.getSenderId(), in.getMux());
out.setLength(len);
}