mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-11 12:58:16 +03:00
Compare commits
10 Commits
f16b779305
...
df1c8e50b9
Author | SHA1 | Date | |
---|---|---|---|
|
df1c8e50b9 | ||
|
87c9e000e5 | ||
|
ba9148d8a5 | ||
|
a0dbf030ee | ||
|
8873a49846 | ||
|
98776424a8 | ||
|
bde22ce8a8 | ||
|
9f8484602f | ||
|
dd3ef5306e | ||
|
dba94f9024 |
@ -9,10 +9,10 @@ srcdir=$(pwd)
|
||||
incdir=$srcdir/include
|
||||
libdir=$srcdir/.libs
|
||||
|
||||
curl -L https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0210.tar.gz |tar xz
|
||||
cd XML-LibXML-2.0210
|
||||
git clone --depth 1 -b test-suite-libxml2 \
|
||||
https://github.com/nwellnhof/perl-XML-LibXML.git
|
||||
cd perl-XML-LibXML
|
||||
|
||||
perl Makefile.PL INC="-I$incdir" LIBS="-L$libdir -lxml2"
|
||||
make
|
||||
# Known to fail
|
||||
LD_LIBRARY_PATH=$libdir make test || true
|
||||
make test
|
||||
|
@ -2973,7 +2973,7 @@ htmlCharDataSAXCallback(htmlParserCtxtPtr ctxt, const xmlChar *buf,
|
||||
|
||||
if ((mode == 0) &&
|
||||
(!ctxt->keepBlanks) &&
|
||||
(areBlanks(ctxt, buf, size))) {
|
||||
(areBlanks(ctxt, buf, size) > 0)) {
|
||||
if (ctxt->sax->ignorableWhitespace != NULL)
|
||||
ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
|
||||
} else {
|
||||
|
215
NEWS
215
NEWS
@ -4,27 +4,47 @@ v2.14.0: not released yet
|
||||
|
||||
### Major changes
|
||||
|
||||
The HTML tokenizer now conforms fully to HTML5. Note that HTML5 tree
|
||||
construction isn't implemented yet.
|
||||
The HTML tokenizer now conforms fully to HTML5. Several non-standard
|
||||
syntax warnings were removed. Note that HTML5 tree construction isn't
|
||||
implemented yet.
|
||||
|
||||
Binary compatibility is restricted to versions 2.14 or newer. On ELF
|
||||
systems, the soname was bumped from libxml2.so.2 to libxml2.so.16.
|
||||
|
||||
The serialization API will now take user-provided or default encodings
|
||||
into account when serializing attribute values, matching the
|
||||
serialization of text and avoiding unnecessary escaping.
|
||||
|
||||
The XML parser won't try to merge consecutive CDATA sections as before
|
||||
to align with web standards. Each CDATA section will create exactly one
|
||||
node or SAX callback.
|
||||
|
||||
Support for RELAX NG can now be disabled with a new configuration
|
||||
option independently of XML Schemas support. It is still enabled by
|
||||
default.
|
||||
|
||||
Binary compatibility is restricted to versions 2.14 or newer. On ELF
|
||||
systems, the soname was bumped from libxml2.so.2 to libxml2.so.16.
|
||||
Parts of the xmllint executable were refactored, allowing the
|
||||
combination of more options. OOM errors should be reported reliably now.
|
||||
|
||||
Several improvements were made to the build systems. Meson support is
|
||||
mostly complete.
|
||||
|
||||
Parts of the buffering code were reworked and simplified.
|
||||
|
||||
Overflow checks before reallocations were hardenend.
|
||||
|
||||
Some unprefixed symbols were renamed to avoid namespace pollution.
|
||||
|
||||
### New features
|
||||
|
||||
Input callbacks can now be set on a parser context and an improved API
|
||||
to create parser input is available.
|
||||
to create parser input is available. The following new functions,
|
||||
taking a parser input object, were added:
|
||||
|
||||
A new API function xmlCtxtParseContent to parse XML content using an
|
||||
existing parser context was added.
|
||||
- xmlCtxtParseDocument
|
||||
- xmlCtxtParseContent as replacement for xmlParseBalancedChunkMemory
|
||||
and xmlParseInNodeContext
|
||||
- xmlCtxtParseDtd
|
||||
|
||||
The xmlSave API now has additional options to replace global settings.
|
||||
|
||||
@ -40,6 +60,8 @@ even if libxml2 was complied without ICU support, see example/icu.c.
|
||||
Access to many public struct members is now deprecated. Several accessor
|
||||
functions were added to use instead.
|
||||
|
||||
More internal functions were deprecated.
|
||||
|
||||
### Removals
|
||||
|
||||
Metadata about the HTML4 content model was removed from the htmlElemDesc
|
||||
@ -53,10 +75,16 @@ The xpointer() scheme now behaves like the xpath1() scheme.
|
||||
|
||||
Several legacy symbols and the functions in xmlunicode.h were removed.
|
||||
|
||||
ELF version information was removed.
|
||||
|
||||
The shell was moved from libxml2 to xmllint. Several related functions
|
||||
are no longer available.
|
||||
|
||||
ELF version information was removed.
|
||||
The libxml.m4 file containing autoconf macros was removed.
|
||||
|
||||
The --with-tree configuration option was removed.
|
||||
|
||||
The hack to detect single-threaded programs under glibc was removed.
|
||||
|
||||
### Planned removals
|
||||
|
||||
@ -69,6 +97,177 @@ The following features are considered for removal in the long term:
|
||||
- Support for compressed file I/O
|
||||
- Legacy Windows build system in win32
|
||||
|
||||
### Thanks
|
||||
|
||||
Thanks to the following contributors for their commits:
|
||||
|
||||
- Andrew Potter
|
||||
- Benjamin Gilbert
|
||||
- Chun-wei Fan
|
||||
- correctmost
|
||||
- Daniel Cheng
|
||||
- Daniel E
|
||||
- Florin Haja
|
||||
- Grzegorz Szymaszek
|
||||
- Heiko Becker
|
||||
- Himanshibansal
|
||||
- Jan Alexander Steffens (heftig)
|
||||
- Kjell Ahlstedt
|
||||
- makise-homura
|
||||
- Markus Rickert
|
||||
- Mike Dalessio
|
||||
- Miklos Vajna
|
||||
- Rosen Penev
|
||||
- Ruslan Garipov
|
||||
- Ryan Carsten Schmidt
|
||||
- Saleem Abdulrasool
|
||||
- Sam James
|
||||
- Satadru Pramanik
|
||||
- Taylor R Campbell
|
||||
- triallax
|
||||
- Yegor Yefremov
|
||||
- Zak Ridouh
|
||||
|
||||
|
||||
v2.13.6: Feb 18 2025
|
||||
|
||||
### Security
|
||||
|
||||
- [CVE-2025-24928] Fix stack-buffer-overflow in xmlSnprintfElements
|
||||
- [CVE-2024-56171] Fix use-after-free after xmlSchemaItemListAdd
|
||||
- pattern: Fix compilation of explicit child axis
|
||||
|
||||
### Regressions
|
||||
|
||||
- xmllint: Support compressed input from stdin
|
||||
- uri: Fix handling of Windows drive letters
|
||||
- reader: Fix return value of xmlTextReaderReadString again
|
||||
- SAX2: Fix xmlSAX2ResolveEntity if systemId is NULL
|
||||
|
||||
### Portability
|
||||
|
||||
- dict: Handle ENOSYS from getentropy gracefully
|
||||
- Fix compilation with uclibc (Dario Binacchi)
|
||||
- python: Declare init func with PyMODINIT_FUNC
|
||||
- tests: Fix sanitizer version check on old Apple clang
|
||||
- cmake: Work around broken sys/random.h in old macOS SDKs
|
||||
|
||||
### Build
|
||||
|
||||
- autotools: Set AC_CONFIG_AUX_DIR
|
||||
- cmake: Always build Python module as shared library
|
||||
- cmake: add missing `Bcrypt` link on Windows (Saleem Abdulrasool)
|
||||
- cmake: Fix compatibility in package version file
|
||||
|
||||
|
||||
v2.13.5: Nov 12 2024
|
||||
|
||||
### Regressions
|
||||
|
||||
- xmlIO: Fix reading from non-regular files like pipes
|
||||
- xmlreader: Fix return value of xmlTextReaderReadString
|
||||
- parser: Fix loading of parameter entities in external DTDs
|
||||
- parser: Fix downstream code that swaps DTDs
|
||||
- parser: Fix detection of duplicate attributes
|
||||
- string: Fix va_copy fallback
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- xpath: Fix parsing of non-ASCII names
|
||||
|
||||
|
||||
v2.13.4: Sep 18 2024
|
||||
|
||||
### Regressions
|
||||
|
||||
- parser: Make unsupported encodings an error in declarations
|
||||
- io: don't set the executable bit when creating files (triallax)
|
||||
- xmlcatalog: Improved fix for #699
|
||||
- Revert "catalog: Fetch XML catalog before dumping"
|
||||
- io: Add missing calls to xmlInitParser
|
||||
- tree: Restore return value of xmlNodeListGetString with NULL list
|
||||
- parser: Fix error handling after reaching limit
|
||||
- parser: Make xmlParseChunk return an error if parser was stopped
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- python: Fix SAX driver with character streams
|
||||
|
||||
### Improvements
|
||||
|
||||
- xpath: Make recursion check work with xmlXPathCompile
|
||||
- parser: Report at least one fatal error
|
||||
|
||||
### Portability
|
||||
|
||||
- include: Check whether _MSC_VER is defined
|
||||
|
||||
|
||||
v2.13.3: Jul 24 2024
|
||||
|
||||
### Security
|
||||
|
||||
- [CVE-2024-40896] Fix XXE protection in downstream code
|
||||
|
||||
### Regressions
|
||||
|
||||
- autotools: Use AC_CHECK_DECL to check for getentropy
|
||||
- xinclude: Fix fallback for text includes
|
||||
- io: Don't call getcwd in xmlParserGetDirectory
|
||||
- io: Fix return value of xmlFileRead
|
||||
- parser: Fix error return of xmlParseBalancedChunkMemory
|
||||
|
||||
### Improvements
|
||||
|
||||
- xinclude: Set error handler when parsing text
|
||||
- Undeprecate xmlKeepBlanksDefault
|
||||
|
||||
|
||||
v2.13.2: Jul 4 2024
|
||||
|
||||
### Regressions
|
||||
|
||||
- tree: Fix handling of empty strings in xmlNodeParseContent
|
||||
- valid: Restore ID lookup
|
||||
- parser: Reenable ctxt->directory
|
||||
- uri: Handle filesystem paths in xmlBuildRelativeURISafe
|
||||
- encoding: Make xmlFindCharEncodingHandler return UTF-8 handler
|
||||
- encoding: Fix encoding lookup with xmlOpenCharEncodingHandler
|
||||
- include: Define ATTRIBUTE_UNUSED for clang
|
||||
- uri: Fix xmlBuildURI with NULL base
|
||||
|
||||
### Improvements
|
||||
|
||||
- uri: Enable Windows paths on Cygwin
|
||||
- tests: Clarify licence of test/intsubset2.xml
|
||||
|
||||
|
||||
v2.13.1: Jun 19 2024
|
||||
|
||||
### Regressions
|
||||
|
||||
- parser: Selectively reenable reading from "-"
|
||||
- reader: Fix xmlTextReaderReadString
|
||||
- xinclude: Set XPath context doc
|
||||
- xinclude: Load included documents with XML_PARSE_DTDLOAD
|
||||
- include: Don't redefine ATTRIBUTE_UNUSED
|
||||
- include: Readd circular dependency between tree.h and parser.h
|
||||
- xinclude: Add missing include (Jan Alexander Steffens (heftig))
|
||||
- win32, msvc: fix missing linking against Bcrypt.lib (Miklos Vajna)
|
||||
- xinclude: Don't raise error on empty nodeset
|
||||
- parser: Make failure to load main document a warning
|
||||
- tree: Fix freeing entities via xmlFreeNode
|
||||
- parser: Pass global object to sax->setDocumentLocator
|
||||
|
||||
### Improvements
|
||||
|
||||
- io: Fix resetting xmlParserInputBufferCreateFilename hook
|
||||
|
||||
### Documentation
|
||||
|
||||
- Fix typo in NEWS (--with-html -> --with-http) (Ryan Carsten Schmidt)
|
||||
- doc: Don't mention xmlNewInputURL
|
||||
|
||||
|
||||
v2.13.0: Jun 12 2024
|
||||
|
||||
|
@ -354,7 +354,6 @@
|
||||
<exports symbol='xmlCharEncodingHandler' type='typedef'/>
|
||||
<exports symbol='xmlCharEncodingHandlerPtr' type='typedef'/>
|
||||
<exports symbol='_xmlCharEncodingHandler' type='struct'/>
|
||||
<exports symbol='xmlCharEncConverter' type='struct'/>
|
||||
<exports symbol='xmlAddEncodingAlias' type='function'/>
|
||||
<exports symbol='xmlCharEncCloseFunc' type='function'/>
|
||||
<exports symbol='xmlCharEncConvCtxtDtor' type='function'/>
|
||||
@ -362,6 +361,7 @@
|
||||
<exports symbol='xmlCharEncConvImpl' type='function'/>
|
||||
<exports symbol='xmlCharEncFirstLine' type='function'/>
|
||||
<exports symbol='xmlCharEncInFunc' type='function'/>
|
||||
<exports symbol='xmlCharEncNewCustomHandler' type='function'/>
|
||||
<exports symbol='xmlCharEncOutFunc' type='function'/>
|
||||
<exports symbol='xmlCharEncodingInputFunc' type='function'/>
|
||||
<exports symbol='xmlCharEncodingOutputFunc' type='function'/>
|
||||
@ -8116,11 +8116,12 @@ crash if you try to modify the tree)'/>
|
||||
<arg name='vctxt' type='void *' info='conversion context'/>
|
||||
</functype>
|
||||
<functype name='xmlCharEncConvImpl' file='encoding' module='encoding'>
|
||||
<info>vctxt: user data name: encoding name conv: pointer to xmlCharEncConverter struct If this function returns XML_ERR_OK, it must fill the @conv struct with a conversion function, and optional destructor and optional input and output conversion contexts.</info>
|
||||
<info>If this function returns XML_ERR_OK, it must fill the @out pointer with an encoding handler. The handler can be obtained from xmlCharEncNewCustomHandler.</info>
|
||||
<return type='int' info='an xmlParserErrors code.'/>
|
||||
<arg name='vctxt' type='void *' info=''/>
|
||||
<arg name='name' type='const char *' info=''/>
|
||||
<arg name='conv' type='xmlCharEncConverter *' info=''/>
|
||||
<arg name='vctxt' type='void *' info='user data'/>
|
||||
<arg name='name' type='const char *' info='encoding name'/>
|
||||
<arg name='output' type='int' info='true if output encoding, false if input'/>
|
||||
<arg name='out' type='xmlCharEncodingHandler **' info='pointer to resulting handler'/>
|
||||
</functype>
|
||||
<function name='xmlCharEncFirstLine' file='encoding' module='encoding'>
|
||||
<info>DEPERECATED: Don't use.</info>
|
||||
@ -8136,6 +8137,17 @@ crash if you try to modify the tree)'/>
|
||||
<arg name='out' type='xmlBufferPtr' info='an xmlBuffer for the output.'/>
|
||||
<arg name='in' type='xmlBufferPtr' info='an xmlBuffer for the input'/>
|
||||
</function>
|
||||
<function name='xmlCharEncNewCustomHandler' file='encoding' module='encoding'>
|
||||
<info>Create a custom xmlCharEncodingHandler.</info>
|
||||
<return type='int' info='an xmlParserError code.'/>
|
||||
<arg name='name' type='const char *' info='the encoding name'/>
|
||||
<arg name='input' type='xmlCharEncConvFunc' info='input callback which converts to UTF-8'/>
|
||||
<arg name='output' type='xmlCharEncConvFunc' info='output callback which converts from UTF-8'/>
|
||||
<arg name='ctxtDtor' type='xmlCharEncConvCtxtDtor' info='context destructor'/>
|
||||
<arg name='inputCtxt' type='void *' info='context for input callback'/>
|
||||
<arg name='outputCtxt' type='void *' info='context for output callback'/>
|
||||
<arg name='out' type='xmlCharEncodingHandler **' info='pointer to resulting handler'/>
|
||||
</function>
|
||||
<function name='xmlCharEncOutFunc' file='encoding' module='encoding'>
|
||||
<info>Generic front-end for the encoding handler output function a first call with @in == NULL has to be made firs to initiate the output in case of non-stateless encoding needing to initiate their state or the output (like the BOM in UTF16). In case of UTF8 sequence conversion errors for the given encoder, the content will be automatically remapped to a CharRef sequence.</info>
|
||||
<return type='int' info='the number of bytes written or an XML_ENC_ERR code.'/>
|
||||
@ -12259,7 +12271,7 @@ crash if you try to modify the tree)'/>
|
||||
<return type='void'/>
|
||||
</function>
|
||||
<functype name='xmlResourceLoader' file='parser' module='parser'>
|
||||
<info>Callback for custom resource loaders. @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.</info>
|
||||
<info>Callback for custom resource loaders. @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK. On success, @out should be set to a new parser input object and XML_ERR_OK should be returned.</info>
|
||||
<return type='int' info='an xmlParserError code.'/>
|
||||
<arg name='ctxt' type='void *' info='parser context'/>
|
||||
<arg name='url' type='const char *' info='URL to load'/>
|
||||
|
163
encoding.c
163
encoding.c
@ -239,12 +239,12 @@ static int nbCharEncodingHandler = 0;
|
||||
|
||||
#ifdef LIBXML_ICONV_ENABLED
|
||||
static int
|
||||
xmlCharEncIconv(void *vctxt, const char *name, xmlCharEncConverter *conv);
|
||||
xmlCharEncIconv(const char *name, xmlCharEncodingHandler **out);
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_ICU_ENABLED
|
||||
static int
|
||||
xmlCharEncUconv(void *vctxt, const char *name, xmlCharEncConverter *conv);
|
||||
xmlCharEncUconv(const char *name, xmlCharEncodingHandler **out);
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
@ -641,6 +641,54 @@ xmlNewCharEncodingHandler(const char *name,
|
||||
return(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCharEncNewCustomHandler:
|
||||
* @name: the encoding name
|
||||
* @input: input callback which converts to UTF-8
|
||||
* @output: output callback which converts from UTF-8
|
||||
* @ctxtDtor: context destructor
|
||||
* @inputCtxt: context for input callback
|
||||
* @outputCtxt: context for output callback
|
||||
* @out: pointer to resulting handler
|
||||
*
|
||||
* Create a custom xmlCharEncodingHandler.
|
||||
*
|
||||
* Returns an xmlParserError code.
|
||||
*/
|
||||
int
|
||||
xmlCharEncNewCustomHandler(const char *name,
|
||||
xmlCharEncConvFunc input, xmlCharEncConvFunc output,
|
||||
xmlCharEncConvCtxtDtor ctxtDtor,
|
||||
void *inputCtxt, void *outputCtxt,
|
||||
xmlCharEncodingHandler **out) {
|
||||
xmlCharEncodingHandler *handler;
|
||||
|
||||
if (out == NULL)
|
||||
return(XML_ERR_ARGUMENT);
|
||||
|
||||
handler = xmlMalloc(sizeof(*handler));
|
||||
if (handler == NULL)
|
||||
return(XML_ERR_NO_MEMORY);
|
||||
memset(handler, 0, sizeof(*handler));
|
||||
|
||||
if (name != NULL) {
|
||||
handler->name = xmlMemStrdup(name);
|
||||
if (handler->name == NULL) {
|
||||
xmlFree(handler);
|
||||
return(XML_ERR_NO_MEMORY);
|
||||
}
|
||||
}
|
||||
|
||||
handler->input.func = input;
|
||||
handler->output.func = output;
|
||||
handler->ctxtDtor = ctxtDtor;
|
||||
handler->inputCtxt = inputCtxt;
|
||||
handler->outputCtxt = outputCtxt;
|
||||
|
||||
*out = handler;
|
||||
return(XML_ERR_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlInitCharEncodingHandlers:
|
||||
*
|
||||
@ -732,25 +780,6 @@ free_handler:
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
xmlInvokeConvImpl(xmlCharEncConvImpl impl, void *implCtxt,
|
||||
const char *name, xmlCharEncodingHandler *handler) {
|
||||
xmlCharEncConverter conv = { NULL, NULL, NULL, NULL, NULL };
|
||||
int ret;
|
||||
|
||||
ret = impl(implCtxt, name, &conv);
|
||||
|
||||
if (ret == XML_ERR_OK) {
|
||||
handler->input.func = conv.input;
|
||||
handler->output.func = conv.output;
|
||||
handler->ctxtDtor = conv.ctxtDtor;
|
||||
handler->inputCtxt = conv.inputCtxt;
|
||||
handler->outputCtxt = conv.outputCtxt;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlFindExtraHandler:
|
||||
* @norig: name of the char encoding
|
||||
@ -768,40 +797,21 @@ static int
|
||||
xmlFindExtraHandler(const char *norig, const char *name, int output,
|
||||
xmlCharEncConvImpl impl, void *implCtxt,
|
||||
xmlCharEncodingHandler **out) {
|
||||
xmlCharEncodingHandler *handler;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
handler = xmlMalloc(sizeof(*handler));
|
||||
if (handler == NULL)
|
||||
return(XML_ERR_NO_MEMORY);
|
||||
memset(handler, 0, sizeof(*handler));
|
||||
|
||||
handler->name = xmlMemStrdup(name);
|
||||
if (handler->name == NULL) {
|
||||
ret = XML_ERR_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try custom implementation before deprecated global handlers.
|
||||
*
|
||||
* Note that we pass the original name without deprecated
|
||||
* alias resolution.
|
||||
*/
|
||||
if (impl != NULL) {
|
||||
ret = xmlInvokeConvImpl(impl, implCtxt, norig, handler);
|
||||
if (ret != XML_ERR_OK)
|
||||
goto done;
|
||||
|
||||
*out = handler;
|
||||
return(XML_ERR_OK);
|
||||
}
|
||||
if (impl != NULL)
|
||||
return(impl(implCtxt, norig, output, out));
|
||||
|
||||
/*
|
||||
* Deprecated
|
||||
*/
|
||||
if (globalHandlers != NULL) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nbCharEncodingHandler; i++) {
|
||||
xmlCharEncodingHandler *h = globalHandlers[i];
|
||||
|
||||
@ -809,42 +819,35 @@ xmlFindExtraHandler(const char *norig, const char *name, int output,
|
||||
(const xmlChar *) h->name)) {
|
||||
if ((output ? h->output.func : h->input.func) != NULL) {
|
||||
*out = h;
|
||||
ret = XML_ERR_OK;
|
||||
goto done;
|
||||
return(XML_ERR_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LIBXML_ICONV_ENABLED
|
||||
ret = xmlInvokeConvImpl(xmlCharEncIconv, handler, name, handler);
|
||||
if (ret == XML_ERR_OK) {
|
||||
*out = handler;
|
||||
return(XML_ERR_OK);
|
||||
{
|
||||
int ret = xmlCharEncIconv(name, out);
|
||||
|
||||
if (ret == XML_ERR_OK)
|
||||
return(XML_ERR_OK);
|
||||
if (ret != XML_ERR_UNSUPPORTED_ENCODING)
|
||||
return(ret);
|
||||
}
|
||||
if (ret != XML_ERR_UNSUPPORTED_ENCODING)
|
||||
goto done;
|
||||
#endif /* LIBXML_ICONV_ENABLED */
|
||||
|
||||
#ifdef LIBXML_ICU_ENABLED
|
||||
ret = xmlInvokeConvImpl(xmlCharEncUconv, handler, name, handler);
|
||||
if (ret == XML_ERR_OK) {
|
||||
*out = handler;
|
||||
return(XML_ERR_OK);
|
||||
{
|
||||
int ret = xmlCharEncUconv(name, out);
|
||||
|
||||
if (ret == XML_ERR_OK)
|
||||
return(XML_ERR_OK);
|
||||
if (ret != XML_ERR_UNSUPPORTED_ENCODING)
|
||||
return(ret);
|
||||
}
|
||||
if (ret != XML_ERR_UNSUPPORTED_ENCODING)
|
||||
goto done;
|
||||
#endif /* LIBXML_ICU_ENABLED */
|
||||
|
||||
ret = XML_ERR_UNSUPPORTED_ENCODING;
|
||||
|
||||
done:
|
||||
if (handler != NULL) {
|
||||
xmlFree(handler->name);
|
||||
xmlFree(handler);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
return(XML_ERR_UNSUPPORTED_ENCODING);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1149,8 +1152,7 @@ xmlEncodingMatch(const char *name1, const char *name2) {
|
||||
#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
|
||||
|
||||
static int
|
||||
xmlCharEncIconv(void *vctxt ATTRIBUTE_UNUSED, const char *name,
|
||||
xmlCharEncConverter *conv) {
|
||||
xmlCharEncIconv(const char *name, xmlCharEncodingHandler **out) {
|
||||
xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
|
||||
iconv_t icv_in;
|
||||
iconv_t icv_out;
|
||||
@ -1241,13 +1243,9 @@ xmlCharEncIconv(void *vctxt ATTRIBUTE_UNUSED, const char *name,
|
||||
}
|
||||
outputCtxt->cd = icv_out;
|
||||
|
||||
conv->input = xmlIconvConvert;
|
||||
conv->output = xmlIconvConvert;
|
||||
conv->ctxtDtor = xmlIconvFree;
|
||||
conv->inputCtxt = inputCtxt;
|
||||
conv->outputCtxt = outputCtxt;
|
||||
|
||||
return(XML_ERR_OK);
|
||||
return(xmlCharEncNewCustomHandler(name, xmlIconvConvert, xmlIconvConvert,
|
||||
xmlIconvFree, inputCtxt, outputCtxt,
|
||||
out));
|
||||
|
||||
error:
|
||||
if (inputCtxt != NULL)
|
||||
@ -1436,8 +1434,7 @@ xmlUconvFree(void *vctxt) {
|
||||
}
|
||||
|
||||
static int
|
||||
xmlCharEncUconv(void *vctxt ATTRIBUTE_UNUSED, const char *name,
|
||||
xmlCharEncConverter *conv) {
|
||||
xmlCharEncUconv(const char *name, xmlCharEncodingHandler **out) {
|
||||
xmlUconvCtxt *ucv_in = NULL;
|
||||
xmlUconvCtxt *ucv_out = NULL;
|
||||
int ret;
|
||||
@ -1449,13 +1446,9 @@ xmlCharEncUconv(void *vctxt ATTRIBUTE_UNUSED, const char *name,
|
||||
if (ret != 0)
|
||||
goto error;
|
||||
|
||||
conv->input = xmlUconvConvert;
|
||||
conv->output = xmlUconvConvert;
|
||||
conv->ctxtDtor = xmlUconvFree;
|
||||
conv->inputCtxt = ucv_in;
|
||||
conv->outputCtxt = ucv_out;
|
||||
|
||||
return(XML_ERR_OK);
|
||||
return(xmlCharEncNewCustomHandler(name, xmlUconvConvert, xmlUconvConvert,
|
||||
xmlUconvFree, ucv_in, ucv_out,
|
||||
out));
|
||||
|
||||
error:
|
||||
if (ucv_in != NULL)
|
||||
|
@ -174,8 +174,8 @@ icuConvCtxtDtor(void *vctxt) {
|
||||
}
|
||||
|
||||
static int
|
||||
icuConvImpl(void *vctxt, const char *name,
|
||||
xmlCharEncConverter *conv) {
|
||||
icuConvImpl(void *vctxt, const char *name, int output,
|
||||
xmlCharEncodingHandler **out) {
|
||||
myConvCtxt *inputCtxt = NULL;
|
||||
myConvCtxt *outputCtxt = NULL;
|
||||
int ret;
|
||||
@ -187,13 +187,9 @@ icuConvImpl(void *vctxt, const char *name,
|
||||
if (ret != 0)
|
||||
goto error;
|
||||
|
||||
conv->input = icuConvert;
|
||||
conv->output = icuConvert;
|
||||
conv->ctxtDtor = icuConvCtxtDtor;
|
||||
conv->inputCtxt = inputCtxt;
|
||||
conv->outputCtxt = outputCtxt;
|
||||
|
||||
return XML_ERR_OK;
|
||||
return xmlCharEncNewCustomHandler(name, icuConvert, icuConvert,
|
||||
icuConvCtxtDtor, inputCtxt, outputCtxt,
|
||||
out);
|
||||
|
||||
error:
|
||||
if (inputCtxt != NULL)
|
||||
|
@ -147,30 +147,6 @@ typedef int
|
||||
typedef void
|
||||
(*xmlCharEncConvCtxtDtor)(void *vctxt);
|
||||
|
||||
typedef struct {
|
||||
xmlCharEncConvFunc input;
|
||||
xmlCharEncConvFunc output;
|
||||
xmlCharEncConvCtxtDtor ctxtDtor;
|
||||
void *inputCtxt;
|
||||
void *outputCtxt;
|
||||
} xmlCharEncConverter;
|
||||
|
||||
/**
|
||||
* xmlCharEncConvImpl:
|
||||
* vctxt: user data
|
||||
* name: encoding name
|
||||
* conv: pointer to xmlCharEncConverter struct
|
||||
*
|
||||
* If this function returns XML_ERR_OK, it must fill the @conv struct
|
||||
* with a conversion function, and optional destructor and optional
|
||||
* input and output conversion contexts.
|
||||
*
|
||||
* Returns an xmlParserErrors code.
|
||||
*/
|
||||
typedef int
|
||||
(*xmlCharEncConvImpl)(void *vctxt, const char *name,
|
||||
xmlCharEncConverter *conv);
|
||||
|
||||
/*
|
||||
* Block defining the handlers for non UTF-8 encodings.
|
||||
*
|
||||
@ -194,6 +170,23 @@ struct _xmlCharEncodingHandler {
|
||||
int flags XML_DEPRECATED_MEMBER;
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlCharEncConvImpl:
|
||||
* @vctxt: user data
|
||||
* @name: encoding name
|
||||
* @output: true if output encoding, false if input
|
||||
* @out: pointer to resulting handler
|
||||
*
|
||||
* If this function returns XML_ERR_OK, it must fill the @out
|
||||
* pointer with an encoding handler. The handler can be obtained
|
||||
* from xmlCharEncNewCustomHandler.
|
||||
*
|
||||
* Returns an xmlParserErrors code.
|
||||
*/
|
||||
typedef int
|
||||
(*xmlCharEncConvImpl)(void *vctxt, const char *name, int output,
|
||||
xmlCharEncodingHandler **out);
|
||||
|
||||
/*
|
||||
* Interfaces for encoding handlers.
|
||||
*/
|
||||
@ -226,6 +219,14 @@ XMLPUBFUN xmlCharEncodingHandlerPtr
|
||||
xmlNewCharEncodingHandler (const char *name,
|
||||
xmlCharEncodingInputFunc input,
|
||||
xmlCharEncodingOutputFunc output);
|
||||
XMLPUBFUN int
|
||||
xmlCharEncNewCustomHandler (const char *name,
|
||||
xmlCharEncConvFunc input,
|
||||
xmlCharEncConvFunc output,
|
||||
xmlCharEncConvCtxtDtor ctxtDtor,
|
||||
void *inputCtxt,
|
||||
void *outputCtxt,
|
||||
xmlCharEncodingHandler **out);
|
||||
|
||||
/*
|
||||
* Interfaces for encoding names and aliases.
|
||||
|
@ -94,7 +94,7 @@ struct _xmlParserInput {
|
||||
/* Current column */
|
||||
int col;
|
||||
/* How many xmlChars already consumed */
|
||||
unsigned long consumed XML_DEPRECATED_MEMBER;
|
||||
unsigned long consumed;
|
||||
/* function to deallocate the base */
|
||||
xmlParserInputDeallocate free XML_DEPRECATED_MEMBER;
|
||||
/* unused */
|
||||
@ -358,7 +358,7 @@ struct _xmlParserCtxt {
|
||||
void *_private;
|
||||
|
||||
/* should the external subset be loaded */
|
||||
int loadsubset XML_DEPRECATED_MEMBER;
|
||||
int loadsubset;
|
||||
/* set line number in element content */
|
||||
int linenumbers XML_DEPRECATED_MEMBER;
|
||||
/* document's own catalog */
|
||||
|
1
result/xmlsec/parseFile/result.txt
Normal file
1
result/xmlsec/parseFile/result.txt
Normal file
@ -0,0 +1 @@
|
||||
Parsed document
|
81
result/xmlsec/parseFile/testfile1.xml
Normal file
81
result/xmlsec/parseFile/testfile1.xml
Normal file
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||
<SignedInfo>
|
||||
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
|
||||
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<Reference URI="#object">
|
||||
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<DigestValue>iDhYt78o294fA6pzQ7k44+eejrQMi+WX3l3UrUdtL1Q=</DigestValue>
|
||||
</Reference>
|
||||
</SignedInfo>
|
||||
<SignatureValue>xOSp1bweDaNd5+NzBNO+m+1oEOm1jNjBMXf12F7LsXoBDpvgC3efL2XgkoRY8LJ9
|
||||
msV4PSDkJRzzmvSTvQ6Txg==</SignatureValue>
|
||||
<KeyInfo>
|
||||
<X509Data>
|
||||
<X509Certificate>MIID9zCCA2CgAwIBAgIJAK+ii7kzrdqsMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
|
||||
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1MIFNlY3Vy
|
||||
aXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2VjKTEQMA4G
|
||||
A1UECxMHUm9vdCBDQTEWMBQGA1UEAxMNQWxla3NleSBTYW5pbjEhMB8GCSqGSIb3
|
||||
DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tMCAXDTE0MDUyMzE3NTA1OVoYDzIxMTQw
|
||||
NDI5MTc1MDU5WjCBrjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx
|
||||
PTA7BgNVBAoTNFhNTCBTZWN1cml0eSBMaWJyYXJ5IChodHRwOi8vd3d3LmFsZWtz
|
||||
ZXkuY29tL3htbHNlYykxEDAOBgNVBAsTB1Jvb3QgQ0ExFjAUBgNVBAMTDUFsZWtz
|
||||
ZXkgU2FuaW4xITAfBgkqhkiG9w0BCQEWEnhtbHNlY0BhbGVrc2V5LmNvbTCBnzAN
|
||||
BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtY4MCNj/qrOzV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3zjcEI60pVPuwDqTM
|
||||
QygZMIHjBgNVHSMEgdswgdiAFP7k7FMk8JWVxxC14US1XTllWuN+oYG0pIGxMIGu
|
||||
MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1M
|
||||
IFNlY3VyaXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2Vj
|
||||
KTEQMA4GA1UECxMHUm9vdCBDQTEWMBQGA1UEAxMNQWxla3NleSBTYW5pbjEhMB8G
|
||||
CSqGSIb3DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tggkAr6KLuTOt2q0wDQYJKoZI
|
||||
hvcNAQEFBQADQQAOXBj0yICp1RmHXqnUlsppryLCW3pKBD1dkb4HWarO7RjA1yJJ
|
||||
fBjXssrERn05kpBcrRfzou4r3DCgQFPhjxga</X509Certificate>
|
||||
</X509Data>
|
||||
</KeyInfo>
|
||||
<Object Id="object">some text</Object>
|
||||
</Signature>
|
22
result/xmlsec/parseFile/testfile2.xml
Normal file
22
result/xmlsec/parseFile/testfile2.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/><Reference URI="#e1ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>3K+K4MbR2EW7l/ry59XockKqt4g=</DigestValue></Reference><Reference URI="#e2ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>hnKFjGFr/jwLCCTckZpaclOwe28=</DigestValue></Reference><Reference URI="#e3ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>RUUBiUeFf8uRqTlpCyutkXDqnJ4=</DigestValue></Reference></SignedInfo><SignatureValue>XzEJQ+whhHUYlqiCEt8XFxC8wpk=</SignatureValue><Object><ietf:c14n11XmlPointerDoc1 xmlns:ietf="http://www.ietf.org" xmlns:w3c="http://www.w3.org">
|
||||
<!-- This is a xml document for checking behaviour of tools with regards to comments when using scheme-based xpointers in the ds:Reference's URI attribute -->
|
||||
<ietf:e1 xml:id="e1ID">
|
||||
<!-- This is a comment for ietf:e1 element -->
|
||||
<ietf:e11>
|
||||
<!-- This is a comment for ietf:e11 element -->
|
||||
<ietf:e111/>
|
||||
</ietf:e11>
|
||||
<ietf:e12 at="2">
|
||||
<!-- This is a comment for ietf:e12 element -->
|
||||
<ietf:e121/>
|
||||
</ietf:e12>
|
||||
</ietf:e1>
|
||||
<ietf:e2 xml:id="e2ID">
|
||||
<!-- This is a comment for ietf:e2 element -->
|
||||
<ietf:e21/>
|
||||
</ietf:e2>
|
||||
<ietf:e3 xml:id="e3ID">
|
||||
<ietf:e31 at="3"/>
|
||||
</ietf:e3>
|
||||
</ietf:c14n11XmlPointerDoc1></Object></Signature>
|
63
result/xmlsec/parseFile/testfile3.xml
Normal file
63
result/xmlsec/parseFile/testfile3.xml
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PaymentInfo xmlns="http://example.org/paymentv2">
|
||||
<Name>John Smith</Name>
|
||||
<CreditCard Currency="USD" Limit="5,000">
|
||||
<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content">
|
||||
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:RetrievalMethod Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" URI="#EK"/>
|
||||
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#" Id="EK">
|
||||
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:KeyName>my-rsa-key</ds:KeyName>
|
||||
<ds:X509Data>
|
||||
<ds:X509Certificate>
|
||||
MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
|
||||
CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
|
||||
U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
|
||||
IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
|
||||
MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
|
||||
CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
|
||||
MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
|
||||
BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
|
||||
Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
|
||||
xMG7z+hEB1LT2swTs10GILFWPByRl3/BEsnekLZdoqNoJrvnttVkxgu3x80Ji3/A
|
||||
ZD8Ub/kBGOSPyu6pn3OdnMTc5q4r1qUe985lQzCZvCMw6AoGeCyJodNu2MbveNeH
|
||||
+YPjRgLCQfzvOFRq+9qMtE8XfUJZdNhPZhgdsOGf8uJauTcIHbAyw7BhxPy6RikW
|
||||
W5yiWUmBya+7t4y1TQJzham/0y0zU3TAA7b/rDrU7xmNPwIDAQABoyQwIjAPBgNV
|
||||
HRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBgAwDQYJKoZIhvcNAQEEBQADggEB
|
||||
ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
|
||||
OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
|
||||
WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
|
||||
p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
|
||||
O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
|
||||
kKO/vB9Ay64Rt88XbLnnGns=
|
||||
</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
<CipherData>
|
||||
<CipherValue>
|
||||
Vc7VOXgJDlw/oQ0hOvIaBKsGiOwyvIArzkhd2W7mZBQyeFlkJlxZQdnPGGg4kJE9
|
||||
EGWeMWQZ0XavJy+xA9Z+PlIFqkpPHUXyos9jZZNniRxEtl6tLce2ReSVah+y8Lb3
|
||||
3xSNSm+O9k2B42yP3Osrj175KNMSMLLM2ZuA0iq28aP7v7DmtDY7VNp0n+O4nJUM
|
||||
Eyy4RO0jmtXctt3jUfpCmGkqy42/LG6F5h1kluyfszjHvi/9lD5LEkCl2Y/3az+j
|
||||
2vLuuXM45z6ef14Dlgsh7eJtqp3bRT0Tpp4JvBWMiuDZaV1zUcZq7q80lNMvXucb
|
||||
mSrSmlXn2lWPttfTrcjXrw==
|
||||
</CipherValue>
|
||||
</CipherData>
|
||||
<ReferenceList>
|
||||
<DataReference URI="#ED"/>
|
||||
</ReferenceList>
|
||||
</EncryptedKey>
|
||||
</ds:KeyInfo>
|
||||
<CipherData>
|
||||
<CipherValue>
|
||||
p5MMs6F765jIUqOj5rH1vAro0Rx4/PLIoEOXCOWaEGbEdCHh0m86zifozutcmoBA
|
||||
xy1SuxmJjtFDO32f/bpuDhdzFDgLrlVIcXrNeHGgken6NryC2n1NdGS9CiYsyaPF
|
||||
B5CWEkx3Prtbak6S20z3XZTJltOdoqzeNOn8/IDavLA=
|
||||
</CipherValue>
|
||||
</CipherData>
|
||||
</EncryptedData>
|
||||
</CreditCard>
|
||||
</PaymentInfo>
|
2
result/xmlsec/parseMemory/buffer1.txt
Normal file
2
result/xmlsec/parseMemory/buffer1.txt
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template></xsl:stylesheet>
|
22
result/xmlsec/parseMemory/buffer2.txt
Normal file
22
result/xmlsec/parseMemory/buffer2.txt
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
|
||||
<xsl:output encoding="UTF-8" indent="no" method="xml"/>
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>Notaries</title>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<xsl:for-each select="Notaries/Notary">
|
||||
<tr>
|
||||
<th>
|
||||
<xsl:value-of select="@name"/>
|
||||
</th>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
40
result/xmlsec/parseMemory/buffer3.txt
Normal file
40
result/xmlsec/parseMemory/buffer3.txt
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:strip-space elements="player name position team"/>
|
||||
<xsl:output encoding="iso-8859-1" indent="no" method="xml"/>
|
||||
|
||||
<xsl:template match="player">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="name"/>
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/name">
|
||||
<h1>
|
||||
<xsl:apply-templates/>
|
||||
</h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/position">
|
||||
<h2>
|
||||
<xsl:apply-templates/>
|
||||
</h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/team">
|
||||
<h3>
|
||||
<xsl:apply-templates/>
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
1
result/xmlsec/parseMemory/result.txt
Normal file
1
result/xmlsec/parseMemory/result.txt
Normal file
@ -0,0 +1 @@
|
||||
Parsed buffer
|
320
runtest.c
320
runtest.c
@ -5112,6 +5112,314 @@ automataTest(const char *filename, const char *result,
|
||||
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
|
||||
static int g_xmlsec_parser_default_options = XML_PARSE_NONET | XML_PARSE_NODICT | XML_PARSE_HUGE;
|
||||
static int xmlSecParserGetDefaultOptions(void) { return (g_xmlsec_parser_default_options); }
|
||||
|
||||
static void xmlSecParsePrepareCtxt(xmlParserCtxtPtr ctxt) {
|
||||
if (ctxt == NULL)
|
||||
fatalError();
|
||||
|
||||
ctxt->loadsubset = 2 | 4;
|
||||
ctxt->replaceEntities = 1;
|
||||
|
||||
xmlCtxtUseOptions(ctxt, xmlSecParserGetDefaultOptions());
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSecParseFileTest:
|
||||
* @filename: the file to parse
|
||||
* @result: the file with the expected data
|
||||
* @err: the file with error messages: unused
|
||||
* @options: unused
|
||||
*
|
||||
* Test case automatically generated from xmlsec.
|
||||
* The test case parses a file containing XML data
|
||||
* and creates a context.
|
||||
*
|
||||
* Returns 0 in case of success, an error code otherwise
|
||||
*
|
||||
* XML Security Library is released under the MIT Licence
|
||||
*/
|
||||
static int
|
||||
xmlSecParseFileTest(const char *filename, const char *result,
|
||||
const char *err ATTRIBUTE_UNUSED, int options ATTRIBUTE_UNUSED) {
|
||||
|
||||
int ret;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
char *tempFileName;
|
||||
FILE *out;
|
||||
tempFileName = resultFilename(filename, temp_directory, ".res");
|
||||
if (tempFileName == NULL) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
fatalError();
|
||||
}
|
||||
out = fopen(tempFileName, "wb");
|
||||
|
||||
if (filename == NULL)
|
||||
return (-1);
|
||||
|
||||
xmlInitParser();
|
||||
ctxt = xmlCreateFileParserCtxt(filename);
|
||||
|
||||
if (ctxt == NULL) {
|
||||
fprintf(out, "Failed to create context\n");
|
||||
free(tempFileName);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
xmlSecParsePrepareCtxt(ctxt);
|
||||
|
||||
if (ctxt->directory == NULL) {
|
||||
ctxt->directory = xmlParserGetDirectory(filename);
|
||||
if (ctxt->directory == NULL)
|
||||
fprintf(out, "Could not get directory\n");
|
||||
fclose(out);
|
||||
free(tempFileName);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ret = xmlParseDocument(ctxt);
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(out, "Failed to parse document\n");
|
||||
fclose(out);
|
||||
free(tempFileName);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (!ctxt->wellFormed) {
|
||||
fprintf(out, "Document is not well formed\n");
|
||||
fclose(out);
|
||||
free(tempFileName);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
xmlSaveFile(tempFileName, ctxt->myDoc);
|
||||
if (compareFiles(tempFileName, result)) {
|
||||
fprintf(stderr, "Got a difference for %s\n", filename);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (ctxt != NULL) {
|
||||
if (ctxt->myDoc != NULL)
|
||||
{
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
}
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
}
|
||||
|
||||
fclose(out);
|
||||
free(tempFileName);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static char *readData(const char *filename, size_t *size) {
|
||||
FILE *stream;
|
||||
char line[100];
|
||||
char *token;
|
||||
char *buffer;
|
||||
int c;
|
||||
unsigned int x;
|
||||
stream = fopen(filename, "r");
|
||||
if (stream == NULL) {
|
||||
fprintf(stderr, "could not open test file");
|
||||
fclose(stream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fgets(line, 100, stream) != NULL) {
|
||||
token = strtok(line, "=");
|
||||
if (strncmp(token, "size", 5) == 0) {
|
||||
token = strtok(NULL, "=");
|
||||
sscanf(token, "%u", &x);
|
||||
*size = x;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Incorrect test file format. Could not read buffer size");
|
||||
fclose(stream);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
buffer = (char *)malloc(*size);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Failed to allocate memory");
|
||||
return NULL;
|
||||
}
|
||||
c = fread(buffer, sizeof(char), *size, stream);
|
||||
if (c == 0) {
|
||||
fprintf(stderr, "Did not read buffer data from file");
|
||||
fclose(stream);
|
||||
return NULL;
|
||||
}
|
||||
fclose(stream);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSecParseMemoryTest:
|
||||
* @filename: the file containing the data to use for the test
|
||||
* @result: the result of the parsing process
|
||||
* @err: the file with error messages: unused
|
||||
* @options: unused
|
||||
*
|
||||
* Test case automatically generated from xmlsec.
|
||||
* The test case parses a buffer containing XML data
|
||||
* and creates a context.
|
||||
*
|
||||
* Returns 0 in case of success, an error code otherwise
|
||||
*
|
||||
* XML Security Library is released under the MIT Licence
|
||||
*/
|
||||
static int
|
||||
xmlSecParseMemoryTest(const char *filename, const char *result,
|
||||
const char *err ATTRIBUTE_UNUSED, int options ATTRIBUTE_UNUSED) {
|
||||
|
||||
size_t size = 0;
|
||||
char *buffer;
|
||||
char *temp;
|
||||
FILE *out;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
int len;
|
||||
int ret;
|
||||
buffer = readData(filename, &size);
|
||||
if (size == 0) {
|
||||
fprintf(stderr, "Could not read data");
|
||||
return -1;
|
||||
}
|
||||
|
||||
temp = resultFilename(filename, temp_directory, ".res");
|
||||
if (temp == NULL) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
free(buffer);
|
||||
fatalError();
|
||||
}
|
||||
|
||||
out = fopen(temp, "wb");
|
||||
|
||||
if (buffer == NULL) {
|
||||
fprintf(out, "Could not allocate memory\n");
|
||||
free(temp);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (size > (size_t)(INT_MAX)) {
|
||||
fprintf(out, "Size is greater than INT_MAX\n");
|
||||
free(buffer);
|
||||
free(temp);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
len = (int)(size);
|
||||
|
||||
ctxt = xmlCreateMemoryParserCtxt((char *)buffer, len);
|
||||
|
||||
if (ctxt == NULL) {
|
||||
fprintf(out, "Failed to create context\n");
|
||||
free(buffer);
|
||||
free(temp);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
xmlSecParsePrepareCtxt(ctxt);
|
||||
|
||||
ret = xmlParseDocument(ctxt);
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(out, "Failed to parse document\n");
|
||||
free(buffer);
|
||||
free(temp);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
xmlSaveFile(temp, ctxt->myDoc);
|
||||
|
||||
if (compareFiles(temp, result)) {
|
||||
fprintf(stderr, "Got a difference for %s\n", filename);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (!ctxt->wellFormed) {
|
||||
if (ctxt->myDoc != NULL) {
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
}
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
fprintf(out, "Buffer is not well formed!\n");
|
||||
free(buffer);
|
||||
free(temp);
|
||||
fclose(out);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
fclose(out);
|
||||
free(temp);
|
||||
free(buffer);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSecCreateTreeTest:
|
||||
*
|
||||
* Test case automatically generated from xmlsec.
|
||||
* The test case generates a new document root node
|
||||
* and associates a namespace to the node.
|
||||
*
|
||||
* Returns 0 in case of success, an error code otherwise
|
||||
*
|
||||
* XML Security Library is released under the MIT Licence
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlSecCreateTreeTest(const char *filename ATTRIBUTE_UNUSED, const char *result ATTRIBUTE_UNUSED,
|
||||
const char *err ATTRIBUTE_UNUSED, int options ATTRIBUTE_UNUSED) {
|
||||
const xmlChar *rootNodeName = (xmlChar *)"Keys";
|
||||
const xmlChar *rootNodeNs = (xmlChar *)"-2086400512";
|
||||
xmlDocPtr doc;
|
||||
xmlNodePtr root;
|
||||
xmlNsPtr ns;
|
||||
if (rootNodeName == NULL){
|
||||
rootNodeNs = NULL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
doc = xmlNewDoc((xmlChar *)"1.0");
|
||||
if (doc == NULL){
|
||||
rootNodeName = NULL;
|
||||
rootNodeNs = NULL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
root = xmlNewDocNode(doc, NULL, rootNodeName, NULL);
|
||||
if (root == NULL) {
|
||||
rootNodeName = NULL;
|
||||
rootNodeNs = NULL;
|
||||
xmlFreeDoc(doc);
|
||||
return (-1);
|
||||
}
|
||||
xmlDocSetRootElement(doc, root);
|
||||
ns = xmlNewNs(root, rootNodeNs, NULL);
|
||||
if (ns == NULL) {
|
||||
rootNodeName = NULL;
|
||||
rootNodeNs = NULL;
|
||||
xmlFreeDoc(doc);
|
||||
return (-1);
|
||||
}
|
||||
xmlSetNs(root, ns);
|
||||
rootNodeName = NULL;
|
||||
rootNodeNs = NULL;
|
||||
xmlFreeDoc(doc);
|
||||
return(0);
|
||||
}
|
||||
/************************************************************************
|
||||
* *
|
||||
* Tests Descriptions *
|
||||
@ -5334,7 +5642,17 @@ testDesc testDescriptions[] = {
|
||||
automataTest, "./test/automata/*", "result/automata/", "", NULL,
|
||||
0 },
|
||||
#endif
|
||||
{NULL, NULL, NULL, NULL, NULL, NULL, 0}
|
||||
{ "XmlSec autogenerated file test" ,
|
||||
xmlSecParseFileTest, "./test/xmlsec/parseFile/*", "result/xmlsec/parseFile/", "", NULL,
|
||||
0 },
|
||||
{ "XmlSec autogenerated memory test" ,
|
||||
xmlSecParseMemoryTest, "./test/xmlsec/parseMemory/*", "result/xmlsec/parseMemory/", "", NULL,
|
||||
0 },
|
||||
{ "XmlSec autogenerated create tree test" ,
|
||||
xmlSecCreateTreeTest, NULL,NULL,NULL, NULL,
|
||||
0 },
|
||||
{NULL, NULL, NULL, NULL, NULL, NULL, 0}
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
81
test/xmlsec/parseFile/testfile1.xml
Normal file
81
test/xmlsec/parseFile/testfile1.xml
Normal file
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||
<SignedInfo>
|
||||
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
|
||||
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<Reference URI="#object">
|
||||
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<DigestValue>iDhYt78o294fA6pzQ7k44+eejrQMi+WX3l3UrUdtL1Q=</DigestValue>
|
||||
</Reference>
|
||||
</SignedInfo>
|
||||
<SignatureValue>xOSp1bweDaNd5+NzBNO+m+1oEOm1jNjBMXf12F7LsXoBDpvgC3efL2XgkoRY8LJ9
|
||||
msV4PSDkJRzzmvSTvQ6Txg==</SignatureValue>
|
||||
<KeyInfo>
|
||||
<X509Data>
|
||||
<X509Certificate>MIID9zCCA2CgAwIBAgIJAK+ii7kzrdqsMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
|
||||
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1MIFNlY3Vy
|
||||
aXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2VjKTEQMA4G
|
||||
A1UECxMHUm9vdCBDQTEWMBQGA1UEAxMNQWxla3NleSBTYW5pbjEhMB8GCSqGSIb3
|
||||
DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tMCAXDTE0MDUyMzE3NTA1OVoYDzIxMTQw
|
||||
NDI5MTc1MDU5WjCBrjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx
|
||||
PTA7BgNVBAoTNFhNTCBTZWN1cml0eSBMaWJyYXJ5IChodHRwOi8vd3d3LmFsZWtz
|
||||
ZXkuY29tL3htbHNlYykxEDAOBgNVBAsTB1Jvb3QgQ0ExFjAUBgNVBAMTDUFsZWtz
|
||||
Z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RTCCAUEwDAYDVR0TBAUwAwEB/zAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH
|
||||
ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFNf0xkZ3zjcEI60pVPuwDqTM
|
||||
QygZMIHjBgNVHSMEgdswgdiAFP7k7FMk8JWVxxC14US1XTllWuN+oYG0pIGxMIGu
|
||||
MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1M
|
||||
IFNlY3VyaXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2Vj
|
||||
KTEQMA4GA1UECxMHUm9vdCBDQTEWMBQGA1UEAxMNQWxla3NleSBTYW5pbjEhMB8G
|
||||
CSqGSIb3DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tggkAr6KLuTOt2q0wDQYJKoZI
|
||||
hvcNAQEFBQADQQAOXBj0yICp1RmHXqnUlsppryLCW3pKBD1dkb4HWarO7RjA1yJJ
|
||||
fBjXssrERn05kpBcrRfzou4r3DCgQFPhjxga</X509Certificate>
|
||||
</X509Data>
|
||||
</KeyInfo>
|
||||
<Object Id="object">some text</Object>
|
||||
</Signature>
|
21
test/xmlsec/parseFile/testfile2.xml
Normal file
21
test/xmlsec/parseFile/testfile2.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/><Reference URI="#e1ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>3K+K4MbR2EW7l/ry59XockKqt4g=</DigestValue></Reference><Reference URI="#e2ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>hnKFjGFr/jwLCCTckZpaclOwe28=</DigestValue></Reference><Reference URI="#e3ID"><Transforms><Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>RUUBiUeFf8uRqTlpCyutkXDqnJ4=</DigestValue></Reference></SignedInfo><SignatureValue>XzEJQ+whhHUYlqiCEt8XFxC8wpk=</SignatureValue><Object><ietf:c14n11XmlPointerDoc1 xmlns:ietf="http://www.ietf.org" xmlns:w3c="http://www.w3.org">
|
||||
<!-- This is a xml document for checking behaviour of tools with regards to comments when using scheme-based xpointers in the ds:Reference's URI attribute -->
|
||||
<ietf:e1 xml:id="e1ID">
|
||||
<!-- This is a comment for ietf:e1 element -->
|
||||
<ietf:e11>
|
||||
<!-- This is a comment for ietf:e11 element -->
|
||||
<ietf:e111/>
|
||||
</ietf:e11>
|
||||
<ietf:e12 at="2">
|
||||
<!-- This is a comment for ietf:e12 element -->
|
||||
<ietf:e121/>
|
||||
</ietf:e12>
|
||||
</ietf:e1>
|
||||
<ietf:e2 xml:id="e2ID">
|
||||
<!-- This is a comment for ietf:e2 element -->
|
||||
<ietf:e21/>
|
||||
</ietf:e2>
|
||||
<ietf:e3 xml:id="e3ID">
|
||||
<ietf:e31 at="3"/>
|
||||
</ietf:e3>
|
||||
</ietf:c14n11XmlPointerDoc1></Object></Signature>
|
63
test/xmlsec/parseFile/testfile3.xml
Normal file
63
test/xmlsec/parseFile/testfile3.xml
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PaymentInfo xmlns="http://example.org/paymentv2">
|
||||
<Name>John Smith</Name>
|
||||
<CreditCard Currency="USD" Limit="5,000">
|
||||
<EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
|
||||
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:RetrievalMethod Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" URI="#EK"/>
|
||||
<EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
|
||||
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:KeyName>my-rsa-key</ds:KeyName>
|
||||
<ds:X509Data>
|
||||
<ds:X509Certificate>
|
||||
MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
|
||||
CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
|
||||
U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
|
||||
IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
|
||||
MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
|
||||
CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
|
||||
MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
|
||||
BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
|
||||
Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
|
||||
xMG7z+hEB1LT2swTs10GILFWPByRl3/BEsnekLZdoqNoJrvnttVkxgu3x80Ji3/A
|
||||
ZD8Ub/kBGOSPyu6pn3OdnMTc5q4r1qUe985lQzCZvCMw6AoGeCyJodNu2MbveNeH
|
||||
+YPjRgLCQfzvOFRq+9qMtE8XfUJZdNhPZhgdsOGf8uJauTcIHbAyw7BhxPy6RikW
|
||||
W5yiWUmBya+7t4y1TQJzham/0y0zU3TAA7b/rDrU7xmNPwIDAQABoyQwIjAPBgNV
|
||||
HRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBgAwDQYJKoZIhvcNAQEEBQADggEB
|
||||
ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
|
||||
OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
|
||||
WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
|
||||
p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
|
||||
O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
|
||||
kKO/vB9Ay64Rt88XbLnnGns=
|
||||
</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
<CipherData>
|
||||
<CipherValue>
|
||||
Vc7VOXgJDlw/oQ0hOvIaBKsGiOwyvIArzkhd2W7mZBQyeFlkJlxZQdnPGGg4kJE9
|
||||
EGWeMWQZ0XavJy+xA9Z+PlIFqkpPHUXyos9jZZNniRxEtl6tLce2ReSVah+y8Lb3
|
||||
3xSNSm+O9k2B42yP3Osrj175KNMSMLLM2ZuA0iq28aP7v7DmtDY7VNp0n+O4nJUM
|
||||
Eyy4RO0jmtXctt3jUfpCmGkqy42/LG6F5h1kluyfszjHvi/9lD5LEkCl2Y/3az+j
|
||||
2vLuuXM45z6ef14Dlgsh7eJtqp3bRT0Tpp4JvBWMiuDZaV1zUcZq7q80lNMvXucb
|
||||
mSrSmlXn2lWPttfTrcjXrw==
|
||||
</CipherValue>
|
||||
</CipherData>
|
||||
<ReferenceList>
|
||||
<DataReference URI="#ED"/>
|
||||
</ReferenceList>
|
||||
</EncryptedKey>
|
||||
</ds:KeyInfo>
|
||||
<CipherData>
|
||||
<CipherValue>
|
||||
p5MMs6F765jIUqOj5rH1vAro0Rx4/PLIoEOXCOWaEGbEdCHh0m86zifozutcmoBA
|
||||
xy1SuxmJjtFDO32f/bpuDhdzFDgLrlVIcXrNeHGgken6NryC2n1NdGS9CiYsyaPF
|
||||
B5CWEkx3Prtbak6S20z3XZTJltOdoqzeNOn8/IDavLA=
|
||||
</CipherValue>
|
||||
</CipherData>
|
||||
</EncryptedData>
|
||||
</CreditCard>
|
||||
</PaymentInfo>
|
2
test/xmlsec/parseMemory/buffer1.txt
Normal file
2
test/xmlsec/parseMemory/buffer1.txt
Normal file
@ -0,0 +1,2 @@
|
||||
size= 205
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template></xsl:stylesheet>
|
24
test/xmlsec/parseMemory/buffer2.txt
Normal file
24
test/xmlsec/parseMemory/buffer2.txt
Normal file
@ -0,0 +1,24 @@
|
||||
size= 964
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
|
||||
<xsl:output encoding="UTF-8" indent="no" method="xml"/>
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>Notaries</title>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<xsl:for-each select="Notaries/Notary">
|
||||
<tr>
|
||||
<th>
|
||||
<xsl:value-of select="@name"/>
|
||||
</th>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
40
test/xmlsec/parseMemory/buffer3.txt
Normal file
40
test/xmlsec/parseMemory/buffer3.txt
Normal file
@ -0,0 +1,40 @@
|
||||
size= 745
|
||||
<xsl:stylesheet xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:strip-space elements="player name position team"/>
|
||||
<xsl:output encoding="iso-8859-1" indent="no" method="xml"/>
|
||||
|
||||
<xsl:template match="player">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="name"/>
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/name">
|
||||
<h1>
|
||||
<xsl:apply-templates/>
|
||||
</h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/position">
|
||||
<h2>
|
||||
<xsl:apply-templates/>
|
||||
</h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="player/team">
|
||||
<h3>
|
||||
<xsl:apply-templates/>
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
13
testapi.c
13
testapi.c
@ -8073,6 +8073,16 @@ test_xmlCharEncInFunc(void) {
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlCharEncNewCustomHandler(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlCharEncOutFunc(void) {
|
||||
int test_ret = 0;
|
||||
@ -8544,11 +8554,12 @@ static int
|
||||
test_encoding(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
if (quiet == 0) printf("Testing encoding : 16 of 22 functions ...\n");
|
||||
if (quiet == 0) printf("Testing encoding : 16 of 23 functions ...\n");
|
||||
test_ret += test_xmlAddEncodingAlias();
|
||||
test_ret += test_xmlCharEncCloseFunc();
|
||||
test_ret += test_xmlCharEncFirstLine();
|
||||
test_ret += test_xmlCharEncInFunc();
|
||||
test_ret += test_xmlCharEncNewCustomHandler();
|
||||
test_ret += test_xmlCharEncOutFunc();
|
||||
test_ret += test_xmlCleanupCharEncodingHandlers();
|
||||
test_ret += test_xmlCleanupEncodingAliases();
|
||||
|
20
testparser.c
20
testparser.c
@ -987,26 +987,22 @@ rot13ConvCtxtDtor(void *vctxt) {
|
||||
}
|
||||
|
||||
static int
|
||||
rot13ConvImpl(void *vctxt ATTRIBUTE_UNUSED, const char *name,
|
||||
xmlCharEncConverter *conv) {
|
||||
rot13ConvImpl(void *vctxt ATTRIBUTE_UNUSED, const char *name, int output,
|
||||
xmlCharEncodingHandler **out) {
|
||||
int *inputCtxt;
|
||||
|
||||
if (strcmp(name, "rot13") != 0) {
|
||||
fprintf(stderr, "rot13ConvImpl received wrong name\n");
|
||||
charEncConvImplError = 1;
|
||||
if (strcmp(name, "rot13") != 0)
|
||||
return xmlCreateCharEncodingHandler(name, output, NULL, NULL, out);
|
||||
|
||||
if (output)
|
||||
return XML_ERR_UNSUPPORTED_ENCODING;
|
||||
}
|
||||
|
||||
conv->input = rot13Convert;
|
||||
conv->output = rot13Convert;
|
||||
conv->ctxtDtor = rot13ConvCtxtDtor;
|
||||
|
||||
inputCtxt = xmlMalloc(sizeof(*inputCtxt));
|
||||
*inputCtxt = 13;
|
||||
conv->inputCtxt = inputCtxt;
|
||||
|
||||
return XML_ERR_OK;
|
||||
return xmlCharEncNewCustomHandler(name, rot13Convert, rot13Convert,
|
||||
rot13ConvCtxtDtor, inputCtxt, NULL,
|
||||
out);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -7715,6 +7715,7 @@ xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
|
||||
xmlNodePtr child = NULL;
|
||||
xmlAttrPtr attr;
|
||||
int hasRefs = 0;
|
||||
int res;
|
||||
|
||||
if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
|
||||
return (NULL);
|
||||
@ -7769,12 +7770,13 @@ xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
|
||||
/*
|
||||
* Parse contained attribute decls/refs.
|
||||
*/
|
||||
if (xmlSchemaParseLocalAttributes(pctxt, schema, &child,
|
||||
res = xmlSchemaParseLocalAttributes(pctxt, schema, &child,
|
||||
(xmlSchemaItemListPtr *) &(ret->attrUses),
|
||||
XML_SCHEMA_TYPE_ATTRIBUTEGROUP, &hasRefs) == -1)
|
||||
return(NULL);
|
||||
XML_SCHEMA_TYPE_ATTRIBUTEGROUP, &hasRefs);
|
||||
if (hasRefs)
|
||||
ret->flags |= XML_SCHEMAS_ATTRGROUP_HAS_REFS;
|
||||
if (res == -1)
|
||||
return(NULL);
|
||||
/*
|
||||
* Parse the attribute wildcard.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user