Add tests for the following v2 handshake scenarios:
- Disconnection happens when >
MAX_GARBAGE_LEN
bytes garbage is sent - Disconnection happens when incorrect garbage terminator is sent
- Disconnection happens when garbage bytes are tampered with
- Disconnection happens when AAD of first encrypted packet after the garbage terminator is not filled
- 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.