diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2004-12-15 10:07:09 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2004-12-15 10:07:09 +0000 |
commit | 501da6b2b6ccdc9413c416d6ea5cb6541b648070 (patch) | |
tree | 87af31742c9f692e6609eb8d56d7f315823a7c18 /lasso/id-ff/logout.c | |
parent | 3ee382c5c621ee3859830c9eeefba8bc48f6cb95 (diff) | |
download | lasso-501da6b2b6ccdc9413c416d6ea5cb6541b648070.tar.gz lasso-501da6b2b6ccdc9413c416d6ea5cb6541b648070.tar.xz lasso-501da6b2b6ccdc9413c416d6ea5cb6541b648070.zip |
coherent error handling for "identity not found" and "federation not found"
cases.
Diffstat (limited to 'lasso/id-ff/logout.c')
-rw-r--r-- | lasso/id-ff/logout.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index 05fce4a4..55615573 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -298,14 +298,12 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, assertion->AuthenticationStatement)->Subject->NameIdentifier; if (strcmp(nameIdentifier->Format, LASSO_LIB_NAME_IDENTIFIER_FORMAT_ONE_TIME) != 0) { if (LASSO_IS_IDENTITY(profile->identity) == FALSE) { - message(G_LOG_LEVEL_CRITICAL, "Identity not found"); - return -1; + return critical_error(LASSO_PROFILE_ERROR_IDENTITY_NOT_FOUND); } federation = g_hash_table_lookup(profile->identity->federations, profile->remote_providerID); if (federation == NULL) { - message(G_LOG_LEVEL_CRITICAL, "Federation not found"); - return -1; + return critical_error(LASSO_PROFILE_ERROR_FEDERATION_NOT_FOUND); } nameIdentifier = lasso_profile_get_nameIdentifier(profile); @@ -706,18 +704,16 @@ lasso_logout_validate_request(LassoLogout *logout) /* If name identifier is federated, then verify federation */ if (strcmp(nameIdentifier->Format, LASSO_LIB_NAME_IDENTIFIER_FORMAT_FEDERATED) == 0) { if (LASSO_IS_IDENTITY(profile->identity) == FALSE) { - message(G_LOG_LEVEL_CRITICAL, "Identity not found"); lasso_profile_set_response_status(profile, LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST); - return -1; + return critical_error(LASSO_PROFILE_ERROR_IDENTITY_NOT_FOUND); } federation = g_hash_table_lookup(profile->identity->federations, profile->remote_providerID); if (LASSO_IS_FEDERATION(federation) == FALSE) { - message(G_LOG_LEVEL_CRITICAL, "Federation not found"); lasso_profile_set_response_status(profile, LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST); - return -1; + return critical_error(LASSO_PROFILE_ERROR_FEDERATION_NOT_FOUND); } if (lasso_federation_verify_nameIdentifier(federation, nameIdentifier) == FALSE) { |