On Fri, Nov 01, 2019 at 11:18:42PM +0100, Alexander Wetzel wrote: > wpa_supplicant_set_suites() stores the key protocol in wpa_s->wpa_proto > and we have to select the WPA version of the eapol frame based on that. wpa_s->wpa_proto and WPA_PROTO_* are internal bitmap values and there is not really a "WPA version of the eapol frame".. > I just tripped over the fact that the eapol version number is wrong in > many captures when the frame has been sent by wpa_supplicant. What here is wrong? > But when you look into the *.hwsim0 test files you quite often see > something like here in ap_hs20_osen.hwsim0: > > RX EAPOL: 02:00:00:00:03:00 -> 02:00:00:00:05:00 ver=2 type=0 len=5 > RX EAPOL: 02:00:00:00:05:00 -> 02:00:00:00:03:00 ver=1 type=0 len=21 Which is fine.. The AP and station may be using different EAPOL versions. > The AP is using using version 2 but wpa_supplicant sets the version to 1 > for the reply. wpa_supplicant defaults to using EAPOL version 1 (IEEE Std 802.1X-2001) to avoid interoperability issues with incorrectly behaving APs. See wpa_supplicant.conf for more details on the eapol_version configuration parameter if you want to change this to 2 (IEEE Std 802.1X-2004). > I think I found and fixed the issue. I have not yet made a full new test > run, though. Fixed what issue? This looks like the expected behavior to me.. > diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c > @@ -69,7 +69,10 @@ static u8 * wpa_alloc_eapol(const struct wpa_supplicant *wpa_s, u8 type, > - hdr->version = wpa_s->conf->eapol_version; > + if (wpa_s->wpa_proto & (WPA_PROTO_RSN | WPA_PROTO_OSEN)) > + hdr->version = WPA_PROTO_RSN; > + else > + hdr->version = WPA_PROTO_WPA; This is clearly wrong. WPA_PROTO_* are internal values and have nothing to do with EAPOL frame Protocol Version field. -- Jouni Malinen PGP id EFC895FA _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap