EAP server: Force FAILURE if EAP method buildReq fails
authorJouni Malinen <j@w1.fi>
Sun, 19 Jul 2015 13:29:29 +0000 (16:29 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Jul 2015 13:29:29 +0000 (16:29 +0300)
Previously, this resulted in unnecessary wait and retransmission of the
previous EAP-Request. Change that to trigger immediate transmission of
EAP-Failure and disconnection since the EAP method cannot really recover
from this state.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_server/eap_server.c

index d561ad9..b235a0f 100644 (file)
@@ -1247,6 +1247,17 @@ SM_STEP(EAP)
                        break;
                }
                SM_ENTER(EAP, SEND_REQUEST);
+               if (sm->eap_if.eapNoReq && !sm->eap_if.eapReq) {
+                       /*
+                        * This transition is not mentioned in RFC 4137, but it
+                        * is needed to handle cleanly a case where EAP method
+                        * buildReq fails.
+                        */
+                       wpa_printf(MSG_DEBUG,
+                                  "EAP: Method did not return a request");
+                       SM_ENTER(EAP, FAILURE);
+                       break;
+               }
                break;
        case EAP_METHOD_RESPONSE:
                /*