add a testing path for setting initiator credentials
[mech_eap.orig] / delete_name_attribute.c
index 657d7a6..88cade3 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.
  */
 
+/*
+ * Wrapper for removing a name attribute.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
@@ -38,8 +42,8 @@ gss_delete_name_attribute(OM_uint32 *minor,
                           gss_buffer_t attr)
 {
     OM_uint32 major;
-    gss_buffer_desc prefix, suffix;
-    enum gss_eap_attribute_type type;
+
+    *minor = 0;
 
     if (name == GSS_C_NO_NAME) {
         *minor = EINVAL;
@@ -48,18 +52,8 @@ gss_delete_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);
-    if (type != ATTR_TYPE_SAML_AAA_ASSERTION) {
-        major = samlDeleteAttribute(minor, name->samlCtx, attr);
-    } else {
-        major = GSS_S_UNAVAILABLE;
-    }
+    major = gssEapDeleteNameAttribute(minor, name, attr);
 
-cleanup:
     GSSEAP_MUTEX_UNLOCK(&name->mutex);
 
     return major;