mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Fix compile errors
This commit is contained in:
16
src/ssl.c
16
src/ssl.c
@@ -19726,32 +19726,40 @@ int wolfSSL_session_reused(WOLFSSL* ssl)
|
||||
#if defined(OPENSSL_EXTRA) || defined(HAVE_EXT_CACHE)
|
||||
WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session)
|
||||
{
|
||||
#ifdef HAVE_EXT_CACHE
|
||||
WOLFSSL_SESSION* copy;
|
||||
WOLFSSL_ENTER("wolfSSL_SESSION_dup");
|
||||
|
||||
if (session == NULL)
|
||||
return NULL;
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
if (session->isDynamic && !session->ticket) {
|
||||
WOLFSSL_MSG("Session dynamic flag is set but ticket pointer is null");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
copy = XMALLOC(sizeof(WOLFSSL_SESSION), NULL, DYNAMIC_TYPE_OPENSSL);
|
||||
if (copy != NULL) {
|
||||
XMEMCPY(copy, session, sizeof(WOLFSSL_SESSION));
|
||||
copy->isAlloced = 1;
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
if (session->isDynamic) {
|
||||
copy->ticket = XMALLOC(session->ticketLen, NULL,
|
||||
DYNAMIC_TYPE_SESSION_TICK);
|
||||
DYNAMIC_TYPE_SESSION_TICK);
|
||||
XMEMCPY(copy->ticket, session->ticket, session->ticketLen);
|
||||
} else {
|
||||
copy->ticket = copy->staticTicket;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return copy;
|
||||
#else
|
||||
WOLFSSL_MSG("wolfSSL_SESSION_dup was called "
|
||||
"but HAVE_EXT_CACHE is not defined");
|
||||
(void)session;
|
||||
return NULL;
|
||||
#endif /* HAVE_EXT_CACHE */
|
||||
}
|
||||
|
||||
void wolfSSL_SESSION_free(WOLFSSL_SESSION* session)
|
||||
|
@@ -4410,9 +4410,12 @@ static void test_wolfSSL_PKCS12(void)
|
||||
WOLFSSL_X509 *x509;
|
||||
WOLFSSL_X509 *tmp;
|
||||
WOLFSSL_CTX *ctx;
|
||||
WOLFSSL *ssl;
|
||||
WOLF_STACK_OF(WOLFSSL_X509) *ca;
|
||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
|
||||
|| defined(WOLFSSL_NGINX)
|
||||
WOLFSSL *ssl;
|
||||
WOLF_STACK_OF(WOLFSSL_X509) *tmp_ca = NULL;
|
||||
#endif
|
||||
|
||||
printf(testingFmt, "wolfSSL_PKCS12()");
|
||||
|
||||
@@ -4459,6 +4462,8 @@ static void test_wolfSSL_PKCS12(void)
|
||||
#else
|
||||
AssertNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
|
||||
#endif
|
||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
|
||||
|| defined(WOLFSSL_NGINX)
|
||||
AssertIntEQ(SSL_CTX_set0_chain(ctx, ca), 1);
|
||||
AssertIntEQ(wolfSSL_CTX_get_extra_chain_certs(ctx, &tmp_ca), 1);
|
||||
AssertNotNull(tmp_ca);
|
||||
@@ -4469,6 +4474,7 @@ static void test_wolfSSL_PKCS12(void)
|
||||
AssertNotNull(SSL_get_certificate(ssl));
|
||||
SSL_free(ssl);
|
||||
SSL_CTX_free(ctx);
|
||||
#endif
|
||||
|
||||
/* should be 2 other certs on stack */
|
||||
tmp = sk_X509_pop(ca);
|
||||
|
Reference in New Issue
Block a user