diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-03-30 09:32:35 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-03-30 10:42:45 +0200 |
commit | fa4926cca68db2433e579d9b4a642248a9314673 (patch) | |
tree | 882ddae72fde111eb8c5785c872c46f6cba0f496 /src/test/fuzz/signature_checker.cpp | |
parent | eeee8f5be1d4ccfb7e237248be5c6bef45b0fbb8 (diff) |
fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target
Can be reviewed with --color-moved=dimmed-zebra
Diffstat (limited to 'src/test/fuzz/signature_checker.cpp')
-rw-r--r-- | src/test/fuzz/signature_checker.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/fuzz/signature_checker.cpp b/src/test/fuzz/signature_checker.cpp index 17a5ae6e87..6b86c8889d 100644 --- a/src/test/fuzz/signature_checker.cpp +++ b/src/test/fuzz/signature_checker.cpp @@ -7,6 +7,7 @@ #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> +#include <test/util/script.h> #include <cstdint> #include <limits> @@ -61,10 +62,7 @@ FUZZ_TARGET_INIT(signature_checker, initialize_signature_checker) const auto script_2 = ConsumeScript(fuzzed_data_provider, 65536); std::vector<std::vector<unsigned char>> stack; (void)EvalScript(stack, script_1, flags, FuzzedSignatureChecker(fuzzed_data_provider), sig_version, nullptr); - if ((flags & SCRIPT_VERIFY_CLEANSTACK) != 0 && ((flags & SCRIPT_VERIFY_P2SH) == 0 || (flags & SCRIPT_VERIFY_WITNESS) == 0)) { - return; - } - if ((flags & SCRIPT_VERIFY_WITNESS) != 0 && (flags & SCRIPT_VERIFY_P2SH) == 0) { + if (!IsValidFlagCombination(flags)) { return; } (void)VerifyScript(script_1, script_2, nullptr, flags, FuzzedSignatureChecker(fuzzed_data_provider), nullptr); |