X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mech_eap%2Futil_reauth.c;h=6c665705bbdcf5e4a12fb3f374471902c16fda0e;hb=e82fcf22c3b6961beae883fc66bf4567896b7c4b;hp=a03f2855aaf034c7920750e5dc6a9e74a58ac19d;hpb=a41fa883097ba57aeb39d0f8cd6aa9aa961c8666;p=moonshot.git diff --git a/mech_eap/util_reauth.c b/mech_eap/util_reauth.c index a03f285..6c66570 100644 --- a/mech_eap/util_reauth.c +++ b/mech_eap/util_reauth.c @@ -217,11 +217,10 @@ gssEapMakeReauthCreds(OM_uint32 *minor, GSSEAP_KRB_INIT(&krbContext); code = getAcceptorKey(krbContext, ctx, cred, &server, &acceptorKey); - if (code == KRB5_KT_NOTFOUND) { + if (code != 0) { *minor = code; return GSS_S_UNAVAILABLE; - } else if (code != 0) - goto cleanup; + } /* * Generate a random session key to place in the ticket and @@ -375,7 +374,7 @@ cleanup: } static int -isTicketGrantingServiceP(krb5_context krbContext, +isTicketGrantingServiceP(krb5_context krbContext GSSEAP_UNUSED, krb5_const_principal principal) { if (KRB_PRINC_LENGTH(principal) == 2 && @@ -652,8 +651,11 @@ static gss_buffer_desc radiusAvpKrbAttr = { */ static OM_uint32 defrostAttrContext(OM_uint32 *minor, +#ifdef HAVE_HEIMDAL_VERSION gss_ctx_id_t glueContext, +#else gss_name_t glueName, +#endif gss_name_t mechName) { OM_uint32 major, tmpMinor; @@ -717,7 +719,7 @@ defrostAttrContext(OM_uint32 *minor, */ OM_uint32 gssEapGlueToMechName(OM_uint32 *minor, - gss_ctx_id_t glueContext, + gss_ctx_id_t ctx, gss_name_t glueName, gss_name_t *pMechName) { @@ -731,11 +733,17 @@ gssEapGlueToMechName(OM_uint32 *minor, goto cleanup; major = gssEapImportName(minor, &nameBuf, GSS_C_NT_USER_NAME, - pMechName); + ctx->mechanismUsed, pMechName); if (GSS_ERROR(major)) goto cleanup; - major = defrostAttrContext(minor, glueContext, glueName, *pMechName); + major = defrostAttrContext(minor, +#ifdef HAVE_HEIMDAL_VERSION + ctx->reauthCtx, +#else + glueName, +#endif + *pMechName); if (GSS_ERROR(major)) goto cleanup; @@ -786,7 +794,7 @@ cleanup: OM_uint32 gssEapReauthComplete(OM_uint32 *minor, gss_ctx_id_t ctx, - gss_cred_id_t cred, + gss_cred_id_t cred GSSEAP_UNUSED, const gss_OID mech, OM_uint32 timeRec) { @@ -807,11 +815,11 @@ gssEapReauthComplete(OM_uint32 *minor, /* Get the raw subsession key and encryption type */ #ifdef HAVE_HEIMDAL_VERSION #define KRB_GSS_SUBKEY_COUNT 1 /* encoded session key */ - major = gssInquireSecContextByOid(minor, ctx->kerberosCtx, + major = gssInquireSecContextByOid(minor, ctx->reauthCtx, GSS_KRB5_GET_SUBKEY_X, &keyData); #else #define KRB_GSS_SUBKEY_COUNT 2 /* raw session key, enctype OID */ - major = gssInquireSecContextByOid(minor, ctx->kerberosCtx, + major = gssInquireSecContextByOid(minor, ctx->reauthCtx, GSS_C_INQ_SSPI_SESSION_KEY, &keyData); #endif if (GSS_ERROR(major))