aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2018-04-12 22:42:10 (GMT)
committerJouni Malinen <j@w1.fi>2018-04-13 09:09:33 (GMT)
commitd5906fbb723b0c854945a3421f9b681c402d74f8 (patch)
treeaf42560091acae815a283e6120c7d39e1ff1fc85
parentd6d7debb5d65b8c8b40f44aeeaf7c86dc4646bef (diff)
downloadhostap-d5906fbb723b0c854945a3421f9b681c402d74f8.zip
hostap-d5906fbb723b0c854945a3421f9b681c402d74f8.tar.gz
hostap-d5906fbb723b0c854945a3421f9b681c402d74f8.tar.bz2
mesh: Properly handle sae_password
The recently introduced sae_password parameter was only handled properly in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that ssid->passphrase exclusively holds the secret. Import the logic from sme.c to mesh.c to allow having only sae_password set which otherwise throws this error: AP-ENABLED mesh: Passphrase for SAE not configured Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--wpa_supplicant/mesh.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index c0c8f91..19b66b4 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -157,6 +157,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
struct mesh_conf *mconf;
int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
+ const char *password;
size_t len;
int rate_len;
int frequency;
@@ -291,7 +292,10 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
}
if (mconf->security != MESH_CONF_SEC_NONE) {
- if (ssid->passphrase == NULL) {
+ password = ssid->sae_password;
+ if (!password)
+ password = ssid->passphrase;
+ if (!password) {
wpa_printf(MSG_ERROR,
"mesh: Passphrase for SAE not configured");
goto out_free;
@@ -311,9 +315,9 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
goto out_free;
}
- len = os_strlen(ssid->passphrase);
+ len = os_strlen(password);
bss->conf->ssid.wpa_passphrase =
- dup_binstr(ssid->passphrase, len);
+ dup_binstr(password, len);
wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
if (!wpa_s->mesh_rsn)