Skip to content

Commit c6f2152

Browse files
krish2718carlescufi
authored andcommitted
wifi: shell: Add a sanity check for MFP
For none and WPA-PSK MFP isn't applicable, it was only introduced in WPA2-PSK (RSN) and later. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 4a1847e commit c6f2152

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ static int __wifi_args_to_params(size_t argc, char *argv[],
499499
if (idx < argc) {
500500
unsigned int mfp = strtol(argv[idx], &endptr, 10);
501501

502+
if (security == WIFI_SECURITY_TYPE_NONE ||
503+
security == WIFI_SECURITY_TYPE_WPA_PSK) {
504+
return -EINVAL;
505+
}
506+
502507
if (mfp <= WIFI_MFP_REQUIRED) {
503508
params->mfp = mfp;
504509
}

0 commit comments

Comments
 (0)