diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-27 15:33:38 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-27 15:39:05 +0900 |
commit | d4d35351fd63a7051a7cbef2002cb0c641925ec3 (patch) | |
tree | d390d823f40a886547b932f9bd9239fe81ef6056 /apps | |
parent | caccc67c33486a1d1b29f227071851961b29a722 (diff) | |
download | xmlsec1-d4d35351fd63a7051a7cbef2002cb0c641925ec3.tar.gz xmlsec1-d4d35351fd63a7051a7cbef2002cb0c641925ec3.tar.bz2 xmlsec1-d4d35351fd63a7051a7cbef2002cb0c641925ec3.zip |
Imported Upstream version 1.2.22upstream/1.2.22upstream
Change-Id: I4d17734839f021e46aef7a30483ac17e8c85fb1d
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Makefile.am | 8 | ||||
-rw-r--r-- | apps/Makefile.in | 253 | ||||
-rw-r--r-- | apps/cmdline.c | 8 | ||||
-rw-r--r-- | apps/cmdline.h | 2 | ||||
-rw-r--r-- | apps/crypto.c | 4 | ||||
-rw-r--r-- | apps/crypto.h | 2 | ||||
-rw-r--r-- | apps/xmlsec.c | 302 |
7 files changed, 211 insertions, 368 deletions
diff --git a/apps/Makefile.am b/apps/Makefile.am index 278ddf49..cbaf4398 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am @@ -9,7 +9,7 @@ XMLSEC_LIBS = $(top_builddir)/src/libxmlsec1.la if XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING CRYPTO_DEPS = \ - $(top_builddir)/src/$(XMLSEC_CRYPTO)/lib$(XMLSEC_CRYPTO_LIB).la \ + $(top_builddir)/src/@XMLSEC_DEFAULT_CRYPTO@/lib$(XMLSEC_CRYPTO_LIB).la \ $(NULL) CRYPTO_INCLUDES = \ @@ -42,9 +42,7 @@ CRYPTO_LD_ADD = \ endif - -INCLUDES = \ - -DXMLSEC_CRYPTO=\"@XMLSEC_CRYPTO@\" \ +AM_CFLAGS = \ -DPACKAGE=\"@PACKAGE@\" \ -I../include \ -I$(top_srcdir)/include \ @@ -65,8 +63,8 @@ xmlsec1_SOURCES = \ xmlsec1_LDFLAGS = \ - $(CRYPTO_LD_FLAGS) \ @XMLSEC_STATIC_BINARIES@ \ + $(CRYPTO_LD_FLAGS) \ $(NULL) xmlsec1_LDADD = \ diff --git a/apps/Makefile.in b/apps/Makefile.in index 601bf8d8..cbe43917 100644 --- a/apps/Makefile.in +++ b/apps/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2014 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. @@ -16,6 +15,61 @@ @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@ @@ -36,14 +90,14 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xmlsec1$(EXEEXT) subdir = apps -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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.in + $(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 = @@ -56,7 +110,7 @@ am_xmlsec1_OBJECTS = xmlsec.$(OBJEXT) crypto.$(OBJEXT) \ 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_CRYPTO)/lib$(XMLSEC_CRYPTO_LIB).la \ +@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) @@ -66,9 +120,22 @@ 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 @@ -81,24 +148,43 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(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_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +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_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +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@ @@ -135,6 +221,10 @@ 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_MKTMPL = @GTKDOC_MKTMPL@ +GTKDOC_SCAN = @GTKDOC_SCAN@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -154,6 +244,7 @@ LIBXSLT_CFLAGS = @LIBXSLT_CFLAGS@ LIBXSLT_CONFIG = @LIBXSLT_CONFIG@ 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@ @@ -192,6 +283,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKGCONFIG_PRESENT = @PKGCONFIG_PRESENT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ @@ -208,7 +300,6 @@ XMLSEC_APP_DEFINES = @XMLSEC_APP_DEFINES@ XMLSEC_CFLAGS = @XMLSEC_CFLAGS@ XMLSEC_CORE_CFLAGS = @XMLSEC_CORE_CFLAGS@ XMLSEC_CORE_LIBS = @XMLSEC_CORE_LIBS@ -XMLSEC_CRYPTO = @XMLSEC_CRYPTO@ XMLSEC_CRYPTO_CFLAGS = @XMLSEC_CRYPTO_CFLAGS@ XMLSEC_CRYPTO_DISABLED_LIST = @XMLSEC_CRYPTO_DISABLED_LIST@ XMLSEC_CRYPTO_EXTRA_LDFLAGS = @XMLSEC_CRYPTO_EXTRA_LDFLAGS@ @@ -216,6 +307,7 @@ 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@ @@ -235,6 +327,7 @@ 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@ @@ -249,7 +342,6 @@ 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_XKMS = @XMLSEC_NO_XKMS@ XMLSEC_NO_XMLDSIG = @XMLSEC_NO_XMLDSIG@ XMLSEC_NO_XMLENC = @XMLSEC_NO_XMLENC@ XMLSEC_NSS_CFLAGS = @XMLSEC_NSS_CFLAGS@ @@ -264,6 +356,7 @@ 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@ @@ -323,7 +416,7 @@ 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_CRYPTO)/lib$(XMLSEC_CRYPTO_LIB).la \ +@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 = \ @@ -348,8 +441,7 @@ NULL = @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(CRYPTO_DEPS) \ @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@ $(NULL) -INCLUDES = \ - -DXMLSEC_CRYPTO=\"@XMLSEC_CRYPTO@\" \ +AM_CFLAGS = \ -DPACKAGE=\"@PACKAGE@\" \ -I../include \ -I$(top_srcdir)/include \ @@ -370,8 +462,8 @@ xmlsec1_SOURCES = \ $(NULL) xmlsec1_LDFLAGS = \ - $(CRYPTO_LD_FLAGS) \ @XMLSEC_STATIC_BINARIES@ \ + $(CRYPTO_LD_FLAGS) \ $(NULL) xmlsec1_LDADD = \ @@ -403,7 +495,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu apps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu apps/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -423,14 +514,19 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @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; \ + 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|.*|.|' \ + 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 } \ @@ -451,7 +547,8 @@ uninstall-binPROGRAMS: @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)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -464,6 +561,7 @@ clean-binPROGRAMS: 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) @@ -479,22 +577,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlsec.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@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 $@ $< @@ -505,26 +606,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +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`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -536,15 +626,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +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 @@ -553,6 +639,21 @@ 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 @@ -696,19 +797,21 @@ uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags 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 uninstall uninstall-am \ - uninstall-binPROGRAMS +.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) diff --git a/apps/cmdline.c b/apps/cmdline.c index b9ecafb5..f477a4b6 100644 --- a/apps/cmdline.c +++ b/apps/cmdline.c @@ -5,9 +5,9 @@ * * See Copyright for the status of this software. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif @@ -152,7 +152,7 @@ xmlSecAppCmdLineValueCreate(xmlSecAppCmdLineParamPtr param, int pos) { assert(param != NULL); value = (xmlSecAppCmdLineValuePtr) malloc(sizeof(xmlSecAppCmdLineValue)); if(value == NULL) { - fprintf(stderr, "Error: malloc failed (%d bytes).\n", sizeof(xmlSecAppCmdLineValue)); + fprintf(stderr, "Error: malloc failed (%d bytes).\n", (int)sizeof(xmlSecAppCmdLineValue)); return(NULL); } memset(value, 0, sizeof(xmlSecAppCmdLineValue)); @@ -284,7 +284,7 @@ xmlSecAppCmdLineParamRead(xmlSecAppCmdLineParamPtr param, const char** argv, int value->strValue = argv[++pos]; buf = (char*)malloc(strlen(value->strValue) + 2); if(buf == NULL) { - fprintf(stderr, "Error: failed to allocate memory (%d bytes).\n", strlen(value->strValue) + 2); + fprintf(stderr, "Error: failed to allocate memory (%d bytes).\n", (int)strlen(value->strValue) + 2); return(-1); } memset(buf, 0, strlen(value->strValue) + 2); diff --git a/apps/cmdline.h b/apps/cmdline.h index 9466f972..f47a201d 100644 --- a/apps/cmdline.h +++ b/apps/cmdline.h @@ -5,7 +5,7 @@ * * See Copyright for the status of this software. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ #ifndef __XMLSEC_APPS_CMDLINE_H__ #define __XMLSEC_APPS_CMDLINE_H__ diff --git a/apps/crypto.c b/apps/crypto.c index 49dd127c..1e53bc72 100644 --- a/apps/crypto.c +++ b/apps/crypto.c @@ -5,9 +5,9 @@ * * See Copyright for the status of this software. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif diff --git a/apps/crypto.h b/apps/crypto.h index 63a94a40..b41d0c0d 100644 --- a/apps/crypto.h +++ b/apps/crypto.h @@ -4,7 +4,7 @@ * * See Copyright for the status of this software. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ #ifndef __XMLSEC_APPS_CRYPTO_H__ #define __XMLSEC_APPS_CRYPTO_H__ diff --git a/apps/xmlsec.c b/apps/xmlsec.c index d551b5a6..94ac80af 100644 --- a/apps/xmlsec.c +++ b/apps/xmlsec.c @@ -3,13 +3,13 @@ * * See Copyright for the status of this software. * - * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> + * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ #include <stdlib.h> #include <string.h> #include <time.h> -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif @@ -36,7 +36,6 @@ #include <xmlsec/transforms.h> #include <xmlsec/xmldsig.h> #include <xmlsec/xmlenc.h> -#include <xmlsec/xkms.h> #include <xmlsec/parser.h> #include <xmlsec/templates.h> #include <xmlsec/errors.h> @@ -46,7 +45,7 @@ static const char copyright[] = "Written by Aleksey Sanin <aleksey@aleksey.com>.\n\n" - "Copyright (C) 2002-2003 Aleksey Sanin.\n" + "Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved..\n" "This is free software: see the source for copying information.\n"; static const char bugs[] = @@ -75,9 +74,6 @@ static const char helpCommands2[] = " --encrypt " "\tencrypt data and output XML document\n" " --decrypt " "\tdecrypt data from XML document\n" #endif /* XMLSEC_NO_XMLENC */ -#ifndef XMLSEC_NO_XKMS - " --xkms-server-request ""\tprocess data as XKMS server request\n" -#endif /* XMLSEC_NO_XKMS */ ; static const char helpVersion[] = @@ -113,10 +109,6 @@ static const char helpDecrypt[] = "Usage: xmlsec decrypt [<options>] <file>\n" "Decrypts XML Encryption data in the <file>\n"; -static const char helpXkmsServerRequest[] = - "Usage: xmlsec xkms-server-request [<options>] <file>\n" - "Processes the <file> as XKMS server request and outputs the response\n"; - static const char helpListKeyData[] = "Usage: xmlsec list-key-data\n" "Prints the list of known key data klasses\n"; @@ -140,7 +132,7 @@ static const char helpCheckTransforms[] = #define xmlSecAppCmdLineTopicEncCommon 0x0010 #define xmlSecAppCmdLineTopicEncEncrypt 0x0020 #define xmlSecAppCmdLineTopicEncDecrypt 0x0040 -#define xmlSecAppCmdLineTopicXkmsCommon 0x0080 +/* #define UNUSED 0x0080 */ #define xmlSecAppCmdLineTopicKeysMngr 0x1000 #define xmlSecAppCmdLineTopicX509Certs 0x2000 #define xmlSecAppCmdLineTopicVersion 0x4000 @@ -419,8 +411,7 @@ static xmlSecAppCmdLineParam sessionKeyParam = { static xmlSecAppCmdLineParam outputParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--output", "-o", "--output <filename>" @@ -432,8 +423,7 @@ static xmlSecAppCmdLineParam outputParam = { static xmlSecAppCmdLineParam nodeIdParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--node-id", NULL, "--node-id <id>" @@ -445,8 +435,7 @@ static xmlSecAppCmdLineParam nodeIdParam = { static xmlSecAppCmdLineParam nodeNameParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--node-name", NULL, "--node-name [<namespace-uri>:]<name>" @@ -459,8 +448,7 @@ static xmlSecAppCmdLineParam nodeNameParam = { static xmlSecAppCmdLineParam nodeXPathParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--node-xpath", NULL, "--node-xpath <expr>" @@ -473,8 +461,7 @@ static xmlSecAppCmdLineParam nodeXPathParam = { static xmlSecAppCmdLineParam dtdFileParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--dtd-file", NULL, "--dtd-file <file>" @@ -486,8 +473,7 @@ static xmlSecAppCmdLineParam dtdFileParam = { static xmlSecAppCmdLineParam printDebugParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--print-debug", NULL, "--print-debug" @@ -499,8 +485,7 @@ static xmlSecAppCmdLineParam printDebugParam = { static xmlSecAppCmdLineParam printXmlDebugParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--print-xml-debug", NULL, "--print-xml-debug" @@ -512,8 +497,7 @@ static xmlSecAppCmdLineParam printXmlDebugParam = { static xmlSecAppCmdLineParam idAttrParam = { xmlSecAppCmdLineTopicDSigCommon | - xmlSecAppCmdLineTopicEncCommon | - xmlSecAppCmdLineTopicXkmsCommon, + xmlSecAppCmdLineTopicEncCommon, "--id-attr", NULL, "--id-attr[:<attr-name>] [<node-namespace-uri>:]<node-name>" @@ -641,72 +625,6 @@ static xmlSecAppCmdLineParam xmlDataParam = { }; #endif /* XMLSEC_NO_XMLENC */ -/**************************************************************** - * - * XKMS params - * - ***************************************************************/ -#ifndef XMLSEC_NO_XKMS -static xmlSecAppCmdLineParam xkmsServiceParam = { - xmlSecAppCmdLineTopicXkmsCommon, - "--xkms-service", - NULL, - "--xkms-service <uri>" - "\n\tsets XKMS \"Service\" <uri>", - xmlSecAppCmdLineParamTypeString, - xmlSecAppCmdLineParamFlagNone, - NULL -}; - -static xmlSecAppCmdLineParam xkmsFormatParam = { - xmlSecAppCmdLineTopicXkmsCommon, - "--xkms-format", - NULL, - "--xkms-format <format>" - "\n\tsets the XKMS request/response format to one of the following values:" - "\n\t \"plain\" (default), \"soap-1.1\" or \"soap-1.2\"", - xmlSecAppCmdLineParamTypeString, - xmlSecAppCmdLineParamFlagNone, - NULL -}; - -static xmlSecAppCmdLineParam xkmsStopUnknownResponseMechanismParam = { - xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */ - "--xkms-stop-on-unknown-response-mechanism", - NULL, - "--xkms-stop-on-unknown-response-mechanism" - "\n\tstop processing XKMS server request if unknown ResponseMechanism" - "\n\tvalue was found", - xmlSecAppCmdLineParamTypeFlag, - xmlSecAppCmdLineParamFlagNone, - NULL -}; - -static xmlSecAppCmdLineParam xkmsStopUnknownRespondWithParam = { - xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */ - "--xkms-stop-on-unknown-respond-with", - NULL, - "--xkms-stop-on-unknown-respond-with" - "\n\tstop processing XKMS server request if unknown RespondWith" - "\n\tvalue was found", - xmlSecAppCmdLineParamTypeFlag, - xmlSecAppCmdLineParamFlagNone, - NULL -}; - -static xmlSecAppCmdLineParam xkmsStopUnknownKeyUsageParam = { - xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */ - "--xkms-stop-on-unknown-key-usage", - NULL, - "--xkms-stop-on-unknown-key-usage" - "\n\tstop processing XKMS server request if unknown KeyUsage" - "\n\tvalue was found", - xmlSecAppCmdLineParamTypeFlag, - xmlSecAppCmdLineParamFlagNone, - NULL -}; - -#endif /* XMLSEC_NO_XKMS */ /**************************************************************** * @@ -842,15 +760,6 @@ static xmlSecAppCmdLineParamPtr parameters[] = { &xmlDataParam, &enabledCipherRefUrisParam, #endif /* XMLSEC_NO_XMLENC */ - - /* xkms params */ -#ifndef XMLSEC_NO_XKMS - &xkmsServiceParam, - &xkmsFormatParam, - &xkmsStopUnknownResponseMechanismParam, - &xkmsStopUnknownRespondWithParam, - &xkmsStopUnknownKeyUsageParam, -#endif /* XMLSEC_NO_XKMS */ /* common dsig and enc parameters */ &sessionKeyParam, @@ -923,8 +832,7 @@ typedef enum { xmlSecAppCommandSignTmpl, xmlSecAppCommandEncrypt, xmlSecAppCommandDecrypt, - xmlSecAppCommandEncryptTmpl, - xmlSecAppCommandXkmsServerRequest + xmlSecAppCommandEncryptTmpl } xmlSecAppCommand; typedef struct _xmlSecAppXmlData xmlSecAppXmlData, @@ -972,12 +880,6 @@ static int xmlSecAppPrepareEncCtx (xmlSecEncCtxPtr static void xmlSecAppPrintEncCtx (xmlSecEncCtxPtr encCtx); #endif /* XMLSEC_NO_XMLENC */ -#ifndef XMLSEC_NO_XKMS -static int xmlSecAppXkmsServerProcess (const char* filename); -static int xmlSecAppPrepareXkmsServerCtx (xmlSecXkmsServerCtxPtr xkmsServerCtx); -static void xmlSecAppPrintXkmsServerCtx (xmlSecXkmsServerCtxPtr xkmsServerCtx); -#endif /* XMLSEC_NO_XKMS */ - static void xmlSecAppListKeyData (void); static int xmlSecAppCheckKeyData (const char * name); static void xmlSecAppListTransforms (void); @@ -997,7 +899,7 @@ xmlSecKeysMngrPtr gKeysMngr = NULL; int repeats = 1; int print_debug = 0; clock_t total_time = 0; -const char* xmlsec_crypto = XMLSEC_CRYPTO; +const char* xmlsec_crypto = NULL; const char* tmp = NULL; int main(int argc, const char **argv) { @@ -1023,7 +925,7 @@ int main(int argc, const char **argv) { xmlSecAppPrintHelp(subCommand, cmdLineTopics); goto success; } else if(command == xmlSecAppCommandVersion) { - fprintf(stdout, "%s %s (%s)\n", PACKAGE, XMLSEC_VERSION, xmlsec_crypto); + fprintf(stdout, "%s %s (%s)\n", PACKAGE, XMLSEC_VERSION, xmlSecGetDefaultCrypto()); goto success; } @@ -1048,9 +950,8 @@ int main(int argc, const char **argv) { case xmlSecAppCommandVerify: case xmlSecAppCommandEncrypt: case xmlSecAppCommandDecrypt: - case xmlSecAppCommandXkmsServerRequest: if(pos >= argc) { - fprintf(stderr, "Error: <file> parameter is requried for this command\n"); + fprintf(stderr, "Error: <file> parameter is required for this command\n"); xmlSecAppPrintUsage(); goto fail; } @@ -1067,8 +968,8 @@ int main(int argc, const char **argv) { xmlsec_crypto = tmp; } #else /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */ - if((tmp != NULL) && (strcmp(tmp, xmlsec_crypto) != 0)) { - fprintf(stderr, "Error: dynaimc crypto libraries loading is disabled and the only available crypto library is '%s'\n", xmlsec_crypto); + if((tmp != NULL) && (xmlStrcmp(BAD_CAST tmp, xmlSecGetDefaultCrypto()) != 0)) { + fprintf(stderr, "Error: dynaimc crypto libraries loading is disabled and the only available crypto library is '%s'\n", xmlSecGetDefaultCrypto()); xmlSecAppPrintUsage(); goto fail; } @@ -1185,16 +1086,6 @@ int main(int argc, const char **argv) { #endif /* XMLSEC_NO_TMPL_TEST */ #endif /* XMLSEC_NO_XMLENC */ -#ifndef XMLSEC_NO_XKMS - case xmlSecAppCommandXkmsServerRequest: - for(i = pos; i < argc; ++i) { - if(xmlSecAppXkmsServerProcess(argv[i]) < 0) { - fprintf(stderr, "Error: failed to process XKMS server request from file \"%s\"\n", argv[i]); - goto fail; - } - } - break; -#endif /* XMLSEC_NO_XKMS */ default: fprintf(stderr, "Error: invalid command %d\n", command); xmlSecAppPrintUsage(); @@ -1883,142 +1774,6 @@ xmlSecAppPrintEncCtx(xmlSecEncCtxPtr encCtx) { #endif /* XMLSEC_NO_XMLENC */ -#ifndef XMLSEC_NO_XKMS -static int -xmlSecAppXkmsServerProcess(const char* filename) { - xmlSecAppXmlDataPtr data = NULL; - xmlDocPtr doc = NULL; - xmlNodePtr result; - xmlSecXkmsServerCtx xkmsServerCtx; - xmlSecXkmsServerFormat format = xmlSecXkmsServerFormatPlain; - clock_t start_time; - int res = -1; - - if(filename == NULL) { - return(-1); - } - - if(xmlSecXkmsServerCtxInitialize(&xkmsServerCtx, gKeysMngr) < 0) { - fprintf(stderr, "Error: XKMS server context initialization failed\n"); - return(-1); - } - if(xmlSecAppPrepareXkmsServerCtx(&xkmsServerCtx) < 0) { - fprintf(stderr, "Error: XKMS server context preparation failed\n"); - goto done; - } - - /* get the input format */ - if(xmlSecAppCmdLineParamGetString(&xkmsFormatParam) != NULL) { - format = xmlSecXkmsServerFormatFromString(BAD_CAST xmlSecAppCmdLineParamGetString(&xkmsFormatParam)); - if(format == xmlSecXkmsServerFormatUnknown) { - fprintf(stderr, "Error: unknown format \"%s\"\n", - xmlSecAppCmdLineParamGetString(&xkmsFormatParam)); - return(-1); - } - } - - /* parse template and select start node, there are multiple options - * for start node thus we don't provide the default start node name */ - data = xmlSecAppXmlDataCreate(filename, NULL, NULL); - if(data == NULL) { - fprintf(stderr, "Error: failed to load request from file \"%s\"\n", filename); - goto done; - } - - /* prepare result document */ - doc = xmlNewDoc(BAD_CAST "1.0"); - if(doc == NULL) { - fprintf(stderr, "Error: failed to create doc\n"); - goto done; - } - - start_time = clock(); - result = xmlSecXkmsServerCtxProcess(&xkmsServerCtx, data->startNode, format, doc); - if(result == NULL) { - fprintf(stderr, "Error: failed to process xkms server request\n"); - goto done; - } - total_time += clock() - start_time; - - - /* print out result only once per execution */ - xmlDocSetRootElement(doc, result); - if(repeats <= 1) { - if(xmlSecAppWriteResult(doc, NULL) < 0) { - goto done; - } - } - - res = 0; - -done: - /* print debug info if requested */ - if(repeats <= 1) { - xmlSecAppPrintXkmsServerCtx(&xkmsServerCtx); - } - xmlSecXkmsServerCtxFinalize(&xkmsServerCtx); - - if(doc != NULL) { - xmlFreeDoc(doc); - } - if(data != NULL) { - xmlSecAppXmlDataDestroy(data); - } - return(res); -} - -static int -xmlSecAppPrepareXkmsServerCtx(xmlSecXkmsServerCtxPtr xkmsServerCtx) { - if(xkmsServerCtx == NULL) { - fprintf(stderr, "Error: XKMS context is null\n"); - return(-1); - } - - /* set key info params */ - if(xmlSecAppPrepareKeyInfoReadCtx(&(xkmsServerCtx->keyInfoReadCtx)) < 0) { - fprintf(stderr, "Error: failed to prepare key info context\n"); - return(-1); - } - - if(xmlSecAppCmdLineParamGetString(&xkmsServiceParam) != NULL) { - xkmsServerCtx->expectedService = xmlStrdup(BAD_CAST xmlSecAppCmdLineParamGetString(&xkmsServiceParam)); - if(xkmsServerCtx->expectedService == NULL) { - fprintf(stderr, "Error: failed to duplicate string \"%s\"\n", - xmlSecAppCmdLineParamGetString(&xkmsServiceParam)); - return(-1); - } - } - - if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownResponseMechanismParam)) { - xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_RESPONSE_MECHANISM; - } - if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownRespondWithParam)) { - xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_RESPOND_WITH; - } - if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownKeyUsageParam)) { - xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_KEY_USAGE; - } - return(0); -} - -static void -xmlSecAppPrintXkmsServerCtx(xmlSecXkmsServerCtxPtr xkmsServerCtx) { - if(xkmsServerCtx == NULL) { - return; - } - - /* print debug info if requested */ - if((print_debug != 0) || xmlSecAppCmdLineParamIsSet(&printDebugParam)) { - xmlSecXkmsServerCtxDebugDump(xkmsServerCtx, stdout); - } - - if(xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) { - xmlSecXkmsServerCtxDebugXmlDump(xkmsServerCtx, stdout); - } -} - -#endif /* XMLSEC_NO_XKMS */ - static void xmlSecAppListKeyData(void) { fprintf(stdout, "Registered key data klasses:\n"); @@ -2453,7 +2208,9 @@ xmlSecAppInit(void) { fprintf(stderr, "Error: unable to load xmlsec-%s library. Make sure that you have\n" "this it installed, check shared libraries path (LD_LIBRARY_PATH)\n" "envornment variable or use \"--crypto\" option to specify different\n" - "crypto engine.\n", xmlsec_crypto); + "crypto engine.\n", + ((xmlsec_crypto != NULL) ? BAD_CAST xmlsec_crypto : xmlSecGetDefaultCrypto()) + ); return(-1); } #endif /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */ @@ -2854,18 +2611,6 @@ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics #endif /* XMLSEC_NO_TMPL_TEST */ #endif /* XMLSEC_NO_XMLENC */ -#ifndef XMLSEC_NO_XKMS - if(strcmp(cmd, "--xkms-server-request") == 0) { - (*cmdLineTopics) = - xmlSecAppCmdLineTopicGeneral | - xmlSecAppCmdLineTopicCryptoConfig | - xmlSecAppCmdLineTopicXkmsCommon | - xmlSecAppCmdLineTopicKeysMngr | - xmlSecAppCmdLineTopicX509Certs; - return(xmlSecAppCommandXkmsServerRequest); - } else -#endif /* XMLSEC_NO_XKMS */ - if(1) { (*cmdLineTopics) = 0; return(xmlSecAppCommandUnknown); @@ -2915,9 +2660,6 @@ xmlSecAppPrintHelp(xmlSecAppCommand command, xmlSecAppCmdLineParamTopic topics) case xmlSecAppCommandEncryptTmpl: fprintf(stdout, "%s\n", helpEncryptTmpl); break; - case xmlSecAppCommandXkmsServerRequest: - fprintf(stdout, "%s\n", helpXkmsServerRequest); - break; } if(topics != 0) { fprintf(stdout, "Options:\n"); @@ -2986,7 +2728,7 @@ xmlSecAppWriteResult(xmlDocPtr doc, xmlSecBufferPtr buffer) { if(doc != NULL) { xmlDocDump(f, doc); } else if((buffer != NULL) && (xmlSecBufferGetData(buffer) != NULL)) { - fwrite(xmlSecBufferGetData(buffer), xmlSecBufferGetSize(buffer), 1, f); + (void)fwrite(xmlSecBufferGetData(buffer), xmlSecBufferGetSize(buffer), 1, f); } else { fprintf(stderr, "Error: both result doc and result buffer are null\n"); xmlSecAppCloseFile(f); |