From 1fcf8c6ba3f8912c9c6cba0555597ab0083eaaa2 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 13 May 2018 12:49:40 -0400 Subject: Add message to BOTAN_ARG_CHECK and use it more widely --- src/lib/stream/ctr/ctr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/stream/ctr') diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp index c63bdebdc..261646344 100644 --- a/src/lib/stream/ctr/ctr.cpp +++ b/src/lib/stream/ctr/ctr.cpp @@ -6,6 +6,7 @@ */ #include +#include #include namespace Botan { @@ -30,8 +31,8 @@ CTR_BE::CTR_BE(BlockCipher* cipher, size_t ctr_size) : m_pad(m_counter.size()), m_pad_pos(0) { - if(m_ctr_size < 4 || m_ctr_size > m_block_size) - throw Invalid_Argument("Invalid CTR-BE counter size"); + BOTAN_ARG_CHECK(m_ctr_size >= 4 && m_ctr_size <= m_block_size, + "Invalid CTR-BE counter size"); } void CTR_BE::clear() -- cgit v1.2.3