Commit Graph

4377 Commits

Author SHA1 Message Date
Benjamin Dauvergne d1ada7b833 Tests: add idwsf2_tests.c, call from tests.c, update Makefile.am 2010-01-04 09:15:32 +00:00
Benjamin Dauvergne bfb8483823 ID-WSF 2.0: in profile.{c,h}, discovery.{c,h}, data_service.{c,h}, overhaul all profiles.
* lasso/id-wsf-2.0/profile.c lasso/id-wsf-2.0/profile.h:
   - lasso_idwsf2_profile_get_name_identifier returns the NameID found
     in an assertion used as a WS-Security token when security mechanism
     Bearer or SAML are used.
   - complete the function lasso_id_wsf2_profile_build_soap_envelope
     with construction of the Sender element which is used to transmit
     the providerID of the message sender by the SOAP binding ID-WSF 2.0
     specification.
   - remove useless instance_init function in profile object
   - reset some profile fields in process_soap_request_msg (response,
     body, nameIdentifier).  use
     lasso_saml20_profile_name_identifier_decryption for handling NameID
     from WS-Security mechanism assertion.
   - add private_data
   - change signature of lasso_idwsf2_profile_init_soap_request to use
     and EPR and a security mechanism specifier when building the SOAP
     request.
   - change signature of lasso_idwsf2_profile_process_soap_request to
     verify security_mech_id of received messages.
 * docs/reference/lasso/lasso-sections.txt:
   add the function to the documentation.

 * lasso/id-wsf-2.0/discovery.{c,h}:
   - use utils.h macros instead of g_return_val_if_fail because it
     removes useless warning, since it returns an error code.  release
     acquired resources.
   - in lasso_idwsf2_discovery_metadata_register_self, return error code
     instead of identifier string for the new service, use an out
     parmeter to return the identifier, use utils.h macros.
   - in lasso_idwsf2_discovery_init_metadata_register, use utils.h
     macros, check return code of lasso_idwsf2_profile_init_soap_request.
   - change signature of lasso_idwsf2_discovery_init_metadata_register
     to support security_mech_id, try to get URL from an existing
     Discovery service EPR (from Session object).
   - change signature of
       lasso_idwsf2_discovery_process_metadata_register_msg,
       lasso_idwsf2_discovery_init_metadata_association_add,
       lasso_idwsf2_discovery_process_metadata_association_add_msg,
       lasso_idwsf2_discovery_init_query,
       lasso_idwsf2_discovery_process_query_msg, to support security
       mechanism.
   - improve lasso_idwsf2_discovery_build_query_response_eprs.
   - add lasso_idwsf2_discovery_get_nth_data_service to acces returned
     services.
 * lasso/id-wsf-2.0/data_service.{c,h}:
   - redo all the API
2010-01-04 09:15:24 +00:00
Benjamin Dauvergne 277fc83eb1 ID-WSF 2.0: in session.c, fix memory handling errors 2010-01-04 09:15:22 +00:00
Benjamin Dauvergne 29558f6a6a ID-WSF 2.0&ID-WSF: in profile.c, wsf_profile.c, errors.c, errors.h, and in lasso-sections.txt change LASSO_SOAP_FAULT_REDIRECT_REQUEST to LASSO_SOAP_ERROR_REDIRECT_REQUEST_FAULT 2010-01-04 09:15:20 +00:00
Benjamin Dauvergne bf084c5eb8 ID-WSF 2.0 Errors: in errors.{c,h}, add new errors code for ID-WSF 2.0
- add LASSO_DST_ERROR_EMPTY_REQUEST
 - add LASSO_WSF_PROFILE_ERROR_SECURITY_MECHANISM_CHECK_FAILED
 - add new errors codes for generic profiles and disco service
2010-01-04 09:15:17 +00:00
Benjamin Dauvergne 9df401c187 ID-WSF 2.0 XML: in strings.h, add identifiers from ID-WSF 2.0
standards

 - add status code for ID-WSF 2.0 DST
 - add token usage identifiers
 - conform security mechanism identifiers to ID-WSF 2.0 Liberty Sech
   Mech specification
 - add Discovery Service status codes
 - add Soap Binding status codes
 - add disco result type and user interaction hint strings
