1 From 30c1693f42326d4f927e76120492bc9593b8f739 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Fri, 13 Apr 2018 00:42:10 +0200
4 Subject: [PATCH] mesh: properly handle sae_password
6 The recently introduced sae_password parameter is only handled properly
7 in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that
8 ssid->passphrase exclusively holds the secret.
9 Import the logic from sme.c to mesh.c to allow having only sae_password
10 set which otherwise throws this error:
12 mesh: Passphrase for SAE not configured
13 Init RSN failed. Deinit mesh...
14 wlan1: interface state ENABLED->DISABLED
18 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
20 wpa_supplicant/mesh.c | 10 +++++++---
21 1 file changed, 7 insertions(+), 3 deletions(-)
23 --- a/wpa_supplicant/mesh.c
24 +++ b/wpa_supplicant/mesh.c
25 @@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_suppli
26 struct wpa_ssid *ssid = wpa_s->current_ssid;
27 struct hostapd_data *bss = ifmsh->bss[0];
28 static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
29 + const char *password;
32 if (mconf->security != MESH_CONF_SEC_NONE) {
33 - if (ssid->passphrase == NULL) {
34 + password = ssid->sae_password;
36 + password = ssid->passphrase;
39 "mesh: Passphrase for SAE not configured");
41 @@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_suppli
45 - len = os_strlen(ssid->passphrase);
46 + len = os_strlen(password);
47 bss->conf->ssid.wpa_passphrase =
48 - dup_binstr(ssid->passphrase, len);
49 + dup_binstr(password, len);
51 wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);