mediatek: add mt7622 subtarget
[openwrt/staging/wigyori.git] / package / network / services / hostapd / patches / 020-mesh-properly-handle-sae_password.patch
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
5
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:
11 AP-ENABLED
12 mesh: Passphrase for SAE not configured
13 Init RSN failed. Deinit mesh...
14 wlan1: interface state ENABLED->DISABLED
15 AP-DISABLED
16 Segmentation fault
17
18 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 ---
20 wpa_supplicant/mesh.c | 10 +++++++---
21 1 file changed, 7 insertions(+), 3 deletions(-)
22
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;
30 size_t len;
31
32 if (mconf->security != MESH_CONF_SEC_NONE) {
33 - if (ssid->passphrase == NULL) {
34 + password = ssid->sae_password;
35 + if (!password)
36 + password = ssid->passphrase;
37 + if (!password) {
38 wpa_printf(MSG_ERROR,
39 "mesh: Passphrase for SAE not configured");
40 return -1;
41 @@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_suppli
42 return -1;
43 }
44
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);
50
51 wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
52 if (!wpa_s->mesh_rsn)