2010-01-04 09:15:14 +00:00
Benjamin Dauvergne a0fd0318dc ID-WSF 2.0 XML: in sec_token.c, remove extra SNIPPET_ANY 2010-01-04 09:15:11 +00:00
Benjamin Dauvergne f4aefd71f8 ID-WSF 2.0 XML: in util_response.{c,h}, add helper functions to idwsf2_util_status 2010-01-04 09:15:09 +00:00
Benjamin Dauvergne 72ba41fa7f ID-WSF 2.0: in server.c, change annotation of lasso_server_get_svc_metadatas_with_id_and_type. 2010-01-04 09:15:06 +00:00
Benjamin Dauvergne 65ab09249a ID-WSF 2.0: in saml2_login.c, change API
* lasso/id-wsf-2.0/saml2_login.c:
   - change private lasso_saml20_login_assertion_add_discovery to public
     lasso_login_idwsf2_add_discovery_bootstrap_epr.
   - remove lasso_saml20_login_copy_assertion_epr, add
     lasso_login_idwsf2_get_discovery_bootstrap_epr.
 * docs/reference/lasso/lasso-docs.sgml:
   - add sections id_wsf_2_0_login
 * docs/reference/lasso/lasso-sections.txt:
   - add new functions to section id_wsf_2_0_login
2010-01-04 09:15:03 +00:00
Benjamin Dauvergne b6ef732df3 ID-WSF 2.0: in idwsf2_helper.c, add new functions, fix old things
- add lasso_wsa_endpoint_reference_get_service,
   lasso_wsa_endpoint_reference_associate_service_type_uri,
2010-01-04 09:15:00 +00:00
Benjamin Dauvergne 4befad2b6e ID-WSF 2.0: create idwsf2_helper.{c,h}, new module for manipulating EPR elements
* lasso/id-wsf-2.0/idwsf2_helper.c lasso/id-wsf-2.0/idwsf2_helper.h:
   add new functions
   lasso_wsa_endpoint_reference_get_idwsf2_service_type,
   lasso_wsa_endpoint_reference_get_idwsf2_provider_id,
   lasso_wsa_endpoint_reference_get_idwsf2_security_context_for_security_mechanism,
   lasso_wsa_endpoint_reference_get_token_by_usage,
   lasso_wsa_endpoint_reference_get_security_token,lasso_wsa_endpoint_reference_get_target_identity_token,
   lasso_wsa_endpoint_reference_new_for_idwsf2_service,
   and lasso_wsa_endpoint_reference_add_security_token.
 * lasso/id-wsf-2.0/idwsf2_helper.h:
   declare new functions.
 * lasso/id-wsf-2.0/Makefile.am:
   add new files to source list
2010-01-04 09:14:58 +00:00
Benjamin Dauvergne 3f1f5efbb3 ID-WSF 2.0: in soap_binding.{c,h}, add new functions 2010-01-04 09:14:56 +00:00
Benjamin Dauvergne e674814189 ID-WSF 2.0: add files soap_binding.c, soap_binding.h
* lasso/id-wsf-2.0/Makefile.am
   - reference new source files in Makefile.am
 * lasso/id-wsf-2.0/soap_binding.c
 * lasso/id-wsf-2.0/soap_binding.h:
   - add extraction functions lasso_soap_envelope_sb2_get_provider_id,
     lasso_soap_envelope_sb2_get_redirect_request_url,
     lasso_soap_envelope_sb2_get_target_identity_header,
   lasso_soap_envelope_add_action and lasso_soap_envelope_get_action.
   - add SOAP security headers accessors
   - add lasso_soap_envelope_get_saml2_security_token which simplify
     retrieving a SAML 2.0 assertion used as a WS-Security token.
     complete documentation of other functions.
 * docs/reference/lasso/lasso-sections.txt:
   - reference the new functions in a new section soap_binding2
 * docs/reference/lasso/lasso-docs.sgml:
   - add new section soap_binding2

