summaryrefslogtreecommitdiff
path: root/encryptedPacket.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-25 19:00:43 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-25 19:00:43 +0000
commit619dec51f630116843a7d83c0c085abc7e3da688 (patch)
tree89536dff865336963d12ae7a3a5292509616c126 /encryptedPacket.cpp
parentbugfix with packet length (diff)
fixed resize issue with buffer->xPacket
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