Subject: [PATCH] Provide the information whether the WPA/RSN EAPOL-Key message sent or failed

Avichal Agarwal avichal.a at
Tue Sep 8 00:10:05 EDT 2015

Dear Jouni

We have encountered one problem  in which peer device keeps on sending 3/4
 and each time supplicant shows Connected event. And after some time disconnection takes place.
While in 4 Way Handshake, After receiving 3/4, supplicant sends 4/4 
and shows CTRL_EVENT_CONNECTED  without properly verifying whether 4/4 send was success or fail.

So This patch will show Connected event only after successful transmission of 4/4 (Return 0 from wpa_eapol_key_send() ). 

Avichal Agarwal 

------- Original Message -------
Sender : Jouni Malinen<j at>
Date : Sep 06, 2015 00:40 (GMT+05:30)
Title : Re: Subject: [PATCH] Provide the information whether the WPA/RSN EAPOL-Key message sent or failed

On Fri, Aug 28, 2015 at 04:38:03AM +0000, Avichal Agarwal wrote:
> This patch provide the exact information whether WPA/RSN EAPOL-Key message sent
> successfully or failed. Now wpa_eapol_key_send will return 0 on success and -1 on failure.

Could you please clarify why this change is needed? Is there some
additional changes that would be used on top of this to react to

That comment about wpa_eapol_key_send() returning 0 on success is not
correct. It returns >= 0 on success and that > 0 case breaks number of
things here. For example, PeerKey initiation does not work with this
patch because of that.

> diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
> @@ -34,11 +34,13 @@
>   * @msg: EAPOL-Key message
>   * @msg_len: Length of message
>   * @key_mic: Pointer to the buffer to which the EAPOL-Key MIC is written
> + * Returns: >=0 on success, <0 on failure
>   */
> -void wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len,

This comment is in conflict with the commit message. It would sound
safest to modify this function to follow the commit message, i.e.,
return 0 on success (convert >= 0 to 0) since some of the functions
calling wpa_eapol_key_send() will need to return (e.g.,
wpa_sm_stkstart() returning > 0 breaks that PeerKey initiation).

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list