From c9011fb16b6d03228b7bb53df9712dffa64d2b41 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 27 Mar 2009 15:05:31 +0000 Subject: Core: replace direct use of xmlSecSoap function by wrapper * lasso/xml/xml.c: In lasso_node_init_from_message_with_format remove direct use of xmlSecSoap* functions because they emit too much warning by lasso reimplementations. --- lasso/xml/xml.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 90003571..2849cc94 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -1636,10 +1635,9 @@ lasso_node_init_from_message_with_format(LassoNode *node, const char *message, L /* XML case */ if (any || constraint == LASSO_MESSAGE_FORMAT_XML || + constraint == LASSO_MESSAGE_FORMAT_BASE64 || constraint == LASSO_MESSAGE_FORMAT_SOAP) { if (strchr(msg, '<')) { - gboolean is_soap = FALSE; - doc = lasso_xml_parse_memory(msg, strlen(msg)); if (doc == NULL) { rc = LASSO_MESSAGE_FORMAT_UNKNOWN; @@ -1648,20 +1646,11 @@ lasso_node_init_from_message_with_format(LassoNode *node, const char *message, L root = xmlDocGetRootElement(doc); if (any || constraint == LASSO_MESSAGE_FORMAT_SOAP) { - is_soap = xmlSecSoap11CheckEnvelope(root) || - xmlSecSoap12CheckEnvelope(root); + gboolean is_soap = FALSE; + is_soap = lasso_xml_is_soap(root); if (is_soap) { - xmlNode *body; - - if (xmlSecSoap11CheckEnvelope(root)) { - body = xmlSecSoap11GetBody(root); - } else { - body = xmlSecSoap12GetBody(root); - } - if (body) { - root = xmlSecGetNextElementNode(body->children); - } + root = lasso_xml_get_soap_content(root); } rc = lasso_node_init_from_xml(node, root); if (rc != 0) { @@ -1705,7 +1694,6 @@ cleanup: } } else { lasso_release_doc(doc); - lasso_release_xml_node(root); } return rc; } -- cgit