bitcoin/test/functional/test_framework
Ava Chow c51c694ede
Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake
c9dacd958d test: Check that non empty version packet is ignored and no disconnection happens (stratospher)
997cc00b95 test: Check that disconnection happens when AAD isn't filled (stratospher)
b5e6238fdb test: Check that disconnection happens when garbage sent/received are different (stratospher)
ad1482d5a2 test: Check that disconnection happens when wrong garbage terminator is sent (stratospher)
e351576862 test: Check that disconnection happens when >4095 garbage bytes is sent (stratospher)
e075fd131d test: Introduce test types and modify v2 handshake function accordingly (stratospher)
7d07daa623 log: Add V2 handshake timeout (stratospher)
d4a1da8543 test: Make global TRANSPORT_VERSION variable an instance variable (stratospher)
c642b08c4e test: Log when the garbage is actually sent to transport layer (stratospher)
86cca2cba2 test: Support disconnect waiting for add_p2p_connection (stratospher)
bf9669af9c test: Rename early key response test and move random_bitflip to util (stratospher)

Pull request description:

  Add tests for the following v2 handshake scenarios:
  1. Disconnection happens when > `MAX_GARBAGE_LEN` bytes garbage is sent
  2. Disconnection happens when incorrect garbage terminator is sent
  3. Disconnection happens when garbage bytes are tampered with
  4. Disconnection happens when AAD of first encrypted packet after the garbage terminator is not filled
  5. bitcoind ignores non-empty version packet and no disconnection happens

  All these tests require a modified v2 P2P class (different from `EncryptedP2PState` used in `v2_p2p.py`) to implement our custom handshake behaviour based on different scenarios and have been kept in a single test file (`test/functional/p2p_v2_misbehaving.py`). Shifted the test in `test/functional/p2p_v2_earlykeyresponse.py` which is of the same pattern to this file too.

ACKs for top commit:
  achow101:
    ACK c9dacd958d
  mzumsande:
    ACK c9dacd958d
  theStack:
    Code-review ACK c9dacd958d

Tree-SHA512: 90df81f0c7f4ecf0a47762d290a618ded92cde9f83d3ef3cc70e1b005ecb16125ec39a9d80ce95f99e695d29abd63443240cb5490aa57c5bc8fa2e52149a0672
2024-07-09 16:37:27 -04:00
..
crypto crypto: add NUMS_H const 2024-05-14 10:24:31 +02:00
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py test: add MiniWallet tagging support to avoid UTXO mixing 2024-05-05 12:33:34 +02:00
authproxy.py test: use json-rpc 2.0 in all functional tests by default 2024-06-07 09:26:55 -04:00
bdb.py scripted-diff: Bump copyright headers 2021-11-10 11:10:24 +01:00
bip340_test_vectors.csv tests: add BIP340 Schnorr signature support to test framework 2020-10-12 17:18:47 -07:00
blockfilter.py Merge bitcoin/bitcoin#28605: Fix typos 2023-11-16 10:35:49 +00:00
blocktools.py [test]: remove duplicate WITNESS_SCALE_FACTOR 2024-05-03 10:30:50 +01:00
coverage.py test: fix PEP484 no implicit optional argument types errors 2023-06-29 16:14:07 -06:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py test: Rename early key response test and move random_bitflip to util 2024-03-11 12:58:20 +05:30
mempool_util.py test: use tagged ephemeral MiniWallet instance in fill_mempool 2024-05-05 12:36:51 +02:00
messages.py refactor: Rename CTransaction::nVersion to version 2024-06-07 13:55:23 -04:00
netutil.py test: cover UNIX sockets in feature_proxy.py 2024-03-01 14:47:29 -05:00
p2p.py Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake 2024-07-09 16:37:27 -04:00
psbt.py test: PSBT: eliminate magic numbers for global unsigned tx key (0) 2023-03-04 12:43:38 +01:00
script.py refactor: Rename CTransaction::nVersion to version 2024-06-07 13:55:23 -04:00
script_util.py test: add unit test for keys_to_multisig_script 2024-06-05 16:18:31 +02:00
segwit_addr.py Use Bech32m encoding for v1+ segwit addresses 2021-03-16 10:48:36 -07:00
socks5.py test: add keep_alive option to socks5 proxy in test_framework 2023-07-10 10:07:45 -04:00
test_framework.py test: Remove redundant verack check 2024-06-10 07:58:10 +02:00
test_node.py Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake 2024-07-09 16:37:27 -04:00
test_shell.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
util.py Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake 2024-07-09 16:37:27 -04:00
v2_p2p.py test: Check that disconnection happens when >4095 garbage bytes is sent 2024-06-21 19:37:13 +05:30
wallet.py Merge bitcoin/bitcoin#29325: consensus: Store transaction nVersion as uint32_t 2024-06-12 10:32:31 +01:00
wallet_util.py Fix typos in description.md and wallet_util.py 2024-04-25 16:14:10 +08:00