summaryrefslogtreecommitdiff
path: root/authenc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'authenc.cpp')
-rw-r--r--authenc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/authenc.cpp b/authenc.cpp
index 2ac9362a..89a7142d 100644
--- a/authenc.cpp
+++ b/authenc.cpp
@@ -140,6 +140,9 @@ reswitch:
void AuthenticatedSymmetricCipherBase::TruncatedFinal(byte *mac, size_t macSize)
{
+ // https://github.com/weidai11/cryptopp/issues/954
+ this->ThrowIfInvalidTruncatedSize(macSize);
+
if (m_totalHeaderLength > MaxHeaderLength())
throw InvalidArgument(AlgorithmName() + ": header length of " + IntToString(m_totalHeaderLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength()));