Commit Graph

4130 Commits

Author SHA1 Message Date
Benjamin Dauvergne ac99ae6423 Update lasso version to 2.2.2
* configure.ac:
 * fedora/lasso.spec:
 * lasso.doap:
   update lasso version to 2.2.2, this commit will be the reference for
   the 2.2.2 release.
2009-03-27 16:44:17 +00:00
Benjamin Dauvergne e65ed18771 Makefile: change dependencies to pass distcheck
* lasso/Makefile.am:
   source dependencies must refer to $(srcdir) in order to pass
   distcheck, I forgot to do it in types.c and symbols.sym target
   changes.
2009-03-27 16:44:15 +00:00
Benjamin Dauvergne a46e6d8085 ID-FF 1.2: if logout request parsing fails, take a shortcut
* lasso/xml/lib_logout_request.c:
   immediately return from init_from_query if overloaded parent method
   fails.
2009-03-27 15:06:45 +00:00
Benjamin Dauvergne 280f5d0c72 SAML 2.0: Update generic relaystate handling
* lasso/saml-2.0/profile.c:
   in lasso_saml20_profile_build_redirect_request_msg and
   lasso_saml20_profile_build_redirect_response, use new function
   lasso_saml20_profile_build_http_redirect.
2009-03-27 15:06:44 +00:00
Benjamin Dauvergne b6ec9b4a09 Core: add a add-signature flag
* lasso/debug.h:
 * lasso/lasso.c:
   add a lasso_flag_add_signature flag variable (default to TRUE),
   and parsing code to change it from LASSO_FLAG environment variable.
   ("env LASSO_FLAG=no-add-signature test").
2009-03-27 15:06:43 +00:00
Benjamin Dauvergne 50c9870fe2 ID-FF 1.2: Only verify InResponseTo if strict checking is on
* lasso/id-ff/login.c:
   add condition upon checking of the InResponseTo field: checks only if
   strict checking is activated as it could stop old code using Lasso
   from working.
2009-03-27 15:06:41 +00:00
Benjamin Dauvergne cc4a7a56b5 Core: Add a flag for enabling more strict checking
* lasso/debug.h:
   declare lasso_flag_strict_checking global boolean variable.

 * lasso/lasso.c:
   add parsing for new option called 'strict-checking'.
2009-03-27 15:06:40 +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 4463c2ccc2 ID-FF 1.2: Add trace in dispose for LassoProfile
* lasso/id-ff/profile.c: add tracing code activaged by
   LASSO_FLAG=memory-debug to print release of field values.
   Complement the existing code in generic deallocation procedure in
   LassoNode.
2009-03-27 15:06:37 +00:00
Benjamin Dauvergne 040431ebaa Core: debug.h need export.h
* lasso/debug.h:
   export.h is needed for the LASSO_EXPORT macro.
2009-03-27 15:06:35 +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 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 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 70299b52ab Test: add missing release of objects and memory
* tests/basic_tests.c:
 * tests/login_tests.c:
 * tests/metadata_tests.c:
 * tests/random_tests.c:
 * tests/tests.c:
   add missing g_free and g_object_unref calls.
2009-03-27 15:06:25 +00:00
Benjamin Dauvergne 84e5c3b66b Bindings: skip DEPRECATED variables
* bindings/bindings.py: when parsing headers, skipped deprecated struct
   fields.
2009-03-27 15:06:24 +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 62de952ae9 Autoconf: Do not include optimisation flags in AM_CFLAGS
* configure.ac: when --enable-debugging set CFLAGS,
  do not modify AM_CFLAGS.
2009-03-27 15:06:19 +00:00
Benjamin Dauvergne d85f440885 ID-FF 1.2 Tests: Add test for relaystate
* tests/login_tests.c:
 - (test02_serviceProviderLogin) add assertion concerning the relaying
   of the RelayState parameter during an SP initiated SSO.
2009-03-27 15:06:18 +00:00
Benjamin Dauvergne 5268ee2928 ID-FF 1.2 Login: Use allocation macros
* lasso/id-ff/login.c: (lasso_login_init_authn_request) again a passing by
  correction, use lasso_assign_string for copying information from
  the request to the profile object.
