From 510ee92c11b86ec31d695ec38fd4403166123033 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Thu, 5 Aug 2021 15:46:12 +1000 Subject: [PATCH] gss: treat empty cred store as GSS_C_NO_CRED_STORE In acquire_mech_cred(), treat a credential store with no elements as equivalent to GSS_C_NO_CRED_STORE, allowing a mechanism's gss_acquire_cred() implementation to be called. --- lib/gssapi/mech/gss_acquire_cred_from.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gssapi/mech/gss_acquire_cred_from.c b/lib/gssapi/mech/gss_acquire_cred_from.c index bcae629d1..5bb956c57 100644 --- a/lib/gssapi/mech/gss_acquire_cred_from.c +++ b/lib/gssapi/mech/gss_acquire_cred_from.c @@ -91,7 +91,8 @@ acquire_mech_cred(OM_uint32 *minor_status, &mc->gmc_cred, NULL, time_rec); - } else if (cred_store == GSS_C_NO_CRED_STORE && m->gm_acquire_cred) { + } else if ((cred_store == GSS_C_NO_CRED_STORE || cred_store->count == 0) && + m->gm_acquire_cred) { major_status = m->gm_acquire_cred(minor_status, mn ? mn->gmn_name : GSS_C_NO_NAME, time_req,