1#
2# Copyright (c) 2024 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7menuconfig WIFI_CREDENTIALS
8	bool "WIFI credentials management"
9	select EXPERIMENTAL
10	help
11	  Enable WiFi credentials management subsystem.
12
13if WIFI_CREDENTIALS
14
15module = WIFI_CREDENTIALS
16module-str = wifi_credentials
17source "subsys/logging/Kconfig.template.log_config"
18
19choice WIFI_CREDENTIALS_BACKEND
20	prompt "WiFi credentials backend"
21	default WIFI_CREDENTIALS_BACKEND_PSA if BUILD_WITH_TFM
22	default WIFI_CREDENTIALS_BACKEND_SETTINGS
23	default WIFI_CREDENTIALS_BACKEND_NONE if WIFI_CREDENTIALS_STATIC
24	help
25	  Selects whether to use PSA Protected Storage or the Zephyr settings subsystem
26	  for credentials storage.
27
28config WIFI_CREDENTIALS_BACKEND_SETTINGS
29	bool "Zephyr Settings"
30	depends on SETTINGS
31	depends on !SETTINGS_NONE
32
33config WIFI_CREDENTIALS_BACKEND_PSA
34	bool "PSA Protected Storage"
35	depends on BUILD_WITH_TFM
36
37config WIFI_CREDENTIALS_BACKEND_NONE
38	bool "No credentials storage"
39	depends on WIFI_CREDENTIALS_STATIC
40
41endchoice
42
43config WIFI_CREDENTIALS_MAX_ENTRIES
44	int "Number of supported WiFi credentials"
45	default 2
46	help
47	  This detemines how many different WiFi networks can be configured at a time.
48
49config WIFI_CREDENTIALS_SAE_PASSWORD_LENGTH
50	int "Max. length of SAE password"
51	default 128
52	help
53	  There is no official limit on SAE password length,
54	  but for example Linux 6.0 has a hardcoded limit of 128 bytes.
55
56config WIFI_CREDENTIALS_SHELL
57	bool "Shell commands to manage Wi-Fi credentials"
58	default y
59	depends on SHELL
60	depends on !WIFI_CREDENTIALS_BACKEND_NONE
61
62config WIFI_CREDENTIALS_CONNECT_STORED
63	bool "Add command to connect to stored networks directly."
64	default y
65
66if WIFI_CREDENTIALS_CONNECT_STORED
67
68config WIFI_CREDENTIALS_CONNECT_STORED_CONNECTION_TIMEOUT
69	int "Connection timeout"
70	default 30
71	help
72	   Wait period before falling back to the next entry in the list of stored SSIDs.
73
74endif # WIFI_CREDENTIALS_CONNECT_STORED
75
76endif # WIFI_CREDENTIALS
77
78if WIFI_CREDENTIALS_BACKEND_PSA
79
80config WIFI_CREDENTIALS_BACKEND_PSA_OFFSET
81	int "PSA_KEY_ID range offset"
82	default 0
83	help
84	  The PSA specification mandates to set key identifiers for keys
85	  with persistent lifetime. The users of the PSA API are responsible (WIFI credentials
86	  management is user of PSA API) to provide correct and unique identifiers.
87
88endif # WIFI_CREDENTIALS_BACKEND_PSA
89
90config WIFI_CREDENTIALS_STATIC
91	bool "Static Wi-Fi network configuration"
92
93if WIFI_CREDENTIALS_STATIC
94
95config WIFI_CREDENTIALS_STATIC_SSID
96	string "SSID of statically configured WiFi network"
97
98config WIFI_CREDENTIALS_STATIC_PASSWORD
99	string "Password of statically configured Wi-Fi network"
100	default ""
101
102choice WIFI_CREDENTIALS_STATIC_TYPE
103	prompt "Static Wi-Fi network security type"
104	default WIFI_CREDENTIALS_STATIC_TYPE_PSK
105
106config WIFI_CREDENTIALS_STATIC_TYPE_OPEN
107	bool "OPEN"
108
109config WIFI_CREDENTIALS_STATIC_TYPE_PSK
110	bool "WPA2-PSK"
111
112config WIFI_CREDENTIALS_STATIC_TYPE_PSK_SHA256
113	bool "WPA2-PSK-SHA256"
114
115config WIFI_CREDENTIALS_STATIC_TYPE_SAE
116	bool "SAE"
117
118config WIFI_CREDENTIALS_STATIC_TYPE_WPA_PSK
119	bool "WPA-PSK"
120
121endchoice
122
123endif
124