File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments