Skip to content

Commit 6554599

Browse files
MaochenWang1kartben
authored andcommitted
net: wifi: should enable MFP when connect to WPA3 network
Add check that should enable MFP when connect to WPA3 network, as MFP required is mandatory for WPA3 network. Signed-off-by: Maochen Wang <[email protected]>
1 parent bc370ea commit 6554599

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,16 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
863863
return -EINVAL;
864864
}
865865

866+
if (params->security == WIFI_SECURITY_TYPE_SAE_HNP
867+
|| params->security == WIFI_SECURITY_TYPE_SAE_H2E
868+
|| params->security == WIFI_SECURITY_TYPE_SAE_AUTO
869+
|| params->wpa3_ent_mode != WIFI_WPA3_ENTERPRISE_NA) {
870+
if (params->mfp != WIFI_MFP_REQUIRED) {
871+
PR_ERROR("MFP is required for WPA3 mode\n");
872+
return -EINVAL;
873+
}
874+
}
875+
866876
if (iface_mode == WIFI_MODE_AP && params->channel == WIFI_CHANNEL_ANY) {
867877
PR_ERROR("Channel not provided\n");
868878
return -EINVAL;

0 commit comments

Comments
 (0)