aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/hmac
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/mac/hmac')
-rw-r--r--src/lib/mac/hmac/hmac.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/mac/hmac/hmac.cpp b/src/lib/mac/hmac/hmac.cpp
index 32f62f0c2..244946d88 100644
--- a/src/lib/mac/hmac/hmac.cpp
+++ b/src/lib/mac/hmac/hmac.cpp
@@ -15,6 +15,7 @@ namespace Botan {
*/
void HMAC::add_data(const uint8_t input[], size_t length)
{
+ verify_key_set(m_ikey.empty() == false);
m_hash->update(input, length);
}
@@ -23,6 +24,7 @@ void HMAC::add_data(const uint8_t input[], size_t length)
*/
void HMAC::final_result(uint8_t mac[])
{
+ verify_key_set(m_okey.empty() == false);
m_hash->final(mac);
m_hash->update(m_okey);
m_hash->update(mac, output_length());