Propagate the EAP method error code
In current implementaion, 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.
Bug: 64612561
Test: Manual
Change-Id: I27736fbaa5d92c4d9f0623ccd642177df2c49a0e
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index e44f6af..e29f13b 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1037,6 +1037,12 @@
wpas_notify_eap_status(wpa_s, status, parameter);
}
+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)
{
@@ -1115,6 +1121,7 @@
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);