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

Jouni Malinen j at w1.fi
Sat Sep 5 15:10:12 EDT 2015


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
failures?

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