]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS ER: Fix SetSelectedRegistrar to include wildcard AuthorizedMACs
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 25 Oct 2010 18:45:29 +0000 (21:45 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 25 Oct 2010 18:45:29 +0000 (21:45 +0300)
This is required by WPS 2.0, so add the wildcard address to
AuthorizedMACs if no addresses are in the list.

src/wps/wps_er.c

index a5b252656972103e5ab89c26aafa8c5ebe9fc533..df556722d71c4ed8bcf68f590d9791ceb7657e2a 100644 (file)
@@ -1391,6 +1391,7 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
        struct wps_er_ap *ap;
        struct wps_registrar *reg = er->wps->registrar;
        const u8 *auth_macs;
+       u8 bcast[ETH_ALEN];
        size_t count;
        union wps_event_data data;
 
@@ -1404,6 +1405,13 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
                return;
 
        auth_macs = wps_authorized_macs(reg, &count);
+#ifdef CONFIG_WPS2
+       if (count == 0) {
+               os_memset(bcast, 0xff, ETH_ALEN);
+               auth_macs = bcast;
+               count = 1;
+       }
+#endif /* CONFIG_WPS2 */
 
        if (wps_build_version(msg) ||
            wps_er_build_selected_registrar(msg, sel_reg) ||