From 58f8594bd5152bdc7445d056c6b605eaf2f42a9e Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 13 Sep 2011 16:39:22 +1000 Subject: [PATCH] separate gss_display_status into inner/outer APIs --- mech_eap/display_status.c | 46 +++++++++++++++++++++++++++------------------- mech_eap/gssapiP_eap.h | 5 +++++ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/mech_eap/display_status.c b/mech_eap/display_status.c index c21cc7b..e5774d5 100644 --- a/mech_eap/display_status.c +++ b/mech_eap/display_status.c @@ -147,13 +147,10 @@ gssEapSaveStatusInfo(OM_uint32 minor, const char *format, ...) #endif /* WIN32 */ } -OM_uint32 GSSAPI_CALLCONV -gss_display_status(OM_uint32 *minor, - OM_uint32 status_value, - int status_type, - gss_OID mech_type, - OM_uint32 *message_context, - gss_buffer_t status_string) +OM_uint32 +gssEapDisplayStatus(OM_uint32 *minor, + OM_uint32 status_value, + gss_buffer_t status_string) { OM_uint32 major; krb5_context krbContext = NULL; @@ -162,18 +159,6 @@ gss_display_status(OM_uint32 *minor, status_string->length = 0; status_string->value = NULL; - if (!gssEapIsMechanismOid(mech_type)) { - *minor = GSSEAP_WRONG_MECH; - return GSS_S_BAD_MECH; - } - - if (status_type != GSS_C_MECH_CODE || - *message_context != 0) { - /* we rely on the mechglue for GSS_C_GSS_CODE */ - *minor = 0; - return GSS_S_BAD_STATUS; - } - errMsg = getStatusInfo(status_value); if (errMsg == NULL) { GSSEAP_KRB_INIT(&krbContext); @@ -194,3 +179,26 @@ gss_display_status(OM_uint32 *minor, return major; } + +OM_uint32 GSSAPI_CALLCONV +gss_display_status(OM_uint32 *minor, + OM_uint32 status_value, + int status_type, + gss_OID mech_type, + OM_uint32 *message_context, + gss_buffer_t status_string) +{ + if (!gssEapIsMechanismOid(mech_type)) { + *minor = GSSEAP_WRONG_MECH; + return GSS_S_BAD_MECH; + } + + if (status_type != GSS_C_MECH_CODE || + *message_context != 0) { + /* we rely on the mechglue for GSS_C_GSS_CODE */ + *minor = 0; + return GSS_S_BAD_STATUS; + } + + return gssEapDisplayStatus(minor, status_value, status_string); +} diff --git a/mech_eap/gssapiP_eap.h b/mech_eap/gssapiP_eap.h index 5d352a9..c0fd894 100644 --- a/mech_eap/gssapiP_eap.h +++ b/mech_eap/gssapiP_eap.h @@ -321,6 +321,11 @@ rfc4121Flags(gss_ctx_id_t ctx, int receiving); void gssEapSaveStatusInfo(OM_uint32 minor, const char *format, ...); +OM_uint32 +gssEapDisplayStatus(OM_uint32 *minor, + OM_uint32 status_value, + gss_buffer_t status_string); + #define IS_WIRE_ERROR(err) ((err) > GSSEAP_RESERVED && \ (err) <= GSSEAP_RADIUS_PROT_FAILURE) -- 2.1.4