Commit Graph

169 Commits

Author SHA1 Message Date
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 667f846085 [Core] fix leak of provider->private_data->endpoints 2010-09-17 17:02:41 +02:00
Benjamin Dauvergne 69f46ad974 [Core] fix leak of provider->private_data->endpoints 2010-09-17 17:02:40 +02:00
Benjamin Dauvergne 3f336a8e83 Merge branch 'develop' into hotfixes-2.3.1 2010-09-03 19:07:08 +02:00
Benjamin Dauvergne 9ab6b944f1 [Core] fix memory leak in lasso_endpoint_free 2010-09-03 19:05:27 +02:00
Benjamin Dauvergne aaca9ce992 [ID-FFv1.2&SAMLv2] add more warning for failure to load metadata file
Report detailf of the failure through warning log.
2010-09-03 19:02:42 +02:00
Benjamin Dauvergne 5c85507ffd [Core] add destroy code for new private field endpoints
The contained string must be disallocated if the object is destroyed.
2010-08-25 18:55:04 +02:00
Benjamin Dauvergne 7352ec8036 [Provider] Fix loading of provider without a public key
This commit also emit propre warning when loading fails for a provider
*with* a public key.
2010-07-05 21:27:08 +00:00
Benjamin Dauvergne 129e7ac6ea Merge branch 'issue-101' 2010-06-29 09:15:06 +00:00
Benjamin Dauvergne 4a55c53ee6 SAMLv2: fix error in naming of function in the documentation 2010-06-04 09:32:48 +00:00
Benjamin Dauvergne dc0da3d1b0 Provider: fix problem when reusing the same lists nodes in Descriptors 2010-04-22 01:12:32 +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 2f5ef5fef0 Improve safety by replacing all g_list_free use by lasso_release_list 2010-04-22 00:44:57 +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 05aad98ec3 Fix documentation problems 2010-04-19 11:30:35 +00:00
Benjamin Dauvergne 143e775942 ID-FF 1.2 & SAML 2.0: factorize access to role prefix 2010-04-06 13:11:36 +00:00
Benjamin Dauvergne c07cd3898c SAML 2.0&ID-FF 1.2: simplify and complete metadata loading for multi-role support 2010-03-27 16:52:04 +00:00
Benjamin Dauvergne f5442dc84b SAML 2.0: add support for attribute, authentication and authorization authorities metadata
* server.c,serverprivate.h: add new private method
   lasso_server_get_firs_providerID_by_role(server, role)w
 * defederation.c: use new private method
   lasso_server_get_first_providerID_by_role for find providerID
   when the argument remote_providerID is null in
   lasso_defederation_init_notification.
 * lasso/id-ff/login.c (lasso_login_init_authn_request): use new private
   method lasso_server_get_first_providerID_by_role.
 * provider.h: add thre new provider role (authn,pdp,attribute) and
    four new services (authn,assertionid,attribute,authz) and also
    a ROLE_ANY value (-1) for catchall purpose and a ROLE_LAST for
    array sizing.
 * provider.h: add a LAST member to LassoMdProtocolType enum.
  * providerprivate.h,provider.c:
   - removes separate hashtable for descriptors depending on provider role,
     use only one table named Descriptors.
   - use the LAST members of enumerations to dimention static string arrays.
  * provider.h: add a LAST member to the e
2010-03-27 16:51:43 +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 0119b91e56 Adapt LassoProvider methods to care for protocol profile version when verifying signature
* lasso/id-ff/provider.c:
   there is now 2 methods to verify signatures, methods calling the old
   one must now choose whether to call the liberty one of the SAML 2.0
   one.
2010-02-10 00:33:49 +00:00
Benjamin Dauvergne 8e1398e65c Core: in provider.c, make lasso_provider_load_metadata_from_buffer the main metadata loading function
* (init_from_xml) fail initialization if we cannot load the metadatas,
   and log a warning.
 * extract _lasso_provider_load_metadata_from_buffer from
   lasso_provider_load_metadata_from_buffer, which accept a length
   parameter. use it inside lasso_provider_load_metadata, instead of
   xmlParseFile.
 * (lasso_provider_load_public_key) use lasso_xmlsec_load_key_info and
   lasso_xmlsec_load_private_key to load the public keys.
2010-02-04 00:02:22 +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 7aa18e07b1 Fix leaks, change signature of lasso_provider_get_sp_name_qualifier, make it return a const char* 2010-02-04 00:02:05 +00:00
Benjamin Dauvergne fa9566aa59 Core: fix gtk-doc annotations 2010-01-28 15:31:43 +00:00
Benjamin Dauvergne b30498aec6 ID-FF&SAML2: if use is not defined on a key descriptor use the key for any use
* lasso/id-ff/provider.c lasso/saml-2.0/provider.c: if the "use"
   attribute is not set on a KeyDescriptor, use the key for signing and
   encryption.
2010-01-14 16:18:24 +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 1dece2447d Core: in provider.c, add lasso_provider_verify_single_node_signature
* lasso/id-ff/provider.c lasso/id-ff/provider.h:
   add a new function to check an enclosed single signature on a
   LassoNode, given that the LassoNode retained its original xml node
   content.
2010-01-04 09:14:25 +00:00
Benjamin Dauvergne e76546078f Core: in provider.c, add accessors for encryption informations
* lasso/id-ff/provider.c:
   add getters for encryption_sym_key_type and encryption_public_key.
 * lasso/id-ff/providerprivate.h:
   declare new accessors.
