WPS: Add new mechanism for generation NFC configuration token
The new hostapd ctrl_iface command WPS_NFC_CONFIG_TOKEN can now be used to fetch payload for an NFC configuration token so that an external program can be used to write this on an NFC tag. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
5bb7ae1f0c
commit
3cf7a59d4f
6 changed files with 83 additions and 1 deletions
|
@ -1584,4 +1584,26 @@ int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd,
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
|
||||
int ndef)
|
||||
{
|
||||
struct wpabuf *ret;
|
||||
|
||||
if (hapd->wps == NULL)
|
||||
return NULL;
|
||||
|
||||
ret = wps_get_oob_cred(hapd->wps);
|
||||
if (ndef && ret) {
|
||||
struct wpabuf *tmp;
|
||||
tmp = ndef_build_wifi(ret);
|
||||
wpabuf_free(ret);
|
||||
if (tmp == NULL)
|
||||
return NULL;
|
||||
ret = tmp;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WPS_NFC */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue