aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/pubkey.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-01-05 23:06:31 +0000
committerlloyd <[email protected]>2010-01-05 23:06:31 +0000
commit2837e915d82e439730624f15bfc8c820475c9d65 (patch)
treeaeb1ec26572fb29c1bd60baab582699279201d71 /src/pubkey/pubkey.cpp
parent968a4250218d40f3da9eee8ff50432a3169605c6 (diff)
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.
Diffstat (limited to 'src/pubkey/pubkey.cpp')
-rw-r--r--src/pubkey/pubkey.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pubkey/pubkey.cpp b/src/pubkey/pubkey.cpp
index 44e31159c..9b5c9180b 100644
--- a/src/pubkey/pubkey.cpp
+++ b/src/pubkey/pubkey.cpp
@@ -73,7 +73,7 @@ PK_Encryptor_MR_with_EME::enc(const byte msg[],
message.set(msg, length);
if(8*(message.size() - 1) + high_bit(message[0]) > key.max_input_bits())
- throw Exception("PK_Encryptor_MR_with_EME: Input is too large");
+ throw Invalid_Argument("PK_Encryptor_MR_with_EME: Input is too large");
return key.encrypt(message, message.size(), rng);
}
@@ -113,11 +113,11 @@ SecureVector<byte> PK_Decryptor_MR_with_EME::dec(const byte msg[],
}
catch(Invalid_Argument)
{
- throw Exception("PK_Decryptor_MR_with_EME: Input is invalid");
+ throw Decoding_Error("PK_Decryptor_MR_with_EME: Input is invalid");
}
catch(Decoding_Error)
{
- throw Exception("PK_Decryptor_MR_with_EME: Input is invalid");
+ throw Decoding_Error("PK_Decryptor_MR_with_EME: Input is invalid");
}
}