ID-WSF 2.0: in soap_binding.{c,h}: add function
2010-01-04 09:14:54 +00:00
Benjamin Dauvergne 78dd2ec1f8 ID-WSF: in id_ff_extensions.c, add SECTION gtk-doc declaration 2010-01-04 09:14:52 +00:00
Benjamin Dauvergne 19789377cc ID-WSF: in interaction_profile_service.{c,h}, make initialization of a redirect request, part of LassoWsfProfile methods. 2010-01-04 09:14:50 +00:00
Benjamin Dauvergne 1c8c8a4688 ID-WSF: in discovery.c:lasso_discovery_init_resource_offering, add doc annotations, use assignment macros to set output argument 2010-01-04 09:14:48 +00:00
Benjamin Dauvergne 02a2b92f92 ID-WSF: in discovery.c, update documentation annotations
* lasso/id-wsf/discovery.c:
   - add annotations to lasso_discovery_init_query,
     lasso_discovery_init_modify, lasso_discovery_process_request_msg.
   - initialize response in lasso_discovery_process_query_mesg and
     lasso_discovery_process_modify_msg, so that modifications of the
     response can be done between _process_ and _build_ calls.
2010-01-04 09:14:46 +00:00
Benjamin Dauvergne 6dd383a051 ID-WSF: in data_service.c:lasso_data_service_init_query check absent resource offering, support security_mech_id argument
* lasso/id-wsf/data_service.c lasso/id-wsf/data_service.h:
   - in lasso_data_service_apply_modifications, dst_modification
     initialization is missing.
   - remove lasso_data_service_get_redirect_request_url
   - change LASSO_DATA_SERVICE_CANNOT_ADD_ITEM to
     LASSO_DATA_SERVICE_ERROR_CANNOT_ADD_ITEM
   - in lasso_data_service_init_query, complete documentation, fix mem
     leak
   - factorize code between lasso_data_service_build_modify_response_msg
     and lasso_data_service_build_query_response_msg, create
     lasso_data_service_build_response_msg
   - in lasso_data_service_get_answer, add out annotation to output
     parameter
   - simplify API, simplify code path for query and modification
     processing
   - add lasso_data_service_process_request_msg,
     lasso_data_service_build_modify_response_msg,
     lasso_data_service_validate_request.
   - remove lasso_data_service_process_query_msg and
     lasso_data_service_process_modify_msg from public API.
   - in lasso_data_service_process_query_msg and
     lasso_data_service_process_modify_msg add arg checks, make them
     static and move preprocessing of the request in
     lasso_data_service_process_request_msg.
   - in lasso_data_service_get_answer, fix request/response mismatch.
   - add accessors lasso_data_service_set_resource_data and
     lasso_data_service_get_resource_data.
   - add securit_mech_id arg to data_service_init_modify, export
     resource_data accessor methods
   - remove lasso_data_service_get_redirect_request_url
   - fix missing intializations and leaks
2010-01-04 09:14:43 +00:00
Benjamin Dauvergne e2aa7b401f ID-WSF: in wsf_profile.c, fix mem leaks 2010-01-04 09:14:41 +00:00
Benjamin Dauvergne 5aebf79127 ID-WSF XML: in dst_modification.c, add SNIPPET_BOOLEAN to overrideAllowed attribute snippet 2010-01-04 09:14:40 +00:00
Benjamin Dauvergne dee4de1858 ID-WSF XML: in dst_modify.{c,h}, remove extra argument to the constructor of LassoDstModify
* lasso/xml/dst_modify.c:
 * lasso/xml/dst_modify.h:
   remove parameters of the default constructor.
2010-01-04 09:14:38 +00:00
Benjamin Dauvergne 27af878c2b Tests: in tests/login_tests.c, change path of header utils.h 2010-01-04 09:14:36 +00:00
Benjamin Dauvergne 6d9cb01e01 Tests: in basic_tests.c, fix, do not overwrite known elements mappings
* tests/basic_tests.c:
   when testing functionality of lasso registries which map namespace
   elements to lasso objects, do not use liberty namespace because it
   interacts with other tests -- deserialization of lib:Assertion node
   was broken by this test -- when running them in CK_FORK=no mode.
   Changed namespace LASSO_LIB_HREF, for "coin" which is less dangerous.
2010-01-04 09:14:35 +00:00
Benjamin Dauvergne c8be196a5a WS XML: change signature of lasso_wsa_attributed_uri_new_with_string, add mappings
* wsa_attributed_uri.c:
   - constify first argument of
     lasso_wsa_attributed_uri_new_with_string.
   - add add direct mappings from wsa:Action,wsa:To to
     LassoWsAddrAttributedURI and from wsa:From,wsa:ReplyTo,wsa:FaultTo
     to LassoWsAddrEndpointReference
