X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot.git;a=blobdiff_plain;f=moonshot%2Fmech_eap%2Futil_cred.c;h=856c0a5da5f47c2dc4a5bf2de504b0bb536adb76;hp=11dcfeb71a384979d73ae55a04d3f1eeba7b0805;hb=27c09a0b09f26d113267c9548305d56fac1a0727;hpb=6bb91facb06b73ad87b19e04bd249d6517fec3da 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,