Commit Graph

350 Commits

Author SHA1 Message Date
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 83ce945c5f lasso_login_init_request(): change error code for invalid artifacts
* lasso/id-ff/login.c:
   if artifact is invalid return LASSO_PROFILE_ERROR_INVALID_ARTIFACT as
   in lasso_saml20_profile_init_artifact_resolve().
2009-04-27 08:19:22 +00:00
Benjamin Dauvergne aec28fdac6 Complete documentation of lasso_login_init_request
* lasso/id-ff/login.c:
   add precision on usage. add all possible return codes with meanings.
2009-04-27 08:19:20 +00:00
Benjamin Dauvergne c7ec6c1ed9 lasso_login_init_authn_request: complete doc
* lasso/id-ff/login.c:
   add all possible return codes and their meaning.
2009-04-27 08:19:18 +00:00
Benjamin Dauvergne 22e51935c7 lasso_login_init_authn_request: change error code for missing remote provider ID
* lasso/id-ff/login.c:
   change the return code for when no remote provider ID could be
   defined (because the argument is NULL and the server object contains
   no providers) so that we can distingish the case where the given
   provider is unknown or if there is no providers configured.
2009-04-27 08:19:17 +00:00
Benjamin Dauvergne a70c175015 Add a deprecated tag to lasso_login_destroy doc
* lasso/id-ff/login.c:
   all destroy functions are deprecated, g_object_unref() should be used
   instead.
2009-04-27 08:19:15 +00:00
Benjamin Dauvergne 0df4e13e7a Complete documentation of lasso_login_byuld_response_msg
* lasso/id-ff/login.c:
   add all possible return codes with meaning.
2009-04-27 08:19:13 +00:00
Benjamin Dauvergne 251dfa0d0b Complete documentation of lasso_login_build_request_msg
* lasso/id-ff/login.c:
   add all possible return codes with meaning.
2009-04-27 08:19:11 +00:00
Benjamin Dauvergne f12c2e7332 Complet documentation for lasso_login_build_authn_response_msg
* lasso/id-ff/login.c:
   add all possible return codes with meaning.
2009-04-27 08:19:09 +00:00
Benjamin Dauvergne 530e6ceac0 Complete documentation of lasso_login_build_authn_request
* lasso/id-ff/login.c:
   add all possible return codes with meaning.
2009-04-27 08:19:08 +00:00
Benjamin Dauvergne c56ba110ea Complete documentation for lasso_login_build_artifact_msg
* lasso/id-ff/login.c:
   add all possible return codes with meaning.
2009-04-27 08:19:06 +00:00
Benjamin Dauvergne 77495e50d3 Complet documentation of lasso_login_accept_sso
* lasso/id-ff/login.c:
   add all possible return codes.
2009-04-27 08:19:04 +00:00
Benjamin Dauvergne 6f79955dfb Complete doc for static function lasso_login_musk_ask_for_consent
* lasso/id-ff/login.c:
   precise return value meaning.
2009-04-27 08:19:02 +00:00
Benjamin Dauvergne df81b3438f Complete document of lasso_login_build_assertion
* lasso/id-ff/login.c:
   add possible return codes.
2009-04-27 08:19:00 +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 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 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 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 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 5e125fda5e ID-FF 1.2: rework lasso_login_process_status_and_assertion
* lasso/id-ff/login.c:
   reword lasso_login_process_status_and_assertion,
   remove wrong NameID decryption code (it cannot work),
   adapt to new signature of lasso_provider_verify_saml_signature,
2009-03-27 15:04:55 +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 94398d7edf ID-FF 1.2 & SAML 2.0: fix "fix bug 173" match assertion and not the response with authn request id
* lasso/id-ff/login.c:
 * lasso/saml-2.0/login.c:
   Serialize/Unserialize request_id private field in LassoLogin dumps.
   Match InResponseTo assertion attribute (ID-FF 1.2) or
   SubjectConfirmationData attribute (SAML 2.0) to original request id
   if it is present.
