aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2012-10-20 10:56:04 -0700
committerJeff Garzik <[email protected]>2012-10-20 10:56:04 -0700
commitdee0ee2ac9d6feb49eac9683c01a0eeed4389449 (patch)
tree9eaf50e73a51a3b40da9cb557090a794138e9f35 /src/test/DoS_tests.cpp
parentRevert "Merge pull request #1931 from laanwj/2012_10_newicons" (diff)
parentCheck for canonical public keys and signatures (diff)
downloaddiscoin-dee0ee2ac9d6feb49eac9683c01a0eeed4389449.tar.xz
discoin-dee0ee2ac9d6feb49eac9683c01a0eeed4389449.zip
Merge pull request #1742 from sipa/canonical
Check for canonical public keys and signatures
Diffstat (limited to 'src/test/DoS_tests.cpp')
-rw-r--r--src/test/DoS_tests.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp
index 7f08dd554..d46959312 100644
--- a/src/test/DoS_tests.cpp
+++ b/src/test/DoS_tests.cpp
@@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
mst1 = boost::posix_time::microsec_clock::local_time();
for (unsigned int i = 0; i < 5; i++)
for (unsigned int j = 0; j < tx.vin.size(); j++)
- BOOST_CHECK(VerifySignature(orphans[j], tx, j, true, SIGHASH_ALL));
+ BOOST_CHECK(VerifySignature(orphans[j], tx, j, true, true, SIGHASH_ALL));
mst2 = boost::posix_time::microsec_clock::local_time();
msdiff = mst2 - mst1;
long nManyValidate = msdiff.total_milliseconds();
@@ -289,13 +289,13 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
// Empty a signature, validation should fail:
CScript save = tx.vin[0].scriptSig;
tx.vin[0].scriptSig = CScript();
- BOOST_CHECK(!VerifySignature(orphans[0], tx, 0, true, SIGHASH_ALL));
+ BOOST_CHECK(!VerifySignature(orphans[0], tx, 0, true, true, SIGHASH_ALL));
tx.vin[0].scriptSig = save;
// Swap signatures, validation should fail:
std::swap(tx.vin[0].scriptSig, tx.vin[1].scriptSig);
- BOOST_CHECK(!VerifySignature(orphans[0], tx, 0, true, SIGHASH_ALL));
- BOOST_CHECK(!VerifySignature(orphans[1], tx, 1, true, SIGHASH_ALL));
+ BOOST_CHECK(!VerifySignature(orphans[0], tx, 0, true, true, SIGHASH_ALL));
+ BOOST_CHECK(!VerifySignature(orphans[1], tx, 1, true, true, SIGHASH_ALL));
std::swap(tx.vin[0].scriptSig, tx.vin[1].scriptSig);
// Exercise -maxsigcachesize code:
@@ -305,7 +305,7 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
BOOST_CHECK(SignSignature(keystore, orphans[0], tx, 0));
BOOST_CHECK(tx.vin[0].scriptSig != oldSig);
for (unsigned int j = 0; j < tx.vin.size(); j++)
- BOOST_CHECK(VerifySignature(orphans[j], tx, j, true, SIGHASH_ALL));
+ BOOST_CHECK(VerifySignature(orphans[j], tx, j, true, true, SIGHASH_ALL));
mapArgs.erase("-maxsigcachesize");
LimitOrphanTxSize(0);