Set security value appropriate in WPA3/WPA2 mode 14/310714/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 7 May 2024 06:58:17 +0000 (15:58 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Tue, 7 May 2024 06:58:17 +0000 (15:58 +0900)
In mixed mode, check keymgmt_capa
and set the security value appropriate for the supported type.

Change-Id: I57c845f7b582b3f8fa0cb19513b4194ca075b4fc
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
gsupplicant/supplicant.c

index 8329975..d0033ed 100755 (executable)
@@ -3240,6 +3240,7 @@ static void bss_compute_security(struct g_supplicant_bss *bss)
 #if defined TIZEN_EXT
        bss->ft_ieee8021x = FALSE;
        bss->ft_psk = FALSE;
+       GSupplicantInterface *interface = bss->interface;
 #endif
 
 #if defined TIZEN_EXT
@@ -3293,9 +3294,14 @@ static void bss_compute_security(struct g_supplicant_bss *bss)
 #if defined TIZEN_EXT
        else if (bss->ft_ieee8021x)
                bss->security = G_SUPPLICANT_SECURITY_IEEE8021X;
-       else if (bss->sae)
-               bss->security = G_SUPPLICANT_SECURITY_SAE;
-       else if (bss->psk_sha256)
+       else if (bss->sae) {
+               if (!bss->psk)
+                       bss->security = G_SUPPLICANT_SECURITY_SAE;
+               else if (interface->keymgmt_capa & G_SUPPLICANT_KEYMGMT_SAE)
+                       bss->security = G_SUPPLICANT_SECURITY_SAE;
+               else
+                       bss->security = G_SUPPLICANT_SECURITY_PSK;
+       } else if (bss->psk_sha256)
                bss->security = G_SUPPLICANT_SECURITY_PSK_SHA256;
 #endif
        else if (bss->psk)