Skip to content

Commit 559424b

Browse files
committed
net: l2: wifi: Handle domain_suffix_match parameter
Add support to handle the domain_suffix_match parameter for proper certification validation. Fixes #88697. Signed-off-by: Triveni Danda <[email protected]>
1 parent fd1cf7d commit 559424b

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,10 @@ struct wifi_connect_req_params {
723723
uint8_t ignore_broadcast_ssid;
724724
/** Parameter used for frequency band */
725725
enum wifi_frequency_bandwidths bandwidth;
726+
/** Domain suffix match */
727+
const uint8_t *domain_suffix_match;
728+
/** Length of domain suffix match, maximum 32 bytes */
729+
uint8_t domain_suffix_length;
726730
};
727731

728732
/** @brief Wi-Fi disconnect reason codes. To be overlaid on top of \ref wifi_status

modules/hostap/src/supp_api.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,13 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
969969
goto out;
970970
}
971971

972+
if (params->domain_suffix_length > 0) {
973+
if (!wpa_cli_cmd_v("set_network %d domain_suffix_match \"%s\"",
974+
resp.network_id, params->domain_suffix_match)) {
975+
goto out;
976+
}
977+
}
978+
972979
if (false == ((params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 ||
973980
params->security == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2) &&
974981
(!params->verify_peer_cert))) {

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
620620
{"ignore-broadcast-ssid", required_argument, 0, 'g'},
621621
{"ieee-80211r", no_argument, 0, 'R'},
622622
{"iface", required_argument, 0, 'i'},
623+
{"domain_suffix_match", required_argument, 0, 'd'},
623624
{"help", no_argument, 0, 'h'},
624625
{0, 0, 0, 0}};
625626
char *endptr;
@@ -872,6 +873,10 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
872873
case 'i':
873874
/* Unused, but parsing to avoid unknown option error */
874875
break;
876+
case 'd':
877+
params->domain_suffix_match = state->optarg;
878+
params->domain_suffix_length = strlen(params->domain_suffix_match);
879+
break;
875880
case 'h':
876881
return -ENOEXEC;
877882
default:
@@ -4028,10 +4033,11 @@ SHELL_SUBCMD_ADD((wifi), connect, NULL,
40284033
"[-P, --eap-pwd1]: Client Password.\n"
40294034
"Default no password for eap user.\n"
40304035
"[-R, --ieee-80211r]: Use IEEE80211R fast BSS transition connect."
4036+
"[-d, --domain_suffix_match] : Domain suffix match value.\n"
40314037
"[-h, --help]: Print out the help for the connect command.\n"
40324038
"[-i, --iface=<interface index>] : Interface index.\n",
40334039
cmd_wifi_connect,
4034-
2, 42);
4040+
2, 44);
40354041

40364042
SHELL_SUBCMD_ADD((wifi), disconnect, NULL,
40374043
"Disconnect from the Wi-Fi AP.\n"

0 commit comments

Comments
 (0)