+ OM_uint32 tmpMinor;
+ VALUE_PAIR *vp;
+ int i = *more;
+ int max = 0;
+ char name[NAME_LENGTH + 1];
+ char displayString[AUTH_STRING_LEN + 1];
+ gss_buffer_desc valueBuf = GSS_C_EMPTY_BUFFER;
+ gss_buffer_desc displayBuf = GSS_C_EMPTY_BUFFER;
+
+ *more = 0;
+
+ if (isSecretAttributeP(attrid, vendor))
+ return false;
+
+ vp = rc_avpair_get(m_avps, attrid, vendor);
+ if (vp == NULL)
+ return false;
+
+ if (i == -1)
+ i = 0;
+
+ do {
+ if (i == max)
+ break;
+
+ max++;
+ } while ((vp = rc_avpair_get(vp->next, attrid, vendor)) != NULL);
+
+ if (i > max)
+ return false;
+
+ if (vp->type == PW_TYPE_STRING) {
+ valueBuf.value = (void *)vp->strvalue;
+ valueBuf.length = vp->lvalue;
+ } else {
+ valueBuf.value = (void *)&vp->lvalue;
+ valueBuf.length = 4;
+ }
+
+ if (value != GSS_C_NO_BUFFER)
+ duplicateBuffer(valueBuf, value);
+
+ if (display_value != GSS_C_NO_BUFFER &&
+ isPrintableAttributeP(vp)) {
+ if (rc_avpair_tostr(m_rh, vp, name, NAME_LENGTH,
+ displayString, AUTH_STRING_LEN) != 0) {
+ gss_release_buffer(&tmpMinor, value);
+ return false;
+ }
+
+ displayBuf.value = (void *)displayString;
+ displayBuf.length = strlen(displayString);
+
+ duplicateBuffer(displayBuf, display_value);
+ }
+
+ if (authenticated != NULL)
+ *authenticated = m_authenticated;
+ if (complete != NULL)
+ *complete = true;
+
+ if (max > i)
+ *more = i;
+
+ return true;
+}
+
+bool
+gss_eap_radius_attr_provider::getAttribute(int attrid,
+ int *authenticated,
+ int *complete,
+ gss_buffer_t value,
+ gss_buffer_t display_value,
+ int *more) const
+{
+
+ return getAttribute(ATTRID(attrid), VENDOR(attrid),
+ authenticated, complete,
+ value, display_value, more);