summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2005-08-16 14:03:19 +0000
committerFrederic Peters <fpeters@entrouvert.com>2005-08-16 14:03:19 +0000
commitfb30438992e6f3020fbd420a50508553b977f3f4 (patch)
tree89f70108248b8a1fc34fcb2c3f566bfec8f378ff
parent8cb5e6957747a909616a1fd68931ff79e5478351 (diff)
build_response_msg called while there was no connection will build a failure
message.
-rw-r--r--lasso/id-ff/logout.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c
index 75b88c2a..888174b8 100644
--- a/lasso/id-ff/logout.c
+++ b/lasso/id-ff/logout.c
@@ -160,20 +160,14 @@ lasso_logout_build_response_msg(LassoLogout *logout)
profile = LASSO_PROFILE(logout);
- /* get the provider */
- if (profile->remote_providerID == NULL) {
- return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND);
- }
-
- provider = g_hash_table_lookup(profile->server->providers, profile->remote_providerID);
- if (provider == NULL) {
+ if (profile->remote_providerID == NULL || profile->response == NULL) {
+ /* no remote provider id set or no response set, this means
+ * this function got called before validate_request, probably
+ * because there were no active session */
return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND);
}
if (profile->response == NULL) {
- /* no answer, this means this function got called before
- * validate_request, probably because there were no active
- * session */
if (profile->http_request_method == LASSO_HTTP_METHOD_SOAP) {
profile->response = lasso_lib_logout_response_new_full(
LASSO_PROVIDER(profile->server)->ProviderID,
@@ -203,6 +197,13 @@ lasso_logout_build_response_msg(LassoLogout *logout)
}
if (profile->http_request_method == LASSO_HTTP_METHOD_REDIRECT) {
+ /* get the provider */
+ provider = g_hash_table_lookup(profile->server->providers,
+ profile->remote_providerID);
+ if (provider == NULL) {
+ return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND);
+ }
+
url = lasso_provider_get_metadata_one(provider, "SingleLogoutServiceReturnURL");
if (url == NULL) {
return critical_error(LASSO_PROFILE_ERROR_UNKNOWN_PROFILE_URL);