Commit Graph

323 Commits

Author SHA1 Message Date
Benjamin Dauvergne 670383da1e If no typename could be determined, stop parsing.
* lasso/xml/xml.c:
   in lasso_node_new_from_xmlNode if no typename is found for the given
   xmlNode, return NULL.
2009-04-21 12:22:41 +00:00
Benjamin Dauvergne dac53715ea Core: Add cast to first argument of isalnum
* lasso/xml/xml.c:
 * lasso/xml/tools.c:
   isalnum takes a int as first arg.
2009-04-14 07:51:25 +00:00
Benjamin Dauvergne 075c9a1a93 XML: use macro for assignment
* lasso/xml/xml.c: use standardized assignment macros (it takes care of
   releasing previous valuesm and other peculiarities associated with
   safe pointer usage).
2009-03-27 15:06:38 +00:00
Benjamin Dauvergne 60018bbb4d XML: fix memory leaks
* lasso/xml/tools.c:
 * lasso/xml/xml.c:
   release xmlDoc, properly steal nodes by using xmlSetTreeDoc(xmlnode, NULL);
2009-03-27 15:06:30 +00:00
Benjamin Dauvergne 8100385979 XML: Remove useless parsing of RelayState in lasso_node_init_from_saml2_query_fields
* lasso/xml/xml.c: (lasso_node_init_from_saml2_query_fields) Since parsing
    of the relayState is now done inside each "_process_*msg" method of
    each SAML2 profile, it is not needed anymore in this function.
2009-03-27 15:06:06 +00:00
Benjamin Dauvergne 27ac758de6 XML: Use memory macros inside lasso_node_export_to_query
* lasso/xml/xml.c (lasso_node_export_to_query): use lasso own memory
   handling macros.
2009-03-27 15:06:03 +00:00
Benjamin Dauvergne 63b38a4066 ID-FF 1.2: review HTTP-Redirect binding parsing/building
* lasso/xml/lib_authn_request.c, lasso/xml/lib_logout_request.c,
   lasso/xml/lib_register_name_identifier_request.c,
   lasso/xml/lib_status_resposne.c:
   - build_query: remove build_query overloaded virtual method, use
     LassoNode new generic implementation.
   - init_from_query:
     - change direct call to lasso_node_init_from_query_fields to use of
       base implementation from LassoNode.
     - make use of utils.h memory handling macros like
       lasso_release_gobject and lasso_assign_string.

 * lasso/xml/lib_federation_termination_notification.c:
   - init_from_query: remove parsing of RelayState parameter
2009-03-27 15:05:59 +00:00
Benjamin Dauvergne f604d63268 XML: Remove static modifier on lasso_node_build_query
* lasso/xml/private.h, lasso/xml/xml.c: remove static modifier to
   lasso_node_build_query and export it for use in id-ff profiles.
2009-03-27 15:05:41 +00:00
Benjamin Dauvergne d0d71abe2c Core: rename lasso_release_xmlchar to lasso_release_xml_string
* lasso/id-wsf/wsf_profile.c, lasso/utils.h, lasso/xml/xml.c: rename
   lasso_release_xmlchar to lasso_release_xml_string.
2009-03-27 15:05:37 +00:00
Benjamin Dauvergne c9011fb16b 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.
2009-03-27 15:05:31 +00:00
Benjamin Dauvergne f6f8ffcd6e Core: remove use of XPath
* lasso/xml/xml.c:
   in lasso_node_new_from_soap, instead of using XPath use function
   lasso_xml_get_soap_content.
2009-03-27 15:05:29 +00:00
Benjamin Dauvergne dd9382d05b Core: fix comment for lasso_node_init_from_message
* lasso/xml/xml.c:
   state the return code type.
2009-03-27 15:05:28 +00:00
Benjamin Dauvergne c252e5d1c3 Core: remove lasso_node_decrypt implementation
* lasso/xml/xml.c:
   remove code for lasso_node_decrypt.
2009-03-27 15:05:26 +00:00
Benjamin Dauvergne 8fc5cb3f49 Core: make comment agree with the code
* lasso/xml/xml.c:
   change comment about xsi:type handling, we try to honor every
   xsi:type.
