Commit Graph

129 Commits

Author SHA1 Message Date
Benjamin Dauvergne 56c9fb65e8 profile: fix leak of private idp_list field 2015-11-25 03:08:58 +01:00
Benjamin Dauvergne 7ecf6c1867 id-ff: fix leak of profile->private_data->message_id 2015-11-24 19:19:48 +01:00
John Dennis 43bcc8cddf Add messageID and idp_list to profile properties
ECP needs a place to store the messageID and idp_list. Normally values
like this would located in a "context" passed to the relevant
routines. But currently there is no such context, the closest thing to
a context we have is the profile so we add them here in the profile
private data using accessors. They are currently not relevant outside
of ECP.

Adds functions:

lasso_profile_get_message_id()
lasso_profile_set_message_id()
lasso_profile_get_idp_list()
lasso_profile_set_idp_list()

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Benjamin Dauvergne 65bc705235 profile: add two new class methods, lasso_profile_get_issuer and lasso_profile_get_in_response_to (#4378)
The goal of those two methods is to allow IdP and SP to load metadata
dynamically without processing completely the incoming. Currently it's
impossible as message parsing and signature checking is done in the same
function.
2015-08-24 10:25:03 +02:00
Simo Sorce 1b955021a5 Do not dereference null pointers
Sounds like these should all be boolean 'OR's, otherwise,
if profile is not in fact a lasso profile then profile->private_data
will be dereferenced even if it is NULL.
Found by Clang

License: MIT
Signed-off-by: Simo Sorce <simo@redhat.com>
2014-07-30 16:07:45 +02:00
Simo Sorce 3a6b2fdee7 Fix license boilerplates
Instad of referring to an old FSF address, point the reader to the FSF
website where the latest licenses and addresses are published.

Signed-off-by: Simo Sorce <simo@redhat.com>
2013-12-03 21:55:06 +01:00
Benjamin Dauvergne 3dca5c2afa [doc] do some documentation fixing 2011-12-22 18:21:12 +01:00
Benjamin Dauvergne 727f07b1ae Simplify useless complexity in include paths 2011-12-16 14:17:31 +01:00
Benjamin Dauvergne 154812b401 [xml] rewrite schema directed serialization/deserialization methods
The new implementations of lasso_node_impl_init_from_xml now validate
namespace of all child nodes befores parsing. It stops on any error. For
node which implement their own parsing of an attribute or a node, it
must declare an XmlSnippet with an offset field set to 0. The 0 value is
invalid for public GObject structure (it's the place of the GObject
machinery like the reference count). The 0 offset can be used for
XmlSnippet in a private structure, so never set the offset to 0 with the
flag SNIPPET_PRIVATE, for a field which is parsed by you get_xmlNode
virtual method.

Other ameliorations in this commit is the possibility to set attributes
with namespace when using the flags SNIPPET_ATTRIBUTE|SNIPPET_ANY. The
syntax for an attribute is inspired by the element tree API from Python:

	{namespace}attribute_name

an example:

	{http://www.w3.org/2001/XMLSchema-instance}type

for the classic xsi:type attribute.
2011-12-16 11:39:24 +01:00
Benjamin Dauvergne 346071a630 [wsf] fix wsf preprocessor conditionals 2011-01-04 16:43:06 +01:00
Benjamin Dauvergne 8c28926304 [profile] prefer to lookup the session before the identity for looking up a name identifier; 2010-12-17 17:40:07 +01:00
Benjamin Dauvergne 462c9a1cd0 [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequal
Too much human errors with strcmp kind of functions. Also change name os
lasso_is_empty_string to lasso_strisempty.
2010-10-01 15:29:38 +02:00
Benjamin Dauvergne cd7b3e92c5 [Core] fix break of lasso_profile_get_request_type_from_soap_msg from commit b9d535625
ManageNameIDRequest is not an ID-WSF kind of request.
2010-09-29 00:10:09 +02:00
Benjamin Dauvergne b9d5356259 [ID-WSFv1&ID-WSFv2] separate better strings for ID-WSF from other strings
Code in core source file which depend upon ID-WSF symbols have been
conditionalized, and each id-wsf source file now include directly its
need string header.
2010-09-09 01:09:28 +02:00
Benjamin Dauvergne 5ba5b4634e Add a lasso_profile_get_signature_status method 2010-05-01 05:40:31 +00:00
Benjamin Dauvergne 81c35bbe2e Ameliorate support for lasso_profile_set_signature_verify_hint
* lasso/id-ff/profile.h:
   - add end symbol for enum LassoProfileSignatureVerifyHint
 * lasso/id-ff/profile.c:
   - fix documentation of lasso_profile_set_signature_verify_hint
   - do not allow to set or return invalid value for the
     signature_verify_hint attribute.
 * lasso/saml-2.0/login.c:
   - handle new enum value
 * lasso/saml-2.0/profile.c:
   - handle new enum value
   - fix missing catch of signature error reporting when
     signature_verify_hint is IGNORE.
 * docs/reference/lasso/lasso-sections.txt:
   - export enums LassoProfileSignatureHint and
     LassoProfileSignatureVerifyHint
 * tests/metadata_tests.c:
   - fix test of all Role enumerations
2010-04-16 15:37:17 +00:00
Benjamin Dauvergne 9150b008cf Core: add method to check whether we are IdP or SP of another provider
* lasso/id-ff/profile.{c,h}:
   the method lasso_profile_sso_role_with, evaluate using the current
   LassoIdentity content if we are in a relation of IdP or SP toward
   another provider. This is based on the existence of a federation with
   this provider.
2010-03-27 16:51:47 +00:00
Benjamin Dauvergne d5994b2bae Add signature_verify_hint accessor methods to LassoProfile
* lasso/id-ff/profile.{c,h}:
   add a LassoProfileSignatureVerifyHint enumeration and two accessor
   methods:
    - lasso_profile_get_signature_verify_hint
    - lasso_profile_set_signature_verify_hint
 * lasso/id-ff/profileprivate.h:
   add private field signature_verify_hint.
2010-03-27 16:51:34 +00:00
Benjamin Dauvergne 32794e6c89 Core: add an helper method to build a SOAP response in a LassoProfile object
* lasso/id-ff/profile.{c,h}:
   add lasso_profile_add_soap_fault_response(char* code, char *string,
   GList *details).
 * lasso/id-wsf-2.0/profile.{c,h}:
   change signature of lasso_idwsf2_profile_init_soap_fault_response.
 * lasso/id-wsf-2.0/data_service.c:
   use new function instead of manually intializing soap faults
 * lasso/id-wsf-2.0/discovery.c:
   init a soap fault when parsed request is of an unknown type, return
   proper error.
2010-03-02 11:57:53 +00:00
Benjamin Dauvergne 95f5d99be6 Core: add missing return value owner semantic annotations to getters
* lasso/id-ff/provider.c:
   fix lasso_provider_get_base64_succinct_id, it returned a libxml
   string, copy it with g_strdup before releasing it to stay with GLib
   allocated string in return values.
2010-02-17 10:14:59 +00:00
Benjamin Dauvergne 58fa7178e4 Core: add annotation to getter function about return value owner semantic
* lasso/id-ff/identity.c lasso/id-ff/profile.c:
   precise owner semantic of lasso_profile_get_identity,
   lasso_profile_get_session, lasso_profile_get_server
 * lasso/id-wsf-2.0/saml2_login.c tests/login_tests_saml2.c:
   in the same vein add missing release of assertion returned by
   lasso_login_get_assertion which return a caller owned object.
2010-02-17 10:14:56 +00:00
Benjamin Dauvergne 685a82b7af ID-WSF 2.0: add strings for Discovery service Actions 2010-02-17 10:14:39 +00:00
Benjamin Dauvergne 3bf8b2a44f Core: in lasso_profile_get_request_type_from_soap_msg use lasso_xml_parse_memory_with_error
* lasso/id-ff/profile.c: (lasso_profile_get_request_type_from_soap_msg)
   use lasso_xml_parse_memory_with_error instead of xmlParseMemory, use
   error code output argument to log error reports.
2010-02-04 00:02:24 +00:00
Benjamin Dauvergne 7aa18e07b1 Fix leaks, change signature of lasso_provider_get_sp_name_qualifier, make it return a const char* 2010-02-04 00:02:05 +00:00
Benjamin Dauvergne 003916b452 Core Profile: remove need for identity in lasso_profile_get_nameIdentifier 2010-01-12 15:40:06 +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 0988cc2ec8 Core: in profile.c, profile.h, profileprivate.h, add a new attribute to express signature needs 2010-01-12 15:39:45 +00:00
Benjamin Dauvergne 896d9abd3f Restore ancient semantic of lasso_profile_is_session_dirty
* lasso/id-ff/profile.c:
   lasso_is_session_dirty must return FALSE if session is NULL.
2009-11-30 22:58:59 +00:00
Benjamin Dauvergne 3c9e4965dd Core: factorize code to obtain a SPNameQualifier
* lasso/id-ff/provider.c lasso/id-ff/provider.h:
   add a method giving the SPNameQualifier for a provider (its entity id
   or its affiliation id).

 * lasso/id-ff/profile.c:
 * lasso/saml-2.0/login.c:
   update use sites.
2009-10-30 14:47:36 +00:00
Benjamin Dauvergne cee61af74f Core: in profile, use lasso_server_get_provider
- lasso/id-ff/profile.c:
   replace direct access to server->provider by
   lasso_server_get_provider.
2009-10-30 14:47:19 +00:00
Benjamin Dauvergne c462bc3b2a Do not use g_new, use g_new0
* lasso/id-ff/federation.c:
 * lasso/id-ff/logout.c:
 * lasso/id-ff/profile.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
 * lasso/id-wsf/authentication.c:
 * lasso/saml-2.0/ecp.c:
 * lasso/xml/xml.c:
   even for private datas, use g_new0, it is safer.
2009-09-29 13:20:36 +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 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 962a5d2403 new function lasso_profile_get_server()
* lasso/id-ff/profile.c:
 * lasso/id-ff/profile.h:
   in a move to try to remove direct access to object content, add a
   function to retrieve the LassoServer object of a LassoProfile.
 * bindings/overrides.xml:
   it conflicts with direct access to the public field server, so we do
   not export it in the binding for now.
2009-04-27 08:19:30 +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 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 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
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Frédéric Péters 6f1adef11c fixed order of freeing calls
(stolen from ec76ae4f7e40e99443ad421a85ec4d3fb7359bf3)
2008-07-22 12:09:06 +00:00
Damien Laniel da28448769 added some more missing unreference 2008-05-22 07:54:46 +00:00
Damien Laniel b3d861afa2 useless variables detroyer; they're already freed by snippets 2008-05-21 09:22:08 +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
Frédéric Péters 20f61fd653 formatting fix in docstring 2007-11-22 12:30:02 +00:00
Frédéric Péters d816d74c1a fixed class hierarchy, with ID-WSF 2 specific stuffs going into
LassoIdWsf2Profile (which now inherits from LassoProfile).
2007-06-19 11:16:17 +00:00
Damien Laniel eefdf3b586 moved soap_envelope_request and soap_envelope_response to ProfilePrivate to avoid ABI breackage 2007-06-18 09:43:47 +00:00
Damien Laniel fdf3feef49 initialise and destroy new attributes 2007-06-13 15:43:32 +00:00
Frédéric Péters 32aff7ef14 differentiate between id-wsf 1 & 2 since this is what is expected in other
places (won't work as easily for DST)
2007-06-08 18:16:42 +00:00