From 050701d319bffb4eaef9a4f928aa2fd62c049a10 Mon Sep 17 00:00:00 2001 From: Nayana Thorat Date: Wed, 18 Dec 2019 22:45:35 +0530 Subject: [PATCH 01/17] Add s390x support for travis (#282) * As Travis CI officially supports s390x builds, adding support for same. --- .travis.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 100abe9e0..5d225e1fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,16 @@ language: c sudo: required -dist: trusty install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi # install build tools -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install automake autoconf libtool; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then + if [ "$TRAVIS_ARCH" = "s390x" ]; then + sudo apt-get install automake autoconf libtool libtool-bin libltdl-dev libltdl7; + else + sudo apt-get install automake autoconf libtool; + fi; + fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install libtool pkg-config; fi # install libxml2/libxslt libraries - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libxml2 libxml2-dev libxslt1.1 libxslt1-dev; fi @@ -16,15 +21,32 @@ install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libnspr4 libnspr4-dev libnss3 libnss3-dev libnss3-tools; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install nss; fi # install gcrypt libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libgcrypt11 libgcrypt11-dev; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then + if [ "$TRAVIS_ARCH" = "s390x" ]; then + sudo apt-get install libgcrypt20 libgcrypt20-dev; + else + sudo apt-get install libgcrypt11 libgcrypt11-dev; + fi; + fi # install gnutls libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libgnutls28 libgnutls-dev; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then + if [ "$TRAVIS_ARCH" = "s390x" ]; then + sudo apt-get install libgnutls-dev; + else + sudo apt-get install libgnutls28 libgnutls-dev; + fi; + fi script: - . scripts/travis-env.sh && mkdir build && cd build && ../autogen.sh --enable-werror && make && make check matrix: include: - - name: "linux" + - name: "linux-x86_64" os: linux + dist: trusty - name: "osx" os: osx osx_image: xcode9.3 + - name: "linux-s390x" + os: linux + arch: s390x + dist: xenial From e78f01e869c346594e0378d1072b7d1d28653637 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Mon, 2 Mar 2020 09:41:10 -0800 Subject: [PATCH 02/17] Added link to Perl-LibXML-Sec module --- docs/download.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/download.html b/docs/download.html index 9d4effe10..72fa70310 100644 --- a/docs/download.html +++ b/docs/download.html @@ -461,6 +461,10 @@

Installation (source archive)

GIT

XML Security Library is available from the GitHub.

+

Other languages

+

From 12d6da6e1e979a3378cdf9647e698f8a0f396582 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Mon, 2 Mar 2020 09:42:54 -0800 Subject: [PATCH 03/17] Added Python xmlsec module --- docs/download.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/download.html b/docs/download.html index 72fa70310..83fee364e 100644 --- a/docs/download.html +++ b/docs/download.html @@ -463,6 +463,7 @@

GIT

Other languages

From 3786af10953630cd2bb2b57ce31c575f025048a8 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Tue, 31 Mar 2020 09:15:04 -0700 Subject: [PATCH 04/17] enable XML_PARSE_HUGE for all xml parsers (issue #283) (#284) --- include/xmlsec/parser.h | 2 +- src/parser.c | 54 ++++++++++++++++++++++------------------- src/xmlenc.c | 8 +++--- src/xmltree.c | 20 ++++++++------- src/xslt.c | 7 ++---- 5 files changed, 46 insertions(+), 45 deletions(-) diff --git a/include/xmlsec/parser.h b/include/xmlsec/parser.h index 743a58045..41e2dcecb 100644 --- a/include/xmlsec/parser.h +++ b/include/xmlsec/parser.h @@ -30,7 +30,7 @@ XMLSEC_EXPORT xmlDocPtr xmlSecParseMemoryExt (const xmlSecByte *prefi xmlSecSize bufferSize, const xmlSecByte *postfix, xmlSecSize postfixSize); - +XMLSEC_EXPORT void xmlSecParsePrepareCtxt (xmlParserCtxtPtr ctxt); /** * xmlSecTransformXmlParserId: diff --git a/src/parser.c b/src/parser.c index ddeb590c0..973727a02 100644 --- a/src/parser.c +++ b/src/parser.c @@ -143,7 +143,7 @@ xmlSecParserFinalize(xmlSecTransformPtr transform) { static int xmlSecParserPushBin(xmlSecTransformPtr transform, const xmlSecByte* data, - xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) { + xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) { xmlSecParserCtxPtr ctx; int ret; @@ -162,11 +162,7 @@ xmlSecParserPushBin(xmlSecTransformPtr transform, const xmlSecByte* data, xmlSecXmlError("xmlCreatePushParserCtxt", xmlSecTransformGetName(transform)); return(-1); } - - /* required for c14n! */ - ctx->parserCtx->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctx->parserCtx->replaceEntities = 1; - ctx->parserCtx->options = XML_PARSE_NONET; + xmlSecParsePrepareCtxt(ctx->parserCtx); transform->status = xmlSecTransformStatusWorking; } else if(transform->status == xmlSecTransformStatusFinished) { @@ -283,6 +279,7 @@ xmlSecParserPopXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr* nodes, xmlFreeParserInputBuffer(buf); return(-1); } + xmlSecParsePrepareCtxt(ctxt); input = xmlNewIOInputStream(ctxt, buf, XML_CHAR_ENCODING_NONE); if(input == NULL) { @@ -306,10 +303,6 @@ xmlSecParserPopXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr* nodes, return(-1); } - /* required for c14n! */ - ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctxt->replaceEntities = 1; - /* finaly do the parsing */ ret = xmlParseDocument(ctxt); if(ret < 0) { @@ -380,9 +373,7 @@ xmlSecParseFile(const char *filename) { "filename=%s", xmlSecErrorsSafeString(filename)); return(NULL); } - - /* enable parsing of XML documents with large text nodes */ - /* crashes on x64 xmlCtxtUseOptions (ctxt, XML_PARSE_HUGE); */ + xmlSecParsePrepareCtxt(ctxt); /* todo: set directories from current doc? */ if ((ctxt->directory == NULL) && (directory == NULL)) { @@ -403,10 +394,6 @@ xmlSecParseFile(const char *filename) { } } - /* required for c14n! */ - ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctxt->replaceEntities = 1; - ret = xmlParseDocument(ctxt); if(ret < 0) { xmlSecXmlParserError2("xmlParseDocument", ctxt, NULL, @@ -465,10 +452,7 @@ xmlSecParseMemoryExt(const xmlSecByte *prefix, xmlSecSize prefixSize, xmlSecXmlError("xmlCreatePushParserCtxt", NULL); goto done; } - - /* required for c14n! */ - ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctxt->replaceEntities = 1; + xmlSecParsePrepareCtxt(ctxt); /* prefix */ if((prefix != NULL) && (prefixSize > 0)) { @@ -548,10 +532,7 @@ xmlSecParseMemory(const xmlSecByte *buffer, xmlSecSize size, int recovery) { xmlSecXmlError("xmlCreateMemoryParserCtxt", NULL); return(NULL); } - - /* required for c14n! */ - ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctxt->replaceEntities = 1; + xmlSecParsePrepareCtxt(ctxt); ret = xmlParseDocument(ctxt); if(ret < 0) { @@ -581,3 +562,26 @@ xmlSecParseMemory(const xmlSecByte *buffer, xmlSecSize size, int recovery) { return(res); } +/** + * xmlSecParsePrepareCtxt: + * @ctxt: the parser context + * + * Prepares parser context for parsing XML for XMLSec. + */ +void +xmlSecParsePrepareCtxt(xmlParserCtxtPtr ctxt) { + xmlSecAssert(ctxt != NULL); + + /* required for c14n! */ + ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + ctxt->replaceEntities = 1; + + /* + * Also see xmlSecReplaceNodeBufferAndReturn: + * + * XML_PARSE_NONET to support c14n + * XML_PARSE_NODICT to avoid problems with moving nodes around + * XML_PARSE_HUGE to enable parsing of XML documents with large text nodes + */ + xmlCtxtUseOptions(ctxt, XML_PARSE_NONET | XML_PARSE_NODICT | XML_PARSE_HUGE); +} diff --git a/src/xmlenc.c b/src/xmlenc.c index 825ed4c44..dcee06c3e 100644 --- a/src/xmlenc.c +++ b/src/xmlenc.c @@ -399,7 +399,7 @@ xmlSecEncCtxXmlEncrypt(xmlSecEncCtxPtr encCtx, xmlNodePtr tmpl, xmlNodePtr node) /* now we need to update our original document */ if((encCtx->type != NULL) && xmlStrEqual(encCtx->type, xmlSecTypeEncElement)) { - /* check if we need to return the replaced node */ + /* check if we need to return the replaced node */ if((encCtx->flags & XMLSEC_ENC_RETURN_REPLACED_NODE) != 0) { ret = xmlSecReplaceNodeAndReturn(node, tmpl, &(encCtx->replacedNodeList)); if(ret < 0) { @@ -415,10 +415,9 @@ xmlSecEncCtxXmlEncrypt(xmlSecEncCtxPtr encCtx, xmlNodePtr tmpl, xmlNodePtr node) return(-1); } } - - encCtx->resultReplaced = 1; + encCtx->resultReplaced = 1; } else if((encCtx->type != NULL) && xmlStrEqual(encCtx->type, xmlSecTypeEncContent)) { - /* check if we need to return the replaced node */ + /* check if we need to return the replaced node */ if((encCtx->flags & XMLSEC_ENC_RETURN_REPLACED_NODE) != 0) { ret = xmlSecReplaceContentAndReturn(node, tmpl, &(encCtx->replacedNodeList)); if(ret < 0) { @@ -434,7 +433,6 @@ xmlSecEncCtxXmlEncrypt(xmlSecEncCtxPtr encCtx, xmlNodePtr tmpl, xmlNodePtr node) return(-1); } } - encCtx->resultReplaced = 1; } else { /* we should've caught this error before */ diff --git a/src/xmltree.c b/src/xmltree.c index df99931d0..9e35fa1c2 100644 --- a/src/xmltree.c +++ b/src/xmltree.c @@ -562,9 +562,6 @@ xmlSecReplaceContentAndReturn(xmlNodePtr node, xmlNodePtr newNode, xmlNodePtr *r xmlSecAssert2(node != NULL, -1); xmlSecAssert2(newNode != NULL, -1); - xmlUnlinkNode(newNode); - xmlSetTreeDoc(newNode, node->doc); - /* return the old nodes if requested */ if(replaced != NULL) { xmlNodePtr cur, next, tail; @@ -573,7 +570,7 @@ xmlSecReplaceContentAndReturn(xmlNodePtr node, xmlNodePtr newNode, xmlNodePtr *r for(cur = node->children; (cur != NULL); cur = next) { next = cur->next; if((*replaced) != NULL) { - /* n is unlinked in this function */ + /* cur is unlinked in this function */ xmlAddNextSibling(tail, cur); tail = cur; } else { @@ -587,8 +584,9 @@ xmlSecReplaceContentAndReturn(xmlNodePtr node, xmlNodePtr newNode, xmlNodePtr *r xmlNodeSetContent(node, NULL); } - xmlAddChild(node, newNode); - xmlSetTreeDoc(newNode, node->doc); + /* swap nodes */ + xmlUnlinkNode(newNode); + xmlAddChildList(node, newNode); return(0); } @@ -628,8 +626,13 @@ xmlSecReplaceNodeBufferAndReturn(xmlNodePtr node, const xmlSecByte *buffer, xmlS xmlSecAssert2(node != NULL, -1); xmlSecAssert2(node->parent != NULL, -1); - /* parse buffer in the context of node's parent */ - ret = xmlParseInNodeContext(node->parent, (const char*)buffer, size, XML_PARSE_NODICT, &results); + /* parse buffer in the context of node's parent (also see xmlSecParsePrepareCtxt): + * XML_PARSE_NONET to support c14n + * XML_PARSE_NODICT to avoid problems with moving nodes around + * XML_PARSE_HUGE to enable parsing of XML documents with large text nodes + */ + ret = xmlParseInNodeContext(node->parent, (const char*)buffer, size, + XML_PARSE_NONET | XML_PARSE_NODICT | XML_PARSE_HUGE, &results); if(ret != XML_ERR_OK) { xmlSecXmlError("xmlParseInNodeContext", NULL); return(-1); @@ -868,7 +871,6 @@ xmlSecPrintXmlString(FILE * fd, const xmlChar * str) { return(res); } - /** * xmlSecGetQName: * @node: the context node. diff --git a/src/xslt.c b/src/xslt.c index cc596e81b..ba0ff79ca 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -284,7 +284,7 @@ xmlSecXsltReadNode(xmlSecTransformPtr transform, xmlNodePtr node, xmlSecTransfor static int xmlSecXsltPushBin(xmlSecTransformPtr transform, const xmlSecByte* data, - xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) { + xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) { xmlSecXsltCtxPtr ctx; int ret; @@ -305,10 +305,7 @@ xmlSecXsltPushBin(xmlSecTransformPtr transform, const xmlSecByte* data, xmlSecXmlError("xmlCreatePushParserCtxt", xmlSecTransformGetName(transform)); return(-1); } - - /* required for c14n! */ - ctx->parserCtx->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - ctx->parserCtx->replaceEntities = 1; + xmlSecParsePrepareCtxt(ctx->parserCtx); transform->status = xmlSecTransformStatusWorking; } else if(transform->status == xmlSecTransformStatusFinished) { From 74ed643819a668984e6c2b0200a83cb6c1ddc0ec Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Fri, 10 Apr 2020 16:06:21 -0700 Subject: [PATCH 05/17] update docs --- docs/api/xmlsec-index.html | 1 + docs/api/xmlsec-parser.html | 30 ++++++++++++++++++++++++++++++ docs/api/xmlsec.devhelp2 | 1 + 3 files changed, 32 insertions(+) diff --git a/docs/api/xmlsec-index.html b/docs/api/xmlsec-index.html index 6eb125bcd..400621309 100644 --- a/docs/api/xmlsec-index.html +++ b/docs/api/xmlsec-index.html @@ -1352,6 +1352,7 @@
  • xmlSecParseFile

  • xmlSecParseMemoryExt

  • xmlSecParseMemory

  • +
  • xmlSecParsePrepareCtxt

  • xmlSecPrintXmlString

  • xmlSecPtrDebugDumpItemMethod

  • xmlSecPtrDestroyItemMethod

  • diff --git a/docs/api/xmlsec-parser.html b/docs/api/xmlsec-parser.html index 1f094838c..0f17c7810 100644 --- a/docs/api/xmlsec-parser.html +++ b/docs/api/xmlsec-parser.html @@ -69,6 +69,14 @@

    parser +void + + +xmlSecParsePrepareCtxt () + + + + xmlSecTransformId @@ -228,6 +236,28 @@

    parser
    +

    xmlSecParsePrepareCtxt ()

    +
    void
    +xmlSecParsePrepareCtxt (xmlParserCtxtPtr ctxt);
    +

    Prepares parser context for parsing XML for XMLSec.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    ctxt

    the parser context

     
    +
    +
    +
    +

    xmlSecTransformXmlParserGetKlass ()

    xmlSecTransformId
     xmlSecTransformXmlParserGetKlass (void);
    diff --git a/docs/api/xmlsec.devhelp2 b/docs/api/xmlsec.devhelp2 index cfffbeb66..7c3a47c0e 100644 --- a/docs/api/xmlsec.devhelp2 +++ b/docs/api/xmlsec.devhelp2 @@ -681,6 +681,7 @@ + From dd0849718a352a32bbe563c5429ed10c2d797f15 Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Wed, 15 Apr 2020 10:37:33 -0700 Subject: [PATCH 06/17] fix issue with make clean in docs --- docs/Makefile.am | 10 +++++----- docs/api/Makefile.am | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index a89ba76c3..4b196026e 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -27,9 +27,9 @@ docs-copy: if [ z"$(srcdir)" != z"$(builddir)" -a z"`uname`" != z"Darwin" ]; \ then \ $(CP) -ru $(srcdir)/*.html $(srcdir)/*.ico $(srcdir)/images $(builddir)/ ; \ - chmod u+w $(builddir)/*.html ; \ - chmod u+w $(builddir)/*.ico ; \ - chmod -R u+w $(builddir)/images ; \ + (chmod u+w $(builddir)/*.html || true) ; \ + (chmod u+w $(builddir)/*.ico || true) ; \ + (chmod -R u+w $(builddir)/images || true) ; \ fi \ ) @@ -94,8 +94,8 @@ endif clean-local: -rm -f *.stamp ( if [ z"$(srcdir)" != z"$(builddir)" ] ; then \ - chmod -R u+w $(builddir)/images && rm -rf $(builddir)/images ; \ - chmod -R u+w $(builddir)/src && rm -rf $(builddir)/src ; \ + (chmod -R u+w $(builddir)/images || true) && rm -rf $(builddir)/images ; \ + (chmod -R u+w $(builddir)/src || true) && rm -rf $(builddir)/src ; \ (for i in `find $(builddir) -name "*.html" -print` ; do \ echo "Removing files '$$i' ... " ; \ chmod -R u+w $$i && rm -f $$i ; \ diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am index a1ffd3a73..dcf093d12 100644 --- a/docs/api/Makefile.am +++ b/docs/api/Makefile.am @@ -268,9 +268,9 @@ clean-local: -rm -rf $(SOURCE_CODE_DIR) $(EXAMPLES_DIR) $(SCAN_DIR)/*.txt $(SGML_DIR) $(GTKDOC_MKDB_OUTPUT_DIR) -rm -f *.stamp *.types index.sgml @( if [ z"$(builddir)" != z"$(srcdir)" ] ; then \ - chmod -R u+w $(builddir)/src && rm -rf $(builddir)/src ; \ - chmod -R u+w $(builddir)/images && rm -rf $(builddir)/images ; \ - chmod -R u+w $(builddir)/*.png && rm -rf $(builddir)/*.png ; \ + (chmod -R u+w $(builddir)/src || true) && rm -rf $(builddir)/src ; \ + (chmod -R u+w $(builddir)/images || true) && rm -rf $(builddir)/images ; \ + (chmod -R u+w $(builddir)/*.png || true) && rm -rf $(builddir)/*.png ; \ fi ; ) distclean-local: clean-local From cd6fe1c19bd40e0e3bd63af61c34d595371e2bc9 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Mon, 20 Apr 2020 11:19:26 -0700 Subject: [PATCH 07/17] prepare for 1.2.30 release (#285) --- .travis.yml | 2 +- appveyor.yml | 2 +- configure.ac | 4 ++-- docs/api/xmlsec-version.html | 6 +++--- docs/download.html | 4 ++-- docs/index.html | 10 +++++++++- docs/news.html | 10 +++++++++- man/xmlsec1-config.1 | 2 +- man/xmlsec1.1 | 2 +- 9 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d225e1fb..f3da56057 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ install: sudo apt-get install automake autoconf libtool; fi; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install libtool pkg-config; fi +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install libtool; fi # install libxml2/libxslt libraries - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libxml2 libxml2-dev libxslt1.1 libxslt1-dev; fi # install openssl libraries diff --git a/appveyor.yml b/appveyor.yml index 4d956a1ae..00d15e2cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ # You can check the whole build process in the logs, and any later commit will start # a new build using a fresh virtual machine. -version: '1.2.29-{build}' +version: '1.2.30-{build}' shallow_clone: true skip_branch_with_pr: true diff --git a/configure.ac b/configure.ac index e2f6393d3..2af551e47 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([xmlsec1],[1.2.29],[http://www.aleksey.com/xmlsec]) +AC_INIT([xmlsec1],[1.2.30],[http://www.aleksey.com/xmlsec]) XMLSEC_PACKAGE=xmlsec1 XMLSEC_VERSION_MAJOR=1 XMLSEC_VERSION_MINOR=2 -XMLSEC_VERSION_SUBMINOR=29 +XMLSEC_VERSION_SUBMINOR=30 XMLSEC_VERSION="$XMLSEC_VERSION_MAJOR.$XMLSEC_VERSION_MINOR.$XMLSEC_VERSION_SUBMINOR" XMLSEC_VERSION_INFO=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` XMLSEC_VERSION_SAFE=`echo $XMLSEC_VERSION | sed 's/\./_/g'` diff --git a/docs/api/xmlsec-version.html b/docs/api/xmlsec-version.html index d669ce78a..915f5f44e 100644 --- a/docs/api/xmlsec-version.html +++ b/docs/api/xmlsec-version.html @@ -78,7 +78,7 @@

    version

    Types and Values

    XMLSEC_VERSION

    -
    #define XMLSEC_VERSION			"1.2.29"
    +
    #define XMLSEC_VERSION			"1.2.30"
     

    The library version string in the format "$major_number.$minor_number.$sub_minor_number".

    @@ -100,14 +100,14 @@

    version

    XMLSEC_VERSION_SUBMINOR

    -
    #define XMLSEC_VERSION_SUBMINOR		29
    +
    #define XMLSEC_VERSION_SUBMINOR		30
     

    The library sub-minor version number.


    XMLSEC_VERSION_INFO

    -
    #define XMLSEC_VERSION_INFO		"3:29:2"
    +
    #define XMLSEC_VERSION_INFO		"3:30:2"
     

    The library version info string in the format "$major_number+$minor_number:$sub_minor_number:$minor_number".

    diff --git a/docs/download.html b/docs/download.html index 83fee364e..4c3e2263d 100644 --- a/docs/download.html +++ b/docs/download.html @@ -420,10 +420,10 @@

    Download

    Stable releases.

    -

    The latest stable XML Security Library version is 1.2.29:

    +

    The latest stable XML Security Library version is 1.2.30:

    • -Sources for latest version.
    • +Sources for latest version.
    • Windows binaries for XMLSec Library (as well as LibXML2, LibXSLT and OpenSSL) from Igor Zlatkovic.
    • diff --git a/docs/index.html b/docs/index.html index 2e8ec715c..150b5320d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -439,7 +439,15 @@

      XML Security Library

      see the Copyright file in the distribution for details.

      News

        -
      • October 15 2019
        +
      • April 21 2020
        + The XML Security Library 1.2.30 release includes the following changes: +
          +
        • Enabled XML_PARSE_HUGE for all xml parsers.
        • +
        • Added s390x support for travis (nayana-ibm).
        • +
        • Several other small fixes (more details).
        • +
        +
      • +
      • October 15 2019
        The XML Security Library 1.2.29 release includes the following changes:
        • Various build and tests fixes and improvements.
        • diff --git a/docs/news.html b/docs/news.html index 05c80c8e0..e55ac8906 100644 --- a/docs/news.html +++ b/docs/news.html @@ -420,7 +420,15 @@

          XML Security Library News

      -
    • October 15 2019
      +
    • April 21 2020
      + The XML Security Library 1.2.30 release includes the following changes: +
        +
      • Enabled XML_PARSE_HUGE for all xml parsers.
      • +
      • Added s390x support for travis (nayana-ibm).
      • +
      • Several other small fixes (more details).
      • +
      +
    • +
    • October 15 2019
      The XML Security Library 1.2.29 release includes the following changes:
      • Various build and tests fixes and improvements.
      • diff --git a/man/xmlsec1-config.1 b/man/xmlsec1-config.1 index b9d255b9e..e52897b64 100644 --- a/man/xmlsec1-config.1 +++ b/man/xmlsec1-config.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. -.TH XMLSEC1-CONFIG "1" "October 2019" "xmlsec1-config 1.2.29" "User Commands" +.TH XMLSEC1-CONFIG "1" "April 2020" "xmlsec1-config 1.2.30" "User Commands" .SH NAME xmlsec1-config \- detail installed version of xmlsec library .SH SYNOPSIS diff --git a/man/xmlsec1.1 b/man/xmlsec1.1 index e4f3f8339..3587deabc 100644 --- a/man/xmlsec1.1 +++ b/man/xmlsec1.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. -.TH XMLSEC1 "1" "October 2019" "xmlsec1 1.2.29 (openssl)" "User Commands" +.TH XMLSEC1 "1" "April 2020" "xmlsec1 1.2.30 (openssl)" "User Commands" .SH NAME xmlsec1 \- sign, verify, encrypt and decrypt XML documents .SH SYNOPSIS From e040111b47c2443b3b96996b711efee756c65d4c Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Thu, 14 May 2020 08:46:04 -0700 Subject: [PATCH 08/17] fix typo in configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2af551e47..6dd4a8f8b 100644 --- a/configure.ac +++ b/configure.ac @@ -315,7 +315,7 @@ if test "z$LIBXML_FOUND" = "zno" -a "z$with_libxml" != "z" -a "z$with_libxml" != AC_MSG_RESULT([yes]) elif test [ -f "$with_libxml/include/libxml2/$LIBXML_INCLUDE_MARKER" ] -a [ -f "$with_libxml/lib/$LIBXML_SHARED_LIB_MARKER" -o -f "$with_libxml/lib/$LIBXML_STATIC_LIB_MARKER" ] ; then LIBXML_INCLUDE_PATH="$with_libxml/include/libxml2" - LIBXSLT_LIB_PATH="$with_libxml/lib" + LIBXML_LIB_PATH="$with_libxml/lib" LIBXML_FOUND="yes" AC_MSG_RESULT([yes]) else From 3e24ac3dfff5fe08e4d7510f8b474354fac42646 Mon Sep 17 00:00:00 2001 From: angelCzar <66357545+angelCzar@users.noreply.github.com> Date: Thu, 4 Jun 2020 16:54:14 +0200 Subject: [PATCH 09/17] FEAT: Make userData available when executing preExecCallback function (#290) --- src/xmldsig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xmldsig.c b/src/xmldsig.c index 619e725a5..a5f5626d5 100644 --- a/src/xmldsig.c +++ b/src/xmldsig.c @@ -1215,6 +1215,7 @@ xmlSecDSigReferenceCtxInitialize(xmlSecDSigReferenceCtxPtr dsigRefCtx, xmlSecDSi } dsigRefCtx->transformCtx.preExecCallback = dsigCtx->referencePreExecuteCallback; dsigRefCtx->transformCtx.enabledUris = dsigCtx->enabledReferenceUris; + dsigRefCtx->transformCtx.userData = dsigCtx->userData; if((dsigCtx->flags & XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK) != 0) { dsigRefCtx->transformCtx.flags |= XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK; From 3ecf7d2ad4fd8017cd803b98962872799def621a Mon Sep 17 00:00:00 2001 From: SvenPStarFinanz Date: Wed, 17 Jun 2020 19:16:22 +0200 Subject: [PATCH 10/17] Allow compilation on UWP (#293) --- src/dl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dl.c b/src/dl.c index b13f9d461..e2424bd40 100644 --- a/src/dl.c +++ b/src/dl.c @@ -148,7 +148,18 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) { #endif /* XMLSEC_DL_LIBLTDL */ #ifdef XMLSEC_DL_WIN32 - lib->handle = LoadLibraryA((char*)lib->filename); +#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP + lib->handle = LoadLibraryA((char*)lib->filename); +#else + LPTSTR wcLibFilename = xmlSecWin32ConvertUtf8ToTstr((char*)lib->filename); + if(wcLibFilename == NULL) { + xmlSecIOError("xmlSecWin32ConvertUtf8ToTstr", lib->filename, NULL); + xmlSecCryptoDLLibraryDestroy(lib); + return(NULL); + } + lib->handle = LoadPackagedLibrary(wcLibFilename, 0); + xmlFree(wcLibFilename); +#endif if(lib->handle == NULL) { xmlSecIOError("LoadLibraryA", lib->filename, NULL); xmlSecCryptoDLLibraryDestroy(lib); From 2d3998090f8882c3aea41ed77050961813ba3beb Mon Sep 17 00:00:00 2001 From: lsh123 Date: Wed, 17 Jun 2020 10:21:07 -0700 Subject: [PATCH 11/17] Fix WINAPI_FAMILY_DESKTOP_APP condition --- src/dl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dl.c b/src/dl.c index e2424bd40..b0cec9931 100644 --- a/src/dl.c +++ b/src/dl.c @@ -148,8 +148,8 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) { #endif /* XMLSEC_DL_LIBLTDL */ #ifdef XMLSEC_DL_WIN32 -#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP - lib->handle = LoadLibraryA((char*)lib->filename); +#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + lib->handle = LoadLibraryA((char*)lib->filename); #else LPTSTR wcLibFilename = xmlSecWin32ConvertUtf8ToTstr((char*)lib->filename); if(wcLibFilename == NULL) { From e397ed53396701436b9f778badfe66e19b985475 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Wed, 17 Jun 2020 14:12:30 -0700 Subject: [PATCH 12/17] Remove unnecessary cast --- src/dl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dl.c b/src/dl.c index b0cec9931..0489ea426 100644 --- a/src/dl.c +++ b/src/dl.c @@ -151,7 +151,7 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) { #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) lib->handle = LoadLibraryA((char*)lib->filename); #else - LPTSTR wcLibFilename = xmlSecWin32ConvertUtf8ToTstr((char*)lib->filename); + LPTSTR wcLibFilename = xmlSecWin32ConvertUtf8ToTstr(lib->filename); if(wcLibFilename == NULL) { xmlSecIOError("xmlSecWin32ConvertUtf8ToTstr", lib->filename, NULL); xmlSecCryptoDLLibraryDestroy(lib); From fc2567125812501e5001830132fc0ae49d677cf4 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Wed, 17 Jun 2020 14:23:39 -0700 Subject: [PATCH 13/17] Fix win string type --- src/dl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dl.c b/src/dl.c index 0489ea426..e934fe4e6 100644 --- a/src/dl.c +++ b/src/dl.c @@ -151,7 +151,7 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) { #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) lib->handle = LoadLibraryA((char*)lib->filename); #else - LPTSTR wcLibFilename = xmlSecWin32ConvertUtf8ToTstr(lib->filename); + LPWSTR wcLibFilename = xmlSecWin32ConvertUtf8ToUnicode(lib->filename); if(wcLibFilename == NULL) { xmlSecIOError("xmlSecWin32ConvertUtf8ToTstr", lib->filename, NULL); xmlSecCryptoDLLibraryDestroy(lib); From 51dc3abd575d7ea7ed5ab33188d735520d558f94 Mon Sep 17 00:00:00 2001 From: SvenPStarFinanz Date: Thu, 18 Jun 2020 18:07:25 +0200 Subject: [PATCH 14/17] Unload error strings in OpenSSL shutdown. (#292) --- src/openssl/crypto.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/openssl/crypto.c b/src/openssl/crypto.c index 5be249fad..8762c1669 100644 --- a/src/openssl/crypto.c +++ b/src/openssl/crypto.c @@ -34,6 +34,7 @@ #include static int xmlSecOpenSSLErrorsInit (void); +static void xmlSecOpenSSLErrorsShutdown (void); static xmlSecCryptoDLFunctionsPtr gXmlSecOpenSSLFunctions = NULL; static xmlChar* gXmlSecOpenSSLTrustedCertsFolder = NULL; @@ -357,6 +358,7 @@ xmlSecOpenSSLInit (void) { int xmlSecOpenSSLShutdown(void) { xmlSecOpenSSLSetDefaultTrustedCertsFolder(NULL); + xmlSecOpenSSLErrorsShutdown(); return(0); } @@ -452,18 +454,21 @@ xmlSecOpenSSLErrorsDefaultCallback(const char* file, int line, const char* func, reason, msg); } +#ifndef OPENSSL_IS_BORINGSSL +static ERR_STRING_DATA xmlSecOpenSSLStrReasons[XMLSEC_ERRORS_MAX_NUMBER + 1]; +static ERR_STRING_DATA xmlSecOpenSSLStrLib[] = { + { ERR_PACK(XMLSEC_OPENSSL_ERRORS_LIB,0,0), "xmlsec routines"}, + { 0, NULL} +}; +static ERR_STRING_DATA xmlSecOpenSSLStrDefReason[]= { + { XMLSEC_OPENSSL_ERRORS_LIB, "xmlsec lib"}, + { 0, NULL} +}; +#endif /* OPENSSL_IS_BORINGSSL */ + static int xmlSecOpenSSLErrorsInit(void) { #ifndef OPENSSL_IS_BORINGSSL - static ERR_STRING_DATA xmlSecOpenSSLStrReasons[XMLSEC_ERRORS_MAX_NUMBER + 1]; - static ERR_STRING_DATA xmlSecOpenSSLStrLib[]= { - { ERR_PACK(XMLSEC_OPENSSL_ERRORS_LIB,0,0), "xmlsec routines"}, - { 0, NULL} - }; - static ERR_STRING_DATA xmlSecOpenSSLStrDefReason[]= { - { XMLSEC_OPENSSL_ERRORS_LIB, "xmlsec lib"}, - { 0, NULL} - }; xmlSecSize pos; /* initialize reasons array */ @@ -473,7 +478,7 @@ xmlSecOpenSSLErrorsInit(void) { xmlSecOpenSSLStrReasons[pos].string = xmlSecErrorsGetMsg(pos); } - /* finally load xmlsec strings in OpenSSL */ + /* load xmlsec strings in OpenSSL */ ERR_load_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrLib); /* define xmlsec lib name */ ERR_load_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrDefReason); /* define default reason */ ERR_load_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrReasons); @@ -485,6 +490,20 @@ xmlSecOpenSSLErrorsInit(void) { return(0); } + +static void +xmlSecOpenSSLErrorsShutdown(void) { + /* remove callback */ + xmlSecErrorsSetCallback(NULL); + +#ifndef OPENSSL_IS_BORINGSSL + /* unload xmlsec strings from OpenSSL */ + ERR_unload_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrLib); + ERR_unload_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrDefReason); + ERR_unload_strings(XMLSEC_OPENSSL_ERRORS_LIB, xmlSecOpenSSLStrReasons); +#endif /* OPENSSL_IS_BORINGSSL */ +} + /** * xmlSecOpenSSLSetDefaultTrustedCertsFolder: * @path: the default trusted certs path. From c882d225f87194a8d457ad61ee23ff4befdb86c7 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Thu, 18 Jun 2020 10:03:14 -0700 Subject: [PATCH 15/17] cleanup and fix travis CI (#295) --- .travis.yml | 77 +++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3da56057..b210c83a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,49 @@ language: c -sudo: required -install: -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update; fi -- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi -# install build tools -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$TRAVIS_ARCH" = "s390x" ]; then - sudo apt-get install automake autoconf libtool libtool-bin libltdl-dev libltdl7; - else - sudo apt-get install automake autoconf libtool; - fi; - fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install libtool; fi -# install libxml2/libxslt libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libxml2 libxml2-dev libxslt1.1 libxslt1-dev; fi -# install openssl libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libssl1.0.0 libssl-dev; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install openssl; fi -# install nspr/nss libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install libnspr4 libnspr4-dev libnss3 libnss3-dev libnss3-tools; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install nss; fi -# install gcrypt libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$TRAVIS_ARCH" = "s390x" ]; then - sudo apt-get install libgcrypt20 libgcrypt20-dev; - else - sudo apt-get install libgcrypt11 libgcrypt11-dev; - fi; - fi -# install gnutls libraries -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$TRAVIS_ARCH" = "s390x" ]; then - sudo apt-get install libgnutls-dev; - else - sudo apt-get install libgnutls28 libgnutls-dev; - fi; - fi +os: linux +dist: bionic + +addons: + apt: + packages: + - automake + - autoconf + - libtool + - libtool-bin + - libltdl-dev + - libltdl7 + - libxml2 + - libxml2-dev + - libxslt1.1 + - libxslt1-dev + - libssl1.0.0 + - libssl-dev + - libnspr4 + - libnspr4-dev + - libnss3 + - libnss3-dev + - libnss3-tools + - libgcrypt20 + - libgcrypt20-dev + - libgnutls28-dev + homebrew: + packages: + - libtool + - openssl + - nss + - libgcrypt + - gnutls + script: - . scripts/travis-env.sh && mkdir build && cd build && ../autogen.sh --enable-werror && make && make check -matrix: + +jobs: include: - name: "linux-x86_64" os: linux - dist: trusty + arch: amd64 - name: "osx" os: osx osx_image: xcode9.3 - name: "linux-s390x" os: linux arch: s390x - dist: xenial From d24c9bd55a7b4eba0cf82005e2494d5f10f490d6 Mon Sep 17 00:00:00 2001 From: lsh123 Date: Thu, 9 Jul 2020 07:33:18 -0700 Subject: [PATCH 16/17] Add pointers to CMakeLIst.txt --- INSTALL | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/INSTALL b/INSTALL index baa984f47..a585a07a0 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,7 @@ Compilation 1. How to compile XMLSec? + As most UNIX libraries XMLSec follows the "standard": gunzip -c xmlsec-xxx.tar.gz | tar xvf - @@ -19,6 +20,14 @@ that the library is compiled successfully by running make check +Alternatively there are several community maintained ports to CMake +build system: + +* https://github.com/vmiklos/odfsig/tree/master/extern/xmlsec + +* https://github.com/microsoft/vcpkg/tree/master/ports/xmlsec + + 2.What other libraries are needed to compile/install XMLSec? XMLSec requires following libraries: From 5dc2b1171b70aa4bf8cd5f35d41761dc6e054f3f Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Sun, 23 Aug 2020 18:29:37 -0700 Subject: [PATCH 17/17] Add autoreconf to ./autogen.sh --- autogen.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autogen.sh b/autogen.sh index fe00bb356..5d2d4a891 100755 --- a/autogen.sh +++ b/autogen.sh @@ -36,6 +36,11 @@ fi echo "You must have autoconf installed to compile xmlsec." DIE=1 } +(autoreconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoreconf installed to compile xmlsec." + DIE=1 +} (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have automake installed to compile xmlsec." @@ -76,6 +81,8 @@ echo "Running automake..." automake --gnu --add-missing echo "Running autoconf..." autoconf +echo "Running autoreconf..." +autoreconf -i cd $THEDIR