wpa_supplicant and OTP
Shriram Jandhyala
sjandhyala at paloaltonetworks.com
Wed Dec 20 18:43:52 PST 2017
I got this to work. I should not call eapol_sm_notify_ctrl_response() in the eap_param_needed_cb.
This brings up a new question:
What about thread safety? Can I call the eapol_sm_notify_ctrl_response() on any thread? And will this new thread interfere with the thread that is running eloop_run()?
Thanks.
Shriram
| -----Original Message-----
| From: Shriram Jandhyala
| Sent: Monday, December 18, 2017 2:33 PM
| To: 'Jouni Malinen' <j at w1.fi>
| Cc: hostap at lists.infradead.org
| Subject: RE: wpa_supplicant and OTP
|
| 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);
| os_free(cfg->pending_req_otp);
| cfg->pending_req_otp = NULL;
| cfg->pending_req_otp_len = 0;
| }
| eapol_sm_notify_ctrl_response(sm);
| 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.
|
| Thanks.
| Shriram
More information about the Hostap
mailing list