aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/pkcs8.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-12-11 09:42:06 -0500
committerJack Lloyd <[email protected]>2015-12-11 09:42:06 -0500
commit6b9a3a534071ef84c121c406559f8fc7ad546104 (patch)
treec11480ad1f07e443ba4e992fefcd618b532c2e93 /src/lib/pubkey/pkcs8.cpp
parent79a51627ee11f4d7f55d589751b30463d1f02a76 (diff)
Reroot the exception hierarchy into a toplevel Exception class
As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
Diffstat (limited to 'src/lib/pubkey/pkcs8.cpp')
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp
index 7b7b54891..92157a196 100644
--- a/src/lib/pubkey/pkcs8.cpp
+++ b/src/lib/pubkey/pkcs8.cpp
@@ -81,7 +81,7 @@ secure_vector<byte> PKCS8_decode(
if(is_encrypted)
{
if(OIDS::lookup(pbe_alg_id.oid) != "PBE-PKCS5v20")
- throw std::runtime_error("Unknown PBE type " + pbe_alg_id.oid.as_string());
+ throw Exception("Unknown PBE type " + pbe_alg_id.oid.as_string());
key = pbes2_decrypt(key_data, get_passphrase(), pbe_alg_id.parameters);
}
else
@@ -144,7 +144,7 @@ choose_pbe_params(const std::string& pbe_algo, const std::string& key_algo)
SCAN_Name request(pbe_algo);
if(request.algo_name() != "PBE-PKCS5v20" || request.arg_count() != 2)
- throw std::runtime_error("Unsupported PBE " + pbe_algo);
+ throw Exception("Unsupported PBE " + pbe_algo);
return std::make_pair(request.arg(1), request.arg(0));
}