diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-25 15:03:00 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-25 15:03:00 +0000 |
| commit | 6023d78531b610cda5badb62340da8e32b165530 (patch) | |
| tree | 66283ace6c162672436a57a19addcc9333fd0fe4 | |
| parent | 110851e9d73a98cf56e6677cdc057eb0035bc6b5 (diff) | |
| download | lasso-6023d78531b610cda5badb62340da8e32b165530.tar.gz lasso-6023d78531b610cda5badb62340da8e32b165530.tar.xz lasso-6023d78531b610cda5badb62340da8e32b165530.zip | |
Moved nameIdentifer attribute of Login object in ProfileContext
| -rw-r--r-- | lasso/id-ff/login.c | 20 | ||||
| -rw-r--r-- | lasso/id-ff/login.h | 1 | ||||
| -rw-r--r-- | lasso/id-ff/profile_context.c | 11 | ||||
| -rw-r--r-- | lasso/id-ff/profile_context.h | 2 |
4 files changed, 19 insertions, 15 deletions
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c index 8e4dff5c..72b0c696 100644 --- a/lasso/id-ff/login.c +++ b/lasso/id-ff/login.c @@ -103,7 +103,7 @@ lasso_login_add_response_assertion(LassoLogin *login, return(-3); } /* store NameIdentifier */ - login->nameIdentifier = lasso_login_get_assertion_nameIdentifier(assertion); + LASSO_PROFILE_CONTEXT(login)->nameIdentifier = lasso_login_get_assertion_nameIdentifier(assertion); ret = lasso_saml_assertion_set_signature(LASSO_SAML_ASSERTION(assertion), LASSO_PROFILE_CONTEXT(login)->server->signature_method, @@ -130,7 +130,7 @@ lasso_login_process_federation(LassoLogin *login) { LassoIdentity *identity; LassoNode *nameIdentifier; - xmlChar *nameIDPolicy; + xmlChar *id, *nameIDPolicy; /* verify if a user context exists else create it */ if (LASSO_PROFILE_CONTEXT(login)->user == NULL) { @@ -152,7 +152,9 @@ lasso_login_process_federation(LassoLogin *login) identity = lasso_identity_new(LASSO_PROFILE_CONTEXT(login)->remote_providerID); /* set local NameIdentifier in identity */ - nameIdentifier = lasso_saml_name_identifier_new(lasso_build_unique_id(32)); + id = lasso_build_unique_id(32); + nameIdentifier = lasso_saml_name_identifier_new(id); + xmlFree(id); lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(nameIdentifier), LASSO_PROFILE_CONTEXT(login)->server->providerID); lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(nameIdentifier), @@ -203,8 +205,8 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) { } /* store NameIdentifier */ - login->nameIdentifier = lasso_login_get_assertion_nameIdentifier(assertion); - if (login->nameIdentifier == NULL) { + LASSO_PROFILE_CONTEXT(login)->nameIdentifier = lasso_login_get_assertion_nameIdentifier(assertion); + if (LASSO_PROFILE_CONTEXT(login)->nameIdentifier == NULL) { message(G_LOG_LEVEL_ERROR, "NameIdentifier element not found in Assertion.\n"); ret = -4; goto done; @@ -300,7 +302,6 @@ lasso_login_build_artifact_msg(LassoLogin *login, } /* save response dump */ login->response_dump = lasso_node_export_to_soap(LASSO_PROFILE_CONTEXT(login)->response); - debug("SOAP enveloped Samlp:response = %s\n", LASSO_LOGIN(login)->response_dump); remote_provider = lasso_server_get_provider(LASSO_PROFILE_CONTEXT(login)->server, LASSO_PROFILE_CONTEXT(login)->remote_providerID); @@ -593,9 +594,6 @@ lasso_login_dump(LassoLogin *login) LASSO_NODE_GET_CLASS(node)->new_child(node, "ProtocolProfile", protocolProfile, FALSE); g_free(protocolProfile); - if (login->nameIdentifier != NULL) { - LASSO_NODE_GET_CLASS(node)->new_child(node, "NameIdentifier", login->nameIdentifier, FALSE); - } if (login->assertionArtifact != NULL) { LASSO_NODE_GET_CLASS(node)->new_child(node, "AssertionArtifact", login->assertionArtifact, FALSE); } @@ -858,7 +856,6 @@ lasso_login_finalize(LassoLogin *login) debug("Login object 0x%x finalized ...\n", login); g_free(login->assertionArtifact); - g_free(login->nameIdentifier); g_free(login->response_dump); parent_class->finalize(G_OBJECT(login)); @@ -873,7 +870,6 @@ lasso_login_instance_init(LassoLogin *login) { login->protocolProfile = 0; login->assertionArtifact = NULL; - login->nameIdentifier = NULL; login->response_dump = NULL; } @@ -941,6 +937,7 @@ lasso_login_new_from_dump(LassoServer *server, node_dump = lasso_node_new_from_dump(dump); /* profile context attributes */ + LASSO_PROFILE_CONTEXT(login)->nameIdentifier = lasso_node_get_child_content(node_dump, "NameIdentifier", NULL); LASSO_PROFILE_CONTEXT(login)->remote_providerID = lasso_node_get_child_content(node_dump, "RemoteProviderID", NULL); LASSO_PROFILE_CONTEXT(login)->msg_url = lasso_node_get_child_content(node_dump, "MsgUrl", NULL); LASSO_PROFILE_CONTEXT(login)->msg_body = lasso_node_get_child_content(node_dump, "MsgBody", NULL); @@ -989,7 +986,6 @@ lasso_login_new_from_dump(LassoServer *server, if (protocolProfile != NULL) { login->protocolProfile = atoi(protocolProfile); } - login->nameIdentifier = lasso_node_get_child_content(node_dump, "NameIdentifier", NULL); login->assertionArtifact = lasso_node_get_child_content(node_dump, "AssertionArtifact", NULL); login->response_dump = lasso_node_get_child_content(node_dump, "ResponseDump", NULL); diff --git a/lasso/id-ff/login.h b/lasso/id-ff/login.h index 3759e788..4607d3b7 100644 --- a/lasso/id-ff/login.h +++ b/lasso/id-ff/login.h @@ -57,7 +57,6 @@ struct _LassoLogin { LassoProfileContext parent; /*< public >*/ lassoLoginProtocolProfiles protocolProfile; - gchar *nameIdentifier; /* rename this ??? */ gchar *assertionArtifact; gchar *response_dump; diff --git a/lasso/id-ff/profile_context.c b/lasso/id-ff/profile_context.c index ee2110cc..9b4449c7 100644 --- a/lasso/id-ff/profile_context.c +++ b/lasso/id-ff/profile_context.c @@ -87,6 +87,7 @@ lasso_profile_context_get_request_type_from_soap_msg(gchar *soap) else{ message(G_LOG_LEVEL_ERROR, "Unkown node name : %s\n", name); } + xmlFree(name); } return(type); @@ -127,16 +128,20 @@ lasso_profile_context_dump(LassoProfileContext *ctx, lasso_node_destroy(response); } + if (ctx->nameIdentifier != NULL) { + LASSO_NODE_GET_CLASS(node)->new_child(node, "NameIdentifier", ctx->nameIdentifier, FALSE); + } + if (ctx->remote_providerID != NULL) { LASSO_NODE_GET_CLASS(node)->new_child(node, "RemoteProviderID", ctx->remote_providerID, FALSE); } if (ctx->msg_url != NULL) { - LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgUrl", lasso_str_escape(ctx->msg_url), FALSE); + LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgUrl", ctx->msg_url, FALSE); } if (ctx->msg_body != NULL) { - LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgBody", lasso_str_escape(ctx->msg_body), FALSE); + LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgBody", ctx->msg_body, FALSE); } if (ctx->msg_relayState != NULL) { LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgRelayState", ctx->msg_relayState, FALSE); @@ -216,6 +221,7 @@ lasso_profile_context_finalize(LassoProfileContext *ctx) { debug("ProfileContext object 0x%x finalized ...\n", ctx); + g_free(ctx->nameIdentifier); g_free(ctx->remote_providerID); g_free(ctx->msg_url); g_free(ctx->msg_body); @@ -249,6 +255,7 @@ lasso_profile_context_instance_init(GTypeInstance *instance, ctx->user = NULL; ctx->request = NULL; ctx->response = NULL; + ctx->nameIdentifier = NULL; ctx->request_type = lassoMessageTypeNone; ctx->response_type = lassoMessageTypeNone; ctx->provider_type = lassoProviderTypeNone; diff --git a/lasso/id-ff/profile_context.h b/lasso/id-ff/profile_context.h index 939bf4f8..174b16fe 100644 --- a/lasso/id-ff/profile_context.h +++ b/lasso/id-ff/profile_context.h @@ -83,6 +83,8 @@ struct _LassoProfileContext { LassoNode *request; LassoNode *response; + gchar *nameIdentifier; + gchar *remote_providerID; gchar *msg_url; |
