WPS NFC: Add more debug for NFC Password Token matching
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 8 Sep 2013 15:09:38 +0000 (08:09 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 7 Nov 2013 11:48:49 +0000 (13:48 +0200)
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/wps_hostapd.c
src/wps/wps_registrar.c

index eb300f1..294a39d 100644 (file)
@@ -1211,6 +1211,7 @@ int hostapd_init_wps_complete(struct hostapd_data *hapd)
 static void hostapd_wps_nfc_clear(struct wps_context *wps)
 {
 #ifdef CONFIG_WPS_NFC
+       wpa_printf(MSG_DEBUG, "WPS: Clear NFC Tag context %p", wps);
        wps->ap_nfc_dev_pw_id = 0;
        wpabuf_free(wps->ap_nfc_dh_pubkey);
        wps->ap_nfc_dh_pubkey = NULL;
@@ -1823,6 +1824,9 @@ int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd)
                return -1;
 
        hostapd_wps_nfc_clear(wps);
+       wpa_printf(MSG_DEBUG,
+                  "WPS: Enable NFC Tag (Dev Pw Id %u) for AP interface %s (context %p)",
+                  hapd->conf->wps_nfc_dev_pw_id, hapd->conf->iface, wps);
        wps->ap_nfc_dev_pw_id = hapd->conf->wps_nfc_dev_pw_id;
        wps->ap_nfc_dh_pubkey = wpabuf_dup(hapd->conf->wps_nfc_dh_pubkey);
        wps->ap_nfc_dh_privkey = wpabuf_dup(hapd->conf->wps_nfc_dh_privkey);
@@ -1849,6 +1853,8 @@ int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd)
 
 void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd)
 {
+       wpa_printf(MSG_DEBUG, "WPS: Disable NFC token for AP interface %s",
+                  hapd->conf->iface);
        hostapd_wps_nfc_clear(hapd->wps);
 }
 
index e8ebfab..ef17617 100644 (file)
@@ -1374,7 +1374,8 @@ static int wps_get_dev_password(struct wps_data *wps)
        }
        if (pin == NULL) {
                wpa_printf(MSG_DEBUG, "WPS: No Device Password available for "
-                          "the Enrollee");
+                          "the Enrollee (context %p registrar %p)",
+                          wps->wps, wps->wps->registrar);
                wps_cb_pin_needed(wps->wps->registrar, wps->uuid_e,
                                  &wps->peer_dev);
                return -1;
@@ -2536,6 +2537,8 @@ static enum wps_process_res wps_process_m1(struct wps_data *wps,
                const u8 *addr[1];
                u8 hash[WPS_HASH_LEN];
 
+               wpa_printf(MSG_DEBUG, "WPS: Searching for NFC token match for id=%d (ctx %p registrar %p)",
+                          wps->dev_pw_id, wps->wps, wps->wps->registrar);
                token = wps_get_nfc_pw_token(
                        &wps->wps->registrar->nfc_pw_tokens, wps->dev_pw_id);
                if (token) {