diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-12 15:39:42 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-12 15:39:42 +0000 |
| commit | ac3a687518a7635ab03b21fe2bccbcbc03559550 (patch) | |
| tree | f8ef4e967479b4b936b566a6ae78b2c52878fd67 | |
| parent | 01dad5fd05974e00274c63373af698bb8486c18a (diff) | |
| download | lasso-ac3a687518a7635ab03b21fe2bccbcbc03559550.tar.gz lasso-ac3a687518a7635ab03b21fe2bccbcbc03559550.tar.xz lasso-ac3a687518a7635ab03b21fe2bccbcbc03559550.zip | |
XML Core: in xml.c, private.h, add a lasso_node_remove_signature function
| -rw-r--r-- | lasso/xml/private.h | 2 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 23 |
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 */ /*****************************************************************************/ |
