mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge deb2327b43 into merged_master (Bitcoin PR #17018)
This commit is contained in:
commit
24ca3f2864
4 changed files with 33 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ FUZZ_TARGETS = \
|
|||
test/fuzz/blockundo_deserialize \
|
||||
test/fuzz/bloomfilter_deserialize \
|
||||
test/fuzz/coins_deserialize \
|
||||
test/fuzz/descriptor_parse \
|
||||
test/fuzz/diskblockindex_deserialize \
|
||||
test/fuzz/eval_script \
|
||||
test/fuzz/inv_deserialize \
|
||||
|
|
@ -262,6 +263,12 @@ test_fuzz_coins_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|||
test_fuzz_coins_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
test_fuzz_coins_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
||||
|
||||
test_fuzz_descriptor_parse_SOURCES = $(FUZZ_SUITE) test/fuzz/descriptor_parse.cpp
|
||||
test_fuzz_descriptor_parse_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
test_fuzz_descriptor_parse_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
test_fuzz_descriptor_parse_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
test_fuzz_descriptor_parse_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
||||
|
||||
test_fuzz_netaddr_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
||||
test_fuzz_netaddr_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DNETADDR_DESERIALIZE=1
|
||||
test_fuzz_netaddr_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
|
|
|
|||
22
src/test/fuzz/descriptor_parse.cpp
Normal file
22
src/test/fuzz/descriptor_parse.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2009-2019 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <script/descriptor.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
void initialize()
|
||||
{
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
void test_one_input(const std::vector<uint8_t>& buffer)
|
||||
{
|
||||
const std::string descriptor(buffer.begin(), buffer.end());
|
||||
FlatSigningProvider signing_provider;
|
||||
std::string error;
|
||||
for (const bool require_checksum : {true, false}) {
|
||||
Parse(descriptor, signing_provider, error, require_checksum);
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,9 @@ static bool read_stdin(std::vector<uint8_t>& data)
|
|||
return length == 0;
|
||||
}
|
||||
|
||||
static void initialize()
|
||||
// Default initialization: Override using a non-weak initialize().
|
||||
__attribute__((weak))
|
||||
void initialize()
|
||||
{
|
||||
const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
void initialize();
|
||||
void test_one_input(const std::vector<uint8_t>& buffer);
|
||||
|
||||
#endif // BITCOIN_TEST_FUZZ_FUZZ_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue