summaryrefslogtreecommitdiff
path: root/encryptedPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'encryptedPacket.cpp')
-rw-r--r--encryptedPacket.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/encryptedPacket.cpp b/encryptedPacket.cpp
index 0ac0ca9..35ccda0 100644
--- a/encryptedPacket.cpp
+++ b/encryptedPacket.cpp
@@ -50,6 +50,15 @@ EncryptedPacket::EncryptedPacket(u_int32_t max_payload_length)
}
+EncryptedPacket::~EncryptedPacket()
+{
+ buf_ = reinterpret_cast<u_int8_t*>(header_);
+ if( auth_tag_ == NULL )
+ length_ = size_ + sizeof(struct HeaderStruct) + AUTHTAG_SIZE;
+ else
+ length_ = size_ + sizeof(struct HeaderStruct);
+}
+
seq_nr_t EncryptedPacket::getSeqNr() const
{
return SEQ_NR_T_NTOH(header_->seq_nr);