hostapd: always use sae_password for mesh/SAE auth
[openwrt/openwrt.git] / package / network / services / hostapd / files / hostapd.sh
index 70ad187a81073c2a4b1d122099695f33f22aef83..8c233a4e60bf1f7dc9d4b9e8e7b2bab2ebc3a5a8 100644 (file)
@@ -1372,11 +1372,11 @@ wpa_supplicant_add_network() {
 
                        key_mgmt="$wpa_key_mgmt"
 
-                       if [ ${#key} -eq 64 ]; then
-                               passphrase="psk=${key}"
+                       if [ "$_w_mode" = "mesh" ] || [ "$auth_type" = "sae" ]; then
+                               passphrase="sae_password=\"${key}\""
                        else
-                               if [ "$_w_mode" = "mesh" ]; then
-                                       passphrase="sae_password=\"${key}\""
+                               if [ ${#key} -eq 64 ]; then
+                                       passphrase="psk=${key}"
                                else
                                        passphrase="psk=\"${key}\""
                                fi