diff options
Diffstat (limited to 'common/rdr')
-rw-r--r-- | common/rdr/AESInStream.cxx | 4 | ||||
-rw-r--r-- | common/rdr/AESOutStream.cxx | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/common/rdr/AESInStream.cxx b/common/rdr/AESInStream.cxx index a4890899..b10a214a 100644 --- a/common/rdr/AESInStream.cxx +++ b/common/rdr/AESInStream.cxx @@ -22,6 +22,8 @@ #include <assert.h> +#include <stdexcept> + #include <rdr/AESInStream.h> #ifdef HAVE_NETTLE @@ -36,7 +38,7 @@ AESInStream::AESInStream(InStream* _in, const uint8_t* key, else if (keySize == 256) EAX_SET_KEY(&eaxCtx256, aes256_set_encrypt_key, aes256_encrypt, key); else - assert(!"incorrect key size"); + throw std::out_of_range("Incorrect key size"); } AESInStream::~AESInStream() {} diff --git a/common/rdr/AESOutStream.cxx b/common/rdr/AESOutStream.cxx index fcb3e37a..1ec38b56 100644 --- a/common/rdr/AESOutStream.cxx +++ b/common/rdr/AESOutStream.cxx @@ -21,7 +21,9 @@ #endif #include <assert.h> -#include <rdr/Exception.h> + +#include <stdexcept> + #include <rdr/AESOutStream.h> #ifdef HAVE_NETTLE @@ -39,7 +41,7 @@ AESOutStream::AESOutStream(OutStream* _out, const uint8_t* key, else if (keySize == 256) EAX_SET_KEY(&eaxCtx256, aes256_set_encrypt_key, aes256_encrypt, key); else - assert(!"incorrect key size"); + throw std::out_of_range("Incorrect key size"); } AESOutStream::~AESOutStream() |