Commit Graph

165 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 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 22feecaffb SAML 2.0 NameIDManagement: use new generic methods
* lasso/saml-2.0/name_id_management.c:
   use new generic methods in lasso_name_id_management_init_request,
   lasso_name_id_management_build_request_msg,
   lasso_name_id_management_process_request_msg,
   lasso_name_id_management_validate_request,
   lasso_name_id_management_build_response_msg,
   lasso_name_id_management_process_response_msg.
   Remove useless boilerplate code.

 * lasso/id-ff/server.c:
 * lasso/id-ff/serverprivate.h:
   last user of lasso_server_nameid_decrypt removed, so remove the code.
2009-03-27 15:05:17 +00:00
Benjamin Dauvergne 141c4a382e Core: add argument checking to lasso_server_get_provider
* lasso/id-ff/server.c:
   In lasso_server_get_provider, return NULL if provider server is not
   one, provider is null or 0-length.
2009-03-27 15:05:02 +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 95d27816ee Core: add a method to decrypt nameid, handling error cases
* lasso/id-dff/serverprivate.h:
 * lasso/id-ff/server.c:
   lasso_server_decrypt_nameid handle error case of NameID decryption,
   and update passed field pointers.
 * lasso/errors.h:
   add new error codes:
   LASSO_DS_ERROR_DECRYPTION_FAILED -118
    -  Decryption of an encrypted node failed
   LASSO_PROFILE_ERROR_MISSING_SERVER -438
    - No server object set in the profile
2009-03-09 14:05:31 +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 7103e81888 Change style of error and dellocation handling
- lasso/id-ff/provider.c:
   - in lasso_provider_verify_signature use standardised memory and
     error handling macros, and also standard return code variable name
     and exit label.
   - in lasso_providerl_load_metadata_from_buffer and
     lasso_provider_load_metadata use the standardised macros, exit
     labels and return code variable.
 - lasso/id-ff/server.c:
   - in lasso_server_load_affiliation use standardised allocation and
     error handling macros.
 - lasso/id-wsf/wsf_profile.c:
   - use standardised memory and error handling macros in
     lasso_wsf_profile_build_soap_request_msg.
2008-11-04 01:58:53 +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 5f163bbffd Add new constructor lasso_server_new_from_buffers
* lasso/id-ff/server.c, lasso/id-ff/server.h: add new function to build
   a LassoServer object holding content of certificate and private key
   files intead of loading them everytime signing is needed. You must
   instead load them yourself the first time.
2008-11-02 11:49:56 +00:00
Damien Laniel 6b9a265102 fixed docstrings which fucked php5 binding 2008-09-17 08:32:01 +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 500480afbf Add public function lasso_server_add_provider_from_buffer, to add a provider
from an XML string of the metadatas (changed semantic of the second argument
compared to lasso_server_add_provider). To support this a new public
LassoProvider constructor was added: lasso_provider_new_from_buffer, where the
second argument is an XML string. It uses a new private function,
lasso_provider_load_metadata_from_buffer.
2008-08-26 12:48:58 +00:00
Benjamin Dauvergne 1a9b5ef5c9 Add documentation to lasso_server_add_service_from_dump. 2008-08-26 12:48:56 +00:00
Benjamin Dauvergne aca239da7a Complete documentation of lasso_server_add_service. 2008-08-26 12:48:54 +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 76d9fce5d5 forked lasso branch for adeline 2008-08-01 14:08:54 +00:00
Damien Laniel bfb243f398 unreference service node after adding it to the server 2008-05-21 12:35:54 +00:00
Damien Laniel 01b3ce4f23 make return value const instead of copying the list 2008-05-21 09:58:18 +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 ac0dcdda5e * reflect in the documentation of lasso_server_new the fact that metadata is optional 2008-02-21 10:21:34 +00:00
Frédéric Péters 3fc428016f added a wrapper around xmlParseMemory to avoid network and DTD 2007-08-12 22:19:32 +00:00
Frédéric Péters 6204c8be9c adds all classes from ID-WSF 2 required schemas; with appropriate changes to
other files.
2007-07-10 08:50:56 +00:00
Damien Laniel dfd2488742 if a user hasn't been associated to a discovery metadata, give him a default disco epr 2007-06-08 10:16:04 +00:00
Damien Laniel 71711d1862 added lasso_idwsf2_discovery_metadata_register_self and lasso_idwsf2_data_service_get_personal_profile_email 2007-06-08 09:14:37 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Damien Laniel de142fe27f replaced svcMDs with svcMDIDs in identity and moved EPRs from identity to session 2007-05-08 23:29:00 +00:00
Damien Laniel a21063c483 fixed gcc warning 2007-04-25 14:17:18 +00:00
Frédéric Péters dc0ebd749e new server.addServiceFromDump method, and extended addService to work for both
id-wsf 1 and 2; also necessary to add quick hack in new_from_xmlnode to map
SvcMD to SvcMetadata.
2007-04-25 12:51:55 +00:00
Damien Laniel 10c8fcb306 fill profile->request in init_metadata_register + added soap_endpoint parameter 2007-04-25 09:37:30 +00:00
Damien Laniel 5c99d2ea80 implemented discovery query 2007-04-24 15:25:08 +00:00
Damien Laniel 39a063b1db fixed gcc warnings 2007-04-19 12:40:19 +00:00
Damien Laniel 383c2e2983 minor fixes 2007-04-19 08:18:53 +00:00
Damien Laniel 27fa0a5739 completed metatada_register and metadata_association_add 2007-04-18 16:54:56 +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 4016a87eac added loading of affiliation metadata (not yet acted upon) 2006-11-19 20:07:46 +00:00
Frédéric Péters ef4f859812 const'ified some char* 2006-11-19 19:08:51 +00:00
Frédéric Péters 1729459a2f s/file_name/filename/ 2006-11-19 19:01:50 +00:00
Damien Laniel 8a331ac747 Decryption of EncryptedID in Assertion 2006-11-15 18:56:34 +00:00
Damien Laniel 1b9ca80cec properly initialise encryption_private_key 2006-11-09 16:44:05 +00:00
Damien Laniel b22f5b9b5e Use xmlSecKeyDestroy to free the key in lasso_server_set_encryption_private_key 2006-11-09 15:07:11 +00:00
Damien Laniel 40a577ac46 Fix a possible memory leak in lasso_server_set_encryption_private_key and add a comment 2006-11-09 14:39:39 +00:00
Damien Laniel 59c70367cb changed prototype for lasso_server_set_encryption_private_key and added error handling 2006-11-09 13:49:49 +00:00