Skip to content

Update certificates for RSA-3072 support with NRF security #3045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5d89afd
Revert "[nrf noup] samples: net: wifi: Update certificates"
rado17 Jul 14, 2025
c69c7ae
[nrf fromlist] snippets: wifi-enterprise: Increase MBEDTLS heap size
rado17 Jul 14, 2025
2ae135b
[nrf fromlist] samples: net: wifi: Add AES-only certificates
rado17 Jul 14, 2025
1962184
Revert "[nrf fromtree] modules: nrf_wifi: Implement new Raw TX APIs"
krish2718 Jul 14, 2025
0198849
[nrf fromtree] drivers: nrf_wifi: put driver ops in flash
kartben Jun 16, 2025
b6baae0
[nrf fromtree] modules: nrf_wifi: Improve power down sequence
krish2718 Jun 17, 2025
de70a92
[nrf fromtree] modules: nrf_wifi: Remove co-ex GPIOs first
krish2718 Jun 17, 2025
377ad9d
[nrf fromtree] modules: nrf_wifi: Implement QSPI deinit
krish2718 Jun 17, 2025
6e96327
[nrf fromtree] modules: nrf_wifi: Implement SPI deinit
krish2718 Jun 17, 2025
32dc2ed
[nrf fromtree] drivers: wifi: Introduce option to use K_HEAP
rado17 Mar 25, 2025
dbeacd7
[nrf fromtree] modules: nrf_wifi: Fix interface down hang
krish2718 Jun 30, 2025
2231002
[nrf fromtree] modules: nrf_wifi: Fix accuracy of microseconds API
krish2718 Jun 29, 2025
929993c
[nrf fromtree] wifi: nrf70: Fix system work queue stack size override
krish2718 Jun 29, 2025
4c5e962
[nrf fromtree] drivers: nrf_wifi: Fix TX drop statistics
krish2718 Jul 3, 2025
27a9e1a
[nrf fromtree] drivers: wifi: nrf_wifi: wifi_mgmt: remove redundant n…
moonlight83340 Jul 8, 2025
8db32c5
[nrf fromtree] modules: nrf_wifi: Implement new Raw TX APIs
krish2718 Jun 27, 2025
79f1cd2
Revert "[nrf fromlist] manifest: Update nrf_wifi SHA to remove sta mo…
krish2718 Jul 14, 2025
a428b5f
[nrf fromtree] manifest: nrf_wifi: Pull fix for raw TX memory leak
krish2718 Jul 3, 2025
0ca446f
[nrf fromtree] manifest: hostap: sync for coverity fix
Qingling-Wu May 30, 2025
9543530
[nrf fromtree] manifest: Use k_fifo for IPC in hostap
jukkar May 22, 2025
58a963b
[nrf fromtree] manifest: hostap: Pull fix for warning in interface down
krish2718 Jul 9, 2025
ba84b9d
Revert "[nrf fromlist] net: wifi: shell: Enable Wi-Fi credentials sup…
krish2718 Jul 14, 2025
85742ab
[nrf fromtree] net: wifi: shell: Enable Wi-Fi credentials support
rado17 Apr 15, 2025
48a8c50
[nrf fromtree] hostap: Replace wifi event mechanism by k_fifo
jukkar May 21, 2025
0c6680f
[nrf fromtree] modules: hostap: Fix EAP dependencies
krish2718 Jun 27, 2025
2ca3fdb
[nrf fromtree] modules: hostap: fix connection termination report
JordanYates Jul 7, 2025
dc431e3
[nrf fromtree] hostap: Set enterprise crypto insecure
ceolin Jul 8, 2025
94d7151
[nrf fromtree] modules: hostap: supp_api: Fix possible null deference
moonlight83340 Jul 8, 2025
4044ebb
[nrf fromtree] modules: hostap: hapd_events: Fix possible null deference
moonlight83340 Jul 8, 2025
380a770
[nrf fromtree] modules: hostap: supp_events: Fix possible null deference
moonlight83340 Jul 8, 2025
8140a8c
Revert "[nrf fromlist] net: lib: wifi_credentials: Add support for En…
rado17 Jul 15, 2025
baa495e
[nrf fromtree] net: lib: wifi_credentials: Add support for Enterprise…
rado17 Apr 15, 2025
eaebd83
Revert "[nrf fromlist] drivers: nrf_wifi: Remove station mode from mo…
rado17 Jul 15, 2025
2adb057
[nrf fromlist] drivers: nrf_wifi: Remove station mode from monitor mode
kapbh Jun 26, 2025
1614913
[nrf fromlist] drivers: nrf_wifi: Fix rpu recovery debug info
kapbh Jul 11, 2025
359ba2e
[nrf fromlist] modules: hostap: Set default stack size for softAP mode
D-Triveni Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions drivers/wifi/nrf_wifi/Kconfig.nrfwifi
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,21 @@ config NRF70_RSSI_STALE_TIMEOUT_MS
value as the driver does not store it and requires RPU to provide the
information.