2010-01-04 09:14:33 +00:00
Benjamin Dauvergne 2725070917 SAML 2.0: in login.c, use lasso_server_saml2_assertion_setup_signature 2010-01-04 09:14:31 +00:00
Benjamin Dauvergne 4497b166bf XML: in private.h, remove duplicate declaration of lasso_xml_parse_memory 2010-01-04 09:14:29 +00:00
Benjamin Dauvergne 1ab3876d3e ID-FF XML: in lib_assertion.c, add registry mapping for lib:AssertionType
* xml/lib_assertion.c:
   this object is really a container for lib:AssertionType, so register
   it.
2010-01-04 09:14:27 +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 689aa794b7 SAML 2.0: in login.c, fix memleaks
* lasso/saml-2.0/login.c:
   return value from lasso_provider_get_sp_name_qualifier must be freed.
2010-01-04 09:14:24 +00:00
Benjamin Dauvergne 8246e5d438 SAML 2.0: in login.c, remove discovery bootstrap handling 2010-01-04 09:14:22 +00:00
Benjamin Dauvergne b6c9be9fa2 Core Login: in login.c, add assertion accessor
* docs/reference/lasso/lasso-sections.txt:
   declare new function
 * lasso/id-ff/login.c lasso/id-ff/login.h:
   add new function lasso_login_get_assertion.
 * lasso/saml-2.0/login.c:
   store created assertions
 * lasso/id-ff/login.h:
   make assertion field private for bindings.
2010-01-04 09:14:20 +00:00
Benjamin Dauvergne c01e1231fa SAML 2.0: in saml2_helper.c, add new methods to manipulate SAML2 assertions
* lasso/saml-2.0/saml2_helper.c lasso/saml-2.0/saml2_helper.h:
   - add lasso_server_saml2_assertion_setup_signature, to help in
     defining signature upon saml2:Assertion nodes.
   - add new symbols LASSO_DURATION_MINUTE, LASSO_DURATION_HOUR,
     LASSO_DURATION_DAY, LASSO_DURATION_WEEK.
   - add method lasso_saml2_assertion_add_attribute_with_node

 * docs/reference/lasso/lasso-sections.txt:
   declare new functions in saml2_helper section.
2010-01-04 09:14:17 +00:00
Benjamin Dauvergne c1bd6a8f50 Tests: in basic_tests.c, check LassoSaml2EncryptedElement handling 2010-01-04 09:14:15 +00:00
Benjamin Dauvergne 1c665f3e85 SAML 2.0 XML: map EncryptedID, EncryptedAssertion, EncryptedAttribute and NewEncryptedID element to saml2:EncryptedElement
* lasso/xml/saml-2.0/saml2_encrypted_element.c:
   add registry mapping from EncryptedID, EncryptedAssertion,
   EncryptedAttribute and NewEncryptedID element to
   saml2:EncryptedElement
2010-01-04 09:14:14 +00:00
Benjamin Dauvergne b77954cf39 SAML 2.0 XML: in strings.h, add the identifier for the holder of key subject confirmation method 2010-01-04 09:14:12 +00:00
Benjamin Dauvergne 399ca193e3 SAML 2.0: in provider.c, add node encryption function and reference it in doc
* lasso/saml-2.0/Makefile.am:
   add new header provider.h
 * lasso/saml-2.0/provider.c lasso/saml-2.0/provider.h:
   add new function lasso_provider_saml2_node_encrypt to encrypt nodes
   and encapslutate the XML Enc datas in a LassoSaml2EncryptedElement
   node.
 * docs/reference/lasso/lasso-sections.txt:
   add function to saml2_utils section
2010-01-04 09:14:10 +00:00
Benjamin Dauvergne dbed9b50e3 WS XML: add forgotten include file to wsa_attributed_uri.c and wsa_endpoint_reference.c 2010-01-04 09:14:08 +00:00
Benjamin Dauvergne 848a3252a8 WS Errors: in errors.h errors.c, add new error section for WS-Security handling 2010-01-04 09:14:06 +00:00
Benjamin Dauvergne c71822c7e0 Core: in server.c, change signature of lasso_server_get_provider, add anottations on return value
* lasso/id-ff/server.h lasso/id-ff/server.c:
   - constify first argument of lasso_server_get_provider
   - add annotation about caller owned return value
