diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py index afdc45d70..a8f4aeb36 100644 --- a/tests/hwsim/test_eap_proto.py +++ b/tests/hwsim/test_eap_proto.py @@ -983,7 +983,7 @@ def test_eap_proto_sake_server(dev, apdev): # Unknown session # --> EAP-SAKE: Session ID mismatch sess, = struct.unpack('B', binascii.unhexlify(resp[20:22])) - sess = binascii.hexlify(struct.pack('B', sess + 1)).decode() + sess = binascii.hexlify(struct.pack('B', (sess + 1) % 256)).decode() msg = resp[0:4] + "0008" + resp[8:12] + "0008" + "3002" + sess + "00" tx_msg(dev[0], hapd, msg) # Unknown subtype