Commit Graph

4876 Commits

Author SHA1 Message Date
Benjamin Dauvergne aebd6ed3d7 [SAMLv2] simplify logic for handling AuthnResponse with binding HTTP-Post
The logic is now simpler:
 - first lasso_saml20_profile_process_any_response check the signature
   on the message
 - then lasso_saml20_login_process_response_status_and_assertion
   traverse all the assertions:
   - if the message is signed all assertion from the same issuer are
     automatically accepted,
   - if the message is not signed, or the signature validation failed,
     or the assertion has a different issuer than the message, we check
     the signature directly on the assertion. If any of the assertions
     fails the signature check, the result will be
     LASSO_PROFILE_ERROR_CANNOT_VERIFY_SIGNATURE.

The public field profile->signature_status will contain only the message
level signature status, each assertion signature status is not
accessible. That will change when signature and key handling is
reworked.
2010-07-20 14:15:55 +00:00
Benjamin Dauvergne 52d9fba0fa [Binding perl] fix broken distclean-local target
The TOCOPY files need to be cleaned only for out of source directory
builds.
2010-07-20 14:15:53 +00:00
Benjamin Dauvergne b8c756db7d [SAMLv2] comment on SessionIndex support hack 2010-07-19 15:56:33 +00:00
Benjamin Dauvergne 1898d645d5 [SAMLv2] remove empty files, wrongly committed 2010-07-19 15:45:52 +00:00
Benjamin Dauvergne e79fcf3beb [SAMLv2/SSO] when processing AuthnResponse with binding HTTP-Post only the assertion need to be signed
If the message is signed, the assertion is also covered, but if only the
assertion is signed, there is no error to report. If the caller ask for
forcing the validation of message signature, then we report an error.

This commit also add checking for the binding used, if it is not
HTTP-Post lasso_login_process_authn_response_msg will now report an
error.
2010-07-19 15:27:10 +00:00
Benjamin Dauvergne 19372c88c1 [Binding java] return empty list for NULL GList value, not null 2010-07-16 19:34:33 +00:00
Benjamin Dauvergne 6b48a72943 [ID-FFv1.2] add missing namespace declarations 2010-07-16 19:34:32 +00:00
Benjamin Dauvergne e869899b79 [SAMLv2] add support for encrypted private keys
* support private key with new internal API in signature setting
   methods

Plug lasso_node_set_signature into
lasso_profile_saml20_setup_message_signature and
lasso_server_saml2_assertion_setup_signature.

 * also use lasso_node_get_signature in has_signature

 * add forgottent LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE in switch
   cases

