diff options
-rw-r--r-- | lasso/xml/dst_modify.h | 2 | ||||
-rw-r--r-- | lasso/xml/dst_modify_response.h | 2 | ||||
-rw-r--r-- | lasso/xml/dst_query.h | 2 | ||||
-rw-r--r-- | lasso/xml/dst_query_response.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_authn_request.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_authn_request_envelope.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_authn_response.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_federation_termination_notification.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_logout_request.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_name_identifier_mapping_request.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_name_identifier_mapping_response.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_register_name_identifier_request.h | 2 | ||||
-rw-r--r-- | lasso/xml/lib_status_response.h | 2 | ||||
-rw-r--r-- | lasso/xml/xml.c | 18 | ||||
-rw-r--r-- | swig/Lasso.i | 19 |
15 files changed, 33 insertions, 30 deletions
diff --git a/lasso/xml/dst_modify.h b/lasso/xml/dst_modify.h index f46f6bde..bd132f42 100644 --- a/lasso/xml/dst_modify.h +++ b/lasso/xml/dst_modify.h @@ -55,7 +55,7 @@ struct _LassoDstModify { LassoDiscoResourceID *ResourceID; LassoDiscoEncryptedResourceID *EncryptedResourceID; GList *Modification; - xmlNode *Extension; + GList *Extension; char *id; char *itemID; diff --git a/lasso/xml/dst_modify_response.h b/lasso/xml/dst_modify_response.h index 08005c09..95c7f882 100644 --- a/lasso/xml/dst_modify_response.h +++ b/lasso/xml/dst_modify_response.h @@ -52,7 +52,7 @@ struct _LassoDstModifyResponse { LassoNode parent; /*< public >*/ - xmlNode *Extension; + GList *Extension; LassoUtilityStatus *Status; char *id; diff --git a/lasso/xml/dst_query.h b/lasso/xml/dst_query.h index da598e7d..9095d03d 100644 --- a/lasso/xml/dst_query.h +++ b/lasso/xml/dst_query.h @@ -55,7 +55,7 @@ struct _LassoDstQuery { LassoDiscoResourceID *ResourceID; LassoDiscoEncryptedResourceID *EncryptedResourceID; GList *QueryItem; - xmlNode *Extension; + GList *Extension; char *id; char *itemID; diff --git a/lasso/xml/dst_query_response.h b/lasso/xml/dst_query_response.h index 09992943..42c4006b 100644 --- a/lasso/xml/dst_query_response.h +++ b/lasso/xml/dst_query_response.h @@ -55,7 +55,7 @@ struct _LassoDstQueryResponse { /*< public >*/ LassoUtilityStatus *Status; GList *Data; - xmlNode *Extension; + GList *Extension; char *id; char *itemIDRef; diff --git a/lasso/xml/lib_authn_request.h b/lasso/xml/lib_authn_request.h index 22b514cc..064e0796 100644 --- a/lasso/xml/lib_authn_request.h +++ b/lasso/xml/lib_authn_request.h @@ -54,7 +54,7 @@ struct _LassoLibAuthnRequest { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="AffiliationID" minOccurs="0"/> */ diff --git a/lasso/xml/lib_authn_request_envelope.h b/lasso/xml/lib_authn_request_envelope.h index fb8c55eb..fe1e183f 100644 --- a/lasso/xml/lib_authn_request_envelope.h +++ b/lasso/xml/lib_authn_request_envelope.h @@ -57,7 +57,7 @@ struct _LassoLibAuthnRequestEnvelope { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="AuthnRequest"/> */ LassoLibAuthnRequest *AuthnRequest; /* <xs:element ref="ProviderID"/> */ diff --git a/lasso/xml/lib_authn_response.h b/lasso/xml/lib_authn_response.h index 1af9817e..2d16f5ad 100644 --- a/lasso/xml/lib_authn_response.h +++ b/lasso/xml/lib_authn_response.h @@ -55,7 +55,7 @@ struct _LassoLibAuthnResponse { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="RelayState" minOccurs="0"/> */ diff --git a/lasso/xml/lib_federation_termination_notification.h b/lasso/xml/lib_federation_termination_notification.h index a1276b52..1ae46c50 100644 --- a/lasso/xml/lib_federation_termination_notification.h +++ b/lasso/xml/lib_federation_termination_notification.h @@ -59,7 +59,7 @@ struct _LassoLibFederationTerminationNotification { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="saml:NameIdentifier"/> */ diff --git a/lasso/xml/lib_logout_request.h b/lasso/xml/lib_logout_request.h index 78f5e704..4e4b3279 100644 --- a/lasso/xml/lib_logout_request.h +++ b/lasso/xml/lib_logout_request.h @@ -55,7 +55,7 @@ struct _LassoLibLogoutRequest { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; char *ProviderID; LassoSamlNameIdentifier *NameIdentifier; char *SessionIndex; diff --git a/lasso/xml/lib_name_identifier_mapping_request.h b/lasso/xml/lib_name_identifier_mapping_request.h index 75c78aea..b200b876 100644 --- a/lasso/xml/lib_name_identifier_mapping_request.h +++ b/lasso/xml/lib_name_identifier_mapping_request.h @@ -58,7 +58,7 @@ struct _LassoLibNameIdentifierMappingRequest { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="saml:NameIdentifier"/> */ diff --git a/lasso/xml/lib_name_identifier_mapping_response.h b/lasso/xml/lib_name_identifier_mapping_response.h index 96f9baa3..ca27a27a 100644 --- a/lasso/xml/lib_name_identifier_mapping_response.h +++ b/lasso/xml/lib_name_identifier_mapping_response.h @@ -60,7 +60,7 @@ struct _LassoLibNameIdentifierMappingResponse { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="samlp:Status"/> */ diff --git a/lasso/xml/lib_register_name_identifier_request.h b/lasso/xml/lib_register_name_identifier_request.h index b1e42e22..6346bab4 100644 --- a/lasso/xml/lib_register_name_identifier_request.h +++ b/lasso/xml/lib_register_name_identifier_request.h @@ -58,7 +58,7 @@ struct _LassoLibRegisterNameIdentifierRequest { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="IDPProvidedNameIdentifier"/> */ diff --git a/lasso/xml/lib_status_response.h b/lasso/xml/lib_status_response.h index 6c503cd9..b7f483bb 100644 --- a/lasso/xml/lib_status_response.h +++ b/lasso/xml/lib_status_response.h @@ -55,7 +55,7 @@ struct _LassoLibStatusResponse { /*< public >*/ /* <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> */ - xmlNode *Extension; + GList *Extension; /* <xs:element ref="ProviderID"/> */ char *ProviderID; /* <xs:element ref="samlp:Status"/> */ diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 5782c7a2..64d91794 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -511,12 +511,8 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) xmlChar *s = xmlNodeGetContent(t); *location = g_list_append(*location, s); } else if (type == SNIPPET_EXTENSION) { - xmlNode **extension = value; - if (*extension) { - xmlAddNextSibling(*extension, t); - } else { - *extension = xmlCopyNode(t, 2); - } + GList **location = value; + *location = g_list_append(*location, xmlCopyNode(t, 1)); } if (tmp == NULL) @@ -657,12 +653,12 @@ lasso_node_dispose(GObject *object) lasso_node_destroy(*value); break; case SNIPPET_EXTENSION: - xmlFreeNodeList(*value); - break; case SNIPPET_LIST_NODES: case SNIPPET_LIST_CONTENT: elem = (GList*)(*value); while (elem) { + if (type == SNIPPET_EXTENSION) + xmlFreeNode(elem->data); if (type == SNIPPET_LIST_NODES) lasso_node_destroy(elem->data); if (type == SNIPPET_LIST_CONTENT) @@ -1094,7 +1090,11 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, } break; case SNIPPET_EXTENSION: - xmlAddChild(xmlnode, xmlCopyNode((xmlNode*)value, 2)); + elem = (GList *)value; + while (elem) { + xmlAddChild(xmlnode, xmlCopyNode(elem->data, 1)); + elem = g_list_next(elem); + } break; case SNIPPET_SIGNATURE: lasso_node_add_signature_template(node, xmlnode, snippet); diff --git a/swig/Lasso.i b/swig/Lasso.i index b56b93d6..7f4d555f 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -894,14 +894,21 @@ void LassoLibAuthnRequest_consent_set(LassoLibAuthnRequest *self, gchar *consent LassoStringArray *LassoLibAuthnRequest_extension_get(LassoLibAuthnRequest *self) { return NULL; /* FIXME */ } + +static void free_xml_list_elem(xmlNode *xmlnode, gpointer unused) +{ + xmlFreeNode(xmlnode); +} + #define LassoLibAuthnRequest_set_extension LassoLibAuthnRequest_extension_set void LassoLibAuthnRequest_extension_set(LassoLibAuthnRequest *self, LassoStringArray *extension) { - if (self->Extension != NULL) - xmlFreeNodeList(self->Extension); + if (self->Extension != NULL) { + g_list_foreach(self->Extension, free_xml_list_elem, NULL); + g_list_free(self->Extension); + } if (extension == NULL) self->Extension = NULL; else { - xmlNode *extensionList = NULL; int index; for (index = 0; index < extension->len; index ++) { xmlDoc *doc; @@ -919,15 +926,11 @@ void LassoLibAuthnRequest_extension_set(LassoLibAuthnRequest *self, LassoStringA LASSO_LIB_PREFIX); xmlSetNs(extensionNode, libertyNamespace); xmlAddChild(extensionNode, xmlCopyNode(node, 1)); - if (extensionList == NULL) - extensionList = extensionNode; - else - xmlAddNextSibling(extensionList, extensionNode); + self->Extension = g_list_append(self->Extension, extensionNode); } xmlFreeDoc(doc); } - self->Extension = extensionList; } } |