Commit Graph

264 Commits

Author SHA1 Message Date
Benjamin Dauvergne b6faccae0f fix warnings about unused but set variables 2013-09-08 21:31:52 +02:00
Benjamin Dauvergne b016558d06 [id-ff 1.1] add support for multiple SessionIndex to lib:LogoutRequest
Combined with the new LassoSession storage for SessionIndex, it
should fix many bugs when doing SLO.
2011-12-22 18:18:23 +01:00
Benjamin Dauvergne 154812b401 [xml] rewrite schema directed serialization/deserialization methods
The new implementations of lasso_node_impl_init_from_xml now validate
namespace of all child nodes befores parsing. It stops on any error. For
node which implement their own parsing of an attribute or a node, it
must declare an XmlSnippet with an offset field set to 0. The 0 value is
invalid for public GObject structure (it's the place of the GObject
machinery like the reference count). The 0 offset can be used for
XmlSnippet in a private structure, so never set the offset to 0 with the
flag SNIPPET_PRIVATE, for a field which is parsed by you get_xmlNode
virtual method.

Other ameliorations in this commit is the possibility to set attributes
with namespace when using the flags SNIPPET_ATTRIBUTE|SNIPPET_ANY. The
syntax for an attribute is inspired by the element tree API from Python:

	{namespace}attribute_name

