summaryrefslogtreecommitdiff
path: root/encryptedPacket.h
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-01-31 11:39:39 +0000
committerOthmar Gsenger <otti@anytun.org>2008-01-31 11:39:39 +0000
commitde5c4f910203dd976ad8c17eff90874f548d6bc3 (patch)
treeb83914f21da87be83691f4c57f0be05cef554cab /encryptedPacket.h
parentdraft fixed version number (diff)
packet and cypher fixes
Diffstat (limited to 'encryptedPacket.h')
-rw-r--r--encryptedPacket.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/encryptedPacket.h b/encryptedPacket.h
index 7b70e17..83b831e 100644
--- a/encryptedPacket.h
+++ b/encryptedPacket.h
@@ -34,7 +34,7 @@
#include "datatypes.h"
#include "buffer.h"
#include "authTag.h"
-
+class Cypher;
class EncryptedPacket : public Buffer
{
public:
@@ -98,7 +98,7 @@ public:
* Get the maximum payload size
* @return maximum payload size
*/
- u_int32_t getSize() const;
+ u_int32_t getMaxLength() const;
/**
* Set the real length of the payload
@@ -111,6 +111,8 @@ public:
AuthTag getAuthTag() const;
void setAuthTag(AuthTag& tag);
+ void setPayloadLength(u_int8_t payload_length);
+
// bool hasHeader() const;
// Packet& withHeader(bool b);
@@ -131,9 +133,13 @@ private:
struct HeaderStruct* header_;
AuthTag* auth_tag_;
- u_int32_t size_;
+ u_int32_t max_length_;
static const u_int32_t AUTHTAG_SIZE = 10; // 10byte
+protected:
+ friend class Cypher;
+ u_int8_t * payload_;
+ u_int32_t payload_length_;
};
#endif