|
@@ -737,6 +737,8 @@ enum wpa_ctrl_req_type wpa_supplicant_ctrl_req_from_string(const char *field)
|
|
|
return WPA_CTRL_REQ_EAP_PASSPHRASE;
|
|
|
else if (os_strcmp(field, "SIM") == 0)
|
|
|
return WPA_CTRL_REQ_SIM;
|
|
|
+ else if (os_strcmp(field, "PSK_PASSPHRASE") == 0)
|
|
|
+ return WPA_CTRL_REQ_PSK_PASSPHRASE;
|
|
|
return WPA_CTRL_REQ_UNKNOWN;
|
|
|
}
|
|
|
|
|
@@ -776,6 +778,10 @@ const char * wpa_supplicant_ctrl_req_to_string(enum wpa_ctrl_req_type field,
|
|
|
case WPA_CTRL_REQ_SIM:
|
|
|
ret = "SIM";
|
|
|
break;
|
|
|
+ case WPA_CTRL_REQ_PSK_PASSPHRASE:
|
|
|
+ *txt = "PSK or passphrase";
|
|
|
+ ret = "PSK_PASSPHRASE";
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -789,6 +795,35 @@ const char * wpa_supplicant_ctrl_req_to_string(enum wpa_ctrl_req_type field,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+void wpas_send_ctrl_req(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
|
|
|
+ const char *field_name, const char *txt)
|
|
|
+{
|
|
|
+ char *buf;
|
|
|
+ size_t buflen;
|
|
|
+ int len;
|
|
|
+
|
|
|
+ buflen = 100 + os_strlen(txt) + ssid->ssid_len;
|
|
|
+ buf = os_malloc(buflen);
|
|
|
+ if (buf == NULL)
|
|
|
+ return;
|
|
|
+ len = os_snprintf(buf, buflen, "%s-%d:%s needed for SSID ",
|
|
|
+ field_name, ssid->id, txt);
|
|
|
+ if (os_snprintf_error(buflen, len)) {
|
|
|
+ os_free(buf);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ssid->ssid && buflen > len + ssid->ssid_len) {
|
|
|
+ os_memcpy(buf + len, ssid->ssid, ssid->ssid_len);
|
|
|
+ len += ssid->ssid_len;
|
|
|
+ buf[len] = '\0';
|
|
|
+ }
|
|
|
+ buf[buflen - 1] = '\0';
|
|
|
+ wpa_msg(wpa_s, MSG_INFO, WPA_CTRL_REQ "%s", buf);
|
|
|
+ os_free(buf);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
#ifdef IEEE8021X_EAPOL
|
|
|
#if defined(CONFIG_CTRL_IFACE) || !defined(CONFIG_NO_STDOUT_DEBUG)
|
|
|
static void wpa_supplicant_eap_param_needed(void *ctx,
|
|
@@ -798,9 +833,6 @@ static void wpa_supplicant_eap_param_needed(void *ctx,
|
|
|
struct wpa_supplicant *wpa_s = ctx;
|
|
|
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
|
|
const char *field_name, *txt = NULL;
|
|
|
- char *buf;
|
|
|
- size_t buflen;
|
|
|
- int len;
|
|
|
|
|
|
if (ssid == NULL)
|
|
|
return;
|
|
@@ -817,25 +849,7 @@ static void wpa_supplicant_eap_param_needed(void *ctx,
|
|
|
|
|
|
wpas_notify_eap_status(wpa_s, "eap parameter needed", field_name);
|
|
|
|
|
|
- buflen = 100 + os_strlen(txt) + ssid->ssid_len;
|
|
|
- buf = os_malloc(buflen);
|
|
|
- if (buf == NULL)
|
|
|
- return;
|
|
|
- len = os_snprintf(buf, buflen,
|
|
|
- WPA_CTRL_REQ "%s-%d:%s needed for SSID ",
|
|
|
- field_name, ssid->id, txt);
|
|
|
- if (os_snprintf_error(buflen, len)) {
|
|
|
- os_free(buf);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (ssid->ssid && buflen > len + ssid->ssid_len) {
|
|
|
- os_memcpy(buf + len, ssid->ssid, ssid->ssid_len);
|
|
|
- len += ssid->ssid_len;
|
|
|
- buf[len] = '\0';
|
|
|
- }
|
|
|
- buf[buflen - 1] = '\0';
|
|
|
- wpa_msg(wpa_s, MSG_INFO, "%s", buf);
|
|
|
- os_free(buf);
|
|
|
+ wpas_send_ctrl_req(wpa_s, ssid, field_name, txt);
|
|
|
}
|
|
|
#else /* CONFIG_CTRL_IFACE || !CONFIG_NO_STDOUT_DEBUG */
|
|
|
#define wpa_supplicant_eap_param_needed NULL
|