Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/script_sign.cpp
| Show All 29 Lines | |||||
| } | } | ||||
| FUZZ_TARGET_INIT(script_sign, initialize_script_sign) { | FUZZ_TARGET_INIT(script_sign, initialize_script_sign) { | ||||
| FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); | FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); | ||||
| const std::vector<uint8_t> key = | const std::vector<uint8_t> key = | ||||
| ConsumeRandomLengthByteVector(fuzzed_data_provider, 128); | ConsumeRandomLengthByteVector(fuzzed_data_provider, 128); | ||||
| { | { | ||||
| CDataStream random_data_stream = | DataStream random_data_stream{ConsumeDataStream(fuzzed_data_provider)}; | ||||
| ConsumeDataStream(fuzzed_data_provider); | |||||
| std::map<CPubKey, KeyOriginInfo> hd_keypaths; | std::map<CPubKey, KeyOriginInfo> hd_keypaths; | ||||
| try { | try { | ||||
| DeserializeHDKeypaths(random_data_stream, key, hd_keypaths); | DeserializeHDKeypaths(random_data_stream, key, hd_keypaths); | ||||
| } catch (const std::ios_base::failure &) { | } catch (const std::ios_base::failure &) { | ||||
| } | } | ||||
| CDataStream serialized{SER_NETWORK, PROTOCOL_VERSION}; | CDataStream serialized{SER_NETWORK, PROTOCOL_VERSION}; | ||||
| SerializeHDKeypaths(serialized, hd_keypaths, | SerializeHDKeypaths(serialized, hd_keypaths, | ||||
| fuzzed_data_provider.ConsumeIntegral<uint8_t>()); | fuzzed_data_provider.ConsumeIntegral<uint8_t>()); | ||||
| ▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines | |||||