}
static bool
-isSecretAttributeP(int attrid, int vendor)
+isHiddenAttributeP(int attrid, int vendor)
{
bool ret = false;
default:
break;
}
+ case RADIUS_VENDOR_ID_GSS_EAP:
+ ret = true;
+ break;
default:
break;
}
for (vp = m_avps; vp != NULL; vp = vp->next) {
gss_buffer_desc attribute;
- if (isSecretAttributeP(ATTRID(vp->attribute), VENDOR(vp->attribute)))
+ if (isHiddenAttributeP(ATTRID(vp->attribute), VENDOR(vp->attribute)))
continue;
if (alreadyAddedAttributeP(seen, vp))
{
OM_uint32 tmpMinor;
VALUE_PAIR *vp;
- int i = *more;
- int max = 0;
+ int i = *more, count = 0;
char name[NAME_LENGTH + 1];
char displayString[AUTH_STRING_LEN + 1];
gss_buffer_desc valueBuf = GSS_C_EMPTY_BUFFER;
*more = 0;
- if (isSecretAttributeP(attrid, vendor))
- return false;
-
- vp = rc_avpair_get(m_avps, attrid, vendor);
- if (vp == NULL)
+ if (isHiddenAttributeP(attrid, vendor))
return false;
if (i == -1)
i = 0;
- do {
- if (i == max)
+ for (vp = rc_avpair_get(m_avps, attrid, vendor);
+ vp != NULL;
+ vp = rc_avpair_get(vp->next, attrid, vendor)) {
+ if (count++ == i) {
+ if (rc_avpair_get(vp->next, attrid, vendor) != NULL)
+ *more = count;
break;
+ }
+ }
- max++;
- } while ((vp = rc_avpair_get(vp->next, attrid, vendor)) != NULL);
-
- if (i > max)
+ if (vp == NULL && *more == 0)
return false;
if (vp->type == PW_TYPE_STRING) {
if (complete != NULL)
*complete = true;
- if (max > i)
- *more = i;
-
return true;
}
bool
+gss_eap_radius_attr_provider::getFragmentedAttribute(int attribute,
+ int vendor,
+ int *authenticated,
+ int *complete,
+ gss_buffer_t value) const
+{
+ OM_uint32 major, minor;
+
+ major = getBufferFromAvps(&minor, m_avps, attribute, vendor, value, TRUE);
+
+ if (authenticated != NULL)
+ *authenticated = m_authenticated;
+ if (complete != NULL)
+ *complete = true;
+
+ return !GSS_ERROR(major);
+}
+
+bool
gss_eap_radius_attr_provider::getAttribute(int attrid,
int *authenticated,
int *complete,
gss_buffer_t display_value,
int *more) const;
+ bool getFragmentedAttribute(int attribute,
+ int vendor,
+ int *authenticated,
+ int *complete,
+ gss_buffer_t value) const;
+
bool authenticated() const { return m_authenticated; }
static bool init();
};
/* For now */
-#define PW_SAML_ASSERTION 1936
-
extern "C" {
#endif
enum { RADIUS_VENDOR_ATTR_GSS_EAP_ACCEPTOR_SERVICE_NAME = 1,
RADIUS_VENDOR_ATTR_GSS_EAP_ACCEPTOR_HOST_NAME,
- RADIUS_VENDOR_ATTR_GSS_EAP_ACCEPTOR_REALM_NAME };
+ RADIUS_VENDOR_ATTR_GSS_EAP_ACCEPTOR_REALM_NAME,
+ RADIUS_VENDOR_ATTR_GSS_EAP_SAML_AAA_ASSERTION
+};
#ifdef __cplusplus
}
{
const gss_eap_radius_attr_provider *radius;
gss_buffer_desc value = GSS_C_EMPTY_BUFFER;
- int authenticated, complete, more = -1;
+ int authenticated, complete;
OM_uint32 minor;
assert(m_assertion == NULL);
radius = static_cast<const gss_eap_radius_attr_provider *>
(m_manager->getProvider(ATTR_TYPE_RADIUS));
if (radius != NULL &&
- radius->getAttribute(PW_SAML_ASSERTION, &authenticated, &complete,
- &value, NULL, &more)) {
+ radius->getFragmentedAttribute(RADIUS_VENDOR_ATTR_GSS_EAP_SAML_AAA_ASSERTION,
+ RADIUS_VENDOR_ID_GSS_EAP,
+ &authenticated, &complete, &value)) {
setAssertion(&value, authenticated);
gss_release_buffer(&minor, &value);
} else {
delete m_assertion;
if (assertion != NULL) {
+#if 0
m_assertion = dynamic_cast<saml2::Assertion *>(assertion->clone());
+#else
+ m_assertion = (saml2::Assertion *)((void *)assertion->clone());
+#endif
m_authenticated = authenticated;
} else {
m_assertion = NULL;
const XMLObjectBuilder *b;
doc = XMLToolingConfig::getConfig().getParser().parse(istream);
+ if (doc == NULL)
+ return NULL;
+
b = XMLObjectBuilder::getBuilder(doc->getDocumentElement());
+#if 0
return dynamic_cast<saml2::Assertion *>(b->buildFromDocument(doc));
+#else
+ return (saml2::Assertion *)((void *)b->buildFromDocument(doc));
+#endif
}
bool
{
string str;
- if (attr != GSS_C_NO_BUFFER || attr->length != 0)
+ if (attr != GSS_C_NO_BUFFER && attr->length != 0)
return false;
if (m_assertion == NULL)
XMLCh space[2] = { ' ', 0 };
gss_buffer_desc utf8;
- qualifiedName = new XMLCh[XMLString::stringLen(attributeName) + 1 +
- XMLString::stringLen(attributeNameFormat) + 1];
- XMLString::copyString(qualifiedName, attributeName);
+ qualifiedName = new XMLCh[XMLString::stringLen(attributeNameFormat) + 1 +
+ XMLString::stringLen(attributeName) + 1];
+ XMLString::copyString(qualifiedName, attributeNameFormat);
XMLString::catString(qualifiedName, space);
- XMLString::catString(qualifiedName, attributeNameFormat);
+ XMLString::catString(qualifiedName, attributeName);
utf8.value = (void *)toUTF8(qualifiedName);
utf8.length = strlen((char *)utf8.value);
i = 0;
else if (i >= nvalues)
return false;
- av = dynamic_cast<const saml2::AttributeValue *>(a->getAttributeValues().at(i)
-);
+#if 0
+ av = dynamic_cast<const saml2::AttributeValue *>(a->getAttributeValues().at(i));
+#else
+ av = (const saml2::AttributeValue *)((void *)(a->getAttributeValues().at(i)));
+#endif
if (av != NULL) {
if (value != NULL) {
value->value = toUTF8(av->getTextContent(), true);