summaryrefslogtreecommitdiff
path: root/external/libxmlsec
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-07 21:37:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-08 07:01:58 +0000
commit9d1f51307d61d0b9a8a8e4847b9e7e5c0177322e (patch)
treebd69f58e5559fe2cc5cc5da8ee2698cfcb1684bf /external/libxmlsec
parent9960537e66868413c64014815deb698c3fa74758 (diff)
Upgrade libxmlsec to 1.2.21
Obsoletes xmlsec1-ooxml.patch.1 and xmlsec1-vs2015.patch.1. Adds xmlsec1-keyinfo-revert.patch.1 till the LO side is adapted to the new xmlsec requirements. Change-Id: I1a46ad8fd7e9c8b4fa7a97591a1d90922969393d Reviewed-on: https://gerrit.libreoffice.org/24403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'external/libxmlsec')
-rw-r--r--external/libxmlsec/UnpackedTarball_xmlsec.mk5
-rw-r--r--external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch.16
-rw-r--r--external/libxmlsec/xmlsec1-configure.patch.179
-rw-r--r--external/libxmlsec/xmlsec1-customkeymanage.patch.195
-rw-r--r--external/libxmlsec/xmlsec1-keyinfo-revert.patch.1232
-rw-r--r--external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch.120
-rw-r--r--external/libxmlsec/xmlsec1-noverify.patch.18
-rw-r--r--external/libxmlsec/xmlsec1-nssdisablecallbacks.patch.16
-rw-r--r--external/libxmlsec/xmlsec1-nssmangleciphers.patch.16
-rw-r--r--external/libxmlsec/xmlsec1-oldlibtool.patch.1445
-rw-r--r--external/libxmlsec/xmlsec1-ooxml.patch.1790
-rw-r--r--external/libxmlsec/xmlsec1-vc.patch.124
-rw-r--r--external/libxmlsec/xmlsec1-vs2015.patch.146
13 files changed, 665 insertions, 1097 deletions
diff --git a/external/libxmlsec/UnpackedTarball_xmlsec.mk b/external/libxmlsec/UnpackedTarball_xmlsec.mk
index e19c67c0b9d2..b74384f37359 100644
--- a/external/libxmlsec/UnpackedTarball_xmlsec.mk
+++ b/external/libxmlsec/UnpackedTarball_xmlsec.mk
@@ -15,12 +15,9 @@ xmlsec_patches += xmlsec1-nssmangleciphers.patch.1
xmlsec_patches += xmlsec1-noverify.patch.1
xmlsec_patches += xmlsec1-mingw-keymgr-mscrypto.patch.1
xmlsec_patches += xmlsec1-vc.patch.1
-# Upstreamed as <https://github.com/lsh123/xmlsec/commit/727f1d3f1fa9c23d6d356b233c6fa274b5dd7d71>.
-xmlsec_patches += xmlsec1-vs2015.patch.1
xmlsec_patches += xmlsec1-1.2.14_fix_extern_c.patch.1
xmlsec_patches += xmlsec1-customkeymanage.patch.1
-# Upstreamed as <https://github.com/lsh123/xmlsec/commit/7069e2b0ab49679008abedd6d223fb95538b0684>.
-xmlsec_patches += xmlsec1-ooxml.patch.1
+xmlsec_patches += xmlsec1-keyinfo-revert.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))
diff --git a/external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch.1 b/external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch.1
index 8266d8dc089b..0ae592b8c9a2 100644
--- a/external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch.1
+++ b/external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch.1
@@ -1,4 +1,4 @@
-From 88dbb430ab261c153c51094dc183dd8876f9ba50 Mon Sep 17 00:00:00 2001
+From 145ae5235f79fec807f360cc34a0bf16cd6b6d75 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:12:48 +0100
Subject: [PATCH] xmlsec1-1.2.14_fix_extern_c.patch
@@ -10,7 +10,7 @@ Conflicts:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/xmlsec/xmlsec.h b/include/xmlsec/xmlsec.h
-index ad44918..b72aa62 100644
+index 963b37a..ec58bec 100644
--- a/include/xmlsec/xmlsec.h
+++ b/include/xmlsec/xmlsec.h
@@ -11,16 +11,16 @@
@@ -35,5 +35,5 @@ index ad44918..b72aa62 100644
*
* Basic types to make ports to exotic platforms easier
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-configure.patch.1 b/external/libxmlsec/xmlsec1-configure.patch.1
index 91ffb9a20970..2c0df5b4d038 100644
--- a/external/libxmlsec/xmlsec1-configure.patch.1
+++ b/external/libxmlsec/xmlsec1-configure.patch.1
@@ -1,54 +1,50 @@
-From a6200ded4c697408d00eb79cbc712acceb8aef83 Mon Sep 17 00:00:00 2001
+From 3a8aaa9a5baf91ef6bf9c24b4080896fb8615b0c Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:06:19 +0100
Subject: [PATCH] xmlsec1-configure.patch
Conflicts:
- configure.in
+ Makefile.am
+ Makefile.in
+ configure.ac
---
- Makefile.am | 5 +++--
- Makefile.in | 5 +++--
- configure.in | 52 ++++++++++++++++++++++++++++++++++++++++------------
+ Makefile.am | 2 +-
+ Makefile.in | 2 +-
+ configure.ac | 50 +++++++++++++++++++++++++++++++++++++++-----------
win32/Makefile.msvc | 2 +-
- 4 files changed, 47 insertions(+), 17 deletions(-)
+ 4 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 669f996..0cf0798 100644
+index 3453c01..da71139 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -1,8 +1,9 @@
+@@ -1,7 +1,7 @@
NULL =
SAFE_VERSION = @XMLSEC_VERSION_SAFE@
--SUBDIRS = include src apps man docs
--TEST_APP = apps/xmlsec1$(EXEEXT)
-+#Do not build xmlsec1 app. It is not needed. Also the libtool includes
-+#a -L/path_to_lib_dir which may contain an incompatible lixbml2.
-+SUBDIRS = include src man docs
- DEFAULT_CRYPTO = @XMLSEC_CRYPTO@
+-SUBDIRS = include src apps man docs
++SUBDIRS = include src man docs
+ TEST_APP = apps/xmlsec1$(EXEEXT)
+ DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@
- bin_SCRIPTS = xmlsec1-config
diff --git a/Makefile.in b/Makefile.in
-index 9b252ff..c42b984 100644
+index 6b23543..759b33e 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -452,8 +452,9 @@ top_builddir = @top_builddir@
+@@ -469,7 +469,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
NULL =
SAFE_VERSION = @XMLSEC_VERSION_SAFE@
-SUBDIRS = include src apps man docs
--TEST_APP = apps/xmlsec1$(EXEEXT)
-+#Do not build xmlsec1 app. It is not needed. Also the libtool includes
-+#a -L/path_to_lib_dir which may contain an incompatible lixbml2.
+SUBDIRS = include src man docs
- DEFAULT_CRYPTO = @XMLSEC_CRYPTO@
+ TEST_APP = apps/xmlsec1$(EXEEXT)
+ DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@
bin_SCRIPTS = xmlsec1-config
- pkgconfig_DATA = xmlsec1.pc @XMLSEC_CRYPTO_PC_FILES_LIST@
-diff --git a/configure.in b/configure.in
-index 7690e7a..f2c98e3 100644
---- a/configure.in
-+++ b/configure.in
-@@ -188,8 +188,8 @@ dnl find libxml
+diff --git a/configure.ac b/configure.ac
+index 8fb8740..67905b5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -230,8 +230,8 @@ dnl find libxml
dnl ==========================================================================
LIBXML_MIN_VERSION="2.7.4"
LIBXML_CONFIG="xml2-config"
@@ -59,7 +55,7 @@ index 7690e7a..f2c98e3 100644
LIBXML_FOUND="no"
AC_ARG_WITH(libxml,
[ --with-libxml=[PFX] libxml2 location]
-@@ -198,6 +198,8 @@ AC_ARG_WITH(libxml-src,
+@@ -240,6 +240,8 @@ AC_ARG_WITH(libxml-src,
[ --with-libxml-src=[PFX] not installed yet libxml2 location]
)
@@ -68,7 +64,7 @@ index 7690e7a..f2c98e3 100644
if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then
AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION)
AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE)
-@@ -246,6 +248,8 @@ if test "z$LIBXML_FOUND" = "zno" ; then
+@@ -288,6 +290,8 @@ if test "z$LIBXML_FOUND" = "zno" ; then
fi
fi
@@ -77,7 +73,7 @@ index 7690e7a..f2c98e3 100644
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)
AC_SUBST(LIBXML_CONFIG)
-@@ -570,12 +574,26 @@ dnl ==========================================================================
+@@ -601,12 +605,26 @@ dnl ==========================================================================
XMLSEC_NO_NSS="1"
SEAMONKEY_MIN_VERSION="1.0"
MOZILLA_MIN_VERSION="1.4"
@@ -106,7 +102,7 @@ index 7690e7a..f2c98e3 100644
NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss"
NSS_FOUND="no"
NSPR_PACKAGE=mozilla-nspr
-@@ -602,6 +620,16 @@ elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z
+@@ -633,6 +651,16 @@ elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z
dnl We are going to try all options
dnl
if test "z$NSS_FOUND" = "zno" ; then
@@ -123,7 +119,7 @@ index 7690e7a..f2c98e3 100644
PKG_CHECK_MODULES(NSS, seamonkey-nspr >= $NSPR_MIN_VERSION seamonkey-nss >= $SEAMONKEY_MIN_VERSION,
[NSS_FOUND=yes NSPR_PACKAGE=seamonkey-nspr NSS_PACKAGE=seamonkey-nss],
[NSS_FOUND=no])
-@@ -633,8 +661,8 @@ if test "z$NSS_FOUND" = "zno" ; then
+@@ -664,8 +692,8 @@ if test "z$NSS_FOUND" = "zno" ; then
ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION
fi
@@ -134,7 +130,7 @@ index 7690e7a..f2c98e3 100644
AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION)
NSPR_INCLUDES_FOUND="no"
-@@ -655,21 +683,21 @@ if test "z$NSS_FOUND" = "zno" ; then
+@@ -686,21 +714,21 @@ if test "z$NSS_FOUND" = "zno" ; then
NSPR_PRINIT_H="$with_nspr/include/prinit.h"
else
for dir in $ac_nss_inc_dir ; do
@@ -160,7 +156,7 @@ index 7690e7a..f2c98e3 100644
dnl do not add -L/usr/lib because compiler does it anyway
if test "z$dir" = "z/usr/lib" ; then
NSPR_LIBS="$NSPR_LIBS_LIST"
-@@ -740,7 +768,7 @@ if test "z$NSS_FOUND" = "zno" ; then
+@@ -771,7 +799,7 @@ if test "z$NSS_FOUND" = "zno" ; then
done
for dir in $ac_nss_lib_dir ; do
@@ -169,20 +165,11 @@ index 7690e7a..f2c98e3 100644
dnl do not add -L/usr/lib because compiler does it anyway
if test "z$dir" = "z/usr/lib" ; then
NSS_LIBS="$NSS_LIBS_LIST"
-@@ -759,7 +787,7 @@ if test "z$NSS_FOUND" = "zno" ; then
-
- if test "z$NSS_INCLUDES_FOUND" = "zyes" -a "z$NSS_LIBS_FOUND" = "zyes" ; then
- OLD_CPPFLAGS=$CPPFLAGS
-- CPPFLAGS="$NSS_CFLAGS"
-+ CPPFLAGS="$NSS_CFLAGS $NSPR_CFLAGS"
- AC_EGREP_CPP(yes,[
- #include <nss.h>
- #if NSS_VMAJOR >= 3 && NSS_VMINOR >= 2
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
-index 2712a0a..d833497 100644
+index 357a890..30b9dfb 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
-@@ -394,7 +394,7 @@ APP_LIBS = $(SOLIBS) $(XMLSEC_CRYPTO_SOLIBS)
+@@ -392,7 +392,7 @@ APP_LIBS = $(SOLIBS) $(XMLSEC_CRYPTO_SOLIBS)
XMLSEC_OPENSSL_SOLIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
XMLSEC_OPENSSL_ALIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
@@ -192,5 +179,5 @@ index 2712a0a..d833497 100644
XMLSEC_MSCRYPTO_SOLIBS = kernel32.lib user32.lib gdi32.lib Crypt32.lib Advapi32.lib
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-customkeymanage.patch.1 b/external/libxmlsec/xmlsec1-customkeymanage.patch.1
index 852d513aea11..d17b3133cf9d 100644
--- a/external/libxmlsec/xmlsec1-customkeymanage.patch.1
+++ b/external/libxmlsec/xmlsec1-customkeymanage.patch.1
@@ -1,4 +1,4 @@
-From 584620e74f3240d955bb9ea7a9a2e2ffc7634b95 Mon Sep 17 00:00:00 2001
+From b902d273b54981681ee9896a015bb5bef71a4c0b Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:19:12 +0100
Subject: [PATCH] xmlsec1-customkeymanage.patch
@@ -33,9 +33,9 @@ Conflicts:
src/nss/symkeys.c | 705 ++++++++++++++++++++++++++++--
src/nss/tokens.c | 548 ++++++++++++++++++++++++
src/nss/x509.c | 565 +++++-------------------
- src/nss/x509vfy.c | 292 ++++---------
+ src/nss/x509vfy.c | 291 ++++---------
win32/Makefile.msvc | 4 +
- 22 files changed, 3034 insertions(+), 970 deletions(-)
+ 22 files changed, 3034 insertions(+), 969 deletions(-)
create mode 100644 include/xmlsec/mscrypto/akmngr.h
create mode 100644 include/xmlsec/nss/akmngr.h
create mode 100644 include/xmlsec/nss/ciphers.h
@@ -57,10 +57,10 @@ index 18dff94..44837b6 100644
certkeys.h \
crypto.h \
diff --git a/include/xmlsec/mscrypto/Makefile.in b/include/xmlsec/mscrypto/Makefile.in
-index 411681d..3ed3f5b 100644
+index 3b22b00..b2eac50 100644
--- a/include/xmlsec/mscrypto/Makefile.in
+++ b/include/xmlsec/mscrypto/Makefile.in
-@@ -379,6 +379,7 @@ top_srcdir = @top_srcdir@
+@@ -397,6 +397,7 @@ top_srcdir = @top_srcdir@
NULL =
xmlsecmscryptoincdir = $(includedir)/xmlsec1/xmlsec/mscrypto
xmlsecmscryptoinc_HEADERS = \
@@ -160,10 +160,10 @@ index e352162..997ca7f 100644
install-exec-hook:
diff --git a/include/xmlsec/nss/Makefile.in b/include/xmlsec/nss/Makefile.in
-index 92f2d19..c190177 100644
+index e7098c6..2f1e318 100644
--- a/include/xmlsec/nss/Makefile.in
+++ b/include/xmlsec/nss/Makefile.in
-@@ -386,6 +386,9 @@ bignum.h \
+@@ -404,6 +404,9 @@ bignum.h \
keysstore.h \
pkikeys.h \
x509.h \
@@ -236,7 +236,7 @@ index 0000000..8053511
+
+
diff --git a/include/xmlsec/nss/app.h b/include/xmlsec/nss/app.h
-index 387d34e..d5dc345 100644
+index aeac55e..72e3db0 100644
--- a/include/xmlsec/nss/app.h
+++ b/include/xmlsec/nss/app.h
@@ -22,6 +22,9 @@ extern "C" {
@@ -765,10 +765,10 @@ index 8cd8586..a14199e 100644
if SHAREDLIB_HACK
diff --git a/src/nss/Makefile.in b/src/nss/Makefile.in
-index e43ac73..5622923 100644
+index 5a1393d..5613f5b 100644
--- a/src/nss/Makefile.in
+++ b/src/nss/Makefile.in
-@@ -126,7 +126,8 @@ am__DEPENDENCIES_1 =
+@@ -135,7 +135,8 @@ am__DEPENDENCIES_1 =
am__libxmlsec1_nss_la_SOURCES_DIST = app.c bignum.c ciphers.c crypto.c \
digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \
x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \
@@ -776,9 +776,9 @@ index e43ac73..5622923 100644
+ ../strings.c \
+ akmngr.c tokens.c
am__objects_1 =
- @SHAREDLIB_HACK_TRUE@am__objects_2 = libxmlsec1_nss_la-strings.lo
- am_libxmlsec1_nss_la_OBJECTS = libxmlsec1_nss_la-app.lo \
-@@ -137,6 +138,8 @@ am_libxmlsec1_nss_la_OBJECTS = libxmlsec1_nss_la-app.lo \
+ am__dirstamp = $(am__leading_dot)dirstamp
+ @SHAREDLIB_HACK_TRUE@am__objects_2 = ../libxmlsec1_nss_la-strings.lo
+@@ -147,6 +148,8 @@ am_libxmlsec1_nss_la_OBJECTS = libxmlsec1_nss_la-app.lo \
libxmlsec1_nss_la-x509.lo libxmlsec1_nss_la-x509vfy.lo \
libxmlsec1_nss_la-keysstore.lo libxmlsec1_nss_la-keytrans.lo \
libxmlsec1_nss_la-kw_des.lo libxmlsec1_nss_la-kw_aes.lo \
@@ -787,7 +787,7 @@ index e43ac73..5622923 100644
$(am__objects_1) $(am__objects_2)
libxmlsec1_nss_la_OBJECTS = $(am_libxmlsec1_nss_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
-@@ -446,6 +449,7 @@ libxmlsec1_nss_la_CPPFLAGS = \
+@@ -464,6 +467,7 @@ libxmlsec1_nss_la_CPPFLAGS = \
libxmlsec1_nss_la_SOURCES = app.c bignum.c ciphers.c crypto.c \
digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \
x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \
@@ -795,7 +795,7 @@ index e43ac73..5622923 100644
$(NULL) $(am__append_1)
libxmlsec1_nss_la_LIBADD = \
$(NSS_LIBS) \
-@@ -557,6 +561,8 @@ distclean-compile:
+@@ -584,6 +588,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-symkeys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509vfy.Plo@am__quote@
@@ -803,8 +803,8 @@ index e43ac73..5622923 100644
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-tokens.Plo@am__quote@
.c.o:
- @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@@ -586,6 +592,20 @@ libxmlsec1_nss_la-app.lo: app.c
+ @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@@ -616,6 +622,20 @@ libxmlsec1_nss_la-app.lo: app.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c
@@ -1216,7 +1216,7 @@ index 0000000..65b94ac
+}
+
diff --git a/src/nss/hmac.c b/src/nss/hmac.c
-index ae7e67e..ba3887a 100644
+index 79fbf40..2469e6a 100644
--- a/src/nss/hmac.c
+++ b/src/nss/hmac.c
@@ -23,8 +23,8 @@
@@ -1247,7 +1247,7 @@ index ae7e67e..ba3887a 100644
}
diff --git a/src/nss/keysstore.c b/src/nss/keysstore.c
-index f07e44b..e4cb0f1 100644
+index 057fc45..e4cb0f1 100644
--- a/src/nss/keysstore.c
+++ b/src/nss/keysstore.c
@@ -1,36 +1,56 @@
@@ -1876,7 +1876,7 @@ index f07e44b..e4cb0f1 100644
- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1);
-
- ss = xmlSecNssKeysStoreGetSS(store);
-- xmlSecAssert2((*ss == NULL), -1);
+- xmlSecAssert2(((ss == NULL) || (*ss == NULL)), -1);
-
- *ss = xmlSecKeyStoreCreate(xmlSecSimpleKeysStoreId);
- if(*ss == NULL) {
@@ -2175,7 +2175,7 @@ index f07e44b..e4cb0f1 100644
+ return(0);
}
diff --git a/src/nss/pkikeys.c b/src/nss/pkikeys.c
-index ae9e29b..9acd317 100644
+index 5ede4cc..896c245 100644
--- a/src/nss/pkikeys.c
+++ b/src/nss/pkikeys.c
@@ -24,6 +24,7 @@
@@ -2212,7 +2212,7 @@ index ae9e29b..9acd317 100644
ret = -1;
goto done;
}
-@@ -792,14 +795,14 @@ done:
+@@ -801,14 +804,14 @@ done:
if (slot != NULL) {
PK11_FreeSlot(slot);
}
@@ -2229,7 +2229,7 @@ index ae9e29b..9acd317 100644
return(ret);
}
-@@ -818,7 +821,7 @@ xmlSecNssKeyDataDsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
+@@ -827,7 +830,7 @@ xmlSecNssKeyDataDsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
xmlSecAssert2(ctx != NULL, -1);
@@ -2238,7 +2238,7 @@ index ae9e29b..9acd317 100644
if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) {
/* we can have only private key or public key */
-@@ -940,7 +943,8 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
+@@ -949,7 +952,8 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
"PK11_PQG_ParamGen",
XMLSEC_ERRORS_R_CRYPTO_FAILED,
@@ -2248,7 +2248,7 @@ index ae9e29b..9acd317 100644
goto done;
}
-@@ -950,11 +954,12 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
+@@ -959,11 +963,12 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
"PK11_PQG_VerifyParams",
XMLSEC_ERRORS_R_CRYPTO_FAILED,
@@ -2263,7 +2263,7 @@ index ae9e29b..9acd317 100644
PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */);
privkey = PK11_GenerateKeyPair(slot, CKM_DSA_KEY_PAIR_GEN, pqgParams,
&pubkey, PR_FALSE, PR_TRUE, NULL);
-@@ -964,8 +969,9 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
+@@ -973,8 +978,9 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
"PK11_GenerateKeyPair",
XMLSEC_ERRORS_R_CRYPTO_FAILED,
@@ -2274,7 +2274,7 @@ index ae9e29b..9acd317 100644
goto done;
}
-@@ -979,6 +985,8 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
+@@ -988,6 +994,8 @@ xmlSecNssKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
goto done;
}
@@ -2283,7 +2283,7 @@ index ae9e29b..9acd317 100644
ret = 0;
done:
-@@ -991,16 +999,13 @@ done:
+@@ -1000,16 +1008,13 @@ done:
if (pqgVerify != NULL) {
PK11_PQG_DestroyVerify(pqgVerify);
}
@@ -2301,7 +2301,7 @@ index ae9e29b..9acd317 100644
}
static xmlSecKeyDataType
-@@ -1010,10 +1015,10 @@ xmlSecNssKeyDataDsaGetType(xmlSecKeyDataPtr data) {
+@@ -1019,10 +1024,10 @@ xmlSecNssKeyDataDsaGetType(xmlSecKeyDataPtr data) {
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), xmlSecKeyDataTypeUnknown);
ctx = xmlSecNssPKIKeyDataGetCtx(data);
xmlSecAssert2(ctx != NULL, -1);
@@ -2314,7 +2314,7 @@ index ae9e29b..9acd317 100644
return(xmlSecKeyDataTypePublic);
}
-@@ -1027,7 +1032,7 @@ xmlSecNssKeyDataDsaGetSize(xmlSecKeyDataPtr data) {
+@@ -1036,7 +1041,7 @@ xmlSecNssKeyDataDsaGetSize(xmlSecKeyDataPtr data) {
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), 0);
ctx = xmlSecNssPKIKeyDataGetCtx(data);
xmlSecAssert2(ctx != NULL, -1);
@@ -2323,7 +2323,7 @@ index ae9e29b..9acd317 100644
return(8 * SECKEY_PublicKeyStrength(ctx->pubkey));
}
-@@ -1216,13 +1221,13 @@ xmlSecNssKeyDataRsaXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
+@@ -1225,13 +1230,13 @@ xmlSecNssKeyDataRsaXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
goto done;
}
@@ -2340,7 +2340,7 @@ index ae9e29b..9acd317 100644
ret = -1;
goto done;
}
-@@ -1384,7 +1389,7 @@ xmlSecNssKeyDataRsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
+@@ -1393,7 +1398,7 @@ xmlSecNssKeyDataRsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
xmlSecAssert2(ctx != NULL, -1);
@@ -2349,7 +2349,7 @@ index ae9e29b..9acd317 100644
if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) {
-@@ -1455,7 +1460,7 @@ xmlSecNssKeyDataRsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
+@@ -1464,7 +1469,7 @@ xmlSecNssKeyDataRsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKe
params.keySizeInBits = sizeBits;
params.pe = 65537;
@@ -2358,7 +2358,7 @@ index ae9e29b..9acd317 100644
PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */);
privkey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, &params,
&pubkey, PR_FALSE, PR_TRUE, NULL);
-@@ -1525,7 +1530,7 @@ xmlSecNssKeyDataRsaGetSize(xmlSecKeyDataPtr data) {
+@@ -1534,7 +1539,7 @@ xmlSecNssKeyDataRsaGetSize(xmlSecKeyDataPtr data) {
ctx = xmlSecNssPKIKeyDataGetCtx(data);
xmlSecAssert2(ctx != NULL, -1);
@@ -2368,7 +2368,7 @@ index ae9e29b..9acd317 100644
return(8 * SECKEY_PublicKeyStrength(ctx->pubkey));
}
diff --git a/src/nss/symkeys.c b/src/nss/symkeys.c
-index 3da7a69..9b4c700 100644
+index b98dd49..39ba339 100644
--- a/src/nss/symkeys.c
+++ b/src/nss/symkeys.c
@@ -15,20 +15,41 @@
@@ -4519,7 +4519,7 @@ index 887c77c..749bbde 100644
xmlSecNssX509CertDebugDump(CERTCertificate* cert, FILE* output) {
SECItem *sn;
diff --git a/src/nss/x509vfy.c b/src/nss/x509vfy.c
-index 8a6e97a..d1b2850 100644
+index 0edaa2d..c8baaab 100644
--- a/src/nss/x509vfy.c
+++ b/src/nss/x509vfy.c
@@ -30,6 +30,7 @@
@@ -4550,7 +4550,7 @@ index 8a6e97a..d1b2850 100644
static xmlSecKeyDataStoreKlass xmlSecNssX509StoreKlass = {
sizeof(xmlSecKeyDataStoreKlass),
-@@ -362,7 +352,7 @@ xmlSecNssX509StoreFinalize(xmlSecKeyDataStorePtr store) {
+@@ -365,7 +355,7 @@ xmlSecNssX509StoreFinalize(xmlSecKeyDataStorePtr store) {
*****************************************************************************/
static CERTName *
xmlSecNssGetCertName(const xmlChar * name) {
@@ -4559,7 +4559,7 @@ index 8a6e97a..d1b2850 100644
xmlChar *p;
CERTName *res;
-@@ -387,33 +377,19 @@ xmlSecNssGetCertName(const xmlChar * name) {
+@@ -390,33 +380,19 @@ xmlSecNssGetCertName(const xmlChar * name) {
memcpy(p, " E=", 13);
}
@@ -4595,7 +4595,7 @@ index 8a6e97a..d1b2850 100644
return(res);
}
-@@ -511,22 +487,11 @@ xmlSecNssX509FindCert(CERTCertList* certsList, const xmlChar *subjectName,
+@@ -514,22 +490,11 @@ xmlSecNssX509FindCert(CERTCertList* certsList, const xmlChar *subjectName,
issuerAndSN.derIssuer.data = nameitem->data;
issuerAndSN.derIssuer.len = nameitem->len;
@@ -4621,7 +4621,7 @@ index 8a6e97a..d1b2850 100644
XMLSEC_ERRORS_R_XMLSEC_FAILED,
"error code=%d", PR_GetError());
SECITEM_FreeItem(&issuerAndSN.serialNumber, PR_FALSE);
-@@ -611,176 +576,6 @@ done:
+@@ -614,175 +579,6 @@ done:
return(cert);
}
@@ -4718,11 +4718,10 @@ index 8a6e97a..d1b2850 100644
- }
- memcpy(p, value, valueLen);
- p+=valueLen;
-- if (len > 0)
+- if (len > 0) {
- *p++=',';
+- }
- }
-- } else {
-- valueLen = 0;
- }
- if(len > 0) {
- ++str; --len;
@@ -4798,7 +4797,7 @@ index 8a6e97a..d1b2850 100644
/* code lifted from NSS */
static int
xmlSecNssNumToItem(SECItem *it, PRUint64 ui)
-@@ -817,6 +612,77 @@ xmlSecNssNumToItem(SECItem *it, PRUint64 ui)
+@@ -819,6 +615,77 @@ xmlSecNssNumToItem(SECItem *it, PRUint64 ui)
PORT_Memcpy(it->data, bb + (zeros_len - 1), it->len);
return(it->len);
}
@@ -4877,10 +4876,10 @@ index 8a6e97a..d1b2850 100644
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
-index 065595b..e0ac57e 100644
+index 51c53a7..525ae8d 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
-@@ -226,6 +226,9 @@ XMLSEC_OPENSSL_OBJS_A = \
+@@ -224,6 +224,9 @@ XMLSEC_OPENSSL_OBJS_A = \
$(XMLSEC_OPENSSL_INTDIR_A)\x509vfy.obj
XMLSEC_NSS_OBJS = \
@@ -4890,7 +4889,7 @@ index 065595b..e0ac57e 100644
$(XMLSEC_NSS_INTDIR)\app.obj\
$(XMLSEC_NSS_INTDIR)\bignum.obj\
$(XMLSEC_NSS_INTDIR)\ciphers.obj \
-@@ -261,6 +264,7 @@ XMLSEC_NSS_OBJS_A = \
+@@ -259,6 +262,7 @@ XMLSEC_NSS_OBJS_A = \
$(XMLSEC_NSS_INTDIR_A)\strings.obj
XMLSEC_MSCRYPTO_OBJS = \
@@ -4899,5 +4898,5 @@ index 065595b..e0ac57e 100644
$(XMLSEC_MSCRYPTO_INTDIR)\crypto.obj \
$(XMLSEC_MSCRYPTO_INTDIR)\ciphers.obj \
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-keyinfo-revert.patch.1 b/external/libxmlsec/xmlsec1-keyinfo-revert.patch.1
new file mode 100644
index 000000000000..42e3662831a0
--- /dev/null
+++ b/external/libxmlsec/xmlsec1-keyinfo-revert.patch.1
@@ -0,0 +1,232 @@
+From 8bcafc8bc497d76dbd68b02d84b4a30e709310a3 Mon Sep 17 00:00:00 2001
+From: Miklos Vajna <vmiklos@collabora.co.uk>
+Date: Thu, 7 Jul 2016 21:25:10 +0200
+Subject: [PATCH] Revert "populate KeyInfo node before calculating Reference
+ nodes"
+
+This reverts commit 8f6c95a90735c4d6e13bddf84de7a5284132826c. This is
+needed till LO code depends on the undocumented xmlsec behavior that
+throwing a binary PNG image on the XML parser returns with an error
+*before* it calls xmlSecDSigCtxProcessKeyInfoNode.
+
+Conflicts:
+ src/xmldsig.c
+---
+ src/xmldsig.c | 123 +++++++++++++++-------------------------------------------
+ 1 file changed, 32 insertions(+), 91 deletions(-)
+
+diff --git a/src/xmldsig.c b/src/xmldsig.c
+index faf5545..3c4b236 100644
+--- a/src/xmldsig.c
++++ b/src/xmldsig.c
+@@ -39,8 +39,7 @@
+ static int xmlSecDSigCtxProcessSignatureNode (xmlSecDSigCtxPtr dsigCtx,
+ xmlNodePtr node);
+ static int xmlSecDSigCtxProcessSignedInfoNode (xmlSecDSigCtxPtr dsigCtx,
+- xmlNodePtr node,
+- xmlNodePtr * firstReferenceNode);
++ xmlNodePtr node);
+ static int xmlSecDSigCtxProcessKeyInfoNode (xmlSecDSigCtxPtr dsigCtx,
+ xmlNodePtr node);
+ static int xmlSecDSigCtxProcessObjectNode (xmlSecDSigCtxPtr dsigCtx,
+@@ -48,9 +47,6 @@ static int xmlSecDSigCtxProcessObjectNode (xmlSecDSigCtxPtr dsigCt
+ static int xmlSecDSigCtxProcessManifestNode (xmlSecDSigCtxPtr dsigCtx,
+ xmlNodePtr node);
+
+-static int xmlSecDSigCtxProcessReferences (xmlSecDSigCtxPtr dsigCtx,
+- xmlNodePtr firstReferenceNode);
+-
+ /* The ID attribute in XMLDSig is 'Id' */
+ static const xmlChar* xmlSecDSigIds[] = { xmlSecAttrId, NULL };
+
+@@ -474,7 +470,6 @@ xmlSecDSigCtxProcessSignatureNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ xmlSecTransformDataType firstType;
+ xmlNodePtr signedInfoNode = NULL;
+ xmlNodePtr keyInfoNode = NULL;
+- xmlNodePtr firstReferenceNode = NULL;
+ xmlNodePtr cur;
+ int ret;
+
+@@ -563,7 +558,7 @@ xmlSecDSigCtxProcessSignatureNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ }
+
+ /* now validated all the references and prepare transform */
+- ret = xmlSecDSigCtxProcessSignedInfoNode(dsigCtx, signedInfoNode, &firstReferenceNode);
++ ret = xmlSecDSigCtxProcessSignedInfoNode(dsigCtx, signedInfoNode);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+@@ -572,12 +567,15 @@ xmlSecDSigCtxProcessSignatureNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
++ /* references processing might change the status */
++ if(dsigCtx->status != xmlSecDSigStatusUnknown) {
++ return(0);
++ }
+
+ /* as the result, we should have sign and c14n methods set */
+ xmlSecAssert2(dsigCtx->signMethod != NULL, -1);
+ xmlSecAssert2(dsigCtx->c14nMethod != NULL, -1);
+
+- /* now read key info node */
+ ret = xmlSecDSigCtxProcessKeyInfoNode(dsigCtx, keyInfoNode);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+@@ -590,21 +588,6 @@ xmlSecDSigCtxProcessSignatureNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ /* as the result, we should have a key */
+ xmlSecAssert2(dsigCtx->signKey != NULL, -1);
+
+- /* now actually process references and calculate digests */
+- ret = xmlSecDSigCtxProcessReferences(dsigCtx, firstReferenceNode);
+- if(ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecDSigCtxProcessReferences",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+- /* references processing might change the status */
+- if(dsigCtx->status != xmlSecDSigStatusUnknown) {
+- return(0);
+- }
+-
+ /* if we need to write result to xml node then we need base64 encode result */
+ if(dsigCtx->operation == xmlSecTransformOperationSign) {
+ xmlSecTransformPtr base64Encode;
+@@ -700,18 +683,18 @@ xmlSecDSigCtxProcessSignatureNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ *
+ */
+ static int
+-xmlSecDSigCtxProcessSignedInfoNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node, xmlNodePtr * firstReferenceNode) {
+- xmlSecSize refNodesCount = 0;
++xmlSecDSigCtxProcessSignedInfoNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
++ xmlSecDSigReferenceCtxPtr dsigRefCtx;
+ xmlNodePtr cur;
++ int ret;
+
+ xmlSecAssert2(dsigCtx != NULL, -1);
+ xmlSecAssert2(dsigCtx->status == xmlSecDSigStatusUnknown, -1);
+ xmlSecAssert2(dsigCtx->signMethod == NULL, -1);
+ xmlSecAssert2(dsigCtx->c14nMethod == NULL, -1);
+ xmlSecAssert2((dsigCtx->operation == xmlSecTransformOperationSign) || (dsigCtx->operation == xmlSecTransformOperationVerify), -1);
++ xmlSecAssert2(xmlSecPtrListGetSize(&(dsigCtx->signedInfoReferences)) == 0, -1);
+ xmlSecAssert2(node != NULL, -1);
+- xmlSecAssert2(firstReferenceNode != NULL, -1);
+- xmlSecAssert2((*firstReferenceNode) == NULL, -1);
+
+ /* first node is required CanonicalizationMethod. */
+ cur = xmlSecGetNextElementNode(node->children);
+@@ -805,72 +788,12 @@ xmlSecDSigCtxProcessSignedInfoNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node, xm
+ }
+ dsigCtx->signMethod->operation = dsigCtx->operation;
+
+- /* read references */
++ /* calculate references */
+ if(cur != NULL) {
+ cur = xmlSecGetNextElementNode(cur->next);
+ }
+ while((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeReference, xmlSecDSigNs))) {
+- /* record first reference node */
+- if((*firstReferenceNode) == NULL) {
+- (*firstReferenceNode) = cur;
+- }
+- ++refNodesCount;
+-
+- /* go to next */
+- cur = xmlSecGetNextElementNode(cur->next);
+- }
+-
+- /* check that we have at least one Reference */
+- if(refNodesCount == 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_DSIG_NO_REFERENCES,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- /* if there is something left than it's an error */
+- if(cur != NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
+- XMLSEC_ERRORS_R_UNEXPECTED_NODE,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- /* done */
+- return(0);
+-}
+-
+-
+-static int
+-xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferenceNode) {
+- xmlSecDSigReferenceCtxPtr dsigRefCtx;
+- xmlNodePtr cur;
+- int ret;
+-
+- xmlSecAssert2(dsigCtx != NULL, -1);
+- xmlSecAssert2(dsigCtx->status == xmlSecDSigStatusUnknown, -1);
+- xmlSecAssert2((dsigCtx->operation == xmlSecTransformOperationSign) || (dsigCtx->operation == xmlSecTransformOperationVerify), -1);
+- xmlSecAssert2(xmlSecPtrListGetSize(&(dsigCtx->signedInfoReferences)) == 0, -1);
+- xmlSecAssert2(firstReferenceNode != NULL, -1);
+-
+- /* process references */
+- for(cur = firstReferenceNode; (cur != NULL); cur = xmlSecGetNextElementNode(cur->next)) {
+- /* already checked but we trust none */
+- if(!xmlSecCheckNodeName(cur, xmlSecNodeReference, xmlSecDSigNs)) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
+- XMLSEC_ERRORS_R_INVALID_NODE,
+- "expected=%s",
+- xmlSecErrorsSafeString(xmlSecNodeReference));
+- return(-1);
+- }
+-
+- /* create reference */
++ /* create reference */
+ dsigRefCtx = xmlSecDSigReferenceCtxCreate(dsigCtx, xmlSecDSigReferenceOriginSignedInfo);
+ if(dsigRefCtx == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+@@ -910,13 +833,31 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
+ dsigCtx->status = xmlSecDSigStatusInvalid;
+ return(0);
+ }
++ cur = xmlSecGetNextElementNode(cur->next);
++ }
++
++ /* check that we have at least one Reference */
++ if(xmlSecPtrListGetSize(&(dsigCtx->signedInfoReferences)) == 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ NULL,
++ XMLSEC_ERRORS_R_DSIG_NO_REFERENCES,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return(-1);
+ }
+
+- /* done */
++ /* if there is something left than it's an error */
++ if(cur != NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
++ XMLSEC_ERRORS_R_UNEXPECTED_NODE,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return(-1);
++ }
+ return(0);
+ }
+
+-
+ static int
+ xmlSecDSigCtxProcessKeyInfoNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
+ int ret;
+--
+2.6.6
+
diff --git a/external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch.1 b/external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch.1
index c570fc89c0a7..bab4d00df364 100644
--- a/external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch.1
+++ b/external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch.1
@@ -1,4 +1,4 @@
-From ba77775b6cf9a025cc049bc8c8d0381ec64933c9 Mon Sep 17 00:00:00 2001
+From 37e2cf159580f9b4e737dfe650f30981f92ad381 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:11:52 +0100
Subject: [PATCH] xmlsec1-mingw-keymgr-mscrypto.patch
@@ -23,10 +23,10 @@ index 5cea654..3dc6452 100644
if SHAREDLIB_HACK
diff --git a/src/mscrypto/Makefile.in b/src/mscrypto/Makefile.in
-index 2697d86..56c28ef 100644
+index d542fe4..f682964 100644
--- a/src/mscrypto/Makefile.in
+++ b/src/mscrypto/Makefile.in
-@@ -126,7 +126,8 @@ am__DEPENDENCIES_1 =
+@@ -135,7 +135,8 @@ am__DEPENDENCIES_1 =
am__libxmlsec1_mscrypto_la_SOURCES_DIST = globals.h private.h app.c \
certkeys.c ciphers.c crypto.c digests.c hmac.c keysstore.c \
kw_aes.c kw_des.c kt_rsa.c signatures.c symkeys.c x509.c \
@@ -34,9 +34,9 @@ index 2697d86..56c28ef 100644
+ x509vfy.c csp_calg.h csp_oid.h xmlsec-mingw.h ../strings.c \
+ akmngr.c
am__objects_1 =
+ am__dirstamp = $(am__leading_dot)dirstamp
@SHAREDLIB_HACK_TRUE@am__objects_2 = \
- @SHAREDLIB_HACK_TRUE@ libxmlsec1_mscrypto_la-strings.lo
-@@ -143,7 +144,8 @@ am_libxmlsec1_mscrypto_la_OBJECTS = libxmlsec1_mscrypto_la-app.lo \
+@@ -153,7 +154,8 @@ am_libxmlsec1_mscrypto_la_OBJECTS = libxmlsec1_mscrypto_la-app.lo \
libxmlsec1_mscrypto_la-signatures.lo \
libxmlsec1_mscrypto_la-symkeys.lo \
libxmlsec1_mscrypto_la-x509.lo \
@@ -46,7 +46,7 @@ index 2697d86..56c28ef 100644
$(am__objects_2)
libxmlsec1_mscrypto_la_OBJECTS = $(am_libxmlsec1_mscrypto_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
-@@ -454,6 +456,7 @@ libxmlsec1_mscrypto_la_CPPFLAGS = \
+@@ -472,6 +474,7 @@ libxmlsec1_mscrypto_la_CPPFLAGS = \
libxmlsec1_mscrypto_la_SOURCES = globals.h private.h app.c certkeys.c \
ciphers.c crypto.c digests.c hmac.c keysstore.c kw_aes.c \
kw_des.c kt_rsa.c signatures.c symkeys.c x509.c x509vfy.c \
@@ -54,15 +54,15 @@ index 2697d86..56c28ef 100644
csp_calg.h csp_oid.h xmlsec-mingw.h $(NULL) $(am__append_1)
libxmlsec1_mscrypto_la_LIBADD = \
$(MSCRYPTO_LIBS) \
-@@ -565,6 +568,7 @@ distclean-compile:
+@@ -592,6 +595,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-symkeys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509vfy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Plo@am__quote@
.c.o:
- @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@@ -594,6 +598,13 @@ libxmlsec1_mscrypto_la-app.lo: app.c
+ @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@@ -624,6 +628,13 @@ libxmlsec1_mscrypto_la-app.lo: app.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_mscrypto_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c
@@ -77,5 +77,5 @@ index 2697d86..56c28ef 100644
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_mscrypto_la-certkeys.lo -MD -MP -MF $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo -c -o libxmlsec1_mscrypto_la-certkeys.lo `test -f 'certkeys.c' || echo '$(srcdir)/'`certkeys.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Plo
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-noverify.patch.1 b/external/libxmlsec/xmlsec1-noverify.patch.1
index 7d7ea9a58ae2..479fe88d35d0 100644
--- a/external/libxmlsec/xmlsec1-noverify.patch.1
+++ b/external/libxmlsec/xmlsec1-noverify.patch.1
@@ -1,4 +1,4 @@
-From 56bd53dc3c8b7f05c55023700b3e0439dcd66aac Mon Sep 17 00:00:00 2001
+From d2b22f265df84d605338546b457aec4fb0888861 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:10:16 +0100
Subject: [PATCH] xmlsec1-noverify.patch
@@ -11,7 +11,7 @@ Conflicts:
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/src/mscrypto/x509vfy.c b/src/mscrypto/x509vfy.c
-index cf31787..80de2c9 100644
+index 899cb6e..cf4cbb7 100644
--- a/src/mscrypto/x509vfy.c
+++ b/src/mscrypto/x509vfy.c
@@ -560,9 +560,16 @@ xmlSecMSCryptoX509StoreVerify(xmlSecKeyDataStorePtr store, HCERTSTORE certs,
@@ -35,7 +35,7 @@ index cf31787..80de2c9 100644
return (NULL);
diff --git a/src/nss/x509vfy.c b/src/nss/x509vfy.c
-index fdb866f..8a6e97a 100644
+index 9e957fe..0edaa2d 100644
--- a/src/nss/x509vfy.c
+++ b/src/nss/x509vfy.c
@@ -211,13 +211,27 @@ xmlSecNssX509StoreVerify(xmlSecKeyDataStorePtr store, CERTCertList* certs,
@@ -74,5 +74,5 @@ index fdb866f..8a6e97a 100644
if (status == SECSuccess) {
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-nssdisablecallbacks.patch.1 b/external/libxmlsec/xmlsec1-nssdisablecallbacks.patch.1
index 8fb7d34b059b..f68be69b0964 100644
--- a/external/libxmlsec/xmlsec1-nssdisablecallbacks.patch.1
+++ b/external/libxmlsec/xmlsec1-nssdisablecallbacks.patch.1
@@ -1,4 +1,4 @@
-From f93d90efc69dfd8471f446e583eaa77e4a8cde48 Mon Sep 17 00:00:00 2001
+From 7904a285f91af7e33e73ffa36c2f0a77030fd822 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:09:10 +0100
Subject: [PATCH] xmlsec1-nssdisablecallbacks.patch
@@ -10,7 +10,7 @@ Conflicts:
1 file changed, 20 insertions(+)
diff --git a/src/nss/crypto.c b/src/nss/crypto.c
-index 7137f1c..7a59575 100644
+index ea79519..473429f 100644
--- a/src/nss/crypto.c
+++ b/src/nss/crypto.c
@@ -214,6 +214,7 @@ xmlSecCryptoGetFunctions_nss(void) {
@@ -48,5 +48,5 @@ index 7137f1c..7a59575 100644
return(gXmlSecNssFunctions);
}
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-nssmangleciphers.patch.1 b/external/libxmlsec/xmlsec1-nssmangleciphers.patch.1
index 30f5eca67a60..d3bb506cebcf 100644
--- a/external/libxmlsec/xmlsec1-nssmangleciphers.patch.1
+++ b/external/libxmlsec/xmlsec1-nssmangleciphers.patch.1
@@ -1,4 +1,4 @@
-From d1d8d2e18825756d7b21b26c8e74e331e38c66ff Mon Sep 17 00:00:00 2001
+From e91666c3d84ca8e945f0a8f408365496cfba0a22 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:09:39 +0100
Subject: [PATCH] xmlsec1-nssmangleciphers.patch
@@ -10,7 +10,7 @@ Conflicts:
1 file changed, 480 insertions(+), 379 deletions(-)
diff --git a/src/nss/ciphers.c b/src/nss/ciphers.c
-index 54bd2af..03af759 100644
+index cf67936..c063c04 100644
--- a/src/nss/ciphers.c
+++ b/src/nss/ciphers.c
@@ -11,180 +11,422 @@
@@ -1141,5 +1141,5 @@ index 54bd2af..03af759 100644
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-oldlibtool.patch.1 b/external/libxmlsec/xmlsec1-oldlibtool.patch.1
index 5ad5fbb86149..712037a42f25 100644
--- a/external/libxmlsec/xmlsec1-oldlibtool.patch.1
+++ b/external/libxmlsec/xmlsec1-oldlibtool.patch.1
@@ -1,161 +1,344 @@
-From 1cf12e1a9c59c46bef9b23aed92c9a27e4305c34 Mon Sep 17 00:00:00 2001
+From 1c4ec7d796c711aade9806ad857932a60d03e4a4 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:08:09 +0100
Subject: [PATCH] xmlsec1-oldlibtool.patch
+Conflicts:
+ compile
---
- compile | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 142 insertions(+)
- create mode 100644 compile
+ compile | 245 ++++++----------------------------------------------------------
+ 1 file changed, 20 insertions(+), 225 deletions(-)
diff --git a/compile b/compile
-new file mode 100644
-index 0000000..1b1d232
---- /dev/null
+index a85b723..1b1d232 100755
+--- a/compile
+++ b/compile
-@@ -0,0 +1,142 @@
-+#! /bin/sh
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+-# Wrapper for compilers which do not understand '-c -o'.
+# Wrapper for compilers which do not understand `-c -o'.
-+
+
+-scriptversion=2012-10-14.11; # UTC
+scriptversion=2005-05-14.22
-+
+
+-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
-+# Written by Tom Tromey <tromey@cygnus.com>.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2, or (at your option)
-+# any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
+ # Written by Tom Tromey <tromey@cygnus.com>.
+ #
+ # This program is free software; you can redistribute it and/or modify
+@@ -17,7 +17,8 @@ scriptversion=2012-10-14.11; # UTC
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+
-+# As a special exception to the GNU General Public License, if you
-+# distribute this file as part of a program that contains a
-+# configuration script generated by Autoconf, you may include it under
-+# the same distribution terms that you use for the rest of that program.
-+
-+# This file is maintained in Automake, please report
-+# bugs to <bug-automake@gnu.org> or send patches to
-+# <automake-patches@gnu.org>.
-+
-+case $1 in
-+ '')
+
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -28,224 +29,21 @@ scriptversion=2012-10-14.11; # UTC
+ # bugs to <bug-automake@gnu.org> or send patches to
+ # <automake-patches@gnu.org>.
+
+-nl='
+-'
+-
+-# We need space, tab and new line, in precisely that order. Quoting is
+-# there to prevent tools from complaining about whitespace usage.
+-IFS=" "" $nl"
+-
+-file_conv=
+-
+-# func_file_conv build_file lazy
+-# Convert a $build file to $host form and store it in $file
+-# Currently only supports Windows hosts. If the determined conversion
+-# type is listed in (the comma separated) LAZY, no conversion will
+-# take place.
+-func_file_conv ()
+-{
+- file=$1
+- case $file in
+- / | /[!/]*) # absolute file, and not a UNC file
+- if test -z "$file_conv"; then
+- # lazily determine how to convert abs files
+- case `uname -s` in
+- MINGW*)
+- file_conv=mingw
+- ;;
+- CYGWIN*)
+- file_conv=cygwin
+- ;;
+- *)
+- file_conv=wine
+- ;;
+- esac
+- fi
+- case $file_conv/,$2, in
+- *,$file_conv,*)
+- ;;
+- mingw/*)
+- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+- ;;
+- cygwin/*)
+- file=`cygpath -m "$file" || echo "$file"`
+- ;;
+- wine/*)
+- file=`winepath -w "$file" || echo "$file"`
+- ;;
+- esac
+- ;;
+- esac
+-}
+-
+-# func_cl_dashL linkdir
+-# Make cl look for libraries in LINKDIR
+-func_cl_dashL ()
+-{
+- func_file_conv "$1"
+- if test -z "$lib_path"; then
+- lib_path=$file
+- else
+- lib_path="$lib_path;$file"
+- fi
+- linker_opts="$linker_opts -LIBPATH:$file"
+-}
+-
+-# func_cl_dashl library
+-# Do a library search-path lookup for cl
+-func_cl_dashl ()
+-{
+- lib=$1
+- found=no
+- save_IFS=$IFS
+- IFS=';'
+- for dir in $lib_path $LIB
+- do
+- IFS=$save_IFS
+- if $shared && test -f "$dir/$lib.dll.lib"; then
+- found=yes
+- lib=$dir/$lib.dll.lib
+- break
+- fi
+- if test -f "$dir/$lib.lib"; then
+- found=yes
+- lib=$dir/$lib.lib
+- break
+- fi
+- if test -f "$dir/lib$lib.a"; then
+- found=yes
+- lib=$dir/lib$lib.a
+- break
+- fi
+- done
+- IFS=$save_IFS
+-
+- if test "$found" != yes; then
+- lib=$lib.lib
+- fi
+-}
+-
+-# func_cl_wrapper cl arg...
+-# Adjust compile command to suit cl
+-func_cl_wrapper ()
+-{
+- # Assume a capable shell
+- lib_path=
+- shared=:
+- linker_opts=
+- for arg
+- do
+- if test -n "$eat"; then
+- eat=
+- else
+- case $1 in
+- -o)
+- # configure might choose to run compile as 'compile cc -o foo foo.c'.
+- eat=1
+- case $2 in
+- *.o | *.[oO][bB][jJ])
+- func_file_conv "$2"
+- set x "$@" -Fo"$file"
+- shift
+- ;;
+- *)
+- func_file_conv "$2"
+- set x "$@" -Fe"$file"
+- shift
+- ;;
+- esac
+- ;;
+- -I)
+- eat=1
+- func_file_conv "$2" mingw
+- set x "$@" -I"$file"
+- shift
+- ;;
+- -I*)
+- func_file_conv "${1#-I}" mingw
+- set x "$@" -I"$file"
+- shift
+- ;;
+- -l)
+- eat=1
+- func_cl_dashl "$2"
+- set x "$@" "$lib"
+- shift
+- ;;
+- -l*)
+- func_cl_dashl "${1#-l}"
+- set x "$@" "$lib"
+- shift
+- ;;
+- -L)
+- eat=1
+- func_cl_dashL "$2"
+- ;;
+- -L*)
+- func_cl_dashL "${1#-L}"
+- ;;
+- -static)
+- shared=false
+- ;;
+- -Wl,*)
+- arg=${1#-Wl,}
+- save_ifs="$IFS"; IFS=','
+- for flag in $arg; do
+- IFS="$save_ifs"
+- linker_opts="$linker_opts $flag"
+- done
+- IFS="$save_ifs"
+- ;;
+- -Xlinker)
+- eat=1
+- linker_opts="$linker_opts $2"
+- ;;
+- -*)
+- set x "$@" "$1"
+- shift
+- ;;
+- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+- func_file_conv "$1"
+- set x "$@" -Tp"$file"
+- shift
+- ;;
+- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+- func_file_conv "$1" mingw
+- set x "$@" "$file"
+- shift
+- ;;
+- *)
+- set x "$@" "$1"
+- shift
+- ;;
+- esac
+- fi
+- shift
+- done
+- if test -n "$linker_opts"; then
+- linker_opts="-link$linker_opts"
+- fi
+- exec "$@" $linker_opts
+- exit 1
+-}
+-
+-eat=
+-
+ case $1 in
+ '')
+- echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
-+ exit 1;
-+ ;;
-+ -h | --h*)
-+ cat <<\EOF
-+Usage: compile [--help] [--version] PROGRAM [ARGS]
-+
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+ Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+-Wrapper for compilers which do not understand '-c -o'.
+-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
-+arguments, and rename the output as expected.
-+
-+If you are trying to build a whole package this is not the
+ arguments, and rename the output as expected.
+
+ If you are trying to build a whole package this is not the
+-right script to run: please start by reading the file 'INSTALL'.
+right script to run: please start by reading the file `INSTALL'.
-+
-+Report bugs to <bug-automake@gnu.org>.
-+EOF
-+ exit $?
-+ ;;
-+ -v | --v*)
-+ echo "compile $scriptversion"
-+ exit $?
-+ ;;
-+esac
-+
-+ofile=
-+cfile=
+
+ Report bugs to <bug-automake@gnu.org>.
+ EOF
+@@ -255,13 +53,11 @@ EOF
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+- func_cl_wrapper "$@" # Doesn't return...
+- ;;
+ esac
+
+ ofile=
+ cfile=
+eat=
-+
-+for arg
-+do
-+ if test -n "$eat"; then
-+ eat=
-+ else
-+ case $1 in
-+ -o)
+
+ for arg
+ do
+@@ -270,8 +66,8 @@ do
+ else
+ case $1 in
+ -o)
+- # configure might choose to run compile as 'compile cc -o foo foo.c'.
+- # So we strip '-o arg' only if arg is an object.
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
-+ eat=1
-+ case $2 in
-+ *.o | *.obj)
-+ ofile=$2
-+ ;;
-+ *)
-+ set x "$@" -o "$2"
-+ shift
-+ ;;
-+ esac
-+ ;;
-+ *.c)
-+ cfile=$1
-+ set x "$@" "$1"
-+ shift
-+ ;;
-+ *)
-+ set x "$@" "$1"
-+ shift
-+ ;;
-+ esac
-+ fi
-+ shift
-+done
-+
-+if test -z "$ofile" || test -z "$cfile"; then
+ eat=1
+ case $2 in
+ *.o | *.obj)
+@@ -298,22 +94,22 @@ do
+ done
+
+ if test -z "$ofile" || test -z "$cfile"; then
+- # If no '-o' option was seen then we might have been invoked from a
+ # If no `-o' option was seen then we might have been invoked from a
-+ # pattern rule where we don't need one. That is ok -- this is a
-+ # normal compilation that the losing compiler can handle. If no
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+- # '.c' file was seen then we are probably linking. That is also
+ # `.c' file was seen then we are probably linking. That is also
-+ # ok.
-+ exec "$@"
-+fi
-+
-+# Name of file we expect compiler to create.
+ # ok.
+ exec "$@"
+ fi
+
+ # Name of file we expect compiler to create.
+-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
-+
-+# Create the lock directory.
+
+ # Create the lock directory.
+-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# Note: use `[/.-]' here to ensure that we don't use the same name
-+# that we are using for the .o file. Also, base the name on the expected
-+# object file name, since that is what matters with a parallel build.
+ # that we are using for the .o file. Also, base the name on the expected
+ # object file name, since that is what matters with a parallel build.
+-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
-+while true; do
-+ if mkdir "$lockdir" >/dev/null 2>&1; then
-+ break
-+ fi
-+ sleep 1
-+done
-+# FIXME: race condition here if user kills between mkdir and trap.
-+trap "rmdir '$lockdir'; exit 1" 1 2 15
-+
-+# Run the compile.
-+"$@"
-+ret=$?
-+
-+if test -f "$cofile"; then
+ while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+@@ -328,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15
+ ret=$?
+
+ if test -f "$cofile"; then
+- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+ mv "$cofile" "$ofile"
-+elif test -f "${cofile}bj"; then
+ elif test -f "${cofile}bj"; then
+- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+ mv "${cofile}bj" "$ofile"
-+fi
-+
-+rmdir "$lockdir"
-+exit $ret
-+
-+# Local Variables:
-+# mode: shell-script
-+# sh-indentation: 2
-+# eval: (add-hook 'write-file-hooks 'time-stamp)
-+# time-stamp-start: "scriptversion="
-+# time-stamp-format: "%:y-%02m-%02d.%02H"
+ fi
+
+ rmdir "$lockdir"
+@@ -342,6 +138,5 @@ exit $ret
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
+ # time-stamp-start: "scriptversion="
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
+-# time-stamp-time-zone: "UTC"
+-# time-stamp-end: "; # UTC"
+# time-stamp-end: "$"
-+# End:
+ # End:
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-ooxml.patch.1 b/external/libxmlsec/xmlsec1-ooxml.patch.1
deleted file mode 100644
index 81d250f8e765..000000000000
--- a/external/libxmlsec/xmlsec1-ooxml.patch.1
+++ /dev/null
@@ -1,790 +0,0 @@
-From c0a2ea2b84e6dc954125ea6f2f57e9ddc29a3d5a Mon Sep 17 00:00:00 2001
-From: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Sun, 14 Feb 2016 22:12:57 +0100
-Subject: [PATCH] Implement OOXML Relationships Transform Algorithm
-
-Reference: ISO/IEC 29500-2:2012(E), section 13.2.4.24
----
- include/xmlsec/strings.h | 12 +
- include/xmlsec/transforms.h | 9 +
- src/strings.c | 12 +
- src/transforms.c | 10 +
- src/xpath.c | 671 ++++++++++++++++++++++++++++++++++++++++++++
- 5 files changed, 714 insertions(+)
-
-diff --git a/include/xmlsec/strings.h b/include/xmlsec/strings.h
-index 5e3f6a1..5a92014 100644
---- a/include/xmlsec/strings.h
-+++ b/include/xmlsec/strings.h
-@@ -590,6 +590,18 @@ XMLSEC_EXPORT_VAR const xmlChar xmlSecNodeXPointer[];
-
- /*************************************************************************
- *
-+ * RelationshipTransform strings
-+ *
-+ ************************************************************************/
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecNameRelationship[];
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecHrefRelationship[];
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecNodeRelationship[];
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecNodeRelationshipReference[];
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecRelationshipsNs[];
-+XMLSEC_EXPORT_VAR const xmlChar xmlSecRelationshipReferenceNs[];
-+
-+/*************************************************************************
-+ *
- * Xslt strings
- *
- ************************************************************************/
-diff --git a/include/xmlsec/transforms.h b/include/xmlsec/transforms.h
-index f0c70c9..0d876f1 100644
---- a/include/xmlsec/transforms.h
-+++ b/include/xmlsec/transforms.h
-@@ -949,6 +949,15 @@ XMLSEC_EXPORT int xmlSecTransformXPointerSetExpr (xmlSecT
- const xmlChar* expr,
- xmlSecNodeSetType nodeSetType,
- xmlNodePtr hereNode);
-+/**
-+ * xmlSecTransformRelationshipId:
-+ *
-+ * The Relationship transform klass.
-+ */
-+#define xmlSecTransformRelationshipId \
-+ xmlSecTransformRelationshipGetKlass()
-+XMLSEC_EXPORT xmlSecTransformId xmlSecTransformRelationshipGetKlass (void);
-+
- #ifndef XMLSEC_NO_XSLT
- #include <libxslt/security.h>
-
-diff --git a/src/strings.c b/src/strings.c
-index f746f4d..1e8516f 100644
---- a/src/strings.c
-+++ b/src/strings.c
-@@ -581,6 +581,18 @@ const xmlChar xmlSecNodeXPointer[] = "XPointer";
-
- /*************************************************************************
- *
-+ * Relationship strings
-+ *
-+ ************************************************************************/
-+const xmlChar xmlSecNameRelationship[] = "relationship";
-+const xmlChar xmlSecHrefRelationship[] = "http://schemas.openxmlformats.org/package/2006/RelationshipTransform";
-+const xmlChar xmlSecNodeRelationship[] = "Relationship";
-+const xmlChar xmlSecNodeRelationshipReference[] = "RelationshipReference";
-+const xmlChar xmlSecRelationshipsNs[] = "http://schemas.openxmlformats.org/package/2006/relationships";
-+const xmlChar xmlSecRelationshipReferenceNs[] = "http://schemas.openxmlformats.org/package/2006/digital-signature";
-+
-+/*************************************************************************
-+ *
- * Xslt strings
- *
- ************************************************************************/
-diff --git a/src/transforms.c b/src/transforms.c
-index 8a2ded2..8a32629 100644
---- a/src/transforms.c
-+++ b/src/transforms.c
-@@ -281,6 +281,16 @@ xmlSecTransformIdsRegisterDefault(void) {
- return(-1);
- }
-
-+ if(xmlSecTransformIdsRegister(xmlSecTransformRelationshipId) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ NULL,
-+ "xmlSecTransformIdsRegister",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ "name=%s",
-+ xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformRelationshipId)));
-+ return(-1);
-+ }
-+
- #ifndef XMLSEC_NO_XSLT
- if(xmlSecTransformIdsRegister(xmlSecTransformXsltId) < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
-diff --git a/src/xpath.c b/src/xpath.c
-index e67631e..748c9da 100644
---- a/src/xpath.c
-+++ b/src/xpath.c
-@@ -17,6 +17,7 @@
- #include <libxml/xpath.h>
- #include <libxml/xpathInternals.h>
- #include <libxml/xpointer.h>
-+#include <libxml/c14n.h>
-
- #include <xmlsec/xmlsec.h>
- #include <xmlsec/xmltree.h>
-@@ -1163,3 +1164,673 @@ xmlSecTransformVisa3DHackExecute(xmlSecTransformPtr transform, int last,
-
-
-
-+/******************************************************************************
-+ *
-+ * Relationship transform
-+ *
-+ *****************************************************************************/
-+typedef struct _xmlSecRelationshipCtx xmlSecRelationshipCtx,
-+ *xmlSecRelationshipCtxPtr;
-+struct _xmlSecRelationshipCtx {
-+ xmlSecPtrListPtr sourceIdList;
-+};
-+#define xmlSecRelationshipSize \
-+ (sizeof(xmlSecTransform) + sizeof(xmlSecRelationshipCtx))
-+#define xmlSecRelationshipGetCtx(transform) \
-+ ((xmlSecRelationshipCtxPtr)(((xmlSecByte*)(transform)) + sizeof(xmlSecTransform)))
-+
-+static int xmlSecRelationshipInitialize (xmlSecTransformPtr transform);
-+static void xmlSecRelationshipFinalize (xmlSecTransformPtr transform);
-+static int xmlSecTransformRelationshipPopBin (xmlSecTransformPtr transform,
-+ xmlSecByte* data,
-+ xmlSecSize maxDataSize,
-+ xmlSecSize* dataSize,
-+ xmlSecTransformCtxPtr transformCtx);
-+static int xmlSecTransformRelationshipPushXml(xmlSecTransformPtr transform,
-+ xmlSecNodeSetPtr nodes,
-+ xmlSecTransformCtxPtr transformCtx);
-+static int xmlSecRelationshipReadNode (xmlSecTransformPtr transform,
-+ xmlNodePtr node,
-+ xmlSecTransformCtxPtr transformCtx);
-+
-+static xmlSecTransformKlass xmlSecRelationshipKlass = {
-+ /* klass/object sizes */
-+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
-+ xmlSecRelationshipSize, /* xmlSecSize objSize */
-+
-+ xmlSecNameRelationship, /* const xmlChar* name; */
-+ xmlSecHrefRelationship, /* const xmlChar* href; */
-+ xmlSecTransformUsageDSigTransform, /* xmlSecTransformUsage usage; */
-+
-+ xmlSecRelationshipInitialize, /* xmlSecTransformInitializeMethod initialize; */
-+ xmlSecRelationshipFinalize, /* xmlSecTransformFinalizeMethod finalize; */
-+ xmlSecRelationshipReadNode, /* xmlSecTransformNodeReadMethod readNode; */
-+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
-+ NULL, /* xmlSecTransformSetKeyReqMethod setKeyReq; */
-+ NULL, /* xmlSecTransformSetKeyMethod setKey; */
-+ NULL, /* xmlSecTransformValidateMethod validate; */
-+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
-+ NULL, /* xmlSecTransformPushBinMethod pushBin; */
-+ xmlSecTransformRelationshipPopBin, /* xmlSecTransformPopBinMethod popBin; */
-+ xmlSecTransformRelationshipPushXml, /* xmlSecTransformPushXmlMethod pushXml; */
-+ NULL, /* xmlSecTransformPopXmlMethod popXml; */
-+ NULL, /* xmlSecTransformExecuteMethod execute; */
-+
-+ NULL, /* void* reserved0; */
-+ NULL, /* void* reserved1; */
-+};
-+
-+xmlSecTransformId
-+xmlSecTransformRelationshipGetKlass(void) {
-+ return(&xmlSecRelationshipKlass);
-+}
-+
-+static int
-+xmlSecRelationshipInitialize(xmlSecTransformPtr transform) {
-+ xmlSecRelationshipCtxPtr ctx;
-+ int ret;
-+
-+ xmlSecAssert2(xmlSecTransformCheckId(transform, xmlSecTransformRelationshipId), -1);
-+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecRelationshipSize), -1);
-+
-+ ctx = xmlSecRelationshipGetCtx(transform);
-+ xmlSecAssert2(ctx != NULL, -1);
-+
-+ /* initialize context */
-+ memset(ctx, 0, sizeof(xmlSecRelationshipCtx));
-+
-+ ctx->sourceIdList = xmlSecPtrListCreate(xmlSecStringListId);
-+ if(ctx->sourceIdList == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecPtrListCreate",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ return(0);
-+}
-+
-+static void
-+xmlSecRelationshipFinalize(xmlSecTransformPtr transform) {
-+ xmlSecRelationshipCtxPtr ctx;
-+
-+ xmlSecAssert(xmlSecTransformCheckId(transform, xmlSecTransformRelationshipId));
-+ xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecRelationshipSize));
-+
-+ ctx = xmlSecRelationshipGetCtx(transform);
-+ xmlSecAssert(ctx != NULL);
-+
-+ if(ctx->sourceIdList != NULL) {
-+ xmlSecPtrListDestroy(ctx->sourceIdList);
-+ }
-+
-+ memset(ctx, 0, sizeof(xmlSecRelationshipCtx));
-+}
-+
-+static int
-+xmlSecRelationshipReadNode(xmlSecTransformPtr transform, xmlNodePtr node, xmlSecTransformCtxPtr transformCtx) {
-+ xmlSecRelationshipCtxPtr ctx;
-+ xmlNodePtr cur;
-+ int ret;
-+
-+ xmlSecAssert2(xmlSecTransformCheckId(transform, xmlSecTransformRelationshipId), -1);
-+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecRelationshipSize), -1);
-+ xmlSecAssert2(node != NULL, -1);
-+ xmlSecAssert2(transformCtx != NULL, -1);
-+ ctx = xmlSecRelationshipGetCtx(transform);
-+ xmlSecAssert2(ctx != NULL, -1);
-+
-+ cur = node->children;
-+ while(cur != NULL) {
-+ if(xmlSecCheckNodeName(cur, xmlSecNodeRelationshipReference, xmlSecRelationshipReferenceNs)) {
-+ xmlChar* sourceId;
-+ xmlChar* tmp;
-+
-+ sourceId = xmlGetProp(cur, "SourceId");
-+ if(sourceId == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ "xmlGetProp",
-+ xmlSecErrorsSafeString("SourceId"),
-+ XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE,
-+ "node=%s",
-+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)));
-+ return(-1);
-+ }
-+
-+ tmp = xmlStrdup(sourceId);
-+ if(tmp == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlStrdup",
-+ XMLSEC_ERRORS_R_STRDUP_FAILED,
-+ "len=%d", xmlStrlen(sourceId));
-+ return(-1);
-+ }
-+
-+ ret = xmlSecPtrListAdd(ctx->sourceIdList, tmp);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecPtrListAdd",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ xmlFree(tmp);
-+ return(-1);
-+ }
-+ }
-+
-+ cur = cur->next;
-+ }
-+
-+ return(0);
-+}
-+
-+/* Sorts Relationship elements by Id value in lexicographical order. */
-+static int
-+xmlSecTransformRelationshipCompare(xmlNodePtr node1, xmlNodePtr node2) {
-+ xmlChar* id1;
-+ xmlChar* id2;
-+
-+ if(node1 == node2) {
-+ return(0);
-+ }
-+ if(node1 == NULL) {
-+ return(-1);
-+ }
-+ if(node2 == NULL) {
-+ return(1);
-+ }
-+
-+ id1 = xmlGetProp(node1, "Id");
-+ id2 = xmlGetProp(node2, "Id");
-+
-+ if(id1 == NULL) {
-+ return(-1);
-+ }
-+
-+ if(id2 == NULL) {
-+ return(1);
-+ }
-+
-+ return(xmlStrcmp(id1, id2));
-+}
-+
-+static int
-+xmlSecTransformRelationshipProcessElementNode(xmlSecTransformPtr transform, xmlOutputBufferPtr buf, xmlNodePtr cur);
-+
-+static int
-+xmlSecTransformRelationshipProcessNode(xmlSecTransformPtr transform, xmlOutputBufferPtr buf, xmlNodePtr cur) {
-+ int ret;
-+
-+ if(xmlSecCheckNodeName(cur, xmlSecNodeRelationship, xmlSecRelationshipsNs)) {
-+ xmlChar* id = xmlGetProp(cur, "Id");
-+ if(id == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlGetProp",
-+ XMLSEC_ERRORS_R_XML_FAILED,
-+ "name=Id");
-+ return(-1);
-+ }
-+
-+ int i;
-+ int found = -1;
-+ xmlSecRelationshipCtxPtr ctx;
-+
-+ ctx = xmlSecRelationshipGetCtx(transform);
-+ for(i = 0; i < xmlSecPtrListGetSize(ctx->sourceIdList); ++i) {
-+ if(xmlStrcmp(xmlSecPtrListGetItem(ctx->sourceIdList, i), id) == 0) {
-+ found = 1;
-+ break;
-+ }
-+ }
-+
-+ if(found < 0) {
-+ return(0);
-+ }
-+ }
-+
-+ ret = xmlSecTransformRelationshipProcessElementNode(transform, buf, cur);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformRelationshipProcessElementNode",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ return(0);
-+}
-+
-+static int
-+xmlSecTransformRelationshipProcessNodeList(xmlSecTransformPtr transform, xmlOutputBufferPtr buf, xmlNodePtr cur) {
-+ xmlListPtr list;
-+ int ret;
-+
-+ list = xmlListCreate(NULL, (xmlListDataCompare)xmlSecTransformRelationshipCompare);
-+ if(list == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlListCreate",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ for(; cur; cur = cur->next) {
-+ if(xmlStrcmp(cur->name, xmlSecNodeRelationship) == 0) {
-+ if(xmlListInsert(list, cur) != 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlListInsert",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ } else {
-+ ret = xmlSecTransformRelationshipProcessNode(transform, buf, cur);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformRelationshipProcessNode",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ xmlListDelete(list);
-+ return(-1);
-+ }
-+ }
-+ }
-+
-+ if(!xmlListEmpty(list)) {
-+ int size;
-+ int i;
-+
-+ xmlListSort(list);
-+ size = xmlListSize(list);
-+ for(i = 0; i < size; ++i) {
-+ xmlLinkPtr link = xmlListFront(list);
-+ xmlNodePtr node = (xmlNodePtr)xmlLinkGetData(link);
-+
-+ ret = xmlSecTransformRelationshipProcessNode(transform, buf, node);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformRelationshipProcessNode",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ xmlListDelete(list);
-+ return(-1);
-+ }
-+
-+ xmlListPopFront(list);
-+ }
-+ }
-+
-+ xmlListDelete(list);
-+ return(0);
-+}
-+
-+static int
-+xmlSecTransformRelationshipProcessElementNode(xmlSecTransformPtr transform, xmlOutputBufferPtr buf, xmlNodePtr cur) {
-+ xmlAttrPtr attr;
-+ int foundTargetMode = 0;
-+
-+ if(xmlOutputBufferWriteString(buf, "<") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, (const char *)cur->name) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ if(cur->nsDef != NULL) {
-+ if(xmlOutputBufferWriteString(buf, " xmlns=\"") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(cur->nsDef->href != NULL) {
-+ if(xmlOutputBufferWriteString(buf, cur->nsDef->href) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+ if(xmlOutputBufferWriteString(buf, "\"") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ for(attr = cur->properties; attr; attr = attr->next) {
-+ if(xmlOutputBufferWriteString(buf, " ") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, (const char *)attr->name) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlStrcmp(attr->name, "TargetMode") == 0) {
-+ foundTargetMode = 1;
-+ }
-+ if(xmlOutputBufferWriteString(buf, "=\"") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, (const char *)xmlGetProp(cur, attr->name)) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, "\"") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ if(xmlStrcmp(cur->name, xmlSecNodeRelationship) == 0 && !foundTargetMode) {
-+ if(xmlOutputBufferWriteString(buf, " TargetMode=\"Internal\"") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ if(xmlOutputBufferWriteString(buf, ">") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ if(cur->children != NULL) {
-+ int ret = xmlSecTransformRelationshipProcessNodeList(transform, buf, cur->children);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformRelationshipProcessNodeList",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ if(xmlOutputBufferWriteString(buf, "</") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, (const char *)cur->name) < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ if(xmlOutputBufferWriteString(buf, ">") < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferWriteString",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ return(0);
-+}
-+
-+static int
-+xmlSecTransformRelationshipExecute(xmlSecTransformPtr transform, xmlOutputBufferPtr buf, xmlDocPtr doc) {
-+ if(doc->children != NULL) {
-+ int ret = xmlSecTransformRelationshipProcessNodeList(transform, buf, doc->children);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformRelationshipProcessNodeList",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ return(0);
-+}
-+
-+static int
-+xmlSecTransformRelationshipPushXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr nodes, xmlSecTransformCtxPtr transformCtx)
-+{
-+ xmlOutputBufferPtr buf;
-+ xmlSecRelationshipCtxPtr ctx;
-+ int ret;
-+
-+ xmlSecAssert2(nodes != NULL, -1);
-+ xmlSecAssert2(nodes->doc != NULL, -1);
-+ xmlSecAssert2(transformCtx != NULL, -1);
-+
-+ ctx = xmlSecRelationshipGetCtx(transform);
-+ xmlSecAssert2(ctx != NULL, -1);
-+
-+ /* check/update current transform status */
-+ switch(transform->status) {
-+ case xmlSecTransformStatusNone:
-+ transform->status = xmlSecTransformStatusWorking;
-+ break;
-+ case xmlSecTransformStatusWorking:
-+ case xmlSecTransformStatusFinished:
-+ return(0);
-+ default:
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ NULL,
-+ XMLSEC_ERRORS_R_INVALID_STATUS,
-+ "status=%d", transform->status);
-+ return(-1);
-+ }
-+ xmlSecAssert2(transform->status == xmlSecTransformStatusWorking, -1);
-+
-+ /* prepare output buffer: next transform or ourselves */
-+ if(transform->next != NULL) {
-+ buf = xmlSecTransformCreateOutputBuffer(transform->next, transformCtx);
-+ if(buf == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformCreateOutputBuffer",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ } else {
-+ buf = xmlSecBufferCreateOutputBuffer(&(transform->outBuf));
-+ if(buf == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecBufferCreateOutputBuffer",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ }
-+
-+ ret = xmlSecTransformRelationshipExecute(transform, buf, nodes->doc);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlC14NExecute",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ xmlOutputBufferClose(buf);
-+ return(-1);
-+ }
-+
-+ ret = xmlOutputBufferClose(buf);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferClose",
-+ XMLSEC_ERRORS_R_XML_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ transform->status = xmlSecTransformStatusFinished;
-+ return(0);
-+}
-+
-+static int
-+xmlSecTransformRelationshipPopBin(xmlSecTransformPtr transform, xmlSecByte* data, xmlSecSize maxDataSize, xmlSecSize* dataSize, xmlSecTransformCtxPtr transformCtx) {
-+ xmlSecBufferPtr out;
-+ int ret;
-+
-+ xmlSecAssert2(data != NULL, -1);
-+ xmlSecAssert2(dataSize != NULL, -1);
-+ xmlSecAssert2(transformCtx != NULL, -1);
-+
-+ out = &(transform->outBuf);
-+ if(transform->status == xmlSecTransformStatusNone) {
-+ xmlOutputBufferPtr buf;
-+
-+ xmlSecAssert2(transform->inNodes == NULL, -1);
-+
-+ if(transform->prev == NULL) {
-+ (*dataSize) = 0;
-+ transform->status = xmlSecTransformStatusFinished;
-+ return(0);
-+ }
-+
-+ /* get xml data from previous transform */
-+ ret = xmlSecTransformPopXml(transform->prev, &(transform->inNodes), transformCtx);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformPopXml",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ /* dump everything to internal buffer */
-+ buf = xmlSecBufferCreateOutputBuffer(out);
-+ if(buf == NULL) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecBufferCreateOutputBuffer",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+
-+ ret = xmlC14NExecute(transform->inNodes->doc, (xmlC14NIsVisibleCallback)xmlSecNodeSetContains, transform->inNodes, XML_C14N_1_0, NULL, 0, buf);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecTransformC14NExecute",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ xmlOutputBufferClose(buf);
-+ return(-1);
-+ }
-+
-+ ret = xmlOutputBufferClose(buf);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlOutputBufferClose",
-+ XMLSEC_ERRORS_R_XML_FAILED,
-+ XMLSEC_ERRORS_NO_MESSAGE);
-+ return(-1);
-+ }
-+ transform->status = xmlSecTransformStatusWorking;
-+ }
-+
-+ if(transform->status == xmlSecTransformStatusWorking) {
-+ xmlSecSize outSize;
-+
-+ /* return chunk after chunk */
-+ outSize = xmlSecBufferGetSize(out);
-+ if(outSize > maxDataSize) {
-+ outSize = maxDataSize;
-+ }
-+ if(outSize > XMLSEC_TRANSFORM_BINARY_CHUNK) {
-+ outSize = XMLSEC_TRANSFORM_BINARY_CHUNK;
-+ }
-+ if(outSize > 0) {
-+ xmlSecAssert2(xmlSecBufferGetData(&(transform->outBuf)), -1);
-+
-+ memcpy(data, xmlSecBufferGetData(&(transform->outBuf)), outSize);
-+ ret = xmlSecBufferRemoveHead(&(transform->outBuf), outSize);
-+ if(ret < 0) {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ "xmlSecBufferRemoveHead",
-+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
-+ "size=%d", outSize);
-+ return(-1);
-+ }
-+ } else if(xmlSecBufferGetSize(out) == 0) {
-+ transform->status = xmlSecTransformStatusFinished;
-+ }
-+ (*dataSize) = outSize;
-+ } else if(transform->status == xmlSecTransformStatusFinished) {
-+ /* the only way we can get here is if there is no output */
-+ xmlSecAssert2(xmlSecBufferGetSize(out) == 0, -1);
-+ (*dataSize) = 0;
-+ } else {
-+ xmlSecError(XMLSEC_ERRORS_HERE,
-+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
-+ NULL,
-+ XMLSEC_ERRORS_R_INVALID_STATUS,
-+ "status=%d", transform->status);
-+ return(-1);
-+ }
-+
-+ return(0);
-+}
---
-2.6.6
-
diff --git a/external/libxmlsec/xmlsec1-vc.patch.1 b/external/libxmlsec/xmlsec1-vc.patch.1
index 8c249e80c89b..9e40c5de5be2 100644
--- a/external/libxmlsec/xmlsec1-vc.patch.1
+++ b/external/libxmlsec/xmlsec1-vc.patch.1
@@ -1,20 +1,17 @@
-From 56448979392d78a6e1688f61ce7bc771f38a880b Mon Sep 17 00:00:00 2001
+From 8586bb027cde6713a9048472917c75095e186643 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:12:29 +0100
Subject: [PATCH] xmlsec1-vc.patch
---
- apps/cmdline.c | 2 +-
- apps/crypto.c | 2 +-
- apps/xmlsec.c | 2 +-
win32/Makefile.msvc | 10 +++++++++-
- 4 files changed, 12 insertions(+), 4 deletions(-)
+ 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
-index d833497..065595b 100644
+index 30b9dfb..51c53a7 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
-@@ -311,6 +311,10 @@ CFLAGS = $(CFLAGS) /D PACKAGE=\"$(XMLSEC_NAME)\"
+@@ -309,6 +309,10 @@ CFLAGS = $(CFLAGS) /D PACKAGE=\"$(XMLSEC_NAME)\"
CFLAGS = $(CFLAGS) /D "HAVE_STDIO_H" /D "HAVE_STDLIB_H"
CFLAGS = $(CFLAGS) /D "HAVE_STRING_H" /D "HAVE_CTYPE_H"
CFLAGS = $(CFLAGS) /D "HAVE_MALLOC_H" /D "HAVE_MEMORY_H"
@@ -25,7 +22,16 @@ index d833497..065595b 100644
!if "$(UNICODE)" == "1"
CFLAGS = $(CFLAGS) /D "UNICODE" /D "_UNICODE"
-@@ -365,7 +369,11 @@ LIBS =
+@@ -332,7 +332,7 @@ CFLAGS = $(CFLAGS) /DXMLSEC_MSCRYPTO_NT4=1
+ !else
+ !endif
+
+-APP_CFLAGS = /D "XMLSEC_DEFAULT_CRYPTO=\"$(XMLSEC_DEFAULT_CRYPTO)\""
++CFLAGS = $(CFLAGS) /D "XMLSEC_DEFAULT_CRYPTO=\"$(XMLSEC_DEFAULT_CRYPTO)\""
+ !if "$(WITH_DL)" == "1"
+ CFLAGS = $(CFLAGS) /D "XMLSEC_DL_WIN32"
+ APP_CFLAGS = $(APP_CFLAGS) /D "XMLSEC_CRYPTO_DYNAMIC_LOADING"
+@@ -363,7 +367,11 @@ LIBS =
!if "$(DEBUG)" == "1"
LDFLAGS = $(LDFLAGS) /DEBUG
!else
@@ -39,5 +45,5 @@ index d833497..065595b 100644
SOLIBS = $(LIBS) libxml2.lib
--
-2.6.2
+2.6.6
diff --git a/external/libxmlsec/xmlsec1-vs2015.patch.1 b/external/libxmlsec/xmlsec1-vs2015.patch.1
deleted file mode 100644
index 53eacc053d36..000000000000
--- a/external/libxmlsec/xmlsec1-vs2015.patch.1
+++ /dev/null
@@ -1,46 +0,0 @@
-From 56448979392d78a6e1688f61ce7bc771f38a880b Mon Sep 17 00:00:00 2001
-From: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Fri, 4 Mar 2016 16:12:29 +0100
-Subject: [PATCH] xmlsec1-vs2015.patch
-
----
-
-diff --git a/apps/cmdline.c b/apps/cmdline.c
-index b9ecafb..4425eaf 100644
---- a/apps/cmdline.c
-+++ b/apps/cmdline.c
-@@ -7,7 +7,7 @@
- *
- * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
- */
--#if defined(_MSC_VER)
-+#if defined(_MSC_VER) && _MSC_VER < 1900
- #define snprintf _snprintf
- #endif
-
-diff --git a/apps/crypto.c b/apps/crypto.c
-index 49dd127..f46eeee 100644
---- a/apps/crypto.c
-+++ b/apps/crypto.c
-@@ -7,7 +7,7 @@
- *
- * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
- */
--#if defined(_MSC_VER)
-+#if defined(_MSC_VER) && _MSC_VER < 1900
- #define snprintf _snprintf
- #endif
-
-diff --git a/apps/xmlsec.c b/apps/xmlsec.c
-index d551b5a..0467c25 100644
---- a/apps/xmlsec.c
-+++ b/apps/xmlsec.c
-@@ -9,7 +9,7 @@
- #include <string.h>
- #include <time.h>
-
--#if defined(_MSC_VER)
-+#if defined(_MSC_VER) && _MSC_VER < 1900
- #define snprintf _snprintf
- #endif
-