From 27c09a0b09f26d113267c9548305d56fac1a0727 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 14 Sep 2011 15:16:24 +1000 Subject: [PATCH] implement gssEapSetCredService --- moonshot/mech_eap/util_cred.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/moonshot/mech_eap/util_cred.c b/moonshot/mech_eap/util_cred.c index 11dcfeb..856c0a5 100644 --- a/moonshot/mech_eap/util_cred.c +++ b/moonshot/mech_eap/util_cred.c @@ -522,6 +522,36 @@ cleanup: return major; } +OM_uint32 +gssEapSetCredService(OM_uint32 *minor, + gss_cred_id_t cred, + const gss_name_t target) +{ + OM_uint32 major, tmpMinor; + gss_name_t newTarget = GSS_C_NO_NAME; + + if (cred->flags & CRED_FLAG_RESOLVED) { + major = GSS_S_FAILURE; + *minor = GSSEAP_CRED_RESOLVED; + goto cleanup; + } + + if (target != GSS_C_NO_NAME) { + major = gssEapDuplicateName(minor, target, &newTarget); + if (GSS_ERROR(major)) + goto cleanup; + } + + gssEapReleaseName(&tmpMinor, &cred->target); + cred->target = newTarget; + + major = GSS_S_COMPLETE; + *minor = 0; + +cleanup: + return major; +} + static OM_uint32 gssEapDuplicateCred(OM_uint32 *minor, const gss_cred_id_t src, -- 2.1.4