summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-06-10 08:39:07 -0400
committerSimo Sorce <simo@redhat.com>2014-06-10 08:39:07 -0400
commit32e0d501ab14b5fb668c3e144f4115403c8094b8 (patch)
treee5c447187b4dff8dc05c9f3a2b8bdbf270c1354e
parent60ab08cfec53a24ecca24d581ebc6dd2af0e1f71 (diff)
downloadlasso-32e0d501ab14b5fb668c3e144f4115403c8094b8.tar.gz
lasso-32e0d501ab14b5fb668c3e144f4115403c8094b8.tar.xz
lasso-32e0d501ab14b5fb668c3e144f4115403c8094b8.zip
Make id mandatory
id should always be present, return immediately if not, and make its use not conditional. License: MIT Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r--lasso/xml/tools.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c
index afbb8b6b..1af3cbd0 100644
--- a/lasso/xml/tools.c
+++ b/lasso/xml/tools.c
@@ -2525,7 +2525,7 @@ lasso_xmlnode_add_saml2_signature_template(xmlNode *node, LassoSignatureContext
xmlNode *existing_signature = NULL, *signature = NULL, *reference, *key_info;
char *uri;
- if (! lasso_validate_signature_context(context) || ! node)
+ if (! lasso_validate_signature_context(context) || ! node || ! id)
return;
switch (context.signature_method) {
@@ -2555,12 +2555,10 @@ lasso_xmlnode_add_saml2_signature_template(xmlNode *node, LassoSignatureContext
* other cases, set snippet->offset to 0 and use xmlSecTmpSignatureAddReference from another
* node get_xmlNode virtual method to add the needed reference.
*/
- if (id) {
- uri = g_strdup_printf("#%s", id);
- reference = xmlSecTmplSignatureAddReference(signature,
- xmlSecTransformSha1Id, NULL, (xmlChar*)uri, NULL);
- lasso_release(uri);
- }
+ uri = g_strdup_printf("#%s", id);
+ reference = xmlSecTmplSignatureAddReference(signature,
+ xmlSecTransformSha1Id, NULL, (xmlChar*)uri, NULL);
+ lasso_release(uri);
/* add enveloped transform */
xmlSecTmplReferenceAddTransform(reference, xmlSecTransformEnvelopedId);