-
Notifications
You must be signed in to change notification settings - Fork 833
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
Introduce Espressif common CONFIG_WOLFSSL_EXAMPLE_NAME, Kconfig #7866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive work!
Little stuff: I Found 3 whitespace infractions, and left several question-comments. In particular, I think you left on some debug gates in the user_config.h
inadvertently.
#define USE_CERT_BUFFERS_256 | ||
/* Be sure to include in app when using example certs: */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix hard tabs in the indentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, interesting. Visual Studio usually converts to spaces at save time. Good catch. Fixed
#define USE_CERT_BUFFERS_256 | ||
/* Be sure to include in app when using example certs: */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more hard tabs to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also fixed
@@ -208,7 +538,7 @@ | |||
#define USE_FAST_MATH | |||
|
|||
/***** Use SP_MATH *****/ | |||
/* #undef USE_FAST_MATH */ | |||
/* #undef USE_FAST_MATH */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest you either snip out the added space after #undef
, or snip out a space afterwards to get the */
to line up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely!
bool "Enable RSA in my project" | ||
default "n" | ||
help | ||
RSA is disabled by default. Select this option to enable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is RSA default-disabled just as a space-saving measure, due to the small target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, good question. Having the default for "works on more systems" is desirable, particularly something like the C2 or Arduino Nano with limited memory.
The sdkconfig.defaults
can be used to set defaults, as well as sdkconfig.defaults.[target]
(see example).
I've been reluctant to include all the sdkconfig.defaults.[target]
files in all the examples without a compelling reason, but in the future it might be better to enable RSA by default, and then include a sdkconfig.defaults.esp32c2
file that disables it.
#define WOLFSSL_ESP32_HW_LOCK_DEBUG | ||
#define WOLFSSL_DEBUG_MUTEX | ||
#define WOLFSSL_DEBUG_ESP_RSA_MULM_BITS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to enable debug gates in the example config? Maybe so. Just wondering if you considered the overhead.
Edit: There's actually another #define WOLFSSL_ESP32_HW_LOCK_DEBUG
below, commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to enable debug gates in the example config? Maybe so.
Maybe, but not much interesting in this template example. I'll review with the other examples & see if any make sense without being too verbose. There's already some informative "always on" messages. See the ESP_LOGI()
in the TLS Client Example. I'll definitely be adding more settings to control these from Kconfig / menuconfig.
Another #define WOLFSSL_ESP32_HW_LOCK_DEBUG below, commented out.
Good catch. I've removed the extra one.
46280ff
to
a0fc2f0
Compare
Thanks, @douzzer for the code review and attention to detail. I believe I've tidied things up. |
retest this please |
Description
This PR introduces common KConfig and user setting files for the Espressif template app as it is the most basic example and least intrusive to change.
The intent is that all wolfSSL examples in all repos will have common
user_settings.h
,CMakeLists.txt
andKConfig
files, with only thesdkconfig.defaults
varying. Rather than propose all changes to all examples at once, this PR for only thetemplate
example is for simplified code review.Note that new configuration settings specific to ESP-IDF versions integrating wolfSSL are also included here. There's likely little to no effect on ESP-IDF versions that do not support the new features. As of the date of this PR, many features are only available on my ESP-IDF v5.2.2 fork.
The objective is to not only simplify the configuration of the
user_settings.h
file by utilizing themenuconfig
capabilities, but in doing so will also prevent changes from being needed when using the wolfSSL Managed Component. Recall that making changes, such as to theuser_settings.h
file, causes the component manager to complain about changes. This forces the user to convert the Managed Component to a regular component, defeating the purpose and value of having a managed component in the first place.Here's the new
idf.py menuconfig
as viewed in VisualGDB. Note the dropdown also increases end-user awareness to the other examples available:Fixes zd#: Not "fixing" but related to 18228.
Testing
How did you test?
Tested only on Espressif targets.
Checklist