Reset EAPOL pointer when handling DBus smartcard parameters

Smartcard parameter update via DBus ended up re-initializing the EAPOL
state machine without updating the pointer inside WPA state machine.
This can trigger a segfault when EAP layer attempts to use the old
reference. Fix this by re-initializing the pointer inside WPA state
machine.
This commit is contained in:
David Smith 2009-11-11 17:46:15 +02:00 committed by Jouni Malinen
parent 355d36a7bf
commit d7199342f0

View file

@ -27,6 +27,7 @@
#include "wpas_glue.h" #include "wpas_glue.h"
#include "eapol_supp/eapol_supp_sm.h" #include "eapol_supp/eapol_supp_sm.h"
#include "wps_supplicant.h" #include "wps_supplicant.h"
#include "wpa.h"
extern int wpa_debug_level; extern int wpa_debug_level;
extern int wpa_debug_show_keys; extern int wpa_debug_show_keys;
@ -1270,8 +1271,11 @@ DBusMessage * wpas_dbus_iface_set_smartcard_modules(
wpa_s->conf->pkcs11_module_path = pkcs11_module_path; wpa_s->conf->pkcs11_module_path = pkcs11_module_path;
#endif /* EAP_TLS_OPENSSL */ #endif /* EAP_TLS_OPENSSL */
wpa_sm_set_eapol(wpa_s->wpa, NULL);
eapol_sm_deinit(wpa_s->eapol); eapol_sm_deinit(wpa_s->eapol);
wpa_s->eapol = NULL;
wpa_supplicant_init_eapol(wpa_s); wpa_supplicant_init_eapol(wpa_s);
wpa_sm_set_eapol(wpa_s->wpa, wpa_s->eapol);
return wpas_dbus_new_success_reply(message); return wpas_dbus_new_success_reply(message);