diff options
| -rw-r--r-- | lasso/id-ff/logout.c | 12 | ||||
| -rw-r--r-- | lasso/saml-2.0/logout.c | 9 |
2 files changed, 9 insertions, 12 deletions
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index c08b1760..05775095 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -347,8 +347,7 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, /* get assertion */ assertion_n = lasso_session_get_assertion(session, profile->remote_providerID); if (LASSO_IS_SAML_ASSERTION(assertion_n) == FALSE) { - message(G_LOG_LEVEL_CRITICAL, "Assertion not found"); - return LASSO_ERROR_UNDEFINED; + return critical_error(LASSO_PROFILE_ERROR_MISSING_ASSERTION); } assertion = LASSO_SAML_ASSERTION(assertion_n); @@ -620,8 +619,7 @@ lasso_logout_process_response_msg(LassoLogout *logout, gchar *response_msg) if (response->Status == NULL || response->Status->StatusCode == NULL || response->Status->StatusCode->Value == NULL) { - message(G_LOG_LEVEL_CRITICAL, "No Status in LogoutResponse !"); - return LASSO_ERROR_UNDEFINED; + return critical_error(LASSO_PROFILE_ERROR_MISSING_STATUS_CODE); } statusCodeValue = response->Status->StatusCode->Value; @@ -679,7 +677,7 @@ lasso_logout_process_response_msg(LassoLogout *logout, gchar *response_msg) return LASSO_LOGOUT_ERROR_FEDERATION_NOT_FOUND; } message(G_LOG_LEVEL_CRITICAL, "Status code is not success : %s", statusCodeValue); - return LASSO_ERROR_UNDEFINED; + return LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS; } /* LogoutResponse status code value is ok */ @@ -861,7 +859,7 @@ lasso_logout_validate_request(LassoLogout *logout) if (assertion_n == NULL) { message(G_LOG_LEVEL_WARNING, "%s has no assertion", profile->remote_providerID); lasso_profile_set_response_status(profile, LASSO_SAML_STATUS_CODE_REQUEST_DENIED); - return LASSO_ERROR_UNDEFINED; + return LASSO_PROFILE_ERROR_MISSING_ASSERTION; } assertion = LASSO_SAML_ASSERTION(assertion_n); @@ -887,7 +885,7 @@ lasso_logout_validate_request(LassoLogout *logout) profile->remote_providerID); lasso_profile_set_response_status(profile, LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST); - return LASSO_ERROR_UNDEFINED; + return LASSO_LOGOUT_ERROR_FEDERATION_NOT_FOUND; } } diff --git a/lasso/saml-2.0/logout.c b/lasso/saml-2.0/logout.c index 81dc55c9..11e55fa0 100644 --- a/lasso/saml-2.0/logout.c +++ b/lasso/saml-2.0/logout.c @@ -61,14 +61,13 @@ lasso_saml20_logout_init_request(LassoLogout *logout, LassoProvider *remote_prov assertion_n = lasso_session_get_assertion(session, profile->remote_providerID); if (LASSO_IS_SAML2_ASSERTION(assertion_n) == FALSE) { - message(G_LOG_LEVEL_CRITICAL, "Assertion not found"); - return LASSO_ERROR_UNDEFINED; + return critical_error(LASSO_PROFILE_ERROR_MISSING_ASSERTION); } assertion = LASSO_SAML2_ASSERTION(assertion_n); if (assertion->Subject == NULL) { - return LASSO_ERROR_UNDEFINED; + return LASSO_PROFILE_ERROR_MISSING_SUBJECT; } name_id = assertion->Subject->NameID; @@ -421,7 +420,7 @@ lasso_saml20_logout_validate_request(LassoLogout *logout) profile->remote_providerID); lasso_saml20_profile_set_response_status(profile, LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST); - return LASSO_ERROR_UNDEFINED; + return LASSO_LOGOUT_ERROR_FEDERATION_NOT_FOUND; } } @@ -658,7 +657,7 @@ lasso_saml20_logout_process_response_msg(LassoLogout *logout, const char *respon return LASSO_LOGOUT_ERROR_UNKNOWN_PRINCIPAL; } message(G_LOG_LEVEL_CRITICAL, "Status code is not success: %s", status_code_value); - return LASSO_ERROR_UNDEFINED; + return LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS; } /* LogoutResponse status code value is ok */ |
