Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tests/api/test_lms_xmss.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ int test_wc_LmsKey_sign_verify(void)
int i;
int numSigs = 5;

/* Zero so cleanup is safe if an early alloc failure skips init. */
XMEMSET(&key, 0, sizeof(key));
XMEMSET(&rng, 0, sizeof(rng));

ExpectIntEQ(wc_InitRng(&rng), 0);

Expand Down Expand Up @@ -174,8 +176,10 @@ int test_wc_LmsKey_reload_cache(void)
/* Sign 33 times to advance q past the 32-entry cache window. */
int preSigs = 33;

/* Zero so cleanup is safe if an early alloc failure skips init. */
XMEMSET(&key, 0, sizeof(key));
XMEMSET(&vkey, 0, sizeof(vkey));
XMEMSET(&rng, 0, sizeof(rng));

ExpectIntEQ(wc_InitRng(&rng), 0);

Expand Down Expand Up @@ -862,7 +866,8 @@ static int rfc9802_gen_chain(void* caKey, int caKeyType, int caSigType,
ExpectNotNull(leafDer = (byte*)XMALLOC(derCap, NULL,
DYNAMIC_TYPE_TMP_BUFFER));
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);
Comment on lines 868 to 871

/* Self-signed CA root. */
Expand Down Expand Up @@ -972,6 +977,10 @@ int test_rfc9802_lms_x509_gen(void)
LmsKey key;
WC_RNG rng;

/* Zero so cleanup is safe if an early alloc failure skips init. */
XMEMSET(&key, 0, sizeof(key));
XMEMSET(&rng, 0, sizeof(rng));

ExpectIntEQ(wc_InitRng(&rng), 0);

/* Single-level LMS (L1-H5-W8). */
Expand Down Expand Up @@ -1177,6 +1186,10 @@ int test_rfc9802_xmss_x509_gen(void)
XmssKey key;
WC_RNG rng;

/* Zero so cleanup is safe if an early alloc failure skips init. */
XMEMSET(&key, 0, sizeof(key));
XMEMSET(&rng, 0, sizeof(rng));

ExpectIntEQ(wc_InitRng(&rng), 0);

/* Single-tree XMSS. */
Expand Down
Loading