an example:

	{http://www.w3.org/2001/XMLSchema-instance}type

for the classic xsi:type attribute.
2011-12-16 11:39:24 +01:00
Benjamin Dauvergne 4eb0ae483e [id-ff] move LassoLogout to use LassoSignatureContext 2011-12-08 17:56:31 +01:00
Benjamin Dauvergne 7ef67c8d7e [core] add missing namespace definitions to internal objects
Identity, Lecp, Login, Logout, NameIdentifierMapping, NameRegistration,
Session, AssertionQuery, Ecp and NameIdManagement objects were missing a
namespace association to their GObject class. It broke when you try to
dump a node created by lasso_node_new_from_dump.
2011-03-01 10:58:54 +01:00
Benjamin Dauvergne 4a970453de [Core] add missing annotation to lasso_*_dump functions
The string returned by these functions is newly allocated and must be
freed by the caller.
2010-09-27 16:18:57 +02:00
Benjamin Dauvergne 8b385af8e6 [ID-FFv1.2] move all user of lasso_node_export_to_query to lasso_node_export_to_query_with_password 2010-07-16 19:34:28 +00:00
Benjamin Dauvergne a041a2ef81 Initialize all uninitialized rc variables 2010-04-30 09:23:01 +00:00
Benjamin Dauvergne 0a169eda51 Improve safety by replacing all g_free use by lasso_release 2010-04-22 00:44:45 +00:00
Benjamin Dauvergne 71ce60e8fc First try to check that objects are fully functionals before proceeding 2010-04-22 00:44:07 +00:00
Benjamin Dauvergne 432b54a79d Core: add new example to LassoLogout for asynchronous response handling 2010-02-22 13:30:32 +00:00
Benjamin Dauvergne c51e61a5ed Documentation: add example to LassoLogout, fix bad markup in id-wsf-2.0/profile.c 2010-02-17 16:08:35 +00:00
Benjamin Dauvergne 95f5d99be6 Core: add missing return value owner semantic annotations to getters
* lasso/id-ff/provider.c:
   fix lasso_provider_get_base64_succinct_id, it returned a libxml
   string, copy it with g_strdup before releasing it to stay with GLib
   allocated string in return values.
2010-02-17 10:14:59 +00:00
Benjamin Dauvergne f520348197 Core: use lasso_node_new_from_dump to implement _new_from_dump methods
* provider.c:
   add annotation for nullable arguments (necessary for bindings of
   new_from_buffer).
 * server.c: add annotations, allow to set encryption_private_key from
   buffers
2010-02-04 00:02:12 +00:00
Benjamin Dauvergne 2ff13e5414 SAML 2.0: overhaul for ubuquitous binding support, still need work for HTTP-Artefact 2010-01-12 15:39:48 +00:00
Benjamin Dauvergne a8e89261dd ID-FF: add a partial_logout flag to LassoLogout private_data
* lasso/id-ff/logout.c:
 * lasso/id-ff/logout.h:
   add a flag to store the status of a partial logout
2009-10-30 14:47:28 +00:00
Benjamin Dauvergne 6921dd1d9b ID-FF1.2 and SAML2: remove direct access to profile->server->providers
* client of LassoServer should use lasso_server_get_provider.
 * LASSO_PROFILE_ERRROR_UNKNOWN_PROVIDER was a mistake, it is
   superfluous, use LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND.
2009-10-30 14:47:23 +00:00
Benjamin Dauvergne bdd1ad92a0 Core: add const modifier to return value of lasso_provider_get_metadata_list
- lasso/id-ff/provider.c lasso/id-ff/provider.h:
   change return type of lasso_provider_get_metadata_list from GList* to
   const GList*.
 - lasso/id-ff/logout.c lasso/saml-2.0/logout.c
   lasso/saml-2.0/provider.c:
   change consumers of the API
2009-09-29 13:20:40 +00:00
Benjamin Dauvergne c462bc3b2a Do not use g_new, use g_new0
* lasso/id-ff/federation.c:
 * lasso/id-ff/logout.c:
 * lasso/id-ff/profile.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
 * lasso/id-wsf/authentication.c:
 * lasso/saml-2.0/ecp.c:
 * lasso/xml/xml.c:
   even for private datas, use g_new0, it is safer.
2009-09-29 13:20:36 +00:00
Benjamin Dauvergne fd256b2269 Docs: change the doc production and lot of other fixes
* lasso/Makefile.am:
   distribute extract_sections.py
 * docs/references/lasso/lasso.types.in: add missing class (mainly SAML2
   and ID-WSF 1.0/2.0) from docs/references/lasso.types.in

 * lasso/xml/strings.h:
   add lots of documentation, or at least documentation template to
   strings constants.
 * id-ff/login.h:
 * saml-2.0/assertion_query.h:
 * xml/xml.h:
   document undocumented enumerations.
 * lasso/errors.h:
   add proper documentation about error codes.
 * lasso/errors.c:
   new version of the lasso_strerror function
 * lasso/build_strerror.py:
   update the script that generater lasso_strerror from the
   documentation comments.

   Remove usage of OFTYPE

 * lasso/id-ff/session.c:
 * lasso/id-ff/session.h:
   remove usage of oftype, prefer gtk-introspection annotations instead.
 * lasso/id-wsf/data_service.h:
 * lasso/id-wsf/data_service.c:
   do the same.

   Add a script to build lasso-sections.txt

 * lasso/extract_sections.py:
   this script parses header files and generated lasso-sections.txt
   content for GObject class descriptions.

   Add a template file for the lasso-section.txt file

 * docs/references/lasso-sections.txt.in:
   this file serves as a base for the generation of lasso-sections.txt

   Update docs/references/Makefile.am for generating lasso-sections.txt

 * docs/references/Makefile.am:
   always rebuild template, using out of source build directory is too
   weird without it.
   call new script extract_sections.py to regenerate lasso-sections.txt
   if header files changed.

   Update lasso.sgml file with all missing sections

 * docs/reference/lasso.sgml:
   add all missing sections, mainly objects from XML schemas.

 * docs/reference/lasso-sections.txt: update it

 * *.c: add section documentation to some files.
 * lasso/xml/strings.h: fix bad usage or docbook markup
2009-08-26 15:15:07 +00:00
Benjamin Dauvergne 7231771856 All: Rework include files handling, separated ID-WSF code from SAML2/ID-FF code
* nearly all C files: change includes for relative paths.
 * lasso/id-wsf/id_wsf.h, lasso/id-wsf-2.0/id_wsf_2.h: add top level
   public include files for ID-WSF 1.0 and ID-WSF 2.0.
 * lasso/id-ff/server.*, lasso/id-ff/session.*, lasso/id-ff/identity.*:
   remove most of the code related to ID-WSF and push into
   lasso/id-wsf/id_ff_extensions.* and lasso/id-wsf-2.0/identity.c,
   lasso/id-wsf-2.0/server.c, lasso/id-wsf-2.0/session.c.
 * lasso/id-wsf-2.0/saml2_login.c,
   lasso/id-wsf-2.0/saml2_login_private.h: same change but for ID-WSF
   2.0 support in SAML2 SSO profile.
2009-08-26 15:14:32 +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 e3bdadf8f7 ID-FF 1.2: Fix leaks, reduce code
* id-ff/login.c:
 * id-ff/logout.c:
 * id-ff/profile.c:
 * id-ff/provider.c:
 * id-ff/server.c:
   fix leaks by using field setting macros which frees previous values,
   it also reduce code length sometimes.
2009-04-30 14:58:20 +00:00
Benjamin Dauvergne 913f159697 Complete doc of lasso_logout_validate_request
* lasso/id-ff/logout.c:
   add description of all possible return codes.
2009-04-27 08:18:57 +00:00
Benjamin Dauvergne a68c89f902 ID-FF 1.2: fix style fault
* lasso/id-ff/defederation.c:
 * lasso/id-ff/logout.c:
 * lasso/id-ff/profile.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
   add missings casts, remove useless wrappers
 * lasso/id-ff/logout.c:
   In lasso_logout_process_request_msg change sequence of "if" for a
   "switch".
2009-03-27 15:06:29 +00:00
Benjamin Dauvergne c89c77c924 ID-FF 1.2: Add handling of relaystate for logout requests
* lasso/id-ff/logout.c (lasso_logout_process_request_msg,
 lasso_logout_validate_request): transfer relaystate from request
 message to profile field.
2009-03-27 15:06:23 +00:00
Benjamin Dauvergne 854df3b651 ID-FF 1.2: Use new macros in logout, defederation and lecp
* lasso/id-ff/logout.c:
 - (lasso_logout_build_response_msg, lasso_logout_init_request,
    lasso_logout_process_request_msg, lasso_logout_process_response_msg,
    lasso_logout_validate_request) use lasso_assign_new_object,
   lasso_assign_string, lasso_release and lasso_assign_new_string when
   possible.
 - (lasso_logout_process_response_msg) move the tranfer of the relaystate
   from XML object to profile object.

* lasso/id-ff/defederation.c:
 - (lasso_defederation_build_notification_msg,
    lasso_defederation_init_notification,
    lasso_defederation_process_notification_msg,
    lasso_defederation_validate_notification): idem

* lasso/id-ff/lecp.c:
 - (lasso_lecp_build_authn_request_envelope_msg,
    lasso_lecp_build_authn_request_msg,lasso_lecp_build_authn_response_msg,
    lasso_lecp_build_authn_response_envelope_msg) idem
2009-03-27 15:06:21 +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 a27ee6c5da ID-FF 1.2: review of logout validate request
* lasso/id-ff/logout.c (lasso_logout_validate_request): use new macros.
2009-01-24 09:34:26 +00:00
Benjamin Dauvergne cd9c25c0f2 ID-FF 1.2: review logout_process_request_msg
* lasso/id-ff/logout.c (lasso_logout_process_request_msg): use the
   new allocation macros, add checking of the parsed object type, add
   validation of some schema constraints before processing, like
   presence of the name identifier.
2009-01-24 09:34:24 +00:00
Benjamin Dauvergne d38057f858 ID-FF 1.2: review logout_validate_request
* lasso/id-ff/logout.c (lasso_logout_validate_request):
  - when signature verification failed in process_request_msg,
    do not continue validation of the request, stop immediately and
    return the signature status code.
  - use utils.h macro for memory allocation handling. Fix potential leak
    of the profile->response object.
2009-01-24 09:34:04 +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 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 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
Damien Laniel b90ab6d783 fixed too long lines and remove some blank lines 2008-05-30 12:27:01 +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
Damien Laniel e10559a915 fixes SLO from IdP with Encrypted NameID in ID-FF 2008-04-09 10:21:37 +00:00
Benjamin Dauvergne 537db7e9e2 * id-ff/logout.c: (lasso_logout_init_request) free remote_provider_id before setting it. free profile->request
before setting it if LASSO_IS_NODE(request), not just LASSO_IS_LIB_LOGOUT_REQUEST(request). Fix memory leaks.
2008-02-29 17:15:08 +00:00
Frédéric Péters b1fe5d552f format list in docstring with paragraphs, as this form is known by the new
binding generator
2007-11-22 15:40:42 +00:00
Frédéric Péters bc56d07345 removed direct usage of g_object_unref from lasso_*_destroy methods 2007-11-22 12:42:47 +00:00
Frédéric Péters dc93184bb4 don't shout a critical error when there is no session and logout
get_next_providerId is called.
2007-11-22 12:29:46 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters a18bef21a9 un-idff'ied docstrings (and fixed a few comments) 2007-01-08 13:13:49 +00:00
Frédéric Péters e636bd0680 new lasso_profile_clean_msg_info function used to clean msg_url and msg_body
(free()ing and setting to NULL) in functions where those variables are later
set.
2007-01-05 13:40:07 +00:00
Frédéric Péters 41d6f7df68 memory management, avoid leaking xmlDoc* 2007-01-05 11:40:10 +00:00
Frédéric Péters 78b83a37b1 misc fixes for 1) memory leaks around XPath usage and 2) potential segfaults
from untested pointers
2007-01-03 23:35:17 +00:00
Frédéric Péters 1e19373f58 make ID-FF SLO works even when there are SAMLv2 assertions in the session 2007-01-03 21:01:51 +00:00
Frédéric Péters 58477d96d8 harmonized LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ and
LASSO_PARAM_ERROR_INVALID_VALUE usage
2006-12-28 17:46:32 +00:00
Frédéric Péters 0808887548 fixed all occurences of returning a negative number unspecified in errors.h 2006-12-27 23:50:15 +00:00