Extend Hash.h Crypto library workaround to RP2040/RP2350#386
Open
bdraco wants to merge 1 commit intoESP32Async:mainfrom
Open
Extend Hash.h Crypto library workaround to RP2040/RP2350#386bdraco wants to merge 1 commit intoESP32Async:mainfrom
bdraco wants to merge 1 commit intoESP32Async:mainfrom
Conversation
The existing ESP8266 workaround detects when Crypto-no-arduino's Hash.h is included instead of the framework's Hash library (by checking the CRYPTO_HASH_h guard) and re-includes the correct one. Extend this to RP2040/RP2350 platforms which use the same framework Hash library for sha1(). Also declare Hash as a dependency for the raspberrypi platform in library.json so PlatformIO resolves it correctly.
mathieucarbou
approved these changes
Feb 9, 2026
Member
|
Thank you @bdraco for these tests, let's see the build output. PR is opened in draft because you are also finishing some testing I guess ? |
Merged
17 tasks
Author
|
Just making sure my testing is reproducible before marking as ready |
Author
|
All good. re-confirmed fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ESP8266 codepath in
AsyncWebSocket.halready has a workaround for when the Crypto library'sHash.hgets included instead of the framework's version — it checks for theCRYPTO_HASH_hguard and re-includes the correct one via<../src/Hash.h>.RP2040/RP2350 has the same issue since the Arduino-Pico framework also provides a
Hashlibrary withsha1(), but this workaround was never extended when RP2040 support was added.This showed up in ESPHome CI when
web_server(ESPAsyncWebServer) anddsmr(Crypto-no-arduino) are compiled together on RP2040: