diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-08 17:22:09 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-08 17:22:09 +0000 |
| commit | 6ddec77e1bc46af42824d1cd10603a823bab693c (patch) | |
| tree | 221a931f6260fe9bb151efec36c44cb20f7bd62e | |
| parent | cf134bfd7be7e629b16dd2046392b43720bbdb68 (diff) | |
moved remaining unbounded elements to GList* (samlp:Response/Assertion being
part of that bunch)
| -rw-r--r-- | lasso/id-ff/login.c | 22 | ||||
| -rw-r--r-- | lasso/xml/lib_assertion.c | 4 | ||||
| -rw-r--r-- | lasso/xml/saml_conditions.c | 3 | ||||
| -rw-r--r-- | lasso/xml/saml_conditions.h | 8 | ||||
| -rw-r--r-- | lasso/xml/samlp_request_abstract.c | 2 | ||||
| -rw-r--r-- | lasso/xml/samlp_request_abstract.h | 2 | ||||
| -rw-r--r-- | lasso/xml/samlp_response.c | 2 | ||||
| -rw-r--r-- | lasso/xml/samlp_response.h | 2 |
8 files changed, 26 insertions, 19 deletions
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c index 9fd986a1..b403f389 100644 --- a/lasso/id-ff/login.c +++ b/lasso/id-ff/login.c @@ -126,8 +126,8 @@ lasso_login_build_assertion(LassoLogin *login, if (login->protocolProfile == LASSO_LOGIN_PROTOCOL_PROFILE_BRWS_POST) { /* only add assertion if response is an AuthnResponse */ - LASSO_SAMLP_RESPONSE(profile->response)->Assertion = - LASSO_SAML_ASSERTION(assertion); + LASSO_SAMLP_RESPONSE(profile->response)->Assertion = g_list_append(NULL, + LASSO_SAML_ASSERTION(assertion)); } /* store assertion in session object */ if (profile->session == NULL) { @@ -329,6 +329,7 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) if (response->Assertion) { LassoProfile *profile = LASSO_PROFILE(login); + LassoSamlAssertion *assertion = response->Assertion->data; idp = g_hash_table_lookup(profile->server->providers, profile->remote_providerID); if (idp == NULL) return LASSO_ERROR_UNDEFINED; @@ -336,12 +337,13 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) /* FIXME: verify assertion signature */ /* store NameIdentifier */ - if (response->Assertion->AuthenticationStatement == NULL) { + if (assertion->AuthenticationStatement == NULL) { return LASSO_ERROR_UNDEFINED; } - profile->nameIdentifier = g_object_ref(LASSO_SAML_SUBJECT_STATEMENT_ABSTRACT( - response->Assertion->AuthenticationStatement + profile->nameIdentifier = g_object_ref( + LASSO_SAML_SUBJECT_STATEMENT_ABSTRACT( + assertion->AuthenticationStatement )->Subject->NameIdentifier); if (LASSO_PROFILE(login)->nameIdentifier == NULL) @@ -388,7 +390,10 @@ lasso_login_accept_sso(LassoLogin *login) if (profile->response == NULL) return LASSO_ERROR_UNDEFINED; - assertion = LASSO_SAMLP_RESPONSE(profile->response)->Assertion; + if (LASSO_SAMLP_RESPONSE(profile->response)->Assertion == NULL) + return LASSO_ERROR_UNDEFINED; + + assertion = LASSO_SAMLP_RESPONSE(profile->response)->Assertion->data; if (assertion == NULL) return LASSO_ERROR_UNDEFINED; @@ -396,8 +401,7 @@ lasso_login_accept_sso(LassoLogin *login) g_object_ref(assertion)); authentication_statement = LASSO_SAML_SUBJECT_STATEMENT_ABSTRACT( - LASSO_SAMLP_RESPONSE(profile->response - )->Assertion->AuthenticationStatement); + assertion->AuthenticationStatement); ni = authentication_statement->Subject->NameIdentifier; if (ni == NULL) @@ -751,7 +755,7 @@ lasso_login_build_response_msg(LassoLogin *login, gchar *remote_providerID) profile->remote_providerID); if (assertion) { LASSO_SAMLP_RESPONSE(profile->response)->Assertion = - g_object_ref(assertion); + g_list_append(NULL, g_object_ref(assertion)); lasso_profile_set_response_status(profile, LASSO_SAML_STATUS_CODE_SUCCESS); lasso_session_remove_status(profile->session, remote_providerID); diff --git a/lasso/xml/lib_assertion.c b/lasso/xml/lib_assertion.c index 3b362888..2b7ad5f4 100644 --- a/lasso/xml/lib_assertion.c +++ b/lasso/xml/lib_assertion.c @@ -153,8 +153,8 @@ lasso_lib_assertion_new_full(const char *issuer, const char *requestID, assertion->Conditions->NotBefore = g_strdup(notBefore); assertion->Conditions->NotOnOrAfter = g_strdup(notOnOrAfter); if (audience) { - assertion->Conditions->AudienceRestrictionCondition = - lasso_saml_audience_restriction_condition_new_full(audience); + assertion->Conditions->AudienceRestrictionCondition = g_list_append(NULL, + lasso_saml_audience_restriction_condition_new_full(audience)); } return LASSO_LIB_ASSERTION(assertion); diff --git a/lasso/xml/saml_conditions.c b/lasso/xml/saml_conditions.c index fcd2e620..468d1c40 100644 --- a/lasso/xml/saml_conditions.c +++ b/lasso/xml/saml_conditions.c @@ -44,7 +44,7 @@ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { - { "AudienceRestrictionCondition", SNIPPET_NODE, + { "AudienceRestrictionCondition", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSamlConditions, AudienceRestrictionCondition) }, { "NotBefore", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSamlConditions, NotBefore) }, @@ -60,6 +60,7 @@ static struct XmlSnippet schema_snippets[] = { static void instance_init(LassoSamlConditions *node) { + node->Condition = NULL; node->AudienceRestrictionCondition = NULL; node->NotBefore = NULL; node->NotOnOrAfter = NULL; diff --git a/lasso/xml/saml_conditions.h b/lasso/xml/saml_conditions.h index 4c423c08..86f09ba3 100644 --- a/lasso/xml/saml_conditions.h +++ b/lasso/xml/saml_conditions.h @@ -53,10 +53,10 @@ struct _LassoSamlConditions { LassoNode parent; /*< public >*/ - /* <element ref="saml:Condition"/> XXX: unbounded */ - /* LassoSamlCondition *Condition; XXX missing from lasso */ - /* <element ref="saml:AudienceRestrictionCondition"/> XXX: unbounded */ - LassoSamlAudienceRestrictionCondition *AudienceRestrictionCondition; + /* <element ref="saml:Condition"/> */ + GList *Condition; /* LassoSamlCondition (XXX missing from lasso) */ + /* <element ref="saml:AudienceRestrictionCondition"/> */ + GList *AudienceRestrictionCondition; /* LassoSamlAudienceRestrictionCondition */ /* <attribute name="NotBefore" type="dateTime" use="optional"/> */ char *NotBefore; /* <attribute name="NotOnOrAfter" type="dateTime" use="optional"/> */ diff --git a/lasso/xml/samlp_request_abstract.c b/lasso/xml/samlp_request_abstract.c index 83c41af4..aed35539 100644 --- a/lasso/xml/samlp_request_abstract.c +++ b/lasso/xml/samlp_request_abstract.c @@ -55,6 +55,8 @@ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { + { "RespondWith", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSamlpRequestAbstract, RespondWith) }, { "Signature", SNIPPET_SIGNATURE, G_STRUCT_OFFSET(LassoSamlpRequestAbstract, RequestID) }, { "RequestID", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSamlpRequestAbstract, RequestID) }, diff --git a/lasso/xml/samlp_request_abstract.h b/lasso/xml/samlp_request_abstract.h index 9425d5a1..8a23bc5a 100644 --- a/lasso/xml/samlp_request_abstract.h +++ b/lasso/xml/samlp_request_abstract.h @@ -55,7 +55,7 @@ struct _LassoSamlpRequestAbstract { /*< public >*/ /* <element ref="samlp:RespondWith" minOccurs="0" maxOccurs="unbounded"/> */ - char *RespondWith; /* XXX: turn into a GList */ + GList *RespondWith; /* of char* */ /* <attribute name="RequestID" type="saml:IDType" use="required"/> */ char *RequestID; /* <attribute name="MajorVersion" type="integer" use="required"/> */ diff --git a/lasso/xml/samlp_response.c b/lasso/xml/samlp_response.c index a529569e..d6ad8021 100644 --- a/lasso/xml/samlp_response.c +++ b/lasso/xml/samlp_response.c @@ -48,7 +48,7 @@ static struct XmlSnippet schema_snippets[] = { { "Status", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlpResponse, Status) }, - { "Assertion", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlpResponse, Assertion) }, + { "Assertion", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSamlpResponse, Assertion) }, { NULL, 0, 0} }; diff --git a/lasso/xml/samlp_response.h b/lasso/xml/samlp_response.h index bde65a30..8ca1094e 100644 --- a/lasso/xml/samlp_response.h +++ b/lasso/xml/samlp_response.h @@ -56,7 +56,7 @@ struct _LassoSamlpResponse { /* <element ref="samlp:Status"/> */ LassoSamlpStatus *Status; /* <element ref="saml:Assertion" minOccurs="0" maxOccurs="unbounded"/> */ - LassoSamlAssertion *Assertion; /* XXX: GList */ + GList *Assertion; /* of LassoSamlAssertion* */ }; struct _LassoSamlpResponseClass { |
