aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-03 13:11:18 -0400
committerJack Lloyd <[email protected]>2016-11-03 13:11:18 -0400
commit660d985e92d030f4ec0c3503bc14363825183371 (patch)
tree8daeec407eab8f5dc7c00f83b08fc687abe9a8d9 /src/lib/x509
parente42d1513fd6f80dcd2ae4109fddf53b61e935116 (diff)
Simplify some code by using T::create_or_throw
Diffstat (limited to 'src/lib/x509')
-rw-r--r--src/lib/x509/x509_ca.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/x509/x509_ca.cpp b/src/lib/x509/x509_ca.cpp
index 179d903c4..bc3763c5a 100644
--- a/src/lib/x509/x509_ca.cpp
+++ b/src/lib/x509/x509_ca.cpp
@@ -232,9 +232,7 @@ PK_Signer* choose_sig_format(const Private_Key& key,
{
const std::string algo_name = key.algo_name();
- std::unique_ptr<HashFunction> hash(HashFunction::create(hash_fn));
- if(!hash)
- throw Algorithm_Not_Found(hash_fn);
+ std::unique_ptr<HashFunction> hash(HashFunction::create_or_throw(hash_fn));
if(key.max_input_bits() < hash->output_length() * 8)
throw Invalid_Argument("Key is too small for chosen hash function");