summaryrefslogtreecommitdiffstats
path: root/lasso/id-ff
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-08-05 15:47:26 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-08-05 15:47:26 +0000
commit8895c1da920efe28b9242f08bd62ef25963f3262 (patch)
treedabf06783231a3c865e8142e515d981fede23190 /lasso/id-ff
parent5315915ec79507e6b3ca3a3372ea0cf25faf57de (diff)
downloadlasso-8895c1da920efe28b9242f08bd62ef25963f3262.tar.gz
lasso-8895c1da920efe28b9242f08bd62ef25963f3262.tar.xz
lasso-8895c1da920efe28b9242f08bd62ef25963f3262.zip
fixed coding style
Diffstat (limited to 'lasso/id-ff')
-rw-r--r--lasso/id-ff/federation_termination.c32
-rw-r--r--lasso/id-ff/lecp.c26
-rw-r--r--lasso/id-ff/logout.c82
-rw-r--r--lasso/id-ff/register_name_identifier.c60
4 files changed, 100 insertions, 100 deletions
diff --git a/lasso/id-ff/federation_termination.c b/lasso/id-ff/federation_termination.c
index ded48856..7c180dd8 100644
--- a/lasso/id-ff/federation_termination.c
+++ b/lasso/id-ff/federation_termination.c
@@ -42,7 +42,7 @@ lasso_federation_termination_build_notification_msg(LassoFederationTermination *
profile = LASSO_PROFILE(defederation);
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider == NULL) {
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider %s not found\n", profile->remote_providerID);
return(-2);
}
@@ -58,25 +58,25 @@ lasso_federation_termination_build_notification_msg(LassoFederationTermination *
protocolProfile = lasso_provider_get_federationTerminationNotificationProtocolProfile(provider,
provider_type,
NULL);
- if(protocolProfile == NULL) {
+ if (protocolProfile == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Federation termination notification protocol profile not found\n");
return(-3);
}
- if(xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
- xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
+ if (xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
+ xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
profile->request_type = lassoHttpMethodSoap;
profile->msg_url = lasso_provider_get_federationTerminationServiceURL(provider,
lassoProviderTypeIdp,
NULL);
- if(profile->msg_url == NULL) {
+ if (profile->msg_url == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Federation Termination Notification url not found\n");
return(-4);
}
profile->msg_body = lasso_node_export_to_soap(profile->request);
}
- else if(xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
- xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
+ else if (xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
+ xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
profile->request_type = lassoHttpMethodRedirect;
profile->msg_url = lasso_node_export_to_query(profile->request,
profile->server->signature_method,
@@ -137,16 +137,16 @@ lasso_federation_termination_init_notification(LassoFederationTermination *defed
}
/* get the name identifier (!!! depend on the provider type : SP or IDP !!!)*/
- switch(profile->provider_type) {
+ switch (profile->provider_type) {
case lassoProviderTypeSp:
nameIdentifier = LASSO_NODE(lasso_federation_get_local_nameIdentifier(federation));
- if(!nameIdentifier) {
+ if (!nameIdentifier) {
nameIdentifier = LASSO_NODE(lasso_federation_get_remote_nameIdentifier(federation));
}
break;
case lassoProviderTypeIdp:
nameIdentifier = LASSO_NODE(lasso_federation_get_remote_nameIdentifier(federation));
- if(!nameIdentifier) {
+ if (!nameIdentifier) {
nameIdentifier = LASSO_NODE(lasso_federation_get_local_nameIdentifier(federation));
}
break;
@@ -155,7 +155,7 @@ lasso_federation_termination_init_notification(LassoFederationTermination *defed
}
lasso_federation_destroy(federation);
- if(!nameIdentifier) {
+ if (!nameIdentifier) {
message(G_LOG_LEVEL_CRITICAL, "Name identifier not found for %s\n", profile->remote_providerID);
codeError = -1;
goto done;
@@ -170,7 +170,7 @@ lasso_federation_termination_init_notification(LassoFederationTermination *defed
nameQualifier,
format);
- if(profile->request == NULL) {
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while creating the notification\n");
codeError = -1;
goto done;
@@ -199,7 +199,7 @@ lasso_federation_termination_load_notification_msg(LassoFederationTermination *d
profile = LASSO_PROFILE(defederation);
- switch(notification_method){
+ switch (notification_method){
case lassoHttpMethodSoap:
debug("Build a federation termination notification from soap msg\n");
profile->request = lasso_federation_termination_notification_new_from_export(notification_msg, lassoNodeExportTypeSoap);
@@ -237,7 +237,7 @@ lasso_federation_termination_process_notification(LassoFederationTermination *de
profile = LASSO_PROFILE(defederation);
- if(profile->request == NULL){
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Request not found\n");
return(-1);
}
@@ -245,14 +245,14 @@ lasso_federation_termination_process_notification(LassoFederationTermination *de
/* set the remote provider id from the request */
profile->remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
NULL, NULL);
- if(profile->remote_providerID == NULL) {
+ if (profile->remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Remote provider id not found\n");
return(-1);
}
nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier",
NULL, NULL);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Name identifier not found in request\n");
return(-1);
}
diff --git a/lasso/id-ff/lecp.c b/lasso/id-ff/lecp.c
index 4a8ec8e8..719c51de 100644
--- a/lasso/id-ff/lecp.c
+++ b/lasso/id-ff/lecp.c
@@ -44,12 +44,12 @@ lasso_lecp_build_authn_request_envelope_msg(LassoLecp *lecp)
assertionConsumerServiceURL = lasso_provider_get_assertionConsumerServiceURL(LASSO_PROVIDER(profile->server),
lassoProviderTypeSp,
NULL);
- if(assertionConsumerServiceURL==NULL){
+ if (assertionConsumerServiceURL == NULL) {
message(G_LOG_LEVEL_CRITICAL, "AssertionConsumerServiceURL not found\n");
return(-1);
}
- if(profile->request==NULL){
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "AuthnRequest not found\n");
return(-1);
}
@@ -57,14 +57,14 @@ lasso_lecp_build_authn_request_envelope_msg(LassoLecp *lecp)
lecp->authnRequestEnvelope = lasso_authn_request_envelope_new(LASSO_AUTHN_REQUEST(profile->request),
profile->server->providerID,
assertionConsumerServiceURL);
- if(lecp->authnRequestEnvelope==NULL){
+ if (lecp->authnRequestEnvelope==NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while building AuthnRequestEnvelope\n");
return(-1);
}
/* FIXME : export to base 64 or simple xml dump */
profile->msg_body = lasso_node_export_to_base64(lecp->authnRequestEnvelope);
- if(profile->msg_body==NULL){
+ if (profile->msg_body==NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while exporting the AuthnRequestEnvelope to POST msg\n");
return(-1);
}
@@ -83,7 +83,7 @@ lasso_lecp_build_authn_request_msg(LassoLecp *lecp)
profile->msg_url = NULL; /* Proxy knows the SOAP EndPoint of the IDP */
profile->msg_body = lasso_node_export_to_soap(profile->request);
- if(profile->msg_body==NULL){
+ if (profile->msg_body==NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while building the AuthnRequest SOAP message\n");
return(-1);
}
@@ -100,12 +100,12 @@ lasso_lecp_build_authn_response_msg(LassoLecp *lecp)
profile = LASSO_PROFILE(lecp);
profile->msg_url = g_strdup(lecp->assertionConsumerServiceURL);
- if(profile->msg_url==NULL){
+ if (profile->msg_url==NULL) {
message(G_LOG_LEVEL_CRITICAL, "AssertionConsumerServiceURL not found\n");
return(-1);
}
profile->msg_body = lasso_node_export_to_base64(profile->response);
- if(profile->msg_body==NULL){
+ if (profile->msg_body==NULL) {
message(G_LOG_LEVEL_CRITICAL, "AuthnResponse base64 msg not found\n");
return(-1);
}
@@ -124,13 +124,13 @@ lasso_lecp_build_authn_response_envelope_msg(LassoLecp *lecp)
profile = LASSO_PROFILE(lecp);
- if(LASSO_IS_AUTHN_RESPONSE(profile->response)==FALSE){
+ if (LASSO_IS_AUTHN_RESPONSE(profile->response) == FALSE) {
message(G_LOG_LEVEL_CRITICAL, "AuthnResponse not found\n");
return(-1);
}
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider==NULL){
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider %s not found\n", profile->remote_providerID);
return(-1);
}
@@ -138,7 +138,7 @@ lasso_lecp_build_authn_response_envelope_msg(LassoLecp *lecp)
assertionConsumerServiceURL = lasso_provider_get_assertionConsumerServiceURL(provider,
lassoProviderTypeSp,
NULL);
- if(assertionConsumerServiceURL==NULL){
+ if (assertionConsumerServiceURL == NULL) {
message(G_LOG_LEVEL_CRITICAL, "AssertionConsumerServiceURL not found\n");
return(-1);
}
@@ -179,7 +179,7 @@ lasso_lecp_init_from_authn_request_msg(LassoLecp *lecp,
g_return_val_if_fail(LASSO_IS_LECP(lecp), -1);
g_return_val_if_fail(authn_request_msg!=NULL, -1);
- if(authn_request_method!=lassoHttpMethodSoap){
+ if (authn_request_method != lassoHttpMethodSoap) {
message(G_LOG_LEVEL_CRITICAL, "Invalid authentication request method\n");
return(-1);
}
@@ -201,7 +201,7 @@ lasso_lecp_process_authn_request_envelope_msg(LassoLecp *lecp,
}
LASSO_PROFILE(lecp)->request = lasso_authn_request_envelope_get_authnRequest(LASSO_AUTHN_REQUEST_ENVELOPE(lecp->authnRequestEnvelope));
- if(LASSO_PROFILE(lecp)->request==NULL){
+ if (LASSO_PROFILE(lecp)->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "AuthnRequest not found\n");
return(-1);
}
@@ -313,7 +313,7 @@ lasso_lecp_new(LassoServer *server)
lecp = g_object_new(LASSO_TYPE_LECP, NULL);
- if(LASSO_IS_SERVER(server)){
+ if (LASSO_IS_SERVER(server)) {
debug("Add server to lecp object\n");
LASSO_PROFILE(lecp)->server = lasso_server_copy(server);
}
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c
index 5a7fc81a..43d18af2 100644
--- a/lasso/id-ff/logout.c
+++ b/lasso/id-ff/logout.c
@@ -72,7 +72,7 @@ lasso_logout_build_request_msg(LassoLogout *logout)
profile = LASSO_PROFILE(logout);
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider == NULL) {
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider %s not found\n", profile->remote_providerID);
return(-2);
}
@@ -82,13 +82,13 @@ lasso_logout_build_request_msg(LassoLogout *logout)
lassoProviderTypeIdp,
NULL);
- if(protocolProfile == NULL) {
+ if (protocolProfile == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Single Logout Protocol profile not found\n");
return(-3);
}
- if(xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
- xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
+ if (xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
+ xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
debug("Building a soap request message\n");
profile->request_type = lassoHttpMethodSoap;
@@ -104,8 +104,8 @@ lasso_logout_build_request_msg(LassoLogout *logout)
NULL);
profile->msg_body = lasso_node_export_to_soap(profile->request);
}
- else if(xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
- xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
+ else if (xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
+ xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
debug("Building a http get request message\n");
profile->request_type = lassoHttpMethodRedirect;
profile->msg_url = lasso_provider_get_singleLogoutServiceURL(provider,
@@ -127,7 +127,7 @@ lasso_logout_build_response_msg(LassoLogout *logout)
LassoProvider *provider;
xmlChar *protocolProfile;
- if(!LASSO_IS_LOGOUT(logout)){
+ if (LASSO_IS_LOGOUT(logout) == FALSE) {
message(G_LOG_LEVEL_CRITICAL, "Not a Logout object\n");
return(-1);
}
@@ -135,7 +135,7 @@ lasso_logout_build_response_msg(LassoLogout *logout)
profile = LASSO_PROFILE(logout);
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider == NULL) {
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider not found %s\n", profile->remote_providerID);
return(-2);
}
@@ -143,19 +143,19 @@ lasso_logout_build_response_msg(LassoLogout *logout)
protocolProfile = lasso_provider_get_singleLogoutProtocolProfile(provider,
lassoProviderTypeSp,
NULL);
- if(protocolProfile == NULL) {
+ if (protocolProfile == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Single Logout Protocol profile not found\n");
return(-3);
}
- if(xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
- xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
+ if (xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
+ xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
debug("Building a soap response message\n");
profile->msg_url = NULL;
profile->msg_body = lasso_node_export_to_soap(profile->response);
}
- else if(xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
- xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
+ else if (xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
+ xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
debug("Building a http get response message\n");
profile->response_type = lassoHttpMethodRedirect;
profile->msg_url = lasso_node_export_to_query(profile->response,
@@ -186,10 +186,10 @@ lasso_logout_get_next_providerID(LassoLogout *logout)
profile = LASSO_PROFILE(logout);
/* if a ProviderID from a SP request, pass it and return the next provider id found */
- for(i = 0; i<profile->session->providerIDs->len; i++){
+ for (i = 0; i < profile->session->providerIDs->len; i++) {
current_provider_id = g_strdup(g_ptr_array_index(profile->session->providerIDs, i));
- if(logout->initial_remote_providerID!=NULL){
- if(xmlStrEqual(current_provider_id, logout->initial_remote_providerID)){
+ if (logout->initial_remote_providerID != NULL) {
+ if (xmlStrEqual(current_provider_id, logout->initial_remote_providerID)) {
debug("It's the ProviderID of the SP requester (%s) : %s, pass it\n",
logout->initial_remote_providerID,
current_provider_id);
@@ -217,7 +217,7 @@ lasso_logout_init_request(LassoLogout *logout,
profile = LASSO_PROFILE(logout);
- if(remote_providerID == NULL) {
+ if (remote_providerID == NULL) {
/* message(G_LOG_LEVEL_INFO, "No remote provider id, get the next assertion peer provider id\n"); */
profile->remote_providerID = lasso_session_get_next_assertion_remote_providerID(profile->session);
}
@@ -226,29 +226,29 @@ lasso_logout_init_request(LassoLogout *logout,
profile->remote_providerID = g_strdup(remote_providerID);
}
- if(profile->remote_providerID == NULL) {
+ if (profile->remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "No provider id for init request\n");
return(-2);
}
/* get federation */
federation = lasso_identity_get_federation(profile->identity, profile->remote_providerID);
- if(federation == NULL) {
+ if (federation == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Federation not found\n");
return(-3);
}
/* get the name identifier (!!! depend on the provider type : SP or IDP !!!)*/
- switch(profile->provider_type){
+ switch (profile->provider_type) {
case lassoProviderTypeSp:
nameIdentifier = lasso_federation_get_local_nameIdentifier(federation);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
nameIdentifier = lasso_federation_get_remote_nameIdentifier(federation);
}
break;
case lassoProviderTypeIdp:
nameIdentifier = lasso_federation_get_remote_nameIdentifier(federation);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
nameIdentifier = lasso_federation_get_local_nameIdentifier(federation);
}
break;
@@ -258,7 +258,7 @@ lasso_logout_init_request(LassoLogout *logout,
}
lasso_federation_destroy(federation);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Name identifier not found for %s\n",
profile->remote_providerID);
return(-5);
@@ -281,7 +281,7 @@ lasso_logout_init_request(LassoLogout *logout,
xmlFree(format);
lasso_node_destroy(nameIdentifier);
- if(profile->request == NULL) {
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while creating the request\n");
return(-6);
}
@@ -300,7 +300,7 @@ gint lasso_logout_process_request_msg(LassoLogout *logout,
profile = LASSO_PROFILE(logout);
- switch(request_method) {
+ switch (request_method) {
case lassoHttpMethodSoap:
debug("Build a logout request from soap msg\n");
profile->request = lasso_logout_request_new_from_export(request_msg,
@@ -350,7 +350,7 @@ lasso_logout_validate_request(LassoLogout *logout)
profile = LASSO_PROFILE(logout);
- if(profile->request == NULL) {
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "LogoutRequest not found\n");
return(-1);
}
@@ -358,7 +358,7 @@ lasso_logout_validate_request(LassoLogout *logout)
/* set the remote provider id from the request */
remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
NULL, NULL);
- if(remote_providerID == NULL) {
+ if (remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "ProviderID in LogoutRequest not found\n");
return(-1);
}
@@ -368,7 +368,7 @@ lasso_logout_validate_request(LassoLogout *logout)
profile->response = lasso_logout_response_new(profile->server->providerID,
lassoSamlStatusCodeSuccess,
profile->request);
- if(profile->response == NULL) {
+ if (profile->response == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while building response\n");
return(-5);
}
@@ -378,7 +378,7 @@ lasso_logout_validate_request(LassoLogout *logout)
nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier",
NULL, NULL);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Name identifier not found in logout request\n");
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-6);
@@ -386,20 +386,20 @@ lasso_logout_validate_request(LassoLogout *logout)
remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
NULL, NULL);
- if(remote_providerID == NULL) {
+ if (remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider id not found in logout request\n");
return(-7);
}
/* verify authentication */
- if(profile->identity == NULL) {
+ if (profile->identity == NULL) {
message(G_LOG_LEVEL_WARNING, "Identity not found\n");
statusCode_class->set_prop(statusCode, "Value", lassoSamlStatusCodeRequestDenied);
return(-1);
}
assertion = lasso_session_get_assertion(profile->session, remote_providerID);
- if(assertion == NULL) {
+ if (assertion == NULL) {
message(G_LOG_LEVEL_WARNING, "%s has no assertion\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoSamlStatusCodeRequestDenied);
return(-8);
@@ -408,13 +408,13 @@ lasso_logout_validate_request(LassoLogout *logout)
/* Verify federation */
federation = lasso_identity_get_federation(profile->identity, remote_providerID);
- if(federation == NULL) {
+ if (federation == NULL) {
message(G_LOG_LEVEL_WARNING, "No federation for %s\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-9);
}
- if(lasso_federation_verify_nameIdentifier(federation, nameIdentifier) == FALSE) {
+ if (lasso_federation_verify_nameIdentifier(federation, nameIdentifier) == FALSE) {
message(G_LOG_LEVEL_WARNING, "No name identifier for %s\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-10);
@@ -423,9 +423,9 @@ lasso_logout_validate_request(LassoLogout *logout)
/* verification is ok, save name identifier in logout object */
lasso_session_remove_assertion(profile->session, profile->remote_providerID);
- if(profile->provider_type==lassoProviderTypeIdp){
+ if (profile->provider_type == lassoProviderTypeIdp) {
logout->initial_remote_providerID = g_strdup(profile->remote_providerID);
- if(profile->session->providerIDs->len>1){
+ if (profile->session->providerIDs->len>1) {
logout->initial_request = profile->request;
profile->request = NULL;
logout->initial_response = profile->response;
@@ -452,7 +452,7 @@ lasso_logout_process_response_msg(LassoLogout *logout,
profile = LASSO_PROFILE(logout);
/* parse LogoutResponse */
- switch(response_method) {
+ switch (response_method) {
case lassoHttpMethodSoap:
profile->response = lasso_logout_response_new_from_export(response_msg, lassoNodeExportTypeSoap);
break;
@@ -464,20 +464,20 @@ lasso_logout_process_response_msg(LassoLogout *logout,
return(-3);
}
- if(profile->response == NULL) {
+ if (profile->response == NULL) {
message(G_LOG_LEVEL_CRITICAL, "LogoutResponse is NULL\n");
return(-1);
}
statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
- if(statusCode == NULL) {
+ if (statusCode == NULL) {
message(G_LOG_LEVEL_CRITICAL, "StatusCode node not found\n");
return(-1);
}
statusCodeValue = lasso_node_get_attr_value(statusCode, "Value", NULL);
- if(!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
+ if (!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
message(G_LOG_LEVEL_WARNING, "Status code value is not Success\n");
return(-1);
}
@@ -489,7 +489,7 @@ lasso_logout_process_response_msg(LassoLogout *logout,
lasso_session_remove_assertion(profile->session, profile->remote_providerID);
/* response is ok, so delete the assertion */
- switch(profile->provider_type) {
+ switch (profile->provider_type) {
case lassoProviderTypeSp:
break;
case lassoProviderTypeIdp:
diff --git a/lasso/id-ff/register_name_identifier.c b/lasso/id-ff/register_name_identifier.c
index aa05a46c..26b885d5 100644
--- a/lasso/id-ff/register_name_identifier.c
+++ b/lasso/id-ff/register_name_identifier.c
@@ -55,7 +55,7 @@ lasso_register_name_identifier_build_request_msg(LassoRegisterNameIdentifier *re
profile = LASSO_PROFILE(register_name_identifier);
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider == NULL) {
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider %s not found\n", profile->remote_providerID);
return(-2);
}
@@ -64,13 +64,13 @@ lasso_register_name_identifier_build_request_msg(LassoRegisterNameIdentifier *re
protocolProfile = lasso_provider_get_registerNameIdentifierProtocolProfile(provider,
lassoProviderTypeIdp,
NULL);
- if(protocolProfile == NULL) {
+ if (protocolProfile == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Register_Name_Identifier Protocol profile not found\n");
return(-3);
}
- if(xmlStrEqual(protocolProfile, lassoLibProtocolProfileRniIdpSoap) || \
- xmlStrEqual(protocolProfile, lassoLibProtocolProfileRniSpSoap)) {
+ if (xmlStrEqual(protocolProfile, lassoLibProtocolProfileRniIdpSoap) || \
+ xmlStrEqual(protocolProfile, lassoLibProtocolProfileRniSpSoap)) {
profile->request_type = lassoHttpMethodSoap;
/* sign the request message */
@@ -85,8 +85,8 @@ lasso_register_name_identifier_build_request_msg(LassoRegisterNameIdentifier *re
NULL);
profile->msg_body = lasso_node_export_to_soap(profile->request);
}
- else if(xmlStrEqual(protocolProfile,lassoLibProtocolProfileRniIdpHttp) || \
- xmlStrEqual(protocolProfile,lassoLibProtocolProfileRniSpHttp)) {
+ else if (xmlStrEqual(protocolProfile,lassoLibProtocolProfileRniIdpHttp) || \
+ xmlStrEqual(protocolProfile,lassoLibProtocolProfileRniSpHttp)) {
debug("Building a http get request message\n");
}
else {
@@ -108,7 +108,7 @@ lasso_register_name_identifier_build_response_msg(LassoRegisterNameIdentifier *r
profile = LASSO_PROFILE(register_name_identifier);
provider = lasso_server_get_provider_ref(profile->server, profile->remote_providerID);
- if(provider == NULL) {
+ if (provider == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Provider not found (ProviderID = %s)\n", profile->remote_providerID);
return(-2);
}
@@ -116,21 +116,21 @@ lasso_register_name_identifier_build_response_msg(LassoRegisterNameIdentifier *r
protocolProfile = lasso_provider_get_registerNameIdentifierProtocolProfile(provider,
lassoProviderTypeSp,
NULL);
- if(protocolProfile == NULL) {
+ if (protocolProfile == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Register name identifier protocol profile not found\n");
return(-3);
}
- if(xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
- xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
+ if (xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloSpSoap) || \
+ xmlStrEqual(protocolProfile, lassoLibProtocolProfileSloIdpSoap)) {
debug("building a soap response message\n");
profile->msg_url = lasso_provider_get_registerNameIdentifierServiceURL(provider,
lassoProviderTypeSp,
NULL);
profile->msg_body = lasso_node_export_to_soap(profile->response);
}
- else if(xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
- xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
+ else if (xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloSpHttp) || \
+ xmlStrEqual(protocolProfile,lassoLibProtocolProfileSloIdpHttp)) {
debug("building a http get response message\n");
}
@@ -159,7 +159,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
profile = LASSO_PROFILE(register_name_identifier);
- if(remote_providerID == NULL) {
+ if (remote_providerID == NULL) {
message(G_LOG_LEVEL_INFO, "No remote provider id, get the next federation peer provider id\n");
profile->remote_providerID = lasso_identity_get_next_federation_remote_providerID(profile->identity);
}
@@ -167,19 +167,19 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
message(G_LOG_LEVEL_INFO, "A remote provider id for register name identifier request : %s\n", remote_providerID);
profile->remote_providerID = g_strdup(remote_providerID);
}
- if(profile->remote_providerID == NULL) {
+ if (profile->remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "No provider id for init request\n");
return(-2);
}
/* get federation */
federation = lasso_identity_get_federation(profile->identity, profile->remote_providerID);
- if(federation == NULL) {
+ if (federation == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Federation not found\n");
return(-3);
}
printf("plop\n");
- switch(profile->provider_type){
+ switch (profile->provider_type) {
case lassoProviderTypeSp:
debug("Service Provider\n");
/* set the new name identifier */
@@ -189,7 +189,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
/* set the old name identifier */
nameIdentifier_node = lasso_federation_get_local_nameIdentifier(federation);
- if(nameIdentifier_node != NULL) {
+ if (nameIdentifier_node != NULL) {
oldNameIdentifier = lasso_node_get_content(nameIdentifier_node, NULL);
oldNameQualifier = lasso_node_get_attr_value(nameIdentifier_node, "NameQualifier", NULL);
oldFormat = lasso_node_get_attr_value(nameIdentifier_node, "Format", NULL);
@@ -198,7 +198,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
/* idp name identifier */
nameIdentifier_node = lasso_federation_get_remote_nameIdentifier(federation);
- if(nameIdentifier_node == NULL) {
+ if (nameIdentifier_node == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Remote NameIdentifier for service provider not found\n");
return(-1);
}
@@ -208,7 +208,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
lasso_node_destroy(nameIdentifier_node);
/* if old name identifier (Service provider) not found, set with federation provider */
- if(oldNameIdentifier == NULL) {
+ if (oldNameIdentifier == NULL) {
oldNameIdentifier = g_strdup(idpNameIdentifier);
oldNameQualifier = g_strdup(idpNameQualifier);
oldFormat = g_strdup(idpFormat);
@@ -227,7 +227,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
oldFormat = lasso_node_get_attr_value(nameIdentifier_node, "Format", NULL);
nameIdentifier_node = lasso_federation_get_remote_nameIdentifier(federation);
- if(nameIdentifier_node != NULL) {
+ if (nameIdentifier_node != NULL) {
spNameIdentifier = lasso_node_get_content(nameIdentifier_node, NULL);
spNameQualifier = lasso_node_get_attr_value(nameIdentifier_node, "NameQualifier", NULL);
spFormat = lasso_node_get_attr_value(nameIdentifier_node, "Format", NULL);
@@ -260,7 +260,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
oldNameQualifier,
oldFormat);
- if(profile->request == NULL) {
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while creating the request\n");
return(-6);
}
@@ -279,7 +279,7 @@ gint lasso_register_name_identifier_load_request_msg(LassoRegisterNameIdentifier
profile = LASSO_PROFILE(register_name_identifier);
- switch(request_method) {
+ switch (request_method) {
case lassoHttpMethodSoap:
debug("Build a register name identifier request from soap msg\n");
profile->request = lasso_register_name_identifier_request_new_from_export(request_msg, lassoNodeExportTypeSoap);
@@ -295,7 +295,7 @@ gint lasso_register_name_identifier_load_request_msg(LassoRegisterNameIdentifier
message(G_LOG_LEVEL_CRITICAL, "Invalid request method\n");
return(-3);
}
- if(profile->request == NULL) {
+ if (profile->request == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while building the request from msg\n");
return(-4);
}
@@ -334,7 +334,7 @@ lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier *regi
(gchar *)lassoSamlStatusCodeSuccess,
profile->request);
- if(profile->response == NULL) {
+ if (profile->response == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Error while building response\n");
return(-4);
}
@@ -343,27 +343,27 @@ lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier *regi
statusCode_class = LASSO_NODE_GET_CLASS(statusCode);
nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL, NULL);
- if(nameIdentifier == NULL) {
+ if (nameIdentifier == NULL) {
message(G_LOG_LEVEL_CRITICAL, "No name identifier found in register_name_identifier request\n");
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-5);
}
remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL, NULL);
- if(remote_providerID == NULL) {
+ if (remote_providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "No provider id found in register_name_identifier request\n");
return(-6);
}
/* Verify federation */
federation = lasso_identity_get_federation(profile->identity, remote_providerID);
- if(federation == NULL) {
+ if (federation == NULL) {
message(G_LOG_LEVEL_WARNING, "No federation for %s\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-7);
}
- if(lasso_federation_verify_nameIdentifier(federation, nameIdentifier) == FALSE) {
+ if (lasso_federation_verify_nameIdentifier(federation, nameIdentifier) == FALSE) {
message(G_LOG_LEVEL_WARNING, "No name identifier for %s\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-8);
@@ -372,7 +372,7 @@ lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier *regi
/* verify authentication (if ok, delete assertion) */
assertion = lasso_session_get_assertion(profile->session, remote_providerID);
- if(assertion == NULL) {
+ if (assertion == NULL) {
message(G_LOG_LEVEL_WARNING, "%s has no assertion\n", remote_providerID);
statusCode_class->set_prop(statusCode, "Value", lassoSamlStatusCodeRequestDenied);
lasso_node_destroy(assertion);
@@ -399,7 +399,7 @@ lasso_register_name_identifier_process_response_msg(LassoRegisterNameIdentifier
profile = LASSO_PROFILE(register_name_identifier);
/* parse RegisterNameIdentifierResponse */
- switch(response_method){
+ switch (response_method) {
case lassoHttpMethodSoap:
profile->response = lasso_register_name_identifier_response_new_from_export(response_msg, lassoNodeExportTypeSoap);
break;