2009-03-27 15:05:24 +00:00
Benjamin Dauvergne d8aa0d69a0 Core: remove commented code
* lasso/xml/xml.c:
   remove commented code to handle a specific lasso extension.
2009-03-27 15:05:23 +00:00
Benjamin Dauvergne 642dcfdfbb Core: use lasso_xml_parse_memory instead of xmlParseDoc
* lasso/id-ff/provider.c:
   use internal wrapper instead of direct call to libxml for parsing.
2009-03-27 15:05:21 +00:00
Benjamin Dauvergne 580239d233 Core: move parse xml wrapper from xml.c to tools.c
* lasso/xml/xml.c:
   remove lasso_xml_parse_memory.
 * lasso/xml/tools.c:
   add lasso_xml_parse_memory to wrap xmlParseDocument.
 * lasso/saml-2.0/name_id_management.c:
   use lasso_xml_parse_memory
2009-03-27 15:05:19 +00:00
Benjamin Dauvergne 9bd1c6a446 Core: new init method with format limit and xmlDoc output argument
* lasso/xml/private.h:
 * lasso/xml/xml.c:
   lasso_node_init_from_message_with_format permit to initialize a node
   and to keep the corresponding xml document, in order for example to
   validate a signature.
 * lasso/xml/tools.c:
   lasso_xml_parse_message is able to parse a message of any type, or of
   a given type. If a message of another than the one specified is
   found, the call fails, and a LASSO_MESSAGE_FORMAT_ERROR is returned.
2009-03-27 15:04:53 +00:00
Benjamin Dauvergne 7f09fe60de Fix bug #94: permit any content for AttributeValue
* lasso/xml/private.h:
 * lasso/xml/xml.h
 * lassoi/xml/xml.c:
   add an implementation helper for the AttributeValue objects
   implementation of get_xmlNode.
   make lasso_node_set_original_xmlnode public API.
 * lasso/xml/saml-2.0/samlp2_extensions.c:
 * lasso/xml/saml-2.0/saml2_attribute_value.c:
 * lasso/xml/saml_attribute_value.c:
   implement get_xmlNode for the AttributeValue and Extensions objects.
   If the any field is empty, use the original_xmlnode value.  In order
   to support free-style content, you must use the method
   lasso_node_set_original_xmlnode, properties and children are
   extracted from the given node and added to the node created by the
   generic get_xmlNode virtual method.
2009-03-27 15:04:41 +00:00
Benjamin Dauvergne a017ddc81e XML Core: add new snippet type SNIPPET_KEEP_XMLNODE
* private.h:
   add the new constant to the enum type
 * xml.c:
   fix lasso_node_traversal, add support for the new contanst in
   lasso_node_imp_init_from_xmlNode.
2009-03-27 15:04:40 +00:00
Benjamin Dauvergne d79b3e5b3a Core: Fix argument checking in init_from_xml
* lasso/xml/xml.c:
   In lasso_node_impl_init_from_xml if xmlnode is null, return an error
   but if no node_data specification is present, do not fail but print a
   warning. It is not an error for a class to not have a node_data
   private field.
   add a comment to fix return code later.
2009-03-27 15:04:35 +00:00
Benjamin Dauvergne b09ef2e015 Core: do not mix public and private headers
* lots of files:
   explicitely load the internal header xml/private.h where needed.
2009-03-27 15:04:26 +00:00
Benjamin Dauvergne 7d025b6952 Core: fix handling of xsi:type
* lasso/xml/xml.c:
   xsi:type handling is broken since commit 3982, restore it.
   move prefix/nodename matching in static helper functions, and reuse
   them inside xsi:type code path.
2009-03-03 20:52:39 +00:00
Benjamin Dauvergne f120c3e8c2 Core: add new error code to lasso_node_init_from_message
- add new return code LASSO_MESSAGE_FORMAT_XSCHEMA_ERROR
 - fix SOAP_FORMAT bizarre if conditional
 - remove old comments
2009-01-24 09:34:14 +00:00
Benjamin Dauvergne 78b62c1ee9 Core: review of lasso_node_encrypt
- use new memory macros
 - copying nodes instead of stealing nodes
