X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mech_eap%2FgssapiP_eap.h;h=486f7a289cb9de04f37561b294bcf111f13ca943;hb=c73d42636354259fe7f36a63be33fa0e081c32a8;hp=af41187587737bbc9cf0c02b818cf3006a379ce4;hpb=a7f15190816b74c00ce45d6659a298ad04ed3160;p=mech_eap.git diff --git a/mech_eap/gssapiP_eap.h b/mech_eap/gssapiP_eap.h index af41187..486f7a2 100644 --- a/mech_eap/gssapiP_eap.h +++ b/mech_eap/gssapiP_eap.h @@ -413,37 +413,42 @@ gssEapInitiatorInit(OM_uint32 *minor); void gssEapFinalize(void); - /* Debugging and tracing*/ - #define gssEapTrace(_fmt, ...) wpa_printf(MSG_INFO, _fmt, __VA_ARGS__); +/* Debugging and tracing */ static inline void gssEapTraceStatus(const char *function, - OM_uint32 major, OM_uint32 minor) + OM_uint32 major, + OM_uint32 minor) { - gss_buffer_desc gss_code_buf, mech_buf; - OM_uint32 tmpmaj, tmpmin, ctx = 0; - gss_code_buf.value = NULL; - mech_buf.value = NULL; - tmpmaj = gss_display_status(&tmpmin, major, - GSS_C_GSS_CODE, GSS_C_NO_OID, &ctx, - &gss_code_buf); - if (!GSS_ERROR(tmpmaj)) { -if (minor == 0) - tmpmaj = makeStringBuffer(&tmpmin, "no minor", &mech_buf); -else tmpmaj = gssEapDisplayStatus(&tmpmin, minor, &mech_buf); -} - if (!GSS_ERROR(tmpmaj)) + gss_buffer_desc gssErrorCodeBuf = GSS_C_EMPTY_BUFFER; + gss_buffer_desc gssMechBuf = GSS_C_EMPTY_BUFFER; + OM_uint32 tmpMajor, tmpMinor; + OM_uint32 messageCtx = 0; + + tmpMajor = gss_display_status(&tmpMinor, major, + GSS_C_GSS_CODE, GSS_C_NO_OID, + &messageCtx, &gssErrorCodeBuf); + if (!GSS_ERROR(tmpMajor)) { + if (minor == 0) + tmpMajor = makeStringBuffer(&tmpMinor, "no minor", &gssMechBuf); + else + tmpMajor = gssEapDisplayStatus(&tmpMinor, minor, &gssMechBuf); + } + + if (!GSS_ERROR(tmpMajor)) wpa_printf(MSG_INFO, "%s: %.*s/%.*s", - function, (int) gss_code_buf.length, (char *) gss_code_buf.value, - (int) mech_buf.length, (char *) mech_buf.value); - else wpa_printf(MSG_INFO, "%s: %u/%u", + function, + (int)gssErrorCodeBuf.length, (char *)gssErrorCodeBuf.value, + (int)gssMechBuf.length, (char *)gssMechBuf.value); + else + wpa_printf(MSG_INFO, "%s: %u/%u", function, major, minor); - tmpmaj = gss_release_buffer(&tmpmin, &gss_code_buf); - tmpmaj = gss_release_buffer(&tmpmin, &mech_buf); - } + gss_release_buffer(&tmpMinor, &gssErrorCodeBuf); + gss_release_buffer(&tmpMinor, &gssMechBuf); +} - /*If built as a library on Linux, don't respect environment when set*uid*/ +/* If built as a library on Linux, don't respect environment when set*uid */ #ifdef HAVE_SECURE_GETENV #define getenv secure_getenv #endif