For AuthnResponse checking the semantic is now that if HINT_FORCE is
used we verify message signature *and* assertion signature. If
HINT_MAYBE is used we check the assertion signature if its issuer
differs from the message issuer.
2010-07-16 19:34:30 +00: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 ad93e9f831 [Core] Change lasso_apply_signature to use quark stored annotated signature parameters
The node containing signature do not handle the private keys passwords.
As the fields for signature parameters are part of the public ABI we
cannot add the password field to the public structure for those nodes.
Instead we use the new quark annotation accessed through
lasso_node_get/set_signature, and if the sign_type parameter is non-NULL
we use it instead of the parameters stored in the public structure.
This is a gross hack :( but at least it is documented.
2010-07-16 19:34:26 +00:00
Benjamin Dauvergne 21ca128532 [Core] add password parameter to lasso_sign_node 2010-07-16 19:34:24 +00:00
Benjamin Dauvergne f8ce6b25e5 [Code] add a lasso_node_export_to_query_with_password method 2010-07-16 19:34:23 +00:00
Benjamin Dauvergne c939427f21 [Core] add a password parameter to lasso_query_sign
We force use of the password through a custom OpenSSL password callback.
2010-07-16 19:34:21 +00:00
Benjamin Dauvergne 2fc20aa682 [Core] dump custom signature parameters in lasso dumps
The signature parameters are serialized as global attributes from the
http://lasso.entrouvert.org/lasso/namespaces/0.0 named:
SignatureType
SignatureMethod
PrivateKey
PrivateKeyPassword
Certificate
2010-07-16 19:34:19 +00:00
Benjamin Dauvergne 950565e5a2 [Tests/python] add test case for WebSSO with providers using encrypted keys 2010-07-16 19:34:18 +00:00
Benjamin Dauvergne 8198294c55 [Core] add lasso_node_set_signature and lasso_node_get_signature
Those two methods allows to associate signature parameters to any node.
They keep it inside the CustomElement quark. Using a private structure
may be more performant.
2010-07-16 19:34:14 +00:00
Benjamin Dauvergne 9d9cf60aca [Core] extract signature adding into base class method lasso_node_get_xmlNode
In order to permit subclass to modify the base xmlNode created by
lasso_node_impl_get_xmlNode we must defer the concrete to the virtual
method wrapper, lasso_node_get_xmlNode.

To do that it whas needed to make id_attribute another virtual field of
LassoNode subclasses (it can be accessed through an offset registered in
the class object).

This commit solves signature validation error since the patch for
managing more than one SessionIndex element in samlp2:LogoutRequest.

It also factorize the creation of signatures in one place.
2010-07-12 14:09:17 +00:00
Benjamin Dauvergne 98445777b9 [SAMLv2] if service provider supports logout, add a SessionIndex from the assertion ID
The standard mandate to provide a SessionIndex to service provider
advertaising their support of the logout profile. We follow the
convention of using the assertion ID as a SessionIndex.
2010-07-12 14:09:14 +00:00
Benjamin Dauvergne 358b2b1764 [Tests] add a sso then slo soap test 2010-07-12 14:09:12 +00:00
Benjamin Dauvergne 43c717764d [Core] lasso_check_version does not return a proper error code
lasso_check_version returns 0, 1 or -1 and one is not a proper error
code, so the original int return type is kept.
2010-07-12 14:09:11 +00:00
Benjamin Dauvergne f3c56a1039 [Bindings] make is_rc only check for lasso_error_t type 2010-07-12 14:09:10 +00:00
Benjamin Dauvergne 553814f90c [Bindings php5] simplify is_object in php_code.py 2010-07-12 14:09:09 +00:00
Benjamin Dauvergne 2468e0a421 [Core] change return type of all error returning methods
The new return type is lasso_error_t, it should allow to pinpoint easily
methods returning an error code in bindings.
2010-07-12 14:09:07 +00:00
Benjamin Dauvergne 07cf66e143 [Bindings java] use is_int instead of custom methods or code 2010-07-12 14:09:03 +00:00
Benjamin Dauvergne a3675cd7b2 [Bindings perl] add lasso_errot_t to type to map to T_IV typemap (integer types) 2010-07-12 14:09:02 +00:00
Benjamin Dauvergne 9ba548d6a0 [Bindings] add lasso_error_t to return code types 2010-07-12 14:09:00 +00:00
Benjamin Dauvergne f38c42de0f [Binding java] use is_rc to match error return type 2010-07-12 14:08:59 +00:00
Benjamin Dauvergne 0a955e18d5 [Binding php5] use is_rc to match error return type 2010-07-12 14:08:58 +00:00
Benjamin Dauvergne 3aec6e5902 [Core] add lasso_error_t to list of integer types 2010-07-12 14:08:57 +00:00
Benjamin Dauvergne a7204adb88 [Core] add a lasso_error_t typedef
This typedef will serve to mark error returning methods.
The ctypes.h header piggyback on export.h to be included in all public
headers.
2010-07-12 14:08:55 +00:00
Benjamin Dauvergne 7352ec8036 [Provider] Fix loading of provider without a public key
This commit also emit propre warning when loading fails for a provider
*with* a public key.
2010-07-05 21:27:08 +00:00
Benjamin Dauvergne eca31dd63c [Python binding] do not throw lasso.Error for python exceptions 2010-07-05 21:24:08 +00:00
Benjamin Dauvergne 11ac1e148a [Perl binding] make include from $(srcdir) works in Perl binding 2010-06-29 14:49:15 +00:00
Benjamin Dauvergne 3534792285 [Bindings] accept simple string in string<->xmlNode converter
Some use case ask for passing simple libxml content node (i.e just an
UTF-8 string) when a method argument or a field of the xmlNode* type.
This commit add a static method in bindings/utils.c named
lasso_string_fragment_to_xmlnode which does this transform by trying to
parse an XML document then by trying to parse a well balanced XML
fragment of only one node (if there is more than one node such as in the
string " xxx <tag/> yyy ", we free the node list and return NULL).
2010-06-29 14:15:08 +00:00
Benjamin Dauvergne 2e9e814b09 [Core] add macro to release an xmlNodeList object 2010-06-29 14:15:02 +00:00
Benjamin Dauvergne f27fa8171a [ID-WSF2] add idwsf2 test script to test suite
Re-activate ID-WSF 2.0 test script. Fix problem with provider issuing
assertion role. Need to be fixed more generally in the future.
2010-06-29 14:15:01 +00:00
Benjamin Dauvergne 4a36e6d065 [Core] add macro to release GList of xmlNodeList 2010-06-29 14:14:59 +00:00
Benjamin Dauvergne 0524051343 [Core] add macros to manipulate xmlNodeList and GList of xmlNodeList
The method to copy them is xmlCopyNodeList and not xmlCopyNode, so we
need another set of macros.
2010-06-29 14:14:58 +00:00
Benjamin Dauvergne 129e7ac6ea Merge branch 'issue-101' 2010-06-29 09:15:06 +00:00
Benjamin Dauvergne c1a4ba2fc0 Merge branch 'issue-88' 2010-06-29 09:15:02 +00:00
Benjamin Dauvergne 6f617027e9 Merge branch 'issue-86' 2010-06-29 09:15:00 +00:00
Benjamin Dauvergne d9d4e6ae38 [Tests/integration] add G_DEBUG=gc-friendly env. var to valgrind-wrapper
It should improve valgrind ability to trace memory origin.
2010-06-18 08:05:55 +00:00
Benjamin Dauvergne ef36d5cad3 [XML] in lasso_node_export_to_paos_request check return value of lasso_node_get_xmlNode 2010-06-17 11:42:45 +00:00
Benjamin Dauvergne eac190160c [XML] in _lasso_node_export_to_base64 check return value of lasso_node_export_to_xml 2010-06-17 11:42:43 +00:00
Benjamin Dauvergne 8c46b3dd58 [XML] in _lasso_node_export_to_xml check return value of lasso_node_get_xmlNode 2010-06-17 11:42:41 +00:00
Benjamin Dauvergne 751d02ed4d Comment out custom silent rules if automake < 1.11 2010-06-15 11:33:01 +00:00
Benjamin Dauvergne 8dd38b7746 [Core] do not ignore keep_xmlnode flag inherited from parent classes
We only looked to the keep_xmlnode flag in the node data of the top
level class, but any parent class can set this flag and in this case we
must honor it too.
2010-06-15 11:33:00 +00:00
Benjamin Dauvergne bf2274f20d Test: add non regression test for reloading a server dump with encrypted keys 2010-06-14 21:21:29 +00:00
Benjamin Dauvergne c1902b7d7e Core: when reloading a dump, use the signing private key password for loading the encryption private key
We currently do not store the encryption private key, instead on reload
of a dump, we try to use the signing private key as the encryption
private key. But we forgot to use the stored private key password.
That's now fixed.

Next step would be to keep the encryption private key around also.
2010-06-14 21:21:27 +00:00
Benjamin Dauvergne 900a8008c4 Binding python: fix freeing of list return values for methods with the transfer full flag
The output 'print' were missing, oups :(
2010-06-14 21:21:25 +00:00