Skip to content

Misc cleanup#104

Merged
danielinux merged 2 commits intowolfSSL:masterfrom
philljj:misc_cleanup
Apr 22, 2026
Merged

Misc cleanup#104
danielinux merged 2 commits intowolfSSL:masterfrom
philljj:misc_cleanup

Conversation

@philljj
Copy link
Copy Markdown
Contributor

@philljj philljj commented Apr 22, 2026

Description

  • Fix error return in esp_check_icv_hmac (return -1 instead of num bytes differing).
  • Refactor ip header update to esp_transport_wrap (removes duplicated code).
  • Clean up esp tests so they correctly return error if built without certain alg support.

@philljj philljj self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 16:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR performs small ESP-related cleanups to make error returns consistent, centralize IP-header fixups in the wrap path, and ensure ESP test binaries fail fast when required crypto support is not compiled in.

Changes:

  • Normalize HMAC ICV check failure return to -1 instead of a non-zero compare value.
  • Move IPv4 header updates (len/proto/checksum) into esp_transport_wrap() and remove duplicate fixups in unit tests / send path.
  • Update ESP integration tests to return an error when built without GCM-stream or DES3 support, and avoid initializing the stack if the selected mode cannot be supported.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/wolfesp.c Normalizes ICV mismatch return and refactors IP header updates into esp_transport_wrap() (removing duplication in esp_send()).
src/test/unit/unit_esp.c Removes manual proto/len/checksum fixups that are now handled by esp_transport_wrap().
src/test/esp/test_esp.c Fails early with an error when selected ESP mode requires missing algorithm support; defers stack init until after SA setup succeeds.
src/test/esp/esp_server.c Same “fail early if alg not built” behavior for the server test binary.
Makefile Clarifies debug-flag comments.

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

@philljj philljj requested review from Copilot, danielinux and gasbytes and removed request for Copilot April 22, 2026 17:12
@philljj philljj assigned danielinux and gasbytes and unassigned philljj Apr 22, 2026
@danielinux danielinux merged commit f97a8ae into wolfSSL:master Apr 22, 2026
34 checks passed
@philljj philljj deleted the misc_cleanup branch April 22, 2026 19:03
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