xmlsec1-1.2.28/0000755000175000017500000000000013455402566011636 5ustar renerenexmlsec1-1.2.28/Makefile.am0000644000175000017500000001066513455402476013702 0ustar renereneNULL = SAFE_VERSION = @XMLSEC_VERSION_SAFE@ SUBDIRS = include src if XMLSEC_APPS SUBDIRS += apps endif if XMLSEC_MANS SUBDIRS += man endif if XMLSEC_DOCS SUBDIRS += docs endif TEST_APP = apps/xmlsec1$(EXEEXT) DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@ bin_SCRIPTS = xmlsec1-config pkgconfig_DATA = xmlsec1.pc @XMLSEC_CRYPTO_PC_FILES_LIST@ pkgconfigdir = $(libdir)/pkgconfig confexecdir = $(libdir) confexec_DATA = xmlsec1Conf.sh m4datadir = $(datadir)/aclocal m4data_DATA = xmlsec1.m4 ACLOCAL_AMFLAGS = -I m4 DISTCLEANFILES = \ xmlsec1Conf.sh \ xmlsec1.pc \ xmlsec1-openssl.pc \ xmlsec1-nss.pc \ xmlsec1-gnutls.pc \ xmlsec1-gcrypt.pc \ xmlsec1-config \ xmlsec1.spec \ stamp-h2 \ stamp-h3 \ stamp-h4 \ stamp-h5 \ $NULL EXTRA_DIST = \ m4 \ examples \ scripts \ tests \ win32 \ NEWS \ ChangeLog \ Copyright \ HACKING \ xmlsec-openssl.pc.in \ xmlsec-nss.pc.in\ xmlsec-gnutls.pc.in \ xmlsec-gcrypt.pc.in \ xmlsec-config.in \ xmlsecConf.sh.in \ xmlsec.spec.in \ xmlsec1Conf.sh \ xmlsec1.pc @XMLSEC_CRYPTO_PC_FILES_LIST@ \ xmlsec1-config \ xmlsec1.spec \ xmlsec1.m4 \ $(NULL) EXTRA_CLEAN = \ examples \ $(NULL) ABS_SRCDIR=@abs_srcdir@ ABS_BUILDDIR=@abs_builddir@ if XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING PRECHECK_COMMANDS = \ cd $(ABS_SRCDIR) \ $(NULL) else PRECHECK_COMMANDS= \ export LD_LIBRARY_PATH="$(ABS_BUILDDIR)/src/.libs:$$LD_LIBRARY_PATH" ; \ for i in $(XMLSEC_CRYPTO_LIST) ; do \ export LTDL_LIBRARY_PATH="$(ABS_BUILDDIR)/src/$$i/.libs:$$LTDL_LIBRARY_PATH" ; \ done && \ cd $(ABS_SRCDIR) \ $(NULL) endif CHECK_CRYPTO_LIST = \ $(XMLSEC_CRYPTO_LIST) \ $(NULL) docs: docs-man @(cd docs && $(MAKE) docs) docs-clean: @(cd docs && $(MAKE) clean) docs-man: @(cd man && $(MAKE) docs) check: check-all check-info check-all: $(TEST_APP) for crypto in $(CHECK_CRYPTO_LIST) ; do \ make check-crypto-$$crypto || exit 1 ; \ done check-crypto-%: $(TEST_APP) @($(PRECHECK_COMMANDS) && \ echo "=================== Checking xmlsec-$* =================================" && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testKeys.sh \ $* \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) der \ && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testDSig.sh \ $* \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) \ der \ && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testEnc.sh \ $* \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) \ der \ ; \ ) check-info: @echo "---------------------------- ATTENTION -----------------------------------" @echo "--- Some of the tests use resources located on external HTTP servers. ---" @echo "--- If you have no Internet connection or the external resource is not ---" @echo "--- responding then the test will fail. ---" @echo "---------------------------- ATTENTION -----------------------------------" check-keys: $(TEST_APP) @($(PRECHECK_COMMANDS) && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testKeys.sh \ $(DEFAULT_CRYPTO) \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) \ der \ ) check-dsig: $(TEST_APP) @($(PRECHECK_COMMANDS) && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testDSig.sh \ $(DEFAULT_CRYPTO) \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) \ der \ ) check-enc: $(TEST_APP) @($(PRECHECK_COMMANDS) && \ $(SHELL) ./tests/testrun.sh \ $(ABS_SRCDIR)/tests/testEnc.sh \ $(DEFAULT_CRYPTO) \ $(ABS_SRCDIR)/tests \ $(ABS_BUILDDIR)/$(TEST_APP) \ der \ ) memcheck-res: @grep -i 'ERROR SUMMARY' /tmp/*.log | sed 's/.*==.*== *//' | sort -u @grep -i 'in use at exit' /tmp/*.log | sed 's/.*==.*== *//' | sort -u @grep -i 'definitely lost:' /tmp/*.log | sed 's/.*==.*== *//' | sort -u @grep -i 'indirectly lost:' /tmp/*.log | sed 's/.*==.*== *//' | sort -u @grep -i 'possibly lost:' /tmp/*.log | sed 's/.*==.*== *//' | sort -u @grep -i 'still reachable:' /tmp/*.log | sed 's/.*==.*== *//' | sort -u memcheck: $(TEST_APP) @(export DEBUG_MEMORY=1 && $(MAKE) check && $(MAKE) memcheck-res) perfcheck: $(TEST_APP) @(export PERF_TEST=10 && $(MAKE) check) dist-hook: cleantar: @($(RM) -f xmlsec*.tar.gz COPYING.LIB) tar-release: clean cleantar @(unset CDPATH && $(MAKE) dist) rpm: cleantar tar-release @(unset CDPATH && rpmbuild -ta $(distdir).tar.gz) rpm-release: clean cleantar rpm xmlsec1-1.2.28/xmlsec-gcrypt.pc.in0000644000175000017500000000056113455402476015372 0ustar renereneprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: xmlsec1-gcrypt Version: @VERSION@ Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ Cflags: @XMLSEC_GCRYPT_CFLAGS@ Cflags.private: -DXMLSEC_STATIC Libs: @XMLSEC_GCRYPT_LIBS@ xmlsec1-1.2.28/TODO0000644000175000017500000000005013455402476012321 0ustar renerenehttps://github.com/lsh123/xmlsec/issues xmlsec1-1.2.28/xmlsec1.m40000644000175000017500000001551713455402476013465 0ustar renerene# # Configure paths for xmlsec1 # H. Ronsdorf 2006-02-03 # Adapted from: # dnl AM_PATH_XMLSEC1([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libxmlsec1, and define XMLSEC1_CFLAGS and XMLSEC1_LIBS dnl AC_DEFUN([AM_PATH_XMLSEC1],[ AC_ARG_WITH(xmlsec1-prefix, AC_HELP_STRING( [--with-xmlsec1-prefix=PFX], [Prefix where libxmlsec1 is installed (optional)] ), xmlsec1_config_prefix="$withval", xmlsec1_config_prefix="" ) AC_ARG_WITH(xmlsec1-exec-prefix, AC_HELP_STRING( [--with-xmlsec1-exec-prefix=PFX], [Exec prefix where libxmlsec1 is installed (optional)] ), xmlsec1_config_exec_prefix="$withval", xmlsec1_config_exec_prefix="" ) AC_ARG_ENABLE(xmlsec1test, AC_HELP_STRING( [--disable-xmlsec1test], [Do not try to compile and run a test cSOAP program] ),, enable_xmlsec1test=yes ) if test x$xmlsec1_config_exec_prefix != x ; then xmlsec1_config_args="$xmlsec1_config_args --exec-prefix=$xmlsec1_config_exec_prefix" if test x${XMLSEC1_CONFIG+set} != xset ; then XMLSEC1_CONFIG=$xmlsec1_config_exec_prefix/bin/xmlsec1-config fi fi if test x$xmlsec1_config_prefix != x ; then xmlsec1_config_args="$xmlsec1_config_args --prefix=$xmlsec1_config_prefix" if test x${XMLSEC1_CONFIG+set} != xset ; then XMLSEC1_CONFIG=$xmlsec1_config_prefix/bin/xmlsec1-config fi fi AC_PATH_PROG(XMLSEC1_CONFIG, xmlsec1-config, no) min_xmlsec1_version=ifelse([$1], ,1.0.0,[$1]) AC_MSG_CHECKING(for libxmlsec1 - version >= $min_xmlsec1_version) no_xmlsec1="" if test "$XMLSEC1_CONFIG" = "no" ; then no_xmlsec1=yes else XMLSEC1_CFLAGS=`$XMLSEC1_CONFIG $xmlsec1_config_args --cflags` XMLSEC1_LIBS=`$XMLSEC1_CONFIG $xmlsec1_config_args --libs` xmlsec1_config_major_version=`$XMLSEC1_CONFIG $xmlsec1_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` xmlsec1_config_minor_version=`$XMLSEC1_CONFIG $xmlsec1_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` xmlsec1_config_micro_version=`$XMLSEC1_CONFIG $xmlsec1_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_xmlsec1test" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $XMLSEC1_CFLAGS" LIBS="$XMLSEC1_LIBS $LIBS" dnl dnl Now check if the installed libxmlsec1 is sufficiently new. dnl (Also sanity checks the results of xmlsec1-config to some extent) dnl rm -f conf.xmlsec1test AC_TRY_RUN([ #include #include #include #include #include int main(int argc, char **argv) { int major, minor, micro; char *tmp_version; system("touch conf.xmlsec1test"); /* Capture xmlsec1-config output via autoconf/configure variables */ /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = (char *)strdup("$min_xmlsec1_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string from xmlsec1-config\n", "$min_xmlsec1_version"); exit(1); } free(tmp_version); /* Test that the library is greater than our minimum version */ if (($xmlsec1_config_major_version < major) || (($xmlsec1_config_major_version == major) && ($xmlsec1_config_minor_version < minor)) || (($xmlsec1_config_major_version == major) && ($xmlsec1_config_minor_version == minor) && ($xmlsec1_config_micro_version < micro))) { printf("\n*** An old version of libxmlsec1 (%d.%d.%d) was found.\n", $xmlsec1_config_major_version, $xmlsec1_config_minor_version, $xmlsec1_config_micro_version); printf("*** You need a version of libxmlsec1 newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** libxmlsec1 is always available from http://xmlsec1.sf.net.\n\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xmlsec1-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libxmlsec1, but you can also set the XMLSEC1_CONFIG environment to point to the\n"); printf("*** correct copy of xmlsec1-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); return 1; } else { return 0; } } ],, no_xmlsec1=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xmlsec1" = x ; then AC_MSG_RESULT(yes (version $xmlsec1_config_major_version.$xmlsec1_config_minor_version.$xmlsec1_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$XMLSEC1_CONFIG" = "no" ; then echo "*** The xmlsec1-config script installed by LIBXMLSEC1 could not be found" echo "*** If libxmlsec1 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XMLSEC1_CONFIG environment variable to the" echo "*** full path to xmlsec1-config." else if test -f conf.xmlsec1test ; then : else echo "*** Could not run libxmlsec1 test program, checking why..." CFLAGS="$CFLAGS $XMLSEC1_CFLAGS" LIBS="$LIBS $XMLSEC1_LIBS" AC_TRY_LINK([ #include #include ], [ soap_client_destroy(); return 0;], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBXMLSEC1 or finding the wrong" echo "*** version of LIBXMLSEC1. If it is not finding LIBXMLSEC1, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBXMLSEC1 was incorrectly installed" echo "*** or that you have moved LIBXMLSEC1 since it was installed. In the latter case, you" echo "*** may want to edit the xmlsec1-config script: $XMLSEC1_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi XMLSEC1_CFLAGS="" XMLSEC1_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(XMLSEC1_CFLAGS) AC_SUBST(XMLSEC1_LIBS) rm -f conf.xmlsec1test ]) xmlsec1-1.2.28/xmlsec1-nss.pc0000644000175000017500000000103513455402561014331 0ustar renereneprefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: xmlsec1-nss Version: 1.2.28 Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= 2.8.0 libxslt >= 1.0.20 xulrunner-nspr >= 1.4 xulrunner-nss >= 1.4 Cflags: -DXMLSEC_CRYPTO_NSS=1 -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -I${prefix}/include/xmlsec1 Cflags.private: -DXMLSEC_STATIC Libs: -L${libdir} -lxmlsec1-nss -lxmlsec1 -lltdl xmlsec1-1.2.28/xmlsec1-gcrypt.pc0000644000175000017500000000115313455402561015037 0ustar renereneprefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: xmlsec1-gcrypt Version: 1.2.28 Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= 2.8.0 libxslt >= 1.0.20 Cflags: -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -I${prefix}/include/xmlsec1 -I/home/aleksey/local/include -DXMLSEC_CRYPTO_GCRYPT=1 Cflags.private: -DXMLSEC_STATIC Libs: -L${exec_prefix}/lib -lxmlsec1-gcrypt -lxmlsec1 -lltdl -L/home/aleksey/local/lib -lgcrypt -L/usr/lib/i386-linux-gnu -lgpg-error xmlsec1-1.2.28/xmlsec.spec.in0000644000175000017500000001267713455402476014427 0ustar renereneSummary: Library providing support for "XML Signature" and "XML Encryption" standards Name: @PACKAGE@ Version: @VERSION@ Release: 1 License: MIT Group: Development/Libraries Vendor: Aleksey Sanin Distribution: Aleksey Sanin Packager: Aleksey Sanin Source: ftp://ftp.aleksey.com/pub/xmlsec/releases/@PACKAGE@-%{version}.tar.gz BuildRoot: %{_tmppath}/@PACKAGE@-%{version}-root URL: http://www.aleksey.com/xmlsec Requires: libxml2 >= @LIBXML_MIN_VERSION@ Requires: libxslt >= @LIBXSLT_MIN_VERSION@ Requires: libtool-ltdl BuildRequires: libxml2-devel >= @LIBXML_MIN_VERSION@ BuildRequires: libxslt-devel >= @LIBXSLT_MIN_VERSION@ Prefix: %{_prefix} Docdir: %{_docdir} %define _unpackaged_files_terminate_build 0 %define _missing_doc_files_terminate_build 0 %description XML Security Library is a C library based on LibXML2 and OpenSSL. The library was created with a goal to support major XML security standards "XML Digital Signature" and "XML Encryption". %package devel Summary: Libraries, includes, etc. to develop applications with XML Digital Signatures and XML Encryption support. Group: Development/Libraries Requires: xmlsec1 = %{version} Requires: libxml2-devel >= @LIBXML_MIN_VERSION@ Requires: libxslt-devel >= @LIBXSLT_MIN_VERSION@ Requires: openssl-devel >= @OPENSSL_MIN_VERSION@ Requires: zlib-devel Requires: libtool-ltdl-devel %description devel Libraries, includes, etc. you can use to develop applications with XML Digital Signatures and XML Encryption support. %package openssl Summary: OpenSSL crypto plugin for XML Security Library Group: Development/Libraries Requires: xmlsec1 = %{version} Requires: libxml2 >= @LIBXML_MIN_VERSION@ Requires: libxslt >= @LIBXSLT_MIN_VERSION@ Requires: openssl >= @OPENSSL_MIN_VERSION@ BuildRequires: openssl-devel >= @OPENSSL_MIN_VERSION@ %description openssl OpenSSL plugin for XML Security Library provides OpenSSL based crypto services for the xmlsec library %package openssl-devel Summary: OpenSSL crypto plugin for XML Security Library Group: Development/Libraries Requires: xmlsec1 = %{version} Requires: xmlsec1-devel = %{version} Requires: xmlsec1-openssl = %{version} Requires: libxml2-devel >= @LIBXML_MIN_VERSION@ Requires: libxslt-devel >= @LIBXSLT_MIN_VERSION@ Requires: openssl >= @OPENSSL_MIN_VERSION@ Requires: openssl-devel >= @OPENSSL_MIN_VERSION@ %description openssl-devel Libraries, includes, etc. for developing XML Security applications with OpenSSL %package nss Summary: NSS crypto plugin for XML Security Library Group: Development/Libraries Requires: xmlsec1 = %{version} Requires: libxml2 >= @LIBXML_MIN_VERSION@ Requires: libxslt >= @LIBXSLT_MIN_VERSION@ Requires: mozilla-nss >= @MOZILLA_MIN_VERSION@ BuildRequires: mozilla-nss-devel >= @MOZILLA_MIN_VERSION@ %description nss NSS plugin for XML Security Library provides NSS based crypto services for the xmlsec library %package nss-devel Summary: NSS crypto plugin for XML Security Library Group: Development/Libraries Requires: xmlsec1 = %{version} Requires: xmlsec1-devel = %{version} Requires: xmlsec1-nss = %{version} Requires: libxml2-devel >= @LIBXML_MIN_VERSION@ Requires: libxslt-devel >= @LIBXSLT_MIN_VERSION@ Requires: mozilla-nss-devel >= @MOZILLA_MIN_VERSION@ %description nss-devel Libraries, includes, etc. for developing XML Security applications with NSS %prep %setup -q %build # Needed for snapshot releases. if [ ! -f configure ]; then %ifarch alpha CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --host=alpha-redhat-linux --prefix=%prefix --sysconfdir="/etc" --mandir=%{_mandir} %else CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix --sysconfdir="/etc" --mandir=%{_mandir} %endif else %ifarch alpha CFLAGS="$RPM_OPT_FLAGS" ./configure --host=alpha-redhat-linux --prefix=%prefix --sysconfdir="/etc" --mandir=%{_mandir} %else CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --sysconfdir="/etc" --mandir=%{_mandir} %endif fi if [ "$SMP" != "" ]; then (make "MAKE=make -k -j $SMP"; exit 0) make else make fi %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/include/@PACKAGE@ mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT/usr/man/man1 make prefix=$RPM_BUILD_ROOT%{prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-, root, root) %doc AUTHORS ChangeLog NEWS README Copyright %doc %{_mandir}/man1/xmlsec1.1* %{prefix}/lib/libxmlsec1.so.* %{prefix}/lib/libxmlsec1.so %{prefix}/bin/xmlsec1 %files devel %defattr(-, root, root) %{prefix}/bin/xmlsec1-config %{prefix}/include/xmlsec1/xmlsec/*.h %{prefix}/include/xmlsec1/xmlsec/private/*.h %{prefix}/lib/libxmlsec1.*a %{prefix}/lib/pkgconfig/xmlsec1.pc %{prefix}/lib/xmlsec1Conf.sh %{prefix}/share/doc/xmlsec1/* %{prefix}/share/aclocal/xmlsec1.m4 %doc AUTHORS HACKING ChangeLog NEWS README Copyright %doc %{_mandir}/man1/xmlsec1-config.1* %files openssl %defattr(-, root, root) %{prefix}/lib/libxmlsec1-openssl.so.* %{prefix}/lib/libxmlsec1-openssl.so %files openssl-devel %defattr(-, root, root) %{prefix}/include/xmlsec1/xmlsec/openssl/*.h %{prefix}/lib/libxmlsec1-openssl.*a %{prefix}/lib/pkgconfig/xmlsec1-openssl.pc %files nss %defattr(-, root, root) %{prefix}/lib/libxmlsec1-nss.so.* %{prefix}/lib/libxmlsec1-nss.so %files nss-devel %defattr(-, root, root) %{prefix}/include/xmlsec1/xmlsec/nss/*.h %{prefix}/lib/libxmlsec1-nss.*a %{prefix}/lib/pkgconfig/xmlsec1-nss.pc %changelog xmlsec1-1.2.28/xmlsec-nss.pc.in0000644000175000017500000000075113455402476014666 0ustar renereneprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: xmlsec1-nss Version: @VERSION@ Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ @NSPR_PACKAGE@ >= @MOZILLA_MIN_VERSION@ @NSS_PACKAGE@ >= @MOZILLA_MIN_VERSION@ Cflags: -DXMLSEC_CRYPTO_NSS=1 @XMLSEC_CORE_CFLAGS@ Cflags.private: -DXMLSEC_STATIC Libs: -L${libdir} -lxmlsec1-nss @XMLSEC_CORE_LIBS@ xmlsec1-1.2.28/compile0000755000175000017500000001624513256032133013210 0ustar renerene#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 # along with this program. If not, see . # 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 or send patches to # . 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 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 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'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= 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'. # 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 # 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 # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # 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. 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 test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${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" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xmlsec1-1.2.28/xmlsec1.pc0000644000175000017500000000071613455402560013534 0ustar renereneprefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: xmlsec1 Version: 1.2.28 Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= 2.8.0 libxslt >= 1.0.20 Cflags: -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -I${prefix}/include/xmlsec1 Libs: -L${libdir} -lxmlsec1 -lltdl xmlsec1-1.2.28/xmlsec-gnutls.pc.in0000644000175000017500000000056113455402476015376 0ustar renereneprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: xmlsec1-gnutls Version: @VERSION@ Description: XML Security Library implements XML Signature and XML Encryption standards Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ Cflags: @XMLSEC_GNUTLS_CFLAGS@ Cflags.private: -DXMLSEC_STATIC Libs: @XMLSEC_GNUTLS_LIBS@ xmlsec1-1.2.28/INSTALL0000644000175000017500000000212713455402476012671 0ustar renereneCompilation 1. How to compile XMLSec? As most UNIX libraries XMLSec follows the "standard": gunzip -c xmlsec-xxx.tar.gz | tar xvf - cd xmlsec-xxxx ./configure --help to see the options, then the compilation/installation proper ./configure [possible options] make make install Probably you may have to rerun ldconfig or similar utility to update your list of installed shared libs. At this point you can check that the library is compiled successfully by running make check 2.What other libraries are needed to compile/install XMLSec? XMLSec requires following libraries: LibXML2 (http://xmlsoft.org): a very powerfull XML parsing and manipulating library LibXSLT (http://xmlsoft.org/XSLT/): a nice XSLT processor based on LibXML2 OpenSSL (http://www.openssl.org): well known cryptographic library If you are running a Linux system then there is a good chance that you already have all libraries installed. Also XMLSec requires the normal C ANSI API (please report any violation to this rule you may find). Aleksey Sanin $Id$ xmlsec1-1.2.28/install-sh0000755000175000017500000003546313256032133013641 0ustar renerene#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # 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" # End: xmlsec1-1.2.28/apps/0000755000175000017500000000000013455402566012601 5ustar renerenexmlsec1-1.2.28/apps/Makefile.am0000644000175000017500000000234313455402476014637 0ustar renereneNULL = bin_PROGRAMS = xmlsec1 XMLSEC_LIBS = $(top_builddir)/src/libxmlsec1.la # check if we use dynamic loading for xmlsec-crypto or not if XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING CRYPTO_DEPS = \ $(top_builddir)/src/@XMLSEC_DEFAULT_CRYPTO@/lib$(XMLSEC_CRYPTO_LIB).la \ $(NULL) CRYPTO_INCLUDES = \ $(XMLSEC_CRYPTO_CFLAGS) \ $(NULL) CRYPTO_LD_FLAGS = \ $(NULL) CRYPTO_LD_ADD = \ $(XMLSEC_CRYPTO_LIBS) \ $(CRYPTO_DEPS) \ $(NULL) else CRYPTO_DEPS = \ $(NULL) CRYPTO_INCLUDES = \ -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 $(NULL) CRYPTO_LD_FLAGS = \ $(NULL) CRYPTO_LD_ADD = \ $(CRYPTO_DEPS) \ $(NULL) endif AM_CFLAGS = \ -DPACKAGE=\"@PACKAGE@\" \ -I../include \ -I$(top_srcdir)/include \ $(XMLSEC_DEFINES) \ $(XMLSEC_APP_DEFINES) \ $(CRYPTO_INCLUDES) \ $(LIBXSLT_CFLAGS) \ $(LIBXML_CFLAGS) \ $(XMLSEC_DL_INCLUDES) \ $(NULL) # xmlsec command line utility xmlsec1_SOURCES = \ xmlsec.c \ crypto.c crypto.h \ cmdline.c cmdline.h \ $(NULL) xmlsec1_LDFLAGS = \ @XMLSEC_STATIC_BINARIES@ \ $(CRYPTO_LD_FLAGS) \ $(NULL) xmlsec1_LDADD = \ $(LIBXSLT_LIBS) \ $(LIBXML_LIBS) \ $(CRYPTO_LD_ADD) \ $(XMLSEC_LIBS) \ $(XMLSEC_DL_LIBS) \ $(NULL) xmlsec1_DEPENDENCIES = \ $(CRYPTO_DEPS) \ $(XMLSEC_LIBS) \ $(NULL) xmlsec1-1.2.28/apps/cmdline.c0000644000175000017500000002777513455402476014402 0ustar renerene/** * * XMLSec library * * * See Copyright for the status of this software. * * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. */ #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif #include #include #include #include #include #include "cmdline.h" static int xmlSecAppCmdLineMatchParam (const char* argvParam, const char* paramName, int canHaveNameString); static xmlSecAppCmdLineParamPtr xmlSecAppCmdLineParamsListFind (xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topics, const char* name); static int xmlSecAppCmdLineParamRead (xmlSecAppCmdLineParamPtr param, const char** argv, int argc, int pos); static int xmlSecAppCmdLineTimeParamRead (const char* str, time_t* t); int xmlSecAppCmdLineParamIsSet(xmlSecAppCmdLineParamPtr param) { return(((param != NULL) && (param->value != NULL)) ? 1 : 0); } const char* xmlSecAppCmdLineParamGetString(xmlSecAppCmdLineParamPtr param) { if(param->type != xmlSecAppCmdLineParamTypeString) { fprintf(stderr, "Error: parameter \"%s\" is not string.\n", param->fullName); return(NULL); } return((param->value != NULL) ? param->value->strValue : NULL); } const char* xmlSecAppCmdLineParamGetStringList(xmlSecAppCmdLineParamPtr param) { if(param->type != xmlSecAppCmdLineParamTypeStringList) { fprintf(stderr, "Error: parameter \"%s\" is not string list.\n", param->fullName); return(NULL); } return((param->value != NULL) ? param->value->strListValue : NULL); } int xmlSecAppCmdLineParamGetInt(xmlSecAppCmdLineParamPtr param, int def) { if(param->type != xmlSecAppCmdLineParamTypeNumber) { fprintf(stderr, "Error: parameter \"%s\" is not integer.\n", param->fullName); return(def); } return((param->value != NULL) ? param->value->intValue : def); } time_t xmlSecAppCmdLineParamGetTime(xmlSecAppCmdLineParamPtr param, time_t def) { if(param->type != xmlSecAppCmdLineParamTypeTime) { fprintf(stderr, "Error: parameter \"%s\" is not time.\n", param->fullName); return(def); } return((param->value != NULL) ? param->value->timeValue : def); } int xmlSecAppCmdLineParamsListParse(xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topics, const char** argv, int argc, int pos) { xmlSecAppCmdLineParamPtr param; int ii; int ret; assert(params != NULL); assert(argv != NULL); while((pos < argc) && (argv[pos][0] == '-') && (strcmp(argv[pos], XMLSEC_STDOUT_FILENAME) != 0)) { param = xmlSecAppCmdLineParamsListFind(params, topics, argv[pos]); if(param == NULL) { fprintf(stderr, "Error: parameter \"%s\" is not supported or the requested\nfeature might have been disabled during compilation.\n", argv[pos]); return(-1); } ret = xmlSecAppCmdLineParamRead(param, argv, argc, pos); if(ret < pos) { fprintf(stderr, "Error: failed to parse parameter \"%s\".\n", argv[pos]); return(-1); } pos = ret + 1; } /* check that all parameters at the end are filenames */ for(ii = pos; (ii < argc); ++ii) { if((argv[ii][0] == '-') && (strcmp(argv[pos], XMLSEC_STDOUT_FILENAME) != 0)) { fprintf(stderr, "Error: filename is expected instead of parameter \"%s\".\n", argv[ii]); return(-1); } } /* done */ return(pos); } void xmlSecAppCmdLineParamsListClean(xmlSecAppCmdLineParamPtr* params) { xmlSecAppCmdLineValuePtr tmp; size_t i; assert(params != NULL); for(i = 0; params[i] != NULL; ++i) { while(params[i]->value != NULL) { tmp = params[i]->value; params[i]->value = params[i]->value->next; xmlSecAppCmdLineValueDestroy(tmp); } } } void xmlSecAppCmdLineParamsListPrint(xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topics, FILE* output) { size_t i; assert(params != NULL); assert(output != NULL); for(i = 0; params[i] != NULL; ++i) { if(((params[i]->topics & topics) != 0) && (params[i]->help != NULL)) { fprintf(output, " %s\n", params[i]->help); } } } xmlSecAppCmdLineValuePtr xmlSecAppCmdLineValueCreate(xmlSecAppCmdLineParamPtr param, int pos) { xmlSecAppCmdLineValuePtr value; assert(param != NULL); value = (xmlSecAppCmdLineValuePtr) malloc(sizeof(xmlSecAppCmdLineValue)); if(value == NULL) { fprintf(stderr, "Error: malloc failed (%d bytes).\n", (int)sizeof(xmlSecAppCmdLineValue)); return(NULL); } memset(value, 0, sizeof(xmlSecAppCmdLineValue)); value->param = param; value->pos = pos; return(value); } void xmlSecAppCmdLineValueDestroy(xmlSecAppCmdLineValuePtr value) { assert(value != NULL); if(value->strListValue != NULL) { free((void*)value->strListValue); } free(value); } static int xmlSecAppCmdLineMatchParam(const char* argvParam, const char* paramName, int canHaveNameString) { assert(argvParam != NULL); assert(paramName != NULL); if(canHaveNameString != 0) { size_t len = strlen(paramName); if((strncmp(argvParam, paramName, len) == 0) && ((argvParam[len] == '\0') || (argvParam[len] == ':'))) { return(1); } } else if(strcmp(argvParam, paramName) == 0) { return(1); } return(0); } static xmlSecAppCmdLineParamPtr xmlSecAppCmdLineParamsListFind(xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topics, const char* name) { size_t i; int canHaveNameString; assert(params != NULL); assert(name != NULL); for(i = 0; params[i] != NULL; ++i) { if((params[i]->topics & topics) == 0) { continue; } canHaveNameString = ((params[i]->flags & xmlSecAppCmdLineParamFlagParamNameValue) != 0) ? 1 : 0; if((params[i]->fullName != NULL) && (xmlSecAppCmdLineMatchParam(name, params[i]->fullName, canHaveNameString) == 1)) { return(params[i]); } if((params[i]->shortName != NULL) && (xmlSecAppCmdLineMatchParam(name, params[i]->shortName, canHaveNameString) == 1)) { return(params[i]); } } return(NULL); } static int xmlSecAppCmdLineParamRead(xmlSecAppCmdLineParamPtr param, const char** argv, int argc, int pos) { xmlSecAppCmdLineValuePtr value; xmlSecAppCmdLineValuePtr prev = NULL; char* buf; assert(param != NULL); assert(argv != NULL); assert(pos < argc); /* first find the previous value in the list */ if((param->flags & xmlSecAppCmdLineParamFlagMultipleValues) != 0) { prev = param->value; while((prev != NULL) && (prev->next != NULL)) { prev = prev->next; } } else if(param->value != NULL) { fprintf(stderr, "Error: only one parameter \"%s\" is allowed.\n", argv[pos]); return(-1); } /* create new value and add to the list */ value = xmlSecAppCmdLineValueCreate(param, pos); if(value == NULL) { fprintf(stderr, "Error: failed to create value for parameter \"%s\".\n", argv[pos]); return(-1); } if(prev != NULL) { assert(prev->next == NULL); prev->next = value; } else { param->value = value; } /* if we can have a string value after the name, parse it */ if((param->flags & xmlSecAppCmdLineParamFlagParamNameValue) != 0) { value->paramNameValue = strchr(argv[pos], ':'); if(value->paramNameValue != NULL) { ++value->paramNameValue; } } switch(param->type) { case xmlSecAppCmdLineParamTypeFlag: /* do nothing */ break; case xmlSecAppCmdLineParamTypeString: if(pos + 1 >= argc) { fprintf(stderr, "Error: string argument expected for parameter \"%s\".\n", argv[pos]); return(-1); } value->strValue = argv[++pos]; break; case xmlSecAppCmdLineParamTypeStringList: if(pos + 1 >= argc) { fprintf(stderr, "Error: string list argument expected for parameter \"%s\".\n", argv[pos]); return(-1); } value->strValue = argv[++pos]; buf = (char*)malloc(strlen(value->strValue) + 2); if(buf == NULL) { fprintf(stderr, "Error: failed to allocate memory (%d bytes).\n", (int)strlen(value->strValue) + 2); return(-1); } memset(buf, 0, strlen(value->strValue) + 2); memcpy(buf, value->strValue, strlen(value->strValue)); value->strListValue = buf; while((*buf) != '\0') { if((*buf) == ',') { (*buf) = '\0'; } ++buf; } break; case xmlSecAppCmdLineParamTypeNumber: if(pos + 1 >= argc) { fprintf(stderr, "Error: integer argument expected for parameter \"%s\".\n", argv[pos]); return(-1); } value->strValue = argv[++pos]; #ifdef WIN32 if(sscanf_s(value->strValue, "%d", &(value->intValue)) != 1) { #else /* WIN32 */ if(sscanf(value->strValue, "%d", &(value->intValue)) != 1) { #endif /* WIN32 */ fprintf(stderr, "Error: integer argument \"%s\" is invalid.\n", value->strValue); return(-1); } break; case xmlSecAppCmdLineParamTypeTime: if(pos + 1 >= argc) { fprintf(stderr, "Error: time argument expected for parameter \"%s\".\n", argv[pos]); return(-1); } value->strValue = argv[++pos]; if(xmlSecAppCmdLineTimeParamRead(value->strValue, &(value->timeValue)) < 0) { fprintf(stderr, "Error: time argument \"%s\" is invalid, expected format is \"YYYY-MM-DD HH:MM:SS\").\n", value->strValue); return(-1); } break; } return(pos); } static int xmlSecAppCmdLineTimeParamRead(const char* str, time_t* t) { struct tm tm; int n; if((str == NULL) || (t == NULL)) { return(-1); } memset(&tm, 0, sizeof(tm)); tm.tm_isdst = -1; #ifdef WIN32 n = sscanf_s(str, "%4d-%2d-%2d%*c%2d:%2d:%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); #else /* WIN32 */ n = sscanf(str, "%4d-%2d-%2d%*c%2d:%2d:%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); #endif /* WIN32 */ if((n != 6) || (tm.tm_year < 1900) || (tm.tm_mon < 1) || (tm.tm_mon > 12) || (tm.tm_mday < 1) || (tm.tm_mday > 31) || (tm.tm_hour < 0) || (tm.tm_hour > 23) || (tm.tm_min < 0) || (tm.tm_min > 59) || (tm.tm_sec < 0) || (tm.tm_sec > 61)) { return(-1); } tm.tm_year -= 1900; /* tm relative format year */ tm.tm_mon -= 1; /* tm relative format month */ (*t) = mktime(&tm); return(0); } xmlsec1-1.2.28/apps/crypto.h0000644000175000017500000000660513455402476014301 0ustar renerene/** * XMLSec library * * * See Copyright for the status of this software. * * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. */ #ifndef __XMLSEC_APPS_CRYPTO_H__ #define __XMLSEC_APPS_CRYPTO_H__ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int xmlSecAppCryptoInit (const char* config); int xmlSecAppCryptoShutdown (void); xmlSecKeyPtr xmlSecAppCryptoKeyGenerate (const char* keyKlassAndSize, const char* name, xmlSecKeyDataType type); /***************************************************************************** * * Simple keys manager * ****************************************************************************/ int xmlSecAppCryptoSimpleKeysMngrInit (xmlSecKeysMngrPtr mngr); int xmlSecAppCryptoSimpleKeysMngrLoad (xmlSecKeysMngrPtr mngr, const char *filename); int xmlSecAppCryptoSimpleKeysMngrSave (xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataType type); int xmlSecAppCryptoSimpleKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataFormat format, xmlSecKeyDataType type); int xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad (xmlSecKeysMngrPtr mngr, const char *files, const char* pwd, const char* name, xmlSecKeyDataFormat format); int xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad (xmlSecKeysMngrPtr mngr, const char *filename, const char* pwd, const char *name); int xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad (xmlSecKeysMngrPtr mngr, const char* keyKlass, const char* filename, const char *name); int xmlSecAppCryptoSimpleKeysMngrKeyGenerate (xmlSecKeysMngrPtr mngr, const char* keyKlassAndSize, const char* name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __XMLSEC_APPS_CRYPTO_H__ */ xmlsec1-1.2.28/apps/crypto.c0000644000175000017500000002134513455402476014272 0ustar renerene/** * * XMLSec library * * * See Copyright for the status of this software. * * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. */ #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif #include #include #include #include #include #include "crypto.h" int xmlSecAppCryptoInit(const char* config) { if(xmlSecCryptoAppInit(config) < 0) { fprintf(stderr, "Error: xmlSecCryptoAppInit failed\n"); return(-1); } if(xmlSecCryptoInit() < 0) { fprintf(stderr, "Error: xmlSecCryptoInit failed\n"); return(-1); } return(0); } int xmlSecAppCryptoShutdown(void) { if(xmlSecCryptoShutdown() < 0) { fprintf(stderr, "Error: xmlSecCryptoShutdown failed\n"); return(-1); } if(xmlSecCryptoAppShutdown() < 0) { fprintf(stderr, "Error: xmlSecCryptoAppShutdown failed\n"); return(-1); } return(0); } int xmlSecAppCryptoSimpleKeysMngrInit(xmlSecKeysMngrPtr mngr) { xmlSecAssert2(mngr != NULL, -1); return(xmlSecCryptoAppDefaultKeysMngrInit(mngr)); } int xmlSecAppCryptoSimpleKeysMngrLoad(xmlSecKeysMngrPtr mngr, const char *filename) { xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(filename != NULL, -1); return(xmlSecCryptoAppDefaultKeysMngrLoad(mngr, filename)); } int xmlSecAppCryptoSimpleKeysMngrSave(xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataType type) { xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(filename != NULL, -1); return(xmlSecCryptoAppDefaultKeysMngrSave(mngr, filename, type)); } int xmlSecAppCryptoSimpleKeysMngrCertLoad(xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataFormat format, xmlSecKeyDataType type) { xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(filename != NULL, -1); #ifndef XMLSEC_NO_X509 return(xmlSecCryptoAppKeysMngrCertLoad(mngr, filename, format, type)); #else /* XMLSEC_NO_X509 */ return(-1); #endif /* XMLSEC_NO_X509 */ } int xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(xmlSecKeysMngrPtr mngr, const char* files, const char* pwd, const char* name, xmlSecKeyDataFormat format) { xmlSecKeyPtr key; int ret; xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(files != NULL, -1); /* first is the key file */ key = xmlSecCryptoAppKeyLoad(files, format, pwd, xmlSecCryptoAppGetDefaultPwdCallback(), (void*)files); if(key == NULL) { fprintf(stderr, "Error: xmlSecCryptoAppKeyLoad failed: file=%s\n", xmlSecErrorsSafeString(files)); return(-1); } if(name != NULL) { ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } } #ifndef XMLSEC_NO_X509 for(files += strlen(files) + 1; (files[0] != '\0'); files += strlen(files) + 1) { ret = xmlSecCryptoAppKeyCertLoad(key, files, format); if(ret < 0) { fprintf(stderr, "Error: xmlSecCryptoAppKeyCertLoad failed: file=%s\n", xmlSecErrorsSafeString(files)); xmlSecKeyDestroy(key); return(-1); } } #else /* XMLSEC_NO_X509 */ files += strlen(files) + 1; if(files[0] != '\0') { fprintf(stderr, "Error: X509 support is disabled\n"); return(-1); } #endif /* XMLSEC_NO_X509 */ ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } return(0); } int xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad(xmlSecKeysMngrPtr mngr, const char *filename, const char* pwd, const char *name) { xmlSecKeyPtr key; int ret; xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(filename != NULL, -1); #ifndef XMLSEC_NO_X509 key = xmlSecCryptoAppKeyLoad(filename, xmlSecKeyDataFormatPkcs12, pwd, xmlSecCryptoAppGetDefaultPwdCallback(), (void*)filename); if(key == NULL) { fprintf(stderr, "Error: xmlSecCryptoAppKeyLoad failed: filename=%s\n", xmlSecErrorsSafeString(filename)); return(-1); } if(name != NULL) { ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } } ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } return(0); #else /* XMLSEC_NO_X509 */ fprintf(stderr, "Error: X509 support is disabled\n"); return(-1); #endif /* XMLSEC_NO_X509 */ } int xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(xmlSecKeysMngrPtr mngr, const char* keyKlass, const char *filename, const char *name) { xmlSecKeyPtr key; xmlSecKeyDataId dataId; int ret; xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(keyKlass != NULL, -1); xmlSecAssert2(filename != NULL, -1); /* find requested data */ dataId = xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST keyKlass, xmlSecKeyDataUsageAny); if(dataId == xmlSecKeyDataIdUnknown) { fprintf(stderr, "Error: xmlSecKeyDataIdListFindByName failed keyKlass=%s\n", xmlSecErrorsSafeString(keyKlass)); return(-1); } key = xmlSecKeyReadBinaryFile(dataId, filename); if(key == NULL) { fprintf(stderr, "Error: xmlSecKeyReadBinaryFile failed filename=%s\n", xmlSecErrorsSafeString(filename)); return(-1); } ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } /* finally add it to keys manager */ ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } return(0); } int xmlSecAppCryptoSimpleKeysMngrKeyGenerate(xmlSecKeysMngrPtr mngr, const char* keyKlassAndSize, const char* name) { xmlSecKeyPtr key; int ret; xmlSecAssert2(mngr != NULL, -1); xmlSecAssert2(keyKlassAndSize != NULL, -1); key = xmlSecAppCryptoKeyGenerate(keyKlassAndSize, name, xmlSecKeyDataTypePermanent); if(key == NULL) { fprintf(stderr, "Error: xmlSecAppCryptoSimpleKeysMngrKeyGenerate failed: name=%s\n", xmlSecErrorsSafeString(name)); return(-1); } ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } return(0); } xmlSecKeyPtr xmlSecAppCryptoKeyGenerate(const char* keyKlassAndSize, const char* name, xmlSecKeyDataType type) { xmlSecKeyPtr key; char* buf; char* p; int size; int ret; xmlSecAssert2(keyKlassAndSize != NULL, NULL); buf = (char*) xmlStrdup(BAD_CAST keyKlassAndSize); if(buf == NULL) { fprintf(stderr, "Error: xmlSecStrdupError(keyKlassAndSize) failed\n"); return(NULL); } /* separate key klass and size */ p = strchr(buf, '-'); if(p == NULL) { fprintf(stderr, "Error: key size is not specified in the key definition \"%s\"\n", xmlSecErrorsSafeString(buf)); xmlFree(buf); return(NULL); } *(p++) = '\0'; size = atoi(p); key = xmlSecKeyGenerateByName(BAD_CAST buf, size, type); if(key == NULL) { fprintf(stderr, "Error: xmlSecKeyGenerateByName() failed: name=%s;size=%d;type=%d\n", xmlSecErrorsSafeString(buf), size, (int)type); xmlFree(buf); return(NULL); } ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); xmlFree(buf); return(NULL); } xmlFree(buf); return(key); } xmlsec1-1.2.28/apps/cmdline.h0000644000175000017500000000704413455402476014372 0ustar renerene/** * XMLSec library * * Command line parsing routines * * See Copyright for the status of this software. * * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. */ #ifndef __XMLSEC_APPS_CMDLINE_H__ #define __XMLSEC_APPS_CMDLINE_H__ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _xmlSecAppCmdLineParam xmlSecAppCmdLineParam, *xmlSecAppCmdLineParamPtr; typedef struct _xmlSecAppCmdLineValue xmlSecAppCmdLineValue, *xmlSecAppCmdLineValuePtr; typedef unsigned int xmlSecAppCmdLineParamTopic; #define xmlSecAppCmdLineParamFlagNone 0x0000 #define xmlSecAppCmdLineParamFlagParamNameValue 0x0001 #define xmlSecAppCmdLineParamFlagMultipleValues 0x0002 #define XMLSEC_STDOUT_FILENAME "-" typedef enum { xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamTypeNumber, xmlSecAppCmdLineParamTypeTime } xmlSecAppCmdLineParamType; struct _xmlSecAppCmdLineParam { xmlSecAppCmdLineParamTopic topics; const char* fullName; const char* shortName; const char* help; xmlSecAppCmdLineParamType type; int flags; xmlSecAppCmdLineValuePtr value; }; int xmlSecAppCmdLineParamIsSet (xmlSecAppCmdLineParamPtr param); const char* xmlSecAppCmdLineParamGetString (xmlSecAppCmdLineParamPtr param); const char* xmlSecAppCmdLineParamGetStringList (xmlSecAppCmdLineParamPtr param); int xmlSecAppCmdLineParamGetInt (xmlSecAppCmdLineParamPtr param, int def); time_t xmlSecAppCmdLineParamGetTime (xmlSecAppCmdLineParamPtr param, time_t def); int xmlSecAppCmdLineParamsListParse (xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topics, const char** argv, int argc, int pos); void xmlSecAppCmdLineParamsListClean (xmlSecAppCmdLineParamPtr* params); void xmlSecAppCmdLineParamsListPrint (xmlSecAppCmdLineParamPtr* params, xmlSecAppCmdLineParamTopic topic, FILE* output); struct _xmlSecAppCmdLineValue { xmlSecAppCmdLineParamPtr param; int pos; const char* paramNameValue; const char* strValue; const char* strListValue; int intValue; time_t timeValue; xmlSecAppCmdLineValuePtr next; }; xmlSecAppCmdLineValuePtr xmlSecAppCmdLineValueCreate (xmlSecAppCmdLineParamPtr param, int pos); void xmlSecAppCmdLineValueDestroy (xmlSecAppCmdLineValuePtr value); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __XMLSEC_APPS_CMDLINE_H__ */ xmlsec1-1.2.28/apps/Makefile.in0000644000175000017500000006450313455402527014653 0ustar renerene# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xmlsec1$(EXEEXT) subdir = apps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = am_xmlsec1_OBJECTS = xmlsec.$(OBJEXT) crypto.$(OBJEXT) \ cmdline.$(OBJEXT) $(am__objects_1) xmlsec1_OBJECTS = $(am_xmlsec1_OBJECTS) am__DEPENDENCIES_1 = @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/src/@XMLSEC_DEFAULT_CRYPTO@/lib$(XMLSEC_CRYPTO_LIB).la \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(am__DEPENDENCIES_1) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(am__DEPENDENCIES_1) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(am__DEPENDENCIES_2) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = xmlsec1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xmlsec1_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(xmlsec1_SOURCES) DIST_SOURCES = $(xmlsec1_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCRYPT_CFLAGS = @GCRYPT_CFLAGS@ GCRYPT_CONFIG_PATH = @GCRYPT_CONFIG_PATH@ GCRYPT_CRYPTO_LIB = @GCRYPT_CRYPTO_LIB@ GCRYPT_LIBS = @GCRYPT_LIBS@ GCRYPT_MIN_VERSION = @GCRYPT_MIN_VERSION@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_CRYPTO_LIB = @GNUTLS_CRYPTO_LIB@ GNUTLS_LIBS = @GNUTLS_LIBS@ GNUTLS_MIN_VERSION = @GNUTLS_MIN_VERSION@ GREP = @GREP@ GTKDOC_MKDB = @GTKDOC_MKDB@ GTKDOC_MKHTML = @GTKDOC_MKHTML@ GTKDOC_SCAN = @GTKDOC_SCAN@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_CONFIG = @LIBXML_CONFIG@ LIBXML_CONFIG_PATH = @LIBXML_CONFIG_PATH@ LIBXML_LIBS = @LIBXML_LIBS@ LIBXML_MIN_VERSION = @LIBXML_MIN_VERSION@ LIBXSLT_CFLAGS = @LIBXSLT_CFLAGS@ LIBXSLT_CONFIG = @LIBXSLT_CONFIG@ LIBXSLT_CONFIG_PATH = @LIBXSLT_CONFIG_PATH@ LIBXSLT_LIBS = @LIBXSLT_LIBS@ LIBXSLT_MIN_VERSION = @LIBXSLT_MIN_VERSION@ LIBXSLT_PC_FILE_COND = @LIBXSLT_PC_FILE_COND@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOZILLA_MIN_VERSION = @MOZILLA_MIN_VERSION@ MSCNG_CFLAGS = @MSCNG_CFLAGS@ MSCNG_CRYPTO_LIB = @MSCNG_CRYPTO_LIB@ MSCNG_LIBS = @MSCNG_LIBS@ MSCRYPTO_CFLAGS = @MSCRYPTO_CFLAGS@ MSCRYPTO_CRYPTO_LIB = @MSCRYPTO_CRYPTO_LIB@ MSCRYPTO_LIBS = @MSCRYPTO_LIBS@ MV = @MV@ NM = @NM@ NMEDIT = @NMEDIT@ NSPR_CFLAGS = @NSPR_CFLAGS@ NSPR_LIBS = @NSPR_LIBS@ NSPR_MIN_VERSION = @NSPR_MIN_VERSION@ NSPR_PACKAGE = @NSPR_PACKAGE@ NSS_CFLAGS = @NSS_CFLAGS@ NSS_CRYPTO_LIB = @NSS_CRYPTO_LIB@ NSS_LIBS = @NSS_LIBS@ NSS_MIN_VERSION = @NSS_MIN_VERSION@ NSS_PACKAGE = @NSS_PACKAGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_CRYPTO_LIB = @OPENSSL_CRYPTO_LIB@ OPENSSL_LIBS = @OPENSSL_LIBS@ OPENSSL_MIN_VERSION = @OPENSSL_MIN_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ VERSION = @VERSION@ XMLSEC_APPS = @XMLSEC_APPS@ XMLSEC_APP_DEFINES = @XMLSEC_APP_DEFINES@ XMLSEC_CFLAGS = @XMLSEC_CFLAGS@ XMLSEC_CORE_CFLAGS = @XMLSEC_CORE_CFLAGS@ XMLSEC_CORE_LIBS = @XMLSEC_CORE_LIBS@ XMLSEC_CRYPTO_CFLAGS = @XMLSEC_CRYPTO_CFLAGS@ XMLSEC_CRYPTO_DISABLED_LIST = @XMLSEC_CRYPTO_DISABLED_LIST@ XMLSEC_CRYPTO_EXTRA_LDFLAGS = @XMLSEC_CRYPTO_EXTRA_LDFLAGS@ XMLSEC_CRYPTO_LIB = @XMLSEC_CRYPTO_LIB@ XMLSEC_CRYPTO_LIBS = @XMLSEC_CRYPTO_LIBS@ XMLSEC_CRYPTO_LIST = @XMLSEC_CRYPTO_LIST@ XMLSEC_CRYPTO_PC_FILES_LIST = @XMLSEC_CRYPTO_PC_FILES_LIST@ XMLSEC_DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@ XMLSEC_DEFINES = @XMLSEC_DEFINES@ XMLSEC_DL_INCLUDES = @XMLSEC_DL_INCLUDES@ XMLSEC_DL_LIBS = @XMLSEC_DL_LIBS@ XMLSEC_DOCDIR = @XMLSEC_DOCDIR@ XMLSEC_DOCS = @XMLSEC_DOCS@ XMLSEC_EXTRA_LDFLAGS = @XMLSEC_EXTRA_LDFLAGS@ XMLSEC_GCRYPT_CFLAGS = @XMLSEC_GCRYPT_CFLAGS@ XMLSEC_GCRYPT_LIBS = @XMLSEC_GCRYPT_LIBS@ XMLSEC_GNUTLS_CFLAGS = @XMLSEC_GNUTLS_CFLAGS@ XMLSEC_GNUTLS_LIBS = @XMLSEC_GNUTLS_LIBS@ XMLSEC_LIBDIR = @XMLSEC_LIBDIR@ XMLSEC_LIBS = $(top_builddir)/src/libxmlsec1.la XMLSEC_MANS = @XMLSEC_MANS@ XMLSEC_NO_AES = @XMLSEC_NO_AES@ XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING = @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING@ XMLSEC_NO_CRYPTO_DYNAMIC_LOADING = @XMLSEC_NO_CRYPTO_DYNAMIC_LOADING@ XMLSEC_NO_DES = @XMLSEC_NO_DES@ XMLSEC_NO_DSA = @XMLSEC_NO_DSA@ XMLSEC_NO_GCRYPT = @XMLSEC_NO_GCRYPT@ XMLSEC_NO_GNUTLS = @XMLSEC_NO_GNUTLS@ XMLSEC_NO_GOST = @XMLSEC_NO_GOST@ XMLSEC_NO_GOST2012 = @XMLSEC_NO_GOST2012@ XMLSEC_NO_HMAC = @XMLSEC_NO_HMAC@ XMLSEC_NO_LIBXSLT = @XMLSEC_NO_LIBXSLT@ XMLSEC_NO_MD5 = @XMLSEC_NO_MD5@ XMLSEC_NO_MSCNG = @XMLSEC_NO_MSCNG@ XMLSEC_NO_MSCRYPTO = @XMLSEC_NO_MSCRYPTO@ XMLSEC_NO_NSS = @XMLSEC_NO_NSS@ XMLSEC_NO_OPENSSL = @XMLSEC_NO_OPENSSL@ XMLSEC_NO_RIPEMD160 = @XMLSEC_NO_RIPEMD160@ XMLSEC_NO_RSA = @XMLSEC_NO_RSA@ XMLSEC_NO_SHA1 = @XMLSEC_NO_SHA1@ XMLSEC_NO_SHA224 = @XMLSEC_NO_SHA224@ XMLSEC_NO_SHA256 = @XMLSEC_NO_SHA256@ XMLSEC_NO_SHA384 = @XMLSEC_NO_SHA384@ XMLSEC_NO_SHA512 = @XMLSEC_NO_SHA512@ XMLSEC_NO_X509 = @XMLSEC_NO_X509@ XMLSEC_NO_XMLDSIG = @XMLSEC_NO_XMLDSIG@ XMLSEC_NO_XMLENC = @XMLSEC_NO_XMLENC@ XMLSEC_NSS_CFLAGS = @XMLSEC_NSS_CFLAGS@ XMLSEC_NSS_LIBS = @XMLSEC_NSS_LIBS@ XMLSEC_OPENSSL_CFLAGS = @XMLSEC_OPENSSL_CFLAGS@ XMLSEC_OPENSSL_LIBS = @XMLSEC_OPENSSL_LIBS@ XMLSEC_PACKAGE = @XMLSEC_PACKAGE@ XMLSEC_STATIC_BINARIES = @XMLSEC_STATIC_BINARIES@ XMLSEC_VERSION = @XMLSEC_VERSION@ XMLSEC_VERSION_INFO = @XMLSEC_VERSION_INFO@ XMLSEC_VERSION_MAJOR = @XMLSEC_VERSION_MAJOR@ XMLSEC_VERSION_MINOR = @XMLSEC_VERSION_MINOR@ XMLSEC_VERSION_SAFE = @XMLSEC_VERSION_SAFE@ XMLSEC_VERSION_SUBMINOR = @XMLSEC_VERSION_SUBMINOR@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@CRYPTO_DEPS = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(NULL) # check if we use dynamic loading for xmlsec-crypto or not @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@CRYPTO_DEPS = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(top_builddir)/src/@XMLSEC_DEFAULT_CRYPTO@/lib$(XMLSEC_CRYPTO_LIB).la \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(NULL) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@CRYPTO_INCLUDES = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@CRYPTO_INCLUDES = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(XMLSEC_CRYPTO_CFLAGS) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(NULL) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@CRYPTO_LD_FLAGS = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(NULL) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@CRYPTO_LD_FLAGS = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(NULL) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@CRYPTO_LD_ADD = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(CRYPTO_DEPS) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(NULL) @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@CRYPTO_LD_ADD = \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(XMLSEC_CRYPTO_LIBS) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(CRYPTO_DEPS) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(NULL) AM_CFLAGS = \ -DPACKAGE=\"@PACKAGE@\" \ -I../include \ -I$(top_srcdir)/include \ $(XMLSEC_DEFINES) \ $(XMLSEC_APP_DEFINES) \ $(CRYPTO_INCLUDES) \ $(LIBXSLT_CFLAGS) \ $(LIBXML_CFLAGS) \ $(XMLSEC_DL_INCLUDES) \ $(NULL) # xmlsec command line utility xmlsec1_SOURCES = \ xmlsec.c \ crypto.c crypto.h \ cmdline.c cmdline.h \ $(NULL) xmlsec1_LDFLAGS = \ @XMLSEC_STATIC_BINARIES@ \ $(CRYPTO_LD_FLAGS) \ $(NULL) xmlsec1_LDADD = \ $(LIBXSLT_LIBS) \ $(LIBXML_LIBS) \ $(CRYPTO_LD_ADD) \ $(XMLSEC_LIBS) \ $(XMLSEC_DL_LIBS) \ $(NULL) xmlsec1_DEPENDENCIES = \ $(CRYPTO_DEPS) \ $(XMLSEC_LIBS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign apps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign apps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmlsec1$(EXEEXT): $(xmlsec1_OBJECTS) $(xmlsec1_DEPENDENCIES) $(EXTRA_xmlsec1_DEPENDENCIES) @rm -f xmlsec1$(EXEEXT) $(AM_V_CCLD)$(xmlsec1_LINK) $(xmlsec1_OBJECTS) $(xmlsec1_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlsec.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@ $(NULL) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xmlsec1-1.2.28/apps/xmlsec.c0000644000175000017500000030756413455402476014257 0ustar renerene/** * XML Security standards test: XMLDSig * * See Copyright for the status of this software. * * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. */ #include #include #include #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif #include #include #include #include #include #ifndef XMLSEC_NO_XSLT #include #include #include #include #include #include #endif /* XMLSEC_NO_XSLT */ #define XMLSEC_PRIVATE #include #include #include #include #include #include #include #include #include #include #include #include #include "crypto.h" #include "cmdline.h" static const char copyright[] = "Written by Aleksey Sanin .\n\n" "Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved..\n" "This is free software: see the source for copying information.\n"; static const char bugs[] = "Report bugs to http://www.aleksey.com/xmlsec/bugs.html\n"; static const char helpCommands1[] = "Usage: xmlsec [] []\n" "\n" "xmlsec is a command line tool for signing, verifying, encrypting and\n" "decrypting XML documents. The allowed values are:\n" " --help " "\tdisplay this help information and exit\n" " --help-all " "\tdisplay help information for all commands/options and exit\n" " --help-" "\tdisplay help information for command and exit\n" " --version " "\tprint version information and exit\n" " --keys " "\tkeys XML file manipulation\n"; static const char helpCommands2[] = #ifndef XMLSEC_NO_XMLDSIG " --sign " "\tsign data and output XML document\n" " --verify " "\tverify signed document\n" #ifndef XMLSEC_NO_TMPL_TEST " --sign-tmpl " "\tcreate and sign dynamicaly generated signature template\n" #endif /* XMLSEC_NO_TMPL_TEST */ #endif /* XMLSEC_NO_XMLDSIG */ #ifndef XMLSEC_NO_XMLENC " --encrypt " "\tencrypt data and output XML document\n" " --decrypt " "\tdecrypt data from XML document\n" #endif /* XMLSEC_NO_XMLENC */ ; static const char helpVersion[] = "Usage: xmlsec version\n" "Prints version information and exits\n"; static const char helpKeys[] = "Usage: xmlsec keys [] \n" "Creates a new XML keys file \n"; static const char helpSign[] = "Usage: xmlsec sign [] \n" "Calculates XML Digital Signature using template file \n"; static const char helpVerify[] = "Usage: xmlsec verify [] \n" "Verifies XML Digital Signature in the \n"; static const char helpSignTmpl[] = "Usage: xmlsec sign-tmpl []\n" "Creates a simple dynamic template and calculates XML Digital Signature\n" "(for testing only).\n"; static const char helpEncrypt[] = "Usage: xmlsec encrypt [] \n" "Encrypts data and creates XML Encryption using template file \n"; static const char helpEncryptTmpl[] = "Usage: xmlsec encrypt []\n" "Creates a simple dynamic template and calculates XML Encryption\n"; static const char helpDecrypt[] = "Usage: xmlsec decrypt [] \n" "Decrypts XML Encryption data in the \n"; static const char helpListKeyData[] = "Usage: xmlsec list-key-data\n" "Prints the list of known key data klasses\n"; static const char helpCheckKeyData[] = "Usage: xmlsec check-key-data [ ... ]\n" "Checks the given key-data against the list of known key-data klasses\n"; static const char helpListTransforms[] = "Usage: xmlsec list-transforms\n" "Prints the list of known transform klasses\n"; static const char helpCheckTransforms[] = "Usage: xmlsec check-transforms [ ... ]\n" "Checks the given transforms against the list of known transform klasses\n"; #define xmlSecAppCmdLineTopicGeneral 0x0001 #define xmlSecAppCmdLineTopicDSigCommon 0x0002 #define xmlSecAppCmdLineTopicDSigSign 0x0004 #define xmlSecAppCmdLineTopicDSigVerify 0x0008 #define xmlSecAppCmdLineTopicEncCommon 0x0010 #define xmlSecAppCmdLineTopicEncEncrypt 0x0020 #define xmlSecAppCmdLineTopicEncDecrypt 0x0040 /* #define UNUSED 0x0080 */ #define xmlSecAppCmdLineTopicKeysMngr 0x1000 #define xmlSecAppCmdLineTopicX509Certs 0x2000 #define xmlSecAppCmdLineTopicVersion 0x4000 #define xmlSecAppCmdLineTopicCryptoConfig 0x8000 #define xmlSecAppCmdLineTopicAll 0xFFFF /**************************************************************** * * General configuration params * ***************************************************************/ static xmlSecAppCmdLineParam helpParam = { xmlSecAppCmdLineTopicGeneral, "--help", "-h", "--help" "\n\tprint help information about the command", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam cryptoParam = { xmlSecAppCmdLineTopicCryptoConfig, "--crypto", NULL, "--crypto " "\n\tthe name of the crypto engine to use from the following" "\n\tlist: openssl, mscrypto, nss, gnutls, gcrypt (if no crypto engine is" "\n\tspecified then the default one is used)", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam cryptoConfigParam = { xmlSecAppCmdLineTopicCryptoConfig, "--crypto-config", NULL, "--crypto-config " "\n\tpath to crypto engine configuration", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam repeatParam = { xmlSecAppCmdLineTopicCryptoConfig, "--repeat", "-r", "--repeat " "\n\trepeat the operation times", xmlSecAppCmdLineParamTypeNumber, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam disableErrorMsgsParam = { xmlSecAppCmdLineTopicGeneral, "--disable-error-msgs", NULL, "--disable-error-msgs" "\n\tdo not print xmlsec error messages", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam printCryptoErrorMsgsParam = { xmlSecAppCmdLineTopicGeneral, "--print-crypto-error-msgs", NULL, "--print-crypto-error-msgs" "\n\tprint errors stack at the end", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; /**************************************************************** * * Keys Manager params * ***************************************************************/ static xmlSecAppCmdLineParam genKeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--gen-key", "-g", "--gen-key[:] -" "\n\tgenerate new key of bits size," "\n\tset the key name to and add the result to keys" "\n\tmanager (for example, \"--gen:mykey rsa-1024\" generates" "\n\ta new 1024 bits RSA key and sets it's name to \"mykey\")", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam keysFileParam = { xmlSecAppCmdLineTopicKeysMngr, "--keys-file", "-k", "--keys-file " "\n\tload keys from XML file", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam privkeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--privkey-pem", "--privkey", "--privkey-pem[:] [,[,[...]]]" "\n\tload private key from PEM file and certificates" "\n\tthat verify this key", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam privkeyDerParam = { xmlSecAppCmdLineTopicKeysMngr, "--privkey-der", NULL, "--privkey-der[:] [,[,[...]]]" "\n\tload private key from DER file and certificates" "\n\tthat verify this key", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pkcs8PemParam = { xmlSecAppCmdLineTopicKeysMngr, "--pkcs8-pem", "--privkey-p8-pem", "--pkcs8-pem[:] [,[,[...]]]" "\n\tload private key from PKCS8 PEM file and PEM certificates" "\n\tthat verify this key", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pkcs8DerParam = { xmlSecAppCmdLineTopicKeysMngr, "--pkcs8-der", "--privkey-p8-der", "--pkcs8-der[:] [,[,[...]]]" "\n\tload private key from PKCS8 DER file and DER certificates" "\n\tthat verify this key", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pubkeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--pubkey-pem", "--pubkey", "--pubkey-pem[:] " "\n\tload public key from PEM file", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pubkeyDerParam = { xmlSecAppCmdLineTopicKeysMngr, "--pubkey-der", NULL, "--pubkey-der[:] " "\n\tload public key from DER file", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; #ifndef XMLSEC_NO_AES static xmlSecAppCmdLineParam aeskeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--aeskey", NULL, "--aeskey[:] " "\n\tload AES key from binary file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; #endif /* XMLSEC_NO_AES */ #ifndef XMLSEC_NO_DES static xmlSecAppCmdLineParam deskeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--deskey", NULL, "--deskey[:] " "\n\tload DES key from binary file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; #endif /* XMLSEC_NO_DES */ #ifndef XMLSEC_NO_HMAC static xmlSecAppCmdLineParam hmackeyParam = { xmlSecAppCmdLineTopicKeysMngr, "--hmackey", NULL, "--hmackey[:] " "\n\tload HMAC key from binary file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; #endif /* XMLSEC_NO_HMAC */ static xmlSecAppCmdLineParam pwdParam = { xmlSecAppCmdLineTopicKeysMngr, "--pwd", NULL, "--pwd " "\n\tthe password to use for reading keys and certs", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam enabledKeyDataParam = { xmlSecAppCmdLineTopicKeysMngr, "--enabled-key-data", NULL, "--enabled-key-data " "\n\tcomma separated list of enabled key data (list of " "\n\tregistered key data klasses is available with \"--list-key-data\"" "\n\tcommand); by default, all registered key data are enabled", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam enabledRetrievalMethodUrisParam = { xmlSecAppCmdLineTopicKeysMngr, "--enabled-retrieval-method-uris", NULL, "--enabled-retrieval-uris " "\n\tcomma separated list of of the following values:" "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI" "\n\tattribute values for the element.", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagNone, NULL }; /**************************************************************** * * Common params * ***************************************************************/ static xmlSecAppCmdLineParam sessionKeyParam = { xmlSecAppCmdLineTopicDSigSign | xmlSecAppCmdLineTopicEncEncrypt, "--session-key", NULL, "--session-key -" "\n\tgenerate new session key of bits size" "\n\t(for example, \"--session des-192\" generates a new 192 bits" "\n\tDES key for DES3 encryption)", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam outputParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--output", "-o", "--output " "\n\twrite result document to file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam nodeIdParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--node-id", NULL, "--node-id " "\n\tset the operation start point to the node with given ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam nodeNameParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--node-name", NULL, "--node-name [:]" "\n\tset the operation start point to the first node" "\n\twith given and URI", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam nodeXPathParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--node-xpath", NULL, "--node-xpath " "\n\tset the operation start point to the first node" "\n\tselected by the specified XPath expression", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam dtdFileParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--dtd-file", NULL, "--dtd-file " "\n\tload the specified file as the DTD", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam printDebugParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--print-debug", NULL, "--print-debug" "\n\tprint debug information to stdout", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam printXmlDebugParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--print-xml-debug", NULL, "--print-xml-debug" "\n\tprint debug information to stdout in xml format", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam idAttrParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--id-attr", NULL, "--id-attr[:] [:]" "\n\tadds attributes (default value \"id\") from all nodes" "\n\twith and namespace to the list of" "\n\tknown ID attributes; this is a hack and if you can use DTD or schema" "\n\tto declare ID attributes instead (see \"--dtd-file\" option)," "\n\tI don't know what else might be broken in your application when" "\n\tyou use this hack", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam xxeParam = { xmlSecAppCmdLineTopicAll, "--xxe", NULL, "--xxe" "\n\tenable External Entity resolution." "\n\tWARNING: this may allow the reading of arbitrary files and URLs," "\n\tcontrolled by the input XML document. Use with caution!", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam urlMapParam = { xmlSecAppCmdLineTopicDSigCommon | xmlSecAppCmdLineTopicEncCommon, "--url-map", NULL, "--url-map: " "\n\tmaps a given to the given for loading external resources", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; /**************************************************************** * * Common dsig params * ***************************************************************/ #ifndef XMLSEC_NO_XMLDSIG static xmlSecAppCmdLineParam ignoreManifestsParam = { xmlSecAppCmdLineTopicDSigCommon, "--ignore-manifests", NULL, "--ignore-manifests" "\n\tdo not process elements", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam storeReferencesParam = { xmlSecAppCmdLineTopicDSigCommon, "--store-references", NULL, "--store-references" "\n\tstore and print the result of element processing" "\n\tjust before calculating digest", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam storeSignaturesParam = { xmlSecAppCmdLineTopicDSigCommon, "--store-signatures", NULL, "--store-signatures" "\n\tstore and print the result of processing" "\n\tjust before calculating signature", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam enabledRefUrisParam = { xmlSecAppCmdLineTopicDSigCommon, "--enabled-reference-uris", NULL, "--enabled-reference-uris " "\n\tcomma separated list of of the following values:" "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI" "\n\tattribute values for the element", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam enableVisa3DHackParam = { xmlSecAppCmdLineTopicDSigCommon, "--enable-visa3d-hack", NULL, "--enable-visa3d-hack" "\n\tenables Visa3D protocol specific hack for URI attributes processing" "\n\twhen we are trying not to use XPath/XPointer engine; this is a hack" "\n\tand I don't know what else might be broken in your application when" "\n\tyou use it (also check \"--id-attr\" option because you might need it)", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; #endif /* XMLSEC_NO_XMLDSIG */ /**************************************************************** * * Enc params * ***************************************************************/ #ifndef XMLSEC_NO_XMLENC static xmlSecAppCmdLineParam enabledCipherRefUrisParam = { xmlSecAppCmdLineTopicEncCommon, "--enabled-cipher-reference-uris", NULL, "--enabled-cipher-reference-uris " "\n\tcomma separated list of of the following values:" "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI" "\n\tattribute values for the element", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam binaryDataParam = { xmlSecAppCmdLineTopicEncEncrypt, "--binary-data", "--binary", "--binary-data " "\n\tbinary to encrypt", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam xmlDataParam = { xmlSecAppCmdLineTopicEncEncrypt, "--xml-data", NULL, "--xml-data " "\n\tXML to encrypt", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagNone, NULL }; #endif /* XMLSEC_NO_XMLENC */ /**************************************************************** * * X509 params * ***************************************************************/ #ifndef XMLSEC_NO_X509 static xmlSecAppCmdLineParam pkcs12Param = { xmlSecAppCmdLineTopicKeysMngr, "--pkcs12", NULL, "--pkcs12[:] " "\n\tload load private key from pkcs12 file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pkcs12PersistParam = { xmlSecAppCmdLineTopicKeysMngr, "--pkcs12-persist", NULL, "--pkcs12-persist" "\n\tpersist loaded private key", xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamFlagNone, NULL }; static xmlSecAppCmdLineParam pubkeyCertParam = { xmlSecAppCmdLineTopicKeysMngr, "--pubkey-cert-pem", "--pubkey-cert", "--pubkey-cert-pem[:] " "\n\tload public key from PEM cert file", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam pubkeyCertDerParam = { xmlSecAppCmdLineTopicKeysMngr, "--pubkey-cert-der", NULL, "--pubkey-cert-der[:] " "\n\tload public key from DER cert file", xmlSecAppCmdLineParamTypeStringList, xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam trustedParam = { xmlSecAppCmdLineTopicX509Certs, "--trusted-pem", "--trusted", "--trusted-pem " "\n\tload trusted (root) certificate from PEM file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam untrustedParam = { xmlSecAppCmdLineTopicX509Certs, "--untrusted-pem", "--untrusted", "--untrusted-pem " "\n\tload untrusted certificate from PEM file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam trustedDerParam = { xmlSecAppCmdLineTopicX509Certs, "--trusted-der", NULL, "--trusted-der " "\n\tload trusted (root) certificate from DER file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam untrustedDerParam = { xmlSecAppCmdLineTopicX509Certs, "--untrusted-der", NULL, "--untrusted-der " "\n\tload untrusted certificate from DER file ", xmlSecAppCmdLineParamTypeString, xmlSecAppCmdLineParamFlagMultipleValues, NULL }; static xmlSecAppCmdLineParam verificationTimeParam = { xmlSecAppCmdLineTopicX509Certs, "--verification-time", NULL, "--verification-time