From 849f76d1fcdbd04470491d0fb3512cc5328fd1e4 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 15 Jan 2010 08:26:31 +0000 Subject: FIX ABI breakage between 2.2.1 and 2.2.2 in LassoSamlAdvice * lasso/xml/saml_advice.c lasso/xml/saml_advice.h: restore fields AssertionIDReference and Assertion, remove field any to restore state from 2.2.1 * lasso/id-ff/session.c: use xmlNode stored inside LassoSamlAssertion objects instead of accessing the 'any' list of xmlNode that was inserted in LassoSamlAdvice. --- lasso/id-ff/session.c | 6 +++--- lasso/xml/saml_advice.c | 5 ++--- lasso/xml/saml_advice.h | 6 +++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index 113ae47a..42b2aa2e 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -88,9 +88,9 @@ lasso_session_add_assertion(LassoSession *session, const char *providerID, Lasso LassoSamlAssertion *saml_assertion = LASSO_SAML_ASSERTION(assertion); if (saml_assertion->Advice) { LassoSamlAdvice *advice = saml_assertion->Advice; - GList *iter; - for (iter = advice->any; iter; iter = iter->next) { - xmlNode *node = (xmlNodePtr)iter->data; + LassoSamlAssertion *advice_assertion = (LassoSamlAssertion*)advice->Assertion; + if (LASSO_IS_SAML_ASSERTION(advice_assertion)) { + xmlNode *node = lasso_node_get_original_xmlnode(&advice_assertion->parent); if (xmlSecCheckNodeName(node, (xmlChar*)"Assertion", (xmlChar*)LASSO_SAML_ASSERTION_HREF)) { xmlChar *id = xmlGetProp(node, (xmlChar*)"AssertionID"); ret = lasso_session_add_assertion_with_id(session, (char*)id, node); diff --git a/lasso/xml/saml_advice.c b/lasso/xml/saml_advice.c index 9d440ba2..8c45cc2a 100644 --- a/lasso/xml/saml_advice.c +++ b/lasso/xml/saml_advice.c @@ -54,10 +54,9 @@ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { -/* { "AssertionIDReference", SNIPPET_LIST_CONTENT, + { "AssertionIDReference", SNIPPET_LIST_CONTENT, G_STRUCT_OFFSET(LassoSamlAdvice, AssertionIDReference), NULL, NULL, NULL}, - { "Assertion", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlAdvice, Assertion), NULL, NULL, NULL}, */ - { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoSamlAdvice, any), NULL, NULL, NULL}, + { "Assertion", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlAdvice, Assertion), NULL, NULL, NULL}, {NULL, 0, 0, NULL, NULL, NULL} }; diff --git a/lasso/xml/saml_advice.h b/lasso/xml/saml_advice.h index 2b3cdea7..82b0ecc2 100644 --- a/lasso/xml/saml_advice.h +++ b/lasso/xml/saml_advice.h @@ -49,7 +49,11 @@ struct _LassoSamlAdvice { LassoNode parent; /*< public >*/ - GList *any; /* of xmlNode */ + /* */ + GList *AssertionIDReference; /* of LassoNode */ + /* */ + LassoNode *Assertion; /* actually LassoSamlAssertion* but it recurses */ + }; struct _LassoSamlAdviceClass { -- cgit