From: Martin Stanislav Date: Mon, 1 Oct 2018 14:59:03 +0000 (+0200) Subject: eapol_test: Start the identifier at an initial random value X-Git-Tag: hostap_2_8~535 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfb01f58a61f96cc4cc1639926401598d3a923c2;p=thirdparty%2Fhostap.git eapol_test: Start the identifier at an initial random value 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 --- diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c index 6548bd17b..3fd4ce61a 100644 --- a/wpa_supplicant/eapol_test.c +++ b/wpa_supplicant/eapol_test.c @@ -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;