diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-09-08 17:08:44 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-09-08 17:08:44 -0400 |
commit | ae34c2d2ffcf2dc9791a27427647d8911af52eb6 (patch) | |
tree | 6ae118bc8caabe6ceb4c2c120ad127b66de470bf /validat0.cpp | |
parent | 4ff34ee329380ad6e0e20a8a028bdd483815dba2 (diff) | |
download | cryptopp-git-ae34c2d2ffcf2dc9791a27427647d8911af52eb6.tar.gz |
Add throw to test recover plain text for DefaultDecryptorWithMAC
Diffstat (limited to 'validat0.cpp')
-rw-r--r-- | validat0.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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&)
{
|