From ae34c2d2ffcf2dc9791a27427647d8911af52eb6 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 8 Sep 2018 17:08:44 -0400 Subject: [PATCH] Add throw to test recover plain text for DefaultDecryptorWithMAC --- validat0.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/validat0.cpp b/validat0.cpp index a032c13b..eafaf86d 100644 --- a/validat0.cpp +++ b/validat0.cpp @@ -438,6 +438,8 @@ bool TestEncryptors() std::string recovered, message = "Now is the time for all good men to come to the aide of their country."; //StringSource(message, true, new DefaultEncryptorWithMAC(password.c_str(), new FileSink("TestData/defdmac.bin"))); FileSource("TestData/defdmac.bin", true, new DefaultDecryptorWithMAC(password.c_str(), new StringSink(recovered))); + if (message != recovered) + throw Exception(Exception::OTHER_ERROR, "DefaultDecryptorWithMAC failed a self test"); } catch(const Exception&) {