summaryrefslogtreecommitdiff
path: root/src/encryptedPacket.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-22 07:20:56 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-22 07:20:56 +0000
commitb7013f1be9a5f09ecae4b37f0986352abfcd0dc1 (patch)
treef890c7677d27953afaf05215a9c91a86b23897bd /src/encryptedPacket.cpp
parentfixed signalController on unix (diff)
replaced regular throws with AnytunError::thowErr
Diffstat (limited to 'src/encryptedPacket.cpp')
-rw-r--r--src/encryptedPacket.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/encryptedPacket.cpp b/src/encryptedPacket.cpp
index 9a1e063..34d2725 100644
--- a/src/encryptedPacket.cpp
+++ b/src/encryptedPacket.cpp
@@ -37,6 +37,7 @@
#include "endian.h"
#include "datatypes.h"
#include "log.h"
+#include "anytunError.hpp"
EncryptedPacket::EncryptedPacket(u_int32_t payload_length, bool allow_realloc)
: Buffer(payload_length + sizeof(struct HeaderStruct), allow_realloc)
@@ -137,14 +138,14 @@ void EncryptedPacket::reinit()
if(length_ < (sizeof(struct HeaderStruct))) {
header_ = NULL;
- throw std::runtime_error("encrypted packet can't be initialized, buffer is too small");
+ AnytunError::throwErr() << "encrypted packet can't be initialized, buffer is too small";
}
if(auth_tag_)
{
if(length_ < (sizeof(struct HeaderStruct) + AUTHTAG_SIZE)) {
auth_tag_ = NULL;
- throw std::runtime_error("auth-tag can't be enabled, buffer is too small");
+ AnytunError::throwErr() << "auth-tag can't be enabled, buffer is too small";
}
auth_tag_ = buf_ + length_ - AUTHTAG_SIZE;
}
@@ -179,7 +180,7 @@ void EncryptedPacket::withAuthTag(bool b)
if(b)
{
if(length_ < (sizeof(struct HeaderStruct) + AUTHTAG_SIZE))
- throw std::runtime_error("auth-tag can't be enabled, buffer is too small");
+ AnytunError::throwErr() << "auth-tag can't be enabled, buffer is too small";
auth_tag_ = buf_ + length_ - AUTHTAG_SIZE;
}