Skip to content

Commit c454a42

Browse files
authored
Merge pull request #7866 from gojimmypi/pr-espressif-config
Introduce Espressif common CONFIG_WOLFSSL_EXAMPLE_NAME, Kconfig
2 parents 3f0ba97 + a0fc2f0 commit c454a42

6 files changed

Lines changed: 964 additions & 31 deletions

File tree

Lines changed: 366 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,366 @@
1+
# Kconfig template
2+
#
3+
# Copyright (C) 2006-2024 wolfSSL Inc. All rights reserved.
4+
#
5+
# This file is part of wolfSSL.
6+
#
7+
# wolfSSL is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 2 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# wolfSSL is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
#
21+
22+
# Kconfig File Version 5.7.0.001 for wolfssl_test
23+
24+
# Kconfig Format Rules
25+
#
26+
# See:
27+
# https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/kconfig.html
28+
#
29+
# Format rules for Kconfig files are as follows:
30+
#
31+
# Option names in any menus should have consistent prefixes. The prefix
32+
# currently should have at least 3 characters.
33+
#
34+
# The unit of indentation should be 4 spaces. All sub-items belonging to a
35+
# parent item are indented by one level deeper. For example, menu is indented
36+
# by 0 spaces, config menu by 4 spaces, help in config by 8 spaces, and the
37+
# text under help by 12 spaces.
38+
#
39+
# No trailing spaces are allowed at the end of the lines.
40+
#
41+
# The maximum length of options is NOT 50 characters as documented.
42+
# kconfcheck will complain that options should be 40 at most.
43+
#
44+
# Fix option lengths first. Superflous errors on other lines may occur.
45+
#
46+
# The maximum length of lines is 120 characters.
47+
#
48+
# python -m kconfcheck <path_to_kconfig_file>
49+
#
50+
# ---------------------------------------------------------------------------------------------------------------------
51+
# Begin main wolfSSL configuration menu
52+
# ---------------------------------------------------------------------------------------------------------------------
53+
menu "wolfSSL"
54+
config TLS_STACK_WOLFSSL
55+
bool "Include wolfSSL in ESP-TLS"
56+
default y
57+
select FREERTOS_ENABLE_BACKWARD_COMPATIBILITY
58+
help
59+
Includes wolfSSL in ESP-TLS so that it can be compiled with wolfSSL as its SSL/TLS library.
60+
61+
menu "Hardening"
62+
config ESP_WOLFSSL_WC_NO_HARDEN
63+
bool "Disable wolfSSL hardening"
64+
default n
65+
help
66+
Sets WC_NO_HARDEN
67+
68+
config ESP_WOLFSSL_TFM_TIMING_RESISTANT
69+
bool "Enable TFM Timing Resistant Code"
70+
default n
71+
help
72+
Sets TFM_TIMING_RESISTANT.
73+
74+
endmenu # Hardening
75+
76+
config ESP_WOLFSSL_ENABLE_BENCHMARK
77+
bool "Enable wolfSSL Benchmark Library"
78+
default n
79+
help
80+
Enables wolfcrypt/benchmark/benchmark.c code for benchmark metrics. Disables NO_CRYPT_BENCHMARK.
81+
82+
83+
menu "Benchmark Debug"
84+
config ESP_DEBUG_WOLFSSL_BENCHMARK_TIMING
85+
bool "Enable benchmark timing debug"
86+
depends on ESP_WOLFSSL_ENABLE_BENCHMARK
87+
default n
88+
help
89+
Enable wolfssl debug for benchmark metric timing (CPU Cycles, RTOS ticks, etc).
90+
91+
config ESP_WOLFSSL_BENCHMARK_TIMER_DEBUG
92+
bool "Enable benchmark timer debug"
93+
depends on ESP_WOLFSSL_ENABLE_BENCHMARK
94+
default n
95+
help
96+
Turn on timer debugging (used when CPU cycles not available)
97+
98+
endmenu # Benchmark Debug
99+
100+
# -----------------------------------------------------------------------------------------------------------------
101+
# wolfCrypt Test
102+
# -----------------------------------------------------------------------------------------------------------------
103+
config ESP_WOLFSSL_ENABLE_TEST
104+
bool "Enable wolfCrypt test Library"
105+
default n
106+
help
107+
Enables wolfcrypt/test/test.c code for testing. Disables NO_CRYPT_TEST.
108+
109+
menu "wolfCrypt tests"
110+
config WOLFSSL_HAVE_WOLFCRYPT_TEST_OPTIONS
111+
bool "Enable wolfCrypt Test Options"
112+
depends on ESP_WOLFSSL_ENABLE_TEST
113+
default n
114+
help
115+
Enables HAVE_WOLFCRYPT_TEST_OPTIONS
116+
endmenu # wolfCrypt tests
117+
118+
# -----------------------------------------------------------------------------------------------------------------
119+
# Apple HomeKit Options
120+
# -----------------------------------------------------------------------------------------------------------------
121+
menu "Apple HomeKit"
122+
config WOLFSSL_APPLE_HOMEKIT
123+
bool "Enable Apple HomeKit options"
124+
default n
125+
help
126+
Enables FP_MAX_BITS (8192 * 2), SRP, ChaCha, Poly1305, Base64 encoding needed for Apple HomeKit.
127+
endmenu # Apple HomeKit
128+
# -----------------------------------------------------------------------------------------------------------------
129+
130+
config ESP_WOLFSSL_DISABLE_MY_ECC
131+
bool "Disable ECC in my project"
132+
default "n"
133+
help
134+
ECC is enabled by default. Select this option to disable.
135+
136+
config ESP_WOLFSSL_ENABLE_MY_USE_RSA
137+
bool "Enable RSA in my project"
138+
default "n"
139+
help
140+
RSA is disabled by default. Select this option to enable.
141+
142+
config ESP_WOLFSSL_BENCHMARK
143+
bool "Enable wolfSSL Benchmark"
144+
default n
145+
help
146+
Enables user settings relevant to benchmark code
147+
148+
config ESP_TLS_USING_WOLFSSL_SPECIFIED
149+
bool "Use the specified wolfssl for ESP-TLS"
150+
default Y
151+
help
152+
Includes wolfSSL from specified directory (not using esp-wolfssl).
153+
154+
config ESP_WOLFSSL_NO_USE_FAST_MATH
155+
bool "Disable FAST_MATH library and all ESP32 Hardware Acceleration"
156+
select ESP_WOLFSSL_NO_HW
157+
select ESP_WOLFSSL_NO_HW_AES
158+
select ESP_WOLFSSL_NO_HW_HASH
159+
select ESP_WOLFSSL_NO_HW_RSA_PRI
160+
select ESP_WOLFSSL_NO_HW_RSA_PRI_MP_MUL
161+
select ESP_WOLFSSL_NO_HW_RSA_PRI_MULMOD
162+
select ESP_WOLFSSL_NO_HW_RSA_PRI_EXPTMOD
163+
default n
164+
help
165+
When disabling all hardware acceleration for smaller memory footprint,
166+
disabling TFM fast math provides faster wolfSSL software algorithms in an
167+
even smaller flash memory footprint.
168+
169+
menu "Protocol Config"
170+
config WOLFSSL_HAVE_ALPN
171+
bool "Enable ALPN (Application Layer Protocol Negotiation) in wolfSSL"
172+
default y
173+
174+
config WOLFSSL_ALLOW_TLS12
175+
bool "Allow TLS 1.2"
176+
default n
177+
help
178+
Allow TLS to fallback to TLS1.2. Memory footprint will likely be larger for TLS1.2.
179+
When disabled HTTPS and MQTT over TLS connections will fail if TLS1.3 not accepted.
180+
181+
config WOLFSSL_HAVE_OCSP
182+
bool "Enable OCSP (Online Certificate Status Protocol) in wolfSSL"
183+
default n
184+
endmenu # Protocol Config
185+
# -----------------------------------------------------------------------------------------------------------------
186+
187+
# -----------------------------------------------------------------------------------------------------------------
188+
menu "wolfSSL ESP-TLS"
189+
config TLS_STACK_WOLFSSL
190+
bool "Include wolfSSL in ESP-TLS"
191+
default y
192+
select FREERTOS_ENABLE_BACKWARD_COMPATIBILITY
193+
help
194+
Includes wolfSSL in ESP-TLS so that it can be compiled with wolfSSL as its SSL/TLS library.
195+
endmenu # wolfSSL ESP-TLS
196+
# -----------------------------------------------------------------------------------------------------------------
197+
198+
# -----------------------------------------------------------------------------------------------------------------
199+
config ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
200+
bool "Modify default hardware acceleration settings"
201+
default n
202+
help
203+
Typically used for debugging, analysis, or optimizations. The default
204+
hardware acceleration features can be each manually adjusted.
205+
206+
menu "wolfSSL Hardware Acceleration"
207+
208+
config ESP_WOLFSSL_NO_ESP32_CRYPT
209+
bool "Disable all ESP32 Hardware Acceleration"
210+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
211+
default n
212+
select ESP_WOLFSSL_NO_HW_AES
213+
select ESP_WOLFSSL_NO_HW_HASH
214+
select ESP_WOLFSSL_NO_HW_RSA_PRI
215+
select ESP_WOLFSSL_NO_HW_RSA_PRI_MP_MUL
216+
select ESP_WOLFSSL_NO_HW_RSA_PRI_MULMOD
217+
select ESP_WOLFSSL_NO_HW_RSA_PRI_EXPTMOD
218+
help
219+
Hardware acceleration enabled by default. When selected defines: NO_ESP32_CRYPT.
220+
Consider disabling FASTMATH (other libraries are faster in software and smaller)
221+
222+
config ESP_WOLFSSL_NO_HW_AES
223+
bool "Disable all ESP32 AES Hardware Acceleration"
224+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
225+
default n
226+
help
227+
Hardware acceleration enabled by default.When selected defines: NO_HW_AES
228+
229+
config ESP_WOLFSSL_NO_HW_HASH
230+
bool "Disable all ESP32 SHA Hash Hardware Acceleration"
231+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
232+
default n
233+
help
234+
Hardware acceleration enabled by default. When selected defines: NO_HW_HASH
235+
236+
config ESP_WOLFSSL_NO_HW_RSA_PRI
237+
bool "Disable all ESP32 RSA Hardware Acceleration"
238+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
239+
default n
240+
select ESP_WOLFSSL_NO_HW_PRI_MP_MUL
241+
select ESP_WOLFSSL_NO_HW_RSA_PRI_MULMOD
242+
select ESP_WOLFSSL_NO_HW_RSA_PRI_EXPTMOD
243+
help
244+
Hardware acceleration enabled by default. When selected defines: NO_HW_RSA_PRI
245+
246+
config ESP_WOLFSSL_NO_HW_RSA_PRI_MP_MUL
247+
bool "Disable all ESP32 Multiplication Hardware Acceleration"
248+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
249+
default n
250+
help
251+
Hardware acceleration enabled by default. When selected defines: NO_HW_RSA_PRI_MP_MUL
252+
253+
config ESP_WOLFSSL_NO_HW_RSA_PRI_MULMOD
254+
bool "Disable all ESP32 Modular Multiplication Hardware Acceleration"
255+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
256+
default n
257+
help
258+
Hardware acceleration enabled by default. When selected defines: NO_HW_RSA_PRI_MULMOD
259+
260+
config ESP_WOLFSSL_NO_HW_RSA_PRI_EXPTMOD
261+
bool "Disable all ESP32 RSA Exponential Math Hardware Acceleration"
262+
depends on ESP_WOLFSSL_ALT_HARDWARE_ACCELERATION
263+
default n
264+
help
265+
Hardware acceleration enabled by default.
266+
Select this option to force disable: NO_HW_RSA_PRI_EXPTMOD
267+
268+
endmenu # wolfSSL Hardware Acceleration
269+
# -----------------------------------------------------------------------------------------------------------------
270+
271+
# -----------------------------------------------------------------------------------------------------------------
272+
menu "wolfSSL Experimental Options"
273+
274+
config ESP_WOLFSSL_EXPERIMENTAL_SETTINGS
275+
bool "Enable wolfSSL Experimental Settings"
276+
default n
277+
help
278+
Enables experimental settings for wolfSSL. See documentation.
279+
280+
config ESP_WOLFSSL_ENABLE_KYBER
281+
bool "Enable wolfSSL Kyber"
282+
default n
283+
help
284+
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
285+
286+
endmenu # wolfSSL Experimental Options
287+
# -----------------------------------------------------------------------------------------------------------------
288+
289+
# -----------------------------------------------------------------------------------------------------------------
290+
menu "wolfSSL Debug Options"
291+
config ESP_WOLFSSL_DEBUG_WOLFSSL
292+
bool "Enable wolfSSL Debugging"
293+
default n
294+
help
295+
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
296+
endmenu # wolfSSL Debug Options
297+
# -----------------------------------------------------------------------------------------------------------------
298+
299+
# -----------------------------------------------------------------------------------------------------------------
300+
menu "wolfSSL Customization"
301+
config CUSTOM_SETTING_WOLFSSL_ROOT
302+
string "Enter a path for wolfSSL source code"
303+
default "~/workspace/wolfssl"
304+
help
305+
This option lets you specify a directory for the wolfSSL source code (typically a git clone).
306+
Enter the path using forward slashes (e.g., C:/myfolder/mysubfolder) or double backslashes
307+
(e.g., C:\\myfolder\\mysubfolder).
308+
309+
endmenu # wolfSSL Customization
310+
# -----------------------------------------------------------------------------------------------------------------
311+
312+
# -----------------------------------------------------------------------------------------------------------------
313+
menu "Component Config"
314+
config IGNORE_ESP_IDF_WOLFSSL_COMPONENT
315+
bool "Ignore the ESP-IDF component of wolfSSL (if present)"
316+
default n
317+
help
318+
Ignores wolfSSL present in the esp-idf/components directory. Requires wolfssl as a local component.
319+
320+
config IGNORE_LOCAL_WOLFSSL_COMPONENT
321+
bool "Ignore the local component of wolfSSL (if present)"
322+
default n
323+
help
324+
Ignores wolfSSL present in the local project components directory.
325+
Requires wolfssl as a ESP-IDF component.
326+
327+
endmenu # Component Config
328+
# -----------------------------------------------------------------------------------------------------------------
329+
330+
endmenu # wolfSSL
331+
# ---------------------------------------------------------------------------------------------------------------------
332+
333+
334+
# ---------------------------------------------------------------------------------------------------------------------
335+
menu "wolfSSH"
336+
config ESP_ENABLE_WOLFSSH
337+
bool "Enable wolfSSH options"
338+
default n
339+
help
340+
Enables WOLFSSH_TERM, WOLFSSL_KEY_GEN, WOLFSSL_PTHREADS, WOLFSSH_TEST_SERVER, WOLFSSH_TEST_THREADING
341+
342+
config ESP_WOLFSSL_DEBUG_WOLFSSH
343+
bool "Enable wolfSSH debugging"
344+
default n
345+
help
346+
Enable wolfSSH debugging macro. See user_settings.h
347+
348+
endmenu # wolfSSH
349+
# ---------------------------------------------------------------------------------------------------------------------
350+
351+
# ---------------------------------------------------------------------------------------------------------------------
352+
menu "wolfMQTT"
353+
config ESP_ENABLE_WOLFMQTT
354+
bool "Enable wolfMQTT options"
355+
default n
356+
help
357+
Enables WOLFMQTT
358+
359+
config ESP_WOLFSSL_DEBUG_WOLFMQTT
360+
bool "Enable wolfMQTT debugging"
361+
default n
362+
help
363+
Enable wolfMQTT debugging macro. See user_settings.h
364+
365+
endmenu # wolfMQTT
366+
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)