summaryrefslogtreecommitdiff
path: root/encryptedPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'encryptedPacket.cpp')
-rw-r--r--encryptedPacket.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/encryptedPacket.cpp b/encryptedPacket.cpp
index a3e5886..b618f99 100644
--- a/encryptedPacket.cpp
+++ b/encryptedPacket.cpp
@@ -113,8 +113,13 @@ u_int32_t EncryptedPacket::getPayloadLength() const
void EncryptedPacket::setPayloadLength(u_int32_t payload_length)
{
Buffer::setLength(payload_length + sizeof(struct HeaderStruct));
-
- // depending on allow_realloc buf_ may point to another address
+ // depending on allow_realloc buf_ may point to another address
+ // therefore in this case reinit() gets called by Buffer::setLength()
+}
+
+void EncryptedPacket::reinit()
+{
+ Buffer::reinit();
header_ = reinterpret_cast<struct HeaderStruct*>(buf_);
payload_ = buf_ + sizeof(struct HeaderStruct); // TODO: fix auth_tag stuff
auth_tag_ = NULL; // TODO: fix auth_tag stuff