Skip to content

Commit

Permalink
Switch away from deprecated LibXML2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
lsh123 committed Jul 4, 2023
1 parent acbede8 commit 3eb3902
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/keyinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <xmlsec/keysmngr.h>
#include <xmlsec/transforms.h>
#include <xmlsec/xmlenc.h>
#include <xmlsec/parser.h>
#include <xmlsec/keyinfo.h>
#include <xmlsec/errors.h>

Expand Down Expand Up @@ -1055,7 +1056,7 @@ xmlSecKeyDataRetrievalMethodXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNod
"retrieval type is unknown");
goto done;
}

res = 0;
goto done;
}
Expand Down Expand Up @@ -1173,9 +1174,9 @@ xmlSecKeyDataRetrievalMethodReadXmlResult(xmlSecKeyDataId typeId, xmlSecKeyPtr k
xmlSecAssert2(keyInfoCtx->mode == xmlSecKeyInfoModeRead, -1);

XMLSEC_SAFE_CAST_SIZE_TO_INT(bufferSize, bufferLen, return(-1), NULL);
doc = xmlRecoverMemory((const char*)buffer, bufferLen);
doc = xmlReadMemory((const char*)buffer, bufferLen, NULL, NULL, xmlSecParserGetDefaultOptions() | XML_PARSE_RECOVER);
if(doc == NULL) {
xmlSecXmlError("xmlRecoverMemory", xmlSecKeyDataKlassGetName(typeId));
xmlSecXmlError("xmlReadMemory", xmlSecKeyDataKlassGetName(typeId));
return(-1);
}

Expand Down

0 comments on commit 3eb3902

Please sign in to comment.