2009-03-27 15:06:17 +00:00
Benjamin Dauvergne fbc86db17f ID-FF 1.2: Handle RelayState inside LassoLogin
* lasso/id-ff/login.c:
   - (lasso_login_init_request) catch RelayState in the query_fields and
     copy it to msg_relayState
   - (lasso_login_process_authn_request_msg) copy RelayState from the
     request object to the profile object.
2009-03-27 15:06:15 +00:00
Benjamin Dauvergne 93dc7ca545 XML ID-FF 1.2 & SAML 2.0: Handle signature failure
* lasso/xml/saml_assertion.c:
 * lasso/xml/samlp_response_abstract.c:
 * lasso/xml/samlp_request_abstract.c:
 * lasso/xml/saml-2.0/samlp2_request_abstract.c:
 * lasso/xml/saml-2.0/saml2_assertion.c:
 * lasso/xml/saml-2.0/samlp2_status_response.c:
   if a failure occur in the signing process, free the xmlnode, return
   NULL and print a warning.
2009-03-27 15:06:13 +00:00
Benjamin Dauvergne 4b8f9075ef XML SAML 2.0: Delete parent_class static variable
* lasso/xml/saml-2.0/samlp2_manage_name_id_request.c,
  lasso/xml/saml-2.0/samlp2_manage_name_id_response.c,
  lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c,
  lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c.
  lasso/xml/saml-2.0/samlp2_subject_query_abstract.c:
  - remove static variable parent_class
  - (class_init) remove intialization of parent_class
2009-03-27 15:06:12 +00:00
Benjamin Dauvergne 91d9d67812 XML SAML 2.0: Mark RelayState field from SAML 2.0 deprecated
* lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   - (instance_init) remove initialization of relayState field

 * lasso/xml/saml-2.0/samlp2_logout_response.c:
   - (instance_init) remove empty function, since it
     only initialized relayState.
   - (lasso_samlp2_logout_reponse_get_type) remove instance_init
     from the type initialization structure.

 * lasso/xml/saml-2.0/samlp2_authn_request.h,
   lasso/xml/saml-2.0/samlp2_logout_request.h,
   lasso/xml/saml-2.0/samlp2_logout_response.h:
   - (struct _LassoSamlp2*) mark relaystate field as deprecated.
2009-03-27 15:06:10 +00:00
Benjamin Dauvergne 1b550a8606 XML SAML 2.0: Clean query string parsing/building
* lasso/xml/saml-2.0/samlp2_status_response.c:
   - (init_from_query) remove useless stub code for parsing RelayState

 * lasso/xml/saml-2.0/samlp2_response.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c,
   lasso/xml/saml-2.0/samlp2_logout_response.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_response.c, :
   - (class_init) remove overloading of init_from_query, use version
     from samlp2_status_response instead.
   - (init_from_query) Useless so deleted.

 * lasso/xml/saml-2.0/samlp2_request_abstract.c:
   - (class_init) add overloaded method for init_from_query virtual
     method.
   - (init_from_query) generic implementation for SAML 2.0 requests

 * lasso/xml/saml-2.0/samlp2_subject_query_abstract.c,
   lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_request.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c,
   lasso/xml/saml-2.0/samlp2_assertion_id_request.c:
   - (class_init) remove overloading of init_from_query, use version
     from samlp2_request_abstract instead.
   - (init_from_query) Useless so deleted.
2009-03-27 15:06:08 +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 d71ff1dec3 ID-FF 1.2: Defederation, changes includes for relative paths
* lasso/id-ff/defederation.c: header path should be relative to the
   implementation, I will try to do it to most files.
2009-03-27 15:05:57 +00:00
Benjamin Dauvergne 6bc8f1a630 ID-FF 1.2: Defederatopm HTTP-Redirect binding, handle relaystate
* lasso/id-ff/defederation.c: get relaystate directly from the query
   string using lasso_get_relaystate_from_query.
2009-03-27 15:05:56 +00:00
Benjamin Dauvergne 88ce5a5669 SAML 2.0: In login change includes for relative paths
* lasso/id-ff/login.c: changes headers for relatives paths
2009-03-27 15:05:55 +00:00
Benjamin Dauvergne bd015db03b Core: Remove ending blanks from erros.c.in
* lasso/errors.c.in: errors.c template contains blanks at end of lines.
2009-03-27 15:05:53 +00:00
Benjamin Dauvergne 88eaabc94d SAML 2.0: add direct treatment of relaystate for HTTP-Redirect binding
* lasso/saml-2.0/login.c: In
  lasso_saml20_login_process_authn_request_msg change handling of
  relayState do not rely upon parsing by the node object, but extract
  directly from the query string. Use new function
  lasso_get_relaystate_from_query.
* lasso/saml-2.0/logout.c: In lasso_saml20_logout_process_request_msg
  change handling of relayState do not rely upon parsing by the node
  object, but extract directly from the query string.
* lasso/saml-2.0/profile.c: In
  lasso_saml20_profile_init_artifact_resolve, add handling of the
  relayState transmitted to the assertion consumer URL.
* lasso/saml-2.0/name_id_management.c: In
  lasso_name_id_management_process_request_msg change handling of
  relayState do not rely upon parsing by the node
  object, but extract directly from the query string.
2009-03-27 15:05:52 +00:00
Benjamin Dauvergne aad866ab67 SAML 2.0: simplify redirect binding code path
* lasso/saml-2.0/login.c, lasso/saml-2.0/logout.c,
   lasso/saml-2.0/name_id_management.c: simplify code path associated
   with generation of the url for the HTTP-Redirect binding using the
   rencently introduced function
   lasso_saml20_profile_build_http_redirect.
2009-03-27 15:05:50 +00:00
Benjamin Dauvergne 64f96e01dc SAML 2.0: remove TODO comment about RelayState
* lasso/xml/saml-2.0/samlp2_status_response.c: do it:)
2009-03-27 15:05:49 +00:00
Benjamin Dauvergne e43ce11311 XML SAML2: Remove unnecessary overloading of build_query in request/respons objects
* lasso/xml/saml-2.0/samlp2_assertion_id_request.c,
   lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   lasso/xml/saml-2.0/samlp2_logout_response.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_request.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_response.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c,
   lasso/xml/saml-2.0/samlp2_response.c,
   lasso/xml/saml-2.0/samlp2_subject_query_abstract.c: remove useless
   overloading of build_query virtual method, revert to implementations
   in LassoSamlp2RequestAbstract and LassoSamlp2StatusResponse.
2009-03-27 15:05:47 +00:00
Benjamin Dauvergne c3b0ca25b8 XML SAML 2.0: add a build query to request base class
* lasso/xml/saml-2.0/samlp2_request_abstract.c: add a build query
   overloaded function to LassoSamlp2RequestAbstract class, the base
   class of all saml 2.0 request nodes.
2009-03-27 15:05:45 +00:00
Benjamin Dauvergne f55ff8ea5e SAML 2.0: Add helper function to implement the HTTP-Redirect binding
* lasso/saml-2.0/profile.c, lasso/saml-2.0/profileprivate.h:
   - remove_all_signature traverse a tree of LassoNode objects to unset
     all signature_type field in on nodes supporting signature
     generation.
   - lasso_saml20_profile_export_to_query does the job of generateing
     the url containing the message content and the relaystate, then
     sign it using lasso_query_sign.
   - lasso_saml20_profile_build_http_redirect use those two functions
     and the metadatas to build the signed redirect url.
2009-03-27 15:05:44 +00:00
Benjamin Dauvergne 71ca7129a6 XML: Add const modifiers to lasso_concat_url_query arguments
* lasso/xml/private.h, lasso/xml/tools.c: add const modifier to
   lasso_concat_url_query arguments.
2009-03-27 15:05:42 +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 96594a8ede XML: Tool function to extract relaystate from query
* lasso/xml/tools.c, lasso/xml/private.h: new function
   lasso_get_relaystate_from_query to help in relaystate handling.
2009-03-27 15:05:39 +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
Benjamin Dauvergne 7696062fbd Core: Fix corner case in deallocation macros
* lasso/utils.h: When setting strings using lasso_assing_string or
   lasso_assign_new_string, verify that new string is different than the
   target value string before deallocating the target.
2009-03-27 15:05:34 +00:00
Benjamin Dauvergne e59c45e598 Add missing intializations
* initialize local variables.
2009-03-27 15:05:33 +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