aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-07-11 13:33:05 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-27 19:44:30 (GMT)
commitd4b4d7fe3c8792b05199f16bb3dc78036d3a20fe (patch)
tree2d366de45a879ba59f6075f4443af64e19dfb9c6 /wpa_supplicant/wps_supplicant.c
parentac08752d289698b7f0eace0bf9dcacfc0fe0ac4c (diff)
downloadhostap-d4b4d7fe3c8792b05199f16bb3dc78036d3a20fe.zip
hostap-d4b4d7fe3c8792b05199f16bb3dc78036d3a20fe.tar.gz
hostap-d4b4d7fe3c8792b05199f16bb3dc78036d3a20fe.tar.bz2
WPS NFC: Update DH keys for ER operations
Since wpa_s->conf->wps_nfc_dh_* parameters can be set in number of code paths, update the wps_context copy of the DH keys even if no new keys were generated for the request. This tries to avoid some cases where public key hash may not have matched the public key used in the ER operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 02e3338..aaf563f 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -2337,8 +2337,9 @@ wpas_wps_er_nfc_handover_sel(struct wpa_supplicant *wpa_s, int ndef,
struct wpabuf *ret;
u8 u[UUID_LEN], *use_uuid = NULL;
u8 addr[ETH_ALEN], *use_addr = NULL;
+ struct wps_context *wps = wpa_s->wps;
- if (wpa_s->wps == NULL)
+ if (wps == NULL)
return NULL;
if (uuid == NULL)
@@ -2351,21 +2352,18 @@ wpas_wps_er_nfc_handover_sel(struct wpa_supplicant *wpa_s, int ndef,
return NULL;
if (wpa_s->conf->wps_nfc_dh_pubkey == NULL) {
- struct wps_context *wps = wpa_s->wps;
if (wps_nfc_gen_dh(&wpa_s->conf->wps_nfc_dh_pubkey,
&wpa_s->conf->wps_nfc_dh_privkey) < 0)
return NULL;
+ }
+ wpas_wps_nfc_clear(wps);
+ wps->ap_nfc_dev_pw_id = DEV_PW_NFC_CONNECTION_HANDOVER;
+ wps->ap_nfc_dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
+ wps->ap_nfc_dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
+ if (!wps->ap_nfc_dh_pubkey || !wps->ap_nfc_dh_privkey) {
wpas_wps_nfc_clear(wps);
- wps->ap_nfc_dev_pw_id = DEV_PW_NFC_CONNECTION_HANDOVER;
- wps->ap_nfc_dh_pubkey =
- wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
- wps->ap_nfc_dh_privkey =
- wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
- if (!wps->ap_nfc_dh_pubkey || !wps->ap_nfc_dh_privkey) {
- wpas_wps_nfc_clear(wps);
- return NULL;
- }
+ return NULL;
}
ret = wps_er_nfc_handover_sel(wpa_s->wps_er, wpa_s->wps, use_uuid,