summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-09-10 13:19:53 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-09-10 13:19:53 +0000
commite6598cefb84928dd6b3fec09980c8bc945421bbc (patch)
tree456bcbf6e107ad2165f489dd69bef8689ff94982
parenta534fb441bd7fd587c8b9d8e7bc13c5910be264f (diff)
downloadlasso-e6598cefb84928dd6b3fec09980c8bc945421bbc.tar.gz
lasso-e6598cefb84928dd6b3fec09980c8bc945421bbc.tar.xz
lasso-e6598cefb84928dd6b3fec09980c8bc945421bbc.zip
Moved lasso_name_registration_validate_request() method at the end of definition order
-rw-r--r--lasso/id-ff/name_registration.c105
1 files changed, 53 insertions, 52 deletions
diff --git a/lasso/id-ff/name_registration.c b/lasso/id-ff/name_registration.c
index 60bca280..b2530828 100644
--- a/lasso/id-ff/name_registration.c
+++ b/lasso/id-ff/name_registration.c
@@ -476,6 +476,59 @@ gint lasso_name_registration_process_request_msg(LassoNameRegistration *name_reg
}
gint
+lasso_name_registration_process_response_msg(LassoNameRegistration *name_registration,
+ gchar *response_msg,
+ lassoHttpMethod response_method)
+{
+ LassoProfile *profile;
+ xmlChar *statusCodeValue;
+ LassoNode *statusCode;
+ gint ret = 0;
+
+ g_return_val_if_fail(LASSO_IS_NAME_REGISTRATION(name_registration), -1);
+ g_return_val_if_fail(response_msg != NULL, -1);
+
+ profile = LASSO_PROFILE(name_registration);
+
+ /* parse NameRegistrationResponse */
+ switch (response_method) {
+ case lassoHttpMethodSoap:
+ profile->response = lasso_register_name_identifier_response_new_from_export(response_msg, lassoNodeExportTypeSoap);
+ break;
+ case lassoHttpMethodRedirect:
+ profile->response = lasso_register_name_identifier_response_new_from_export(response_msg, lassoNodeExportTypeQuery);
+ break;
+ default:
+ message(G_LOG_LEVEL_CRITICAL, "Unknown response method\n");
+ ret = -1;
+ goto done;
+ }
+
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
+ if (statusCode == NULL) {
+ message(G_LOG_LEVEL_CRITICAL, "StatusCode not found\n");
+ ret = -1;
+ goto done;
+ }
+ statusCodeValue = lasso_node_get_attr_value(statusCode, "Value", NULL);
+ if (statusCodeValue == NULL) {
+ message(G_LOG_LEVEL_CRITICAL, "StatusCodeValue not found\n");
+ ret = -1;
+ goto done;
+ }
+
+ if(!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
+ ret = -1;
+ goto done;
+ }
+
+ done:
+
+ return ret;
+}
+
+
+gint
lasso_name_registration_validate_request(LassoNameRegistration *name_registration)
{
LassoProfile *profile;
@@ -551,58 +604,6 @@ lasso_name_registration_validate_request(LassoNameRegistration *name_registratio
return ret;
}
-gint
-lasso_name_registration_process_response_msg(LassoNameRegistration *name_registration,
- gchar *response_msg,
- lassoHttpMethod response_method)
-{
- LassoProfile *profile;
- xmlChar *statusCodeValue;
- LassoNode *statusCode;
- gint ret = 0;
-
- g_return_val_if_fail(LASSO_IS_NAME_REGISTRATION(name_registration), -1);
- g_return_val_if_fail(response_msg != NULL, -1);
-
- profile = LASSO_PROFILE(name_registration);
-
- /* parse NameRegistrationResponse */
- switch (response_method) {
- case lassoHttpMethodSoap:
- profile->response = lasso_register_name_identifier_response_new_from_export(response_msg, lassoNodeExportTypeSoap);
- break;
- case lassoHttpMethodRedirect:
- profile->response = lasso_register_name_identifier_response_new_from_export(response_msg, lassoNodeExportTypeQuery);
- break;
- default:
- message(G_LOG_LEVEL_CRITICAL, "Unknown response method\n");
- ret = -1;
- goto done;
- }
-
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
- if (statusCode == NULL) {
- message(G_LOG_LEVEL_CRITICAL, "StatusCode not found\n");
- ret = -1;
- goto done;
- }
- statusCodeValue = lasso_node_get_attr_value(statusCode, "Value", NULL);
- if (statusCodeValue == NULL) {
- message(G_LOG_LEVEL_CRITICAL, "StatusCodeValue not found\n");
- ret = -1;
- goto done;
- }
-
- if(!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
- ret = -1;
- goto done;
- }
-
- done:
-
- return ret;
-}
-
/*****************************************************************************/
/* overrided parent class methods */
/*****************************************************************************/