From e63a80f1af3494dbd92613c214220a1c3df8feeb Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 30 Jun 2020 21:21:43 +0200 Subject: [PATCH] Use `NO_SESSION_CACHE` as well in preproc checks --- examples/client/client.c | 2 +- src/ssl.c | 8 +++----- tests/api.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index badd47ccb..430e5d2a7 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -2410,7 +2410,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) wolfSSL_CTX_SetCACb(ctx, CaCb); #endif -#ifdef HAVE_EXT_CACHE +#if defined(HAVE_EXT_CACHE) && !defined(NO_SESSION_CACHE) wolfSSL_CTX_sess_set_get_cb(ctx, mySessGetCb); wolfSSL_CTX_sess_set_new_cb(ctx, mySessNewCb); wolfSSL_CTX_sess_set_remove_cb(ctx, mySessRemCb); diff --git a/src/ssl.c b/src/ssl.c index 3ba07f14c..dfb6faf05 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -26974,7 +26974,8 @@ int wolfSSL_sk_SSL_COMP_num(WOLF_STACK_OF(WOLFSSL_COMP)* sk) #endif /* OPENSSL_EXTRA */ -#if defined(OPENSSL_EXTRA) || defined(HAVE_EXT_CACHE) +#if !defined(NO_SESSION_CACHE) && (defined(OPENSSL_EXTRA) || \ + defined(HAVE_EXT_CACHE)) /* stunnel 4.28 needs * * Callback that is called if a session tries to resume but could not find @@ -27391,9 +27392,6 @@ end: return s; } -#endif /* OPENSSL_EXTRA || HAVE_EXT_CACHE */ - -#if defined(OPENSSL_EXTRA) || defined(HAVE_EXT_CACHE) long wolfSSL_SESSION_get_timeout(const WOLFSSL_SESSION* sess) { long timeout = 0; @@ -27426,7 +27424,7 @@ long wolfSSL_SSL_SESSION_set_timeout(WOLFSSL_SESSION* ses, long t) return WOLFSSL_SUCCESS; } -#endif /* OPENSSL_EXTRA || HAVE_EXT_CACHE */ +#endif /* !NO_SESSION_CACHE && OPENSSL_EXTRA || HAVE_EXT_CACHE */ #ifdef KEEP_PEER_CERT diff --git a/tests/api.c b/tests/api.c index 353805885..c22a7a353 100644 --- a/tests/api.c +++ b/tests/api.c @@ -25902,7 +25902,7 @@ static void test_wolfSSL_SESSION(void) { #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && \ !defined(NO_RSA) && defined(HAVE_EXT_CACHE) && \ - defined(HAVE_IO_TESTS_DEPENDENCIES) + defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE) WOLFSSL* ssl; WOLFSSL_CTX* ctx;