Commit Graph

53 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 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 1ffece0e57 [SAMLv2] fix memleak of request in lasso_name_id_management_process_request_msg 2010-09-17 18:01:31 +02:00
Benjamin Dauvergne 280ee28202 [SAMLv2 NID management] report signature error in response, do not check response signature if forbidden
- build_response_msg will report signature error in response status
   code when called without an initialized response (without a call to
   validate_request)
 - process_response_msg now use
   lasso_saml20_profile_check_signature_status to check the signature
   status only if permitted.
2010-09-10 15:37:41 +02:00
Benjamin Dauvergne 51d5d4d3e3 [SAMLv2] apply the LassoProfileVerifySignatureHint when processing requests
The check was missing for processing of logout requests, name id
management request and assertion query responses.

A new internal function lasso_saml20_profile_check_signature_status is
added.
2010-09-09 16:20:17 +02:00
Benjamin Dauvergne 560e43046c SAML 2.0: in name_id_management.c, rework lasso_name_id_management_new_from_dump 2010-02-04 00:02:17 +00:00
Benjamin Dauvergne 92efc271a4 SAML 2.0: fix annotations, documentation and signatures 2010-01-29 00:43:50 +00:00
Benjamin Dauvergne 436c8cb232 in saml-2.0/name_id_management.c: handle NewEncryptedID, only encrypt if needed 2010-01-12 15:40:18 +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 f6e1260e2e Fix bad macro choice, precise error for bad formatted NIDM request
* saml-2.0/name_id_management.c:
   use specialized lasso_saml20_profile_set_response_status
   set 'MissingNameID' second level error with requester first level
   error code when request is missing a name id.
2009-10-30 14:55:38 +00:00
Benjamin Dauvergne 2b24cd50e2 SAML2: change lasso_saml20_profile_set_response_status signature
* lasso/saml-2.0/profile.c:
 * lasso/saml-2.0/profileprivate.h:
   make lasso_saml20_profile_set_response_status2 the new implementation
   of lasso_saml20_profile_set_response_status.
   add helper macros to set success, responder and requester first level
   status code.
 * saml-2.0/assertion_query.c:
 * saml-2.0/login.c:
 * saml-2.0/logout.c:
 * saml-2.0/name_id_management.c:
   adapt consumers to the new signature.
2009-10-30 14:47:30 +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 c5f5f84329 SAML 2.0: Fix many leaks
* lasso/saml-2.0/login.c:
 * lasso/saml-2.0/logout.c:
 * lasso/saml-2.0/name_id_management.c:
 * lasso/saml-2.0/profile.c:
 * lasso/saml-2.0/provider.c:
   do not mix g_malloc strings with libxml strings, use the
   string/gobject handling macros as much as possible, be a good memory
   citizen, don't put your elbows on the table.
2009-04-30 14:58:11 +00:00
Benjamin Dauvergne 2a75e87543 More work on signature validation for SAML 2.0
* lasso/saml-2.0/profile.c:
   in lasso_saml20_profile_process_any_request and
   lasso_saml20_profile_process_any_response do not make signature
   validation failure as call failure, just store the result in
   profile->signature_status and let the upper level functions handle
   what to do with it. also add documentation about those two functions.

 * lasso/saml-2.0/logout.c:
 * lasso/saml-2.0/name_id_management.c:
   handle new signature_status semantic.

 * lasso/saml-2.0/login.c:
   add internal documentation for
   lasso_saml20_login_process_authn_response_msg.
2009-04-27 15:48:53 +00:00
Benjamin Dauvergne 580239d233 Core: move parse xml wrapper from xml.c to tools.c
* lasso/xml/xml.c:
   remove lasso_xml_parse_memory.
 * lasso/xml/tools.c:
   add lasso_xml_parse_memory to wrap xmlParseDocument.
 * lasso/saml-2.0/name_id_management.c:
   use lasso_xml_parse_memory
2009-03-27 15:05:19 +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 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 8e47e763fb SAML 2.0: Fix #90, simplify NameID decryption for NameIdManagement
* lasso/saml-2.0/name_id_management.c:
   (lasso_saml2_name_id_management_process_request)
   simplify code, remove explicit decryption of nameid and handling of
   error cases, delegate to lasso_decrypt_nameid (from xml/tools.c).
2009-03-09 14:05:33 +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
Damien Laniel 9ee9e2b6fd check in lasso_name_id_management_init_request if HTTP method is supported 2008-12-16 16:40:33 +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
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
Frédéric Péters f728465716 forbit query strings to be xml signed 2008-05-29 14:14:48 +00:00
Damien Laniel a6ed1b1c11 added some more missing unreference 2008-05-21 17:28:44 +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 4f18e67789 * lasso_name_id_management_process_requet: verify that request_msg is not null. 2008-03-03 17:59:03 +00:00
Frédéric Péters eca6a8814e only get session when remote provider id is not provided 2008-03-03 16:26:54 +00:00
Benjamin Dauvergne 1d182718f4 * fix syntax error introduced in r3494 :) Bad benjamin commit before compiling. 2008-02-29 17:19:45 +00:00
Benjamin Dauvergne 3823298a1a * name_id_management.c: (lasso_name_id_management_init_request)get the
first providerId when remote_provider_id is NULL, free old remote_provider_id
 string when non null and unref old name_identifier when non null. Fix 
 memory leaks and lacking usual feature of init_request functions.
2008-02-29 17:13:06 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters 3e34ddd259 add profileprivate.h header for lasso_profile_clean_info function declaration 2007-04-14 16:32:06 +00:00
Frédéric Péters 05212816bd fixed docstring parameter name 2007-01-08 13:36:00 +00:00
Frédéric Péters ad3e57fa1d added documentation about SAMLv2 Name Id Management profile; and by the same
time updated all tmpl/ files with a newer gtk-doc
2007-01-08 13:11:11 +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 1e77c84d5d extra checking for wrong or NULL parameters 2006-12-28 17:32:40 +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
Frédéric Péters cdd45908f5 new LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS error code 2006-12-27 16:19:39 +00:00
Frédéric Péters 1b0f96f6c7 fixed a few (harmless) warnings detected when compiling with -Wall
-Wmissing-declarations -Wdeclaration-after-statement
2006-12-21 00:03:08 +00:00
Frédéric Péters 4e69543847 use Location when ResponseLocation is not available 2006-12-07 13:33:00 +00:00
Frédéric Péters 2bdab69dfc minimal support for EncryptedID in federation termiation 2006-12-07 13:27:18 +00:00
Frédéric Péters 011bc44569 random fixage of warning displayed with -Wall 2006-11-14 17:07:31 +00:00
Frédéric Péters aec4544976 fixed url/query construction for endpoints with query part (zxid) 2006-11-07 12:44:32 +00:00
Frédéric Péters 76e8b09760 fixed dump/restore from dump for name id management profile 2006-11-07 10:03:43 +00:00
Frédéric Péters 44f853656c implementation of lasso_name_id_management_process_response_msg 2006-11-05 19:43:11 +00:00
Frédéric Péters 22554ade71 empty _process_response_msg 2006-11-04 16:18:12 +00:00
Frédéric Péters 43c016772b dump handling 2006-11-04 16:12:29 +00:00