Commit Graph

88 Commits

Author SHA1 Message Date
Benjamin Dauvergne 81fad67ad2 saml-2.0: improve support for free content inside samlp2:Extensions (fixes #18581)
Four new accesors:

	lasso_samlp2_extensions_get_any
	lasso_samlp2_extensions_set_any
	lasso_samlp2_extensions_get_attributes
	lasso_samlp2_extensions_set_attributes

The two new pseudo field are fully supported in the python binding.

	node = lasso.Samlp2Extensions()
	node.any = '<test>ok</test>'
	node.attributes = {'{http://entrouvert.org/}attribute1': 'value'}
	print node.dump()
2017-09-11 15:14:41 +02:00
Benjamin Dauvergne a71e682905 do not call xmlSecKeyDuplicate is source key is NULL 2016-04-26 14:43:43 +02:00
John Dennis a6014fc51b Add lasso_is_in_list_of_strings macro to utils.h
Add macro that tests to see if a string is a member in a list of
strings.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis f3849b2664 Fix build failure, remove inclusion of xml/private.h in utils.h
The public utils.h header includes the private xml/private.h file
which is not installed. Therefore anyone trying to build against lasso
and include utils.h will fail because xml/private.h cannot be
found. There doesn't seem to be any need to include this file.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Simo Sorce 3a6b2fdee7 Fix license boilerplates
Instad of referring to an old FSF address, point the reader to the FSF
website where the latest licenses and addresses are published.

Signed-off-by: Simo Sorce <simo@redhat.com>
2013-12-03 21:55:06 +01:00
Benjamin Dauvergne be5bcfbb59 utils: add a lasso_release_slist macro 2013-01-25 18:30:38 +01:00
Benjamin Dauvergne a3fb13e36b add a lasso_release_slist 2013-01-25 18:30:18 +01:00
Benjamin Dauvergne 727f07b1ae Simplify useless complexity in include paths 2011-12-16 14:17:31 +01:00
Benjamin Dauvergne 10edf69bfc [utils] add lasso_crypto_memequal function
This method compare byte strings in constant time.
2011-12-05 12:03:12 +01:00
Benjamin Dauvergne 4ba067b828 [utils] add lasso_transfer_xml_node macros 2011-12-05 12:03:12 +01:00
Benjamin Dauvergne e14652e7a4 [utils] add macros to append to and release a list of xmlSecKey*
[core] make lasso_provider_verify_query_signature use lasso_provider_verify_signature
2011-05-19 17:54:16 +02:00
Benjamin Dauvergne b0c2fdab28 [utils] fix typo in lasso_assign_sec_key 2010-12-14 01:53:01 +01:00
Benjamin Dauvergne 462c9a1cd0 [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequal
Too much human errors with strcmp kind of functions. Also change name os
lasso_is_empty_string to lasso_strisempty.
2010-10-01 15:29:38 +02:00
Benjamin Dauvergne b5fcbc6455 [Core] add helper API for string comparaison
It should remove most errors when comparing strings.
2010-10-01 15:13:49 +02:00
Benjamin Dauvergne 2e9e814b09 [Core] add macro to release an xmlNodeList object 2010-06-29 14:15:02 +00:00
Benjamin Dauvergne 4a36e6d065 [Core] add macro to release GList of xmlNodeList 2010-06-29 14:14:59 +00:00
Benjamin Dauvergne 0524051343 [Core] add macros to manipulate xmlNodeList and GList of xmlNodeList
The method to copy them is xmlCopyNodeList and not xmlCopyNode, so we
need another set of macros.
2010-06-29 14:14:58 +00:00
Benjamin Dauvergne a9b673cd4a Core: move logging function and macros to their own module, adapt perl binding 2010-06-12 00:43:49 +00:00
Benjamin Dauvergne d0a2135f60 Import tools in utils.h 2010-06-10 13:37:56 +00:00
Benjamin Dauvergne 2c0ea4d647 Change all logging to use message() 2010-06-09 16:54:55 +00:00
Benjamin Dauvergne 80a930cc37 Utils: add function to extract/create node in lists
* lasso_extract_gtype_from_list_or_new will help for method with create
   or extend nodes in lists.
2010-06-09 16:54:49 +00:00
Benjamin Dauvergne 0e8441afe3 Improve safety by replacing all g_hash_table_destroy use by lasso_release_ghashtable 2010-04-22 00:45:02 +00:00
Benjamin Dauvergne 34c7642226 Utils: add lasso_assign_list 2010-04-22 00:44:22 +00:00
Benjamin Dauvergne f08387c983 Add lasso_release_gstring 2010-04-22 00:44:19 +00:00
Benjamin Dauvergne 7682ce4eac Utils: add lasso_release_ghashtable 2010-04-22 00:44:15 +00:00
Benjamin Dauvergne 99454639cd Core: add macro to remove gobject from lists 2010-03-02 11:58:00 +00:00
Benjamin Dauvergne dce077bd99 Core: add do/while(0) around block of goto_cleanup_with_rc 2010-03-02 11:57:34 +00:00
Benjamin Dauvergne 3c8855eb66 Fix lasso_extract_gobject_from_list 2010-02-22 13:30:23 +00:00
Benjamin Dauvergne 6aee196410 Core: in utils.h, use a temporary to store reference to freed list 2010-02-17 10:14:31 +00:00
Benjamin Dauvergne 3433a07361 Core: add more memory tracing, add a tracing macro
* lasso/utils.h: add lasso_trace, which as a printf signature.
 * xml/xml.c: add more trace to node initialization code.
2010-02-04 00:02:16 +00:00
Benjamin Dauvergne 2a7b411ea1 Core: in utils.h, add macros to replace verbose g_return_val_if_fail 2010-02-01 19:50:04 +00:00
Benjamin Dauvergne 935c724cea Utils: lasso_unref, a safe g_object_unref, and add some document about existing family of macros 2010-02-01 19:50:00 +00:00
Benjamin Dauvergne b3b2e6f22d Core: add new macros to lasso/utils.h, fix lasso_assign_new_list_of_gobjects
* lasso/utils.h:
   add:
    - lasso_assign_new_xml_node
    - lasso_assign_new_list_of_strings
    - lasso_assign_new_list_of_xml_node
   fix lasso_assign_new_list_of_gobjects, bad naming of release macro.
2010-01-28 15:31:41 +00:00
Benjamin Dauvergne bec8672cc5 Add new macro lasso_list_add_new_xml_node
* lasso/utils.h:
   fix lasso_list_add_xml_node, it must copy the node before assigning
   it.
   add lasso_list_add_new_xml_node for keeping the old behaviour.
 * lasso/xml/xml.c:
   fix use of lasso_list_add_xml_node, because copying the node before
   assigning it is a leak now.
2010-01-25 23:47:43 +00:00
Benjamin Dauvergne 0279087029 Documentation: distribute stylesheet, fix documentation comments, compelte lasso-sections.txt 2010-01-18 10:03:54 +00:00
Benjamin Dauvergne bb2f640231 Core: in utils.h, add a macros, fix existing
* lasso/utils.h:
   - add macro lasso_ref(object), if object is not null, call
     g_object_ref on it, and return the value, otherwise do nothing and
     return NULL.
   - make a better reporting of bad object release
   - change format type for __LINE__ and dest arguments in
     lasso_release_gobject warning display.
   - add a lasso_check_non_empty_string macro
   - add new macro to extract a specific node type from a list of
     GObject objects.
   - use xmlStrdup not g_strdup for lasso_assign_xml_string
   - add lasso_list_add_gstrv and lasso_check_good_rc
   - add macro lasso_list_get_first_child
   - add inline function to test empty string
   - change macro lasso_check_non_empty_string to use the new inline
     function and go to cleanup
   - fix lasso_check_non_empty_string macro
 * lasso/utils.c:
   - add lasso_gobject_is_of_type returns 0 if first parameters is a
     gobject whose GType is equal to the second parameter, and 1
     otherwise.
2010-01-04 09:13:46 +00:00
Benjamin Dauvergne 07ccaf02ec Core: in utils.h, change __STRING(x) for #x
* lasso/utils.h:
   __STRING(x) does not seem more portable than #x so change, problem
   with AIX.
2009-12-16 09:28:04 +00:00
Benjamin Dauvergne 4074c22a13 Core: add new macros to traverse lists
* lasso/utils.h:
   lasso_foreach_full_begin(_type, _data, _iter, _list)
   traverse GList* _list, using _iter as iteration variable
   extract data field to variable _data of type _type.
2009-09-11 15:51:51 +00:00
Benjamin Dauvergne fbfbe5553d ID-FF&Core: Seal public field of LassoSession
* id-ff/session.h: seal public fields.

 * id-ff/session.c, id-ff/sessionprivate.h: add accessors for reading
   the is_dirty flag and counting store assertions.

 * id-ff/logout.c, id-ff/login.c, saml-2.0/login.c, saml-2.0/logout.c,
   saml-2.0/profile.c: use the new accessors.

 * id-ff/profile.c: include the private header file, use the new
   accessors, and remove unnecessary setting of is_dirty to FALSE (it
   should be false at instanciation).

 * utils.h: add a macro to access private content, prepare for using
   G_TYPE_INSTANCE_GET_PRIVATE and the GObject infrastructure for
   private structures eventually.
2009-08-26 15:13:55 +00:00
Benjamin Dauvergne c150172504 Core: fix bad name of lasso_unlink_and_release_node
* lasso/utils.h:
   - rename lasso_unlink_and_release_node to
     lasso_release_list_of_xml_node.
   - add a GList iteration macro: lasso_foreach.
2009-08-26 15:13:49 +00:00
Benjamin Dauvergne 8b23081b3a Fix debug echo on stdout
* lasso/utils.h:
   make lasso_mem_debug output on stderr and not stdout
2009-04-30 14:58:01 +00:00
Benjamin Dauvergne 86b97760e6 fix: handle non-LHS argument for lasso_extract_node_or_fail()
* lasso/utils.h:
   create a temporary varaible to store result of second argument
   evaluation to prevent spurious side effects.
2009-04-27 08:19:25 +00:00
Benjamin Dauvergne 52e60ecb09 Rework cleanup handling
* lasso/utils.h:
   change 'goto exit' for 'goto cleanup'. rename all goto_exit macros to
   goto_cleanup_.  rename goto_cleanup_if_fail to
   goto_cleanup_if_fail_with_rc and add a
   goto_cleanup_if_fail for function which do not return an integer
   value. add documentation for goto_cleanup macro family.
 * lasso/id-ff/login.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
 * lasso/id-wsf/discovery.c:
 * lasso/id-wsf/wsf_profile.c:
 * lasso/saml-2.0/profile.c:
 * lasso/utils.h:
 * lasso/xml/lib_logout_request.c:
 * lasso/xml/tools.c:
 * lasso/xml/xml.c:
   update name of goto_exit_if_fail macros. rename 'exit' labels to
   'cleanup'.
2009-04-22 23:49:29 +00:00
Benjamin Dauvergne 3cd463c4a2 Core: add an header file for backward compatibility
* lasso/backward_comp.h:
   this header will contain substitue function, defines or types for
   compatibility with older versions of dependencies.
 * lasso/utils.h:
   remove declaration of g_strcmp0
 * lasso.c:
 * tests/login_tests.c:
   use backward_comp.h
2009-04-14 07:51:22 +00:00
Benjamin Dauvergne ff18983520 Tests&Core: add g_strcmp0 if glib is old
* lasso/utils.h:
   if glib is older than 2.16, export g_strcmp0 as part of internal
   headers, in order to use it in login_tests.c
 * tests/login_tests.c:
   include utils.h
2009-04-02 17:16:05 +00:00
Benjamin Dauvergne 61b64a38c5 Core: Macros to print deallocation messages
* lasso/utils.h:
   lasso_mem_debug print deallocation message with respect to class and
   field.
2009-03-27 15:06:34 +00:00
Benjamin Dauvergne c34e67d523 Core: remove type check equality on gobject macros
* lasso/utils.h:
   assignment to the temporary variable allow to check for the typing,
   do not use lasso_check_type_equality.
2009-03-27 15:06:33 +00:00
Benjamin Dauvergne 38053d6790 Core: add macros to handle xmlSecKey
* lasso/utils.h:
   macros to assign and release xmlSecKey(s).
2009-03-27 15:06:32 +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 56160b783d Core: Fix double instantiation of macro parameters
* lasso/utils.h:
 - (lasso_assign_new_string,lasso_assign_gobject) if source parameter
   is a function call it could be called two times and have unexpected
   side effects. Copy the returned value to a temp variable and use it
   instead.
2009-03-27 15:05:35 +00:00