2010-01-04 09:14:05 +00:00
Benjamin Dauvergne 255962cc35 Core: in tools.c, complete documentation of lasso_verify_signature 2010-01-04 09:14:03 +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 7e22acdd2c Core XML: in xml.{c,h}, add new function lasso_node_get_name to get the element name for an object 2010-01-04 09:13:59 +00:00
Benjamin Dauvergne a2bfa25d71 Core XML: make first argument of lasso_misc_text_node_new_with_string const
* lasso/xml/misc_text_node.h lasso/xml/misc_text_node.c:
   change signature of lasso_misc_text_node_new_with_string, string
   argument is const.
2010-01-04 09:13:57 +00:00
Benjamin Dauvergne 1d8bd498cd Core XML: in xml/tools.c, add conversion method from iso8601 to time_t
* lasso/xml/tools.c:
   add function lasso_iso_8601_gmt_to_time_t
 * lasso/xml/private.h:
   declare new function.
2010-01-04 09:13:55 +00:00
Benjamin Dauvergne 4a10bbf9c6 Core XML: in xml.c, keep original node names, handle xsi:type attribute better
* lasso/xml/xml.c lasso/xml/xml.h:
   - fix signature of lasso_node_set_original_xmlnode, fix signature in
     documentation of lasso_node_set_original_xmlnode;
   - add a new API lasso_node_set_custom_nodename to specify the exact
     element name to use when serializing a LassoNode to XML.
   - rename internal structure _CustomNamespace to _CustomElement, add a
     nodename field to it.
   - rework internal functions around _CustomElement to be aware of an
     existing attached _CustomElement and re-use if needed.
   - move application of _CustomElement hints after the serialization of
     the node, so that the normal behaviour of the serialization is kept
     -- i.e. do not play with the list of parent classes.

   - use the full xsi:type content to find a LassoNode subclass when
     de-serializaing XML content, factorize QName->GObject class mapping
     for the three executions paths inside
     _type_name_from_href_and_nodename:
      - element QName,
      - xsi:type QName,
      - element name with xsi:type namespace
   - add a long comment expliciting the way the mapping is done.
   - remove direct mapping of EncryptedAssertion element, the registry
     declaration on the class LassoSaml2EncryptedElement shoud be
     enough.
2010-01-04 09:13:53 +00:00
Benjamin Dauvergne 3feefb47de Core XML: in xml.c, parse attributes with namespace checking
* lasso/xml/xml.c:
   - use snippet->ns_uri and snippet->ns_name to parse attributes
     outside of the parent node namespace.
2010-01-04 09:13:51 +00:00
Benjamin Dauvergne 1deaa13210 Core XML: in xml/tools.c, improve lasso_eval_xpath_expression, do not fail when nodeset is empty
* lasso/xml/tools.c:
   only check that the query returned a nodeset object, do not check its
   content size.
2010-01-04 09:13:49 +00:00
Benjamin Dauvergne bb2f640231 Core: in utils.h, add a macros, fix existing
* lasso/utils.h:
   - add macro lasso_ref(object), if object is not null, call
     g_object_ref on it, and return the value, otherwise do nothing and
     return NULL.
   - make a better reporting of bad object release
   - change format type for __LINE__ and dest arguments in
     lasso_release_gobject warning display.
   - add a lasso_check_non_empty_string macro
   - add new macro to extract a specific node type from a list of
     GObject objects.
   - use xmlStrdup not g_strdup for lasso_assign_xml_string
   - add lasso_list_add_gstrv and lasso_check_good_rc
   - add macro lasso_list_get_first_child
   - add inline function to test empty string
   - change macro lasso_check_non_empty_string to use the new inline
     function and go to cleanup
   - fix lasso_check_non_empty_string macro
 * lasso/utils.c:
   - add lasso_gobject_is_of_type returns 0 if first parameters is a
     gobject whose GType is equal to the second parameter, and 1
     otherwise.
2010-01-04 09:13:46 +00:00
Benjamin Dauvergne 1e21b80fcd Core: add new errors LASSO_PROFILE_ERROR_INVALID_RESPONSE, LASSO_PROFILE_ERROR_INVALID_REQUEST. 2010-01-04 09:13:45 +00:00