2010-01-04 09:14:01 +00:00
Benjamin Dauvergne 3c9e4965dd Core: factorize code to obtain a SPNameQualifier
* lasso/id-ff/provider.c lasso/id-ff/provider.h:
   add a method giving the SPNameQualifier for a provider (its entity id
   or its affiliation id).

 * lasso/id-ff/profile.c:
 * lasso/saml-2.0/login.c:
   update use sites.
2009-10-30 14:47:36 +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 00ea5d7113 Core: Add const modifiers to LassoProvider methods
* lasso/id-ff/provider.c lasso/id-ff/provider.h
   lasso/saml-2.0/provider.c lasso/saml-2.0/provider.h:
   add const modifier where they could be added.
2009-09-29 13:20:38 +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 af7feb4670 Add method to Provider to retrieve default NameIDFormat
* lasso/id-ff/provider.c lasso/id-ff/provider.h:
   add lasso_provider_get_default_name_id_format, which returns the firs
   listed NameIDFormat from the SAML 2.0 metadatas of the provider.
2009-09-29 13:20:31 +00:00
Benjamin Dauvergne 77a1233080 Fix bugs found via coverity (thanks to Bhaskar Jain)
* lasso/id-wsf-2.0/data_service.c: fix uninitialized res variable in
   lasso_idwsf2_data_service_process_query_response_soap_fault_msg.
 * lasso/xml/saml-2.0/saml2_assertion.c: fix uninitialized rc variable
   in get_xmlNode.
 * lasso/saml-2.0/login.c:
   in lasso_saml20_login_accept_sso check for ni and ni->Format
   null-ness before dereferencing, remove idp_ni which is not used
   anymore.
   remote all use of federation->remote_nameIdentifier, SAML 2.0 only
   need one NameID, and it will be local_nameIdentifier.
 * lasso/xml/xml.c:
   in lasso_node_traversal, check null-ness of node before dereferencing
   it, add check for class null-ness also.
 * lasso/id-ff/provider.c:
   in lasso_provider_get_first_http_method, remove useless check for t2
   null-ness -- if found is TRUE, t1 and t2 cannot be null.
 * lasso/xml/tools.c:
   in lasso_sign_node, add documentation, check for private_key_file and
   xmlnode null-ness.
   in lasso_get_public_key_from_private_key_file, add a cleanup phase,
   check for cert variabl null-ness befor appending, count the number of
   certificates added.
   in lasso_query_verify_signature, check that URL unescaping and base64
   decoding are succesfull before using the decoded strings.
 * lasso/saml-2.0/name_id_management.c:
   in lasso_name_id_management_validate_request, fix mis-handling of
   federation, if federation does not match request name_id, return
   UNKNOWN_PRINCIPAL.
2009-09-17 15:05:50 +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 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 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 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 3caee2835d ID-FF 1.2: fix some real and potential memory leaks
* lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
   use macros to release previous value when necessary,
   release object used as parameters to constructors,
   free the encryption key associated with a provider,
   release the key manager created for a saml signature
   verification.
2009-03-27 15:06:27 +00:00
Benjamin Dauvergne e59c45e598 Add missing intializations
* initialize local variables.
2009-03-27 15:05:33 +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 a475d9eb00 Core: add new internal API lasso_provider_verify_query_signature
* lasso/id-ff/provider.c:
   try to keep some homgeneity between lasso_verify_signature and
   lasso_verify_query_signature functions, by having mirror methods
   inside the LassoProvider class. this new methods comes with complete
   documentation.
 * lasso/xml/tools.c:
   add a xmlDoc argument to lasso_verify_signature, in order to
   reuse an already built message context, and possible problems with
   interned string in parsed xml documents.
2009-03-27 15:05:00 +00:00
Benjamin Dauvergne 3b2f3fbced Core: add xmlDoc parameter to lasso_provider_verify_saml_signature
* lasso/id-ff/provider.c:
   add an xmlDoc parameter to lasso_provider_verify_saml_signature,
   reflecting change in lasso_verify_signature.
   fix memory leaks of an xmlSecKeysMngr.
   complete arguments checking.
 * lasso/id-ff/login.c:
   update use of lasso_provider_verify_signature in LassoLogin
2009-03-27 15:04:58 +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
Damien Laniel 5aafc13002 documentation-related fixes 2009-01-26 16:42:19 +00:00
Benjamin Dauvergne fdc8c66a98 XML: new LassoProvider API to verify XMLDsig signatures
* lasso/id-ff/provider.c, lasso/id-ff/providerprivate.h:
  - (lasso_provider_verify_saml_signature) validate a signed
    saml Request, Response or Assertion, using the public key
    of the given provider.
2009-01-24 09:33:55 +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 d01eec1b57 Add missing intialization
- lasso/id-ff/provider.c,lasso/id-ff/server.c: add missing initialization
   of return code variable.
2008-11-05 23:38:26 +00:00
Benjamin Dauvergne aff32ad997 Add log message in the metadata loading process
- lasso/id-ff/provider.c, lasso/saml-2.0/provider.c: add critical log
   message in each failed loading of metadatas branch cases.
2008-11-05 11:23:29 +00:00
Benjamin Dauvergne a30f9f6b9e Fix uninitialized return code
Thanks Emmanuel Dreyfus
2008-11-05 11:23:26 +00:00