WPS: Use pre-configured NFC password token instead of overriding it

"WPS_NFC_TOKEN <WPS/NDEF>" used to generate a new NFC password token
regardless of whether there was a pre-configured token in the
configuration. Change this to use the pre-configured value, if
available, instead. This allows the same command to be used to write the
password token to an NFC tag more conveniently.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-02-15 11:24:29 +02:00 committed by Jouni Malinen
parent d16531c40c
commit 042ec551d4
9 changed files with 74 additions and 22 deletions

View file

@ -1595,6 +1595,13 @@ struct wpabuf * hostapd_wps_nfc_hs_cr(struct hostapd_data *hapd, int ndef)
struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef)
{
if (hapd->conf->wps_nfc_pw_from_config) {
return wps_nfc_token_build(ndef,
hapd->conf->wps_nfc_dev_pw_id,
hapd->conf->wps_nfc_dh_pubkey,
hapd->conf->wps_nfc_dev_pw);
}
return wps_nfc_token_gen(ndef, &hapd->conf->wps_nfc_dev_pw_id,
&hapd->conf->wps_nfc_dh_pubkey,
&hapd->conf->wps_nfc_dh_privkey,