elements/src/test/fuzz
Ava Chow 0ed2c130e7
Merge bitcoin/bitcoin#27375: net: support unix domain sockets for -proxy and -onion
567cec9a05 doc: add release notes and help text for unix sockets (Matthew Zipkin)
bfe5192891 test: cover UNIX sockets in feature_proxy.py (Matthew Zipkin)
c65c0d0163 init: allow UNIX socket path for -proxy and -onion (Matthew Zipkin)
c3bd43142e gui: accomodate unix socket Proxy in updateDefaultProxyNets() (Matthew Zipkin)
a88bf9dedd i2p: construct Session with Proxy instead of CService (Matthew Zipkin)
d9318a37ec net: split ConnectToSocket() from ConnectDirectly() for unix sockets (Matthew Zipkin)
ac2ecf3182 proxy: rename randomize_credentials to m_randomize_credentials (Matthew Zipkin)
a89c3f59dc netbase: extend Proxy class to wrap UNIX socket as well as TCP (Matthew Zipkin)
3a7d6548ef net: move CreateSock() calls from ConnectNode() to netbase methods (Matthew Zipkin)
74f568cb6f netbase: allow CreateSock() to create UNIX sockets if supported (Matthew Zipkin)
bae86c8d31 netbase: refactor CreateSock() to accept sa_family_t (Matthew Zipkin)
adb3a3e51d configure: test for unix domain sockets (Matthew Zipkin)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/27252

  UNIX domain sockets are a mechanism for inter-process communication that are faster than local TCP ports (because there is no need for TCP overhead) and potentially more secure because access is managed by the filesystem instead of serving an open port on the system.

  There has been work on [unix domain sockets before](https://github.com/bitcoin/bitcoin/pull/9979) but for now I just wanted to start on this single use-case which is enabling unix sockets from the client side, specifically connecting to a local Tor proxy (Tor can listen on unix sockets and even enforces strict curent-user-only access permission before binding) configured by `-onion=` or `-proxy=`

  I copied the prefix `unix:` usage from Tor. With this patch built locally you can test with your own filesystem path (example):

  `tor --SocksPort unix:/Users/matthewzipkin/torsocket/x`

  `bitcoind -proxy=unix:/Users/matthewzipkin/torsocket/x`

  Prep work for this feature includes:
  - Moving where and how we create `sockaddr` and `Sock` to accommodate `AF_UNIX` without disturbing `CService`
  - Expanding `Proxy` class to represent either a `CService` or a UNIX socket (by its file path)

  Future work:
  - Enable UNIX sockets for ZMQ (https://github.com/bitcoin/bitcoin/pull/27679)
  - Enable UNIX sockets for I2P SAM proxy (some code is included in this PR but not tested or exposed to user options yet)
  - Enable UNIX sockets on windows where supported
  - Update Network Proxies dialog in GUI to support UNIX sockets

ACKs for top commit:
  Sjors:
    re-ACK 567cec9a05
  tdb3:
    re ACK for 567cec9a05.
  achow101:
    ACK 567cec9a05
  vasild:
    ACK 567cec9a05

Tree-SHA512: de81860e56d5de83217a18df4c35297732b4ad491e293a0153d2d02a0bde1d022700a1131279b187ef219651487537354b9d06d10fde56225500c7e257df92c1
2024-03-13 06:53:07 -04:00
..
util fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
addition_overflow.cpp fuzz: Assume presence of __builtin_*_overflow, without checks 2024-01-09 16:46:58 +01:00
addrman.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
asmap.cpp
asmap_direct.cpp
autofile.cpp fuzz: AutoFile with XOR 2023-11-14 17:41:54 +01:00
banman.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
base_encode_decode.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bech32.cpp
bip324.cpp fuzz: BIP324: damage ciphertext/aad in full byte range 2023-11-28 02:30:09 +01:00
bitdeque.cpp fuzz: Avoid timeout in bitdeque 2023-12-06 15:44:38 +01:00
block.cpp fuzz: Drop unused version from fuzz input format 2023-11-30 11:27:21 +01:00
block_header.cpp
blockfilter.cpp
bloom_filter.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
buffered_file.cpp streams: Base BufferedFile on AutoFile instead of CAutoFile 2023-11-18 00:15:22 +10:00
chain.cpp chain: Rename HaveTxsDownloaded to HaveNumChainTxs 2023-10-06 19:43:32 +02:00
checkqueue.cpp refactor: Make CCheckQueue constructor start worker threads 2023-10-03 10:52:15 +01:00
coins_view.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
coinscache_sim.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
connman.cpp fuzz: fix connman initialization 2024-01-09 15:15:36 -03:00
crypto.cpp refactor: use Span for SipHash::Write 2023-07-17 13:27:46 +02:00
crypto_aes256.cpp
crypto_aes256cbc.cpp
crypto_chacha20.cpp fuzz: support std::byte in Consume{Fixed,Variable}LengthByteVector 2023-08-17 15:31:56 -04:00
crypto_common.cpp
crypto_diff_fuzz_chacha20.cpp crypto: require key on ChaCha20 initialization 2023-08-17 15:31:27 -04:00
crypto_hkdf_hmac_sha256_l32.cpp
crypto_poly1305.cpp fuzz: support std::byte in Consume{Fixed,Variable}LengthByteVector 2023-08-17 15:31:56 -04:00
cuckoocache.cpp
decode_tx.cpp
descriptor_parse.cpp fuzz: rule-out too deep derivation paths in descriptor parsing targets 2023-12-31 16:19:56 +01:00
deserialize.cpp fuzz: Drop unused version from fuzz input format 2023-11-30 11:27:21 +01:00
eval_script.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
fee_rate.cpp
fees.cpp [net processing] FeeFilterRounder doesn't own a FastRandomContext 2023-10-04 13:16:52 +01:00
flatfile.cpp Refactor: Remove unused FlatFilePos::SetNull 2023-03-21 13:54:11 +01:00
float.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
fuzz.cpp Merge bitcoin/bitcoin#27375: net: support unix domain sockets for -proxy and -onion 2024-03-13 06:53:07 -04:00
fuzz.h refactor: Drop unused _Pragma to ignore -Wgnu-zero-variadic-macro-arguments 2023-12-07 11:06:05 +01:00
FuzzedDataProvider.h doc: fix typos 2023-11-07 10:21:51 +09:00
golomb_rice.cpp refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
headerssync.cpp Rename CalculateHeadersWork to CalculateClaimedHeadersWork 2024-03-05 10:01:24 -05:00
hex.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
http_request.cpp refactor: Remove call to ShutdownRequested from HTTPRequest 2023-12-04 15:39:15 -04:00
integer.cpp crypto: replace CountBits with std::bit_width 2024-02-26 16:13:12 +00:00
key.cpp [fuzz] Improve fuzzing stability for ellswift_roundtrip harness 2024-01-10 16:21:16 +00:00
key_io.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
kitchen_sink.cpp
load_external_block_file.cpp blockstorage: switch from CAutoFile to AutoFile 2023-11-18 03:01:03 +10:00
locale.cpp
merkleblock.cpp refactor: Use Txid in CMerkleBlock 2023-11-28 17:49:41 +01:00
message.cpp fuzz: introduce and use ConsumePrivateKey helper 2023-09-06 13:59:12 +02:00
mini_miner.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
miniscript.cpp serialize: Drop useless version param from GetSerializeSize() 2023-11-16 11:14:13 +10:00
minisketch.cpp [fuzz] Improve fuzzing stability for minisketch harness 2023-12-14 20:10:21 +00:00
muhash.cpp
multiplication_overflow.cpp fuzz: Assume presence of __builtin_*_overflow, without checks 2024-01-09 16:46:58 +01:00
net.cpp fuzz: add target for local addresses 2024-02-29 14:13:58 -03:00
net_permissions.cpp Merge bitcoin/bitcoin#27114: p2p: Allow whitelisting manual connections 2024-03-12 12:59:02 -04:00
netaddress.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
netbase_dns_lookup.cpp p2p: return CSubNet in LookupSubNet 2023-05-30 16:27:21 -03:00
node_eviction.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
p2p_transport_serialization.cpp refactor: P2P transport without serialize version and type 2023-11-23 13:43:39 +01:00
package_eval.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
parse_hd_keypath.cpp Switch hardened derivation marker to h in descriptors 2023-04-04 18:33:08 +02:00
parse_numbers.cpp
parse_script.cpp
parse_univalue.cpp refactor: Revert addition of univalue sighash string check 2023-07-27 09:36:05 +02:00
partially_downloaded_block.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
policy_estimator.cpp test: change m_submitted_in_package input to fuzz data provider boolean 2024-01-02 12:41:01 +01:00
policy_estimator_io.cpp fuzz: Remove FuzzedAutoFileProvider 2023-11-14 17:41:26 +01:00
poolresource.cpp Add PoolResource fuzzer 2023-03-23 19:38:38 +01:00
pow.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
prevector.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
primitives_transaction.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
process_message.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
process_messages.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
protocol.cpp
psbt.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
random.cpp
rbf.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
rolling_bloom_filter.cpp
rpc.cpp fuzz: Use C++20 starts_with in rpc.cpp 2023-12-07 11:06:16 +01:00
script.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
script_assets_test_minimizer.cpp refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
script_bitcoin_consensus.cpp fuzz: add coverage for bitcoinconsensus_verify_script_with_spent_outputs 2023-10-13 08:55:12 -03:00
script_descriptor_cache.cpp
script_flags.cpp Fix IWYU for the script_flags fuzz target 2023-11-23 17:57:53 +01:00
script_format.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
script_interpreter.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
script_ops.cpp
script_sigcache.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
script_sign.cpp Remove unused CDataStream 2023-11-30 11:27:54 +01:00
scriptnum_ops.cpp
secp256k1_ec_seckey_import_export_der.cpp
secp256k1_ecdsa_signature_parse_der_lax.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
signature_checker.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
signet.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
socks5.cpp netbase: use reliable send() during SOCKS5 handshake 2023-10-31 18:19:37 +01:00
span.cpp
spanparsing.cpp
string.cpp Merge bitcoin/bitcoin#27576: kernel: Remove args, settings, chainparams, chainparamsbase from kernel library 2023-06-09 14:58:49 -04:00
strprintf.cpp
system.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
timedata.cpp
torcontrol.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
transaction.cpp fuzz: Drop unused version from fuzz input format 2023-11-30 11:27:21 +01:00
tx_in.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
tx_out.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
tx_pool.cpp Merge bitcoin/bitcoin#28960: kernel: Remove dependency on CScheduler 2024-03-08 20:58:04 -05:00
txorphan.cpp fuzz: Improve fuzzing stability for txorphan harness 2023-12-08 13:14:46 +00:00
txrequest.cpp
util.cpp fuzz: restrict fopencookie usage to Linux & FreeBSD 2024-03-05 21:18:44 +00:00
util.h Remove unused version.h include 2023-11-30 11:28:19 +01:00
utxo_snapshot.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
utxo_total_supply.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
validation_load_mempool.cpp fuzz: Remove FuzzedAutoFileProvider 2023-11-14 17:41:26 +01:00
versionbits.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00