diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-05-14 05:26:33 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-05-14 05:26:33 -0400 |
commit | 7ee87af86b93dcc766aeb01b9ec4caf05c00ee0d (patch) | |
tree | f33c46497cc2f18fba26152e8c485529d84729fa /datatest.cpp | |
parent | 017f7f61b40f101b03ed3d276526b5f550eb79bd (diff) | |
download | cryptopp-git-7ee87af86b93dcc766aeb01b9ec4caf05c00ee0d.tar.gz |
Don't latch BlockSize or BlockPaddingScheme across tests
Diffstat (limited to 'datatest.cpp')
-rw-r--r-- | datatest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/datatest.cpp b/datatest.cpp index 97be8d20..296ef16d 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -488,6 +488,14 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters) std::cout << "\n";
SignalTestFailure();
}
+
+ // If BlockSize or BlockPaddingScheme was set for a test, then it becomes latched
+ // in testDataPairs. The old value is used in subsequent tests, and it could cause a
+ // self test failure in the next test. The behavior surfaced under Kalyna, where the
+ // official test vectors use NO_PADDING for all tests excpet one. For BlockSize or
+ // BlockPaddingScheme, unlatch them now. Also note we only unlatch from testDataPairs.
+ // If overrideParameters are specified, then the caller is responsible.
+ v.erase("BlockSize"); v.erase("BlockPaddingScheme");
}
else
{
|