Skip to content

fix for nightly memory allocation test cases with LMS#10739

Open
JacobBarthelmeh wants to merge 1 commit into
wolfSSL:masterfrom
JacobBarthelmeh:test
Open

fix for nightly memory allocation test cases with LMS#10739
JacobBarthelmeh wants to merge 1 commit into
wolfSSL:masterfrom
JacobBarthelmeh:test

Conversation

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

No description provided.

@JacobBarthelmeh JacobBarthelmeh self-assigned this Jun 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 23:23

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

This PR updates the LMS/XMSS API tests to behave safely under simulated allocation-failure conditions (nightly LMS memory allocation tests), primarily by ensuring stack-allocated crypto objects are in a known state before init/cleanup paths run.

Changes:

  • Zero-initialize LmsKey/XmssKey and WC_RNG locals so cleanup is safe if initialization is skipped due to early failures.
  • Adjust ECC leaf key cleanup tracking in the RFC 9802 chain-generation helper to avoid freeing an uninitialized ecc_key.

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

Comment thread tests/api/test_lms_xmss.c
Comment on lines 868 to 871
ExpectIntEQ(wc_ecc_init(&leafKey), 0);
leafKeyInit = 1;
if (EXPECT_SUCCESS()) /* only flag for free if init ran and succeeded */
leafKeyInit = 1;
ExpectIntEQ(wc_ecc_make_key(rng, 32, &leafKey), 0);
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