separate gss_display_status into inner/outer APIs
authorLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 06:39:22 +0000 (16:39 +1000)
committerLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 06:39:22 +0000 (16:39 +1000)
mech_eap/display_status.c
mech_eap/gssapiP_eap.h

index c21cc7b..e5774d5 100644 (file)
@@ -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);
+}
index 5d352a9..c0fd894 100644 (file)
@@ -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)