]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS NFC: Add BSSID and AP channel info to Configuration Token
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 28 Nov 2013 10:31:32 +0000 (12:31 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jan 2014 19:44:31 +0000 (21:44 +0200)
This information can help the Enrollee to find the AP more quickly with
an optimized scan.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/wps_hostapd.c
src/wps/wps.h
src/wps/wps_common.c

index 469ac3e9bde91c81d3a3161041e106ce47da138a..1b1dce4c4a15c6d5242f0f9117ff117ba4fd9607 100644 (file)
@@ -1784,7 +1784,8 @@ struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
        if (hapd->wps == NULL)
                return NULL;
 
-       ret = wps_get_oob_cred(hapd->wps);
+       ret = wps_get_oob_cred(hapd->wps, hostapd_wps_rf_band_cb(hapd),
+                              hapd->iconf->channel);
        if (ndef && ret) {
                struct wpabuf *tmp;
                tmp = ndef_build_wifi(ret);
index 355939bf4c92847e38922b03bd0fdb50957095d8..6ccce1a9a25c92d57043ab0b92e1648092eb9a58 100644 (file)
@@ -821,7 +821,8 @@ unsigned int wps_generate_pin(void);
 int wps_pin_str_valid(const char *pin);
 void wps_free_pending_msgs(struct upnp_pending_message *msgs);
 
-struct wpabuf * wps_get_oob_cred(struct wps_context *wps);
+struct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
+                                int channel);
 int wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr);
 int wps_attr_text(struct wpabuf *data, char *buf, char *end);
 const char * wps_ei_str(enum wps_error_indication ei);
index e98ec003a4a3f0ec1fbeb7d0a1c8f436a8e9b570..abf3a4fc6787336748fb6af36fd24f723acb7868 100644 (file)
@@ -352,7 +352,8 @@ void wps_pbc_disable_event(struct wps_context *wps)
 
 #ifdef CONFIG_WPS_OOB
 
-struct wpabuf * wps_get_oob_cred(struct wps_context *wps)
+struct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
+                                int channel)
 {
        struct wps_data data;
        struct wpabuf *plain;
@@ -369,6 +370,9 @@ struct wpabuf * wps_get_oob_cred(struct wps_context *wps)
        data.auth_type = wps->auth_types;
        data.encr_type = wps->encr_types;
        if (wps_build_cred(&data, plain) ||
+           (rf_band && wps_build_rf_bands_attr(plain, rf_band)) ||
+           (channel && wps_build_ap_channel(plain, channel)) ||
+           wps_build_mac_addr(plain, wps->dev.mac_addr) ||
            wps_build_wfa_ext(plain, 0, NULL, 0)) {
                os_free(data.new_psk);
                wpabuf_free(plain);