2009-03-03 20:52:45 +00:00
Benjamin Dauvergne 1cc04298df ID-FF 1.2 & SAML 2.0: Fix #173, check InReponseTo in authn responses
* id-ff/login.h:
   add a string field named request_id in the private part of LassoLogin
   to store request id from the original AuthnRequest.
 * id-ff/login.c:
   if request_id field is not null check the InResponseTo attribute of
   the samlp:Response.
 * saml-2.0/login.c:
   if request_id field is not null check the InResponseTo attribute of
   the samlp:Response.
2009-02-17 17:02:01 +00:00
Benjamin Dauvergne 936d01dbe4 ID-FF 1.2: fix leak of instance object 2009-01-24 09:34:09 +00:00
Benjamin Dauvergne b5d79960c7 ID-FF 1.2: validate signatures on responses during the BRWS/Artifact profile
- lasso/id-ff/login.c:
  - the lasso_login_process_response_msg is used to process SOAP response
    to artifact resolution requests. The answer contains an samlp:Response
    that can be signed, and each contained assertion MUST be individually
    signed.
- lasso/xml/samlp_response.c:
 - set keep_xmlnode flag on the class metadatas to help in signature
   validations.
2009-01-24 09:34:03 +00:00
Benjamin Dauvergne 90b40c874d ID-FF 1.2: add validation of assertion signatures
- lasso/id-ff/login.c:
  - lasso_login_process_response_status_and_assertion:
   - if signature_status is not 0 and an assertion is present, we
     validate the signature on this assertion using the
     internal API lasso_provider_verify_saml_signature.
2009-01-24 09:34:00 +00:00
Benjamin Dauvergne 89f1ae7e5b ID-FF 1.2: fix signature validation in login_process_authn_response_msg
* lasso/id-ff/login.c:
  when signature validation fails on a message, then return the
  signature status as return code. There is a security fix.
2009-01-24 09:33:57 +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
Damien Laniel d8f2c4f31e If ProviderID isn't found in an AuthnResponse, immediately return a critical error 2008-09-23 15:15:39 +00:00
Damien Laniel a18ddb94e0 fixed various bugs with new compilation flags 2008-09-16 16:31:05 +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 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 2b84680d33 * removed unused variables, and change FIXME comment. 2008-08-05 14:52:46 +00:00
Benjamin Dauvergne 228520ccf6 * remove code to add credentials, it is actually useless. 2008-08-05 14:52:41 +00:00
Benjamin Dauvergne 593a21e91b * lasso/id-ff/login.c: comment the generation of Advice when ResourceOffering for
the DiscoService support a security mechanism needing one. Anyway the
  generation of Credentials is broken.
* lasso/id-ff/session.c: add treatment of saml:Advice on newly added
  Assertions, keep the transmitted assertions inside the session indexed by their
  AssertionID.

* lasso/xml/saml_advice.{c,h}: change content to SNIPPET_LIST_XMLNODES.
2008-08-01 14:11:20 +00:00
Benjamin Dauvergne 76d9fce5d5 forked lasso branch for adeline 2008-08-01 14:08:54 +00:00
Frédéric Péters 29e87584e9 fixed ..._must_authenticate to look for any assertion, not just one from the
requester provider.
2008-07-22 12:07:18 +00:00
Damien Laniel 9d99fe7a9c set an accurate error code on IdP if session wasn't reloaded 2008-06-16 16:54:47 +00:00
Frédéric Péters 36919bdf64 check NameIdentifier for existence before strcmp'ing it 2008-06-05 15:46:42 +00:00
Frédéric Péters 4dacc4661d NameIdPolicy must be allocated 2008-05-30 10:31:09 +00:00
Damien Laniel a6ed1b1c11 added some more missing unreference 2008-05-21 17:28:44 +00:00
Damien Laniel a779166e31 removed warning when calling lasso_node_destroy with NULL argument 2008-05-21 09:45:20 +00:00
Damien Laniel eb2fbc8fc0 fixed some reference counting and memory management 2008-05-20 18:34:09 +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
Benjamin Dauvergne 02e13d5e89 fix indentation III the come back 2008-04-30 12:57:17 +00:00