Skip to content

Use wolfCrypt's Base16_Decode in test.h when it is available - #1169

Open
ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:test-base16-collision
Open

Use wolfCrypt's Base16_Decode in test.h when it is available#1169
ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:test-base16-collision

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

The static Base16_Decode in test.h collides with wolfSSL's public declaration when coding.h is included first. TPM builds hit this, as the wolfTPM headers pull in coding.h, so api.c and unit.c will not build with --enable-tpm against an --enable-all wolfSSL.

Include coding.h and compile the local copy only when WOLFSSL_BASE16 is absent. The include also settles the macro for the guard, which test.h would not otherwise see. The fallback is still needed: --enable-wolfssh alone does not set WOLFSSL_BASE16.

CopilotAI lite review requested due to automatic review settings August 13, 2026 20:56

CopilotAI 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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Resolves a build collision between wolfSSH’s local Base16_Decode (in test.h) and wolfSSL’s public Base16_Decode declaration when coding.h is included first (notably in TPM builds with --enable-all).

Changes:

  • Include wolfssl/wolfcrypt/coding.h to ensure WOLFSSL_BASE16 is visible and Base16_Decode is declared when available.
  • Compile the local fallback Base16_Decode implementation only when WOLFSSL_BASE16 is not defined.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wolfSSL-Fenrir-botwolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1169

Scan targets checked:wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

 - test.h's static Base16_Decode collides with wolfSSL's public one
when coding.h lands first, breaking --enable-tpm builds.
- Include coding.h in test.h, keeping the local copy only when
WOLFSSL_BASE16 is absent; --enable-wolfssh alone does not set it.
- api.c includes coding.h too, dropping its hand-declared
Base64_Encode_NoNl, which would now be a duplicate.
@ejohnstown
ejohnstownforce-pushed the test-base16-collision branch from a65720f to 8ad6ca4CompareAugust 13, 2026 22:37
Sign up for freeto 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

@ejohnstown@wolfSSL-Fenrir-bot