From 9bcb2b75ace5ef7217eb1688e14f011efd5e3323 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 30 May 2018 15:08:08 -0500 Subject: [PATCH] eapol: On success, reset EAP state Instead of destroying the EAP object, just reset its state in case the EAP process completed successfully. This allows EAP Reauthentication to work. --- src/eapol.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index fefb3fdc..f822ced6 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -1487,11 +1487,14 @@ static void eapol_eap_complete_cb(enum eap_result result, void *user_data) "eapSuccess" : (result == EAP_RESULT_FAIL ? "eapFail" : "eapTimeout")); - eap_free(sm->eap); - sm->eap = NULL; - - if (result != EAP_RESULT_SUCCESS) + if (result != EAP_RESULT_SUCCESS) { + eap_free(sm->eap); + sm->eap = NULL; handshake_failed(sm, MMPDU_REASON_CODE_IEEE8021X_FAILED); + return; + } + + eap_reset(sm->eap); } /* This respresentes the eapResults message */