diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2024-02-10 21:29:48 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2024-02-10 21:29:50 -0500 |
commit | 9f6fe4c926931920570fac84fa2fcdc9de8a3324 (patch) | |
tree | b6a2f1e549a76cca854e11c01e54017ecab06a57 /tests | |
parent | 92b6dac2a1e292ed2654094e3c9c426ba27a1d97 (diff) |
Fix 32-bit-ism in protocol seqno rollover test from Terrapin fix
Fixes #2353
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_transport.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_transport.py b/tests/test_transport.py index 67e2eb45..59f871b8 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -1419,16 +1419,19 @@ class TestStrictKex: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Induce an about-to-rollover seqno, such that it rolls over - # during initial kex. + # during initial kex. (Sequence numbers are uint32, so we need + # the largest possible 32bit integer such that incrementing it + # will roll over to 0.) + last_seq = 2**32 - 1 setattr( self.packetizer, "_Packetizer__sequence_number_in", - sys.maxsize, + last_seq, ) setattr( self.packetizer, "_Packetizer__sequence_number_out", - sys.maxsize, + last_seq, ) with raises( |