diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-19 15:37:08 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-19 15:37:08 +0000 |
| commit | 282df76fa3ecc39eba8fb3bc2fabcd1465b6a0b6 (patch) | |
| tree | e983f8ca91da5589c63e7b7572a5b6ff35744d25 | |
| parent | fd46dd6c2541da10ab9480b71e428ef121744b7d (diff) | |
| download | lasso-282df76fa3ecc39eba8fb3bc2fabcd1465b6a0b6.tar.gz lasso-282df76fa3ecc39eba8fb3bc2fabcd1465b6a0b6.tar.xz lasso-282df76fa3ecc39eba8fb3bc2fabcd1465b6a0b6.zip | |
Fixed a bug in lasso_node_verify_signature() & lasso_node_verify_x509_signature()
| -rw-r--r-- | lasso/xml/xml.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 6644af1a..176e4d52 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1148,16 +1148,21 @@ lasso_node_impl_verify_signature(LassoNode *node, g_return_val_if_fail(public_key_file != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); doc = xmlNewDoc("1.0"); - xmlNode = xmlCopyNode(lasso_node_get_xmlNode(node), 1); + /* Don't use xmlCopyNode here because it changed the attrs and ns order :-( */ + xmlNode = lasso_node_get_xmlNode(node); xmlAddChild((xmlNodePtr)doc, xmlNode); /* FIXME : register 'AssertionID' ID attribute manually */ id_attr = lasso_node_get_attr(node, "AssertionID", NULL); if (id_attr != NULL) { + printf("OK AssertionID attr found, try to add new ID\n"); id_value = xmlNodeListGetString(doc, id_attr->children, 1); id = xmlAddID(NULL, doc, id_value, id_attr); + if (id == NULL) printf("Failed add new ID\n"); xmlFree(id_value); } + else + printf("AssertionID attr not found\n"); /* find start node */ signature = xmlSecFindNode(xmlNode, xmlSecNodeSignature, @@ -1215,7 +1220,7 @@ lasso_node_impl_verify_signature(LassoNode *node, if(dsigCtx != NULL) { xmlSecDSigCtxDestroy(dsigCtx); } - xmlFreeDoc(doc); + /* FIXME xmlFreeDoc(doc); */ return (ret); } @@ -1237,7 +1242,8 @@ lasso_node_impl_verify_x509_signature(LassoNode *node, LASSO_PARAM_ERROR_INVALID_VALUE); doc = xmlNewDoc("1.0"); - xmlNode = xmlCopyNode(lasso_node_get_xmlNode(node), 1); + /* Don't use xmlCopyNode here because it changed the attrs and ns order :-( */ + xmlNode = lasso_node_get_xmlNode(node); xmlAddChild((xmlNodePtr)doc, xmlNode); /* FIXME: register 'AssertionID' ID attribute manually */ @@ -1322,7 +1328,7 @@ lasso_node_impl_verify_x509_signature(LassoNode *node, if(mngr != NULL) { xmlSecKeysMngrDestroy(mngr); } - xmlFreeDoc(doc); + /* FIXME xmlFreeDoc(doc); */ return (ret); } |
