Commit Graph

394 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 7b3b7d6900 [id-ff 1.2] change websso with artifact binding to work as SAML 2.0
The old way of transmiting the assertion to return via the session is kept,
but a new way more semblable to the one used in the SAML 2.0 code is added.

After lasso_login_build_artifact_msg() you must save the return of
lasso_profile_get_artifact_message() linked to the value of the artifact
obtained via lasso_profile_get_artifact().

In the artifact-resolve endpoint you must find the artifact message
corresponding to the return value of lasso_profile_get_artifact()
reinstall the artifact message using lasso_profile_set_artifact_message()
just before calling lasso_login_build_response_msg().

This change is necessary for ID-FF 1.2 SSO profile to work with the
thin-sessions.
2011-12-23 10:56:27 +01:00
Benjamin Dauvergne 1907d66f1a [id-ff 1.2] in lasso_login_build_assertion() always add the assertion to the response 2011-12-22 18:55:52 +01:00
Benjamin Dauvergne 26b341a276 [id-ff 1.2] provision the SessionIndex into the assertions
Without it SLO session management is broken.
2011-12-22 18:19:29 +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 641702b346 [id-ff] move LassoLogin to use LassoSignatureContext 2011-12-08 17:56:31 +01:00
Benjamin Dauvergne 5192cdf7a0 [core] multiple decryption keys support
This commit complements the support for multiple signing certificate
support in the metadata files. The use-case is still key roll-over.

The structure LassoServerPrivateData was changed to accomodate multiple
decryption keys, and so:

 xmlSecKey *encryption_private_key

became:

 GList *encryption_private_keys

All uses of this key were replaced by a loop over this list, terminating
with the first key to be able to decrypt the content.

The private key passed to lasso_server_new() or
lasso_server_new_from_buffers() is first added to the list of decryption
keys. Any other call to
lasso_server_set_encryption_private_key_with_password() or
lasso_server_set_encryption_private_key() will add a new key to the
list.
2011-11-21 10:25:03 +01:00
Benjamin Dauvergne 9cedec628e [core] finish transition from single encryption key to multiple ones
Some code still reference provider->private->encryption_public_key, this
commit make them use lasso_provider_get_encryption_public_key().
2011-05-30 22:24:37 +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 346071a630 [wsf] fix wsf preprocessor conditionals 2011-01-04 16:43:06 +01:00
Benjamin Dauvergne 5d56e4558e [ID-FFv1.2] in lasso_login_process_authn_request_msg() adopt simpler behaviour for checking signatures
There is two sources of advice for signature checking:
AuthnRequestsSigned attribute in service provider metadata files and
value of lasso_profile_get_signature_verify_hint().

If lasso_profile_get_signature_verify_hint() forbid to check signature,
we do not check.
If the SP advise to check signature, we check.
If lasso_profile_get_signature_verify_hint() forces to check signature,
we do not check.
In all other cases we only check if a signature is present, i.e. we
ignore the error LASSO_DS_ERROR_SIGNATURE_NOT_FOUND.
2010-10-06 17:00:52 +02:00
Benjamin Dauvergne 58a3868361 [ID-FFv1.2] make lasso_login_process_authn_request_msg() return LASSO_PROFILE_ERROR_INVALID_MSG if received request is not a lib:AuthnRequest 2010-10-06 17:00:52 +02:00
Benjamin Dauvergne 6be8d9cfa8 [SAMLv2&ID-FFv1.2] improve documentation of lasso_login_process_authn_request_msg 2010-10-06 17:00:52 +02:00
Benjamin Dauvergne 4a970453de [Core] add missing annotation to lasso_*_dump functions
The string returned by these functions is newly allocated and must be
freed by the caller.
2010-09-27 16:18:57 +02:00
Benjamin Dauvergne 8b385af8e6 [ID-FFv1.2] move all user of lasso_node_export_to_query to lasso_node_export_to_query_with_password 2010-07-16 19:34:28 +00:00
Benjamin Dauvergne 64dd61b1a8 ID-FFv1.2: for idp initiated sso accept any nameIdPolicy
* IdP initiated SSO can be of any kind, no need to limit it.
2010-06-06 14:03:49 +00:00
Benjamin Dauvergne e109756cf5 Change <p> tags to <para> 2010-05-01 05:40:34 +00:00
Benjamin Dauvergne a041a2ef81 Initialize all uninitialized rc variables 2010-04-30 09:23:01 +00:00
Benjamin Dauvergne 6e072c2b5f Fix wrong change g_free -> lasso_release inside example code 2010-04-22 11:19:32 +00:00
Benjamin Dauvergne 2f5ef5fef0 Improve safety by replacing all g_list_free use by lasso_release_list 2010-04-22 00:44:57 +00:00
Benjamin Dauvergne 0a169eda51 Improve safety by replacing all g_free use by lasso_release 2010-04-22 00:44:45 +00:00
Benjamin Dauvergne c93fb2a356 Start an example listing for an IdP SingleSignOn endpoint 2010-04-22 00:44:31 +00:00
Benjamin Dauvergne 2d89170af6 Login: remove symbol markers in example code 2010-04-19 11:51:28 +00:00
Benjamin Dauvergne 05aad98ec3 Fix documentation problems 2010-04-19 11:30:35 +00:00
Benjamin Dauvergne c95e6b9918 Docs: remove from documentation comments characters outside ASCII for python bindings 2010-04-06 13:11:00 +00:00
Benjamin Dauvergne 7d9159dea8 update documentation of lasso_login_build_authn_response_msg 2010-03-27 17:40:03 +00:00
Benjamin Dauvergne 34e9e35413 update documentation of lasso_login_build_authn_request_msg 2010-03-27 17:40:01 +00:00
Benjamin Dauvergne 9aa68aa4ef improve documentation of lasso_login_build_artifact_msg 2010-03-27 17:40:00 +00:00
Benjamin Dauvergne 938d84e0ea use lasso_release_gobject in lasso_login_destroy 2010-03-27 17:39:59 +00:00
Benjamin Dauvergne aea8e65e82 update lasso_login_accept_sso documentation 2010-03-27 17:39:57 +00:00
Benjamin Dauvergne f09332e9d6 ID-FF&SAML2: complete documentation of lasso_login_build_assertion 2010-03-27 17:39:56 +00:00
Benjamin Dauvergne f5442dc84b SAML 2.0: add support for attribute, authentication and authorization authorities metadata
* server.c,serverprivate.h: add new private method
   lasso_server_get_firs_providerID_by_role(server, role)w
 * defederation.c: use new private method
   lasso_server_get_first_providerID_by_role for find providerID
   when the argument remote_providerID is null in
   lasso_defederation_init_notification.
 * lasso/id-ff/login.c (lasso_login_init_authn_request): use new private
   method lasso_server_get_first_providerID_by_role.
 * provider.h: add thre new provider role (authn,pdp,attribute) and
    four new services (authn,assertionid,attribute,authz) and also
    a ROLE_ANY value (-1) for catchall purpose and a ROLE_LAST for
    array sizing.
 * provider.h: add a LAST member to LassoMdProtocolType enum.
  * providerprivate.h,provider.c:
   - removes separate hashtable for descriptors depending on provider role,
     use only one table named Descriptors.
   - use the LAST members of enumerations to dimention static string arrays.
  * provider.h: add a LAST member to the e