config NRF_WIFI_GLOBAL_HEAP
bool "Use Zephyr kernel heap for Wi-Fi driver"
depends on KERNEL_MEM_POOL && ((HEAP_MEM_POOL_SIZE > 0) || HEAP_MEM_POOL_IGNORE_MIN)
help
Enable this option to use K_HEAP for memory allocations in Wi-Fi driver.

if NRF_WIFI_GLOBAL_HEAP
config HEAP_MEM_POOL_ADD_SIZE_NRF70
# Use a maximum that works for typical use cases and boards, each sample/app can override
# this value if needed by using CONFIG_HEAP_MEM_POOL_IGNORE_MIN
def_int 25000 if NRF70_SCAN_ONLY
def_int 150000
endif # NRF_WIFI_GLOBAL_HEAP

if !NRF_WIFI_GLOBAL_HEAP
config NRF_WIFI_CTRL_HEAP_SIZE
int "Dedicated memory pool for control plane"
default 20000
Expand All @@ -580,13 +595,12 @@ config NRF_WIFI_DATA_HEAP_SIZE
default 8000 if NRF70_SCAN_ONLY
default 110000 if !SOC_FAMILY_NORDIC_NRF
default 130000
endif

if NETWORKING
# Finetune defaults for certain system components used by the driver

config SYSTEM_WORKQUEUE_STACK_SIZE
default 4096

# Note: These will take effect only if the symbol is not defined already
# (i.e., the original symbol is processed after "drivers/Kconfig")
config NET_TX_STACK_SIZE
default 4096

Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/nrf_wifi/inc/fmac_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ struct nrf_wifi_ctx_zep {
unsigned int rpu_recovery_retries;
int rpu_recovery_success;
int rpu_recovery_failure;
int wdt_irq_received;
int wdt_irq_ignored;
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/wifi/nrf_wifi/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)

