aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stanislav <ms@uakom.sk>2018-10-01 14:59:03 (GMT)
committerJouni Malinen <j@w1.fi>2019-01-08 11:40:33 (GMT)
commitcfb01f58a61f96cc4cc1639926401598d3a923c2 (patch)
tree6830426a1545b68b3e32508327eaefe4e685291a
parent6bcbda408233f4d1fa01e8982dfe497663fcc73f (diff)
downloadhostap-cfb01f58a61f96cc4cc1639926401598d3a923c2.zip
hostap-cfb01f58a61f96cc4cc1639926401598d3a923c2.tar.gz
hostap-cfb01f58a61f96cc4cc1639926401598d3a923c2.tar.bz2
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 <ms@uakom.sk>
-rw-r--r--wpa_supplicant/eapol_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index 6548bd1..3fd4ce6 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;