Skip to content

Commit fc10c3d

Browse files
account for x509 small builds in test case
1 parent 449cd13 commit fc10c3d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/api/test_x509.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,20 @@ int test_X509_set_serialNumber(void)
250250
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
251251
WOLFSSL_X509* x509 = NULL;
252252
WOLFSSL_ASN1_INTEGER* s = NULL;
253+
#if defined(OPENSSL_EXTRA_X509_SMALL)
254+
WOLFSSL_ASN1_INTEGER asnInt;
255+
#endif
253256

254257
ExpectNotNull(x509 = wolfSSL_X509_new());
258+
#if defined(OPENSSL_EXTRA_X509_SMALL)
259+
XMEMSET(&asnInt, 0, sizeof(asnInt));
260+
asnInt.data = asnInt.intData;
261+
asnInt.isDynamic = 0;
262+
asnInt.dataMax = (unsigned int)sizeof(asnInt.intData);
263+
s = &asnInt;
264+
#else
255265
ExpectNotNull(s = wolfSSL_ASN1_INTEGER_new());
266+
#endif
256267

257268
/* --- invalid inputs that must be rejected --- */
258269

@@ -316,7 +327,9 @@ int test_X509_set_serialNumber(void)
316327
ExpectIntEQ(x509->serial[1], 0x02);
317328
}
318329

330+
#if !defined(OPENSSL_EXTRA_X509_SMALL)
319331
wolfSSL_ASN1_INTEGER_free(s);
332+
#endif
320333
wolfSSL_X509_free(x509);
321334
#endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
322335
return EXPECT_RESULT();

0 commit comments

Comments
 (0)