summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-16 11:27:15 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-16 11:27:15 -0400
commit399a1546de71f41598c15edada28e7f0d616f541 (patch)
tree530160789358a3303be180df2d8529c82782156b /datatest.cpp
parentfca5fbb36169a7522e6c533df9c322d47e3dc6bb (diff)
downloadcryptopp-git-399a1546de71f41598c15edada28e7f0d616f541.tar.gz
Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)
trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 315b93da..7a2e64c9 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -300,12 +300,12 @@ void TestSignatureScheme(TestData &v)
else if (test == "RandomSign")
{
SignalTestError();
- assert(false); // TODO: implement
+ CRYPTOPP_ASSERT(false); // TODO: implement
}
else
{
SignalTestError();
- assert(false);
+ CRYPTOPP_ASSERT(false);
}
}
@@ -345,7 +345,7 @@ void TestAsymmetricCipher(TestData &v)
else
{
SignalTestError();
- assert(false);
+ CRYPTOPP_ASSERT(false);
}
}
@@ -443,7 +443,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
while (ss.Pump(64)) {}
ss.PumpAll();
for (int i=0; i<z.length(); i++)
- assert(encrypted[i] == z[i]);
+ CRYPTOPP_ASSERT(encrypted[i] == z[i]);
}*/
if (test != "EncryptXorDigest")
ciphertext = GetDecodedDatum(v, "Ciphertext");
@@ -608,7 +608,7 @@ void TestDigestOrMAC(TestData &v, bool testDigest)
else
{
SignalTestError();
- assert(false);
+ CRYPTOPP_ASSERT(false);
}
}
@@ -618,7 +618,7 @@ void TestKeyDerivationFunction(TestData &v)
std::string test = GetRequiredDatum(v, "Test");
if(test == "Skip") return;
- assert(test == "Verify");
+ CRYPTOPP_ASSERT(test == "Verify");
std::string key = GetDecodedDatum(v, "Key");
std::string salt = GetDecodedDatum(v, "Salt");
@@ -722,7 +722,7 @@ void OutputPair(const NameValuePairs &v, const char *name)
{
Integer x;
bool b = v.GetValue(name, x);
- CRYPTOPP_UNUSED(b); assert(b);
+ CRYPTOPP_UNUSED(b); CRYPTOPP_ASSERT(b);
cout << name << ": \\\n ";
x.Encode(HexEncoder(new FileSink(cout), false, 64, "\\\n ").Ref(), x.MinEncodedSize());
cout << endl;
@@ -768,7 +768,7 @@ void TestDataFile(std::string filename, const NameValuePairs &overrideParameters
while (file)
{
while (file.peek() == '#')
- file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+ file.ignore((std::numeric_limits<std::streamsize>::max)(), '\n');
if (file.peek() == '\n' || file.peek() == '\r')
v.clear();