Commit graph

4 commits

Author SHA1 Message Date
stratospher
bf9669af9c test: Rename early key response test and move random_bitflip to util
Early key response test is a special kind of test which requires
modified v2 handshake functions. More such tests can be added
where v2 handshake functions send incorrect garbage terminator,
excess garbage bytes etc.. Hence, rename p2p_v2_earlykey.py to a
general test file name - p2p_v2_misbehaving.py.

random_bitflip function (used in signature tests prior to this
commit) can be used in p2p_v2_misbehaving test to generate wrong
garbage terminator, wrong garbage bytes etc..
So, move the function to util.
2024-03-11 12:58:20 +05:30
Martin Zumsande
5fc9db504b test: enable p2p_sendtxrcncl.py with v2transport
By adding to the test framework a wait until the v2 handshake
is completed, so that p2p_sendtxrcncl.py (which doesn't need
to be changed itself) doesnt't send out any other messages before that.
2024-02-06 15:59:17 -05:00
Martin Zumsande
9642aefb81 test: fix intermittent failure in p2p_v2_earlykeyresponse
This fixes a possible race between the python NetworkThread and the actual
test, which will both call initiate_v2_handshake.
2024-01-31 10:21:44 -05:00
stratospher
bc9283c441 [test] Add functional test to test early key response behaviour in BIP 324
- A node initiates a v2 connection by sending 64 bytes ellswift
- In BIP 324 "The responder waits until one byte is received which does not match the
  V1_PREFIX (16 bytes consisting of the network magic followed by "version\x00\x00\x00\x00\x00".)"
- It's possible that the 64 bytes ellswift sent by an initiator starts with a prefix of V1_PREFIX
- Example form of 64 bytes ellswift could be:
	4 bytes network magic + 60 bytes which aren't prefixed with remaining V1_PREFIX
- We test this behaviour:
	- when responder receives 4 byte network magic -> no response received by initiator
	- when first mismatch happens -> response received by initiator
2024-01-25 11:12:15 +05:30