X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=wpa_supplicant%2Fmesh.c;h=dd534d4eaeeb37e3ffb12c2b45959880280b32c8;hb=4976618c76b954f2f584360f4e921f4a2b205526;hp=c5f089e51507dc67225ec4a642da65f6d75d9738;hpb=3b6deac0e7d5e84527bcae49890c6775527f590c;p=mech_eap.git diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index c5f089e..dd534d4 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -70,6 +70,7 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { struct mesh_conf *conf; + int cipher; conf = os_zalloc(sizeof(struct mesh_conf)); if (!conf) @@ -90,8 +91,24 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s, else conf->ieee80211w = NO_MGMT_FRAME_PROTECTION; } - conf->pairwise_cipher = WPA_CIPHER_CCMP; - conf->group_cipher = WPA_CIPHER_CCMP; + + cipher = wpa_pick_pairwise_cipher(ssid->pairwise_cipher, 0); + if (cipher < 0 || cipher == WPA_CIPHER_TKIP) { + wpa_msg(wpa_s, MSG_INFO, "mesh: Invalid pairwise cipher"); + os_free(conf); + return NULL; + } + conf->pairwise_cipher = cipher; + + cipher = wpa_pick_group_cipher(ssid->group_cipher); + if (cipher < 0 || cipher == WPA_CIPHER_TKIP || + cipher == WPA_CIPHER_GTK_NOT_USED) { + wpa_msg(wpa_s, MSG_INFO, "mesh: Invalid group cipher"); + os_free(conf); + return NULL; + } + + conf->group_cipher = cipher; if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) conf->mgmt_group_cipher = WPA_CIPHER_AES_128_CMAC; @@ -428,6 +445,9 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, /* hostapd sets the interface down until we associate */ wpa_drv_set_operstate(wpa_s, 1); + if (!ret) + wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); + out: return ret; }