diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2012-09-28 22:58:10 +0200 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2012-09-28 22:58:24 +0200 |
| commit | bd0f935a2450b5779a01e9e5053267ec4cac94d6 (patch) | |
| tree | c717cd2c11a4f0c272a38eae778cc54039f4d4d2 /lasso/id-ff/session.c | |
| parent | e94015f8bcc168c9882348d2e8c5a5138ea56676 (diff) | |
| download | lasso-bd0f935a2450b5779a01e9e5053267ec4cac94d6.tar.gz lasso-bd0f935a2450b5779a01e9e5053267ec4cac94d6.tar.xz lasso-bd0f935a2450b5779a01e9e5053267ec4cac94d6.zip | |
Rewrite all xmlNode serialization code to be compatible with libxml 2.9.0
Libxml stopped exposing the internal of the xmlOutputBuffer structure;
it was replace by proper use of the API and of the xmlBuffer structure.
There could be regression for older version of libxml as some functions
appeared in recent version of libxml; but the reference API document
does not give any introduction date for functions so it's hard to be
sure.
Diffstat (limited to 'lasso/id-ff/session.c')
| -rw-r--r-- | lasso/id-ff/session.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index d5294ff3..67b0147f 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -723,27 +723,12 @@ add_assertion_childnode(gchar *key, LassoLibAssertion *value, DumpContext *conte xmlChar * xmlNode_to_base64(xmlNode *node) { - xmlOutputBufferPtr buf = NULL; - xmlCharEncodingHandlerPtr handler = NULL; - xmlChar *buffer = NULL; + gchar *buffer = NULL; xmlChar *ret = NULL; - handler = xmlFindCharEncodingHandler("utf-8"); - if (! handler) - goto cleanup; - buf = xmlAllocOutputBuffer(handler); - if (! buf) - goto cleanup; - xmlNodeDumpOutput(buf, NULL, node, 0, 0, "utf-8"); - xmlOutputBufferFlush(buf); - buffer = buf->conv ? buf->conv->content : buf->buffer->content; - - ret = xmlSecBase64Encode(buffer, strlen((char*)buffer), 0); - -cleanup: - if (buf) - xmlOutputBufferClose(buf); - + buffer = lasso_xmlnode_to_string(node, 0, 0); + ret = xmlSecBase64Encode(BAD_CAST buffer, strlen((char*)buffer), 0); + lasso_release_string(buffer); return ret; } |
