SAE: Allow SAE password to be configured separately (AP)

The new sae_password hostapd configuration parameter can now be used to
set the SAE password instead of the previously used wpa_passphrase
parameter. This allows shorter than 8 characters and longer than 63
characters long passwords to be used. In addition, this makes it
possible to configure a BSS with both WPA-PSK and SAE enabled to use
different passphrase/password based on which AKM is selected.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-10-11 23:07:08 +03:00 committed by Jouni Malinen
parent c5aeb4343e
commit 2377c1caef
5 changed files with 21 additions and 3 deletions

View file

@ -634,6 +634,8 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
wpabuf_free(conf->dpp_csign);
#endif /* CONFIG_DPP */
os_free(conf->sae_password);
os_free(conf);
}

View file

@ -582,6 +582,7 @@ struct hostapd_bss_config {
unsigned int sae_anti_clogging_threshold;
int *sae_groups;
char *sae_password;
char *wowlan_triggers; /* Wake-on-WLAN triggers */

View file

@ -361,16 +361,19 @@ static struct wpabuf * auth_build_sae_commit(struct hostapd_data *hapd,
struct sta_info *sta, int update)
{
struct wpabuf *buf;
const char *password;
if (hapd->conf->ssid.wpa_passphrase == NULL) {
password = hapd->conf->sae_password;
if (!password)
password = hapd->conf->ssid.wpa_passphrase;
if (!password) {
wpa_printf(MSG_DEBUG, "SAE: No password available");
return NULL;
}
if (update &&
sae_prepare_commit(hapd->own_addr, sta->addr,
(u8 *) hapd->conf->ssid.wpa_passphrase,
os_strlen(hapd->conf->ssid.wpa_passphrase),
(u8 *) password, os_strlen(password),
sta->sae) < 0) {
wpa_printf(MSG_DEBUG, "SAE: Could not pick PWE");
return NULL;