X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mech_eap%2Futil_reauth.c;h=6c665705bbdcf5e4a12fb3f374471902c16fda0e;hb=e82fcf22c3b6961beae883fc66bf4567896b7c4b;hp=ebeb4f21dc8c1e9b0efbc7333e03c0594dab0182;hpb=5b7b2ae782e0b44027c6c8c69f264750beb8fe99;p=moonshot.git diff --git a/mech_eap/util_reauth.c b/mech_eap/util_reauth.c index ebeb4f2..6c66570 100644 --- a/mech_eap/util_reauth.c +++ b/mech_eap/util_reauth.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, JANET(UK) + * Copyright (c) 2011, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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; @@ -785,10 +793,10 @@ cleanup: */ OM_uint32 gssEapReauthComplete(OM_uint32 *minor, - gss_ctx_id_t ctx, - gss_cred_id_t cred, - const gss_OID mech, - OM_uint32 timeRec) + gss_ctx_id_t ctx, + gss_cred_id_t cred GSSEAP_UNUSED, + const gss_OID mech, + OM_uint32 timeRec) { OM_uint32 major, tmpMinor; gss_buffer_set_t keyData = GSS_C_NO_BUFFER_SET; @@ -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))