#ifndef CONFIG_NRF70_RADIO_TEST
#ifdef CONFIG_NET_L2_WIFI_MGMT
static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
.scan = nrf_wifi_disp_scan_zep,
#ifdef CONFIG_NET_STATISTICS_WIFI
.get_stats = nrf_wifi_stats_get,
Expand Down Expand Up @@ -883,7 +883,7 @@ static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {


#ifdef CONFIG_NRF70_STA_MODE
static struct zep_wpa_supp_dev_ops wpa_supp_ops = {
static const struct zep_wpa_supp_dev_ops wpa_supp_ops = {
.init = nrf_wifi_wpa_supp_dev_init,
.deinit = nrf_wifi_wpa_supp_dev_deinit,
.scan2 = nrf_wifi_wpa_supp_scan2,
Expand Down
20 changes: 20 additions & 0 deletions drivers/wifi/nrf_wifi/src/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
struct nrf_wifi_vif_ctx_zep,
nrf_wifi_rpu_recovery_work);
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;
struct nrf_wifi_hal_dev_ctx *hal_dev_ctx = NULL;
int ret;

if (!vif_ctx_zep) {
Expand All @@ -90,6 +92,18 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
return;
}

fmac_dev_ctx = rpu_ctx_zep->rpu_ctx;
if (!fmac_dev_ctx) {
LOG_ERR("%s: fmac_dev_ctx is NULL", __func__);
return;
}

hal_dev_ctx = fmac_dev_ctx->hal_dev_ctx;
if (!hal_dev_ctx) {
LOG_ERR("%s: hal_dev_ctx is NULL", __func__);
return;
}

if (rpu_ctx_zep->rpu_recovery_in_progress) {
#ifdef CONFIG_NRF_WIFI_RPU_RECOVERY_DEBUG
LOG_ERR("%s: RPU recovery already in progress", __func__);
Expand Down Expand Up @@ -134,6 +148,8 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
}
#endif
rpu_ctx_zep->rpu_recovery_in_progress = true;
rpu_ctx_zep->wdt_irq_received += hal_dev_ctx->wdt_irq_received;
rpu_ctx_zep->wdt_irq_ignored += hal_dev_ctx->wdt_irq_ignored;
#ifdef CONFIG_NRF_WIFI_RPU_RECOVERY_DEBUG
LOG_ERR("%s: Bringing the interface down", __func__);
#else
Expand Down Expand Up @@ -429,6 +445,10 @@ int nrf_wifi_if_send(const struct device *dev,
#ifdef CONFIG_NRF70_RAW_DATA_TX
}
#endif /* CONFIG_NRF70_RAW_DATA_TX */
if (ret == NRF_WIFI_STATUS_FAIL) {
/* FMAC API takes care of freeing the nbuf */
host_stats->total_tx_drop_pkts++;
}
goto unlock;
drop:
if (host_stats != NULL) {
Expand Down
5 changes: 0 additions & 5 deletions drivers/wifi/nrf_wifi/src/wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ int nrf_wifi_get_power_save_config(const struct device *dev,

fmac_dev_ctx = rpu_ctx_zep->rpu_ctx;

if (!rpu_ctx_zep) {
LOG_ERR("%s: rpu_ctx_zep is NULL", __func__);
goto out;
}

vif_ctx_zep->ps_info = ps_config;

vif_ctx_zep->ps_config_info_evnt = false;
Expand Down
23 changes: 15 additions & 8 deletions drivers/wifi/nrf_wifi/src/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,20 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh,
}

fmac_dev_ctx = ctx->rpu_ctx;
if (!fmac_dev_ctx) {
shell_fprintf(sh, SHELL_ERROR, "FMAC context not initialized\n");
ret = -ENOEXEC;
goto unlock;
}

hal_dev_ctx = fmac_dev_ctx->hal_dev_ctx;
if (!hal_dev_ctx) {
shell_fprintf(sh, SHELL_ERROR, "HAL context not initialized\n");
ret = -ENOEXEC;
goto unlock;
}

shell_fprintf(sh,
SHELL_INFO,
shell_fprintf(sh, SHELL_INFO,
"wdt_irq_received: %d\n"
"wdt_irq_ignored: %d\n"
"last_wakeup_now_asserted_time_ms: %lu milliseconds\n"
Expand All @@ -950,14 +960,11 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh,
"current time: %lu milliseconds\n"
"rpu_recovery_success: %d\n"
"rpu_recovery_failure: %d\n\n",
hal_dev_ctx->wdt_irq_received,
hal_dev_ctx->wdt_irq_ignored,
ctx->wdt_irq_received, ctx->wdt_irq_ignored,
hal_dev_ctx->last_wakeup_now_asserted_time_ms,
hal_dev_ctx->last_wakeup_now_deasserted_time_ms,
hal_dev_ctx->last_rpu_sleep_opp_time_ms,
current_time_ms,
ctx->rpu_recovery_success,
ctx->rpu_recovery_failure);
hal_dev_ctx->last_rpu_sleep_opp_time_ms, current_time_ms,
ctx->rpu_recovery_success, ctx->rpu_recovery_failure);

ret = 0;
unlock:
Expand Down
2 changes: 1 addition & 1 deletion kernel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ rsource "Kconfig.obj_core"
menu "System Work Queue Options"
config SYSTEM_WORKQUEUE_STACK_SIZE
int "System workqueue stack size"
default 4096 if COVERAGE_GCOV
default 4096 if COVERAGE_GCOV || WIFI_NRF70
default 2560 if WIFI_NM_WPA_SUPPLICANT
default 1024

Expand Down
22 changes: 18 additions & 4 deletions modules/hostap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ config WIFI_NM_WPA_SUPPLICANT
select XSI_SINGLE_PROCESS
select NET_SOCKETS
select NET_SOCKETS_PACKET
select NET_SOCKETPAIR
select NET_L2_WIFI_MGMT
select WIFI_NM
select EXPERIMENTAL
select COMMON_LIBC_MALLOC
select ZVFS
select ZVFS_EVENTFD
help
WPA supplicant as a network management backend for WIFI_NM.

if WIFI_NM_WPA_SUPPLICANT

config HEAP_MEM_POOL_ADD_SIZE_HOSTAP
def_int 66560 if WIFI_NM_HOSTAPD_AP
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
# 30K is mandatory, but might need more for long duration use cases
def_int 30000
Expand All @@ -35,6 +37,8 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE
# TODO: Providing higher stack size for Enterprise mode to fix stack
# overflow issues. Need to identify the cause for higher stack usage.
default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
# This is needed to handle stack overflow issues on nRF Wi-Fi drivers.
default 5900 if WIFI_NM_WPA_SUPPLICANT_AP
default 5800

config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE
Expand Down Expand Up @@ -196,8 +200,14 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
select MBEDTLS_SERVER_NAME_INDICATION if MBEDTLS_BUILTIN
select MBEDTLS_X509_CRL_PARSE_C
select MBEDTLS_TLS_VERSION_1_2
select NOT_SECURE
depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
help
Enable Enterprise Crypto support for WiFi. This feature
is considered NOT SECURE due the lack of certificate
validation.

if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
config EAP_TLS
bool "EAP-TLS support"

Expand Down Expand Up @@ -256,7 +266,8 @@ config EAP_ALL
select EAP_GTC
select EAP_TTLS
select EAP_MSCHAPV2
default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
default y
endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE

config WIFI_NM_WPA_SUPPLICANT_WPA3
bool "WPA3 support"
Expand Down Expand Up @@ -300,6 +311,7 @@ config WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
bool "Hostapd crypto enterprise support"
depends on WIFI_NM_HOSTAPD_AP

if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
config EAP_SERVER_TLS
bool "EAP-TLS server support"

Expand Down Expand Up @@ -328,7 +340,9 @@ config EAP_SERVER_ALL
select EAP_SERVER_PEAP
select EAP_SERVER_GTC
select EAP_SERVER_TTLS
default y if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
default y

endif # WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE

config WIFI_NM_WPA_SUPPLICANT_BSS_MAX_IDLE_TIME
int "BSS max idle timeout in seconds"
Expand Down
4 changes: 3 additions & 1 deletion modules/hostap/src/hapd_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ int hostapd_send_wifi_mgmt_ap_sta_event(struct hostapd_iface *ap_ctx,
void *data)
{
struct sta_info *sta = data;
char *ifname = ap_ctx->bss[0]->conf->iface;
char *ifname;
struct wifi_ap_sta_info sta_info = { 0 };

if (!ap_ctx || !sta) {
return -EINVAL;
}

ifname = ap_ctx->bss[0]->conf->iface;

memcpy(sta_info.mac, sta->addr, sizeof(sta_info.mac));

if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) {
Expand Down
16 changes: 12 additions & 4 deletions modules/hostap/src/supp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,8 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status
struct wpa_ssid *ssid = wpa_s->current_ssid;
u8 channel;
struct signal_poll_resp signal_poll;
u8 *_ssid = ssid->ssid;
size_t ssid_len = ssid->ssid_len;
u8 *_ssid;
size_t ssid_len;
struct status_resp cli_status;
int proto;
int key_mgmt;
Expand All @@ -1299,6 +1299,8 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status
goto out;
}

_ssid = ssid->ssid;
ssid_len = ssid->ssid_len;
proto = ssid->proto;
key_mgmt = ssid->key_mgmt;
sae_pwe = wpa_s->conf->sae_pwe;
Expand Down Expand Up @@ -1489,9 +1491,15 @@ int supplicant_11k_cfg(const struct device *dev, struct wifi_11k_params *params)

int supplicant_11k_neighbor_request(const struct device *dev, struct wifi_11k_params *params)
{
int ssid_len = strlen(params->ssid);
int ssid_len;

if (params != NULL && ssid_len > 0) {
if (params == NULL) {
return -1;
}

ssid_len = strlen(params->ssid);

if (ssid_len > 0) {
if (ssid_len > WIFI_SSID_MAX_LEN) {
wpa_printf(MSG_ERROR, "%s: ssid too long %u",
__func__, ssid_len);
Expand Down
10 changes: 8 additions & 2 deletions modules/hostap/src/supp_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,24 @@ int supplicant_send_wifi_mgmt_conn_event(void *ctx, int status_code)
int supplicant_send_wifi_mgmt_disc_event(void *ctx, int reason_code)
{
struct wpa_supplicant *wpa_s = ctx;
int status = wpas_to_wifi_mgmt_disconn_status(reason_code);
enum net_event_wifi_cmd event;
int status;

if (!wpa_s || !wpa_s->current_ssid) {
return -EINVAL;
}

if (wpa_s->wpa_state >= WPA_COMPLETED) {
/* Disconnect event code & status */
status = wpas_to_wifi_mgmt_disconn_status(reason_code);
if (wpa_s->current_ssid->mode == WPAS_MODE_AP) {
event = NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT;
} else {
event = NET_EVENT_WIFI_CMD_DISCONNECT_RESULT;
}
} else {
/* Connect event code & status */
status = WIFI_STATUS_CONN_FAIL;
if (wpa_s->current_ssid->mode == WPAS_MODE_AP) {
event = NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT;
} else {
Expand Down Expand Up @@ -300,13 +304,15 @@ int supplicant_send_wifi_mgmt_ap_sta_event(void *ctx,
{
struct sta_info *sta = data;
struct wpa_supplicant *ap_ctx = ctx;
char *ifname = ap_ctx->ifname;
char *ifname;
struct wifi_ap_sta_info sta_info = { 0 };

if (!ap_ctx || !sta) {
return -EINVAL;
}

ifname = ap_ctx->ifname;

memcpy(sta_info.mac, sta->addr, sizeof(sta_info.mac));

if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) {
Expand Down
Loading
Loading