diff --git a/src/crypto/crypto.cc b/src/crypto/crypto.cc index c1f002a..f9d0404 100644 --- a/src/crypto/crypto.cc +++ b/src/crypto/crypto.cc @@ -41,6 +41,7 @@ #include "byteorder.h" #include "crypto.h" #include "base64.h" +#include "fatal_assert.h" #include "prng.h" using namespace std; @@ -171,9 +172,7 @@ Session::Session( Base64Key s_key ) Session::~Session() { - if ( ae_clear( ctx ) != AE_SUCCESS ) { - throw CryptoException( "Could not clear AES-OCB context." ); - } + fatal_assert( ae_clear( ctx ) == AE_SUCCESS ); } Nonce::Nonce( uint64_t val ) diff --git a/src/network/network.cc b/src/network/network.cc index 9441131..87d8afd 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -639,9 +639,7 @@ uint64_t Connection::timeout( void ) const Connection::Socket::~Socket() { - if ( close( _fd ) < 0 ) { - throw NetworkException( "close", errno ); - } + fatal_assert ( close( _fd ) == 0 ); } Connection::Socket::Socket( const Socket & other )