diff options
author | Jouni Malinen <j@w1.fi> | 2012-06-28 13:25:48 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-06-28 13:25:48 +0300 |
commit | 3cf7a59d4f4345c24f99e5422a680cec6b9356d0 (patch) | |
tree | cf6f42aa1653b9591a525f9cff7b5cfd4a5ef93c /src/ap | |
parent | 5bb7ae1f0ccca1474d8972dab582d136fef8d65b (diff) | |
download | external_wpa_supplicant_8_ti-3cf7a59d4f4345c24f99e5422a680cec6b9356d0.zip external_wpa_supplicant_8_ti-3cf7a59d4f4345c24f99e5422a680cec6b9356d0.tar.gz external_wpa_supplicant_8_ti-3cf7a59d4f4345c24f99e5422a680cec6b9356d0.tar.bz2 |
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>
Diffstat (limited to 'src/ap')
-rw-r--r-- | src/ap/wps_hostapd.c | 22 | ||||
-rw-r--r-- | src/ap/wps_hostapd.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index e6c158a..b95b617 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -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 */ diff --git a/src/ap/wps_hostapd.h b/src/ap/wps_hostapd.h index 75a3bcb..8256c06 100644 --- a/src/ap/wps_hostapd.h +++ b/src/ap/wps_hostapd.h @@ -35,6 +35,8 @@ int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid, const char *auth, const char *encr, const char *key); int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd, const struct wpabuf *data); +struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd, + int ndef); #else /* CONFIG_WPS */ |