2010-03-27 16:51:43 +00:00
Benjamin Dauvergne 59246ba028 Add complete error code listing for lasso_login_process_response_msg
* lasso/id-ff/login.c:
   list all error codes and their semantic with respect to this call.
2010-02-10 00:34:09 +00:00
Benjamin Dauvergne f2b5731eb5 Update code example for LassoLogin
* lasso/id-ff/login.c:
   add code for intializaing request for SAML 2.0, shows how to handler errors codes.
2010-02-10 00:34:04 +00:00
Benjamin Dauvergne f520348197 Core: use lasso_node_new_from_dump to implement _new_from_dump methods
* provider.c:
   add annotation for nullable arguments (necessary for bindings of
   new_from_buffer).
 * server.c: add annotations, allow to set encryption_private_key from
   buffers
2010-02-04 00:02:12 +00:00
Benjamin Dauvergne a45b383cd0 Core: document return values of lasso_login_validate_request_msg 2010-02-01 19:50:03 +00:00
Benjamin Dauvergne 92efc271a4 SAML 2.0: fix annotations, documentation and signatures 2010-01-29 00:43:50 +00:00
Benjamin Dauvergne d42c16e239 Core Node: add args to lasso_node_encrypt to set recipient of an encrypted element 2010-01-12 15:39:57 +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 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 012b7c3af5 Fix double g_object_unref
* lasso/id-ff/login.c:
   status is already freed by lasso_assign_gobject, do not free it first
   with lasso_node_destroy.
2009-11-30 22:58:57 +00:00
Benjamin Dauvergne 6921dd1d9b ID-FF1.2 and SAML2: remove direct access to profile->server->providers
* client of LassoServer should use lasso_server_get_provider.
 * LASSO_PROFILE_ERRROR_UNKNOWN_PROVIDER was a mistake, it is
   superfluous, use LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND.
2009-10-30 14:47:23 +00:00
Benjamin Dauvergne 17d6885dfc Change setting of default NameIDFormat for SAML 2.0 login
* saml-2.0/login.c:
   in lasso_saml20_login_init_authn_request,
   lasso_saml20_login_init_idp_initiated_authn_request, if the service
   provider provided a list of supported name id formats, use the first
   one as default for new AuthnRequest.
 * id-ff/login.c:
   modify documentation to report the new way of choosing a default.
2009-09-29 13:20:33 +00:00
Benjamin Dauvergne 1fb7750337 Complete documentation of lasso_login_init_authn_request concerning the NameIDFormat
* lasso/id-ff/login.c:
   in lasso_login_init_authn_request, add docbook formatting, add
   remarks about the different NameIDFormat for ID-FF 1.2 and SAML 2.0.
2009-09-29 13:12:37 +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 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