From e7d0e0673edad1449eb2665d2a29266979e2f74e Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 31 Jan 2008 11:59:15 +0000 Subject: finallly working, payload type needs further checks --- encryptedPacket.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'encryptedPacket.cpp') 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) -- cgit v1.2.3