path: root/wpa_supplicant/wpas_glue.c
diff options
authorAhmed ElArabawy <arabawy@google.com>2018-03-15 16:00:10 (GMT)
committerJouni Malinen <j@w1.fi>2018-03-31 08:57:33 (GMT)
commit45f7574d31b543ef4f65551d095be2b42a32ac77 (patch)
tree2577288e516d0902ee428794f785df37a4145970 /wpa_supplicant/wpas_glue.c
parentc9aba19bd34af3f04517ca6bf37891d0ecb4d59b (diff)
Propagate the EAP method error code
In the current implementation, upon an EAP method failure, followed by an EAP failure, the EAP Status is propagated up in wpa_supplicant with a general failure parameter string "failure". This parameter is used for a notification on the dbus. This commit reports the EAP method failure error code in a separate callback. The solution in this commit is generic to all EAP methods, and can be used by any method that need to pass its error code. However, this commit only implements the reporting for EAP-SIM and EAP-AKA methods where the Notification Code (in AT_NOTIFICATION) is used as the method specific error code value. Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
Diffstat (limited to 'wpa_supplicant/wpas_glue.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index e44f6af..4634ed7 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1038,6 +1038,14 @@ static void wpa_supplicant_status_cb(void *ctx, const char *status,
+static void wpa_supplicant_eap_error_cb(void *ctx, int error_code)
+ struct wpa_supplicant *wpa_s = ctx;
+ wpas_notify_eap_error(wpa_s, error_code);
static void wpa_supplicant_set_anon_id(void *ctx, const u8 *id, size_t len)
struct wpa_supplicant *wpa_s = ctx;
@@ -1115,6 +1123,7 @@ int wpa_supplicant_init_eapol(struct wpa_supplicant *wpa_s)
ctx->cert_cb = wpa_supplicant_cert_cb;
ctx->cert_in_cb = wpa_s->conf->cert_in_cb;
ctx->status_cb = wpa_supplicant_status_cb;
+ ctx->eap_error_cb = wpa_supplicant_eap_error_cb;
ctx->set_anon_id = wpa_supplicant_set_anon_id;
ctx->cb_ctx = wpa_s;
wpa_s->eapol = eapol_sm_init(ctx);