diff options
author | lloyd <[email protected]> | 2010-01-05 23:06:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-05 23:06:31 +0000 |
commit | 2837e915d82e439730624f15bfc8c820475c9d65 (patch) | |
tree | aeb1ec26572fb29c1bd60baab582699279201d71 /checks | |
parent | 968a4250218d40f3da9eee8ff50432a3169605c6 (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 'checks')
-rw-r--r-- | checks/block.cpp | 2 | ||||
-rw-r--r-- | checks/pk.cpp | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/checks/block.cpp b/checks/block.cpp index 3cd41e63a..c90e3e499 100644 --- a/checks/block.cpp +++ b/checks/block.cpp @@ -89,7 +89,7 @@ void ECB_Encryption_ErrorCheck::end_msg() } if(position) - throw Exception("ECB: input was not in full blocks"); + throw Encoding_Error("ECB: input was not in full blocks"); } Filter* lookup_block(const std::string& algname, const std::string& key) diff --git a/checks/pk.cpp b/checks/pk.cpp index e6f4d4f48..9c243f1cf 100644 --- a/checks/pk.cpp +++ b/checks/pk.cpp @@ -172,7 +172,7 @@ u32bit validate_rsa_enc_pkcs8(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 4 && str.size() != 5) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RSA) @@ -210,7 +210,7 @@ u32bit validate_rsa_enc(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 6) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RSA) @@ -238,7 +238,7 @@ u32bit validate_elg_enc(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 6 && str.size() != 7) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_ELGAMAL) @@ -270,7 +270,7 @@ u32bit validate_rsa_sig(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 6) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RSA) @@ -296,7 +296,7 @@ u32bit validate_rsa_ver(const std::string& algo, const std::vector<std::string>& str) { if(str.size() != 5) /* is actually 4, parse() adds an extra empty one */ - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RSA) RSA_PublicKey key(to_bigint(str[1]), to_bigint(str[0])); @@ -320,7 +320,7 @@ u32bit validate_rsa_ver_x509(const std::string& algo, const std::vector<std::string>& str) { if(str.size() != 5) /* is actually 3, parse() adds extra empty ones */ - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RSA) DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()), @@ -352,7 +352,7 @@ u32bit validate_rw_ver(const std::string& algo, const std::vector<std::string>& str) { if(str.size() != 5) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); @@ -379,7 +379,7 @@ u32bit validate_rw_sig(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 6) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_RW) @@ -405,7 +405,7 @@ u32bit validate_dsa_sig(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 4 && str.size() != 5) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); std::string pass; if(str.size() == 5) pass = str[4]; @@ -442,7 +442,7 @@ u32bit validate_dsa_ver(const std::string& algo, const std::vector<std::string>& str) { if(str.size() != 5) /* is actually 3, parse() adds extra empty ones */ - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()), str[0].length()); @@ -476,7 +476,7 @@ u32bit validate_nr_sig(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 8) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_NYBERG_RUEPPEL) @@ -503,7 +503,7 @@ u32bit validate_dh(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 5 && str.size() != 6) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_DIFFIE_HELLMAN) @@ -534,7 +534,7 @@ u32bit validate_dlies(const std::string& algo, RandomNumberGenerator& rng) { if(str.size() != 6) - throw Exception("Invalid input from pk_valid.dat"); + throw std::runtime_error("Invalid input from pk_valid.dat"); #if defined(BOTAN_HAS_DLIES) DL_Group domain(to_bigint(str[0]), to_bigint(str[1])); @@ -547,7 +547,7 @@ u32bit validate_dlies(const std::string& algo, std::vector<std::string> options = split_on(opt_str, '/'); if(options.size() != 3) - throw Exception("DLIES needs three options: " + opt_str); + throw std::runtime_error("DLIES needs three options: " + opt_str); MessageAuthenticationCode* mac = get_mac(options[1]); u32bit mac_key_len = to_u32bit(options[2]); |