aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-22 15:54:04 -0400
committerJack Lloyd <[email protected]>2018-08-22 15:54:04 -0400
commit56468f8a389350516de67005c8e780c4f7743aab (patch)
treef151e3421fe9532087c9b62468e1a02344086478 /src/lib/pubkey
parent2fc2598ebab23aa63f7be30c8a2eff6afb262fb3 (diff)
Simplify exception messages
Remove "Invalid argument" and "Decoding Error" prefixes
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
-rw-r--r--src/lib/pubkey/x509_key.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp
index 8d3eba6dc..c91e436c7 100644
--- a/src/lib/pubkey/pkcs8.cpp
+++ b/src/lib/pubkey/pkcs8.cpp
@@ -97,7 +97,7 @@ secure_vector<uint8_t> PKCS8_decode(
}
catch(Decoding_Error& e)
{
- throw Decoding_Error("PKCS #8 private key decoding failed: " + std::string(e.what()));
+ throw Decoding_Error("PKCS #8 private key decoding", e);
}
try
@@ -126,7 +126,7 @@ secure_vector<uint8_t> PKCS8_decode(
}
catch(std::exception& e)
{
- throw Decoding_Error("PKCS #8 private key decoding failed: " + std::string(e.what()));
+ throw Decoding_Error("PKCS #8 private key decoding", e);
}
return key;
}
diff --git a/src/lib/pubkey/x509_key.cpp b/src/lib/pubkey/x509_key.cpp
index 6e49d953a..fff75ec44 100644
--- a/src/lib/pubkey/x509_key.cpp
+++ b/src/lib/pubkey/x509_key.cpp
@@ -62,13 +62,13 @@ Public_Key* load_key(DataSource& source)
}
if(key_bits.empty())
- throw Decoding_Error("X.509 public key decoding failed");
+ throw Decoding_Error("X.509 public key decoding");
return load_public_key(alg_id, key_bits).release();
}
catch(Decoding_Error& e)
{
- throw Decoding_Error("X.509 public key decoding failed: " + std::string(e.what()));
+ throw Decoding_Error("X.509 public key decoding", e);
}
}