mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
remove sk_X509_free for compatibility
This commit is contained in:
@@ -19063,8 +19063,6 @@ void wolfSSL_X509_STORE_CTX_free(WOLFSSL_X509_STORE_CTX* ctx)
|
|||||||
if (ctx->current_cert != NULL)
|
if (ctx->current_cert != NULL)
|
||||||
wolfSSL_FreeX509(ctx->current_cert);
|
wolfSSL_FreeX509(ctx->current_cert);
|
||||||
#endif
|
#endif
|
||||||
if (ctx->chain != NULL)
|
|
||||||
wolfSSL_sk_X509_free(ctx->chain);
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
if (ctx->param != NULL){
|
if (ctx->param != NULL){
|
||||||
XFREE(ctx->param,NULL,DYNAMIC_TYPE_OPENSSL);
|
XFREE(ctx->param,NULL,DYNAMIC_TYPE_OPENSSL);
|
||||||
|
11
tests/api.c
11
tests/api.c
@@ -18528,6 +18528,9 @@ static void test_wolfSSL_X509_STORE_CTX(void)
|
|||||||
X509_STORE_CTX* ctx;
|
X509_STORE_CTX* ctx;
|
||||||
X509_STORE* str;
|
X509_STORE* str;
|
||||||
X509* x509;
|
X509* x509;
|
||||||
|
#ifdef OPENSSL_ALL
|
||||||
|
STACK_OF(X509)* sk;
|
||||||
|
#endif
|
||||||
|
|
||||||
printf(testingFmt, "wolfSSL_X509_STORE_CTX()");
|
printf(testingFmt, "wolfSSL_X509_STORE_CTX()");
|
||||||
AssertNotNull(ctx = X509_STORE_CTX_new());
|
AssertNotNull(ctx = X509_STORE_CTX_new());
|
||||||
@@ -18535,12 +18538,20 @@ static void test_wolfSSL_X509_STORE_CTX(void)
|
|||||||
AssertNotNull((x509 =
|
AssertNotNull((x509 =
|
||||||
wolfSSL_X509_load_certificate_file(svrCertFile, SSL_FILETYPE_PEM)));
|
wolfSSL_X509_load_certificate_file(svrCertFile, SSL_FILETYPE_PEM)));
|
||||||
AssertIntEQ(X509_STORE_add_cert(str, x509), SSL_SUCCESS);
|
AssertIntEQ(X509_STORE_add_cert(str, x509), SSL_SUCCESS);
|
||||||
|
#ifdef OPENSSL_ALL
|
||||||
|
AssertNotNull(sk = sk_X509_new());
|
||||||
|
AssertIntEQ(X509_STORE_CTX_init(ctx, str, x509, sk), SSL_SUCCESS);
|
||||||
|
#else
|
||||||
AssertIntEQ(X509_STORE_CTX_init(ctx, str, x509, NULL), SSL_SUCCESS);
|
AssertIntEQ(X509_STORE_CTX_init(ctx, str, x509, NULL), SSL_SUCCESS);
|
||||||
|
#endif
|
||||||
AssertIntEQ(SSL_get_ex_data_X509_STORE_CTX_idx(), 0);
|
AssertIntEQ(SSL_get_ex_data_X509_STORE_CTX_idx(), 0);
|
||||||
X509_STORE_CTX_set_error(ctx, -5);
|
X509_STORE_CTX_set_error(ctx, -5);
|
||||||
X509_STORE_CTX_set_error(NULL, -5);
|
X509_STORE_CTX_set_error(NULL, -5);
|
||||||
|
|
||||||
X509_STORE_CTX_free(ctx);
|
X509_STORE_CTX_free(ctx);
|
||||||
|
#ifdef OPENSSL_ALL
|
||||||
|
sk_X509_free(sk);
|
||||||
|
#endif
|
||||||
#ifdef WOLFSSL_KEEP_STORE_CERTS
|
#ifdef WOLFSSL_KEEP_STORE_CERTS
|
||||||
X509_STORE_free(str);
|
X509_STORE_free(str);
|
||||||
X509_free(x509);
|
X509_free(x509);
|
||||||
|
Reference in New Issue
Block a user