summaryrefslogtreecommitdiffstats
path: root/lasso/xml
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-12-27 19:47:06 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-12-27 19:47:06 +0000
commit740e6be5e7a03f03024b072e7fb25df0a0fbc7ea (patch)
treef760e4a74b93c8691289b3950ea21f68d34761c2 /lasso/xml
parent1975fecaff8e287e51655ff2fb4c9c45315c0279 (diff)
downloadlasso-740e6be5e7a03f03024b072e7fb25df0a0fbc7ea.tar.gz
lasso-740e6be5e7a03f03024b072e7fb25df0a0fbc7ea.tar.xz
lasso-740e6be5e7a03f03024b072e7fb25df0a0fbc7ea.zip
Fixed lasso_lecp_build_authn_request_envelope_msg,
lasso_lecp_process_authn_request_envelope_msg and lasso_lecp_build_authn_request_msg to properly deal with signatures (and, generally, to work)
Diffstat (limited to 'lasso/xml')
-rw-r--r--lasso/xml/tools.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c
index 7f956a81..39ef4dc9 100644
--- a/lasso/xml/tools.c
+++ b/lasso/xml/tools.c
@@ -606,7 +606,7 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value
const char *private_key_file, const char *certificate_file)
{
xmlDoc *doc;
- xmlNode *sign_tmpl;
+ xmlNode *sign_tmpl, *old_parent;
xmlSecDSigCtx *dsig_ctx;
sign_tmpl = NULL;
@@ -614,11 +614,14 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value
if (strcmp(sign_tmpl->name, "Signature") == 0)
break;
}
+ sign_tmpl = xmlSecFindNode(xmlnode, xmlSecNodeSignature, xmlSecDSigNs);
if (sign_tmpl == NULL)
return LASSO_DS_ERROR_SIGNATURE_TEMPLATE_NOT_FOUND;
doc = xmlNewDoc("1.0");
+ old_parent = xmlnode->parent;
+ xmlnode->parent = NULL;
xmlDocSetRootElement(doc, xmlnode);
xmlSetTreeDoc(sign_tmpl, doc);
if (id_attr_name) {
@@ -650,6 +653,7 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value
}
xmlSecDSigCtxDestroy(dsig_ctx);
xmlUnlinkNode(xmlnode);
+ xmlnode->parent = old_parent;
xmlFreeDoc(doc);
return 0;