Commit Graph

409 Commits

Author SHA1 Message Date
Benjamin Dauvergne 72b778e47e Fix all cast-function-type warnings (#71400) 2022-11-21 13:28:08 +01:00
Benjamin Dauvergne 8a588a8acb Replace all use of xmlSecBase64Decode by lasso_base64_decode (#71399) 2022-11-21 13:27:15 +01:00
Benjamin Dauvergne 53b0bd3569 Change default key encryption padding algorithm to RSA-OAEP (#56023)
The key encryption padding algorithm is now configurable, the default
being changed to OAEP. It's possible to set the default through
./configure with:

    --with-default-key-encryption-method=[rsa-pkcs1|rsa-oaep]

at initialization time with an environment variable:

    LASSO_DEFAULT_KEY_ENCRYPTION_METHOD=[rsa-pkcs1|rsa-oaep]

or at runtime for a service provider:

    lasso_provider_set_key_encryption_method(LassoProvider *provider,
        LassoKeyEncryptionMethod key_encryption_method)

The setting is global for all encrypted nodes (Assertion or NameID).
2021-09-11 19:20:04 +02:00
Benjamin Dauvergne 4a880977d1 Remove ID-WSF 1.0, 2.0 and WS-* support (#56644)
It has been deprecated for a long time.
2021-09-11 18:54:41 +02:00
Benjamin Dauvergne 0b742b1f6d tools: reimplement xmlURIEscapeStr to respect RFC3986 (#45581)
Bugfix by Emmanuel Dreyfus.

License: MIT
2020-08-14 10:58:06 +02:00
Benjamin Dauvergne e5ad4b1702 misc: clear warnings about class_init signature using coccinelle
$ spatch --in-place --sp-file add-second-arg-to-class-init.cocci `git grep -l -C1 ^class_init \*.c`
	$ sed -i 's/\*unused\>/*unused G_GNUC_UNUSED/' `git grep -l 'void \*unused'`
2020-03-26 22:52:49 +01:00
Benjamin Dauvergne 6dd28b20d3 fix get_issuer and get_in_response_to 2018-04-06 17:23:13 +02:00
Benjamin Dauvergne c1bd8ca117 fix warnings 2018-04-06 15:12:24 +02:00
John Dennis bdecdc248c ECP and PAOS special handling
ECP does not require an SP to know the remote IdP provider. Existing
code made the assumption the remote provider always was
necessary. Determination and setting of the remote consumer URL is
different in the presence of ECP. Rework the logic to reflect
differing requirements.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Benjamin Dauvergne 4436c0d4e4 Check return value of lasso_session_add_assertion() in lasso_login_build_assertion() 2015-01-21 15:04:00 +01:00
Frédéric Péters 9b99eaee8a reformat gtk-doc function comment to work with gtk-doc 1.21 2014-08-11 09:41:36 +02:00
Simo Sorce cb7ea06ca5 Rearrange case checking to avoid compiler warnings
The compiler was complaining that 'compa' could be uninitialized.
USe this occasion to make the code simpler to understand and assign
actually meaningful values to the variable, even though the proper
actions are not implemented yet.

License: MIT
Signed-off-by: Simo Sorce <simo@redhat.com>
2014-07-30 16:07:44 +02:00
Benjamin Dauvergne 7362567411 login: complete document of lasso_login_process_authn_response_msg on expectable error codes 2014-05-21 14:07:06 +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 8d3dc99d8a id-ff/login.c: initialize role status of sp and idp in lasso_login_init_authn_request 2013-09-27 09:59:44 +02:00
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