Skip to content

esp: use wc_ConstantCompare.#144

Open
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:wc_cons_compare
Open

esp: use wc_ConstantCompare.#144
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:wc_cons_compare

Conversation

@philljj

@philljj philljj commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

wolfcrypt exposes a constant compare wrapper now:

Use it instead of our own.

Testing

make && make cppcheck && make unit-esp && LD_LIBRARY_PATH=/usr/local/lib ./build/test/unit-esp

Copilot AI review requested due to automatic review settings July 16, 2026 17:20
@philljj philljj self-assigned this Jul 16, 2026
@philljj

philljj commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Some of the tests are using old wolfssl

Configuration summary for wolfssl version 5.9.1
...
./src/wolfesp.c:1214:10: error: call to undeclared function 'wc_ConstantCompare'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1214 |     rc = wc_ConstantCompare(icv, hash, esp_sa->icv_len);
      |          ^
1 error generated.
gmake: *** [Makefile:860: build/test/unit-esp] Error 1

This will pass when the nightly branch is updated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates wolfIP’s ESP HMAC ICV verification to use the newly exported wolfCrypt constant-time compare wrapper, removing the local duplicate implementation and aligning wolfIP with upstream wolfCrypt.

Changes:

  • Removed the local esp_const_memcmp() constant-time compare helper.
  • Switched ESP ICV verification to wc_ConstantCompare().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants