2020-12-31 05:48:25 -03:00
|
|
|
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
2019-10-02 08:20:17 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2020-04-22 09:57:28 -04:00
|
|
|
#include <test/fuzz/FuzzedDataProvider.h>
|
2019-10-02 08:20:17 -03:00
|
|
|
#include <test/fuzz/fuzz.h>
|
2020-04-22 09:57:28 -04:00
|
|
|
#include <test/fuzz/util.h>
|
2019-10-02 08:20:17 -03:00
|
|
|
#include <util/bip32.h>
|
|
|
|
|
2020-04-22 09:57:28 -04:00
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
2020-12-03 12:42:49 -03:00
|
|
|
FUZZ_TARGET(parse_hd_keypath)
|
2019-10-02 08:20:17 -03:00
|
|
|
{
|
|
|
|
const std::string keypath_str(buffer.begin(), buffer.end());
|
|
|
|
std::vector<uint32_t> keypath;
|
|
|
|
(void)ParseHDKeypath(keypath_str, keypath);
|
2020-04-22 09:57:28 -04:00
|
|
|
|
|
|
|
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
|
|
|
const std::vector<uint32_t> random_keypath = ConsumeRandomLengthIntegralVector<uint32_t>(fuzzed_data_provider);
|
|
|
|
(void)FormatHDKeypath(random_keypath);
|
|
|
|
(void)WriteHDKeypath(random_keypath);
|
2019-10-02 08:20:17 -03:00
|
|
|
}
|