Skip to content

Commit b4035e8

Browse files
Rex-Chen-NXPmmahadevan108
authored andcommitted
net: wifi: shell: add enterprise support for sap
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2, EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb support for sap. Signed-off-by: Rex Chen <[email protected]>
1 parent ef9cc18 commit b4035e8

File tree

12 files changed

+508
-27
lines changed

12 files changed

+508
-27
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ extern "C" {
5151
#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL 1
5252
#endif /* CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL */
5353

54+
#ifdef CONFIG_WIFI_ENT_IDENTITY_MAX_USERS
55+
#define WIFI_ENT_IDENTITY_MAX_USERS CONFIG_WIFI_ENT_IDENTITY_MAX_USERS
56+
#else
57+
#define WIFI_ENT_IDENTITY_MAX_USERS 1
58+
#endif /* CONFIG_WIFI_ENT_IDENTITY_MAX_USERS */
59+
5460
#define WIFI_MGMT_BAND_STR_SIZE_MAX 8
5561
#define WIFI_MGMT_SCAN_MAX_BSS_CNT 65535
5662

@@ -535,7 +541,7 @@ struct wifi_connect_req_params {
535541
/** suiteb or suiteb-192 */
536542
uint8_t suiteb_type;
537543
/** eap version */
538-
uint8_t eap_ver;
544+
int eap_ver;
539545
/** Identity for EAP */
540546
const uint8_t *eap_identity;
541547
/** eap identity length, max 64 */
@@ -546,6 +552,14 @@ struct wifi_connect_req_params {
546552
uint8_t eap_passwd_length;
547553
/** Fast BSS Transition used */
548554
bool ft_used;
555+
/** Number of EAP users */
556+
int nusers;
557+
/** Number of EAP passwds */
558+
uint8_t passwds;
559+
/** User Identities */
560+
const uint8_t *identities[WIFI_ENT_IDENTITY_MAX_USERS];
561+
/** User Passwords */
562+
const uint8_t *passwords[WIFI_ENT_IDENTITY_MAX_USERS];
549563
};
550564

551565
/** @brief Wi-Fi connect result codes. To be overlaid on top of \ref wifi_status
@@ -797,6 +811,18 @@ struct wifi_enterprise_creds_params {
797811
uint8_t *client_key2;
798812
/** Phase2 Client key length */
799813
uint32_t client_key2_len;
814+
/** Server certification */
815+
uint8_t *server_cert;
816+
/** Server certification length */
817+
uint32_t server_cert_len;
818+
/** Server key */
819+
uint8_t *server_key;
820+
/** Server key length */
821+
uint32_t server_key_len;
822+
/** Diffie–Hellman parameter */
823+
uint8_t *dh_param;
824+
/** Diffie–Hellman parameter length */
825+
uint32_t dh_param_len;
800826
};
801827

802828
/** @brief Wi-Fi power save configuration */

modules/hostap/CMakeLists.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,73 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
593593
${HOSTAP_SRC_BASE}/tls/asn1.c
594594
)
595595
596+
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
597+
${HOSTAP_SRC_BASE}/eap_server/eap_server_tls_common.c
598+
)
599+
600+
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
601+
WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
602+
EAP_TLS_FUNCS
603+
EAP_SERVER
604+
)
605+
606+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_IDENTITY
607+
${HOSTAP_SRC_BASE}/eap_server/eap_server_identity.c
608+
)
609+
610+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_IDENTITY
611+
EAP_SERVER_IDENTITY
612+
)
613+
614+
615+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_TLS
616+
${HOSTAP_SRC_BASE}/eap_server/eap_server_tls.c
617+
)
618+
619+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_TLS
620+
EAP_SERVER_TLS
621+
)
622+
623+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_MD5
624+
${HOSTAP_SRC_BASE}/eap_server/eap_server_md5.c
625+
)
626+
627+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_MD5
628+
EAP_SERVER_MD5
629+
)
630+
631+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_MSCHAPV2
632+
${HOSTAP_SRC_BASE}/eap_server/eap_server_mschapv2.c
633+
)
634+
635+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_MSCHAPV2
636+
EAP_SERVER_MSCHAPV2
637+
)
638+
639+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_PEAP
640+
${HOSTAP_SRC_BASE}/eap_server/eap_server_peap.c
641+
)
642+
643+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_PEAP
644+
EAP_SERVER_PEAP
645+
)
646+
647+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_GTC
648+
${HOSTAP_SRC_BASE}/eap_server/eap_server_gtc.c
649+
)
650+
651+
zephyr_library_compile_definitions_ifdef(CONFIG_EAP_SERVER_GTC
652+
EAP_SERVER_GTC
653+
)
654+
655+
zephyr_library_sources_ifdef(CONFIG_EAP_SERVER_TTLS
656+
${HOSTAP_SRC_BASE}/eap_server/eap_server_ttls.c
657+
)
658+
659+
zephyr_library_compile_definitions_ifdef(CONFIGEAP_SERVER_TTLS
660+
EAP_SERVER_TTLS
661+
)
662+
596663
# crypto mbedtls related
597664
if(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO)
598665
zephyr_library_sources(

modules/hostap/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,35 @@ config WIFI_NM_HOSTAPD_AP
278278
bool "FullAP mode support based on Hostapd"
279279
depends on !WIFI_NM_WPA_SUPPLICANT_INF_MON
280280

281+
config WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
282+
bool "Hostapd crypto enterprise support"
283+
284+
config EAP_SERVER_TLS
285+
bool "EAP-TLS server support"
286+
287+
config EAP_SERVER_IDENTITY
288+
bool "EAP-IDENTITY server support"
289+
290+
config EAP_SERVER_MD5
291+
bool "EAP-MD5 server support"
292+
293+
config EAP_SERVER_MSCHAPV2
294+
bool "EAP-MSCHAPV2 server support"
295+
296+
config EAP_SERVER_PEAP
297+
bool "EAP-PEAP server support"
298+
299+
config EAP_SERVER_GTC
300+
bool "EAP-GTC server support"
301+
302+
config EAP_SERVER_TTLS
303+
bool "EAP-TTLS server support"
304+
305+
config EAP_SERVER_ALL
306+
bool "All EAP methods support"
307+
select EAP_SERVER_TLS
308+
default y if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
309+
281310
config WIFI_NM_WPA_SUPPLICANT_BSS_MAX_IDLE_TIME
282311
int "BSS max idle timeout in seconds"
283312
range 0 64000

0 commit comments

Comments
 (0)