diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-15 08:26:31 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-15 08:26:31 +0000 |
commit | 849f76d1fcdbd04470491d0fb3512cc5328fd1e4 (patch) | |
tree | 2facb0f1f0dc8c511e1f6cc1eb8dac9567518dcf | |
parent | 41ddda5a85ce98a4d38931da4edb3f0db191e885 (diff) | |
download | lasso-849f76d1fcdbd04470491d0fb3512cc5328fd1e4.tar.gz lasso-849f76d1fcdbd04470491d0fb3512cc5328fd1e4.tar.xz lasso-849f76d1fcdbd04470491d0fb3512cc5328fd1e4.zip |
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.
-rw-r--r-- | lasso/id-ff/session.c | 6 | ||||
-rw-r--r-- | lasso/xml/saml_advice.c | 5 | ||||
-rw-r--r-- | 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 */ + /* <element ref="saml:AssertionIDReference"/> */ + GList *AssertionIDReference; /* of LassoNode */ + /* <element ref="saml:Assertion"/> */ + LassoNode *Assertion; /* actually LassoSamlAssertion* but it recurses */ + }; struct _LassoSamlAdviceClass { |