wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

Introduce IDE/PlatformIO; add wolfSSL Benchmark and Test Examples

Open gojimmypi opened this issue 1 year ago • 6 comments

Description

Adds IDE/PlatformIO examples.

See also https://github.com/wolfSSL/wolfssl/pull/7413 and https://github.com/platformio/platformio-registry/issues/85

Fixes zd# n/a

Testing

How did you test?

Tested manually using PlatformIO in VS Code.

Checklist

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

gojimmypi avatar May 14 '24 02:05 gojimmypi

@bandi13 thanks for testing this for a test drive!

It's actually a good thing that the example test app is failing here. The published wolfSSL 5.7.0-rev.3b (Post Release Update for PlatformIO) referenced by the example on PlatformIO is stale.

I introduced a SHA interleave test in https://github.com/wolfSSL/wolfssl/pull/7262. This test is included in the stale, post 5.7.0 version published at PlatformIO and is failing as desired, properly detecting the interleave problem.

The failing SHA interleave was the root cause of the SRP errors noted in https://github.com/wolfSSL/wolfssl/issues/7210.

The SHA/SRP problem was fixed in https://github.com/wolfSSL/wolfssl/pull/7505, merged within the last day but not yet published to PlatformIO.

Unfortunately (or fortunately, depending on your perspective), I found a new problem with the latest version of wolfSSL for PlatformIO as noted in https://github.com/wolfSSL/wolfssl/issues/7533.

My plan is to create a new PR to fix https://github.com/wolfSSL/wolfssl/issues/7533 and then publish a new, post-release wolfSSL to PlatformIO.

I don't think there's any problem with this particular PR 7528, as the root cause is the currently published wolfSSL version at PlatformIO. I've confirmed the latest master branch of wolfSSL works properly for both the SHA and SRP tests.

Reminder the SRP for the Apple HomeKit also requires the FP_MAX_BITS setting:

#define WOLFCRYPT_HAVE_SRP
#define FP_MAX_BITS (8192 * 2)

See the 4 different versions of wolfSSL available at PlatformIO:

  • Regular (release): https://registry.platformio.org/libraries/wolfssl/wolfssl

  • Arduino (release): https://registry.platformio.org/libraries/wolfssl/Arduino-wolfSSL

  • Regular (staging): https://registry.platformio.org/libraries/wolfssl-staging/wolfSSL

  • Arduino (staging): https://registry.platformio.org/libraries/wolfssl-staging/Arduino-wolfSSL

Note the Arduino version of the PlatformIO library should not be confused with the Official wolfSSL for Arduino: https://github.com/wolfSSL/Arduino-wolfSSL which is published to https://www.arduino.cc/reference/en/libraries/wolfssl/

This initial rollout has been a little more bumpy than anticipated. I do believe that once the appropriate platform-specific fixes are implemented, that the regular release cycle should be considerably more stable and graceful.

gojimmypi avatar May 15 '24 00:05 gojimmypi

@gojimmypi do you want to rebase the PR or accept as-is?

dgarske avatar May 15 '24 16:05 dgarske

@dgarske please stand by. I'd like to rebase and apply some minor updates. Testing is taking longer than anticipated.

gojimmypi avatar May 15 '24 18:05 gojimmypi

Hi @dgarske I've refreshed from upstream and made some minor changes in https://github.com/wolfSSL/wolfssl/pull/7528/commits/503bbbec8fcb0cd1ece6404fcade60945fa454ab.

Key to getting this to work was having the proper fresh update of wolfSSL published to PlatformIO.

Tested and confirmed working are these versions in platformio.ini:

@bandi13 if you could please, take this for a test drive again & let me know how it goes.

gojimmypi avatar May 16 '24 00:05 gojimmypi

Jenkins retest this please.

gojimmypi avatar May 16 '24 04:05 gojimmypi

Jenkins retest this please

gojimmypi avatar May 16 '24 21:05 gojimmypi