mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
Add eap_session_id to wpa_supplicant STATUS output
This makes the current EAP Session-Id available for external programs. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
f19c907822
commit
993a865407
@ -380,6 +380,11 @@ static inline int eapol_sm_get_key(struct eapol_sm *sm, u8 *key, size_t len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
static inline const u8 *
|
||||
eapol_sm_get_session_id(struct eapol_sm *sm, size_t *len)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff)
|
||||
{
|
||||
}
|
||||
|
@ -1701,6 +1701,8 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
|
||||
#ifdef CONFIG_HS20
|
||||
const u8 *hs20;
|
||||
#endif /* CONFIG_HS20 */
|
||||
const u8 *sess_id;
|
||||
size_t sess_id_len;
|
||||
|
||||
if (os_strcmp(params, "-DRIVER") == 0)
|
||||
return wpa_drv_status(wpa_s, buf, buflen);
|
||||
@ -1933,6 +1935,24 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
|
||||
pos += res;
|
||||
}
|
||||
|
||||
sess_id = eapol_sm_get_session_id(wpa_s->eapol, &sess_id_len);
|
||||
if (sess_id) {
|
||||
char *start = pos;
|
||||
|
||||
ret = os_snprintf(pos, end - pos, "eap_session_id=");
|
||||
if (os_snprintf_error(end - pos, ret))
|
||||
return start - buf;
|
||||
pos += ret;
|
||||
ret = wpa_snprintf_hex(pos, end - pos, sess_id, sess_id_len);
|
||||
if (ret <= 0)
|
||||
return start - buf;
|
||||
pos += ret;
|
||||
ret = os_snprintf(pos, end - pos, "\n");
|
||||
if (os_snprintf_error(end - pos, ret))
|
||||
return start - buf;
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
res = rsn_preauth_get_status(wpa_s->wpa, pos, end - pos, verbose);
|
||||
if (res >= 0)
|
||||
pos += res;
|
||||
|
Loading…
Reference in New Issue
Block a user