wpa_supplicant and OTP

Shriram Jandhyala sjandhyala at paloaltonetworks.com
Mon Dec 18 14:32:40 PST 2017

This does not seem to work.

In my eap_param_needed_cb, I do:

if ((fld == WPA_CTRL_REQ_EAP_OTP)) {
        int len = 0;
        printf("** Need OTP: %s \n", txt);
        bin_clear_free(cfg-> otp, cfg-> otp_len);
            char otp [32] = {};
            char *tmp = fgets(otp, sizeof(otp)-1, stdin);
            if (tmp) {
                len = strlen(otp) - 1;
                cfg->otp_len = len;
                cfg->otp = os_zalloc(len);
                os_memcpy(cfg-> otp, otp, len);

        if (cfg->pending_req_otp) {
            printf("** Setting OTP to: '%s'\n", cfg->otp);
            cfg->pending_req_otp = NULL;
            cfg->pending_req_otp_len = 0;
        printf("* done param needed.\n");

At this point, the state machine still does not proceed.
In eapol_supp_sm.c: eapol_sm_notify_ctrl_response(), sm->eapReq is TRUE, and the eapol_sm_step() does not happen.
Manually changing sm->eapReq to FALSE does not make a difference.


More information about the Hostap mailing list