summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lasso/xml/private.h2
-rw-r--r--lasso/xml/xml.c23
2 files changed, 25 insertions, 0 deletions
diff --git a/lasso/xml/private.h b/lasso/xml/private.h
index 516a9596..abab6c31 100644
--- a/lasso/xml/private.h
+++ b/lasso/xml/private.h
@@ -159,6 +159,8 @@ LassoSaml2EncryptedElement* lasso_node_encrypt(LassoNode *lasso_node,
int lasso_node_decrypt_xmlnode(xmlNode* encrypted_element, GList *encrypted_key,
xmlSecKey *encryption_private_key, LassoNode **output);
+void lasso_node_remove_signature(LassoNode *node);
+
char* lasso_concat_url_query(const char *url, const char *query);
xmlDocPtr lasso_xml_parse_memory(const char *buffer, int size);
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 96e57ede..268b02b6 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -1230,6 +1230,29 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode)
return 0;
}
+/**
+ * lasso_node_remove_signature:
+ * @node: a #LassoNode object
+ *
+ * Remove any signature setup on this node.
+ */
+void
+lasso_node_remove_signature(LassoNode *node) {
+ LassoNodeClass *klass;
+
+ if (! LASSO_IS_NODE(node))
+ return;
+ klass = LASSO_NODE_GET_CLASS(node);
+ /* follow the class parenting chain */
+ while (klass && LASSO_IS_NODE_CLASS(klass)) {
+ if (klass && klass->node_data && klass->node_data->sign_type_offset != 0) {
+ G_STRUCT_MEMBER(LassoSignatureType, node, klass->node_data->sign_type_offset) =
+ LASSO_SIGNATURE_TYPE_NONE;
+ }
+ klass = g_type_class_peek_parent(klass);
+ }
+}
+
/*****************************************************************************/
/* private methods */
/*****************************************************************************/