#define NET_WLAN_MAX_PSK_PASSPHRASE_LEN 65
/**
+ * Length of SAE Key
+ */
+#define NET_WLAN_MAX_SAE_PASSPHRASE_LEN 65
+
+/**
* Length of WEP Key
* Max of 10 Hex digits allowed in case of 64 bit encryption
* Max of 26 Hex digits allowed in case of 128 bit encryption
WLAN_SEC_MODE_WPA_PSK, /** WPA-PSK */
WLAN_SEC_MODE_WPA2_PSK, /** WPA2-PSK */
WLAN_SEC_MODE_WPA_FT_PSK,
+ WLAN_SEC_MODE_SAE, /** SAE */
} wlan_security_mode_type_e;
/**
} wlan_psk_info_s;
/**
+ * Below structure is used by WPA3-SAE
+ * To see the maximum length of SAE passphrase key.
+ */
+typedef struct {
+ char saeKey[NET_WLAN_MAX_SAE_PASSPHRASE_LEN + 1]; /** key value for WPA3-SAE */
+} wlan_sae_info_s;
+
+/**
* Below structure is used by WEP
* To see the maximum length of WEP key.
*/
wlan_wep_info_s wep; /** Wep Authentication */
wlan_psk_info_s psk; /** psk Authentication */
wlan_eap_info_s eap; /** eap Authentication */
+ wlan_sae_info_s sae; /** sae Authentication */
} wlan_auth_info_u;
/**
WIFI_MANAGER_SECURITY_TYPE_WPA2_PSK = 3, /**< WPA2-PSK */
WIFI_MANAGER_SECURITY_TYPE_EAP = 4, /**< EAP */
WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK = 5, /**< FT-PSK (Since 5.0) */
+ WIFI_MANAGER_SECURITY_TYPE_SAE = 6, /**< SAE (Since 5.5) */
} wifi_manager_security_type_e;
/**
else if (g_strcmp0(value, "rsn") == 0 &&
ProfInfo->security_info.sec_mode < WLAN_SEC_MODE_WPA_PSK)
ProfInfo->security_info.sec_mode = WLAN_SEC_MODE_WPA2_PSK;
+ else if (g_strcmp0(value, "sae") == 0 &&
+ ProfInfo->security_info.sec_mode < WLAN_SEC_MODE_SAE)
+ ProfInfo->security_info.sec_mode = WLAN_SEC_MODE_SAE;
else if (g_strcmp0(value, "wps") == 0)
ProfInfo->security_info.wps_support = TRUE;
else if (ProfInfo->security_info.sec_mode < WLAN_SEC_MODE_NONE)
wifi_connection_info.passphrase =
(char *)wifi_info->security_info.authentication.psk.pskKey;
break;
+
case WLAN_SEC_MODE_WPA_FT_PSK:
wifi_connection_info.security = "ft_psk";
wifi_connection_info.passphrase =
(char *)wifi_info->security_info.authentication.psk.pskKey;
break;
-
+ /** SAE supported */
+ case WLAN_SEC_MODE_SAE:
+ wifi_connection_info.security = "sae";
+ wifi_connection_info.passphrase =
+ (char *)wifi_info->security_info.authentication.sae.saeKey;
+ break;
case WLAN_SEC_MODE_IEEE8021X:
wifi_connection_info.security = "ieee8021x";
return WLAN_SEC_MODE_WPA2_PSK;
case 5:
return WLAN_SEC_MODE_IEEE8021X;
+ case 6:
+ return WLAN_SEC_MODE_WPA_FT_PSK;
+ case 7:
+ return WLAN_SEC_MODE_SAE;
default:
return WLAN_SEC_MODE_NONE;
}
case WLAN_SEC_MODE_WEP:
g_sec = "wep";
break;
+ case WLAN_SEC_MODE_IEEE8021X:
+ g_sec = "ieee8021x";
+ break;
case WLAN_SEC_MODE_WPA_PSK:
case WLAN_SEC_MODE_WPA2_PSK:
g_sec = "psk";
break;
- case WLAN_SEC_MODE_IEEE8021X:
- g_sec = "ieee8021x";
- break;
case WLAN_SEC_MODE_WPA_FT_PSK:
g_sec = "ft_psk";
break;
+ case WLAN_SEC_MODE_SAE:
+ g_sec = "sae";
+ break;
default:
WIFI_LOG(WIFI_ERROR, "Invalid security type");
return NULL;
case WLAN_SEC_MODE_WPA_FT_PSK:
*type = WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK;
break;
+ case WLAN_SEC_MODE_SAE:
+ *type = WIFI_MANAGER_SECURITY_TYPE_SAE;
+ break;
default:
/* __NETWORK_CAPI_FUNC_EXIT__; */
return WIFI_MANAGER_ERROR_OPERATION_FAILED;
case WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK:
profile_info->security_info.sec_mode = WLAN_SEC_MODE_WPA_FT_PSK;
break;
+ case WIFI_MANAGER_SECURITY_TYPE_SAE:
+ profile_info->security_info.sec_mode = WLAN_SEC_MODE_SAE;
+ break;
default:
__NETWORK_CAPI_FUNC_EXIT__;
return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
case WLAN_SEC_MODE_WPA_PSK:
case WLAN_SEC_MODE_WPA2_PSK:
case WLAN_SEC_MODE_WPA_FT_PSK:
+ case WLAN_SEC_MODE_SAE:
*required = true;
break;
default:
g_strlcpy(profile_info->security_info.authentication.psk.pskKey,
passphrase, NET_WLAN_MAX_PSK_PASSPHRASE_LEN+1);
break;
+ case WLAN_SEC_MODE_SAE:
+ g_strlcpy(profile_info->security_info.authentication.sae.saeKey,
+ passphrase, NET_WLAN_MAX_SAE_PASSPHRASE_LEN+1);
+ break;
case WLAN_SEC_MODE_NONE:
case WLAN_SEC_MODE_IEEE8021X:
default:
#define WIFI_SECURITY_WEP "wep"
#define WIFI_SECURITY_WPA_PSK "psk"
#define WIFI_SECURITY_WPA_FT_PSK "ft_psk"
+#define WIFI_SECURITY_SAE "sae"
#define WIFI_SECURITY_EAP "ieee8021x"
static __thread GSList *wifi_manager_handle_list = NULL;
case WIFI_MANAGER_SECURITY_TYPE_WPA2_PSK:
return WIFI_SECURITY_WPA_PSK;
+ case WIFI_MANAGER_SECURITY_TYPE_SAE:
+ return WIFI_SECURITY_SAE;
+
case WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK:
return WIFI_SECURITY_WPA_FT_PSK;
profile->security_info.sec_mode = WLAN_SEC_MODE_WPA2_PSK;
break;
case 4:
+ profile->security_info.sec_mode = WLAN_SEC_MODE_SAE;
+ break;
+ case 5:
profile->security_info.sec_mode = WLAN_SEC_MODE_IEEE8021X;
break;
default:
case WLAN_SEC_MODE_WPA_FT_PSK:
type = WIFI_MANAGER_SECURITY_TYPE_WPA_PSK;
break;
+ case WLAN_SEC_MODE_SAE:
+ type = WIFI_MANAGER_SECURITY_TYPE_SAE;
+ break;
}
if (prof_info->is_hidden == TRUE) {
if (type == sec_type) {
g_strlcpy(profile_info->security_info.authentication.psk.pskKey,
passphrase, NET_WLAN_MAX_PSK_PASSPHRASE_LEN+1);
break;
+ case WLAN_SEC_MODE_SAE:
+ g_strlcpy(profile_info->security_info.authentication.sae.saeKey,
+ passphrase, NET_WLAN_MAX_SAE_PASSPHRASE_LEN+1);
+ break;
case WLAN_SEC_MODE_NONE:
break;
case WLAN_SEC_MODE_IEEE8021X:
case WIFI_MANAGER_SECURITY_TYPE_WEP:
case WIFI_MANAGER_SECURITY_TYPE_WPA_PSK:
case WIFI_MANAGER_SECURITY_TYPE_WPA2_PSK:
+ case WIFI_MANAGER_SECURITY_TYPE_SAE:
{
char passphrase[100];
printf("Input passphrase for %s : ", ap_name);
return "EAP";
case WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK:
return "FT_PSK";
+ case WIFI_MANAGER_SECURITY_TYPE_SAE:
+ return "WPA3";
}
return "Unknown";