summaryrefslogtreecommitdiffstats
path: root/lasso/id-ff
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-07-31 20:34:46 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-07-31 20:34:46 +0000
commit0ecf1691ba1f1590b480ee53a6af0c0dbb66424a (patch)
treeb8bee0ef463e7bdb376789c19f5d0d77f2fcb3e9 /lasso/id-ff
parented561ce190fb10c4dc35e8c23c39c7292f14e5bc (diff)
downloadlasso-0ecf1691ba1f1590b480ee53a6af0c0dbb66424a.tar.gz
lasso-0ecf1691ba1f1590b480ee53a6af0c0dbb66424a.tar.xz
lasso-0ecf1691ba1f1590b480ee53a6af0c0dbb66424a.zip
Added a new argument 'err' in 4 methods of the LassoNode class:
lasso_node_get_attr lasso_node_get_child lasso_node_get_child_content lasso_node_get_content for reporting errors.
Diffstat (limited to 'lasso/id-ff')
-rw-r--r--lasso/id-ff/federation_termination.c12
-rw-r--r--lasso/id-ff/identity.c19
-rw-r--r--lasso/id-ff/lecp.c7
-rw-r--r--lasso/id-ff/login.c80
-rw-r--r--lasso/id-ff/logout.c36
-rw-r--r--lasso/id-ff/name_identifier_mapping.c31
-rw-r--r--lasso/id-ff/profile.c12
-rw-r--r--lasso/id-ff/register_name_identifier.c24
-rw-r--r--lasso/id-ff/server.c6
-rw-r--r--lasso/id-ff/session.c5
10 files changed, 132 insertions, 100 deletions
diff --git a/lasso/id-ff/federation_termination.c b/lasso/id-ff/federation_termination.c
index 531ce9a9..a756b343 100644
--- a/lasso/id-ff/federation_termination.c
+++ b/lasso/id-ff/federation_termination.c
@@ -149,7 +149,7 @@ lasso_federation_termination_init_notification(LassoFederationTermination *defed
}
/* build the request */
- content = lasso_node_get_content(nameIdentifier);
+ content = lasso_node_get_content(nameIdentifier, NULL);
nameQualifier = lasso_node_get_attr_value(nameIdentifier, "NameQualifier", NULL);
format = lasso_node_get_attr_value(nameIdentifier, "Format", NULL);
profile->request = lasso_federation_termination_notification_new(profile->server->providerID,
@@ -206,11 +206,11 @@ lasso_federation_termination_load_notification_msg(LassoFederationTermination *d
/* get the NameIdentifier to load identity dump */
profile->nameIdentifier = lasso_node_get_child_content(profile->request,
- "NameIdentifier", NULL);
+ "NameIdentifier", NULL, NULL);
/* get the RelayState */
profile->msg_relayState = lasso_node_get_child_content(profile->request,
- "RelayState", NULL);
+ "RelayState", NULL, NULL);
return(0);
}
@@ -230,13 +230,15 @@ 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);
+ profile->remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
+ NULL, NULL);
if(profile->remote_providerID == NULL) {
message(G_LOG_LEVEL_ERROR, "Remote provider id not found\n");
return(-1);
}
- nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL);
+ nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier",
+ NULL, NULL);
if(nameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "Name identifier not found in request\n");
return(-1);
diff --git a/lasso/id-ff/identity.c b/lasso/id-ff/identity.c
index e8ce48b0..1d4c878d 100644
--- a/lasso/id-ff/identity.c
+++ b/lasso/id-ff/identity.c
@@ -378,7 +378,8 @@ lasso_identity_new_from_dump(gchar *dump)
/* federations */
federations_node = lasso_node_get_child(identity_node,
- LASSO_IDENTITY_FEDERATIONS_NODE, NULL);
+ LASSO_IDENTITY_FEDERATIONS_NODE,
+ NULL, NULL);
if (federations_node != NULL) {
federations_class = LASSO_NODE_GET_CLASS(federations_node);
federations_xmlNode = federations_class->get_xmlNode(federations_node);
@@ -403,22 +404,26 @@ lasso_identity_new_from_dump(gchar *dump)
/* local name identifier */
local_nameIdentifier_node = lasso_node_get_child(federation_node,
- LASSO_FEDERATION_LOCAL_NAME_IDENTIFIER_NODE, NULL);
+ LASSO_FEDERATION_LOCAL_NAME_IDENTIFIER_NODE,
+ NULL, NULL);
if (local_nameIdentifier_node != NULL) {
- nameIdentifier_node = lasso_node_get_child(local_nameIdentifier_node, "NameIdentifier", NULL);
+ nameIdentifier_node = lasso_node_get_child(local_nameIdentifier_node, "NameIdentifier",
+ NULL, NULL);
lasso_federation_set_local_nameIdentifier(federation, nameIdentifier_node);
- debug(" ... add local name identifier %s\n", lasso_node_get_content(nameIdentifier_node));
+ debug(" ... add local name identifier %s\n", lasso_node_get_content(nameIdentifier_node, NULL));
lasso_node_destroy(nameIdentifier_node);
lasso_node_destroy(local_nameIdentifier_node);
}
/* remote name identifier */
remote_nameIdentifier_node = lasso_node_get_child(federation_node,
- LASSO_FEDERATION_REMOTE_NAME_IDENTIFIER_NODE, NULL);
+ LASSO_FEDERATION_REMOTE_NAME_IDENTIFIER_NODE,
+ NULL, NULL);
if (remote_nameIdentifier_node != NULL) {
- nameIdentifier_node = lasso_node_get_child(remote_nameIdentifier_node, "NameIdentifier", NULL);
+ nameIdentifier_node = lasso_node_get_child(remote_nameIdentifier_node, "NameIdentifier",
+ NULL, NULL);
lasso_federation_set_remote_nameIdentifier(federation, nameIdentifier_node);
- debug(" ... add remote name identifier %s\n", lasso_node_get_content(nameIdentifier_node));
+ debug(" ... add remote name identifier %s\n", lasso_node_get_content(nameIdentifier_node, NULL));
lasso_node_destroy(nameIdentifier_node);
lasso_node_destroy(remote_nameIdentifier_node);
}
diff --git a/lasso/id-ff/lecp.c b/lasso/id-ff/lecp.c
index 97a267d7..38161097 100644
--- a/lasso/id-ff/lecp.c
+++ b/lasso/id-ff/lecp.c
@@ -132,15 +132,16 @@ lasso_lecp_init_authn_response_envelope(LassoLecp *lecp,
g_return_val_if_fail(LASSO_IS_AUTHN_REQUEST(authnRequest), -1);
lecp->server = lasso_server_copy(server);
- providerID = lasso_node_get_child_content(LASSO_NODE(authnRequest), "ProviderID", NULL);
- if(providerID==NULL){
+ providerID = lasso_node_get_child_content(LASSO_NODE(authnRequest), "ProviderID",
+ NULL, NULL);
+ if(providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "ProviderID not found\n");
return(-1);
}
provider = lasso_server_get_provider(lecp->server, providerID);
assertionConsumerServiceURL = lasso_provider_get_assertionConsumerServiceURL(provider);
- if(providerID==NULL){
+ if(providerID == NULL) {
message(G_LOG_LEVEL_CRITICAL, "AssertionConsumerServiceURL not found\n");
return(-1);
}
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c
index b7dab056..3370dd6e 100644
--- a/lasso/id-ff/login.c
+++ b/lasso/id-ff/login.c
@@ -51,8 +51,9 @@ lasso_login_get_assertion_nameIdentifier(LassoNode *assertion)
{
xmlChar *ni, *idp_ni;
- ni = lasso_node_get_child_content(assertion, "NameIdentifier", NULL);
- idp_ni = lasso_node_get_child_content(assertion, "IDPProvidedNameIdentifier", NULL);
+ ni = lasso_node_get_child_content(assertion, "NameIdentifier", NULL, NULL);
+ idp_ni = lasso_node_get_child_content(assertion, "IDPProvidedNameIdentifier",
+ NULL, NULL);
if (xmlStrEqual(ni, idp_ni) && idp_ni != NULL) {
xmlFree(ni);
@@ -64,7 +65,7 @@ lasso_login_get_assertion_nameIdentifier(LassoNode *assertion)
return (ni);
}
else {
- message(G_LOG_LEVEL_ERROR, "NameIdentifier value not found in AuthenticationStatement element.\n");
+ message(G_LOG_LEVEL_CRITICAL, "NameIdentifier value not found in AuthenticationStatement element.\n");
return (NULL);
}
}
@@ -85,7 +86,7 @@ lasso_login_add_response_assertion(LassoLogin *login,
"RequestID", &err);
if (requestID == NULL) {
- message(G_LOG_LEVEL_ERROR, err->message);
+ message(G_LOG_LEVEL_CRITICAL, err->message);
ret = err->code;
g_error_free(err);
return(ret);
@@ -103,7 +104,7 @@ lasso_login_add_response_assertion(LassoLogin *login,
LASSO_SAML_AUTHENTICATION_STATEMENT(authentication_statement));
}
else {
- message(G_LOG_LEVEL_ERROR, "Failed to build the AuthenticationStatement element of the Assertion.\n");
+ message(G_LOG_LEVEL_CRITICAL, "Failed to build the AuthenticationStatement element of the Assertion.\n");
lasso_node_destroy(assertion);
return(-3);
}
@@ -149,7 +150,7 @@ lasso_login_process_federation(LassoLogin *login)
federation = lasso_identity_get_federation(LASSO_PROFILE(login)->identity,
LASSO_PROFILE(login)->remote_providerID);
nameIDPolicy = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
- "NameIDPolicy", NULL);
+ "NameIDPolicy", NULL, NULL);
if (nameIDPolicy == NULL || xmlStrEqual(nameIDPolicy, lassoLibNameIDPolicyTypeNone)) {
if (federation == NULL) {
lasso_profile_set_response_status(LASSO_PROFILE(login),
@@ -223,7 +224,8 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) {
assertion = lasso_node_get_child(LASSO_PROFILE(login)->response,
"Assertion",
- lassoLibHRef);
+ lassoLibHRef,
+ NULL);
idp = lasso_server_get_provider(LASSO_PROFILE(login)->server,
LASSO_PROFILE(login)->remote_providerID);
@@ -249,13 +251,13 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) {
/* check StatusCode value */
status = lasso_node_get_child(LASSO_PROFILE(login)->response,
- "Status", lassoSamlProtocolHRef);
+ "Status", lassoSamlProtocolHRef, NULL);
if (status == NULL) {
message(G_LOG_LEVEL_ERROR, "Status element not found in response.\n");
ret = -9;
goto done;
}
- statusCode = lasso_node_get_child(status, "StatusCode", lassoSamlProtocolHRef);
+ statusCode = lasso_node_get_child(status, "StatusCode", lassoSamlProtocolHRef, NULL);
if (statusCode == NULL) {
message(G_LOG_LEVEL_ERROR, "StatusCode element not found in Status.\n");
@@ -306,7 +308,7 @@ lasso_login_accept_sso(LassoLogin *login)
if (LASSO_PROFILE(login)->response != NULL) {
assertion = lasso_node_get_child(LASSO_PROFILE(login)->response,
- "Assertion", lassoLibHRef);
+ "Assertion", lassoLibHRef, NULL);
if (assertion == NULL) {
message(G_LOG_LEVEL_ERROR, "Assertion element not found in response.\n");
ret = -2;
@@ -319,14 +321,16 @@ lasso_login_accept_sso(LassoLogin *login)
assertion);
/* put the 2 NameIdentifiers in identity object */
- nameIdentifier = lasso_node_get_child(assertion, "NameIdentifier", lassoSamlAssertionHRef);
+ nameIdentifier = lasso_node_get_child(assertion, "NameIdentifier",
+ lassoSamlAssertionHRef, NULL);
if (nameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "NameIdentifier element not found in assertion.\n");
ret = -3;
goto done;
}
- idpProvidedNameIdentifier = lasso_node_get_child(assertion, "IDPProvidedNameIdentifier", lassoLibHRef);
+ idpProvidedNameIdentifier = lasso_node_get_child(assertion, "IDPProvidedNameIdentifier",
+ lassoLibHRef, NULL);
if (idpProvidedNameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "IDPProvidedNameIdentifier element not found in assertion.\n");
ret = -4;
@@ -389,13 +393,13 @@ lasso_login_build_artifact_msg(LassoLogin *login,
if (authentication_result == 0) {
lasso_profile_set_response_status(LASSO_PROFILE(login),
- lassoSamlStatusCodeRequestDenied);
+ lassoSamlStatusCodeRequestDenied);
}
else {
/* federation */
lasso_login_process_federation(login);
federation = lasso_identity_get_federation(LASSO_PROFILE(login)->identity,
- LASSO_PROFILE(login)->remote_providerID);
+ LASSO_PROFILE(login)->remote_providerID);
/* fill the response with the assertion */
if (federation != NULL) {
lasso_login_add_response_assertion(login,
@@ -422,7 +426,7 @@ lasso_login_build_artifact_msg(LassoLogin *login,
b64_samlArt = (gchar *)xmlSecBase64Encode(samlArt, 42, 0);
g_free(samlArt);
relayState = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
- "RelayState", NULL);
+ "RelayState", NULL, NULL);
switch (method) {
case lassoHttpMethodRedirect:
@@ -466,7 +470,9 @@ lasso_login_build_authn_request_msg(LassoLogin *login)
LASSO_PROFILE(login)->remote_providerID);
/* check if authnRequest must be signed */
- md_authnRequestsSigned = lasso_node_get_child_content(provider->metadata, "AuthnRequestsSigned", NULL);
+ md_authnRequestsSigned = lasso_node_get_child_content(provider->metadata,
+ "AuthnRequestsSigned",
+ NULL, NULL);
if (md_authnRequestsSigned != NULL) {
must_sign = xmlStrEqual(md_authnRequestsSigned, "true");
xmlFree(md_authnRequestsSigned);
@@ -687,7 +693,7 @@ lasso_login_init_from_authn_request_msg(LassoLogin *login,
/* get ProtocolProfile */
protocolProfile = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
- "ProtocolProfile", NULL);
+ "ProtocolProfile", NULL, NULL);
if (protocolProfile == NULL) {
login->protocolProfile = lassoLoginProtocolProfileBrwsArt;
}
@@ -716,12 +722,13 @@ lasso_login_init_from_authn_request_msg(LassoLogin *login,
/* get remote ProviderID */
LASSO_PROFILE(login)->remote_providerID = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
- "ProviderID", NULL);
+ "ProviderID", NULL, NULL);
remote_provider = lasso_server_get_provider(LASSO_PROFILE(login)->server,
LASSO_PROFILE(login)->remote_providerID);
/* Is authnRequest signed ? */
- md_authnRequestsSigned = lasso_node_get_child_content(remote_provider->metadata, "AuthnRequestsSigned", NULL);
+ md_authnRequestsSigned = lasso_node_get_child_content(remote_provider->metadata,
+ "AuthnRequestsSigned", NULL, NULL);
if (md_authnRequestsSigned != NULL) {
must_verify_signature = xmlStrEqual(md_authnRequestsSigned, "true");
xmlFree(md_authnRequestsSigned);
@@ -819,7 +826,8 @@ lasso_login_must_authenticate(LassoLogin *login)
gchar *str;
/* verify if the user must be authenticated or not */
- str = lasso_node_get_child_content(LASSO_PROFILE(login)->request, "IsPassive", NULL);
+ str = lasso_node_get_child_content(LASSO_PROFILE(login)->request, "IsPassive",
+ NULL, NULL);
if (str != NULL) {
if (xmlStrEqual(str, "false")) {
isPassive = FALSE;
@@ -827,7 +835,8 @@ lasso_login_must_authenticate(LassoLogin *login)
xmlFree(str);
}
- str = lasso_node_get_child_content(LASSO_PROFILE(login)->request, "ForceAuthn", NULL);
+ str = lasso_node_get_child_content(LASSO_PROFILE(login)->request, "ForceAuthn",
+ NULL, NULL);
if (str != NULL) {
if (xmlStrEqual(str, "true")) {
forceAuthn = TRUE;
@@ -866,7 +875,8 @@ lasso_login_process_request_msg(LassoLogin *login,
LASSO_PROFILE(login)->request_type = lassoMessageTypeRequest;
login->assertionArtifact = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
- "AssertionArtifact", lassoSamlProtocolHRef);
+ "AssertionArtifact",
+ lassoSamlProtocolHRef, NULL);
return (0);
}
@@ -995,17 +1005,17 @@ lasso_login_new_from_dump(LassoServer *server,
node_dump = lasso_node_new_from_dump(dump);
/* profile attributes */
- LASSO_PROFILE(login)->nameIdentifier = lasso_node_get_child_content(node_dump, "NameIdentifier", NULL);
- LASSO_PROFILE(login)->remote_providerID = lasso_node_get_child_content(node_dump, "RemoteProviderID", NULL);
- LASSO_PROFILE(login)->msg_url = lasso_node_get_child_content(node_dump, "MsgUrl", NULL);
- LASSO_PROFILE(login)->msg_body = lasso_node_get_child_content(node_dump, "MsgBody", NULL);
- LASSO_PROFILE(login)->msg_relayState = lasso_node_get_child_content(node_dump, "MsgRelayState", NULL);
+ LASSO_PROFILE(login)->nameIdentifier = lasso_node_get_child_content(node_dump, "NameIdentifier", NULL, NULL);
+ LASSO_PROFILE(login)->remote_providerID = lasso_node_get_child_content(node_dump, "RemoteProviderID", NULL, NULL);
+ LASSO_PROFILE(login)->msg_url = lasso_node_get_child_content(node_dump, "MsgUrl", NULL, NULL);
+ LASSO_PROFILE(login)->msg_body = lasso_node_get_child_content(node_dump, "MsgBody", NULL, NULL);
+ LASSO_PROFILE(login)->msg_relayState = lasso_node_get_child_content(node_dump, "MsgRelayState", NULL, NULL);
- type = lasso_node_get_child_content(node_dump, "RequestType", NULL);
+ type = lasso_node_get_child_content(node_dump, "RequestType", NULL, NULL);
LASSO_PROFILE(login)->request_type = atoi(type);
xmlFree(type);
- request_node = lasso_node_get_child(node_dump, "Request", NULL);
+ request_node = lasso_node_get_child(node_dump, "Request", NULL, NULL);
if (request_node != NULL) {
export = lasso_node_export(request_node);
switch (LASSO_PROFILE(login)->request_type) {
@@ -1024,11 +1034,11 @@ lasso_login_new_from_dump(LassoServer *server,
lasso_node_destroy(request_node);
}
- type = lasso_node_get_child_content(node_dump, "ResponseType", NULL);
+ type = lasso_node_get_child_content(node_dump, "ResponseType", NULL, NULL);
LASSO_PROFILE(login)->response_type = atoi(type);
xmlFree(type);
- response_node = lasso_node_get_child(node_dump, "Response", NULL);
+ response_node = lasso_node_get_child(node_dump, "Response", NULL, NULL);
if (response_node != NULL) {
export = lasso_node_export(response_node);
switch (LASSO_PROFILE(login)->response_type) {
@@ -1047,18 +1057,18 @@ lasso_login_new_from_dump(LassoServer *server,
lasso_node_destroy(response_node);
}
- type = lasso_node_get_child_content(node_dump, "ProviderType", NULL);
+ type = lasso_node_get_child_content(node_dump, "ProviderType", NULL, NULL);
LASSO_PROFILE(login)->provider_type = atoi(type);
xmlFree(type);
/* login attributes */
- protocolProfile = lasso_node_get_child_content(node_dump, "ProtocolProfile", NULL);
+ protocolProfile = lasso_node_get_child_content(node_dump, "ProtocolProfile", NULL, NULL);
if (protocolProfile != NULL) {
login->protocolProfile = atoi(protocolProfile);
xmlFree(protocolProfile);
}
- login->assertionArtifact = lasso_node_get_child_content(node_dump, "AssertionArtifact", NULL);
- login->response_dump = lasso_node_get_child_content(node_dump, "ResponseDump", NULL);
+ login->assertionArtifact = lasso_node_get_child_content(node_dump, "AssertionArtifact", NULL, NULL);
+ login->response_dump = lasso_node_get_child_content(node_dump, "ResponseDump", NULL, NULL);
lasso_node_destroy(node_dump);
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c
index 0145f1ec..15b95cb0 100644
--- a/lasso/id-ff/logout.c
+++ b/lasso/id-ff/logout.c
@@ -249,13 +249,15 @@ lasso_logout_init_request(LassoLogout *logout,
}
if(nameIdentifier == NULL) {
- message(G_LOG_LEVEL_ERROR, "Name identifier not found for %s\n", profile->remote_providerID);
+ message(G_LOG_LEVEL_ERROR, "Name identifier not found for %s\n",
+ profile->remote_providerID);
return(-5);
}
/* build the request */
- content = lasso_node_get_content(nameIdentifier);
- nameQualifier = lasso_node_get_attr_value(nameIdentifier, "NameQualifier", NULL);
+ content = lasso_node_get_content(nameIdentifier, NULL);
+ nameQualifier = lasso_node_get_attr_value(nameIdentifier, "NameQualifier",
+ NULL);
format = lasso_node_get_attr_value(nameIdentifier, "Format", NULL);
profile->request = lasso_logout_request_new(profile->server->providerID,
content,
@@ -288,11 +290,13 @@ gint lasso_logout_load_request_msg(LassoLogout *logout,
switch(request_method){
case lassoHttpMethodSoap:
debug("Build a logout request from soap msg\n");
- profile->request = lasso_logout_request_new_from_export(request_msg, lassoNodeExportTypeSoap);
+ profile->request = lasso_logout_request_new_from_export(request_msg,
+ lassoNodeExportTypeSoap);
break;
case lassoHttpMethodRedirect:
debug("Build a logout request from query msg\n");
- profile->request = lasso_logout_request_new_from_export(request_msg, lassoNodeExportTypeQuery);
+ profile->request = lasso_logout_request_new_from_export(request_msg,
+ lassoNodeExportTypeQuery);
break;
case lassoHttpMethodGet:
debug("TODO, implement the get method\n");
@@ -308,11 +312,13 @@ gint lasso_logout_load_request_msg(LassoLogout *logout,
/* get the NameIdentifier to load identity dump */
profile->nameIdentifier = lasso_node_get_child_content(profile->request,
- "NameIdentifier", NULL);
+ "NameIdentifier",
+ NULL, NULL);
/* get the RelayState */
profile->msg_relayState = lasso_node_get_child_content(profile->request,
- "RelayState", NULL);
+ "RelayState",
+ NULL, NULL);
return(0);
}
@@ -337,7 +343,8 @@ lasso_logout_process_request(LassoLogout *logout)
}
/* set the remote provider id from the request */
- remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
+ NULL, NULL);
if(remote_providerID == NULL) {
message(G_LOG_LEVEL_ERROR, "ProviderID in LogoutRequest not found\n");
return(-1);
@@ -353,17 +360,19 @@ lasso_logout_process_request(LassoLogout *logout)
return(-5);
}
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
statusCode_class = LASSO_NODE_GET_CLASS(statusCode);
- nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL);
+ nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier",
+ NULL, NULL);
if(nameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "Name identifier not found in logout request\n");
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-6);
}
- remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
+ NULL, NULL);
if(remote_providerID == NULL) {
message(G_LOG_LEVEL_ERROR, "Provider id not found in logout request\n");
return(-7);
@@ -457,7 +466,7 @@ lasso_logout_process_response_msg(LassoLogout *logout,
message(G_LOG_LEVEL_ERROR, "LogoutResponse is NULL\n");
return(-1);
}
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
if(statusCode == NULL) {
message(G_LOG_LEVEL_ERROR, "StatusCode node not found\n");
@@ -470,7 +479,8 @@ lasso_logout_process_response_msg(LassoLogout *logout,
return(-1);
}
- profile->remote_providerID = lasso_node_get_child_content(profile->response, "ProviderID", NULL);
+ profile->remote_providerID = lasso_node_get_child_content(profile->response, "ProviderID",
+ NULL, NULL);
/* response is ok, so delete the assertion */
switch(profile->provider_type) {
case lassoProviderTypeSp:
diff --git a/lasso/id-ff/name_identifier_mapping.c b/lasso/id-ff/name_identifier_mapping.c
index 2a7b6f24..4c3ba3f4 100644
--- a/lasso/id-ff/name_identifier_mapping.c
+++ b/lasso/id-ff/name_identifier_mapping.c
@@ -32,7 +32,7 @@
gchar *
lasso_name_identifier_mapping_dump(LassoNameIdentifierMapping *mapping)
{
- gchar *dump;
+ gchar *dump = NULL;
g_return_val_if_fail(LASSO_IS_NAME_IDENTIFIER_MAPPING(mapping), NULL);
@@ -101,13 +101,13 @@ lasso_name_identifier_mapping_build_response_msg(LassoNameIdentifierMapping *map
profile = LASSO_PROFILE(mapping);
provider = lasso_server_get_provider(profile->server, profile->remote_providerID);
- if(provider==NULL){
+ if(provider == NULL) {
message(G_LOG_LEVEL_ERROR, "Provider %s not found\n", profile->remote_providerID);
return(-2);
}
protocolProfile = lasso_provider_get_nameIdentifierMappingProtocolProfile(provider, &err);
- if(err != NULL){
+ if(err != NULL) {
message(G_LOG_LEVEL_ERROR, err->message);
ret = err->code;
g_error_free(err);
@@ -144,7 +144,7 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping,
xmlChar *content, *nameQualifier, *format;
g_return_val_if_fail(LASSO_IS_NAME_IDENTIFIER_MAPPING(mapping), -1);
- g_return_val_if_fail(remote_providerID!=NULL, -2);
+ g_return_val_if_fail(remote_providerID != NULL, -2);
profile = LASSO_PROFILE(mapping);
@@ -158,7 +158,7 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping,
}
/* get the name identifier (!!! depend on the provider type : SP or IDP !!!)*/
- switch(profile->provider_type){
+ switch(profile->provider_type) {
case lassoProviderTypeSp:
debug("service provider\n");
nameIdentifier = LASSO_NODE(lasso_federation_get_local_nameIdentifier(federation));
@@ -167,23 +167,24 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping,
break;
case lassoProviderTypeIdp:
debug("federation provider\n");
- /* get the next assertion ( next authenticated service provider ) */
+ /* get the next assertion (next authenticated service provider) */
nameIdentifier = LASSO_NODE(lasso_federation_get_remote_nameIdentifier(federation));
- if(!nameIdentifier)
+ if(nameIdentifier == NULL) {
nameIdentifier = LASSO_NODE(lasso_federation_get_local_nameIdentifier(federation));
+ }
break;
default:
message(G_LOG_LEVEL_ERROR, "Unknown provider type\n");
return(-4);
}
- if(!nameIdentifier){
+ if(nameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "Name identifier not found\n");
return(-5);
}
/* build the request */
- content = lasso_node_get_content(nameIdentifier);
+ content = lasso_node_get_content(nameIdentifier, NULL);
nameQualifier = lasso_node_get_attr_value(nameIdentifier, "NameQualifier", NULL);
format = lasso_node_get_attr_value(nameIdentifier, "Format", NULL);
profile->request = lasso_name_identifier_mapping_request_new(profile->server->providerID,
@@ -231,7 +232,8 @@ lasso_name_identifier_mapping_process_request_msg(LassoNameIdentifierMapping *ma
}
/* set the remote provider id from the request */
- remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
+ NULL, NULL);
profile->remote_providerID = remote_providerID;
/* set Name_Identifier_MappingResponse */
@@ -241,16 +243,17 @@ lasso_name_identifier_mapping_process_request_msg(LassoNameIdentifierMapping *ma
g_return_val_if_fail(profile->response!=NULL, -4);
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
statusCode_class = LASSO_NODE_GET_CLASS(statusCode);
- nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL);
+ nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL, NULL);
if(nameIdentifier == NULL) {
statusCode_class->set_prop(statusCode, "Value", lassoLibStatusCodeFederationDoesNotExist);
return(-5);
}
- remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID",
+ NULL, NULL);
/* Verify federation */
federation = lasso_identity_get_federation(profile->identity, remote_providerID);
@@ -294,7 +297,7 @@ lasso_name_identifier_mapping_process_response_msg(LassoNameIdentifierMapping *m
return(-3);
}
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
statusCodeValue = lasso_node_get_attr_value(statusCode, "Value", &err);
if (err == NULL) {
if(!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c
index 71fbed06..b4acbe99 100644
--- a/lasso/id-ff/profile.c
+++ b/lasso/id-ff/profile.c
@@ -52,27 +52,27 @@ lasso_profile_get_request_type_from_soap_msg(gchar *soap)
int type = 0;
soap_node = lasso_node_new_from_dump(soap);
- if(soap_node==NULL){
+ if (soap_node == NULL) {
message(G_LOG_LEVEL_ERROR, "Error while build node from soap msg\n");
return(-1);
}
- body_node = lasso_node_get_child(soap_node, "Body", NULL);
- if(body_node==NULL){
+ body_node = lasso_node_get_child(soap_node, "Body", NULL, NULL);
+ if(body_node == NULL) {
message(G_LOG_LEVEL_ERROR, "Body node not found\n");
return(-2);
}
children = lasso_node_get_children(body_node);
- if(children->len>0){
+ if(children->len>0) {
request_node = g_ptr_array_index(children, 0);
name = lasso_node_get_name(request_node);
- if(xmlStrEqual(name, "Request")){
+ if(xmlStrEqual(name, "Request")) {
debug("A Request node found\n");
type = lassoRequestTypeLogin;
}
- else if(xmlStrEqual(name, "LogoutRequest")){
+ else if(xmlStrEqual(name, "LogoutRequest")) {
type = lassoRequestTypeLogout;
}
else if(xmlStrEqual(name, "FederationTerminationNotification")){
diff --git a/lasso/id-ff/register_name_identifier.c b/lasso/id-ff/register_name_identifier.c
index 5e19c89f..7aca6b41 100644
--- a/lasso/id-ff/register_name_identifier.c
+++ b/lasso/id-ff/register_name_identifier.c
@@ -181,7 +181,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) {
- oldNameIdentifier = lasso_node_get_content(nameIdentifier_node);
+ 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);
}
@@ -193,7 +193,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
message(G_LOG_LEVEL_ERROR, "Remote NameIdentifier for service provider not found\n");
return(-1);
}
- idpNameIdentifier = lasso_node_get_content(nameIdentifier_node);
+ idpNameIdentifier = lasso_node_get_content(nameIdentifier_node, NULL);
idpNameQualifier = lasso_node_get_attr_value(nameIdentifier_node, "NameQualifier", NULL);
idpFormat = lasso_node_get_attr_value(nameIdentifier_node, "Format", NULL);
lasso_node_destroy(nameIdentifier_node);
@@ -213,13 +213,13 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
idpFormat = "federated";
nameIdentifier_node = lasso_federation_get_local_nameIdentifier(federation);
- oldNameIdentifier = lasso_node_get_content(nameIdentifier_node);
+ 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);
nameIdentifier_node = lasso_federation_get_remote_nameIdentifier(federation);
if(nameIdentifier_node != NULL) {
- spNameIdentifier = lasso_node_get_content(nameIdentifier_node);
+ 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);
}
@@ -292,11 +292,11 @@ gint lasso_register_name_identifier_load_request_msg(LassoRegisterNameIdentifier
/* get the NameIdentifier to load identity dump */
profile->nameIdentifier = lasso_node_get_child_content(profile->request,
- "NameIdentifier", NULL);
+ "NameIdentifier", NULL, NULL);
/* get the RelayState */
profile->msg_relayState = lasso_node_get_child_content(profile->request,
- "RelayState", NULL);
+ "RelayState", NULL, NULL);
return(0);
}
@@ -316,12 +316,12 @@ lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier *regi
profile = LASSO_PROFILE(register_name_identifier);
/* set the remote provider id from the request */
- remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL, NULL);
profile->remote_providerID = remote_providerID;
/* set RegisterNameIdentifierResponse */
profile->response = lasso_register_name_identifier_response_new(profile->server->providerID,
- lassoSamlStatusCodeSuccess,
+ (gchar *)lassoSamlStatusCodeSuccess,
profile->request);
if(profile->response == NULL) {
@@ -329,17 +329,17 @@ lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier *regi
return(-4);
}
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
statusCode_class = LASSO_NODE_GET_CLASS(statusCode);
- nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL);
+ nameIdentifier = lasso_node_get_child(profile->request, "NameIdentifier", NULL, NULL);
if(nameIdentifier == NULL) {
message(G_LOG_LEVEL_ERROR, "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);
+ remote_providerID = lasso_node_get_child_content(profile->request, "ProviderID", NULL, NULL);
if(remote_providerID == NULL) {
message(G_LOG_LEVEL_ERROR, "No provider id found in register_name_identifier request\n");
return(-6);
@@ -400,7 +400,7 @@ lasso_register_name_identifier_process_response_msg(LassoRegisterNameIdentifier
return(-3);
}
- statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL);
+ statusCode = lasso_node_get_child(profile->response, "StatusCode", NULL, NULL);
statusCodeValue = lasso_node_get_attr_value(statusCode, "Value", &err);
if (err == NULL) {
if(!xmlStrEqual(statusCodeValue, lassoSamlStatusCodeSuccess)) {
diff --git a/lasso/id-ff/server.c b/lasso/id-ff/server.c
index 762d7a72..c9bf01b8 100644
--- a/lasso/id-ff/server.c
+++ b/lasso/id-ff/server.c
@@ -407,7 +407,7 @@ lasso_server_new_from_dump(gchar *dump)
}
/* metadata */
- server_metadata_node = lasso_node_get_child(server_node, "EntityDescriptor", NULL);
+ server_metadata_node = lasso_node_get_child(server_node, "EntityDescriptor", NULL, NULL);
LASSO_PROVIDER(server)->metadata = lasso_node_copy(server_metadata_node);
lasso_node_destroy(server_metadata_node);
@@ -418,7 +418,7 @@ lasso_server_new_from_dump(gchar *dump)
LASSO_PROVIDER(server)->ca_certificate = lasso_node_get_attr_value(server_node, LASSO_PROVIDER_CA_CERTIFICATE_NODE, NULL);
/* providers */
- providers_node = lasso_node_get_child(server_node, LASSO_SERVER_PROVIDERS_NODE, NULL);
+ providers_node = lasso_node_get_child(server_node, LASSO_SERVER_PROVIDERS_NODE, NULL, NULL);
if(providers_node != NULL) {
providers_class = LASSO_NODE_GET_CLASS(providers_node);
providers_xmlNode = providers_class->get_xmlNode(providers_node);
@@ -430,7 +430,7 @@ lasso_server_new_from_dump(gchar *dump)
provider_node = lasso_node_new_from_xmlNode(provider_xmlNode);
/* metadata */
- entity_node = lasso_node_get_child(provider_node, "EntityDescriptor", NULL);
+ entity_node = lasso_node_get_child(provider_node, "EntityDescriptor", NULL, NULL);
/* public key */
public_key = lasso_node_get_attr_value(provider_node, LASSO_PROVIDER_PUBLIC_KEY_NODE, NULL);
diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c
index 0c8b2dae..1d555bc8 100644
--- a/lasso/id-ff/session.c
+++ b/lasso/id-ff/session.c
@@ -218,7 +218,7 @@ lasso_session_get_authentication_method(LassoSession *session,
if (remote_providerID == NULL) {
g_free(providerID);
}
- as = lasso_node_get_child(assertion, "AuthenticationStatement", NULL);
+ as = lasso_node_get_child(assertion, "AuthenticationStatement", NULL, NULL);
authentication_method = lasso_node_get_attr_value(as, "AuthenticationMethod", &err);
if (authentication_method == NULL) {
message(G_LOG_LEVEL_ERROR, err->message);
@@ -403,7 +403,8 @@ lasso_session_new_from_dump(gchar *dump)
/* get assertions */
assertions_node = lasso_node_get_child(session_node,
- LASSO_SESSION_ASSERTIONS_NODE, NULL);
+ LASSO_SESSION_ASSERTIONS_NODE,
+ NULL, NULL);
if (assertions_node != NULL) {
assertions_xmlNode = LASSO_NODE_GET_CLASS(assertions_node)->get_xmlNode(assertions_node);
assertion_xmlNode = assertions_xmlNode->children;