more work on SAML ification
[mech_eap.git] / inquire_name.c
index 388f3a9..c41d246 100644 (file)
@@ -37,6 +37,10 @@ struct eap_gss_attribute_args {
     gss_buffer_set_t attrs;
 };
 
+/*
+ * The purpose of this callback interface is to not expose the attribute
+ * prefixes to the attribute providers themselves.
+ */
 static OM_uint32
 addAttribute(OM_uint32 *minor,
              void *data,
@@ -89,7 +93,7 @@ OM_uint32 gss_inquire_name(OM_uint32 *minor,
 
     args.attrs = *attrs;
 
-    if (name->assertion != NULL) {
+    if (name->samlCtx != NULL) {
         args.prefix = gssEapAttributeTypeToPrefix(ATTR_TYPE_SAML_AAA_ASSERTION);
 
         major = addAttribute(minor, &args, GSS_C_NO_BUFFER);
@@ -97,14 +101,8 @@ OM_uint32 gss_inquire_name(OM_uint32 *minor,
             goto cleanup;
 
         args.prefix = gssEapAttributeTypeToPrefix(ATTR_TYPE_SAML_ATTR);
-        major = samlGetAttributeTypes(minor, name->assertion, &args, addAttribute);
-        if (GSS_ERROR(major))
-            goto cleanup;
-    }
-
-    if (name->avps != NULL) {
-        args.prefix = gssEapAttributeTypeToPrefix(ATTR_TYPE_RADIUS_AVP);
-        major = radiusGetAttributeTypes(minor, name->avps, &args, addAttribute);
+        major = samlGetAttributeTypes(minor, name->samlCtx,
+                                      &args, addAttribute);
         if (GSS_ERROR(major))
             goto cleanup;
     }