Make unit test more resilient to earlier errors

This commit is contained in:
Josh Holtrop
2025-07-24 15:46:01 -04:00
parent 6309b241cd
commit 71bd9e2f6e

View File

@@ -18338,13 +18338,16 @@ static int test_wc_PKCS7_GetEnvelopedDataKariRid(void)
if (skiHexFile != XBADFILE)
XFCLOSE(skiHexFile);
if (EXPECT_SUCCESS()) {
ret = wc_PKCS7_GetEnvelopedDataKariRid(cms, cmsSz, rid, &ridSz);
}
ExpectIntEQ(ret, 0);
ExpectIntGT(ridSz, ridKeyIdentifierOffset);
/* The Subject Key Identifier hex file should have 2 hex characters for each
* byte of the key identifier in the returned recipient ID (rid), plus a
* terminating new line character. */
ExpectIntGE(skiHexSz, ((ridSz - ridKeyIdentifierOffset) * 2) + 1);
if (EXPECT_SUCCESS()) {
for (i = 0; i < (ridSz - ridKeyIdentifierOffset); i++)
{
size_t j;
@@ -18363,6 +18366,7 @@ static int test_wc_PKCS7_GetEnvelopedDataKariRid(void)
}
ExpectIntEQ(ridKeyIdByte, skiByte);
}
}
#endif
#endif /* HAVE_PKCS7 */
return EXPECT_RESULT();