aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf
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/kdf
parente42d1513fd6f80dcd2ae4109fddf53b61e935116 (diff)
Simplify some code by using T::create_or_throw
Diffstat (limited to 'src/lib/kdf')
-rw-r--r--src/lib/kdf/kdf.cpp2
-rw-r--r--src/lib/kdf/prf_tls/prf_tls.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/kdf/kdf.cpp b/src/lib/kdf/kdf.cpp
index f8f822809..94694c70c 100644
--- a/src/lib/kdf/kdf.cpp
+++ b/src/lib/kdf/kdf.cpp
@@ -195,7 +195,7 @@ KDF::create_or_throw(const std::string& algo,
{
return bc;
}
- throw Lookup_Error("Block cipher", algo, provider);
+ throw Lookup_Error("KDF", algo, provider);
}
std::vector<std::string> KDF::providers(const std::string& algo_spec)
diff --git a/src/lib/kdf/prf_tls/prf_tls.cpp b/src/lib/kdf/prf_tls/prf_tls.cpp
index e83d07692..6f247ab6e 100644
--- a/src/lib/kdf/prf_tls/prf_tls.cpp
+++ b/src/lib/kdf/prf_tls/prf_tls.cpp
@@ -11,11 +11,9 @@
namespace Botan {
TLS_PRF::TLS_PRF() :
- m_hmac_md5(MessageAuthenticationCode::create("HMAC(MD5)")),
- m_hmac_sha1(MessageAuthenticationCode::create("HMAC(SHA-1)"))
+ m_hmac_md5(MessageAuthenticationCode::create_or_throw("HMAC(MD5)")),
+ m_hmac_sha1(MessageAuthenticationCode::create_or_throw("HMAC(SHA-1)"))
{
- if(!m_hmac_md5 || !m_hmac_sha1)
- throw Algorithm_Not_Found("TLS_PRF HMACs not available");
}
namespace {