hostap: add AP network security type DPP

Add DPP security type for AP DPP support.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
This commit is contained in:
Fengming Ye 2024-06-20 14:47:02 +09:00 committed by Henrik Brix Andersen
parent 01418564bc
commit 4f93c84a94
3 changed files with 25 additions and 4 deletions

View file

@ -66,12 +66,14 @@ enum wifi_security_type {
WIFI_SECURITY_TYPE_WPA_PSK,
/** WPA/WPA2/WPA3 PSK security. */
WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL,
/** DPP security */
WIFI_SECURITY_TYPE_DPP,
/** @cond INTERNAL_HIDDEN */
/** @cond INTERNAL_HIDDEN */
__WIFI_SECURITY_TYPE_AFTER_LAST,
WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1,
WIFI_SECURITY_TYPE_UNKNOWN
/** @endcond */
/** @endcond */
};
/** Helper function to get user-friendly security type name. */

View file

@ -1373,6 +1373,25 @@ int hapd_config_network(struct hostapd_iface *iface,
goto out;
}
iface->bss[0]->conf->sae_pwe = 2;
} else if (params->security == WIFI_SECURITY_TYPE_DPP) {
if (!hostapd_cli_cmd_v("set wpa 2")) {
goto out;
}
if (!hostapd_cli_cmd_v("set wpa_key_mgmt WPA-PSK DPP")) {
goto out;
}
if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
goto out;
}
if (!hostapd_cli_cmd_v("set wpa_pairwise CCMP")) {
goto out;
}
if (!hostapd_cli_cmd_v("set rsn_pairwise CCMP")) {
goto out;
}
if (!hostapd_cli_cmd_v("set dpp_configurator_connectivity 1")) {
goto out;
}
}
} else {
if (!hostapd_cli_cmd_v("set wpa 0")) {

View file

@ -2539,7 +2539,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_cmd_ap,
"-p --passphrase=<PSK> (valid only for secure SSIDs)\n"
"-k --key-mgmt=<Security type> (valid only for secure SSIDs)\n"
"0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE, 4:WAPI, 5:EAP-TLS, 6:WEP\n"
"7: WPA-PSK\n"
"7: WPA-PSK, 11: DPP\n"
"-w --ieee-80211w=<MFP> (optional: needs security type to be specified)\n"
"0:Disable, 1:Optional, 2:Required\n"
"-b --band=<band> (2 -2.6GHz, 5 - 5Ghz, 6 - 6GHz)\n"
@ -2657,7 +2657,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
"[-p, --psk]: Passphrase (valid only for secure SSIDs)\n"
"[-k, --key-mgmt]: Key Management type (valid only for secure SSIDs)\n"
"0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE-HNP, 4:SAE-H2E, 5:SAE-AUTO, 6:WAPI,"
" 7:EAP-TLS, 8:WEP, 9: WPA-PSK, 10: WPA-Auto-Personal\n"
" 7:EAP-TLS, 8:WEP, 9: WPA-PSK, 10: WPA-Auto-Personal, 11: DPP\n"
"[-w, --ieee-80211w]: MFP (optional: needs security type to be specified)\n"
": 0:Disable, 1:Optional, 2:Required.\n"
"[-m, --bssid]: MAC address of the AP (BSSID).\n"