Skip to content

image.c: mldsa: don't discard return value - #856

Merged
danielinux merged 1 commit into
wolfSSL:masterfrom
rizlik:mldsa_ret_check
Aug 27, 2026
Merged

image.c: mldsa: don't discard return value#856
danielinux merged 1 commit into
wolfSSL:masterfrom
rizlik:mldsa_ret_check

Conversation

@rizlik

@rizlik rizlik commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

F-7968

Copilot AI lite review requested due to automatic review settings August 12, 2026 11:06

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

Adjusts ML-DSA signature verification in src/image.c to properly handle and propagate error states (avoiding use of an uninitialized key and ensuring return values are not effectively ignored) during wolfCrypt ML-DSA key setup.

Changes:

  • Adds an early return when wc_MlDsaKey_Init() fails (preventing subsequent operations on an uninitialized wc_MlDsaKey).
  • Makes ML-DSA wolfHSM key-ID setup conditional on prior success (ret == 0) after parameter configuration.
  • Simplifies control flow by removing a redundant if (ret == 0) wrapper around wc_MlDsaKey_SetParams().

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

Comment thread src/image.c
@danielinux danielinux assigned rizlik and unassigned danielinux Aug 13, 2026
@danielinux
danielinux merged commit 70919f3 into wolfSSL:master Aug 27, 2026
433 checks passed
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.

3 participants