aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_handshake_hash.cpp
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/tls/tls_handshake_hash.cpp
parente42d1513fd6f80dcd2ae4109fddf53b61e935116 (diff)
Simplify some code by using T::create_or_throw
Diffstat (limited to 'src/lib/tls/tls_handshake_hash.cpp')
-rw-r--r--src/lib/tls/tls_handshake_hash.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/tls/tls_handshake_hash.cpp b/src/lib/tls/tls_handshake_hash.cpp
index 4f78bebbc..540f1de14 100644
--- a/src/lib/tls/tls_handshake_hash.cpp
+++ b/src/lib/tls/tls_handshake_hash.cpp
@@ -29,11 +29,7 @@ secure_vector<byte> Handshake_Hash::final(Protocol_Version version,
};
const std::string hash_algo = choose_hash();
- std::unique_ptr<HashFunction> hash(HashFunction::create(hash_algo));
- if(!hash)
- {
- throw Algorithm_Not_Found(hash_algo);
- }
+ std::unique_ptr<HashFunction> hash(HashFunction::create_or_throw(hash_algo));
hash->update(m_data);
return hash->final();
}