0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-06 10:18:44 -05:00
bitcoin-bitcoin-core/src/test/fuzz
MarcoFalke 18cd0888ef
Merge #21328: net, refactor: pass uint16 CService::port as uint16
52dd40a9fe test: add missing netaddress include headers (Jon Atack)
6f09c0f6b5 util: add missing braces and apply clang format to SplitHostPort() (Jon Atack)
2875a764f7 util: add ParseUInt16(), use it in SplitHostPort() (Jon Atack)
6423c8175f p2p, refactor: pass and use uint16_t CService::port as uint16_t (Jon Atack)

Pull request description:

  As noticed during review today in https://github.com/bitcoin/bitcoin/pull/20685#discussion_r584873708 of the upcoming I2P network support, `CService::port` is `uint16_t` but is passed around the codebase and into the ctors as `int`, which causes uneeded conversions and casts. We can avoid these (including in the incoming I2P code without further changes to it) by using ports with the correct type. The remaining conversions are pushed out to the user input boundaries where they can be range-checked and raise with user feedback in the next patch.

ACKs for top commit:
  practicalswift:
    cr ACK 52dd40a9fe: patch looks correct
  MarcoFalke:
    cr ACK 52dd40a9fe
  vasild:
    ACK 52dd40a9fe

Tree-SHA512: 203c1cab3189a206c55ecada77b9548b810281cdc533252b8e3330ae0606b467731c75f730ce9deb07cbaab66facf97e1ffd2051084ff9077cba6750366b0432
2021-03-19 20:47:10 +01:00
..
addition_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrdb.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrman.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
asmap.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
asmap_direct.cpp test: add missing netaddress include headers 2021-03-16 19:52:37 +01:00
autofile.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
banman.cpp Move MakeNoLogFileContext to common libtest_util, and use it in bench 2021-03-03 09:17:37 +01:00
base_encode_decode.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bech32.cpp Implement Bech32m encoding/decoding 2021-03-15 17:26:35 -07:00
block.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
block_header.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
blockfilter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bloom_filter.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
buffered_file.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
chain.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
checkqueue.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
coins_view.cpp node/coinstats: Pass in BlockManager to GetUTXOStats 2021-03-08 15:54:31 -05:00
connman.cpp net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection 2021-03-04 19:54:17 +00:00
crypto.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
crypto_aes256.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_aes256cbc.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_chacha20.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
crypto_chacha20_poly1305_aead.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
crypto_common.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_hkdf_hmac_sha256_l32.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_poly1305.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
cuckoocache.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
danger_link_all.sh build: Add option --enable-danger-fuzz-link-all 2020-12-14 16:55:56 +01:00
data_stream.cpp Move MakeNoLogFileContext to common libtest_util, and use it in bench 2021-03-03 09:17:37 +01:00
decode_tx.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
descriptor_parse.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
deserialize.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
eval_script.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
fee_rate.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fees.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
flatfile.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
float.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fuzz.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
fuzz.h scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
FuzzedDataProvider.h fuzz: Bump FuzzedDataProvider.h 2021-03-09 12:56:44 +01:00
golomb_rice.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
hex.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
http_request.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
integer.cpp util: Avoid invalid integer negation in ValueFromAmount: make ValueFromAmount(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min() 2021-03-02 16:05:28 +00:00
key.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
key_io.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
kitchen_sink.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
load_external_block_file.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
locale.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
merkleblock.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
message.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
muhash.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
multiplication_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
net.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
net_permissions.cpp fuzz: Add ConsumeWeakEnum helper, Extract ALL_NET_PERMISSION_FLAGS 2021-01-02 15:07:07 +01:00
netaddress.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
netbase_dns_lookup.cpp p2p, refactor: pass and use uint16_t CService::port as uint16_t 2021-03-16 19:52:31 +01:00
node_eviction.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
p2p_transport_deserializer.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
parse_hd_keypath.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_iso8601.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_numbers.cpp test: add ParseUInt8() unit and fuzz test coverage 2021-03-15 20:50:20 +01:00
parse_script.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_univalue.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
policy_estimator.cpp Move MakeNoLogFileContext to common libtest_util, and use it in bench 2021-03-03 09:17:37 +01:00
policy_estimator_io.cpp Move MakeNoLogFileContext to common libtest_util, and use it in bench 2021-03-03 09:17:37 +01:00
pow.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
prevector.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
primitives_transaction.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
process_message.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
process_messages.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
protocol.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
psbt.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
random.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
rbf.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
rolling_bloom_filter.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
script.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
script_assets_test_minimizer.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
script_bitcoin_consensus.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_descriptor_cache.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
script_flags.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
script_interpreter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_ops.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
script_sigcache.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
script_sign.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
scriptnum_ops.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
secp256k1_ec_seckey_import_export_der.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
secp256k1_ecdsa_signature_parse_der_lax.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
signature_checker.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
signet.cpp Move MakeNoLogFileContext to common libtest_util, and use it in bench 2021-03-03 09:17:37 +01:00
socks5.cpp test: add missing netaddress include headers 2021-03-16 19:52:37 +01:00
span.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
spanparsing.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
string.cpp test: add missing netaddress include headers 2021-03-16 19:52:37 +01:00
strprintf.cpp scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext 2021-02-22 10:27:22 +01:00
system.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
timedata.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
torcontrol.cpp fuzz: Add missing include (test/util/setup_common.h) 2021-03-04 08:39:27 +01:00
transaction.cpp util: Avoid invalid integer negation in ValueFromAmount: make ValueFromAmount(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min() 2021-03-02 16:05:28 +00:00
tx_in.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
tx_out.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
txrequest.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
util.cpp fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSION 2021-01-23 20:04:37 +01:00
util.h tests: Set errno in FuzzedFileProvider. Implement seek(..., ..., SEEK_END). 2021-03-11 22:34:39 +00:00
validation_load_mempool.cpp tests: Add fuzzing harness for LoadMempool(...) and DumpMempool(...) 2021-03-15 15:42:15 +00:00
versionbits.cpp tests: Add fuzzing harness for versionbits 2021-03-19 15:05:21 +10:00