summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-04-06 09:46:34 +0200
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-04-06 09:46:34 +0200
commitf3409ece4dab64da843f118f2739481c1bff2613 (patch)
tree44c659486d0aa66d5e1fc147202cdb43d172f8a3 /lasso
parent6125a2ad4fd04f886893a48390d6ececc5019036 (diff)
downloadlasso-f3409ece4dab64da843f118f2739481c1bff2613.tar.gz
lasso-f3409ece4dab64da843f118f2739481c1bff2613.tar.xz
lasso-f3409ece4dab64da843f118f2739481c1bff2613.zip
[saml2] modify behaviour of lasso_saml2_assertion_add_attribute_with_node
If an AttributeStatement already exists, we add the new attribute to it.
Diffstat (limited to 'lasso')
-rw-r--r--lasso/saml-2.0/saml2_helper.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lasso/saml-2.0/saml2_helper.c b/lasso/saml-2.0/saml2_helper.c
index 7d160e56..c49cbc3b 100644
--- a/lasso/saml-2.0/saml2_helper.c
+++ b/lasso/saml-2.0/saml2_helper.c
@@ -721,10 +721,18 @@ lasso_saml2_assertion_add_attribute_with_node(LassoSaml2Assertion *assertion, co
lasso_assign_string(attribute->NameFormat, LASSO_SAML2_ATTRIBUTE_NAME_FORMAT_URI);
lasso_list_add_new_gobject(attribute->AttributeValue, attribute_value);
- attribute_statement = LASSO_SAML2_ATTRIBUTE_STATEMENT(lasso_saml2_attribute_statement_new());
+ if (assertion->AttributeStatement
+ && LASSO_IS_SAML2_ATTRIBUTE_STATEMENT(
+ assertion->AttributeStatement->data)) {
+ attribute_statement =
+ (LassoSaml2AttributeStatement*)
+ assertion->AttributeStatement->data;
+ } else {
+ attribute_statement = LASSO_SAML2_ATTRIBUTE_STATEMENT(lasso_saml2_attribute_statement_new());
+ lasso_list_add_new_gobject(assertion->AttributeStatement, attribute_statement);
+ }
lasso_list_add_new_gobject(attribute_statement->Attribute, attribute);
- lasso_list_add_new_gobject(assertion->AttributeStatement, attribute_statement);
cleanup:
return rc;
}