From 87eabaee6a0ddb68f54d25c2caf65c93ac77ea3e Mon Sep 17 00:00:00 2001 From: Valery Febvre Date: Sun, 2 May 2004 21:31:35 +0000 Subject: Removed funct lasso_authn_response_get_protocolProfile() Added funct lasso_authn_response_process_authentication_result() 3 args removed in lasso_authn_response_new() --- lasso/Attic/protocols/authn_response.c | 46 ++++++++++++++++++---------------- lasso/Attic/protocols/authn_response.h | 30 +++++++++++----------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/lasso/Attic/protocols/authn_response.c b/lasso/Attic/protocols/authn_response.c index 2529cfbc..27be5322 100644 --- a/lasso/Attic/protocols/authn_response.c +++ b/lasso/Attic/protocols/authn_response.c @@ -25,22 +25,6 @@ #include -/*****************************************************************************/ -/* functions */ -/*****************************************************************************/ - -xmlChar * -lasso_authn_response_get_protocolProfile(xmlChar *query) -{ - xmlChar *protocolProfile; - - protocolProfile = lasso_g_ptr_array_index(lasso_query_get_value(query, "ProtocolProfile"), 0); - if (protocolProfile == NULL) - protocolProfile = lassoLibProtocolProfileArtifact; - - return (protocolProfile); -} - /*****************************************************************************/ /* public methods */ /*****************************************************************************/ @@ -96,6 +80,24 @@ lasso_authn_response_must_authenticate(LassoAuthnResponse *response, return (must_authenticate); } +void +lasso_authn_response_process_authentication_result(LassoAuthnResponse *response, + gboolean authentication_result) +{ + LassoNode *status, *status_code; + + if (authentication_result == FALSE) { + status = lasso_samlp_status_new(); + status_code = lasso_samlp_status_code_new(); + lasso_samlp_status_code_set_value(LASSO_SAMLP_STATUS_CODE(status_code), + lassoLibStatusCodeUnknownPrincipal); + lasso_samlp_status_set_statusCode(LASSO_SAMLP_STATUS(status), + LASSO_SAMLP_STATUS_CODE(status_code)); + lasso_samlp_response_set_status(LASSO_SAMLP_RESPONSE(response), + LASSO_SAMLP_STATUS(status)); + } +} + gboolean lasso_authn_response_verify_signature(LassoAuthnResponse *response, xmlChar *public_key_file, @@ -172,13 +174,13 @@ GType lasso_authn_response_get_type() { LassoNode* lasso_authn_response_new(xmlChar *query, - const xmlChar *providerID, - gboolean signature_status, - gboolean authentication_status) + const xmlChar *providerID) { GData *gd; LassoNode *response, *status, *status_code; - const xmlChar *nameIDPolicy; + + g_return_val_if_fail(query != NULL, NULL); + g_return_val_if_fail(providerID != NULL, NULL); response = LASSO_NODE(g_object_new(LASSO_TYPE_AUTHN_RESPONSE, NULL)); @@ -211,7 +213,7 @@ lasso_authn_response_new(xmlChar *query, if (lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0) != NULL) { lasso_samlp_response_abstract_set_inResponseTo(LASSO_SAMLP_RESPONSE_ABSTRACT(response), lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0)); - LASSO_AUTHN_RESPONSE(response)->requestID = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0); + LASSO_AUTHN_RESPONSE(response)->requestID = g_strdup(lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0)); } /* consent */ @@ -234,5 +236,7 @@ lasso_authn_response_new(xmlChar *query, lasso_samlp_response_set_status(LASSO_SAMLP_RESPONSE(response), LASSO_SAMLP_STATUS(status)); + g_datalist_clear(&gd); + return (response); } diff --git a/lasso/Attic/protocols/authn_response.h b/lasso/Attic/protocols/authn_response.h index 2413ad9b..50931a24 100644 --- a/lasso/Attic/protocols/authn_response.h +++ b/lasso/Attic/protocols/authn_response.h @@ -55,27 +55,25 @@ struct _LassoAuthnResponseClass { LassoLibAuthnResponseClass parent; }; -LASSO_EXPORT xmlChar* lasso_authn_response_get_protocolProfile (xmlChar *query); +LASSO_EXPORT GType lasso_authn_response_get_type (void); +LASSO_EXPORT LassoNode* lasso_authn_response_new (xmlChar *query, + const xmlChar *providerID); -LASSO_EXPORT GType lasso_authn_response_get_type (void); +LASSO_EXPORT void lasso_authn_response_add_assertion (LassoAuthnResponse *response, + LassoAssertion *assertion, + const xmlChar *private_key_file, + const xmlChar *certificate_file); -LASSO_EXPORT LassoNode* lasso_authn_response_new (xmlChar *query, - const xmlChar *providerID, - gboolean signature_status, - gboolean authentication_status); +LASSO_EXPORT gboolean lasso_authn_response_must_authenticate (LassoAuthnResponse *response, + gboolean is_authenticated); -LASSO_EXPORT void lasso_authn_response_add_assertion (LassoAuthnResponse *response, - LassoAssertion *assertion, - const xmlChar *private_key_file, - const xmlChar *certificate_file); +LASSO_EXPORT void lasso_authn_response_process_authentication_result(LassoAuthnResponse *response, + gboolean authentication_result); -LASSO_EXPORT gboolean lasso_authn_response_must_authenticate (LassoAuthnResponse *response, - gboolean is_authenticated); - -LASSO_EXPORT gboolean lasso_authn_response_verify_signature (LassoAuthnResponse *response, - xmlChar *public_key_file, - xmlChar *private_key_file); +LASSO_EXPORT gboolean lasso_authn_response_verify_signature (LassoAuthnResponse *response, + xmlChar *public_key_file, + xmlChar *private_key_file); #ifdef __cplusplus } -- cgit