diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-10-10 17:29:34 +0200 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-10-10 17:38:03 +0200 |
| commit | c6d4076599c05e74b3d4ccbd5a735f09d4a5000e (patch) | |
| tree | bc1649b7f6e34d6c93e27ec5373c1971a8c35060 | |
| parent | 984759ea671cc4fa2ed047c17777ea1dfaa65544 (diff) | |
| download | lasso-c6d4076599c05e74b3d4ccbd5a735f09d4a5000e.tar.gz lasso-c6d4076599c05e74b3d4ccbd5a735f09d4a5000e.tar.xz lasso-c6d4076599c05e74b3d4ccbd5a735f09d4a5000e.zip | |
[id-wsf2 profile] check provider->private_data->roles instead of provider->role
Fixes #140.
| -rw-r--r-- | lasso/id-wsf-2.0/profile.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lasso/id-wsf-2.0/profile.c b/lasso/id-wsf-2.0/profile.c index 489c5899..34b94de3 100644 --- a/lasso/id-wsf-2.0/profile.c +++ b/lasso/id-wsf-2.0/profile.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <stdio.h> #include "../xml/private.h" #include <libxml/xpath.h> #include <libxml/xpathInternals.h> @@ -415,6 +416,7 @@ lasso_idwsf2_profile_check_security_mechanism(LassoIdWsf2Profile *profile, const char *sender_id = NULL, *local_service_id = NULL; const char *name_qualifier = NULL, *sp_name_qualifier = NULL; LassoSaml2AssertionValidationState validation_state; + LassoProviderRole role; assertion = lasso_soap_envelope_get_saml2_security_token (envelope); if (assertion == NULL) @@ -425,7 +427,12 @@ lasso_idwsf2_profile_check_security_mechanism(LassoIdWsf2Profile *profile, issuer = lasso_saml2_assertion_get_issuer_provider(assertion, profile->parent.server); if (! issuer) goto_cleanup_with_rc(LASSO_PROFILE_ERROR_UNKNOWN_ISSUER); - if (issuer->role != LASSO_PROVIDER_ROLE_IDP) + if (issuer == &profile->parent.server->parent || issuer->role == 0) { + role = issuer->private_data->roles; + } else { + role = issuer->role; + } + if ((role & LASSO_PROVIDER_ROLE_IDP) == 0) goto_cleanup_with_rc(LASSO_PROFILE_ERROR_ISSUER_IS_NOT_AN_IDP); lasso_check_good_rc(lasso_provider_verify_single_node_signature(issuer, (LassoNode*)assertion, "ID")); |
