diff options
author | Jack Lloyd <[email protected]> | 2017-10-26 20:31:30 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-26 22:26:15 -0400 |
commit | e6d45052efedfe49e99adb6318aaf56e0a9e8d7b (patch) | |
tree | c6c3ccd3cff3d04285940bf1d518c809e0653947 /src/lib/modes | |
parent | 315b002ecf00f6b6bb0f0d5200d1f39a83527e8f (diff) |
Add checks that keyed algorithms are actually keyed before use
Previously calling update or encrypt without calling set_key first
would result in invalid outputs or else crashing.
Diffstat (limited to 'src/lib/modes')
-rw-r--r-- | src/lib/modes/aead/gcm/ghash.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/modes/aead/gcm/ghash.cpp b/src/lib/modes/aead/gcm/ghash.cpp index 51477f43a..482eec335 100644 --- a/src/lib/modes/aead/gcm/ghash.cpp +++ b/src/lib/modes/aead/gcm/ghash.cpp @@ -199,7 +199,7 @@ void GHASH::set_associated_data(const uint8_t input[], size_t length) void GHASH::update_associated_data(const uint8_t ad[], size_t length) { - BOTAN_ASSERT(m_ghash.size() == GCM_BS, "Key was set"); + verify_key_set(m_ghash.size() == GCM_BS); m_ad_len += length; ghash_update(m_ghash, ad, length); } |