]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS NFC: Add support for wpa_supplicant AP/GO mode to use handover
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 4 Apr 2013 13:43:12 +0000 (16:43 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jan 2014 19:10:55 +0000 (21:10 +0200)
New functionality is needed for this with the update NFC connection
handover design that depends on the AP side using the public key hash
from the handover request.

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

wpa_supplicant/ap.c
wpa_supplicant/ap.h
wpa_supplicant/ctrl_iface.c

index 5f693897d40cf59c8ccb7efb1201f27ea4ae6cb3..0f8024949369dc9ae8cf62b1b79dbcc435a154f1 100644 (file)
@@ -946,6 +946,19 @@ struct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
        return hostapd_wps_nfc_hs_cr(hapd, ndef);
 }
 
+
+int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
+                                   const struct wpabuf *req,
+                                   const struct wpabuf *sel)
+{
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface == NULL)
+               return -1;
+       hapd = wpa_s->ap_iface->bss[0];
+       return hostapd_wps_nfc_report_handover(hapd, req, sel);
+}
+
 #endif /* CONFIG_WPS_NFC */
 
 #endif /* CONFIG_WPS */
index c3828980d7c1ed07d752c9214f32294c2e2835cc..9138717fd2aa022a61da2bfed136eeed9c95b352 100644 (file)
@@ -69,4 +69,8 @@ wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
 }
 #endif /* CONFIG_AP */
 
+int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
+                                   const struct wpabuf *req,
+                                   const struct wpabuf *sel);
+
 #endif /* AP_H */
index ee3d14d806fae5685076668df6d4f855366ec418..2ec89a9b50367ee81b659ba8cadb66398b49a0ed 100644 (file)
@@ -1125,6 +1125,9 @@ static int wpas_ctrl_nfc_report_handover(struct wpa_supplicant *wpa_s,
 
        if (os_strcmp(role, "INIT") == 0 && os_strcmp(type, "WPS") == 0) {
                ret = wpas_wps_nfc_report_handover(wpa_s, req, sel);
+       } else if (os_strcmp(role, "RESP") == 0 && os_strcmp(type, "WPS") == 0)
+       {
+               ret = wpas_ap_wps_nfc_report_handover(wpa_s, req, sel);
        } else {
                wpa_printf(MSG_DEBUG, "NFC: Unsupported connection handover "
                           "reported: role=%s type=%s", role, type);