diff options
author | lloyd <[email protected]> | 2010-09-26 17:10:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-26 17:10:02 +0000 |
commit | 3181cda998fc96868efc17b9630fdd5dceff9404 (patch) | |
tree | 556cb4ef134b1ed34c26ea1a08ebb1aba605b988 /src/kdf/ssl_prf/prf_ssl3.cpp | |
parent | c820501357ac3acc81ddb8fad9fd9fd5fee9b32f (diff) |
Use BOTAN_ASSERT in various places
Diffstat (limited to 'src/kdf/ssl_prf/prf_ssl3.cpp')
-rw-r--r-- | src/kdf/ssl_prf/prf_ssl3.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kdf/ssl_prf/prf_ssl3.cpp b/src/kdf/ssl_prf/prf_ssl3.cpp index 1d896a63c..952158378 100644 --- a/src/kdf/ssl_prf/prf_ssl3.cpp +++ b/src/kdf/ssl_prf/prf_ssl3.cpp @@ -10,6 +10,7 @@ #include <botan/exceptn.h> #include <botan/sha160.h> #include <botan/md5.h> +#include <botan/internal/assert.h> #include <memory> namespace Botan { @@ -24,8 +25,7 @@ OctetString next_hash(u32bit where, u32bit want, const byte secret[], u32bit secret_len, const byte seed[], u32bit seed_len) { - if(want > md5.OUTPUT_LENGTH) - throw Internal_Error("SSL3_PRF:next_hash: want is too big"); + BOTAN_ASSERT(want <= md5.OUTPUT_LENGTH, "Desired output too large"); const byte ASCII_A_CHAR = 0x41; @@ -52,7 +52,7 @@ SecureVector<byte> SSL3_PRF::derive(u32bit key_len, const byte seed[], u32bit seed_len) const { if(key_len > 416) - throw Internal_Error("SSL3_PRF: Requested key length is too large"); + throw Invalid_Argument("SSL3_PRF: Requested key length is too large"); MD5 md5; SHA_160 sha1; |