2009-01-24 09:34:12 +00:00
Benjamin Dauvergne 33bbf7a7de All: Fix missing field initializer problems
* lots of files: Explicitely set all field of initialized structures,
  in order to remove -Wno-missing-field-initilizers from needed
  compiler options when using -Wall -Wextra.
2009-01-24 09:33:40 +00:00
Benjamin Dauvergne 095dfe6b1a Fix overwriting of attributes ht by node lists
- lasso/xml/xml.c:
   - In lasso_node_impl_init_from_xml fix really old bug seen when
     running ID-WSF 2 python tests, when looking for snippet_any
     field in the GObject we should not take the any attribute field,
     otherwise the field value is gonna be overwritten with new GList
     nodes. The problem ca be seen only with classes using the two kind
     of snippets (ANY nodes and ANY attributs).
2008-11-04 01:58:55 +00:00
Benjamin Dauvergne c5249bab79 Move xmlDoc release after xmlFreeXPath*
- lasso/xml/xml.c:
   - in lasso_node_new_from_soap release xmlDoc (and the contained
     nodes) after the XPath objects that can reference them.
2008-11-04 01:58:51 +00:00
Benjamin Dauvergne 0d66367f28 Remove use of xmlFreeDoc for lasso_release_doc
- bindings/java/wrapper_top.c, bindings/php4/lasso_php4_helper.c,
    bindings/php5/wrapper_source_top.c, bindings/python/wrapper_top.c,
    lasso/id-ff/identity.c, lasso/id-ff/lecp.c, lasso/id-ff/login.c,
    lasso/id-ff/logout.c, lasso/id-ff/name_registration.c,
    lasso/id-ff/profile.c, lasso/id-ff/provider.c, lasso/id-ff/server.c,
    lasso/id-ff/session.c, lasso/id-wsf-2.0/data_service.c,
    lasso/id-wsf/data_service.c, lasso/id-wsf/discovery.c,
    lasso/id-wsf/wsf_profile.c, lasso/saml-2.0/ecp.c,
    lasso/saml-2.0/login.c, lasso/saml-2.0/name_id_management.c,
    lasso/utils.h, lasso/xml/tools.c, lasso/xml/xml.c, swig/Lasso.i:
    Remove use of xmlFreeDoc. Use lasso_release_doc instead.
2008-11-04 01:58:49 +00:00
Benjamin Dauvergne 12afeac716 Restore ABI compatibility wrt original_xmlNode
* lasso/xml/xml.c:
  - use set/get_qdata to store the original xmlnode, modify
    init_from_xml and dispose function to cope with this new storage
    place.
 * lasso/xml/xml.h:
  - remove field original_xmlNode from structure LassoNode to keep ABI
    compatibility with previous versions.
  - declare new API lasso_node_get_original_xmlnode
2008-11-03 15:01:33 +00:00
Benjamin Dauvergne a8adf797fe API to cleanup LassoNode tree of keeped xmlNode
* lasso/xml/xml.c:
  - add a new function lasso_node_cleanup_original_xmlnodes to
    disallocate all keeped xmlNode inside a tree of LassoNodes.
  - add internal function lasso_node_traversal to iterate across a
    LassoNode tree (could be used to reimplement lasso_node_destroy)
    It is a preorder traversal.
2008-11-03 14:15:44 +00:00
Benjamin Dauvergne 770e3c5538 Add support for keep_xmlnode flag
* lasso/xml/xml.c:
   - (lasso_node_impl_init_from_xml) When the keep_xmlnode flag is true
     for the currently parsed Node class, we copy the parsed xmlNode
     and keep inside the LassoNode.
   - (lasso_node_dispose) if an original_xmlNode is present, we disallocate
     it.
2008-11-03 14:15:43 +00:00
Benjamin Dauvergne ef42f2cbc8 add functionality to enable debugging flags at runtime
This code permit to set flags, separated by commas, space,
tabulations, or colons. This flags activates debug functions like,
suppressing validations of signatures or print debugging message about
deallocations.

The new flags are defined in /lasso/debug.h they can be set using an
environment variable named LASSO_FLAG or a function named
lasso_set_flag.

There are two flags currently:
- verify-signature:
  To deactivate it, pass 'no-verify-signature' inside LASSO_DEBUG.
  It desactivate signature verification, inside two functions:
  lasso_query_verify_signature and lasso_provider_verify_signature.
