aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes
diff options
context:
space:
mode:
authorDaniel Wyatt <[email protected]>2017-06-09 09:03:17 -0400
committerDaniel Wyatt <[email protected]>2017-06-09 09:03:17 -0400
commit3059cbe059eebaf75cdd8353e2682fdeb560823a (patch)
treed106273dfa8fafbd3a72c57bacf207d6cdabae36 /src/lib/modes
parent5b2fe4a6d4dfdb28af364eec86a407327e64d1d7 (diff)
Add assertion to ensure key is set in OCB_Encryption::encrypt.
Otherwise we just SIGSEGV.
Diffstat (limited to 'src/lib/modes')
-rw-r--r--src/lib/modes/aead/ocb/ocb.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/modes/aead/ocb/ocb.cpp b/src/lib/modes/aead/ocb/ocb.cpp
index 84787ad38..e1fae911b 100644
--- a/src/lib/modes/aead/ocb/ocb.cpp
+++ b/src/lib/modes/aead/ocb/ocb.cpp
@@ -241,6 +241,8 @@ void OCB_Encryption::encrypt(uint8_t buffer[], size_t blocks)
const size_t proc_blocks = std::min(blocks, par_blocks);
const size_t proc_bytes = proc_blocks * 16;
+ BOTAN_ASSERT(m_L, "A key was set");
+
const auto& offsets = m_L->compute_offsets(m_offset, m_block_index, proc_blocks);
xor_buf(m_checksum.data(), buffer, proc_bytes);