]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS ER: Fix segfault in some selected registrar change cases
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 30 Nov 2011 12:44:23 +0000 (14:44 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 30 Nov 2011 12:44:23 +0000 (14:44 +0200)
Commit 628d54639a90f779fd5c98c31e049638de56b17e introduced number
of new WPS related ctrl_iface messages to hostapd. Some of these
were for ER events which do not make any sense to hostapd that
cannot operate as an ER. The WPS_EV_ER_SET_SELECTED_REGISTRAR one
from wps_registrar_sel_registrar_changed_event() was especially
problematic since it can cause wpa_supplicant ER code segfault due
to missing event data.

Revert all the ER specific changes from commit
628d54639a90f779fd5c98c31e049638de56b17e to get rid of the segfault
and undesired extra code in hostapd.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/wps_hostapd.c
src/wps/wps_common.c
src/wps/wps_i.h
src/wps/wps_registrar.c

index 671bc67470e3c03f49983db5b40fd69b81876256..28e037dc167b7566de7f398bbfef608418e80110 100644 (file)
@@ -599,22 +599,16 @@ static void hostapd_wps_event_cb(void *ctx, enum wps_event event,
                wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_TIMEOUT);
                break;
        case WPS_EV_ER_AP_ADD:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_ADD);
                break;
        case WPS_EV_ER_AP_REMOVE:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_REMOVE);
                break;
        case WPS_EV_ER_ENROLLEE_ADD:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_ENROLLEE_ADD);
                break;
        case WPS_EV_ER_ENROLLEE_REMOVE:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_ENROLLEE_REMOVE);
                break;
        case WPS_EV_ER_AP_SETTINGS:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_SETTINGS);
                break;
        case WPS_EV_ER_SET_SELECTED_REGISTRAR:
-               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_SET_SEL_REG);
                break;
        }
        if (hapd->wps_event_cb)
index a8942e93a6b6cf777ec19deee1b46ee91ab4848c..505837b174583b2e99a8fe8ad9b5863983022b67 100644 (file)
@@ -312,15 +312,6 @@ void wps_pbc_timeout_event(struct wps_context *wps)
 }
 
 
-void wps_registrar_sel_registrar_changed_event(struct wps_context *wps)
-{
-       if (wps->event_cb == NULL)
-               return;
-
-       wps->event_cb(wps->cb_ctx, WPS_EV_ER_SET_SELECTED_REGISTRAR, NULL);
-}
-
-
 #ifdef CONFIG_WPS_OOB
 
 static struct wpabuf * wps_get_oob_cred(struct wps_context *wps)
index a147da12e2ca63b1e50c80f4df037813e2d3c0ff..bdb6da2bfa832079836d3008e0c761d2d710e5d4 100644 (file)
@@ -228,7 +228,6 @@ void wps_success_event(struct wps_context *wps);
 void wps_pwd_auth_fail_event(struct wps_context *wps, int enrollee, int part);
 void wps_pbc_overlap_event(struct wps_context *wps);
 void wps_pbc_timeout_event(struct wps_context *wps);
-void wps_registrar_sel_registrar_changed_event(struct wps_context *wps);
 
 extern struct oob_device_data oob_ufd_device_data;
 extern struct oob_device_data oob_nfc_device_data;
index 4a49197904d5d12a542b43219fbfbd3a18b576f6..66ed41086a09c5f86d2692bbca729501ecdcfe7a 100644 (file)
@@ -3137,7 +3137,6 @@ static void wps_registrar_set_selected_timeout(void *eloop_ctx,
                   "unselect internal Registrar");
        reg->selected_registrar = 0;
        reg->pbc = 0;
-       wps_registrar_sel_registrar_changed_event(reg->wps);
        wps_registrar_selected_registrar_changed(reg);
 }