Skip to content

fix: Do not define XMEMCPY in case of encrypted ext flash - #973

Open
vhdirk wants to merge 2 commits into
wolfSSL:masterfrom
vhdirk:avoid-redefine-xmemcpy
Open

vhdirk wants to merge 2 commits into
wolfSSL:masterfrom
vhdirk:avoid-redefine-xmemcpy

Conversation

@vhdirk

@vhdirk vhdirk commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

When using encrypted ext flash, wolfssl/types.h is included. That defines XMEMCPY, XMEMCMP and XMEMSET, but only after the fallback definitions here.

When using encrypted ext flash, wolfssl/types.h is included.
That already defines XMEMCPY, XMEMCMP and XMEMSET, so there's no need
for this fallback mechanism
Copilot AI balanced review requested due to automatic review settings November 5, 2026 13:21
@vhdirk vhdirk changed the title fix: Do not redefine XMEMCPY in case of encrypted ext flash fix: Do not define XMEMCPY in case of encrypted ext flash Nov 5, 2026

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.

🟡 Changes recommended

The fallback is disabled for encrypted BUILD_TOOL builds, leaving XMEMCPY unresolved and breaking the non-MMU UART flash server build with ENCRYPT=1 and NVM_FLASH_WRITEONCE=1.

1 open issue
What changed in this PR

This PR aims to prevent fallback memory macros from conflicting with wolfSSL definitions when external-flash encryption is enabled.

Changes:

  • Adds an EXT_ENCRYPTED check to the fallback macro guard in libwolfboot.c.
File Description
src/​libwolfboot.c Skips fallback memory macro definitions when EXT_ENCRYPTED is defined.

Review effort: Balanced

Comment thread src/libwolfboot.c Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay to test. Contributor agreement on file for customer.

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.

5 participants