@@ -50277,7 +50277,43 @@ static int test_wolfSSL_X509_STORE_get1_certs(void)
5027750277#endif /* OPENSSL_EXTRA && WOLFSSL_SIGNER_DER_CERT && !NO_FILESYSTEM */
5027850278 return EXPECT_RESULT();
5027950279}
50280+ static int test_wolfSSL_dup_CA_list(void)
50281+ {
50282+ int res = TEST_SKIPPED;
50283+ #if defined(OPENSSL_ALL)
50284+ EXPECT_DECLS;
50285+ STACK_OF(X509_NAME) *originalStack = NULL;
50286+ STACK_OF(X509_NAME) *copyStack = NULL;
50287+ int originalCount = 0;
50288+ int copyCount = 0;
50289+ X509_NAME *name = NULL;
50290+ int i;
50291+
50292+ originalStack = sk_X509_NAME_new_null();
50293+ ExpectNotNull(originalStack);
50294+
50295+ for (i = 0; i < 3; i++) {
50296+ name = X509_NAME_new();
50297+ ExpectNotNull(name);
50298+ AssertIntEQ(sk_X509_NAME_push(originalStack, name), WOLFSSL_SUCCESS);
50299+ }
50300+
50301+ copyStack = SSL_dup_CA_list(originalStack);
50302+ ExpectNotNull(copyStack);
50303+ originalCount = sk_X509_NAME_num(originalStack);
50304+ copyCount = sk_X509_NAME_num(copyStack);
50305+
50306+ AssertIntEQ(originalCount, copyCount);
50307+ sk_X509_NAME_pop_free(originalStack, X509_NAME_free);
50308+ sk_X509_NAME_pop_free(copyStack, X509_NAME_free);
50309+
50310+ originalStack = NULL;
50311+ copyStack = NULL;
5028050312
50313+ res = EXPECT_RESULT();
50314+ #endif /* OPENSSL_ALL */
50315+ return res;
50316+ }
5028150317/* include misc.c here regardless of NO_INLINE, because misc.c implementations
5028250318 * have default (hidden) visibility, and in the absence of visibility, it's
5028350319 * benign to mask out the library implementation.
@@ -60385,7 +60421,7 @@ TEST_CASE testCases[] = {
6038560421
6038660422 TEST_DECL(test_GENERAL_NAME_set0_othername),
6038760423 TEST_DECL(test_othername_and_SID_ext),
60388-
60424+ TEST_DECL(test_wolfSSL_dup_CA_list),
6038960425 /* OpenSSL sk_X509 API test */
6039060426 TEST_DECL(test_sk_X509),
6039160427 /* OpenSSL sk_X509_CRL API test */
0 commit comments