WPS NFC: Validate peer public key hash on Enrollee
Since the Enrollee can now get the public key hash from the Registrar, there is need to validate this during the WPS protocol run. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
ff40cd6dd1
commit
5f4545573f
8 changed files with 92 additions and 16 deletions
|
@ -144,12 +144,13 @@ static void * eap_wsc_init(struct eap_sm *sm)
|
|||
size_t identity_len;
|
||||
int registrar;
|
||||
struct wps_config cfg;
|
||||
const char *pos;
|
||||
const char *pos, *end;
|
||||
const char *phase1;
|
||||
struct wps_context *wps;
|
||||
struct wps_credential new_ap_settings;
|
||||
int res;
|
||||
int nfc = 0;
|
||||
u8 pkhash[WPS_OOB_PUBKEY_HASH_LEN];
|
||||
|
||||
wps = sm->wps;
|
||||
if (wps == NULL) {
|
||||
|
@ -220,6 +221,24 @@ static void * eap_wsc_init(struct eap_sm *sm)
|
|||
if (pos && cfg.pin)
|
||||
cfg.dev_pw_id = atoi(pos + 10);
|
||||
|
||||
pos = os_strstr(phase1, " pkhash=");
|
||||
if (pos) {
|
||||
size_t len;
|
||||
pos += 8;
|
||||
end = os_strchr(pos, ' ');
|
||||
if (end)
|
||||
len = end - pos;
|
||||
else
|
||||
len = os_strlen(pos);
|
||||
if (len != 2 * WPS_OOB_PUBKEY_HASH_LEN ||
|
||||
hexstr2bin(pos, pkhash, WPS_OOB_PUBKEY_HASH_LEN)) {
|
||||
wpa_printf(MSG_INFO, "EAP-WSC: Invalid pkhash");
|
||||
os_free(data);
|
||||
return NULL;
|
||||
}
|
||||
cfg.peer_pubkey_hash = pkhash;
|
||||
}
|
||||
|
||||
res = eap_wsc_new_ap_settings(&new_ap_settings, phase1);
|
||||
if (res < 0) {
|
||||
os_free(data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue