mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target
Can be reviewed with --color-moved=dimmed-zebra
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user