diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-04-27 22:55:21 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-04-27 22:55:21 +0000 |
| commit | 86e549141f2ea95d18f86bb66ce405a00b4c44a2 (patch) | |
| tree | 804eca02fdeaf6f5fe4a038f425a2147d777f83f | |
| parent | 24599cbe7f99eb86d8ee547cb19f08fe1db1f89b (diff) | |
| download | lasso-86e549141f2ea95d18f86bb66ce405a00b4c44a2.tar.gz lasso-86e549141f2ea95d18f86bb66ce405a00b4c44a2.tar.xz lasso-86e549141f2ea95d18f86bb66ce405a00b4c44a2.zip | |
SAML 2.0: lasso_saml20_profile_process_any_response_msg, change status code checking
| -rw-r--r-- | lasso/saml-2.0/profile.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c index be298510..caac621a 100644 --- a/lasso/saml-2.0/profile.c +++ b/lasso/saml-2.0/profile.c @@ -1320,6 +1320,7 @@ lasso_saml20_profile_process_any_response(LassoProfile *profile, } else { rc = LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND; profile->signature_status = LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND; + goto cleanup; } /* verify status code */ @@ -1327,12 +1328,19 @@ lasso_saml20_profile_process_any_response(LassoProfile *profile, LASSO_PROFILE_ERROR_MISSING_STATUS_CODE); lasso_extract_node_or_fail(status_code1, status->StatusCode, SAMLP2_STATUS_CODE, LASSO_PROFILE_ERROR_MISSING_STATUS_CODE); - goto_cleanup_if_fail_with_rc (rc || status_code1->Value != NULL, - LASSO_PROFILE_ERROR_MISSING_STATUS_CODE); + if (g_strcmp0(status_code1->Value, + LASSO_SAML2_STATUS_CODE_SUCCESS) != 0) + { + LassoSamlp2StatusCode *status_code2 = status_code1->StatusCode; + rc = LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS; + + if (!status_code2) + goto cleanup; - goto_cleanup_if_fail_with_rc ( rc || strcmp(status_code1->Value, - LASSO_SAML2_STATUS_CODE_SUCCESS) == 0, - LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS); + if (!status_code2->Value) + goto cleanup; + /* FIXME: what to do with secondary status code ? */ + } cleanup: lasso_release_doc(doc); |
