SAE: Advertise Password Identifier use

Support the new Extended Capabilities field bits 81 and 82 to indicate
whether SAe Password Identifiers are in use.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-01-24 00:00:28 +02:00 committed by Jouni Malinen
parent 59c6930641
commit 42d308635f
3 changed files with 45 additions and 0 deletions

View file

@ -1168,3 +1168,26 @@ void hostapd_set_security_params(struct hostapd_bss_config *bss,
}
}
}
int hostapd_sae_pw_id_in_use(struct hostapd_bss_config *conf)
{
int with_id = 0, without_id = 0;
struct sae_password_entry *pw;
if (conf->ssid.wpa_passphrase)
without_id = 1;
for (pw = conf->sae_passwords; pw; pw = pw->next) {
if (pw->identifier)
with_id = 1;
else
without_id = 1;
if (with_id && without_id)
break;
}
if (with_id && !without_id)
return 2;
return with_id;
}