-
Notifications
You must be signed in to change notification settings - Fork 835
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
Improved Arduino Support: ESP32, Due #7177
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.
What hardware have you tested with?
IDE/ARDUINO/wolfssl-arduino.sh
Outdated
#define WOLFSSL_ARDUINO | ||
|
||
/* Math library (remove this to use normal math)*/ | ||
# if [ ! -f ".${ROOT_SRC_DIR}/user_settings.h" ]; then |
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.
Why is this commented out and still 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.
oh, that was an oversight. good catch, deleted.
#define WOLFSSL_SM4 | ||
*/ | ||
|
||
// #define WOLFSSL_MEMORY_STORAGE __FlashStringHelper * |
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.
What is WOLFSSL_MEMORY_STORAGE
? Please document
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.
WOLFSSL_MEMORY_STORAGE
is an experimental macro for the Arduino-specific F(string_literal)
macro class to help improve memory storage.
I'll review and either add more detail or remove for now.
*edit: I've removed the WOLFSSL_MEMORY_STORAGE
macro for now.
src/internal.c
Outdated
@@ -2314,6 +2314,12 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap) | |||
ctx->CBIORecvFrom = uIPRecvFrom; | |||
} | |||
#endif | |||
#elif defined(ARDUINO) | |||
#if defined(__AVR__) |
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.
Why need this at all? Seems like requiring WOLFSSL_USER_IO is the better option. Then you can remove this.
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.
oh, nice. excellent suggestion, thank you. changed.
IDE/ARDUINO/PREPENDED_README.md
Outdated
`WC_SHA512` should be used for the enum name. | ||
|
||
|
||
# wolfSSL Release 5.6.6 (Dec 19, 2023) |
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.
Would prefer a link to the ChangeLog.md and not duplicating.
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.
This is different from the change log.
My intention for the PREPENDED_README.md is to add some prepended text to the beginning of the library README.md
published in the Official wolfSSL Arduino Library to indicate the Arduino-specific nature.
This prepended text might have Arduino-specific release information, outside of the normal wolfSSL versions, that are needed to be tagged as noted in the Arduino Library Specifications and noted in the requirements:
The library repository must have a Git tag (or release) and must have been compliant with all the above requirements at the time of that tag.
There is however, an argument that the PREPENDED_README.md
file is only a temporary file for the published wolfSSL Arduino README.md and could be excluded here?
edit: I've removed the programmatically generated PREPENDED_README.md
and added the name to .gitignore
.
So far I've successfully tested with two different ESP32 devices and an ARM-based Arduino Due. I have an Arduino Uno rev 3 with an Ethernet Shield. I gave up trying to fit TLS into the 8KB RAM, but we might be able to do other things. I tried a Arduino Mega & gave up for the same small memory reason. I've ben focused on the TLS client & server examples. I have a Arduino Uno R4 WiFi on my workbench that is known to not work yet. (Renesas RA4M1 + Espressif ESP32-S3) I have a variety of other non-Arduino devices that could be tested. There's quite a list of Arduino and compatible systems on wikipedia. The
*edit: just to clarify: I've tested with some other boards, but the source for those updated examples is still WIP. I'll be creating a separate PR for the Arduino Client and Server examples in the coming weeks, |
a193a64
to
28b9913
Compare
1f31b9e
to
105c4cb
Compare
105c4cb
to
ee0e25d
Compare
Retest this please |
retest this please |
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.
Looks good. Lets find an engineer to also try this out.
I used our internal testing for the Intel Galileo, and was able to produce the same results as the old version This test does the following:
I made some suggestions for the README directly to Jim, these suggestions where due to the confusion of using option 1 for step 1. This has been clarified as of posting this comment and the README updated I have not tested with a ESP32/Arduino DUE since I lack the hardware to test the functionality of that portion of the PR. |
Jenkins retest this please. |
Description
This PR improves support for the Arduino platform.
I'll be testing other Arduino boards, but I've added the
help wanted
label to invite others to test these changes with various other devices.Of particular interest, gated sections added to:
src/internal.c
(only a placeholder reminder / not part of "else" gating)wolfcrypt/src/random.c
(more board-specific implementation will be needed here)wolfssl/wolfcrypt/settings.h
(only AVR, ARM, and Espressif at this time)wolfssl/wolfcrypt/tfm.h
(just a spelling correction)wolfssl/wolfcrypt/wc_port.h
(only basic Arduino support, likely needs work for other boards)wolfssl/ssl.h
(only a placeholder reminder & adjacent cleanup)wolfssl/test.h
(only a placeholder reminder; test.h not yet working in Arduino)wolfssl/wolfio.h
(only Espressif at this time)Fixes zd# may help with 17001, although more ESP8266 work is known to be needed.
See also #6360 and wolfSSL/Arduino-wolfSSL#1
Testing
How did you test?
Primarily tested in the Arduino environment, as well as the usual:
Checklist