Skip to content

Commit

Permalink
Add sanity check to AuthenticatedSymmetricCipherBase::TruncatedFinal …
Browse files Browse the repository at this point in the history
…(GH #954)
  • Loading branch information
noloader committed Jul 7, 2020
1 parent 9c5ea3a commit a7b3286
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions authenc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ void AuthenticatedSymmetricCipherBase::ProcessData(byte *outString, const byte *

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()));

Expand Down

0 comments on commit a7b3286

Please sign in to comment.