return RADIUS attributes as integers
authorLuke Howard <lukeh@padl.com>
Tue, 21 Sep 2010 17:05:50 +0000 (19:05 +0200)
committerLuke Howard <lukeh@padl.com>
Tue, 21 Sep 2010 17:05:50 +0000 (19:05 +0200)
mech_eap/util_radius.cpp

index 5543973..a6d186b 100644 (file)
@@ -166,15 +166,24 @@ gss_eap_radius_attr_provider::getAttributeTypes(gss_eap_attr_enumeration_cb addA
 
     for (vp = m_avps; vp != NULL; vp = vp->next) {
         gss_buffer_desc attribute;
-
+#ifndef RADIUS_STRING_ATTRS
+        char attrid[64];
+#endif
         if (isHiddenAttributeP(ATTRID(vp->attribute), VENDOR(vp->attribute)))
             continue;
 
         if (alreadyAddedAttributeP(seen, vp))
             continue;
 
+#ifdef RADIUS_STRING_ATTRS
         attribute.value = (void *)vp->name;
         attribute.length = strlen(vp->name);
+#else
+        snprintf(attrid, sizeof(attrid), "%d", vp->attribute);
+
+        attribute.value = attrid;
+        attribute.length = strlen(attrid);
+#endif /* RADIUS_STRING_ATTRS */
 
         if (!addAttribute(this, &attribute, data))
             return false;