From 454e2275e6ae9c948c3c93e1b932fc07aa5fc45f Mon Sep 17 00:00:00 2001 From: Hans Zandbelt Date: Wed, 1 Nov 2023 22:56:57 +0100 Subject: [PATCH] 2.4.15rc2: avoid warnings on cache misses (regression from 2.4.15rc1) Signed-off-by: Hans Zandbelt --- ChangeLog | 4 ++++ configure.ac | 2 +- src/cache/common.c | 11 ++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 700c2265..9d4cc4f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +11/01/2023 +- avoid warnings on cache misses (regression introduced in 2.4.15rc1) +- bump to 2.4.15rc2 + 10/31/2023 - add capability to seamlessly rollover OIDCCryptoPassphrase using a (temporary) 2nd value that holds the old one - bump to 2.4.15rc1 diff --git a/configure.ac b/configure.ac index a6d384a3..90409a7a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mod_auth_openidc],[2.4.15rc1],[hans.zandbelt@openidc.com]) +AC_INIT([mod_auth_openidc],[2.4.15rc2],[hans.zandbelt@openidc.com]) AC_SUBST(NAMEVER, AC_PACKAGE_TARNAME()-AC_PACKAGE_VERSION()) diff --git a/src/cache/common.c b/src/cache/common.c index 4d066cc0..65ca4709 100644 --- a/src/cache/common.c +++ b/src/cache/common.c @@ -312,11 +312,9 @@ apr_byte_t oidc_cache_get(request_rec *r, const char *section, const char *key, } /* see if it is any good */ - if (cache_value == NULL) { - if ((encrypted != 1) || (cfg->crypto_passphrase.secret2 == NULL)) { - rc = FALSE; - goto out; - } + if ((cache_value == NULL) && (encrypted == 1) + && (cfg->crypto_passphrase.secret2 != NULL)) { + oidc_debug(r, "2nd try with previous passphrase"); s_secret = cfg->crypto_passphrase.secret2; s_key = oidc_cache_get_hashed_key(r, s_secret, key); if (cfg->cache->get(r, section, s_key, &cache_value) == FALSE) { @@ -325,6 +323,9 @@ apr_byte_t oidc_cache_get(request_rec *r, const char *section, const char *key, } } + if (cache_value == NULL) + goto out; + /* see if encryption is turned on */ if (encrypted == 0) { *value = apr_pstrdup(r->pool, cache_value);