]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eapol_test: Start the identifier at an initial random value
authorMartin Stanislav <ms@uakom.sk>
Mon, 1 Oct 2018 14:59:03 +0000 (16:59 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 8 Jan 2019 11:40:33 +0000 (13:40 +0200)
Start the (EAP request) identifier at an initial random value
as recommended by RFC 3748 in section 4.1 Request and Response
on page 21.

Signed-off-by: Martin Stanislav <ms@uakom.sk>
wpa_supplicant/eapol_test.c

index 6548bd17b11f83ccb639bc5be0ce767ea9c52b80..3fd4ce61a1c28ae3984d0243cfdebafc1301069d 100644 (file)
@@ -711,7 +711,8 @@ static void send_eap_request_identity(void *eloop_ctx, void *timeout_ctx)
 
        eap = (struct eap_hdr *) (hdr + 1);
        eap->code = EAP_CODE_REQUEST;
-       eap->identifier = 0;
+       if (os_get_random((u8 *) &eap->identifier, sizeof(eap->identifier)) < 0)
+               eap->identifier = os_random() & 0xff;
        eap->length = htons(5);
        pos = (u8 *) (eap + 1);
        *pos = EAP_TYPE_IDENTITY;