summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-02-15 10:37:44 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-02-15 10:37:44 +0000
commit293616bcbeda5a1bf693f7b77a211229482a5f6e (patch)
treea68ddee43b5dded5277b86eda9bf252a8ae7b334
parent3791c7d2ae0def0b758bb88835e3c49c078297f2 (diff)
downloadlasso-293616bcbeda5a1bf693f7b77a211229482a5f6e.tar.gz
lasso-293616bcbeda5a1bf693f7b77a211229482a5f6e.tar.xz
lasso-293616bcbeda5a1bf693f7b77a211229482a5f6e.zip
ID-WSF 2.0: in lasso_login_idwsf2_get_discovery_bootstrap_epr, better handle attribute content
* lasso/id-wsf-2.0/saml2_login.c: LassoSaml2AttributeValue can contain many children, so traverse them all to find the firs LassoWsAddrEndpointReference among them.
-rw-r--r--lasso/id-wsf-2.0/saml2_login.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/lasso/id-wsf-2.0/saml2_login.c b/lasso/id-wsf-2.0/saml2_login.c
index 541abff8..4dcb3c34 100644
--- a/lasso/id-wsf-2.0/saml2_login.c
+++ b/lasso/id-wsf-2.0/saml2_login.c
@@ -147,7 +147,7 @@ lasso_login_idwsf2_get_discovery_bootstrap_epr(LassoLogin *login)
LassoSaml2AttributeStatement *attribute_statement = NULL;
LassoSaml2Attribute *attribute = NULL;
LassoSaml2AttributeValue *attribute_value = NULL;
- GList *i = NULL, *j = NULL;
+ GList *i = NULL, *j = NULL, *k = NULL;
LassoWsAddrEndpointReference *rc = NULL;
g_return_val_if_fail (LASSO_IS_LOGIN (login), NULL);
@@ -181,12 +181,16 @@ lasso_login_idwsf2_get_discovery_bootstrap_epr(LassoLogin *login)
if (! LASSO_IS_SAML2_ATTRIBUTE_VALUE (attribute->AttributeValue->data))
continue;
attribute_value = (LassoSaml2AttributeValue*)attribute->AttributeValue->data;
- if (! attribute_value->any)
- continue;
- if (LASSO_IS_WSA_ENDPOINT_REFERENCE (attribute_value->any->data))
- continue;
- rc = (LassoWsAddrEndpointReference*)g_object_ref(attribute_value->any->data);
- goto cleanup;
+ lasso_foreach (k, attribute_value->any) {
+ if (! k->data) {
+ message(G_LOG_LEVEL_CRITICAL, "found a NULL in attribute_value->any");
+ break; /* NULL here ? bad... */
+ }
+ if (! LASSO_IS_WSA_ENDPOINT_REFERENCE (k->data))
+ continue;
+ rc = (LassoWsAddrEndpointReference*)g_object_ref(k->data);
+ goto cleanup;
+ }
}
}