summaryrefslogtreecommitdiff
path: root/encryptedPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'encryptedPacket.cpp')
-rw-r--r--encryptedPacket.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/encryptedPacket.cpp b/encryptedPacket.cpp
index 9c091b5..a8e7a36 100644
--- a/encryptedPacket.cpp
+++ b/encryptedPacket.cpp
@@ -93,6 +93,10 @@ void EncryptedPacket::setLength(u_int32_t length)
throw std::out_of_range("can't set length greater then size ofsize of allocated memory");
length_ = length;
+ if( auth_tag_)
+ payload_length_ = length_ - sizeof(struct HeaderStruct)+AUTHTAG_SIZE;
+ else
+ payload_length_ = length_ - sizeof(struct HeaderStruct);
}
void EncryptedPacket::setSeqNr(seq_nr_t seq_nr)