- memory-debug:
  It enabled reporting of memory deallocation inside generic memory
  dellaocator for LassoNode objects and also in bindings.

- lasso/xml/xml.c: do not free a null hash table pointer.
2008-10-01 10:31:58 +00:00
Benjamin Dauvergne 152ec6d42e Many fix to compile with --enable-wsf and --enable-debugging and also to
remove valgrind errors through python tests.

1. Rename lasso_wsf_profile_new_full for java bindings (cannot subclass
   in overrides of static methods).
2. Add const modifiers to many functon signatures in
   bindings/python/wrapper_top.c.
3. add initialisation of private_data->encryption_sym_key_type (to
   please valgrind) in instance_init of LassoProvider.
4. Add new macro to assign xmlNode, we consider xmlNode to be an
   immutable value, and always use xmlCopyNode for assignment. The
   macros is called named lasso_assign_node.
5. Fix segfault, when using xmlSec to encrypt the newly created
   encrypted node replace the original node inside the xmlDoc structure,
   and the original node is freed automatically. So you cannot borrow
   the encrypted if you do not remove it from xmlDoc first.
2008-09-23 09:13:09 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Benjamin Dauvergne ae1f6a297c * Remove warnings:
- remove unused parameter from private function signatures
 - remove unused variable
 - initialize variable potentially accessed uninitialized
 - add G_GNUC_UNUSED if function is public or adhering to an interface, and a
   parameter is unused.
 - if ID-WSF is not compiled in, define stubs with G_GNUC_UNUSED on parameters.
 The goal is to compile with -Werror.
2008-09-12 13:57:22 +00:00
Benjamin Dauvergne 09daafe00f * Add support of lasso_registry to lasso_node_new_from_xmlNode.
* Add full support for xsi:type, with lookup of the QName namespace, will only
  work if lib: namespace is correctly declared in the dumped XML fragment.
* Add a test for the new functionnality in lasso_node_new_from_xmlNode.
2008-09-12 10:17:26 +00:00
Benjamin Dauvergne 207891ff29 * Fix blanks mismatch (space in *.c and *h files or tabs in *.py files) and formatting 2008-08-05 14:53:29 +00:00
Benjamin Dauvergne b629c91b08 * add include of utils.h 2008-08-05 14:52:43 +00:00
Benjamin Dauvergne 2d18a0d3f8 * Fix potential memory leaks
* id-wsf/wsf_profile.c: add error code path in
  lasso_wsf_profile_build_soap_request_msg for unsupported
  security mechanisms.
2008-08-05 14:52:34 +00:00
Benjamin Dauvergne d4b310822e * add detail node to node with specialised detection in lass_node_new_from_xmlNode 2008-08-01 14:11:56 +00:00
Benjamin Dauvergne c89267b8fe * specialise lasso_node_new_from_xmlNode for soap:detail node 2008-08-01 14:11:53 +00:00
Benjamin Dauvergne e3c2e7dccd * lasso/xml/xml.c: add support for dgme:Status node. 2008-08-01 14:11:38 +00:00
Benjamin Dauvergne c9304be702 * lasso/xml/xml.c: in samlNs, compare prefix *AND* href fields of the namespace object 2008-08-01 14:11:35 +00:00
Benjamin Dauvergne 2cb76452da * lasso/xml/xml.c: make xmlClean change namespace of properties not just of nodes 2008-08-01 14:11:05 +00:00
Benjamin Dauvergne 205d705b33 * lasso/xml/xml.c: adapt to new prefix of Dgme library 2008-08-01 14:11:02 +00:00
Benjamin Dauvergne 76d9fce5d5 forked lasso branch for adeline 2008-08-01 14:08:54 +00:00
Damien Laniel 5316df50a7 fixed memory management during node decryption 2008-05-21 14:20:33 +00:00
Damien Laniel a779166e31 removed warning when calling lasso_node_destroy with NULL argument 2008-05-21 09:45:20 +00:00
Frédéric Péters e5ba6151ba moved gtk-doc inline as is better on so many points; also added schema
fragments to published doc
2008-05-15 21:17:44 +00:00