Skip to content

Commit d2e696a

Browse files
committed
net: l2: wifi: Refactor certificates processing code into common file
Refactor certificate processing code to eliminate duplication and enable reuse across modules that require enterprise support. Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
1 parent 503011d commit d2e696a

File tree

6 files changed

+414
-523
lines changed

6 files changed

+414
-523
lines changed

include/zephyr/net/wifi_certs.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef WIFI_CREDS_H__
8+
#define WIFI_CREDS_H__
9+
10+
#include <stdbool.h>
11+
#include <zephyr/kernel.h>
12+
#include <zephyr/net/wifi_mgmt.h>
13+
#include <utils/common.h>
14+
#include <eap_peer/eap_config.h>
15+
#include <ctrl_iface_zephyr.h>
16+
#include <wpa_supplicant/config.h>
17+
18+
extern struct wifi_enterprise_creds_params enterprise_creds_params;
19+
20+
/*
21+
* Set Wi-Fi enterprise credentials
22+
* @param iface Network interface
23+
* @param AP or Station mode
24+
*/
25+
int wifi_set_enterprise_credentials(struct net_if *iface,
26+
bool is_ap);
27+
28+
#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES
29+
/*
30+
* Clear Wi-Fi enterprise credentials
31+
* @param Wi-Fi enterprise params
32+
*/
33+
void clear_enterprise_creds_params(struct wifi_enterprise_creds_params *params);
34+
#endif
35+
36+
#endif /* WIFI_CREDS_H__ */

subsys/net/l2/wifi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ zephyr_library_include_directories_ifdef(
1313
)
1414

1515
zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_MGMT wifi_mgmt.c)
16+
zephyr_library_sources_ifdef(CONFIG_WIFI_CERTS wifi_certs.c)
1617
zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_SHELL wifi_shell.c)
1718
zephyr_library_sources_ifdef(CONFIG_WIFI_NM wifi_nm.c)
1819
zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_UTILS wifi_utils.c)

subsys/net/l2/wifi/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ config WIFI_ENT_IDENTITY_MAX_USERS
128128

129129
if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
130130

131+
config WIFI_CERTS
132+
bool "Process certificates in enterprise mode"
133+
default y
134+
131135
config WIFI_SHELL_RUNTIME_CERTIFICATES
132136
bool "Provide Wi-Fi enterprise security certificates at run-time"
133137
select TLS_CREDENTIALS

0 commit comments

Comments
 (0)