Skip to content
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

Espressif updates to fix Apple Homekit SHA / SRP #7505

Merged
merged 2 commits into from
May 14, 2024

Conversation

gojimmypi
Copy link
Contributor

@gojimmypi gojimmypi commented May 4, 2024

Description

This PR addresses the problems encountered for the ESP32-C2 as noted in #7210 (see #7210 (comment)).

In particular, the concurrent SHA calculations have been improved: both in a multi-threaded environment, as well as for multiple, different SHA calculations (e.g. multiple SHA256, and/or concurrent, ongoing SHA512 hash calculations, suc as those in the SRP)

See application & notes in AchimPieters/esp32-homekit-demo#3

Fixes zd# n/a

Testing

How did you test?

Exhaustively tested on 8 types of ESP32 flavors + ESP8288 using my test jig and the wolfssl_test example app for Espressif.

Also tested on Apple iPhone 5c with the Apple Homekit app and confirmed working for:

  • ESP32
  • ESP32-S2
  • ESP32-S3
  • ESP32-C2
  • ESP32-C3
  • ESP32-C6

A variety of other minor changes, comments, and various code cleanup.

Checklist

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

wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h Outdated Show resolved Hide resolved
@@ -44,13 +44,31 @@
#include <esp_types.h>
#include <esp_log.h>

#ifndef _INTPTR_T_DECLARED
Copy link
Contributor

Choose a reason for hiding this comment

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

These normally come from stdint.h. Any reason not to use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should have left myself a reminder; I don't recall. You're correct. For the ESP32 ESP-IDF, this is defined in:

xtensa-esp-elf\xtensa-esp-elf\sys-include\sys\_stdint.h

The missing _INTPTR_T_DECLARED was encountered in one of the other environments such as Arduino, PlatformIO, possibly the ESP8266 RTOS SDK.

There's probably no harm in leaving this, but I can put it in a separate PR once I re-discover why I needed it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine to leave it as-is.

wolfcrypt/src/port/Espressif/esp32_sha.c Outdated Show resolved Hide resolved
@dgarske
Copy link
Contributor

dgarske commented May 13, 2024

Retest this please

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.

3 participants