From 2837e915d82e439730624f15bfc8c820475c9d65 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 5 Jan 2010 23:06:31 +0000 Subject: Clean up exceptions. Remove some unused ones like Config_Error. Make Invalid_Argument just a typedef for std::invalid_argument. Make Botan::Exception a typedef for std::runtime_error. Make Memory_Exhaustion a public exception, and use it in other places where memory allocations can fail. --- src/block/lion/lion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/block/lion') diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index e590a78ce..d8dfd1fcb 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -116,8 +116,9 @@ Lion::Lion(HashFunction* hash_in, StreamCipher* sc_in, u32bit block_len) : { if(2*LEFT_SIZE + 1 > BLOCK_SIZE) throw Invalid_Argument(name() + ": Chosen block size is too small"); + if(!cipher->valid_keylength(LEFT_SIZE)) - throw Exception(name() + ": This stream/hash combination is invalid"); + throw Invalid_Argument(name() + ": This stream/hash combo is invalid"); key1.resize(LEFT_SIZE); key2.resize(LEFT_SIZE); -- cgit v1.2.3