comment out dumping code
[mech_eap.orig] / set_name_attribute.c
index a8a4a56..6dd9434 100644 (file)
@@ -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
  * SUCH DAMAGE.
  */
 
+/*
+ * Set an attribute on a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
@@ -40,8 +44,6 @@ gss_set_name_attribute(OM_uint32 *minor,
                        gss_buffer_t value)
 {
     OM_uint32 major;
-    gss_buffer_desc prefix, suffix;
-    enum gss_eap_attribute_type type;
 
     if (name == GSS_C_NO_NAME) {
         *minor = EINVAL;
@@ -50,27 +52,8 @@ gss_set_name_attribute(OM_uint32 *minor,
 
     GSSEAP_MUTEX_LOCK(&name->mutex);
 
-    major = decomposeAttributeName(minor, attr, &prefix, &suffix);
-    if (GSS_ERROR(major))
-        goto cleanup;
-
-    type = gssEapAttributePrefixToType(&prefix);
-    switch (type) {
-    case ATTR_TYPE_SAML_ATTR:
-        major = samlSetAttribute(minor, name->samlCtx,
-                                 complete, &suffix, value);
-        break;
-    case ATTR_TYPE_RADIUS_AVP:
-        major = radiusSetAttribute(minor, name->radiusCtx,
-                                   complete, &suffix, value);
-        break;
-    default:
-        *minor = ENOENT;
-        major = GSS_S_UNAVAILABLE;
-        break;
-    }
+    major = gssEapSetNameAttribute(minor, name, complete, attr, value);
 
-cleanup:
     GSSEAP_MUTEX_UNLOCK(&name->mutex);
 
     return major;