WPS NFC: Add more debug for NFC Password Token matching

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-09-08 08:09:38 -07:00 committed by Jouni Malinen
parent 67a88a747c
commit b6881b5218
2 changed files with 10 additions and 1 deletions

View file

@ -1211,6 +1211,7 @@ int hostapd_init_wps_complete(struct hostapd_data *hapd)
static void hostapd_wps_nfc_clear(struct wps_context *wps) static void hostapd_wps_nfc_clear(struct wps_context *wps)
{ {
#ifdef CONFIG_WPS_NFC #ifdef CONFIG_WPS_NFC
wpa_printf(MSG_DEBUG, "WPS: Clear NFC Tag context %p", wps);
wps->ap_nfc_dev_pw_id = 0; wps->ap_nfc_dev_pw_id = 0;
wpabuf_free(wps->ap_nfc_dh_pubkey); wpabuf_free(wps->ap_nfc_dh_pubkey);
wps->ap_nfc_dh_pubkey = NULL; wps->ap_nfc_dh_pubkey = NULL;
@ -1823,6 +1824,9 @@ int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd)
return -1; return -1;
hostapd_wps_nfc_clear(wps); 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_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_pubkey = wpabuf_dup(hapd->conf->wps_nfc_dh_pubkey);
wps->ap_nfc_dh_privkey = wpabuf_dup(hapd->conf->wps_nfc_dh_privkey); 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) 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); hostapd_wps_nfc_clear(hapd->wps);
} }

View file

@ -1374,7 +1374,8 @@ static int wps_get_dev_password(struct wps_data *wps)
} }
if (pin == NULL) { if (pin == NULL) {
wpa_printf(MSG_DEBUG, "WPS: No Device Password available for " 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_cb_pin_needed(wps->wps->registrar, wps->uuid_e,
&wps->peer_dev); &wps->peer_dev);
return -1; return -1;
@ -2536,6 +2537,8 @@ static enum wps_process_res wps_process_m1(struct wps_data *wps,
const u8 *addr[1]; const u8 *addr[1];
u8 hash[WPS_HASH_LEN]; 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( token = wps_get_nfc_pw_token(
&wps->wps->registrar->nfc_pw_tokens, wps->dev_pw_id); &wps->wps->registrar->nfc_pw_tokens, wps->dev_pw_id);
if (token) { if (token) {