Skip to content

Conversation

@gojimmypi
Copy link
Contributor

@gojimmypi gojimmypi commented Mar 6, 2024

Description

Although labeled as an Arduino update, others may find the new memory allocation and other function messages useful. The included breadcrumbs allowed me to tune wolfSSL user_settings.h to have TLS client or server examples with as little as 32KB free RAM. (specifically tested on the Arduino Nano 33 IoT)

Ready for Arduino publish version 5.6.6-Arduino.2

  • Enhances the Arduino Library publishing script. All lower case name: wolfssl. Move wolfssl.h to separate file.
  • Updates Arduino client and server examples. Adds examples to published Arduino library.
  • Allows WOLFSSL_MSG() to send messages via Arduino Serial.print().
  • Revises default Arduino user_settings.h for wolfSSL.
  • Includes a variety of breadcrumb messages when DEBUG_WOLFSSL is enabled, mostly memory allocation related.
  • Adds some testsuite files to .gitignore

Note the Arduino user_settings.h has DEBUG_WOLFSSL defined (set to enabled), by default, allowing a more interesting TLS examples, particularly on slower devices.

See the Arduino-wolfSSL and log.

To have these changes applied to the wolfSSL Arduino library, see wolfSSL/Arduino-wolfSSL#5.

Fixes zd# n/a

Testing

How did you test?

Manually tested on various Arduino board and:

./configure --enable-all
make clean
make && make test

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@gojimmypi gojimmypi requested a review from dgarske March 6, 2024 21:09
@gojimmypi gojimmypi force-pushed the PR-Arduino-Logging branch 2 times, most recently from 6268a77 to eef0e9d Compare March 6, 2024 22:19
@gojimmypi gojimmypi force-pushed the PR-Arduino-Logging branch from eef0e9d to e40eb3c Compare March 6, 2024 23:13
@gojimmypi
Copy link
Contributor Author

Jenkins retest this please.

@SparkiDev SparkiDev merged commit 28e8228 into wolfSSL:master Mar 7, 2024
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gojimmypi This PR was merged and has a lot of debugging added that should be removed.

keySz = ssl->eccTempKeySz;
/* get curve type */
if (ssl->ecdhCurveOID > 0) {
WOLFSSL_MSG("calling ecc_cuve"); /* TODO; review */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new logging entries and TODO's probably should not be here.

else
#endif
{
WOLFSSL_MSG("make key"); /* TODO review */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new logging entries and TODO's probably should not be here.

#ifndef WOLFSSL_NO_MALLOC
if (p == NULL) {
p = (ecc_point*)XMALLOC(sizeof(ecc_point), heap, DYNAMIC_TYPE_ECC);
WOLFSSL_MSG_EX("XMALLOC ecc_point %d bytes.", sizeof(ecc_point));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this logging seems like debugging and should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dgarske - yes, the debugging breadcrumbs were included as I found them extremely valuable when enabling DEBUG_WOLFSSL to see where things were proceeding, and where code would quietly just halt when out of memory (in my case - the memory constrained embedded devices such as ESP32 or the tiny 32KB Arduino).

I thought they might be helpful to a future developer in a similar situation. The TODO was however, an oversight on my part and was not intended to be included.

Do you wish to have all of the breadcrumbs in this PR removed, or shall I remove the ones you mentioned and perhaps some others at my discretion?

gojimmypi added a commit to gojimmypi/wolfssl that referenced this pull request Mar 8, 2024
dgarske added a commit that referenced this pull request Mar 8, 2024
@gojimmypi gojimmypi deleted the PR-Arduino-Logging branch October 9, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants