The EAP-Success cases with id off by 2 or 3 need to handle the special
cases where the id wraps around over the maximum value to avoid failures
when the random id value from hostapd ends up being close enough to the
maximum value.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
idx += 1
if ctx['num'] == idx:
logger.info("Test: EAP-Success - id off by 2")
- return struct.pack(">BBH", EAP_CODE_SUCCESS, id + 1, 4)
+ return struct.pack(">BBH", EAP_CODE_SUCCESS, (id + 1) % 256, 4)
idx += 1
if ctx['num'] == idx:
idx += 1
if ctx['num'] == idx:
logger.info("Test: EAP-Success - id off by 3")
- return struct.pack(">BBH", EAP_CODE_SUCCESS, id + 2, 4)
+ return struct.pack(">BBH", EAP_CODE_SUCCESS, (id + 2) % 256, 4)
idx += 1
if ctx['num'] == idx: