xml-security-c-1.7.3/000755 001751 001751 00000000000 12477614643 015613 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/build-aux/000755 001751 001751 00000000000 12477614644 017506 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/m4/000755 001751 001751 00000000000 12477614642 016132 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/000755 001751 001751 00000000000 12477614644 016556 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Makefile.am000644 001751 001751 00000001677 12475453666 017666 0ustar00scantorscantor000000 000000 # # Copyright 2006-2011 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip ACLOCAL_AMFLAGS = -I m4 SUBDIRS = xsec EXTRA_DIST = \ CHANGELOG.txt \ INSTALL.txt \ LICENSE.txt \ NOTICE.txt \ Projects \ xml-security-c.spec \ xsec/framework/resource.h \ xsec/framework/version.rc \ xsec/tools/threadTest/threadtest.cpp dist-hook: rm -rf `find $(distdir)/Projects -name .svn` xml-security-c-1.7.3/configure000755 001751 001751 00002360767 12475453704 017544 0ustar00scantorscantor000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for XML-Security-C 1.7.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: dev@santuario.apache.org about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='XML-Security-C' PACKAGE_TARNAME='xml-security-c' PACKAGE_VERSION='1.7.3' PACKAGE_STRING='XML-Security-C 1.7.3' PACKAGE_BUGREPORT='dev@santuario.apache.org' PACKAGE_URL='' ac_unique_file="xsec" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS XSEC_AM_HAVE_NSS_FALSE XSEC_AM_HAVE_NSS_TRUE XSEC_AM_HAVE_OPENSSL_FALSE XSEC_AM_HAVE_OPENSSL_TRUE PKG_CONFIG PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_debug with_xerces with_xalan with_openssl with_nss ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures XML-Security-C 1.7.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xml-security-c] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of XML-Security-C 1.7.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Have GCC compile with symbols (Default = no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-xerces=PATH where xerces-c is installed --with-xalan Enable Xalan integration. Values = 'yes' or installation directory (Default = yes) --with-openssl Use Openssl. Values = 'yes' or installation directory (Default = yes) --with-nss Use NSS. Values = 'yes' or installation directory (Default = no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF XML-Security-C configure 1.7.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------------------------- ## ## Report this to dev@santuario.apache.org ## ## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------------------------- ## ## Report this to dev@santuario.apache.org ## ## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES # ----------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_cxx_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by XML-Security-C $as_me 1.7.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xml-security-c' VERSION='1.7.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.5' macro_revision='2.4.5' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # lt_cv_sys_lib... is unaugmented for libtool script decls... lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for # LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=$enableval else enable_debug=no fi if test "$enable_debug" = "yes" ; then GCC_CFLAGS="$CFLAGS -g -D_DEBUG" GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG" else GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG" GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG" fi # Define the files we wish to generate ac_config_files="$ac_config_files Makefile xsec/Makefile" ac_config_headers="$ac_config_headers config.h xsec/framework/XSECConfig.hpp" # Check for basic programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in gcc gcc3 cc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in gcc gcc3 cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ g++3 c++ CC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ g++3 c++ CC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # lt_cv_sys_lib... is unaugmented for libtool script decls... lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for # LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done # Extract the first word of "autoconf", so it can be a program name with args. set dummy autoconf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AUTOCONF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AUTOCONF"; then ac_cv_prog_AUTOCONF="$AUTOCONF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AUTOCONF="autoconf" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_AUTOCONF" && ac_cv_prog_AUTOCONF="true" fi fi AUTOCONF=$ac_cv_prog_AUTOCONF if test -n "$AUTOCONF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOCONF" >&5 $as_echo "$AUTOCONF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GCC" = "yes" ; then CFLAGS="-Wall $GCC_CFLAGS" CXXFLAGS="-Wall $GCC_CXXFLAGS" fi # pthreads ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; *-darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *-osf* | *-hpux*) flag="-D_REENTRANT";; *solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}" LIBS="${LIBS} ${PTHREAD_LIBS}" CC="${PTHREAD_CC}" # Checks for required libraries { $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5 $as_echo_n "checking for floor in -lm... " >&6; } if ${ac_cv_lib_m_floor+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char floor (); int main () { return floor (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_floor=yes else ac_cv_lib_m_floor=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5 $as_echo "$ac_cv_lib_m_floor" >&6; } if test "x$ac_cv_lib_m_floor" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservent in -lsocket" >&5 $as_echo_n "checking for getservent in -lsocket... " >&6; } if ${ac_cv_lib_socket_getservent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getservent (); int main () { return getservent (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_getservent=yes else ac_cv_lib_socket_getservent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getservent" >&5 $as_echo "$ac_cv_lib_socket_getservent" >&6; } if test "x$ac_cv_lib_socket_getservent" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi # Check for required includes for ac_header in unistd.h direct.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "#include " if test "x$ac_cv_have_decl_strcasecmp" = xyes; then : $as_echo "#define XSEC_HAVE_STRCASECMP 1" >>confdefs.h fi # Check whether getcwd can dynamically allocate memory. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd(NULL, 0) works" >&5 $as_echo_n "checking whether getcwd(NULL, 0) works... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { char *cwd = getcwd(NULL, 0); return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_HAVE_GETCWD_DYN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Xerces is required # Check whether --with-xerces was given. if test "${with_xerces+set}" = set; then : withval=$with_xerces; if test x_$with_xerces != x_/usr; then LDFLAGS="-L${with_xerces}/lib $LDFLAGS" CPPFLAGS="-I${with_xerces}/include $CPPFLAGS" fi fi LIBS="-lxerces-c $LIBS" ac_fn_cxx_check_header_mongrel "$LINENO" "xercesc/dom/DOM.hpp" "ac_cv_header_xercesc_dom_DOM_hpp" "$ac_includes_default" if test "x$ac_cv_header_xercesc_dom_DOM_hpp" = xyes; then : else as_fn_error $? "unable to find xerces header files" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Xerces version" >&5 $as_echo_n "checking Xerces version... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if _XERCES_VERSION >= 20000 int i = 0; #else #error cannot use version 1.x #endif ; return 0; } _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 $as_echo "OK" >&6; } else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Xerces-C 2.x or 3.x is required See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.err conftest.i conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { xercesc::XMLPlatformUtils::Initialize() ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else as_fn_error $? "unable to link with Xerces" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Get user options # Check whether --with-xalan was given. if test "${with_xalan+set}" = set; then : withval=$with_xalan; use_xalan=$withval else use_xalan=yes fi if test x"$use_xalan" != "xyes" ; then if test x"$use_xalan" != "xno" ; then XALANCROOT=$use_xalan fi fi # Ensure we are always compiling using library defs CFLAGS="${CFLAGS} -DXSEC_LIBRARY_BUILD" CXXFLAGS="${CXXFLAGS} -DXSEC_LIBRARY_BUILD" # Find out some properties of the version of Xerces we have { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces is 64-bit clean" >&5 $as_echo_n "checking whether Xerces is 64-bit clean... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; XMLFilePos testvar; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_64BITSAFE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces BinInputStream requires getContentType" >&5 $as_echo_n "checking whether Xerces BinInputStream requires getContentType... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; XMLByte buf[1024]; BinMemInputStream in(buf,1024); in.getContentType(); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces XMLFormatter requires a version" >&5 $as_echo_n "checking whether Xerces XMLFormatter requires a version... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { using namespace XERCES_CPP_NAMESPACE; XMLCh s_encoding[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_8, chNull }; XMLFormatter f(s_encoding, NULL, NULL, XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_REQUIRES_MEMMGR 1" >>confdefs.h $as_echo "#define XSEC_XERCES_FORMATTER_REQUIRES_VERSION 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces XMLString has ::release" >&5 $as_echo_n "checking whether Xerces XMLString has ::release... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; XMLCh * tst; XMLString::release(&tst); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_XMLSTRING_HAS_RELEASE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces XMLElement has ::setIdAttribute(XMLCh*)" >&5 $as_echo_n "checking whether Xerces XMLElement has ::setIdAttribute(XMLCh*)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; DOMElement * elt; elt->setIdAttribute(NULL); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } xerces_has_setidattribute=yes $as_echo "#define XSEC_XERCES_HAS_SETIDATTRIBUTE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test -z "$xerces_has_setidattribute" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces XMLElement has ::setIdAttribute(XMLCh*, bool)" >&5 $as_echo_n "checking whether Xerces XMLElement has ::setIdAttribute(XMLCh*, bool)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; DOMElement * elt; elt->setIdAttribute(NULL, false); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } xerces_has_setidattribute=yes $as_echo "#define XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # For Xerces 3.x we now have a stricter DOM L3 implementation { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces DOMImplementationLS has DOMLSSerializer" >&5 $as_echo_n "checking whether Xerces DOMImplementationLS has DOMLSSerializer... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(NULL); DOMLSSerializer *ls = ((DOMImplementationLS*)impl)->createLSSerializer(); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_DOMLSSERIALIZER 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xerces DOMEntity uses getInputEncoding()" >&5 $as_echo_n "checking whether Xerces DOMEntity uses getInputEncoding()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { using namespace XERCES_CPP_NAMESPACE; DOMEntity *t; t->getInputEncoding(); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCES_DOMENTITYINPUTENCODING 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Now check for Xalan if test x"$use_xalan" != x"no" ; then if test $XALANCROOT; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xalan headers in XALANCROOT" >&5 $as_echo_n "checking for Xalan headers in XALANCROOT... " >&6; } OLD_CPPFLAGS=$CPPFLAGS # Updated to include nls/include as this is generally needed for # compilation against non-installed xalan. # Also now include XALANCROOT/include to cater for installed xalan CPPFLAGS="-I${XALANCROOT}/src -I${XALANCROOT}/include -I${XALANCROOT}/nls/include ${CPPFLAGS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : xalan_found=yes LIBS="-L${XALANCROOT}/lib -lxalan-c ${LIBS}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else CPPFLAGS=$OLD_CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest.err conftest.i conftest.$ac_ext; fi if test -z "$xalan_found" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xalan in system includes" >&5 $as_echo_n "checking for Xalan in system includes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : xalan_found=yes LIBS="${LIBS} -lxalan-c" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else $as_echo "#define XSEC_NO_XALAN 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - WARNING - configuring for no Xalan" >&5 $as_echo "no - WARNING - configuring for no Xalan" >&6; } fi rm -f conftest.err conftest.i conftest.$ac_ext; fi else # NO_XALAN is defined - so we skip { $as_echo "$as_me:${as_lineno-$LINENO}: Warning - Xalan being configured out - XPath and XSLT will not be available" >&5 $as_echo "$as_me: Warning - Xalan being configured out - XPath and XSLT will not be available" >&6;} $as_echo "#define XSEC_NO_XALAN 1" >>confdefs.h fi if test "${xalan_found}" = "yes" ; then # Do we need xalanMsg.so? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libxalanMsg is required" >&5 $as_echo_n "checking if libxalanMsg is required... " >&6; } old_libs=$LIBS LIBS="${LIBS} -lxalanMsg" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int test=1; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS=${old_libs} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; fi # Check for handling of XSLException types if test "$xalan_found" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XSLException::getType() returns XalanDOMString" >&5 $as_echo_n "checking whether XSLException::getType() returns XalanDOMString... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { try { int x = 1; } catch (XALAN_CPP_NAMESPACE_QUALIFIER XSLException &e) { e.getType().c_str(); } ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XSLEXCEPTION_RETURNS_DOMSTRING 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XercesParserLiaison ctor takes XercesDOMSupport" >&5 $as_echo_n "checking whether XercesParserLiaison ctor takes XercesDOMSupport... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { XALAN_CPP_NAMESPACE_QUALIFIER XercesDOMSupport theDOMSupport; XALAN_CPP_NAMESPACE_QUALIFIER XercesParserLiaison theParserLiaison(theDOMSupport); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XPathEvaluator::selectNodeList requires NodeRefList" >&5 $as_echo_n "checking whether XPathEvaluator::selectNodeList requires NodeRefList... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { XALAN_CPP_NAMESPACE_QUALIFIER XercesDOMSupport theDOMSupport; XALAN_CPP_NAMESPACE_QUALIFIER XPathEvaluator theEvaluator; XALAN_CPP_NAMESPACE_QUALIFIER NodeRefList theResult( theEvaluator.selectNodeList( theDOMSupport, NULL, NULL, NULL)); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_SELECTNODELIST_REQS_NODEREFLIST 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xalan classes require MemoryManager" >&5 $as_echo_n "checking whether Xalan classes require MemoryManager... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { } XALAN_CPP_NAMESPACE_BEGIN class FunctionTest : public Function { public: typedef Function ParentType; FunctionTest(); virtual ~FunctionTest(); virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args, const LocatorType* locator) const; XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectPtr arg1, const XObjectPtr arg2, const LocatorType* locator) const; XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectPtr arg1, const XObjectPtr arg2, const XObjectPtr arg3, const LocatorType* locator) const; #if !defined(XALAN_NO_USING_DECLARATION) using ParentType::execute; #endif #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) virtual Function* #else virtual FunctionTest* #endif clone() const; protected: virtual const XalanDOMString getError() const; private: // Not implemented... FunctionTest& operator=(const FunctionTest&); bool operator==(const FunctionTest&) const; }; void main2(void){ FunctionTest t; } XALAN_CPP_NAMESPACE_END int main3(void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_XALAN_REQS_MEMORYMANAGER 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; fi # Crypto provider options (OpenSSL / NSS) # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; use_openssl=$withval else use_openssl=yes fi if test x"$use_openssl" != "xno" ; then # Check for explicit location or try pkg-config if test x"$use_openssl" = "xyes" ; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then if pkg-config openssl ; then SSLLIBS="`$PKG_CONFIG --libs openssl`" SSLFLAGS="`$PKG_CONFIG --cflags openssl`" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OpenSSL not supported by pkg-config, try --with-openssl=PATH instead" >&5 $as_echo "$as_me: WARNING: OpenSSL not supported by pkg-config, try --with-openssl=PATH instead" >&2;} fi fi else if test x_$use_openssl != x_/usr; then SSLFLAGS="-I${use_openssl}/include" SSLLIBS="-L${use_openssl}/lib -lcrypto -lssl" else SSLLIBS="-lcrypto -lssl" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL cflags" >&5 $as_echo_n "checking for OpenSSL cflags... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SSLFLAGS" >&5 $as_echo "$SSLFLAGS" >&6; } CPPFLAGS="$CPPFLAGS $SSLFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : $as_echo "#define XSEC_HAVE_OPENSSL 1" >>confdefs.h else as_fn_error $? "Unable to find OpenSSL headers" "$LINENO" 5 fi rm -f conftest.err conftest.i conftest.$ac_ext; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL libraries" >&5 $as_echo_n "checking for OpenSSL libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SSLLIBS" >&5 $as_echo "$SSLLIBS" >&6; } LIBS="$LIBS $SSLLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { EVP_EncryptInit(NULL, NULL, NULL, NULL) ; return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else as_fn_error $? "\"Unable to find libcrypto\"" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Now try to find out some things about this version of OpenSSL { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const input buffers in OpenSSL" >&5 $as_echo_n "checking for const input buffers in OpenSSL... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const unsigned char * buf; unsigned char * outbuf; RSA rsa; RSA_private_decrypt(1,buf,outbuf,&rsa,RSA_PKCS1_PADDING); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_OPENSSL_CONST_BUFFERS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-broken AES support" >&5 $as_echo_n "checking for non-broken AES support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { EVP_aes_256_cbc(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_OPENSSL_HAVE_AES 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCM support" >&5 $as_echo_n "checking for GCM support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { EVP_aes_256_gcm(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_OPENSSL_HAVE_GCM 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_fn_cxx_check_decl "$LINENO" "PKCS1_MGF1" "ac_cv_have_decl_PKCS1_MGF1" "#include " if test "x$ac_cv_have_decl_PKCS1_MGF1" = xyes; then : $as_echo "#define XSEC_OPENSSL_HAVE_MGF1 1" >>confdefs.h fi ac_fn_cxx_check_decl "$LINENO" "EVP_PKEY_set1_EC_KEY" "ac_cv_have_decl_EVP_PKEY_set1_EC_KEY" "#include " if test "x$ac_cv_have_decl_EVP_PKEY_set1_EC_KEY" = xyes; then : $as_echo "#define XSEC_OPENSSL_HAVE_EC 1" >>confdefs.h fi ac_fn_cxx_check_decl "$LINENO" "EVP_sha512" "ac_cv_have_decl_EVP_sha512" "#include " if test "x$ac_cv_have_decl_EVP_sha512" = xyes; then : $as_echo "#define XSEC_OPENSSL_HAVE_SHA2 1" >>confdefs.h fi ac_fn_cxx_check_decl "$LINENO" "EVP_CIPHER_CTX_set_padding" "ac_cv_have_decl_EVP_CIPHER_CTX_set_padding" "#include " if test "x$ac_cv_have_decl_EVP_CIPHER_CTX_set_padding" = xyes; then : $as_echo "#define XSEC_OPENSSL_CANSET_PADDING 1" >>confdefs.h fi ac_fn_cxx_check_decl "$LINENO" "CRYPTO_cleanup_all_ex_data" "ac_cv_have_decl_CRYPTO_cleanup_all_ex_data" "#include " if test "x$ac_cv_have_decl_CRYPTO_cleanup_all_ex_data" = xyes; then : $as_echo "#define XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const input buffer in loadX509Base64Bin" >&5 $as_echo_n "checking for const input buffer in loadX509Base64Bin... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const unsigned char * buf; d2i_X509(NULL, &buf, 1); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define XSEC_OPENSSL_D2IX509_CONST_BUFFER 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # Check whether --with-nss was given. if test "${with_nss+set}" = set; then : withval=$with_nss; use_nss=$withval else use_nss=no fi if test x"$use_nss" != "xno" ; then # Check for explicit location or try pkg-config if test x"$use_nss" = "xyes" ; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then if pkg-config nss ; then NSSLIBS="`$PKG_CONFIG --libs nss`" NSSFLAGS="`$PKG_CONFIG --cflags nss`" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NSS not supported by pkg-config, try --with-nss=PATH instead" >&5 $as_echo "$as_me: WARNING: NSS not supported by pkg-config, try --with-nss=PATH instead" >&2;} fi else check=`nss-config --version 2>/dev/null` if test -n "$check"; then NSSLIBS=`nss-config --libs` NSSFLAGS=`nss-config --cflags` else as_fn_error $? "Unable to use pkg-config or find nss-config, try --with-nss=PATH" "$LINENO" 5 fi fi else if test x_$use_nss != x_/usr; then NSSLIBS="-L${use_nss}/lib" fi # NSS is broken and doesn't use a standard include path. NSSFLAGS="-I${use_nss}/include/nss3 -I${use_nss}/include/nss" NSSLIBS="$NSSLIBS -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS cflags" >&5 $as_echo_n "checking for NSS cflags... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSSFLAGS" >&5 $as_echo "$NSSFLAGS" >&6; } CPPFLAGS="$CPPFLAGS $NSSFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : $as_echo "#define XSEC_HAVE_NSS 1" >>confdefs.h else as_fn_error $? "Unable to find NSS headers" "$LINENO" 5 fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS libraries" >&5 $as_echo_n "checking for NSS libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSSLIBS" >&5 $as_echo "$NSSLIBS" >&6; } LIBS="$LIBS $NSSLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { NSS_NoDB_Init(NULL); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else as_fn_error $? "Unable to link with NSS" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Populate the Makefile conditionals if test x"$use_openssl" != "xno"; then XSEC_AM_HAVE_OPENSSL_TRUE= XSEC_AM_HAVE_OPENSSL_FALSE='#' else XSEC_AM_HAVE_OPENSSL_TRUE='#' XSEC_AM_HAVE_OPENSSL_FALSE= fi if test x"$use_nss" != "xno"; then XSEC_AM_HAVE_NSS_TRUE= XSEC_AM_HAVE_NSS_FALSE='#' else XSEC_AM_HAVE_NSS_TRUE='#' XSEC_AM_HAVE_NSS_FALSE= fi # output the Makefiles cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSEC_AM_HAVE_OPENSSL_TRUE}" && test -z "${XSEC_AM_HAVE_OPENSSL_FALSE}"; then as_fn_error $? "conditional \"XSEC_AM_HAVE_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSEC_AM_HAVE_NSS_TRUE}" && test -z "${XSEC_AM_HAVE_NSS_FALSE}"; then as_fn_error $? "conditional \"XSEC_AM_HAVE_NSS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by XML-Security-C $as_me 1.7.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ XML-Security-C config.status 1.7.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ lt_cv_sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "xsec/Makefile") CONFIG_FILES="$CONFIG_FILES xsec/Makefile" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "xsec/framework/XSECConfig.hpp") CONFIG_HEADERS="$CONFIG_HEADERS xsec/framework/XSECConfig.hpp" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" ## -------------------------------------- ## ## Shell functions shared with configure. ## ## -------------------------------------- ## # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xml-security-c-1.7.3/configure.ac000644 001751 001751 00000046536 12462600235 020101 0ustar00scantorscantor000000 000000 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # Process this file with autoreconf AC_PREREQ(2.50) AC_INIT([[XML-Security-C]],[1.7.3],[dev@santuario.apache.org],[xml-security-c]) AC_CONFIG_SRCDIR(xsec) AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_MACRO_DIR(m4) AM_INIT_AUTOMAKE AC_PROG_LIBTOOL AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]), enable_debug=$enableval, enable_debug=no) if test "$enable_debug" = "yes" ; then GCC_CFLAGS="$CFLAGS -g -D_DEBUG" GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG" else GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG" GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG" fi # Define the files we wish to generate AC_CONFIG_FILES([Makefile xsec/Makefile]) AC_CONFIG_HEADERS([config.h xsec/framework/XSECConfig.hpp]) AH_BOTTOM([#include ]) # Check for basic programs AC_PROG_CC([gcc gcc3 cc]) AC_PROG_CXX([g++ g++3 c++ CC]) AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_AWK AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) if test "$GCC" = "yes" ; then CFLAGS="-Wall $GCC_CFLAGS" CXXFLAGS="-Wall $GCC_CXXFLAGS" fi # pthreads AX_PTHREAD CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}" LIBS="${LIBS} ${PTHREAD_LIBS}" CC="${PTHREAD_CC}" # Checks for required libraries AC_CHECK_LIB(m, floor,) AC_CHECK_LIB(socket, getservent,) # Check for required includes AC_CHECK_HEADERS([unistd.h direct.h]) AC_CHECK_DECL(strcasecmp,[AC_DEFINE([XSEC_HAVE_STRCASECMP],[1],[Define to 1 if strcasecmp present.])],,[#include ]) # Check whether getcwd can dynamically allocate memory. AC_MSG_CHECKING([whether getcwd(NULL, 0) works]) AC_RUN_IFELSE([AC_LANG_PROGRAM([#include #include ], [char *cwd = getcwd(NULL, 0); return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;])], [AC_MSG_RESULT(yes) AC_DEFINE([XSEC_HAVE_GETCWD_DYN], [1], [Define to 1 if getcwd(NULL, 0) works])], [AC_MSG_RESULT(no)]) AC_LANG(C++) # Xerces is required AC_ARG_WITH(xerces,AS_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]), [if test x_$with_xerces != x_/usr; then LDFLAGS="-L${with_xerces}/lib $LDFLAGS" CPPFLAGS="-I${with_xerces}/include $CPPFLAGS" fi]) LIBS="-lxerces-c $LIBS" AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files])) AC_MSG_CHECKING([Xerces version]) AC_PREPROC_IFELSE( [AC_LANG_PROGRAM([#include ], [#if _XERCES_VERSION >= 20000 int i = 0; #else #error cannot use version 1.x #endif])], [AC_MSG_RESULT(OK)], [AC_MSG_FAILURE([Xerces-C 2.x or 3.x is required])]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[xercesc::XMLPlatformUtils::Initialize()]])], [],[AC_MSG_ERROR([unable to link with Xerces])]) # Get user options AC_ARG_WITH(xalan, AS_HELP_STRING([--with-xalan],[Enable Xalan integration. Values = 'yes' or installation directory (Default = yes)]), use_xalan=$withval, use_xalan=yes) if test x"$use_xalan" != "xyes" ; then if test x"$use_xalan" != "xno" ; then XALANCROOT=$use_xalan fi fi # Ensure we are always compiling using library defs CFLAGS="${CFLAGS} -DXSEC_LIBRARY_BUILD" CXXFLAGS="${CXXFLAGS} -DXSEC_LIBRARY_BUILD" # Find out some properties of the version of Xerces we have AC_MSG_CHECKING([whether Xerces is 64-bit clean]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; XMLFilePos testvar; ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_64BITSAFE],[1],[Define to 1 if Xerces has a 64-bit-safe API.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether Xerces BinInputStream requires getContentType]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; XMLByte buf[1024]; BinMemInputStream in(buf,1024); in.getContentType(); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE],[1],[Define to 1 if Xerces InputStream class requires getContentType.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether Xerces XMLFormatter requires a version]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #include ]], [[using namespace XERCES_CPP_NAMESPACE; XMLCh s_encoding[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_8, chNull }; XMLFormatter f(s_encoding, NULL, NULL, XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_REQUIRES_MEMMGR],[1],[Define to 1 if Xerces XMLFormatter requires MemoryManager.]) AC_DEFINE([XSEC_XERCES_FORMATTER_REQUIRES_VERSION],[1],[Define to 1 if Xerces XMLFormatter requires version.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether Xerces XMLString has ::release]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; XMLCh * tst; XMLString::release(&tst); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_XMLSTRING_HAS_RELEASE],[1],[Define to 1 if Xerces XMLString has release method.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether Xerces XMLElement has ::setIdAttribute(XMLCh*)]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; DOMElement * elt; elt->setIdAttribute(NULL); ]])],[AC_MSG_RESULT([yes]) xerces_has_setidattribute=yes AC_DEFINE([XSEC_XERCES_HAS_SETIDATTRIBUTE],[1],[Define to 1 if Xerces has legacy setIdAttribute.])], [AC_MSG_RESULT([no])]) if test -z "$xerces_has_setidattribute" ; then AC_MSG_CHECKING([whether Xerces XMLElement has ::setIdAttribute(XMLCh*, bool)]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; DOMElement * elt; elt->setIdAttribute(NULL, false); ]])],[AC_MSG_RESULT([yes]) xerces_has_setidattribute=yes AC_DEFINE([XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE],[1],[Define to 1 if Xerces DOM ID methods take extra parameter.])], [AC_MSG_RESULT([no])]) fi # For Xerces 3.x we now have a stricter DOM L3 implementation AC_MSG_CHECKING([whether Xerces DOMImplementationLS has DOMLSSerializer]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(NULL); DOMLSSerializer *ls = ((DOMImplementationLS*)impl)->createLSSerializer(); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_DOMLSSERIALIZER],[1],[Define to 1 if Xerces has DOMLSSerializer.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether Xerces DOMEntity uses getInputEncoding()]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[using namespace XERCES_CPP_NAMESPACE; DOMEntity *t; t->getInputEncoding(); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCES_DOMENTITYINPUTENCODING],[1],[Define to 1 if Xerces DOMEntity has getInputEncoding.])], [AC_MSG_RESULT([no])]) # Now check for Xalan if test x"$use_xalan" != x"no" ; then if test $XALANCROOT; then AC_MSG_CHECKING([for Xalan headers in XALANCROOT]) OLD_CPPFLAGS=$CPPFLAGS # Updated to include nls/include as this is generally needed for # compilation against non-installed xalan. # Also now include XALANCROOT/include to cater for installed xalan CPPFLAGS=["-I${XALANCROOT}/src -I${XALANCROOT}/include -I${XALANCROOT}/nls/include ${CPPFLAGS}"] AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[xalan_found=yes LIBS="-L${XALANCROOT}/lib -lxalan-c ${LIBS}" AC_MSG_RESULT([found])],[CPPFLAGS=$OLD_CPPFLAGS AC_MSG_RESULT([no])]); fi if test -z "$xalan_found" ; then AC_MSG_CHECKING([for Xalan in system includes]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[xalan_found=yes LIBS="${LIBS} -lxalan-c" AC_MSG_RESULT([found])], [AC_DEFINE([XSEC_NO_XALAN],[1],[Define to 1 if Xalan is unavailable.]) AC_MSG_RESULT([no - WARNING - configuring for no Xalan]) ]); fi else # NO_XALAN is defined - so we skip AC_MSG_NOTICE([Warning - Xalan being configured out - XPath and XSLT will not be available]) AC_DEFINE([XSEC_NO_XALAN],[1],[Define to 1 if Xalan is unavailable.]) fi if test "${xalan_found}" = "yes" ; then # Do we need xalanMsg.so? AC_MSG_CHECKING([if libxalanMsg is required]) old_libs=$LIBS LIBS="${LIBS} -lxalanMsg" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ int test=1; ]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) LIBS=${old_libs}]); fi # Check for handling of XSLException types if test "$xalan_found" = "yes" ; then AC_MSG_CHECKING([whether XSLException::getType() returns XalanDOMString]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ try { int x = 1; } catch (XALAN_CPP_NAMESPACE_QUALIFIER XSLException &e) { e.getType().c_str(); } ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XSLEXCEPTION_RETURNS_DOMSTRING],[1],[Define to 1 if Xalan XSLException returns XalanDOMString.])], [AC_MSG_RESULT([no])]); AC_MSG_CHECKING([whether XercesParserLiaison ctor takes XercesDOMSupport]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[ XALAN_CPP_NAMESPACE_QUALIFIER XercesDOMSupport theDOMSupport; XALAN_CPP_NAMESPACE_QUALIFIER XercesParserLiaison theParserLiaison(theDOMSupport); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT],[1],[Define to 1 if Xalan XercesParserLiaison ctor takes XercesDOMSupport.])], [AC_MSG_RESULT([no])]); AC_MSG_CHECKING([whether XPathEvaluator::selectNodeList requires NodeRefList]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #include #include ]], [[ XALAN_CPP_NAMESPACE_QUALIFIER XercesDOMSupport theDOMSupport; XALAN_CPP_NAMESPACE_QUALIFIER XPathEvaluator theEvaluator; XALAN_CPP_NAMESPACE_QUALIFIER NodeRefList theResult( theEvaluator.selectNodeList( theDOMSupport, NULL, NULL, NULL)); ]])],[AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_SELECTNODELIST_REQS_NODEREFLIST],[1],[Define to 1 if Xalan XPathEvaluator requires NodeRefList.])]); AC_MSG_CHECKING([whether Xalan classes require MemoryManager]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ } XALAN_CPP_NAMESPACE_BEGIN class FunctionTest : public Function { public: typedef Function ParentType; FunctionTest(); virtual ~FunctionTest(); virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args, const LocatorType* locator) const; XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectPtr arg1, const XObjectPtr arg2, const LocatorType* locator) const; XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectPtr arg1, const XObjectPtr arg2, const XObjectPtr arg3, const LocatorType* locator) const; #if !defined(XALAN_NO_USING_DECLARATION) using ParentType::execute; #endif #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) virtual Function* #else virtual FunctionTest* #endif clone() const; protected: virtual const XalanDOMString getError() const; private: // Not implemented... FunctionTest& operator=(const FunctionTest&); bool operator==(const FunctionTest&) const; }; void main2(void){ FunctionTest t; } XALAN_CPP_NAMESPACE_END int main3(void) { ]])],[AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_XALAN_REQS_MEMORYMANAGER],[1],[Define to 1 if Xalan requires MemoryManager])]); fi # Crypto provider options (OpenSSL / NSS) AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl],[Use Openssl. Values = 'yes' or installation directory (Default = yes)]), use_openssl=$withval, use_openssl=yes) if test x"$use_openssl" != "xno" ; then # Check for explicit location or try pkg-config if test x"$use_openssl" = "xyes" ; then AC_PATH_PROG(PKG_CONFIG, pkg-config,) if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then if pkg-config openssl ; then SSLLIBS="`$PKG_CONFIG --libs openssl`" SSLFLAGS="`$PKG_CONFIG --cflags openssl`" else AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl=PATH instead]) fi fi else if test x_$use_openssl != x_/usr; then SSLFLAGS="-I${use_openssl}/include" SSLLIBS="-L${use_openssl}/lib -lcrypto -lssl" else SSLLIBS="-lcrypto -lssl" fi fi AC_MSG_CHECKING(for OpenSSL cflags) AC_MSG_RESULT($SSLFLAGS) CPPFLAGS="$CPPFLAGS $SSLFLAGS" AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])], [AC_DEFINE([XSEC_HAVE_OPENSSL],[1],[Define if OpenSSL is in use.])], [AC_MSG_ERROR([Unable to find OpenSSL headers])]); AC_MSG_CHECKING(for OpenSSL libraries) AC_MSG_RESULT($SSLLIBS) LIBS="$LIBS $SSLLIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[EVP_EncryptInit(NULL, NULL, NULL, NULL) ; return 0; ]])],, [AC_MSG_ERROR(["Unable to find libcrypto"])]) # Now try to find out some things about this version of OpenSSL AC_MSG_CHECKING([for const input buffers in OpenSSL]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ const unsigned char * buf; unsigned char * outbuf; RSA rsa; RSA_private_decrypt(1,buf,outbuf,&rsa,RSA_PKCS1_PADDING);]])], [AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_OPENSSL_CONST_BUFFERS],[1],[Define to 1 if OpenSSL uses const input buffers.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for non-broken AES support]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ EVP_aes_256_cbc(); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_OPENSSL_HAVE_AES],[1],[Define to 1 if OpenSSL has full AES support.])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for GCM support]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ EVP_aes_256_gcm(); ]])],[AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_OPENSSL_HAVE_GCM],[1],[Define to 1 if OpenSSL has GCM support.])], [AC_MSG_RESULT([no])]) AC_CHECK_DECL(PKCS1_MGF1, [AC_DEFINE([XSEC_OPENSSL_HAVE_MGF1],[1],[Define to 1 if OpenSSL has PKCS1_MGF1 function.])], ,[#include ]) AC_CHECK_DECL(EVP_PKEY_set1_EC_KEY, [AC_DEFINE([XSEC_OPENSSL_HAVE_EC],[1],[Define to 1 if OpenSSL has EC support.])], ,[#include ]) AC_CHECK_DECL(EVP_sha512, [AC_DEFINE([XSEC_OPENSSL_HAVE_SHA2],[1],[Define to 1 if OpenSSL has SHA2 support.])], ,[#include ]) AC_CHECK_DECL(EVP_CIPHER_CTX_set_padding, [AC_DEFINE([XSEC_OPENSSL_CANSET_PADDING],[1],[Define to 1 if OpenSSL has EVP_CIPHER_CTX_set_padding.])], ,[#include ]) AC_CHECK_DECL(CRYPTO_cleanup_all_ex_data, [AC_DEFINE([XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA],[1],[Define to 1 if OpenSSL has CRYPTO_cleanup_all_ex_data.])], ,[#include ]) AC_MSG_CHECKING([for const input buffer in loadX509Base64Bin]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ const unsigned char * buf; d2i_X509(NULL, &buf, 1);]])], [AC_MSG_RESULT([yes]) AC_DEFINE([XSEC_OPENSSL_D2IX509_CONST_BUFFER],[1],[Define to 1 if OpenSSL X509 API has const input buffer.])], [AC_MSG_RESULT([no])]) fi AC_ARG_WITH(nss, AS_HELP_STRING([--with-nss],[Use NSS. Values = 'yes' or installation directory (Default = no)]), use_nss=$withval, use_nss=no) if test x"$use_nss" != "xno" ; then # Check for explicit location or try pkg-config if test x"$use_nss" = "xyes" ; then AC_PATH_PROG(PKG_CONFIG, pkg-config,) if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then if pkg-config nss ; then NSSLIBS="`$PKG_CONFIG --libs nss`" NSSFLAGS="`$PKG_CONFIG --cflags nss`" else AC_MSG_WARN([NSS not supported by pkg-config, try --with-nss=PATH instead]) fi else check=`nss-config --version 2>/dev/null` if test -n "$check"; then NSSLIBS=`nss-config --libs` NSSFLAGS=`nss-config --cflags` else AC_MSG_ERROR([Unable to use pkg-config or find nss-config, try --with-nss=PATH]) fi fi else if test x_$use_nss != x_/usr; then NSSLIBS="-L${use_nss}/lib" fi # NSS is broken and doesn't use a standard include path. NSSFLAGS="-I${use_nss}/include/nss3 -I${use_nss}/include/nss" NSSLIBS="$NSSLIBS -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" fi AC_MSG_CHECKING(for NSS cflags) AC_MSG_RESULT($NSSFLAGS) CPPFLAGS="$CPPFLAGS $NSSFLAGS" AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])], [AC_DEFINE([XSEC_HAVE_NSS],[1],[Define if NSS is in use.])], [AC_MSG_ERROR([Unable to find NSS headers])]) AC_MSG_CHECKING(for NSS libraries) AC_MSG_RESULT($NSSLIBS) LIBS="$LIBS $NSSLIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[NSS_NoDB_Init(NULL);]])],, [AC_MSG_ERROR([Unable to link with NSS])]) fi # Populate the Makefile conditionals AM_CONDITIONAL(XSEC_AM_HAVE_OPENSSL, test x"$use_openssl" != "xno") AM_CONDITIONAL(XSEC_AM_HAVE_NSS, test x"$use_nss" != "xno") # output the Makefiles AC_OUTPUT xml-security-c-1.7.3/aclocal.m4000644 001751 001751 00000122520 12475453703 017451 0ustar00scantorscantor000000 000000 # generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_pthread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) xml-security-c-1.7.3/Makefile.in000644 001751 001751 00000065427 12475453705 017674 0ustar00scantorscantor000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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. # 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@ # # Copyright 2006-2011 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # 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@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(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 $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/xsec/framework/XSECConfig.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # 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 CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/xsec/framework/XSECConfig.hpp.in \ build-aux/compile build-aux/config.guess build-aux/config.sub \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip dist-zip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ 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@ GREP = @GREP@ 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@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ 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@ AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip ACLOCAL_AMFLAGS = -I m4 SUBDIRS = xsec EXTRA_DIST = \ CHANGELOG.txt \ INSTALL.txt \ LICENSE.txt \ NOTICE.txt \ Projects \ xml-security-c.spec \ xsec/framework/resource.h \ xsec/framework/version.rc \ xsec/tools/threadTest/threadtest.cpp all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ xsec/framework/XSECConfig.hpp: xsec/framework/stamp-h2 @test -f $@ || rm -f xsec/framework/stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) xsec/framework/stamp-h2 xsec/framework/stamp-h2: $(top_srcdir)/xsec/framework/XSECConfig.hpp.in $(top_builddir)/config.status @rm -f xsec/framework/stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status xsec/framework/XSECConfig.hpp distclean-hdr: -rm -f config.h stamp-h1 xsec/framework/XSECConfig.hpp xsec/framework/stamp-h2 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(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-recursive 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive 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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ 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 installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile dist-hook: rm -rf `find $(distdir)/Projects -name .svn` # 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: xml-security-c-1.7.3/config.h.in000644 001751 001751 00000011013 12475453705 017630 0ustar00scantorscantor000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DIRECT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if getcwd(NULL, 0) works */ #undef XSEC_HAVE_GETCWD_DYN /* Define if NSS is in use. */ #undef XSEC_HAVE_NSS /* Define if OpenSSL is in use. */ #undef XSEC_HAVE_OPENSSL /* Define to 1 if strcasecmp present. */ #undef XSEC_HAVE_STRCASECMP /* Define to 1 if Xalan is unavailable. */ #undef XSEC_NO_XALAN /* Define to 1 if OpenSSL has EVP_CIPHER_CTX_set_padding. */ #undef XSEC_OPENSSL_CANSET_PADDING /* Define to 1 if OpenSSL uses const input buffers. */ #undef XSEC_OPENSSL_CONST_BUFFERS /* Define to 1 if OpenSSL X509 API has const input buffer. */ #undef XSEC_OPENSSL_D2IX509_CONST_BUFFER /* Define to 1 if OpenSSL has full AES support. */ #undef XSEC_OPENSSL_HAVE_AES /* Define to 1 if OpenSSL has CRYPTO_cleanup_all_ex_data. */ #undef XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA /* Define to 1 if OpenSSL has EC support. */ #undef XSEC_OPENSSL_HAVE_EC /* Define to 1 if OpenSSL has GCM support. */ #undef XSEC_OPENSSL_HAVE_GCM /* Define to 1 if OpenSSL has PKCS1_MGF1 function. */ #undef XSEC_OPENSSL_HAVE_MGF1 /* Define to 1 if OpenSSL has SHA2 support. */ #undef XSEC_OPENSSL_HAVE_SHA2 /* Define to 1 if Xalan XPathEvaluator requires NodeRefList. */ #undef XSEC_SELECTNODELIST_REQS_NODEREFLIST /* Define to 1 if Xalan requires MemoryManager */ #undef XSEC_XALAN_REQS_MEMORYMANAGER /* Define to 1 if Xalan XercesParserLiaison ctor takes XercesDOMSupport. */ #undef XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT /* Define to 1 if Xerces has a 64-bit-safe API. */ #undef XSEC_XERCES_64BITSAFE /* Define to 1 if Xerces DOMEntity has getInputEncoding. */ #undef XSEC_XERCES_DOMENTITYINPUTENCODING /* Define to 1 if Xerces has DOMLSSerializer. */ #undef XSEC_XERCES_DOMLSSERIALIZER /* Define to 1 if Xerces XMLFormatter requires version. */ #undef XSEC_XERCES_FORMATTER_REQUIRES_VERSION /* Define to 1 if Xerces DOM ID methods take extra parameter. */ #undef XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE /* Define to 1 if Xerces has legacy setIdAttribute. */ #undef XSEC_XERCES_HAS_SETIDATTRIBUTE /* Define to 1 if Xerces InputStream class requires getContentType. */ #undef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE /* Define to 1 if Xerces XMLFormatter requires MemoryManager. */ #undef XSEC_XERCES_REQUIRES_MEMMGR /* Define to 1 if Xerces XMLString has release method. */ #undef XSEC_XERCES_XMLSTRING_HAS_RELEASE /* Define to 1 if Xalan XSLException returns XalanDOMString. */ #undef XSEC_XSLEXCEPTION_RETURNS_DOMSTRING #include xml-security-c-1.7.3/CHANGELOG.txt000644 001751 001751 00000021712 12462600235 017630 0ustar00scantorscantor000000 000000 For subsequent changes, refer to the issue tracker. Changes since 1.7.0 ===================================== * Fixes for CVE-2013-2153, CVE-2013-2154, CVE-2013-2155, CVE-2013-2156 * Reduced entity expansion limits when parsing Changes since 1.6.1 ===================================== * [SANTUARIO-314] - AES-GCM support * [SANTUARIO-315] - XML Encryption 1.1 OAEP enhancements Changes since 1.6.0 ===================================== * [SANTUARIO-268] - TXFMXPathFilter->evaluateExpr crashes on Windows * [SANTUARIO-270] - DSIGObject::load method crashes for ds:Object without Id attribute * [SANTUARIO-271] - Bug when signing files with big RSA keys * [SANTUARIO-272] - Memory bug inside XENCCipherImpl::deSerialise * [SANTUARIO-274] - Function cleanURIEscapes always throws XSECException, when any escape sequence occurs * [SANTUARIO-275] - Function isHexDigit doesn't recognize invalid escape sequences. * [SANTUARIO-276] - Percent-encoded multibyte (UTF-8) sequences unrecognized * [SANTUARIO-280] - RSA-OAEP handler only allows SHA-1 digests Changes since 1.5.1 ===================================== * Fix for bug#43964, wrong namespace in encryption DigestMethod (SC) * Fix for bug#48676, RetrievalMethod handler (SC) * Fix for bug#45867, support for >1 CRL per KeyInfo (SC) * Fix for bug#49148, buffer initialization issue (SC) * Fix for bug#49255, vector index bug (SC) * Fix for bug#49257, stylesheet append bug (SC) * Fix for bug#49260, header guard in XPath transform header (SC) * Fix for bug#49264, string release crash (SC) * Fix for bug#44983, improper c14n of XSLT (SC) * Fix for bug#49289, setters for Reference Type/Id (SC) * Fix for bug#49371, skip comments in X509Certificate elements (SC) * Fix for bug#49459, more header guards (SC) * Fix for bug#49660, NSS verification of RSA broken (SC) * Expose algorithm URI on Signature and Reference objects (SC) * White/blacklisting of otherwise registered algorithms (SC) * Add selected XML Signature 1.1 KeyInfo extensions (SC) * Add elliptic curve keys and signatures via ECDSA (SC) * Support debugging of Reference/SignedInfo data (SC) * Clean up tests for SHA2 algorithms in OpenSSL (SC) * Updated autoconf script, added NSS support, removed pre-automake material (SC) * Add methods for Reference removal to DSIGSignature/DSIGSignedInfo classes (SC) Changes between 1.5 and 1.5.1 ===================================== * Fix for bug#47353 in c14n of default namespaces (SC) * Fix Sparc compilation bug (SC) * Fix for CVE-2009-0217 (SC) Changes between version 1.4 and 1.5 ===================================== * Make SHA-1 the implicit default DigestMethod for RSA-OAEP key transport, allowing for interop until broken impls are fixed (SC) * Fix memory leak in OpenSSL RSA/DSA key cloning (SC) * Expose KeyInfo extensions via DOM (SC) * Fix c14n to omit standard xmlns:xml declarations (SC) * Add partial support for Inclusive C14N 1.1 with regard to xml:id but not xml:base (SC) * Finish port to Xerces 3.0 (SC) * 64-bit API changes (SC) * Add VC9 build files (SC) Changes between version 1.3.1 and 1.4 ===================================== * Fix exclusive c14n namespace bug (rev. 526939) (BL) * Add const specifiers and methods to various classes (SC) * Add better extraction of openssl build settings using pkg-config (SC) * Fix XSECnew macro to stop catching arbitrary errors and report crypto exceptions instead of turning them into allocation errors (SC) * Add various missing files to dist target (SC) Changes between version 1.3 and 1.3.1 ===================================== * Refactor NIX build to use automake and libtool * Initial support for API changes in Xerces 3.0 * Fix bug in autconf that would stop proper detection of Xerces ability to set Id attributes * Fix bug 40085 - incorrect OIDs on non SHA1 based RSA signatures. * Update support for non SHA1 based RSA signatures * Remove redundant code from SignedInfo that was preventing the library from loading signatures it did not have an algorithm hard wired for * Fix bug in envelope transform when input nodeset is a document fragment rather than the entire document and the canonicalisation uses a namespace that was not defined directly in the fragment * Fix bug in DSIGXPathFilterExpr where m_loaded was not initialised potentially causing an exception when an XPath expression was loaded reported by Ralf "Sabo" Saborowski. Changes between version 1.2.1 and 1.3 ===================================== * Performance improvements in canonicalisation * Implemented algorithm handlers for the digital signature classes, to provide algorithm extensibility * Update signature classes to pass in requested algorithms as URIs rather than enums. Enum based methods are now deprecated. * Fix memory leaks in OpenSSL wrapping code * Provide ability for calling application to define whether references are interlocking. * Provide some stability if the Apache keystore is corrupted under Windows. * Initial import of beta NSS crypto support * Complete implementation of XKMS message set * Methods to allow loading of encrypted data without doing decrypt and to process a decrypt/encrypt operation without replacing the original nodes * Provide MS VC++ 2005 project files * Fix bug when encrypting small input docs * Implement checks for broken OpenSSL support under Solaris 10 * Add --with-xalan, --with-openssl, --with-xerces and --enable-warnerror flags in configure * Configure now detects if Xalan is installed rather than having XALANCROOT being a pointer to the compile directory - Reorder hashing in DSIGReference.cpp as per suggestion by Peter Gubis - Update microsoft project files to reflect new version as per Scott Cantor - Replace setAttribute with setAttributeNS calls - Add methods to OpenSSL classes to extract OpenSSL objects - Fix handling of libcrypto on Solaris platform - Fix bug in Canoncicalisation courtesy of Scott Cantor Changes between version 1.2 and 1.2.1 ===================================== * Fixed library versions in Windows builds (were being generated as 1.1) * Added "No Xalan" builds for xklient under Windows VC6.0 * Added "No Xalan" builds for all projects in VC 7.0 Changes between version 1.1 and 1.2 =================================== * Started a changelog :> * Remove MFC dependency and clean up memory debugging * Remove dynamic_casts and RTTI requirement * Implemented XKMS Message generation and processing * Implemented command line XKMS tool for generating and dumping XKMS messages * Support for DESTDIR as provided by ville.skytta@iki.fi in Bugzilla 28520 * Update to Apache licence 2.0. * Add support for SHA224/256/384/512 (requires OpenSSL 0.9.8 Beta) * Patch for Mac OS X compile - provided by Scott Cantor - cantor.2@osu.edu - See Bugzilla #34920 * Updates to compile against Xalan 1.9 * Backport to compile with Xerces 2.1 * Fix bug with NULL pointer when validating or signing empty reference lists - fix as suggested by Jesse Pelton on 23 March 2005 on security-dev@xml * Provided support for nominating namespace based Id attributes * Change to allow apps to calculate and obtain signed info hash - from Eckehard.Hermann@softwareag.com - see email of 2 March 2005 on security-dev@xml * Patch for long RSA keys provided by Michael Braunoeder - michael@mib.priv.at to security-dev@xml on 16 Nov 2005 * Memory leak in OpenSSLCryptoBase64 reported by Jesse Pelton fixed. * Move to internal Base64 decoder in a number of methods to handle non-wrapping data * Resize buffer in OpenSSLCryptoKeyRSA for larger RSA keys - as submitted by Vadim Ismailov 3 December 2005 * Remove redundant m_keyType class variable from OpenSSLCryptoKeyRSA as reported by Jesse Pelton (jsp@pkc.com) on security-dev@xml * Don't throw an exception when an RSA decrypt fails during sig validation - this is a failed validate, not an error * Shutdown OpenSSL properly - as suggested by Jesse Pelton in e-mail to security-dev@xml on 9 March 2005 * Changed scope of WinCapiCryptoKey::importKey() from private to public. It returns key now, instead of void. * Fix problem in Windows CAPI where XSEC doesn't work if user doesn't have admin rights. * Bug fix in Windows CAPI code for some W2K machines - reported by Andrzej Matejko 4/5/2004 * Fix build on non WINCAPI systems, as reported by Milan Tomic on 22/4/2004 * New constructor added to WinCapiX509 * Fixed Bug in encode() XSCryptCryptoBase64. * Fix bug in XPathFilter transform when checking if an attribute is in the input node set. * Fix bug in in UTF transcoder for counting of transcoded characters (count characters not bytes) reported by Milan Tomic * Move function definitions in the Windows BinInput stream class to static to avoid conflicts with Xerces. As suggested by Jesse Pelton on 2 Feb 2005 in security-dev@xml * Added complete KeyInfo handling for XENCEncryptedType * Fix to stop re-use of derived key encrypting key when decrypting multiple elements in a document * Fix to ignore encryption exceptions during a private key decrypt * Add code to detect ASN.1 encoded DSA signatures and validate accordingly xml-security-c-1.7.3/INSTALL.txt000644 001751 001751 00000000104 12003301053 017422 0ustar00scantorscantor000000 000000 C++ Library Docs ---------------- See http://santuario.apache.org/ xml-security-c-1.7.3/LICENSE.txt000644 001751 001751 00000026135 12003301052 017411 0ustar00scantorscantor000000 000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. xml-security-c-1.7.3/NOTICE.txt000644 001751 001751 00000000647 12147777032 017340 0ustar00scantorscantor000000 000000 Apache Santuario XML-Security-C Library Copyright 2010-2013 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/). This product also includes software developed, copyrighted, and contributed by The Ohio State University.xml-security-c-1.7.3/Projects/000755 001751 001751 00000000000 12003301054 017352 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xml-security-c.spec000644 001751 001751 00000011477 12477614411 021357 0ustar00scantorscantor000000 000000 Name: xml-security-c Version: 1.7.3 Release: 1 Summary: Apache XML security C++ library Group: Development/Libraries/C and C++ License: Apache 2.0 URL: http://www.apache.org/dist/santuario/c-library/ Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700 BuildRequires: xerces-c-devel >= 3.1 %{?_with_xalan:BuildRequires: xalan-c-devel >= 1.6} %else BuildRequires: libxerces-c-devel >= 3.1 %{?_with_xalan:BuildRequires: libxalan-c-devel >= 1.6} %endif BuildRequires: openssl-devel gcc-c++ pkgconfig %if "%{_vendor}" == "redhat" BuildRequires: redhat-rpm-config %endif %description The xml-security-c library is a C++ implementation of the XML Digital Signature and Encryption specifications. The library makes use of the Apache XML project's Xerces-C XML Parser and Xalan-C XSLT processor. The latter is used for processing XPath and XSLT transforms. %package -n xml-security-c-bin Summary: Utilities for XML security C++ library Group: Development/Libraries/C and C++ %description -n xml-security-c-bin The xml-security-c library is a C++ implementation of the XML Digital Signature and Encryption specifications. The library makes use of the Apache XML project's Xerces-C XML Parser and Xalan-C XSLT processor. The latter is used for processing XPath and XSLT transforms. This package contains the utility programs. %package -n libxml-security-c17 Summary: Apache XML security C++ library Group: Development/Libraries/C and C++ Provides: xml-security-c = %{version}-%{release} Obsoletes: xml-security-c < %{version}-%{release} %description -n libxml-security-c17 The xml-security-c library is a C++ implementation of the XML Digital Signature and Encryption specifications. The library makes use of the Apache XML project's Xerces-C XML Parser and Xalan-C XSLT processor. The latter is used for processing XPath and XSLT transforms. This package contains just the shared library. %package -n libxml-security-c-devel Summary: Development files for the Apache C++ XML security library Group: Development/Libraries/C and C++ Requires: libxml-security-c17 = %{version}-%{release} Requires: openssl-devel %if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700 Requires: xerces-c-devel %{?_with_xalan:Requires: xalan-c-devel} %else Requires: libxerces-c-devel %{?_with_xalan:Requires: libxalan-c-devel} %endif Provides: xml-security-c-devel = %{version}-%{release} Obsoletes: xml-security-c-devel < %{version}-%{release} %description -n libxml-security-c-devel The xml-security-c library is a C++ implementation of the XML Digital Signature and Encryption specifications. The library makes use of the Apache XML project's Xerces-C XML Parser and Xalan-C XSLT processor. The latter is used for processing XPath and XSLT transforms. This package includes files needed for development with xml-security-c. %prep %setup -q %build %configure %{!?_with_xalan: --without-xalan} %{__make} %install %{__make} install DESTDIR=$RPM_BUILD_ROOT %clean %{__rm} -rf $RPM_BUILD_ROOT %ifnos solaris2.8 solaris2.9 solaris2.10 %post -n libxml-security-c17 -p /sbin/ldconfig %endif %ifnos solaris2.8 solaris2.9 solaris2.10 %postun -n libxml-security-c17 -p /sbin/ldconfig %endif %files -n xml-security-c-bin %defattr(-,root,root,-) %{_bindir}/* %files -n libxml-security-c17 %defattr(-,root,root,-) %{_libdir}/*.so.* %files -n libxml-security-c-devel %defattr(-,root,root,-) %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.a %changelog * Wed Jan 28 2015 Scott Cantor 1.7.3-1 - update to 1.7.3 - remove support for dead Xerces versions - switch to bzipped source to avoid SuSE problems later * Tue May 13 2014 Ian Young 1.7.2-2.2 - fix package dependencies for RHEL/CentOS 7 - fix bogus dates in changelog * Mon Jul 30 2012 Scott Cantor 1.7.0-1 - update to 1.7.0 - update URL and license * Tue Oct 26 2010 Scott Cantor 1.6.0-1 - update to 1.6.0 - fix package dependencies for OpenSUSE 11.3+ and Xalan * Mon Dec 28 2009 Scott Cantor 1.5.1-2 - Sync package names for side by side installation * Wed Aug 5 2009 Scott Cantor 1.5.1-1 - update to 1.5.1 and add SuSE conventions * Sat Dec 6 2008 Scott Cantor 1.5-1 - update to 1.5 - fix Xerces dependency name on SUSE * Wed Aug 15 2007 Scott Cantor 1.4.0-1 - update to 1.4.0 * Mon Jun 11 2007 Scott Cantor 1.3.1-1 - update to 1.3.1 * Thu Mar 23 2006 Ian Young - 1.2.0-2 - patch to remove extra qualifications for compat with g++ 4.1 * Sun Jul 03 2005 Scott Cantor - 1.2.0-1 - Updated version. * Tue Oct 19 2004 Derek Atkins - 1.1.1-1 - First Package. xml-security-c-1.7.3/Projects/VC9.0/000755 001751 001751 00000000000 12003301053 020110 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/000755 001751 001751 00000000000 12003301053 020160 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/000755 001751 001751 00000000000 12003301054 020106 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/000755 001751 001751 00000000000 12003301054 020107 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/000755 001751 001751 00000000000 12003301054 020110 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/000755 001751 001751 00000000000 12475453105 021074 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/000755 001751 001751 00000000000 12475453105 021536 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleHMAC/000755 001751 001751 00000000000 12475453105 023460 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleValidate/000755 001751 001751 00000000000 12475453105 024501 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleDecrypt/000755 001751 001751 00000000000 12475453105 024362 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleEncrypt/000755 001751 001751 00000000000 12475453105 024374 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/Samples.sln000644 001751 001751 00000007613 12475453105 023667 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleDecrypt", "simpleDecrypt\simpleDecrypt.vcproj", "{BDC78535-DC55-4FD5-97E4-DAE53E42A607}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleEncrypt", "simpleEncrypt\simpleEncrypt.vcproj", "{AFFEB936-ACB5-42D3-9588-F584278960B9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleHMAC", "simpleHMAC\simpleHMAC.vcproj", "{F0CC8080-089E-473E-8565-1C951177A38B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleValidate", "simpleValidate\simpleValidate.vcproj", "{0D10752D-2EA8-4446-9086-D0F8487E914B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug|Win32 = Debug|Win32 Release No Xalan|Win32 = Release No Xalan|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.ActiveCfg = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.Build.0 = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.ActiveCfg = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.Build.0 = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.ActiveCfg = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.Build.0 = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.ActiveCfg = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.Build.0 = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.ActiveCfg = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.Build.0 = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.ActiveCfg = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.Build.0 = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.ActiveCfg = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.Build.0 = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.ActiveCfg = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleEncrypt/simpleEncrypt.vcproj000644 001751 001751 00000021042 12475453105 030456 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleDecrypt/simpleDecrypt.vcproj000644 001751 001751 00000021040 12475453105 030430 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleValidate/simpleValidate.vcproj000644 001751 001751 00000021105 12475453105 030670 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/Samples/simpleHMAC/simpleHMAC.vcproj000644 001751 001751 00000021034 12475453105 026627 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xtest/000755 001751 001751 00000000000 12475453105 022243 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/checksig/000755 001751 001751 00000000000 12475453106 022655 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/c14n/000755 001751 001751 00000000000 12475453106 021642 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/txfmout/000755 001751 001751 00000000000 12475453106 022603 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/threadTest/000755 001751 001751 00000000000 12475453105 023203 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/siginf/000755 001751 001751 00000000000 12475453106 022354 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xsec_lib/000755 001751 001751 00000000000 12475453105 022664 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/cipher/000755 001751 001751 00000000000 12475453105 022346 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/templatesign/000755 001751 001751 00000000000 12475453105 023570 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xklient/000755 001751 001751 00000000000 12475453105 022552 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xsec.sln000644 001751 001751 00000041552 12475453105 022563 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsec_lib", "xsec_lib\xsec_lib.vcproj", "{D5B5A007-E873-4D12-B4AF-60811AFD9EF1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xtest", "xtest\xtest.vcproj", "{127B3E61-096C-438A-BF33-5A9F05C7035A}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c14n", "c14n\c14n.vcproj", "{ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksig", "checksig\checksig.vcproj", "{B32B9596-E250-41D5-8AA8-A623226C9018}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cipher", "cipher\cipher.vcproj", "{0C455A95-991B-4019-8872-AA1FE6139F69}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "siginf", "siginf\siginf.vcproj", "{20E437FA-F184-4D60-9B3B-4358EFFA8B42}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "templatesign", "templatesign\templatesign.vcproj", "{10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadTest", "threadTest\threadTest.vcproj", "{5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "txfmout", "txfmout\txfmout.vcproj", "{E1A95507-B3E4-4075-8C31-A24C9460BF68}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xklient", "xklient\xklient.vcproj", "{48346695-1496-4881-8709-E5C02392930A}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug No Xalan|x64 = Debug No Xalan|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release No Xalan|Win32 = Release No Xalan|Win32 Release No Xalan|x64 = Release No Xalan|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.ActiveCfg = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.Build.0 = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.ActiveCfg = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.Build.0 = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.ActiveCfg = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.Build.0 = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.ActiveCfg = Release|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.Build.0 = Release|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|Win32.ActiveCfg = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|Win32.Build.0 = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|x64.ActiveCfg = Debug|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|x64.Build.0 = Debug|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|Win32.ActiveCfg = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|Win32.Build.0 = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|x64.ActiveCfg = Release|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|x64.Build.0 = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.ActiveCfg = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.Build.0 = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.ActiveCfg = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.Build.0 = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.ActiveCfg = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.Build.0 = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.ActiveCfg = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.Build.0 = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.ActiveCfg = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.Build.0 = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.ActiveCfg = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.Build.0 = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.ActiveCfg = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.Build.0 = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.ActiveCfg = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.Build.0 = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.ActiveCfg = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.Build.0 = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.ActiveCfg = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.Build.0 = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.ActiveCfg = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.Build.0 = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.ActiveCfg = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.Build.0 = Release|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|Win32.ActiveCfg = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|Win32.Build.0 = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|x64.ActiveCfg = Debug|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|x64.Build.0 = Debug|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|Win32.ActiveCfg = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|Win32.Build.0 = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|x64.ActiveCfg = Release|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|x64.Build.0 = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.ActiveCfg = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.Build.0 = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.ActiveCfg = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.Build.0 = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.ActiveCfg = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.Build.0 = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.ActiveCfg = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.Build.0 = Release|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|Win32.ActiveCfg = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|Win32.Build.0 = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|x64.ActiveCfg = Debug|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|x64.Build.0 = Debug|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|Win32.ActiveCfg = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|Win32.Build.0 = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|x64.ActiveCfg = Release|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|x64.Build.0 = Release|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|Win32.ActiveCfg = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|Win32.Build.0 = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|x64.ActiveCfg = Debug|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|x64.Build.0 = Debug|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|Win32.ActiveCfg = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|Win32.Build.0 = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|x64.ActiveCfg = Release|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|x64.Build.0 = Release|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug|Win32.ActiveCfg = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug|Win32.Build.0 = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug|x64.ActiveCfg = Debug|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug|x64.Build.0 = Debug|x64 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Release|Win32.ActiveCfg = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release|Win32.Build.0 = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release|x64.ActiveCfg = Release|x64 {48346695-1496-4881-8709-E5C02392930A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC8.0/xsec/xklient/xklient.vcproj000644 001751 001751 00000037737 12475453105 025476 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/templatesign/templatesign.vcproj000644 001751 001751 00000040233 12475453105 027513 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/cipher/cipher.vcproj000644 001751 001751 00000040411 12475453105 025045 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xsec_lib/xsec_lib.vcproj000644 001751 001751 00000147044 12475453105 025713 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/siginf/siginf.vcproj000644 001751 001751 00000040373 12475453106 025067 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/threadTest/threadTest.vcproj000644 001751 001751 00000040473 12475453105 026547 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/txfmout/txfmout.vcproj000644 001751 001751 00000040413 12475453106 025540 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/c14n/c14n.vcproj000644 001751 001751 00000037777 12475453106 023661 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/checksig/checksig.vcproj000644 001751 001751 00000040763 12475453106 025674 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC8.0/xsec/xtest/xtest.vcproj000644 001751 001751 00000041735 12475453105 024651 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/000755 001751 001751 00000000000 12475453106 021074 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/000755 001751 001751 00000000000 12475453106 021536 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleHMAC/000755 001751 001751 00000000000 12475453106 023460 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleValidate/000755 001751 001751 00000000000 12475453106 024501 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleDecrypt/000755 001751 001751 00000000000 12475453106 024362 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleEncrypt/000755 001751 001751 00000000000 12475453106 024374 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/Samples.sln000644 001751 001751 00000007351 12475453106 023666 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleDecrypt", "simpleDecrypt\simpleDecrypt.vcproj", "{BDC78535-DC55-4FD5-97E4-DAE53E42A607}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleEncrypt", "simpleEncrypt\simpleEncrypt.vcproj", "{AFFEB936-ACB5-42D3-9588-F584278960B9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleHMAC", "simpleHMAC\simpleHMAC.vcproj", "{F0CC8080-089E-473E-8565-1C951177A38B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleValidate", "simpleValidate\simpleValidate.vcproj", "{0D10752D-2EA8-4446-9086-D0F8487E914B}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Debug No Xalan ConfigName.2 = Release ConfigName.3 = Release No Xalan EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug.ActiveCfg = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug.Build.0 = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release.ActiveCfg = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release.Build.0 = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan.Build.0 = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug.ActiveCfg = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug.Build.0 = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release.ActiveCfg = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release.Build.0 = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan.Build.0 = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug.ActiveCfg = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug.Build.0 = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release.ActiveCfg = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release.Build.0 = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan.Build.0 = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug.ActiveCfg = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug.Build.0 = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release.ActiveCfg = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release.Build.0 = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan.Build.0 = Release No Xalan|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleEncrypt/simpleEncrypt.vcproj000644 001751 001751 00000014626 12475453106 030470 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleDecrypt/simpleDecrypt.vcproj000644 001751 001751 00000014624 12475453106 030442 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleValidate/simpleValidate.vcproj000644 001751 001751 00000014636 12475453106 030703 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/Samples/simpleHMAC/simpleHMAC.vcproj000644 001751 001751 00000014576 12475453106 026644 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xtest/000755 001751 001751 00000000000 12475453106 022243 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/checksig/000755 001751 001751 00000000000 12475453106 022654 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/c14n/000755 001751 001751 00000000000 12475453106 021641 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/txfmout/000755 001751 001751 00000000000 12475453106 022602 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/threadTest/000755 001751 001751 00000000000 12475453106 023203 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/siginf/000755 001751 001751 00000000000 12475453106 022353 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xsec_lib/000755 001751 001751 00000000000 12475453106 022664 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/cipher/000755 001751 001751 00000000000 12475453106 022346 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/templatesign/000755 001751 001751 00000000000 12475453106 023570 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xklient/000755 001751 001751 00000000000 12475453106 022552 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xsec.sln000644 001751 001751 00000022147 12475453106 022562 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsec_lib", "xsec_lib\xsec_lib.vcproj", "{D5B5A007-E873-4D12-B4AF-60811AFD9EF1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xtest", "xtest\xtest.vcproj", "{127B3E61-096C-438A-BF33-5A9F05C7035A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c14n", "c14n\c14n.vcproj", "{ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksig", "checksig\checksig.vcproj", "{B32B9596-E250-41D5-8AA8-A623226C9018}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cipher", "cipher\cipher.vcproj", "{0C455A95-991B-4019-8872-AA1FE6139F69}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "siginf", "siginf\siginf.vcproj", "{20E437FA-F184-4D60-9B3B-4358EFFA8B42}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "templatesign", "templatesign\templatesign.vcproj", "{10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadTest", "threadTest\threadTest.vcproj", "{5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "txfmout", "txfmout\txfmout.vcproj", "{E1A95507-B3E4-4075-8C31-A24C9460BF68}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xklient", "xklient\xklient.vcproj", "{48346695-1496-4881-8709-E5C02392930A}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Debug No Xalan ConfigName.2 = Release ConfigName.3 = Release No Xalan EndGlobalSection GlobalSection(ProjectDependencies) = postSolution {127B3E61-096C-438A-BF33-5A9F05C7035A}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {B32B9596-E250-41D5-8AA8-A623226C9018}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {0C455A95-991B-4019-8872-AA1FE6139F69}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {E1A95507-B3E4-4075-8C31-A24C9460BF68}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} {48346695-1496-4881-8709-E5C02392930A}.0 = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug.ActiveCfg = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug.Build.0 = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release.ActiveCfg = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release.Build.0 = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan.Build.0 = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug.ActiveCfg = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug.Build.0 = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release.ActiveCfg = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release.Build.0 = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan.Build.0 = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug.ActiveCfg = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug.Build.0 = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release.ActiveCfg = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release.Build.0 = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan.Build.0 = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug.ActiveCfg = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug.Build.0 = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release.ActiveCfg = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release.Build.0 = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan.Build.0 = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug.ActiveCfg = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug.Build.0 = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release.ActiveCfg = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release.Build.0 = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan.Build.0 = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug.ActiveCfg = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug.Build.0 = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release.ActiveCfg = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release.Build.0 = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan.Build.0 = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug.ActiveCfg = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug.Build.0 = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release.ActiveCfg = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release.Build.0 = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan.Build.0 = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug.ActiveCfg = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug.Build.0 = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release.ActiveCfg = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release.Build.0 = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan.Build.0 = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug.ActiveCfg = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug.Build.0 = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release.ActiveCfg = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release.Build.0 = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan.Build.0 = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug.ActiveCfg = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug.Build.0 = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan.ActiveCfg = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan.Build.0 = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release.ActiveCfg = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release.Build.0 = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan.ActiveCfg = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan.Build.0 = Release No Xalan|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC7.0/xsec/xklient/xklient.vcproj000644 001751 001751 00000013637 12475453106 025467 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/templatesign/templatesign.vcproj000644 001751 001751 00000014142 12475453106 027513 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/cipher/cipher.vcproj000644 001751 001751 00000014356 12475453106 025056 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xsec_lib/xsec_lib.vcproj000644 001751 001751 00000112624 12475453106 025707 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/siginf/siginf.vcproj000644 001751 001751 00000014054 12475453106 025063 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/threadTest/threadTest.vcproj000644 001751 001751 00000014120 12475453106 026535 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/txfmout/txfmout.vcproj000644 001751 001751 00000014065 12475453106 025543 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/c14n/c14n.vcproj000644 001751 001751 00000014015 12475453106 023634 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/checksig/checksig.vcproj000644 001751 001751 00000014675 12475453106 025676 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC7.0/xsec/xtest/xtest.vcproj000644 001751 001751 00000014602 12475453106 024642 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/000755 001751 001751 00000000000 12475453106 021073 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/000755 001751 001751 00000000000 12475453106 021535 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleHMAC/000755 001751 001751 00000000000 12475453106 023457 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleValidate/000755 001751 001751 00000000000 12475453106 024500 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleDecrypt/000755 001751 001751 00000000000 12475453106 024361 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleEncrypt/000755 001751 001751 00000000000 12475453106 024373 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/Samples/Samples.dsw000644 001751 001751 00000002272 12475453106 023663 0ustar00scantorscantor000000 000000 Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "simpleDecrypt"=".\simpleDecrypt\simpleDecrypt.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "simpleEncrypt"=".\simpleEncrypt\simpleEncrypt.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "simpleHMAC"=".\simpleHMAC\simpleHMAC.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "simpleValidate"=".\simpleValidate\simpleValidate.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleEncrypt/simpleEncrypt.dsp000644 001751 001751 00000017521 12475453106 027747 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="simpleEncrypt" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=simpleEncrypt - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simpleEncrypt.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simpleEncrypt.mak" CFG="simpleEncrypt - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simpleEncrypt - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "simpleEncrypt - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "simpleEncrypt - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "simpleEncrypt - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "simpleEncrypt - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "simpleEncrypt - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleEncrypt - Win32 Debug No Xalan" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug No Xalan" # PROP BASE Intermediate_Dir "Debug No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleEncrypt - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release No Xalan" # PROP BASE Intermediate_Dir "Release No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "simpleEncrypt - Win32 Release" # Name "simpleEncrypt - Win32 Debug" # Name "simpleEncrypt - Win32 Debug No Xalan" # Name "simpleEncrypt - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\samples\simpleEncrypt.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleDecrypt/simpleDecrypt.dsp000644 001751 001751 00000017546 12475453106 027732 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="simpleDecrypt" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=simpleDecrypt - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simpleDecrypt.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simpleDecrypt.mak" CFG="simpleDecrypt - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simpleDecrypt - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "simpleDecrypt - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "simpleDecrypt - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "simpleDecrypt - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "simpleDecrypt - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "simpleDecrypt - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleDecrypt - Win32 Debug No Xalan" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug No Xalan" # PROP BASE Intermediate_Dir "Debug No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleDecrypt - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release No Xalan" # PROP BASE Intermediate_Dir "Release No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "simpleDecrypt - Win32 Release" # Name "simpleDecrypt - Win32 Debug" # Name "simpleDecrypt - Win32 Debug No Xalan" # Name "simpleDecrypt - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\samples\simpleDecrypt.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleValidate/simpleValidate.dsp000644 001751 001751 00000020145 12475453106 030155 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="simpleValidate" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=simpleValidate - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simpleValidate.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simpleValidate.mak" CFG="simpleValidate - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simpleValidate - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "simpleValidate - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "simpleValidate - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "simpleValidate - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "simpleValidate - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "simpleValidate - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleValidate - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "simpleValidate___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "simpleValidate___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\xsec" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_lib_01d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleValidate - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "simpleValidate___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "simpleValidate___Win32_Release_No_Xalan" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\..\xsec" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_lib_01.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "simpleValidate - Win32 Release" # Name "simpleValidate - Win32 Debug" # Name "simpleValidate - Win32 Debug No Xalan" # Name "simpleValidate - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\samples\simpleValidate.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/Samples/simpleHMAC/simpleHMAC.dsp000644 001751 001751 00000020056 12475453106 026114 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="simpleHMAC" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=simpleHMAC - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simpleHMAC.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simpleHMAC.mak" CFG="simpleHMAC - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simpleHMAC - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "simpleHMAC - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "simpleHMAC - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "simpleHMAC - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "simpleHMAC - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "simpleHMAC - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleHMAC - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "simpleHMAC___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "simpleHMAC___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Debug" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\xsec" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib ../../../../Build/Win32/vc6/Debug/xsec_lib_01d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib ../../../../Build/Win32/vc6/Debug/xsec_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "simpleHMAC - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "simpleHMAC___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "simpleHMAC___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "..\..\..\..\Build\Win32\vc6\Release" # PROP Intermediate_Dir "..\..\..\..\Build\Win32\vc6\Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\..\xsec" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib ../../../../Build/Win32/vc6/Release/xsec_lib_01.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib ../../../../Build/Win32/vc6/Release/xsec_1.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "simpleHMAC - Win32 Release" # Name "simpleHMAC - Win32 Debug" # Name "simpleHMAC - Win32 Debug No Xalan" # Name "simpleHMAC - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\samples\simpleHMAC.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\samples\IOStreamOutputter.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/xtest/000755 001751 001751 00000000000 12475453106 022242 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/checksig/000755 001751 001751 00000000000 12475453106 022653 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/c14n/000755 001751 001751 00000000000 12475453106 021640 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/txfmout/000755 001751 001751 00000000000 12475453106 022601 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/threadTest/000755 001751 001751 00000000000 12475453106 023202 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/siginf/000755 001751 001751 00000000000 12475453106 022352 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/xsec_lib/000755 001751 001751 00000000000 12475453106 022663 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/cipher/000755 001751 001751 00000000000 12475453106 022345 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/templatesign/000755 001751 001751 00000000000 12475453106 023567 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/xklient/000755 001751 001751 00000000000 12475453106 022551 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC6.0/xsec/xsec.dsw000644 001751 001751 00000006114 12475453106 022556 0ustar00scantorscantor000000 000000 Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "c14n"=".\c14n\c14n.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "checksig"=".\checksig\checksig.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "cipher"=".\cipher\cipher.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "siginf"=".\siginf\siginf.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "templatesign"=".\templatesign\templatesign.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "threadTest"=".\threadTest\threadTest.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "txfmout"=".\txfmout\txfmout.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "xklient"=".\xklient\xklient.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Project: "xsec_lib"=".\xsec_lib\xsec_lib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "xtest"=".\xtest\xtest.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name xsec_lib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### xml-security-c-1.7.3/Projects/VC6.0/xsec/xklient/xklient.dsp000644 001751 001751 00000016401 12475453106 024741 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="xklient" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=xklient - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "xklient.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "xklient.mak" CFG="xklient - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "xklient - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "xklient - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "xklient - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "xklient - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "xklient - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "xklient - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "xklient - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "xklient___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "xklient___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "xklient - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "xklient___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "xklient___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "xklient - Win32 Release" # Name "xklient - Win32 Debug" # Name "xklient - Win32 Debug No Xalan" # Name "xklient - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\xklient\xklient.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/templatesign/templatesign.dsp000644 001751 001751 00000017277 12475453106 027011 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="templatesign" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=templatesign - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "templatesign.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "templatesign.mak" CFG="templatesign - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "templatesign - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "templatesign - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "templatesign - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "templatesign - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "templatesign - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "templatesign - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "templatesign - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "templatesign___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "templatesign___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "templatesign - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "templatesign___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "templatesign___Win32_Release_No_Xalan" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../../../../src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "templatesign - Win32 Release" # Name "templatesign - Win32 Debug" # Name "templatesign - Win32 Debug No Xalan" # Name "templatesign - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\templatesign\templatesign.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/cipher/cipher.dsp000644 001751 001751 00000017014 12475453106 024332 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="cipher" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=cipher - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "cipher.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "cipher.mak" CFG="cipher - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "cipher - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "cipher - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "cipher - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "cipher - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "cipher - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "cipher - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "cipher - Win32 Debug No Xalan" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "cipher___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "cipher___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FR /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib crypt32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "cipher - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "cipher___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "cipher___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "cipher - Win32 Release" # Name "cipher - Win32 Debug" # Name "cipher - Win32 Debug No Xalan" # Name "cipher - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\cipher\cipher.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\tools\cipher\XencInteropResolver.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\tools\cipher\XencInteropResolver.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/xsec_lib/xsec_lib.dsp000644 001751 001751 00000125334 12475453106 025173 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="xsec_lib" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=xsec_lib - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "xsec_lib.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "xsec_lib.mak" CFG="xsec_lib - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "xsec_lib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "xsec_lib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "xsec_lib - Win32 Debug No Xalan" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "xsec_lib - Win32 Release No Xalan" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "xsec_lib - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../../../Build/Win32/VC6/Release/xsec_1_6.dll" /implib:"../../../../Build/Win32/VC6/Release/xsec_1.lib" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "xsec_lib - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:0.2 /dll /debug /machine:I386 /out:"../../../../Build/Win32/VC6/Debug/xsec_1_6D.dll" /implib:"../../../../Build/Win32/VC6/Debug/xsec_1D.lib" /pdbtype:sept # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "xsec_lib - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "xsec_lib___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "xsec_lib___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /FR /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib /nologo /version:0.2 /dll /debug /machine:I386 /out:"../../../../Build/Win32/VC6/Debug/xsec_lib_01D.dll" /pdbtype:sept # ADD LINK32 xerces-c_2D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:0.2 /dll /debug /machine:I386 /out:"../../../../Build/Win32/VC6/Debug/xsec_1_6D.dll" /implib:"../../../../Build/Win32/VC6/Debug/xsec_1D.lib" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "xsec_lib - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "xsec_lib___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "xsec_lib___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../../../../src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSEC_LIB_EXPORTS" /D "PROJ_CANON" /D "PROJ_DSIG" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib libeay32.lib /nologo /dll /machine:I386 /out:"../../../../Build/Win32/VC6/Release/xsec_lib_01.dll" # ADD LINK32 xerces-c_2.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../../../Build/Win32/VC6/Release/xsec_1_6.dll" /implib:"../../../../Build/Win32/VC6/Release/xsec_1.lib" # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "xsec_lib - Win32 Release" # Name "xsec_lib - Win32 Debug" # Name "xsec_lib - Win32 Debug No Xalan" # Name "xsec_lib - Win32 Release No Xalan" # Begin Group "canon" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECC14n20010315.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECC14n20010315.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECCanon.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECCanon.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECXMLNSStack.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\canon\XSECXMLNSStack.hpp # End Source File # End Group # Begin Group "dsig" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGAlgorithmHandlerDefault.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGAlgorithmHandlerDefault.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGConstants.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGConstants.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfo.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoList.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoList.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoMgmtData.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoMgmtData.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoName.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoName.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoPGPData.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoPGPData.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoSPKIData.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoSPKIData.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoValue.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoValue.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoX509.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoX509.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoExt.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGKeyInfoExt.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGObject.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGObject.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGReference.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGReference.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGReferenceList.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGReferenceList.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGSignature.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGSignature.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGSignedInfo.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGSignedInfo.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransform.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransform.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformBase64.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformBase64.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformC14n.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformC14n.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformEnvelope.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformEnvelope.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformList.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformList.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXPath.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXPath.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXPathFilter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXPathFilter.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXSL.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGTransformXSL.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGXPathFilterExpr.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGXPathFilterExpr.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGXPathHere.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\dsig\DSIGXPathHere.hpp # End Source File # End Group # Begin Group "enc" # PROP Default_Filter "" # Begin Group "OpenSSL" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoBase64.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoBase64.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoHash.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoHash.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoHashHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoHashHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyDSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyDSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyRSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyRSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyEC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoKeyEC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoProvider.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\openssl\OpenSSLCryptoProvider.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoSymmetricKey.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoSymmetricKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoX509.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoX509.hpp # End Source File # End Group # Begin Group "XSCrypt" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSCrypt\XSCryptCryptoBase64.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSCrypt\XSCryptCryptoBase64.hpp # End Source File # End Group # Begin Group "WinCAPI" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoHash.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoHash.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoHashHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoHashHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyDSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyDSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyRSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoKeyRSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoProvider.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoProvider.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoSymmetricKey.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoSymmetricKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoX509.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\WinCAPI\WinCAPICryptoX509.hpp # End Source File # End Group # Begin Group "NSS" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoHash.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoHash.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoHashHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoHashHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyDSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyDSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyHMAC.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyRSA.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoKeyRSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoProvider.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoProvider.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoSymmetricKey.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoSymmetricKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoX509.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\NSS\NSSCryptoX509.hpp # End Source File # End Group # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoBase64.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoBase64.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoException.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoException.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoHash.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoKeyDSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoKeyHMAC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoKeyRSA.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoKeyEC.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoProvider.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoProvider.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoSymmetricKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoUtils.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoUtils.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoX509.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECCryptoX509.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECKeyInfoResolver.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECKeyInfoResolverDefault.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\enc\XSECKeyInfoResolverDefault.hpp # End Source File # End Group # Begin Group "utils" # PROP Default_Filter "" # Begin Group "winutils" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\utils\winutils\XSECBinHTTPURIInputStream.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\winutils\XSECBinHTTPURIInputStream.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\winutils\XSECSOAPRequestorSimpleWin32.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\winutils\XSECURIResolverGenericWin32.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\winutils\XSECURIResolverGenericWin32.hpp # End Source File # End Group # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECBinTXFMInputStream.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECBinTXFMInputStream.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECDOMUtils.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECDOMUtils.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECNameSpaceExpander.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECNameSpaceExpander.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECPlatformUtils.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECPlatformUtils.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSafeBuffer.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSafeBuffer.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSafeBufferFormatter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSafeBufferFormatter.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSOAPRequestor.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSOAPRequestorSimple.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECSOAPRequestorSimple.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECTXFMInputSource.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECTXFMInputSource.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECXPathNodeList.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\utils\XSECXPathNodeList.hpp # End Source File # End Group # Begin Group "framework" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECAlgorithmHandler.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECAlgorithmMapper.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECAlgorithmMapper.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECDefs.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECEnv.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECEnv.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECError.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECError.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECException.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECException.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECProvider.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECProvider.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECURIResolver.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECURIResolverXerces.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECURIResolverXerces.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\framework\XSECW32Config.hpp # End Source File # End Group # Begin Group "transformers" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMBase.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMBase.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMBase64.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMBase64.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMC14n.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMC14n.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMChain.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMChain.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMCipher.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMCipher.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMConcatChains.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMConcatChains.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMDocObject.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMDocObject.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMEnvelope.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMEnvelope.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMMD5.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMMD5.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMOutputFile.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMOutputFile.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMParser.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMParser.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMSB.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMSB.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMSHA1.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMSHA1.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMURL.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMURL.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXPath.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXPath.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXPathFilter.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXPathFilter.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXSL.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\transformers\TXFMXSL.hpp # End Source File # End Group # Begin Group "resources" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\framework\version.rc # End Source File # End Group # Begin Group "xenc" # PROP Default_Filter "" # Begin Group "impl" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCAlgorithmHandlerDefault.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCAlgorithmHandlerDefault.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherDataImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherDataImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherReferenceImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherReferenceImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherValueImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCCipherValueImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedDataImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedDataImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedKeyImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedKeyImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedTypeImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptedTypeImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptionMethodImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\impl\XENCEncryptionMethodImpl.hpp # End Source File # End Group # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCCipher.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCCipherData.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCCipherReference.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCCipherValue.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCEncryptedData.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCEncryptedKey.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCEncryptedType.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xenc\XENCEncryptionMethod.hpp # End Source File # End Group # Begin Group "xkms" # PROP Default_Filter "" # Begin Group "impl No. 1" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSAuthenticationImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSAuthenticationImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSCompoundRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSCompoundRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSCompoundResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSCompoundResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSKeyBindingAbstractTypeImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSKeyBindingAbstractTypeImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSLocateRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSLocateRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSLocateResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSLocateResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSMessageAbstractTypeImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSMessageAbstractTypeImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSMessageFactoryImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSMessageFactoryImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSNotBoundAuthentication.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSNotBoundAuthenticationImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSPendingRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSPendingRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSPrototypeKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSPrototypeKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSQueryKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSQueryKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRecoverResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRegisterRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRegisterRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRegisterResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRegisterResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSReissueResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRequestAbstractTypeImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRequestAbstractTypeImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRespondWithImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRespondWithImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResponseMechanismImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResponseMechanismImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResultTypeImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSResultTypeImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRevokeResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRSAKeyPairImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSRSAKeyPairImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSStatusResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSUnverifiedKeyBindingImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSUnverifiedKeyBindingImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSUseKeyWithImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSUseKeyWithImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidateRequestImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidateRequestImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidateResultImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidateResultImpl.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidityIntervalImpl.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\impl\XKMSValidityIntervalImpl.hpp # End Source File # End Group # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSAuthentication.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSCompoundRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSCompoundResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSConstants.cpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSConstants.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSKeyBindingAbstractType.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSLocateRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSLocateResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSMessageAbstractType.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSMessageFactory.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSNotBoundAuthentication.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSPendingRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSPrototypeKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSQueryKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRecoverKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRecoverRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRecoverResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRegisterRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRegisterResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSReissueKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSReissueRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSReissueResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRequestAbstractType.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRespondWith.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSResponseMechanism.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSResultType.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRevokeKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRevokeRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRevokeResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSRSAKeyPair.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSStatus.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSStatusRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSStatusResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSUnverifiedKeyBinding.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSUseKeyWith.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSValidateRequest.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSValidateResult.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\xkms\XKMSValidityInterval.hpp # End Source File # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/siginf/siginf.dsp000644 001751 001751 00000016306 12475453106 024347 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="siginf" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=siginf - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "siginf.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "siginf.mak" CFG="siginf - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "siginf - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "siginf - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "siginf - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "siginf - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "siginf - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "siginf - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "siginf - Win32 Debug No Xalan" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug No Xalan" # PROP BASE Intermediate_Dir "Debug No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "siginf - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release No Xalan" # PROP BASE Intermediate_Dir "Release No Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "siginf - Win32 Release" # Name "siginf - Win32 Debug" # Name "siginf - Win32 Debug No Xalan" # Name "siginf - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\siginf\siginf.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/threadTest/threadTest.dsp000644 001751 001751 00000016524 12475453106 026031 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="threadTest" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=threadTest - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "threadTest.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "threadTest.mak" CFG="threadTest - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "threadTest - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "threadTest - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "threadTest - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "threadTest - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "threadTest - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "threadTest - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "threadTest - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "threadTest___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "threadTest___Win32_Release_No_Xalan" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "threadTest - Win32 Debug No Xalan" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "threadTest___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "threadTest___Win32_Debug_No_Xalan" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "threadTest___Win32_Debug_No_Xalan" # PROP Intermediate_Dir "threadTest___Win32_Debug_No_Xalan" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "threadTest - Win32 Release" # Name "threadTest - Win32 Debug" # Name "threadTest - Win32 Release No Xalan" # Name "threadTest - Win32 Debug No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\threadTest\threadtest.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/txfmout/txfmout.dsp000644 001751 001751 00000017045 12475453106 025026 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="txfmout" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=txfmout - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "txfmout.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "txfmout.mak" CFG="txfmout - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "txfmout - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "txfmout - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "txfmout - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "txfmout - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "txfmout - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "txfmout - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "txfmout - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "txfmout___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "txfmout___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /I "../../../../src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "txfmout - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "txfmout___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "txfmout___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "txfmout - Win32 Release" # Name "txfmout - Win32 Debug" # Name "txfmout - Win32 Release No Xalan" # Name "txfmout - Win32 Debug No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\txfmout\txfmout.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/c14n/c14n.dsp000644 001751 001751 00000016760 12475453106 023127 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="c14n" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=c14n - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "c14n.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "c14n.mak" CFG="c14n - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "c14n - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "c14n - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "c14n - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "c14n - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "c14n - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "c14n - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\SRC" /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # SUBTRACT CPP /X # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "c14n - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "c14n___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "c14n___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\SRC" /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # SUBTRACT BASE CPP /X # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\SRC" /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # SUBTRACT CPP /X # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "c14n - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "c14n___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "c14n___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../../../../src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT BASE CPP /Fr # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib /nologo /subsystem:console /machine:I386 /pdbtype:sept # SUBTRACT BASE LINK32 /debug # ADD LINK32 xerces-c_2.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # SUBTRACT LINK32 /debug !ENDIF # Begin Target # Name "c14n - Win32 Release" # Name "c14n - Win32 Debug" # Name "c14n - Win32 Debug No Xalan" # Name "c14n - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\c14n\c14n.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/checksig/checksig.dsp000644 001751 001751 00000021453 12475453106 025150 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="checksig" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=checksig - Win32 Release No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "checksig.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "checksig.mak" CFG="checksig - Win32 Release No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "checksig - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "checksig - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "checksig - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "checksig - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "checksig - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "checksig - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 xerces-c_2D.lib Xalan-C_1D.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /map /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "checksig - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "checksig___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "checksig___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yc /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "checksig - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "checksig___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "checksig___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /GX /Od /Ob1 /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /machine:I386 # SUBTRACT LINK32 /debug !ENDIF # Begin Target # Name "checksig - Win32 Release" # Name "checksig - Win32 Debug" # Name "checksig - Win32 Debug No Xalan" # Name "checksig - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\checksig\AnonymousResolver.cpp !IF "$(CFG)" == "checksig - Win32 Release" !ELSEIF "$(CFG)" == "checksig - Win32 Debug" !ELSEIF "$(CFG)" == "checksig - Win32 Debug No Xalan" # ADD CPP /YX !ELSEIF "$(CFG)" == "checksig - Win32 Release No Xalan" !ENDIF # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\tools\checksig\checksig.cpp !IF "$(CFG)" == "checksig - Win32 Release" !ELSEIF "$(CFG)" == "checksig - Win32 Debug" !ELSEIF "$(CFG)" == "checksig - Win32 Debug No Xalan" # ADD CPP /YX !ELSEIF "$(CFG)" == "checksig - Win32 Release No Xalan" !ENDIF # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\tools\checksig\InteropResolver.cpp !IF "$(CFG)" == "checksig - Win32 Release" !ELSEIF "$(CFG)" == "checksig - Win32 Debug" !ELSEIF "$(CFG)" == "checksig - Win32 Debug No Xalan" # ADD CPP /YX !ELSEIF "$(CFG)" == "checksig - Win32 Release No Xalan" !ENDIF # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\..\xsec\tools\checksig\AnonymousResolver.hpp # End Source File # Begin Source File SOURCE=..\..\..\..\xsec\tools\checksig\InteropResolver.hpp # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC6.0/xsec/xtest/xtest.dsp000644 001751 001751 00000017346 12475453106 024134 0ustar00scantorscantor000000 000000 # Microsoft Developer Studio Project File - Name="xtest" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=xtest - Win32 Debug No Xalan !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "xtest.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "xtest.mak" CFG="xtest - Win32 Debug No Xalan" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "xtest - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "xtest - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "xtest - Win32 Debug No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE "xtest - Win32 Release No Xalan" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "xtest - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 xerces-c_2.lib Xalan-C_1.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "xtest - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WWW_WIN_ASYNC" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib Xalan-C_1D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nss3.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "xtest - Win32 Debug No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "xtest___Win32_Debug_No_Xalan" # PROP BASE Intermediate_Dir "xtest___Win32_Debug_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../../../../Build/Win32/VC6/Debug" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../../src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WWW_WIN_ASYNC" /FR /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "%LIBWWW%\Library\External" /I "%LIBWWW%\Library\Src" /I "../../../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WWW_WIN_ASYNC" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Debug/xsec_lib_01D.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2D.lib Xalan-C_1D.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libeay32.lib xerces-c_2D.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "xtest - Win32 Release No Xalan" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "xtest___Win32_Release_No_Xalan" # PROP BASE Intermediate_Dir "xtest___Win32_Release_No_Xalan" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../../../../Build/Win32/VC6/Release" # PROP Intermediate_Dir "../../../../Build/Win32/VC6/Release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../../../../src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT BASE CPP /Fr # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ../../../../Build/Win32/VC6/Release/xsec_lib_01.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib xerces-c_2.lib Xalan-C_1.lib libeay32.lib /nologo /subsystem:console /machine:I386 # SUBTRACT BASE LINK32 /debug # ADD LINK32 xerces-c_2.lib libeay32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # SUBTRACT LINK32 /debug !ENDIF # Begin Target # Name "xtest - Win32 Release" # Name "xtest - Win32 Debug" # Name "xtest - Win32 Debug No Xalan" # Name "xtest - Win32 Release No Xalan" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\..\xsec\tools\xtest\xtest.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project xml-security-c-1.7.3/Projects/VC10.0/xsec/000755 001751 001751 00000000000 12475453105 021145 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/000755 001751 001751 00000000000 12475453105 021607 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleHMAC/000755 001751 001751 00000000000 12475453105 023531 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleValidate/000755 001751 001751 00000000000 12475453105 024552 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleDecrypt/000755 001751 001751 00000000000 12475453105 024433 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleEncrypt/000755 001751 001751 00000000000 12475453105 024445 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/Samples/Samples.sln000644 001751 001751 00000015233 12475453105 023735 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleDecrypt", "simpleDecrypt\simpleDecrypt.vcxproj", "{BDC78535-DC55-4FD5-97E4-DAE53E42A607}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleEncrypt", "simpleEncrypt\simpleEncrypt.vcxproj", "{AFFEB936-ACB5-42D3-9588-F584278960B9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleHMAC", "simpleHMAC\simpleHMAC.vcxproj", "{F0CC8080-089E-473E-8565-1C951177A38B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleValidate", "simpleValidate\simpleValidate.vcxproj", "{0D10752D-2EA8-4446-9086-D0F8487E914B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug No Xalan|x64 = Debug No Xalan|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release No Xalan|Win32 = Release No Xalan|Win32 Release No Xalan|x64 = Release No Xalan|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.ActiveCfg = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.Build.0 = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|x64.ActiveCfg = Debug|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|x64.Build.0 = Debug|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.ActiveCfg = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.Build.0 = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|x64.ActiveCfg = Release|x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|x64.Build.0 = Release|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.ActiveCfg = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.Build.0 = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|x64.ActiveCfg = Debug|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|x64.Build.0 = Debug|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.ActiveCfg = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.Build.0 = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|x64.ActiveCfg = Release|x64 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|x64.Build.0 = Release|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.ActiveCfg = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.Build.0 = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|x64.ActiveCfg = Debug|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|x64.Build.0 = Debug|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.ActiveCfg = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.Build.0 = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|x64.ActiveCfg = Release|x64 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|x64.Build.0 = Release|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.ActiveCfg = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.Build.0 = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|x64.ActiveCfg = Debug|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|x64.Build.0 = Debug|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.ActiveCfg = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.Build.0 = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|x64.ActiveCfg = Release|x64 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleEncrypt/simpleEncrypt.vcxproj000644 001751 001751 00000055323 12475453105 030730 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {AFFEB936-ACB5-42D3-9588-F584278960B9} Win32Proj Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleDecrypt/simpleDecrypt.vcxproj000644 001751 001751 00000054357 12475453105 030712 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {BDC78535-DC55-4FD5-97E4-DAE53E42A607} Win32Proj Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true true Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true true Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true true Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true true Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleValidate/simpleValidate.vcxproj000644 001751 001751 00000055407 12475453105 031145 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {0D10752D-2EA8-4446-9086-D0F8487E914B} simpleValidate Win32Proj Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false xml-security-c-1.7.3/Projects/VC10.0/Samples/simpleHMAC/simpleHMAC.vcxproj000644 001751 001751 00000055320 12475453105 027075 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {F0CC8080-089E-473E-8565-1C951177A38B} Win32Proj Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ true true ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ ..\..\..\..\Build\$(Platform)\VC10\$(Configuration)\obj\ false false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;Xalan-C_1D.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;Xalan-C_1.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MachineX86 Disabled ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true libeay32.lib;xerces-c_3D.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1D.lib;%(AdditionalDependencies) true Console false MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false MachineX86 MaxSpeed OnlyExplicitInline true ..\..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL true false Level3 ProgramDatabase libeay32.lib;xerces-c_3.lib;../../../../Build/$(Platform)/VC10/$(Configuration)/xsec_1.lib;%(AdditionalDependencies) true Console true true false xml-security-c-1.7.3/Projects/VC10.0/xsec/xtest/000755 001751 001751 00000000000 12475453105 022314 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/checksig/000755 001751 001751 00000000000 12475453105 022725 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/c14n/000755 001751 001751 00000000000 12475453105 021712 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/txfmout/000755 001751 001751 00000000000 12475453105 022653 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/threadTest/000755 001751 001751 00000000000 12475453105 023254 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/siginf/000755 001751 001751 00000000000 12475453105 022424 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/xsec_lib/000755 001751 001751 00000000000 12475453105 022735 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/cipher/000755 001751 001751 00000000000 12475453105 022417 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/templatesign/000755 001751 001751 00000000000 12475453105 023641 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/xklient/000755 001751 001751 00000000000 12475453105 022623 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC10.0/xsec/xsec.sln000644 001751 001751 00000040411 12475453105 022625 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsec_lib", "xsec_lib\xsec_lib.vcxproj", "{D5B5A007-E873-4D12-B4AF-60811AFD9EF1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c14n", "c14n\c14n.vcxproj", "{ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksig", "checksig\checksig.vcxproj", "{B32B9596-E250-41D5-8AA8-A623226C9018}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cipher", "cipher\cipher.vcxproj", "{0C455A95-991B-4019-8872-AA1FE6139F69}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "templatesign", "templatesign\templatesign.vcxproj", "{10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "siginf", "siginf\siginf.vcxproj", "{F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadTest", "threadTest\threadTest.vcxproj", "{1B2062DE-5283-454A-8655-489585843863}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "txfmout", "txfmout\txfmout.vcxproj", "{C84D6CCF-E9E5-4846-9E51-4D84412663FA}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xklient", "xklient\xklient.vcxproj", "{2BF4DAA8-A057-4098-AEA9-B587882A08BD}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xtest", "xtest\xtest.vcxproj", "{5C1E590A-F911-4295-8747-0C09682DA009}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug No Xalan|x64 = Debug No Xalan|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release No Xalan|Win32 = Release No Xalan|Win32 Release No Xalan|x64 = Release No Xalan|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.ActiveCfg = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.Build.0 = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.ActiveCfg = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.Build.0 = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.ActiveCfg = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.Build.0 = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.ActiveCfg = Release|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.Build.0 = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.ActiveCfg = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.Build.0 = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.ActiveCfg = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.Build.0 = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.ActiveCfg = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.Build.0 = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.ActiveCfg = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.Build.0 = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.ActiveCfg = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.Build.0 = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.ActiveCfg = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.Build.0 = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.ActiveCfg = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.Build.0 = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.ActiveCfg = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.Build.0 = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.ActiveCfg = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.Build.0 = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.ActiveCfg = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.Build.0 = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.ActiveCfg = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.Build.0 = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.ActiveCfg = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.Build.0 = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.ActiveCfg = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.Build.0 = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.ActiveCfg = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.Build.0 = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.ActiveCfg = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.Build.0 = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.ActiveCfg = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.Build.0 = Release|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug|Win32.ActiveCfg = Debug|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug|Win32.Build.0 = Debug|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug|x64.ActiveCfg = Debug|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Debug|x64.Build.0 = Debug|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release|Win32.ActiveCfg = Release|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release|Win32.Build.0 = Release|Win32 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release|x64.ActiveCfg = Release|x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA}.Release|x64.Build.0 = Release|x64 {1B2062DE-5283-454A-8655-489585843863}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {1B2062DE-5283-454A-8655-489585843863}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {1B2062DE-5283-454A-8655-489585843863}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {1B2062DE-5283-454A-8655-489585843863}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {1B2062DE-5283-454A-8655-489585843863}.Debug|Win32.ActiveCfg = Debug|Win32 {1B2062DE-5283-454A-8655-489585843863}.Debug|Win32.Build.0 = Debug|Win32 {1B2062DE-5283-454A-8655-489585843863}.Debug|x64.ActiveCfg = Debug|x64 {1B2062DE-5283-454A-8655-489585843863}.Debug|x64.Build.0 = Debug|x64 {1B2062DE-5283-454A-8655-489585843863}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {1B2062DE-5283-454A-8655-489585843863}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {1B2062DE-5283-454A-8655-489585843863}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {1B2062DE-5283-454A-8655-489585843863}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {1B2062DE-5283-454A-8655-489585843863}.Release|Win32.ActiveCfg = Release|Win32 {1B2062DE-5283-454A-8655-489585843863}.Release|Win32.Build.0 = Release|Win32 {1B2062DE-5283-454A-8655-489585843863}.Release|x64.ActiveCfg = Release|x64 {1B2062DE-5283-454A-8655-489585843863}.Release|x64.Build.0 = Release|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug|Win32.ActiveCfg = Debug|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug|Win32.Build.0 = Debug|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug|x64.ActiveCfg = Debug|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Debug|x64.Build.0 = Debug|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release|Win32.ActiveCfg = Release|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release|Win32.Build.0 = Release|Win32 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release|x64.ActiveCfg = Release|x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA}.Release|x64.Build.0 = Release|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug|Win32.ActiveCfg = Debug|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug|Win32.Build.0 = Debug|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug|x64.ActiveCfg = Debug|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Debug|x64.Build.0 = Debug|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release|Win32.ActiveCfg = Release|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release|Win32.Build.0 = Release|Win32 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release|x64.ActiveCfg = Release|x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD}.Release|x64.Build.0 = Release|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug|Win32.ActiveCfg = Debug|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug|Win32.Build.0 = Debug|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug|x64.ActiveCfg = Debug|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Debug|x64.Build.0 = Debug|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Release|Win32.ActiveCfg = Release|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Release|Win32.Build.0 = Release|Win32 {5C1E590A-F911-4295-8747-0C09682DA009}.Release|x64.ActiveCfg = Release|x64 {5C1E590A-F911-4295-8747-0C09682DA009}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC10.0/xsec/xklient/xklient.vcxproj000644 001751 001751 00000040765 12475453105 025732 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {2BF4DAA8-A057-4098-AEA9-B587882A08BD} Win32Proj xklient Application true MultiByte Application true MultiByte Application true MultiByte Application true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) {d5b5a007-e873-4d12-b4af-60811afd9ef1} xml-security-c-1.7.3/Projects/VC10.0/xsec/templatesign/templatesign.vcxproj000644 001751 001751 00000054307 12475453105 027763 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8} templatesign Win32Proj Application MultiByte true Application MultiByte Application MultiByte true Application MultiByte Application MultiByte true Application false MultiByte Application MultiByte true Application false MultiByte <_ProjectFileVersion>10.0.30319.1 ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks Level3 EditAndContinue true MultiThreadedDebugDLL xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console false MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console false MachineX64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true false MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true false MachineX64 true Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console false MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console false MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true false MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true false MachineX64 true {d5b5a007-e873-4d12-b4af-60811afd9ef1} false xml-security-c-1.7.3/Projects/VC10.0/xsec/cipher/cipher.vcxproj000644 001751 001751 00000053632 12475453105 025317 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {0C455A95-991B-4019-8872-AA1FE6139F69} cipher Win32Proj Application MultiByte true Application MultiByte Application MultiByte true Application MultiByte Application MultiByte true Application false MultiByte Application MultiByte true Application false MultiByte <_ProjectFileVersion>10.0.30319.1 ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true MachineX64 true Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX64 true {d5b5a007-e873-4d12-b4af-60811afd9ef1} false xml-security-c-1.7.3/Projects/VC10.0/xsec/xsec_lib/xsec_lib.vcxproj000644 001751 001751 00000146400 12475453105 026147 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} xsec_lib Win32Proj DynamicLibrary MultiByte true DynamicLibrary MultiByte DynamicLibrary MultiByte true DynamicLibrary MultiByte DynamicLibrary MultiByte true DynamicLibrary false MultiByte DynamicLibrary MultiByte true DynamicLibrary false MultiByte <_ProjectFileVersion>10.0.30319.1 ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7D.dll true Windows false $(OutDir)xsec_1D.lib MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7D.dll true Windows false $(OutDir)xsec_1D.lib MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7.dll Windows true true false $(OutDir)xsec_1.lib MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7.dll Windows true true false $(OutDir)xsec_1.lib MachineX64 true Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7D.dll true Windows false $(OutDir)xsec_1D.lib MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7D.dll true Windows false $(OutDir)xsec_1D.lib MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7.dll Windows true true false $(OutDir)xsec_1.lib MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;XSEC_LIB_EXPORTS;PROJ_CANON;PROJ_DSIG;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) $(OutDir)xsec_1_7.dll Windows true true false $(OutDir)xsec_1.lib MachineX64 true xml-security-c-1.7.3/Projects/VC10.0/xsec/siginf/siginf.vcxproj000644 001751 001751 00000040001 12475453105 025313 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {F16BFFE5-F2D0-4BFC-8165-E030781AF1DA} Win32Proj siginf Application true MultiByte Application true MultiByte Application true MultiByte Application true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ Level3 Disabled _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) {d5b5a007-e873-4d12-b4af-60811afd9ef1} xml-security-c-1.7.3/Projects/VC10.0/xsec/threadTest/threadTest.vcxproj000644 001751 001751 00000040655 12475453105 027012 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {1B2062DE-5283-454A-8655-489585843863} Win32Proj threadTest Application true MultiByte Application true MultiByte Application true MultiByte Application true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) {d5b5a007-e873-4d12-b4af-60811afd9ef1} xml-security-c-1.7.3/Projects/VC10.0/xsec/txfmout/txfmout.vcxproj000644 001751 001751 00000041144 12475453105 026002 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {C84D6CCF-E9E5-4846-9E51-4D84412663FA} Win32Proj txfmout Application true MultiByte Application true MultiByte Application true MultiByte Application true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 MaxSpeed true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) {d5b5a007-e873-4d12-b4af-60811afd9ef1} xml-security-c-1.7.3/Projects/VC10.0/xsec/c14n/c14n.vcxproj000644 001751 001751 00000053116 12475453105 024102 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4} c14n Win32Proj Application MultiByte true Application MultiByte Application MultiByte true Application MultiByte Application MultiByte true Application false MultiByte Application MultiByte true Application false MultiByte <_ProjectFileVersion>10.0.30319.1 ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;Xalan-C_1D.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX64 true Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 true EditAndContinue xerces-c_3D.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX64 true {d5b5a007-e873-4d12-b4af-60811afd9ef1} false xml-security-c-1.7.3/Projects/VC10.0/xsec/checksig/checksig.vcxproj000644 001751 001751 00000054102 12475453105 026124 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {B32B9596-E250-41D5-8AA8-A623226C9018} checksig Win32Proj Application MultiByte true Application MultiByte Application MultiByte true Application MultiByte Application MultiByte true Application false MultiByte Application MultiByte true Application false MultiByte <_ProjectFileVersion>10.0.30319.1 ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;Xalan-C_1D.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) Level3 ProgramDatabase true xerces-c_3.lib;crypt32.lib;libeay32.lib;Xalan-C_1.lib;%(AdditionalDependencies) Console true true MachineX64 true Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console MachineX86 X64 Disabled ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true xerces-c_3D.lib;crypt32.lib;libeay32D.lib;%(AdditionalDependencies) true Console MachineX64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX86 true X64 ../../../..;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ProgramDatabase true Level3 xerces-c_3.lib;crypt32.lib;libeay32.lib;%(AdditionalDependencies) Console true true MachineX64 true {d5b5a007-e873-4d12-b4af-60811afd9ef1} false xml-security-c-1.7.3/Projects/VC10.0/xsec/xtest/xtest.vcxproj000644 001751 001751 00000040757 12475453105 025115 0ustar00scantorscantor000000 000000  Debug No Xalan Win32 Debug No Xalan x64 Debug Win32 Debug x64 Release No Xalan Win32 Release No Xalan x64 Release Win32 Release x64 {5C1E590A-F911-4295-8747-0C09682DA009} Win32Proj xtest Application true MultiByte Application true MultiByte Application true MultiByte Application true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte Application false true MultiByte true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ true ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ false ../../../../Build/$(Platform)/VC10/$(Configuration)/ ../../../../Build/$(Platform)/VC10/$(Configuration)/obj/ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDebugDLL ../../../..; false Console true xerces-c_3D.lib;libeay32D.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) Level3 MaxSpeed true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../../../..; Console true true true xerces-c_3.lib;libeay32.lib;%(AdditionalDependencies) {d5b5a007-e873-4d12-b4af-60811afd9ef1} xml-security-c-1.7.3/Projects/VC9.0/xsec/000755 001751 001751 00000000000 12475453106 021076 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/000755 001751 001751 00000000000 12475453106 021540 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleHMAC/000755 001751 001751 00000000000 12475453106 023462 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleValidate/000755 001751 001751 00000000000 12475453106 024503 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleDecrypt/000755 001751 001751 00000000000 12475453106 024364 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleEncrypt/000755 001751 001751 00000000000 12475453106 024376 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/Samples.sln000644 001751 001751 00000007607 12475453106 023674 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleDecrypt", "simpleDecrypt\simpleDecrypt.vcproj", "{BDC78535-DC55-4FD5-97E4-DAE53E42A607}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleEncrypt", "simpleEncrypt\simpleEncrypt.vcproj", "{AFFEB936-ACB5-42D3-9588-F584278960B9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleHMAC", "simpleHMAC\simpleHMAC.vcproj", "{F0CC8080-089E-473E-8565-1C951177A38B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleValidate", "simpleValidate\simpleValidate.vcproj", "{0D10752D-2EA8-4446-9086-D0F8487E914B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug|Win32 = Debug|Win32 Release No Xalan|Win32 = Release No Xalan|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.ActiveCfg = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Debug|Win32.Build.0 = Debug|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.ActiveCfg = Release|Win32 {BDC78535-DC55-4FD5-97E4-DAE53E42A607}.Release|Win32.Build.0 = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.ActiveCfg = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Debug|Win32.Build.0 = Debug|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.ActiveCfg = Release|Win32 {AFFEB936-ACB5-42D3-9588-F584278960B9}.Release|Win32.Build.0 = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.ActiveCfg = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Debug|Win32.Build.0 = Debug|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.ActiveCfg = Release|Win32 {F0CC8080-089E-473E-8565-1C951177A38B}.Release|Win32.Build.0 = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.ActiveCfg = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Debug|Win32.Build.0 = Debug|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.ActiveCfg = Release|Win32 {0D10752D-2EA8-4446-9086-D0F8487E914B}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleEncrypt/simpleEncrypt.vcproj000644 001751 001751 00000021200 12475453106 030454 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleDecrypt/simpleDecrypt.vcproj000644 001751 001751 00000021176 12475453106 030444 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleValidate/simpleValidate.vcproj000644 001751 001751 00000021243 12475453106 030675 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/Samples/simpleHMAC/simpleHMAC.vcproj000644 001751 001751 00000021172 12475453106 026634 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xtest/000755 001751 001751 00000000000 12475453106 022245 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/checksig/000755 001751 001751 00000000000 12475453106 022656 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/c14n/000755 001751 001751 00000000000 12475453106 021643 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/txfmout/000755 001751 001751 00000000000 12475453106 022604 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/threadTest/000755 001751 001751 00000000000 12475453106 023205 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/siginf/000755 001751 001751 00000000000 12475453106 022355 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xsec_lib/000755 001751 001751 00000000000 12475453106 022666 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/cipher/000755 001751 001751 00000000000 12475453106 022350 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/templatesign/000755 001751 001751 00000000000 12475453106 023572 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xklient/000755 001751 001751 00000000000 12475453106 022554 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xsec.sln000644 001751 001751 00000041553 12475453106 022566 0ustar00scantorscantor000000 000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsec_lib", "xsec_lib\xsec_lib.vcproj", "{D5B5A007-E873-4D12-B4AF-60811AFD9EF1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xtest", "xtest\xtest.vcproj", "{127B3E61-096C-438A-BF33-5A9F05C7035A}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c14n", "c14n\c14n.vcproj", "{ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksig", "checksig\checksig.vcproj", "{B32B9596-E250-41D5-8AA8-A623226C9018}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cipher", "cipher\cipher.vcproj", "{0C455A95-991B-4019-8872-AA1FE6139F69}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "siginf", "siginf\siginf.vcproj", "{20E437FA-F184-4D60-9B3B-4358EFFA8B42}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "templatesign", "templatesign\templatesign.vcproj", "{10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadTest", "threadTest\threadTest.vcproj", "{5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "txfmout", "txfmout\txfmout.vcproj", "{E1A95507-B3E4-4075-8C31-A24C9460BF68}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xklient", "xklient\xklient.vcproj", "{48346695-1496-4881-8709-E5C02392930A}" ProjectSection(ProjectDependencies) = postProject {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} = {D5B5A007-E873-4D12-B4AF-60811AFD9EF1} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug No Xalan|Win32 = Debug No Xalan|Win32 Debug No Xalan|x64 = Debug No Xalan|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release No Xalan|Win32 = Release No Xalan|Win32 Release No Xalan|x64 = Release No Xalan|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.ActiveCfg = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|Win32.Build.0 = Debug|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.ActiveCfg = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Debug|x64.Build.0 = Debug|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.ActiveCfg = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|Win32.Build.0 = Release|Win32 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.ActiveCfg = Release|x64 {D5B5A007-E873-4D12-B4AF-60811AFD9EF1}.Release|x64.Build.0 = Release|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|Win32.ActiveCfg = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|Win32.Build.0 = Debug|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|x64.ActiveCfg = Debug|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Debug|x64.Build.0 = Debug|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|Win32.ActiveCfg = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|Win32.Build.0 = Release|Win32 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|x64.ActiveCfg = Release|x64 {127B3E61-096C-438A-BF33-5A9F05C7035A}.Release|x64.Build.0 = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.ActiveCfg = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|Win32.Build.0 = Debug|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.ActiveCfg = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Debug|x64.Build.0 = Debug|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.ActiveCfg = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|Win32.Build.0 = Release|Win32 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.ActiveCfg = Release|x64 {ADFB4A1A-9CB4-4BEE-9DE8-6584708624C4}.Release|x64.Build.0 = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.ActiveCfg = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|Win32.Build.0 = Debug|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.ActiveCfg = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Debug|x64.Build.0 = Debug|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.ActiveCfg = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|Win32.Build.0 = Release|Win32 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.ActiveCfg = Release|x64 {B32B9596-E250-41D5-8AA8-A623226C9018}.Release|x64.Build.0 = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.ActiveCfg = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|Win32.Build.0 = Debug|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.ActiveCfg = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Debug|x64.Build.0 = Debug|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.ActiveCfg = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|Win32.Build.0 = Release|Win32 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.ActiveCfg = Release|x64 {0C455A95-991B-4019-8872-AA1FE6139F69}.Release|x64.Build.0 = Release|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|Win32.ActiveCfg = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|Win32.Build.0 = Debug|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|x64.ActiveCfg = Debug|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Debug|x64.Build.0 = Debug|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|Win32.ActiveCfg = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|Win32.Build.0 = Release|Win32 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|x64.ActiveCfg = Release|x64 {20E437FA-F184-4D60-9B3B-4358EFFA8B42}.Release|x64.Build.0 = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.ActiveCfg = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|Win32.Build.0 = Debug|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.ActiveCfg = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Debug|x64.Build.0 = Debug|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.ActiveCfg = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|Win32.Build.0 = Release|Win32 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.ActiveCfg = Release|x64 {10CE0E86-DF94-4244-9D81-C1D5CDDA6AD8}.Release|x64.Build.0 = Release|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|Win32.ActiveCfg = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|Win32.Build.0 = Debug|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|x64.ActiveCfg = Debug|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Debug|x64.Build.0 = Debug|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|Win32.ActiveCfg = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|Win32.Build.0 = Release|Win32 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|x64.ActiveCfg = Release|x64 {5EE9A0C7-72C8-48F3-A6DB-6E5BF0715DC3}.Release|x64.Build.0 = Release|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|Win32.ActiveCfg = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|Win32.Build.0 = Debug|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|x64.ActiveCfg = Debug|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Debug|x64.Build.0 = Debug|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|Win32.ActiveCfg = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|Win32.Build.0 = Release|Win32 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|x64.ActiveCfg = Release|x64 {E1A95507-B3E4-4075-8C31-A24C9460BF68}.Release|x64.Build.0 = Release|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|Win32.ActiveCfg = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|Win32.Build.0 = Debug No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|x64.ActiveCfg = Debug No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug No Xalan|x64.Build.0 = Debug No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug|Win32.ActiveCfg = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug|Win32.Build.0 = Debug|Win32 {48346695-1496-4881-8709-E5C02392930A}.Debug|x64.ActiveCfg = Debug|x64 {48346695-1496-4881-8709-E5C02392930A}.Debug|x64.Build.0 = Debug|x64 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|Win32.ActiveCfg = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|Win32.Build.0 = Release No Xalan|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|x64.ActiveCfg = Release No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Release No Xalan|x64.Build.0 = Release No Xalan|x64 {48346695-1496-4881-8709-E5C02392930A}.Release|Win32.ActiveCfg = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release|Win32.Build.0 = Release|Win32 {48346695-1496-4881-8709-E5C02392930A}.Release|x64.ActiveCfg = Release|x64 {48346695-1496-4881-8709-E5C02392930A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal xml-security-c-1.7.3/Projects/VC9.0/xsec/xklient/xklient.vcproj000644 001751 001751 00000040171 12475453106 025462 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/templatesign/templatesign.vcproj000644 001751 001751 00000040465 12475453106 027524 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/cipher/cipher.vcproj000644 001751 001751 00000040643 12475453106 025056 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xsec_lib/xsec_lib.vcproj000644 001751 001751 00000146761 12475453106 025722 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/siginf/siginf.vcproj000644 001751 001751 00000040625 12475453106 025070 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/threadTest/threadTest.vcproj000644 001751 001751 00000040725 12475453106 026551 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/txfmout/txfmout.vcproj000644 001751 001751 00000040645 12475453106 025550 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/c14n/c14n.vcproj000644 001751 001751 00000040231 12475453106 023635 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/checksig/checksig.vcproj000644 001751 001751 00000041215 12475453106 025666 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/Projects/VC9.0/xsec/xtest/xtest.vcproj000644 001751 001751 00000042167 12475453106 024653 0ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/framework/000755 001751 001751 00000000000 12477614644 020553 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/000755 001751 001751 00000000000 12477614643 017715 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/canon/000755 001751 001751 00000000000 12477614644 017654 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/dsig/000755 001751 001751 00000000000 12477614644 017504 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/enc/000755 001751 001751 00000000000 12477614644 017323 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/samples/000755 001751 001751 00000000000 12477614644 020222 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/transformers/000755 001751 001751 00000000000 12477614644 021303 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/utils/000755 001751 001751 00000000000 12477614644 017716 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/xenc/000755 001751 001751 00000000000 12477614644 017513 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/xkms/000755 001751 001751 00000000000 12477614644 017540 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/Makefile.am000644 001751 001751 00000042627 12462320141 020601 0ustar00scantorscantor000000 000000 # # Copyright 2006-2010 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = -I.. noinst_PROGRAMS = ${samples} bin_PROGRAMS = ${tools} LDADD = libxml-security-c.la # # The following are sample programs. They are NOT installed # samples = # HMAC sign samples += simpleHMAC simpleHMAC_SOURCES = \ samples/simpleHMAC.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp # HMAC validate samples += simpleValidate simpleValidate_SOURCES = \ samples/simpleValidate.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp # Encrypt samples += simpleEncrypt simpleEncrypt_SOURCES = \ samples/simpleEncrypt.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp # Decrypt samples += simpleDecrypt simpleDecrypt_SOURCES = \ samples/simpleDecrypt.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp # # Finally we compile the tools that can be used to manipulate # XML Security inputs and outputs # tools = # xtest tools += xtest xtest_SOURCES = \ tools/xtest/xtest.cpp tools += c14n c14n_SOURCES = \ tools/c14n/c14n.cpp tools += checksig checksig_SOURCES = \ tools/checksig/checksig.cpp \ tools/checksig/AnonymousResolver.hpp \ tools/checksig/AnonymousResolver.cpp \ tools/checksig/InteropResolver.hpp \ tools/checksig/InteropResolver.cpp tools += templatesign templatesign_SOURCES = \ tools/templatesign/templatesign.cpp tools += txfmout txfmout_SOURCES = \ tools/txfmout/txfmout.cpp tools += siginf siginf_SOURCES = \ tools/siginf/siginf.cpp tools += cipher cipher_SOURCES = \ tools/cipher/cipher.cpp \ tools/cipher/XencInteropResolver.hpp \ tools/cipher/XencInteropResolver.cpp tools += xklient xklient_SOURCES = \ tools/xklient/xklient.cpp lib_LTLIBRARIES = libxml-security-c.la xsecincludedir = $(includedir)/xsec canonincludedir = $(includedir)/xsec/canon encincludedir = $(includedir)/xsec/enc xscryptincludedir = $(includedir)/xsec/enc/XSCrypt opensslincludedir = $(includedir)/xsec/enc/OpenSSL nssincludedir = $(includedir)/xsec/enc/NSS dsigincludedir = $(includedir)/xsec/dsig frameworkincludedir = $(includedir)/xsec/framework transformersincludedir = $(includedir)/xsec/transformers utilsincludedir = $(includedir)/xsec/utils unixutilsincludedir = $(includedir)/xsec/utils/unixutils xencincludedir = $(includedir)/xsec/xenc xkmsincludedir = $(includedir)/xsec/xkms # The required include files # A line like the following will generate a list of headers # for a given directory: (must be issued from base directory) # # find src/framework -name '*.hpp' -exec echo {} \\ ";" | sed "s/src/ xsec/g" # Canon canoninclude_HEADERS = \ canon/XSECXMLNSStack.hpp \ canon/XSECCanon.hpp \ canon/XSECC14n20010315.hpp # enc encinclude_HEADERS = \ enc/XSECCryptoKeyHMAC.hpp \ enc/XSECCryptoX509.hpp \ enc/XSECCryptoKeyDSA.hpp \ enc/XSECCryptoKeyEC.hpp \ enc/XSECKeyInfoResolver.hpp \ enc/XSECCryptoHash.hpp \ enc/XSECCryptoBase64.hpp \ enc/XSECCryptoSymmetricKey.hpp \ enc/XSECCryptoKey.hpp \ enc/XSECCryptoProvider.hpp \ enc/XSECKeyInfoResolverDefault.hpp \ enc/XSECCryptoKeyRSA.hpp \ enc/XSECCryptoException.hpp \ enc/XSECCryptoUtils.hpp xscryptinclude_HEADERS = \ enc/XSCrypt/XSCryptCryptoBase64.hpp opensslinclude_HEADERS = \ enc/OpenSSL/OpenSSLCryptoBase64.hpp \ enc/OpenSSL/OpenSSLCryptoSymmetricKey.hpp \ enc/OpenSSL/OpenSSLCryptoProvider.hpp \ enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp \ enc/OpenSSL/OpenSSLCryptoX509.hpp \ enc/OpenSSL/OpenSSLCryptoHashHMAC.hpp \ enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp \ enc/OpenSSL/OpenSSLCryptoKeyEC.hpp \ enc/OpenSSL/OpenSSLCryptoKeyHMAC.hpp \ enc/OpenSSL/OpenSSLCryptoHash.hpp nssinclude_HEADERS = \ enc/NSS/NSSCryptoX509.hpp \ enc/NSS/NSSCryptoHashHMAC.hpp \ enc/NSS/NSSCryptoKeyDSA.hpp \ enc/NSS/NSSCryptoKeyHMAC.hpp \ enc/NSS/NSSCryptoHash.hpp \ enc/NSS/NSSCryptoSymmetricKey.hpp \ enc/NSS/NSSCryptoProvider.hpp \ enc/NSS/NSSCryptoKeyRSA.hpp dsiginclude_HEADERS = \ dsig/DSIGKeyInfoSPKIData.hpp \ dsig/DSIGXPathHere.hpp \ dsig/DSIGAlgorithmHandlerDefault.hpp \ dsig/DSIGXPathFilterExpr.hpp \ dsig/DSIGKeyInfoX509.hpp \ dsig/DSIGKeyInfoList.hpp \ dsig/DSIGKeyInfoValue.hpp \ dsig/DSIGKeyInfoDEREncoded.hpp \ dsig/DSIGTransformC14n.hpp \ dsig/DSIGTransformXSL.hpp \ dsig/DSIGKeyInfo.hpp \ dsig/DSIGKeyInfoPGPData.hpp \ dsig/DSIGKeyInfoExt.hpp \ dsig/DSIGObject.hpp \ dsig/DSIGTransformList.hpp \ dsig/DSIGTransform.hpp \ dsig/DSIGTransformBase64.hpp \ dsig/DSIGTransformXPath.hpp \ dsig/DSIGKeyInfoMgmtData.hpp \ dsig/DSIGSignedInfo.hpp \ dsig/DSIGTransformXPathFilter.hpp \ dsig/DSIGReferenceList.hpp \ dsig/DSIGReference.hpp \ dsig/DSIGSignature.hpp \ dsig/DSIGKeyInfoName.hpp \ dsig/DSIGTransformEnvelope.hpp \ dsig/DSIGConstants.hpp frameworkinclude_HEADERS = \ framework/XSECAlgorithmHandler.hpp \ framework/XSECURIResolver.hpp \ framework/XSECDefs.hpp \ framework/XSECEnv.hpp \ framework/XSECException.hpp \ framework/XSECError.hpp \ framework/XSECProvider.hpp \ framework/XSECConfig.hpp \ framework/XSECURIResolverXerces.hpp \ framework/XSECAlgorithmMapper.hpp \ framework/XSECW32Config.hpp \ framework/XSECVersion.hpp transformersinclude_HEADERS = \ transformers/TXFMXPathFilter.hpp \ transformers/TXFMSHA1.hpp \ transformers/TXFMParser.hpp \ transformers/TXFMOutputFile.hpp \ transformers/TXFMURL.hpp \ transformers/TXFMBase.hpp \ transformers/TXFMCipher.hpp \ transformers/TXFMEnvelope.hpp \ transformers/TXFMChain.hpp \ transformers/TXFMMD5.hpp \ transformers/TXFMDocObject.hpp \ transformers/TXFMConcatChains.hpp \ transformers/TXFMSB.hpp \ transformers/TXFMC14n.hpp \ transformers/TXFMXSL.hpp \ transformers/TXFMXPath.hpp \ transformers/TXFMBase64.hpp utilsinclude_HEADERS = \ utils/XSECAutoPtr.hpp \ utils/XSECSafeBuffer.hpp \ utils/XSECSOAPRequestor.hpp \ utils/XSECTXFMInputSource.hpp \ utils/XSECNameSpaceExpander.hpp \ utils/XSECSOAPRequestorSimple.hpp \ utils/XSECXPathNodeList.hpp \ utils/XSECSafeBufferFormatter.hpp \ utils/XSECDOMUtils.hpp \ utils/XSECBinTXFMInputStream.hpp \ utils/XSECPlatformUtils.hpp unixutilsinclude_HEADERS = \ utils/unixutils/XSECURIResolverGenericUnix.hpp \ utils/unixutils/XSECBinHTTPURIInputStream.hpp xencinclude_HEADERS = \ xenc/XENCEncryptionMethod.hpp \ xenc/XENCEncryptedType.hpp \ xenc/XENCCipherData.hpp \ xenc/XENCEncryptedKey.hpp \ xenc/XENCCipherValue.hpp \ xenc/XENCEncryptedData.hpp \ xenc/XENCCipherReference.hpp \ xenc/XENCCipher.hpp xkmsinclude_HEADERS = \ xkms/XKMSNotBoundAuthentication.hpp \ xkms/XKMSValidateResult.hpp \ xkms/XKMSValidityInterval.hpp \ xkms/XKMSStatusRequest.hpp \ xkms/XKMSRegisterRequest.hpp \ xkms/XKMSPendingRequest.hpp \ xkms/XKMSCompoundRequest.hpp \ xkms/XKMSUseKeyWith.hpp \ xkms/XKMSValidateRequest.hpp \ xkms/XKMSUnverifiedKeyBinding.hpp \ xkms/XKMSLocateResult.hpp \ xkms/XKMSRespondWith.hpp \ xkms/XKMSQueryKeyBinding.hpp \ xkms/XKMSPrototypeKeyBinding.hpp \ xkms/XKMSKeyBindingAbstractType.hpp \ xkms/XKMSMessageAbstractType.hpp \ xkms/XKMSMessageFactory.hpp \ xkms/XKMSConstants.hpp \ xkms/XKMSRequestAbstractType.hpp \ xkms/XKMSResult.hpp \ xkms/XKMSAuthentication.hpp \ xkms/XKMSLocateRequest.hpp \ xkms/XKMSResultType.hpp \ xkms/XKMSStatusResult.hpp \ xkms/XKMSKeyBinding.hpp \ xkms/XKMSCompoundResult.hpp \ xkms/XKMSRegisterResult.hpp \ xkms/XKMSResponseMechanism.hpp \ xkms/XKMSStatus.hpp \ xkms/XKMSRevokeRequest.hpp \ xkms/XKMSRevokeResult.hpp \ xkms/XKMSRecoverKeyBinding.hpp \ xkms/XKMSRevokeKeyBinding.hpp \ xkms/XKMSRSAKeyPair.hpp \ xkms/XKMSRecoverResult.hpp \ xkms/XKMSReissueResult.hpp \ xkms/XKMSRecoverRequest.hpp \ xkms/XKMSReissueRequest.hpp \ xkms/XKMSReissueKeyBinding.hpp libxml_security_c_la_SOURCES = ${lib_sources} lib_sources = # canon lib_sources += ${canon_sources} # Signature lib_sources += ${dsig_sources} # Main encryption sources lib_sources += ${enc_sources} # Framework sources lib_sources += ${framework_sources} # transformers lib_sources += ${txfm_sources} # Utility sources lib_sources += ${utils_sources} # XML Encryption lib_sources += ${xenc_sources} # XML Key Management lib_sources += ${xkms_sources} # # The following blocks are conditionally added on the basis # of selections made during the "configure" operation if XSEC_AM_HAVE_OPENSSL lib_sources += ${openssl_sources} endif if XSEC_AM_HAVE_NSS lib_sources += ${nss_sources} endif # Sources are build up using a find command: # # find xsec/transformers/ -name '*.cpp' -exec echo {} \\ ";" | sed "s/xsec\// ..\/xsec\//g" # canon canon_sources = \ canon/XSECC14n20010315.cpp \ canon/XSECXMLNSStack.cpp \ canon/XSECCanon.cpp # Signature dsig_sources = \ dsig/DSIGKeyInfoPGPData.cpp \ dsig/DSIGReferenceList.cpp \ dsig/DSIGKeyInfoValue.cpp \ dsig/DSIGKeyInfoDEREncoded.cpp \ dsig/DSIGXPathHere.cpp \ dsig/DSIGAlgorithmHandlerDefault.cpp \ dsig/DSIGXPathFilterExpr.cpp \ dsig/DSIGKeyInfoMgmtData.cpp \ dsig/DSIGTransformXPathFilter.cpp \ dsig/DSIGSignedInfo.cpp \ dsig/DSIGKeyInfoList.cpp \ dsig/DSIGConstants.cpp \ dsig/DSIGSignature.cpp \ dsig/DSIGTransformXSL.cpp \ dsig/DSIGObject.cpp \ dsig/DSIGTransformXPath.cpp \ dsig/DSIGTransformEnvelope.cpp \ dsig/DSIGKeyInfoName.cpp \ dsig/DSIGTransformBase64.cpp \ dsig/DSIGReference.cpp \ dsig/DSIGKeyInfoSPKIData.cpp \ dsig/DSIGTransformList.cpp \ dsig/DSIGKeyInfoX509.cpp \ dsig/DSIGKeyInfoExt.cpp \ dsig/DSIGTransform.cpp \ dsig/DSIGTransformC14n.cpp # Main Crypto interface routines enc_sources = \ enc/XSECCryptoX509.cpp \ enc/XSECKeyInfoResolverDefault.cpp \ enc/XSECCryptoUtils.cpp \ enc/XSECCryptoBase64.cpp \ enc/XSCrypt/XSCryptCryptoBase64.cpp \ enc/XSECCryptoProvider.cpp \ enc/XSECCryptoException.cpp # Framework files framework_sources = \ framework/XSECError.cpp \ framework/XSECAlgorithmMapper.cpp \ framework/XSECEnv.cpp \ framework/XSECProvider.cpp \ framework/XSECException.cpp \ framework/XSECURIResolverXerces.cpp txfm_sources = \ transformers/TXFMBase.cpp \ transformers/TXFMChain.cpp \ transformers/TXFMCipher.cpp \ transformers/TXFMParser.cpp \ transformers/TXFMSB.cpp \ transformers/TXFMEnvelope.cpp \ transformers/TXFMBase64.cpp \ transformers/TXFMXPathFilter.cpp \ transformers/TXFMSHA1.cpp \ transformers/TXFMC14n.cpp \ transformers/TXFMURL.cpp \ transformers/TXFMOutputFile.cpp \ transformers/TXFMXPath.cpp \ transformers/TXFMXSL.cpp \ transformers/TXFMDocObject.cpp \ transformers/TXFMConcatChains.cpp \ transformers/TXFMMD5.cpp # Utility files. Note we don't worry about checking # if the UNIX stuff is necessary - we just assume that # we are running on a *NIX system because compiling under # make. Cygwin compiles use the UNIX utilities, not windows utils_sources = \ utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp \ utils/unixutils/XSECURIResolverGenericUnix.cpp \ utils/unixutils/XSECBinHTTPURIInputStream.cpp \ utils/XSECBinTXFMInputStream.cpp \ utils/XSECXPathNodeList.cpp \ utils/XSECSafeBuffer.cpp \ utils/XSECTXFMInputSource.cpp \ utils/XSECDOMUtils.cpp \ utils/XSECSafeBufferFormatter.cpp \ utils/XSECSOAPRequestorSimple.cpp \ utils/XSECNameSpaceExpander.cpp \ utils/XSECPlatformUtils.cpp # XML Encryption xenc_sources = \ xenc/impl/XENCCipherReferenceImpl.cpp \ xenc/impl/XENCEncryptionMethodImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.hpp \ xenc/impl/XENCCipherValueImpl.cpp \ xenc/impl/XENCCipherImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.hpp \ xenc/impl/XENCCipherDataImpl.hpp \ xenc/impl/XENCEncryptionMethodImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.cpp \ xenc/impl/XENCEncryptedDataImpl.cpp \ xenc/impl/XENCEncryptedTypeImpl.hpp \ xenc/impl/XENCCipherDataImpl.cpp \ xenc/impl/XENCEncryptedDataImpl.hpp \ xenc/impl/XENCCipherValueImpl.hpp \ xenc/impl/XENCEncryptedTypeImpl.cpp \ xenc/impl/XENCCipherImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.cpp \ xenc/impl/XENCCipherReferenceImpl.hpp # XML Key Management xkms_sources = \ xkms/XKMSConstants.cpp \ xkms/impl/XKMSCompoundRequestImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.cpp \ xkms/impl/XKMSRegisterResultImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.cpp \ xkms/impl/XKMSValidateResultImpl.hpp \ xkms/impl/XKMSRevokeResultImpl.hpp \ xkms/impl/XKMSCompoundResultImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.cpp \ xkms/impl/XKMSCompoundResultImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp \ xkms/impl/XKMSQueryKeyBindingImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.cpp \ xkms/impl/XKMSValidateResultImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.hpp \ xkms/impl/XKMSAuthenticationImpl.cpp \ xkms/impl/XKMSNotBoundAuthenticationImpl.hpp \ xkms/impl/XKMSCompoundRequestImpl.hpp \ xkms/impl/XKMSPendingRequestImpl.hpp \ xkms/impl/XKMSStatusResultImpl.cpp \ xkms/impl/XKMSStatusImpl.hpp \ xkms/impl/XKMSRegisterRequestImpl.hpp \ xkms/impl/XKMSReissueRequestImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.hpp \ xkms/impl/XKMSRequestAbstractTypeImpl.cpp \ xkms/impl/XKMSRespondWithImpl.cpp \ xkms/impl/XKMSResponseMechanismImpl.hpp \ xkms/impl/XKMSResultImpl.hpp \ xkms/impl/XKMSReissueResultImpl.cpp \ xkms/impl/XKMSAuthenticationImpl.hpp \ xkms/impl/XKMSMessageAbstractTypeImpl.cpp \ xkms/impl/XKMSRevokeResultImpl.cpp \ xkms/impl/XKMSStatusResultImpl.hpp \ xkms/impl/XKMSReissueKeyBindingImpl.hpp \ xkms/impl/XKMSRespondWithImpl.hpp \ xkms/impl/XKMSRevokeRequestImpl.cpp \ xkms/impl/XKMSPendingRequestImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.cpp \ xkms/impl/XKMSStatusRequestImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.hpp \ xkms/impl/XKMSRecoverKeyBindingImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.cpp \ xkms/impl/XKMSMessageAbstractTypeImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.hpp \ xkms/impl/XKMSLocateResultImpl.hpp \ xkms/impl/XKMSLocateRequestImpl.cpp \ xkms/impl/XKMSResultTypeImpl.cpp \ xkms/impl/XKMSRecoverKeyBindingImpl.hpp \ xkms/impl/XKMSResultImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.cpp \ xkms/impl/XKMSRegisterRequestImpl.cpp \ xkms/impl/XKMSReissueResultImpl.hpp \ xkms/impl/XKMSStatusImpl.cpp \ xkms/impl/XKMSReissueRequestImpl.hpp \ xkms/impl/XKMSStatusRequestImpl.cpp \ xkms/impl/XKMSReissueKeyBindingImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.hpp \ xkms/impl/XKMSResultTypeImpl.hpp \ xkms/impl/XKMSMessageFactoryImpl.cpp \ xkms/impl/XKMSRevokeRequestImpl.hpp \ xkms/impl/XKMSResponseMechanismImpl.cpp \ xkms/impl/XKMSNotBoundAuthentication.cpp \ xkms/impl/XKMSLocateRequestImpl.hpp \ xkms/impl/XKMSLocateResultImpl.cpp \ xkms/impl/XKMSRequestAbstractTypeImpl.hpp \ xkms/impl/XKMSQueryKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.cpp \ xkms/impl/XKMSMessageFactoryImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.hpp \ xkms/impl/XKMSRegisterResultImpl.hpp # Conditional crypto routines openssl_sources = \ enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp \ enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp \ enc/OpenSSL/OpenSSLCryptoHash.cpp \ enc/OpenSSL/OpenSSLCryptoProvider.cpp \ enc/OpenSSL/OpenSSLCryptoX509.cpp \ enc/OpenSSL/OpenSSLCryptoBase64.cpp \ enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp \ enc/OpenSSL/OpenSSLCryptoKeyEC.cpp \ enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp \ enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp nss_sources = \ enc/NSS/NSSCryptoX509.cpp \ enc/NSS/NSSCryptoHashHMAC.cpp \ enc/NSS/NSSCryptoHash.cpp \ enc/NSS/NSSCryptoKeyDSA.cpp \ enc/NSS/NSSCryptoProvider.cpp \ enc/NSS/NSSCryptoSymmetricKey.cpp \ enc/NSS/NSSCryptoKeyRSA.cpp \ enc/NSS/NSSCryptoKeyHMAC.cpp # # Now the library specific build items # libxml_security_c_la_LDFLAGS = -version-info 17:3:0 install-exec-hook: for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done EXTRA_DIST = \ utils/winutils/XSECURIResolverGenericWin32.cpp \ utils/winutils/XSECSOAPRequestorSimpleWin32.cpp \ utils/winutils/XSECBinHTTPURIInputStream.cpp \ utils/winutils/XSECURIResolverGenericWin32.hpp \ utils/winutils/XSECBinHTTPURIInputStream.hpp \ enc/WinCAPI/WinCAPICryptoProvider.cpp \ enc/WinCAPI/WinCAPICryptoKeyHMAC.hpp \ enc/WinCAPI/WinCAPICryptoHash.cpp \ enc/WinCAPI/WinCAPICryptoKeyDSA.cpp \ enc/WinCAPI/WinCAPICryptoHashHMAC.hpp \ enc/WinCAPI/WinCAPICryptoKeyDSA.hpp \ enc/WinCAPI/WinCAPICryptoSymmetricKey.hpp \ enc/WinCAPI/WinCAPICryptoX509.hpp \ enc/WinCAPI/WinCAPICryptoKeyRSA.hpp \ enc/WinCAPI/WinCAPICryptoX509.cpp \ enc/WinCAPI/WinCAPICryptoHashHMAC.cpp \ enc/WinCAPI/WinCAPICryptoHash.hpp \ enc/WinCAPI/WinCAPICryptoKeyRSA.cpp \ enc/WinCAPI/WinCAPICryptoProvider.hpp \ enc/WinCAPI/WinCAPICryptoSymmetricKey.cpp \ enc/WinCAPI/WinCAPICryptoKeyHMAC.cpp xml-security-c-1.7.3/xsec/Makefile.in000644 001751 001751 00001030163 12475453706 020625 0ustar00scantorscantor000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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. # 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@ # # Copyright 2006-2010 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # 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@ noinst_PROGRAMS = $(am__EXEEXT_2) bin_PROGRAMS = $(am__EXEEXT_1) # # The following blocks are conditionally added on the basis # of selections made during the "configure" operation @XSEC_AM_HAVE_OPENSSL_TRUE@am__append_1 = ${openssl_sources} @XSEC_AM_HAVE_NSS_TRUE@am__append_2 = ${nss_sources} subdir = xsec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(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 $(canoninclude_HEADERS) \ $(dsiginclude_HEADERS) $(encinclude_HEADERS) \ $(frameworkinclude_HEADERS) $(nssinclude_HEADERS) \ $(opensslinclude_HEADERS) $(transformersinclude_HEADERS) \ $(unixutilsinclude_HEADERS) $(utilsinclude_HEADERS) \ $(xencinclude_HEADERS) $(xkmsinclude_HEADERS) \ $(xscryptinclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/xsec/framework/XSECConfig.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(canonincludedir)" "$(DESTDIR)$(dsigincludedir)" \ "$(DESTDIR)$(encincludedir)" \ "$(DESTDIR)$(frameworkincludedir)" \ "$(DESTDIR)$(nssincludedir)" "$(DESTDIR)$(opensslincludedir)" \ "$(DESTDIR)$(transformersincludedir)" \ "$(DESTDIR)$(unixutilsincludedir)" \ "$(DESTDIR)$(utilsincludedir)" "$(DESTDIR)$(xencincludedir)" \ "$(DESTDIR)$(xkmsincludedir)" "$(DESTDIR)$(xscryptincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libxml_security_c_la_LIBADD = am__libxml_security_c_la_SOURCES_DIST = canon/XSECC14n20010315.cpp \ canon/XSECXMLNSStack.cpp canon/XSECCanon.cpp \ dsig/DSIGKeyInfoPGPData.cpp dsig/DSIGReferenceList.cpp \ dsig/DSIGKeyInfoValue.cpp dsig/DSIGKeyInfoDEREncoded.cpp \ dsig/DSIGXPathHere.cpp dsig/DSIGAlgorithmHandlerDefault.cpp \ dsig/DSIGXPathFilterExpr.cpp dsig/DSIGKeyInfoMgmtData.cpp \ dsig/DSIGTransformXPathFilter.cpp dsig/DSIGSignedInfo.cpp \ dsig/DSIGKeyInfoList.cpp dsig/DSIGConstants.cpp \ dsig/DSIGSignature.cpp dsig/DSIGTransformXSL.cpp \ dsig/DSIGObject.cpp dsig/DSIGTransformXPath.cpp \ dsig/DSIGTransformEnvelope.cpp dsig/DSIGKeyInfoName.cpp \ dsig/DSIGTransformBase64.cpp dsig/DSIGReference.cpp \ dsig/DSIGKeyInfoSPKIData.cpp dsig/DSIGTransformList.cpp \ dsig/DSIGKeyInfoX509.cpp dsig/DSIGKeyInfoExt.cpp \ dsig/DSIGTransform.cpp dsig/DSIGTransformC14n.cpp \ enc/XSECCryptoX509.cpp enc/XSECKeyInfoResolverDefault.cpp \ enc/XSECCryptoUtils.cpp enc/XSECCryptoBase64.cpp \ enc/XSCrypt/XSCryptCryptoBase64.cpp enc/XSECCryptoProvider.cpp \ enc/XSECCryptoException.cpp framework/XSECError.cpp \ framework/XSECAlgorithmMapper.cpp framework/XSECEnv.cpp \ framework/XSECProvider.cpp framework/XSECException.cpp \ framework/XSECURIResolverXerces.cpp transformers/TXFMBase.cpp \ transformers/TXFMChain.cpp transformers/TXFMCipher.cpp \ transformers/TXFMParser.cpp transformers/TXFMSB.cpp \ transformers/TXFMEnvelope.cpp transformers/TXFMBase64.cpp \ transformers/TXFMXPathFilter.cpp transformers/TXFMSHA1.cpp \ transformers/TXFMC14n.cpp transformers/TXFMURL.cpp \ transformers/TXFMOutputFile.cpp transformers/TXFMXPath.cpp \ transformers/TXFMXSL.cpp transformers/TXFMDocObject.cpp \ transformers/TXFMConcatChains.cpp transformers/TXFMMD5.cpp \ utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp \ utils/unixutils/XSECURIResolverGenericUnix.cpp \ utils/unixutils/XSECBinHTTPURIInputStream.cpp \ utils/XSECBinTXFMInputStream.cpp utils/XSECXPathNodeList.cpp \ utils/XSECSafeBuffer.cpp utils/XSECTXFMInputSource.cpp \ utils/XSECDOMUtils.cpp utils/XSECSafeBufferFormatter.cpp \ utils/XSECSOAPRequestorSimple.cpp \ utils/XSECNameSpaceExpander.cpp utils/XSECPlatformUtils.cpp \ xenc/impl/XENCCipherReferenceImpl.cpp \ xenc/impl/XENCEncryptionMethodImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.hpp \ xenc/impl/XENCCipherValueImpl.cpp xenc/impl/XENCCipherImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.hpp \ xenc/impl/XENCCipherDataImpl.hpp \ xenc/impl/XENCEncryptionMethodImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.cpp \ xenc/impl/XENCEncryptedDataImpl.cpp \ xenc/impl/XENCEncryptedTypeImpl.hpp \ xenc/impl/XENCCipherDataImpl.cpp \ xenc/impl/XENCEncryptedDataImpl.hpp \ xenc/impl/XENCCipherValueImpl.hpp \ xenc/impl/XENCEncryptedTypeImpl.cpp \ xenc/impl/XENCCipherImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.cpp \ xenc/impl/XENCCipherReferenceImpl.hpp xkms/XKMSConstants.cpp \ xkms/impl/XKMSCompoundRequestImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.cpp \ xkms/impl/XKMSRegisterResultImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.cpp \ xkms/impl/XKMSValidateResultImpl.hpp \ xkms/impl/XKMSRevokeResultImpl.hpp \ xkms/impl/XKMSCompoundResultImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.cpp \ xkms/impl/XKMSCompoundResultImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp \ xkms/impl/XKMSQueryKeyBindingImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.cpp \ xkms/impl/XKMSValidateResultImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.hpp \ xkms/impl/XKMSAuthenticationImpl.cpp \ xkms/impl/XKMSNotBoundAuthenticationImpl.hpp \ xkms/impl/XKMSCompoundRequestImpl.hpp \ xkms/impl/XKMSPendingRequestImpl.hpp \ xkms/impl/XKMSStatusResultImpl.cpp \ xkms/impl/XKMSStatusImpl.hpp \ xkms/impl/XKMSRegisterRequestImpl.hpp \ xkms/impl/XKMSReissueRequestImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.hpp \ xkms/impl/XKMSRequestAbstractTypeImpl.cpp \ xkms/impl/XKMSRespondWithImpl.cpp \ xkms/impl/XKMSResponseMechanismImpl.hpp \ xkms/impl/XKMSResultImpl.hpp \ xkms/impl/XKMSReissueResultImpl.cpp \ xkms/impl/XKMSAuthenticationImpl.hpp \ xkms/impl/XKMSMessageAbstractTypeImpl.cpp \ xkms/impl/XKMSRevokeResultImpl.cpp \ xkms/impl/XKMSStatusResultImpl.hpp \ xkms/impl/XKMSReissueKeyBindingImpl.hpp \ xkms/impl/XKMSRespondWithImpl.hpp \ xkms/impl/XKMSRevokeRequestImpl.cpp \ xkms/impl/XKMSPendingRequestImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.cpp \ xkms/impl/XKMSStatusRequestImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.hpp \ xkms/impl/XKMSRecoverKeyBindingImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.cpp \ xkms/impl/XKMSMessageAbstractTypeImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.hpp \ xkms/impl/XKMSLocateResultImpl.hpp \ xkms/impl/XKMSLocateRequestImpl.cpp \ xkms/impl/XKMSResultTypeImpl.cpp \ xkms/impl/XKMSRecoverKeyBindingImpl.hpp \ xkms/impl/XKMSResultImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.cpp \ xkms/impl/XKMSRegisterRequestImpl.cpp \ xkms/impl/XKMSReissueResultImpl.hpp \ xkms/impl/XKMSStatusImpl.cpp \ xkms/impl/XKMSReissueRequestImpl.hpp \ xkms/impl/XKMSStatusRequestImpl.cpp \ xkms/impl/XKMSReissueKeyBindingImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.hpp \ xkms/impl/XKMSResultTypeImpl.hpp \ xkms/impl/XKMSMessageFactoryImpl.cpp \ xkms/impl/XKMSRevokeRequestImpl.hpp \ xkms/impl/XKMSResponseMechanismImpl.cpp \ xkms/impl/XKMSNotBoundAuthentication.cpp \ xkms/impl/XKMSLocateRequestImpl.hpp \ xkms/impl/XKMSLocateResultImpl.cpp \ xkms/impl/XKMSRequestAbstractTypeImpl.hpp \ xkms/impl/XKMSQueryKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.cpp \ xkms/impl/XKMSMessageFactoryImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.hpp \ xkms/impl/XKMSRegisterResultImpl.hpp \ enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp \ enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp \ enc/OpenSSL/OpenSSLCryptoHash.cpp \ enc/OpenSSL/OpenSSLCryptoProvider.cpp \ enc/OpenSSL/OpenSSLCryptoX509.cpp \ enc/OpenSSL/OpenSSLCryptoBase64.cpp \ enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp \ enc/OpenSSL/OpenSSLCryptoKeyEC.cpp \ enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp \ enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp enc/NSS/NSSCryptoX509.cpp \ enc/NSS/NSSCryptoHashHMAC.cpp enc/NSS/NSSCryptoHash.cpp \ enc/NSS/NSSCryptoKeyDSA.cpp enc/NSS/NSSCryptoProvider.cpp \ enc/NSS/NSSCryptoSymmetricKey.cpp enc/NSS/NSSCryptoKeyRSA.cpp \ enc/NSS/NSSCryptoKeyHMAC.cpp am__objects_1 = XSECC14n20010315.lo XSECXMLNSStack.lo XSECCanon.lo am__objects_2 = DSIGKeyInfoPGPData.lo DSIGReferenceList.lo \ DSIGKeyInfoValue.lo DSIGKeyInfoDEREncoded.lo DSIGXPathHere.lo \ DSIGAlgorithmHandlerDefault.lo DSIGXPathFilterExpr.lo \ DSIGKeyInfoMgmtData.lo DSIGTransformXPathFilter.lo \ DSIGSignedInfo.lo DSIGKeyInfoList.lo DSIGConstants.lo \ DSIGSignature.lo DSIGTransformXSL.lo DSIGObject.lo \ DSIGTransformXPath.lo DSIGTransformEnvelope.lo \ DSIGKeyInfoName.lo DSIGTransformBase64.lo DSIGReference.lo \ DSIGKeyInfoSPKIData.lo DSIGTransformList.lo DSIGKeyInfoX509.lo \ DSIGKeyInfoExt.lo DSIGTransform.lo DSIGTransformC14n.lo am__objects_3 = XSECCryptoX509.lo XSECKeyInfoResolverDefault.lo \ XSECCryptoUtils.lo XSECCryptoBase64.lo XSCryptCryptoBase64.lo \ XSECCryptoProvider.lo XSECCryptoException.lo am__objects_4 = XSECError.lo XSECAlgorithmMapper.lo XSECEnv.lo \ XSECProvider.lo XSECException.lo XSECURIResolverXerces.lo am__objects_5 = TXFMBase.lo TXFMChain.lo TXFMCipher.lo TXFMParser.lo \ TXFMSB.lo TXFMEnvelope.lo TXFMBase64.lo TXFMXPathFilter.lo \ TXFMSHA1.lo TXFMC14n.lo TXFMURL.lo TXFMOutputFile.lo \ TXFMXPath.lo TXFMXSL.lo TXFMDocObject.lo TXFMConcatChains.lo \ TXFMMD5.lo am__objects_6 = XSECSOAPRequestorSimpleUnix.lo \ XSECURIResolverGenericUnix.lo XSECBinHTTPURIInputStream.lo \ XSECBinTXFMInputStream.lo XSECXPathNodeList.lo \ XSECSafeBuffer.lo XSECTXFMInputSource.lo XSECDOMUtils.lo \ XSECSafeBufferFormatter.lo XSECSOAPRequestorSimple.lo \ XSECNameSpaceExpander.lo XSECPlatformUtils.lo am__objects_7 = XENCCipherReferenceImpl.lo XENCEncryptionMethodImpl.lo \ XENCCipherValueImpl.lo XENCAlgorithmHandlerDefault.lo \ XENCEncryptedDataImpl.lo XENCCipherDataImpl.lo \ XENCEncryptedTypeImpl.lo XENCCipherImpl.lo \ XENCEncryptedKeyImpl.lo am__objects_8 = XKMSConstants.lo XKMSCompoundRequestImpl.lo \ XKMSRecoverRequestImpl.lo XKMSRegisterResultImpl.lo \ XKMSRecoverResultImpl.lo XKMSCompoundResultImpl.lo \ XKMSRevokeKeyBindingImpl.lo XKMSKeyBindingAbstractTypeImpl.lo \ XKMSPrototypeKeyBindingImpl.lo XKMSValidateResultImpl.lo \ XKMSAuthenticationImpl.lo XKMSStatusResultImpl.lo \ XKMSReissueRequestImpl.lo XKMSKeyBindingImpl.lo \ XKMSRequestAbstractTypeImpl.lo XKMSRespondWithImpl.lo \ XKMSReissueResultImpl.lo XKMSMessageAbstractTypeImpl.lo \ XKMSRevokeResultImpl.lo XKMSRevokeRequestImpl.lo \ XKMSPendingRequestImpl.lo XKMSValidateRequestImpl.lo \ XKMSRecoverKeyBindingImpl.lo XKMSRSAKeyPairImpl.lo \ XKMSUnverifiedKeyBindingImpl.lo XKMSLocateRequestImpl.lo \ XKMSResultTypeImpl.lo XKMSResultImpl.lo \ XKMSValidityIntervalImpl.lo XKMSRegisterRequestImpl.lo \ XKMSStatusImpl.lo XKMSStatusRequestImpl.lo \ XKMSReissueKeyBindingImpl.lo XKMSMessageFactoryImpl.lo \ XKMSResponseMechanismImpl.lo XKMSNotBoundAuthentication.lo \ XKMSLocateResultImpl.lo XKMSQueryKeyBindingImpl.lo \ XKMSUseKeyWithImpl.lo am__objects_9 = OpenSSLCryptoHashHMAC.lo OpenSSLCryptoKeyRSA.lo \ OpenSSLCryptoHash.lo OpenSSLCryptoProvider.lo \ OpenSSLCryptoX509.lo OpenSSLCryptoBase64.lo \ OpenSSLCryptoKeyDSA.lo OpenSSLCryptoKeyEC.lo \ OpenSSLCryptoSymmetricKey.lo OpenSSLCryptoKeyHMAC.lo @XSEC_AM_HAVE_OPENSSL_TRUE@am__objects_10 = $(am__objects_9) am__objects_11 = NSSCryptoX509.lo NSSCryptoHashHMAC.lo \ NSSCryptoHash.lo NSSCryptoKeyDSA.lo NSSCryptoProvider.lo \ NSSCryptoSymmetricKey.lo NSSCryptoKeyRSA.lo \ NSSCryptoKeyHMAC.lo @XSEC_AM_HAVE_NSS_TRUE@am__objects_12 = $(am__objects_11) am__objects_13 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ $(am__objects_4) $(am__objects_5) $(am__objects_6) \ $(am__objects_7) $(am__objects_8) $(am__objects_10) \ $(am__objects_12) am_libxml_security_c_la_OBJECTS = $(am__objects_13) libxml_security_c_la_OBJECTS = $(am_libxml_security_c_la_OBJECTS) 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 = libxml_security_c_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libxml_security_c_la_LDFLAGS) \ $(LDFLAGS) -o $@ am__EXEEXT_1 = xtest$(EXEEXT) c14n$(EXEEXT) checksig$(EXEEXT) \ templatesign$(EXEEXT) txfmout$(EXEEXT) siginf$(EXEEXT) \ cipher$(EXEEXT) xklient$(EXEEXT) am__EXEEXT_2 = simpleHMAC$(EXEEXT) simpleValidate$(EXEEXT) \ simpleEncrypt$(EXEEXT) simpleDecrypt$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_c14n_OBJECTS = c14n.$(OBJEXT) c14n_OBJECTS = $(am_c14n_OBJECTS) c14n_LDADD = $(LDADD) c14n_DEPENDENCIES = libxml-security-c.la am_checksig_OBJECTS = checksig.$(OBJEXT) AnonymousResolver.$(OBJEXT) \ InteropResolver.$(OBJEXT) checksig_OBJECTS = $(am_checksig_OBJECTS) checksig_LDADD = $(LDADD) checksig_DEPENDENCIES = libxml-security-c.la am_cipher_OBJECTS = cipher.$(OBJEXT) XencInteropResolver.$(OBJEXT) cipher_OBJECTS = $(am_cipher_OBJECTS) cipher_LDADD = $(LDADD) cipher_DEPENDENCIES = libxml-security-c.la am_siginf_OBJECTS = siginf.$(OBJEXT) siginf_OBJECTS = $(am_siginf_OBJECTS) siginf_LDADD = $(LDADD) siginf_DEPENDENCIES = libxml-security-c.la am_simpleDecrypt_OBJECTS = simpleDecrypt.$(OBJEXT) \ IOStreamOutputter.$(OBJEXT) simpleDecrypt_OBJECTS = $(am_simpleDecrypt_OBJECTS) simpleDecrypt_LDADD = $(LDADD) simpleDecrypt_DEPENDENCIES = libxml-security-c.la am_simpleEncrypt_OBJECTS = simpleEncrypt.$(OBJEXT) \ IOStreamOutputter.$(OBJEXT) simpleEncrypt_OBJECTS = $(am_simpleEncrypt_OBJECTS) simpleEncrypt_LDADD = $(LDADD) simpleEncrypt_DEPENDENCIES = libxml-security-c.la am_simpleHMAC_OBJECTS = simpleHMAC.$(OBJEXT) \ IOStreamOutputter.$(OBJEXT) simpleHMAC_OBJECTS = $(am_simpleHMAC_OBJECTS) simpleHMAC_LDADD = $(LDADD) simpleHMAC_DEPENDENCIES = libxml-security-c.la am_simpleValidate_OBJECTS = simpleValidate.$(OBJEXT) \ IOStreamOutputter.$(OBJEXT) simpleValidate_OBJECTS = $(am_simpleValidate_OBJECTS) simpleValidate_LDADD = $(LDADD) simpleValidate_DEPENDENCIES = libxml-security-c.la am_templatesign_OBJECTS = templatesign.$(OBJEXT) templatesign_OBJECTS = $(am_templatesign_OBJECTS) templatesign_LDADD = $(LDADD) templatesign_DEPENDENCIES = libxml-security-c.la am_txfmout_OBJECTS = txfmout.$(OBJEXT) txfmout_OBJECTS = $(am_txfmout_OBJECTS) txfmout_LDADD = $(LDADD) txfmout_DEPENDENCIES = libxml-security-c.la am_xklient_OBJECTS = xklient.$(OBJEXT) xklient_OBJECTS = $(am_xklient_OBJECTS) xklient_LDADD = $(LDADD) xklient_DEPENDENCIES = libxml-security-c.la am_xtest_OBJECTS = xtest.$(OBJEXT) xtest_OBJECTS = $(am_xtest_OBJECTS) xtest_LDADD = $(LDADD) xtest_DEPENDENCIES = libxml-security-c.la 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) -I$(top_builddir)/xsec/framework depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = 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 = $(libxml_security_c_la_SOURCES) $(c14n_SOURCES) \ $(checksig_SOURCES) $(cipher_SOURCES) $(siginf_SOURCES) \ $(simpleDecrypt_SOURCES) $(simpleEncrypt_SOURCES) \ $(simpleHMAC_SOURCES) $(simpleValidate_SOURCES) \ $(templatesign_SOURCES) $(txfmout_SOURCES) $(xklient_SOURCES) \ $(xtest_SOURCES) DIST_SOURCES = $(am__libxml_security_c_la_SOURCES_DIST) \ $(c14n_SOURCES) $(checksig_SOURCES) $(cipher_SOURCES) \ $(siginf_SOURCES) $(simpleDecrypt_SOURCES) \ $(simpleEncrypt_SOURCES) $(simpleHMAC_SOURCES) \ $(simpleValidate_SOURCES) $(templatesign_SOURCES) \ $(txfmout_SOURCES) $(xklient_SOURCES) $(xtest_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(canoninclude_HEADERS) $(dsiginclude_HEADERS) \ $(encinclude_HEADERS) $(frameworkinclude_HEADERS) \ $(nssinclude_HEADERS) $(opensslinclude_HEADERS) \ $(transformersinclude_HEADERS) $(unixutilsinclude_HEADERS) \ $(utilsinclude_HEADERS) $(xencinclude_HEADERS) \ $(xkmsinclude_HEADERS) $(xscryptinclude_HEADERS) 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)/build-aux/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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ 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@ GREP = @GREP@ 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@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ 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@ AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = -I.. LDADD = libxml-security-c.la # # The following are sample programs. They are NOT installed # # HMAC sign # HMAC validate # Encrypt # Decrypt samples = simpleHMAC simpleValidate simpleEncrypt simpleDecrypt simpleHMAC_SOURCES = \ samples/simpleHMAC.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp simpleValidate_SOURCES = \ samples/simpleValidate.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp simpleEncrypt_SOURCES = \ samples/simpleEncrypt.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp simpleDecrypt_SOURCES = \ samples/simpleDecrypt.cpp \ samples/IOStreamOutputter.cpp \ samples/IOStreamOutputter.hpp # # Finally we compile the tools that can be used to manipulate # XML Security inputs and outputs # # xtest tools = xtest c14n checksig templatesign txfmout siginf cipher xklient xtest_SOURCES = \ tools/xtest/xtest.cpp c14n_SOURCES = \ tools/c14n/c14n.cpp checksig_SOURCES = \ tools/checksig/checksig.cpp \ tools/checksig/AnonymousResolver.hpp \ tools/checksig/AnonymousResolver.cpp \ tools/checksig/InteropResolver.hpp \ tools/checksig/InteropResolver.cpp templatesign_SOURCES = \ tools/templatesign/templatesign.cpp txfmout_SOURCES = \ tools/txfmout/txfmout.cpp siginf_SOURCES = \ tools/siginf/siginf.cpp cipher_SOURCES = \ tools/cipher/cipher.cpp \ tools/cipher/XencInteropResolver.hpp \ tools/cipher/XencInteropResolver.cpp xklient_SOURCES = \ tools/xklient/xklient.cpp lib_LTLIBRARIES = libxml-security-c.la xsecincludedir = $(includedir)/xsec canonincludedir = $(includedir)/xsec/canon encincludedir = $(includedir)/xsec/enc xscryptincludedir = $(includedir)/xsec/enc/XSCrypt opensslincludedir = $(includedir)/xsec/enc/OpenSSL nssincludedir = $(includedir)/xsec/enc/NSS dsigincludedir = $(includedir)/xsec/dsig frameworkincludedir = $(includedir)/xsec/framework transformersincludedir = $(includedir)/xsec/transformers utilsincludedir = $(includedir)/xsec/utils unixutilsincludedir = $(includedir)/xsec/utils/unixutils xencincludedir = $(includedir)/xsec/xenc xkmsincludedir = $(includedir)/xsec/xkms # The required include files # A line like the following will generate a list of headers # for a given directory: (must be issued from base directory) # # find src/framework -name '*.hpp' -exec echo {} \\ ";" | sed "s/src/ xsec/g" # Canon canoninclude_HEADERS = \ canon/XSECXMLNSStack.hpp \ canon/XSECCanon.hpp \ canon/XSECC14n20010315.hpp # enc encinclude_HEADERS = \ enc/XSECCryptoKeyHMAC.hpp \ enc/XSECCryptoX509.hpp \ enc/XSECCryptoKeyDSA.hpp \ enc/XSECCryptoKeyEC.hpp \ enc/XSECKeyInfoResolver.hpp \ enc/XSECCryptoHash.hpp \ enc/XSECCryptoBase64.hpp \ enc/XSECCryptoSymmetricKey.hpp \ enc/XSECCryptoKey.hpp \ enc/XSECCryptoProvider.hpp \ enc/XSECKeyInfoResolverDefault.hpp \ enc/XSECCryptoKeyRSA.hpp \ enc/XSECCryptoException.hpp \ enc/XSECCryptoUtils.hpp xscryptinclude_HEADERS = \ enc/XSCrypt/XSCryptCryptoBase64.hpp opensslinclude_HEADERS = \ enc/OpenSSL/OpenSSLCryptoBase64.hpp \ enc/OpenSSL/OpenSSLCryptoSymmetricKey.hpp \ enc/OpenSSL/OpenSSLCryptoProvider.hpp \ enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp \ enc/OpenSSL/OpenSSLCryptoX509.hpp \ enc/OpenSSL/OpenSSLCryptoHashHMAC.hpp \ enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp \ enc/OpenSSL/OpenSSLCryptoKeyEC.hpp \ enc/OpenSSL/OpenSSLCryptoKeyHMAC.hpp \ enc/OpenSSL/OpenSSLCryptoHash.hpp nssinclude_HEADERS = \ enc/NSS/NSSCryptoX509.hpp \ enc/NSS/NSSCryptoHashHMAC.hpp \ enc/NSS/NSSCryptoKeyDSA.hpp \ enc/NSS/NSSCryptoKeyHMAC.hpp \ enc/NSS/NSSCryptoHash.hpp \ enc/NSS/NSSCryptoSymmetricKey.hpp \ enc/NSS/NSSCryptoProvider.hpp \ enc/NSS/NSSCryptoKeyRSA.hpp dsiginclude_HEADERS = \ dsig/DSIGKeyInfoSPKIData.hpp \ dsig/DSIGXPathHere.hpp \ dsig/DSIGAlgorithmHandlerDefault.hpp \ dsig/DSIGXPathFilterExpr.hpp \ dsig/DSIGKeyInfoX509.hpp \ dsig/DSIGKeyInfoList.hpp \ dsig/DSIGKeyInfoValue.hpp \ dsig/DSIGKeyInfoDEREncoded.hpp \ dsig/DSIGTransformC14n.hpp \ dsig/DSIGTransformXSL.hpp \ dsig/DSIGKeyInfo.hpp \ dsig/DSIGKeyInfoPGPData.hpp \ dsig/DSIGKeyInfoExt.hpp \ dsig/DSIGObject.hpp \ dsig/DSIGTransformList.hpp \ dsig/DSIGTransform.hpp \ dsig/DSIGTransformBase64.hpp \ dsig/DSIGTransformXPath.hpp \ dsig/DSIGKeyInfoMgmtData.hpp \ dsig/DSIGSignedInfo.hpp \ dsig/DSIGTransformXPathFilter.hpp \ dsig/DSIGReferenceList.hpp \ dsig/DSIGReference.hpp \ dsig/DSIGSignature.hpp \ dsig/DSIGKeyInfoName.hpp \ dsig/DSIGTransformEnvelope.hpp \ dsig/DSIGConstants.hpp frameworkinclude_HEADERS = \ framework/XSECAlgorithmHandler.hpp \ framework/XSECURIResolver.hpp \ framework/XSECDefs.hpp \ framework/XSECEnv.hpp \ framework/XSECException.hpp \ framework/XSECError.hpp \ framework/XSECProvider.hpp \ framework/XSECConfig.hpp \ framework/XSECURIResolverXerces.hpp \ framework/XSECAlgorithmMapper.hpp \ framework/XSECW32Config.hpp \ framework/XSECVersion.hpp transformersinclude_HEADERS = \ transformers/TXFMXPathFilter.hpp \ transformers/TXFMSHA1.hpp \ transformers/TXFMParser.hpp \ transformers/TXFMOutputFile.hpp \ transformers/TXFMURL.hpp \ transformers/TXFMBase.hpp \ transformers/TXFMCipher.hpp \ transformers/TXFMEnvelope.hpp \ transformers/TXFMChain.hpp \ transformers/TXFMMD5.hpp \ transformers/TXFMDocObject.hpp \ transformers/TXFMConcatChains.hpp \ transformers/TXFMSB.hpp \ transformers/TXFMC14n.hpp \ transformers/TXFMXSL.hpp \ transformers/TXFMXPath.hpp \ transformers/TXFMBase64.hpp utilsinclude_HEADERS = \ utils/XSECAutoPtr.hpp \ utils/XSECSafeBuffer.hpp \ utils/XSECSOAPRequestor.hpp \ utils/XSECTXFMInputSource.hpp \ utils/XSECNameSpaceExpander.hpp \ utils/XSECSOAPRequestorSimple.hpp \ utils/XSECXPathNodeList.hpp \ utils/XSECSafeBufferFormatter.hpp \ utils/XSECDOMUtils.hpp \ utils/XSECBinTXFMInputStream.hpp \ utils/XSECPlatformUtils.hpp unixutilsinclude_HEADERS = \ utils/unixutils/XSECURIResolverGenericUnix.hpp \ utils/unixutils/XSECBinHTTPURIInputStream.hpp xencinclude_HEADERS = \ xenc/XENCEncryptionMethod.hpp \ xenc/XENCEncryptedType.hpp \ xenc/XENCCipherData.hpp \ xenc/XENCEncryptedKey.hpp \ xenc/XENCCipherValue.hpp \ xenc/XENCEncryptedData.hpp \ xenc/XENCCipherReference.hpp \ xenc/XENCCipher.hpp xkmsinclude_HEADERS = \ xkms/XKMSNotBoundAuthentication.hpp \ xkms/XKMSValidateResult.hpp \ xkms/XKMSValidityInterval.hpp \ xkms/XKMSStatusRequest.hpp \ xkms/XKMSRegisterRequest.hpp \ xkms/XKMSPendingRequest.hpp \ xkms/XKMSCompoundRequest.hpp \ xkms/XKMSUseKeyWith.hpp \ xkms/XKMSValidateRequest.hpp \ xkms/XKMSUnverifiedKeyBinding.hpp \ xkms/XKMSLocateResult.hpp \ xkms/XKMSRespondWith.hpp \ xkms/XKMSQueryKeyBinding.hpp \ xkms/XKMSPrototypeKeyBinding.hpp \ xkms/XKMSKeyBindingAbstractType.hpp \ xkms/XKMSMessageAbstractType.hpp \ xkms/XKMSMessageFactory.hpp \ xkms/XKMSConstants.hpp \ xkms/XKMSRequestAbstractType.hpp \ xkms/XKMSResult.hpp \ xkms/XKMSAuthentication.hpp \ xkms/XKMSLocateRequest.hpp \ xkms/XKMSResultType.hpp \ xkms/XKMSStatusResult.hpp \ xkms/XKMSKeyBinding.hpp \ xkms/XKMSCompoundResult.hpp \ xkms/XKMSRegisterResult.hpp \ xkms/XKMSResponseMechanism.hpp \ xkms/XKMSStatus.hpp \ xkms/XKMSRevokeRequest.hpp \ xkms/XKMSRevokeResult.hpp \ xkms/XKMSRecoverKeyBinding.hpp \ xkms/XKMSRevokeKeyBinding.hpp \ xkms/XKMSRSAKeyPair.hpp \ xkms/XKMSRecoverResult.hpp \ xkms/XKMSReissueResult.hpp \ xkms/XKMSRecoverRequest.hpp \ xkms/XKMSReissueRequest.hpp \ xkms/XKMSReissueKeyBinding.hpp libxml_security_c_la_SOURCES = ${lib_sources} # canon # Signature # Main encryption sources # Framework sources # transformers # Utility sources # XML Encryption # XML Key Management lib_sources = ${canon_sources} ${dsig_sources} ${enc_sources} \ ${framework_sources} ${txfm_sources} ${utils_sources} \ ${xenc_sources} ${xkms_sources} $(am__append_1) \ $(am__append_2) # Sources are build up using a find command: # # find xsec/transformers/ -name '*.cpp' -exec echo {} \\ ";" | sed "s/xsec\// ..\/xsec\//g" # canon canon_sources = \ canon/XSECC14n20010315.cpp \ canon/XSECXMLNSStack.cpp \ canon/XSECCanon.cpp # Signature dsig_sources = \ dsig/DSIGKeyInfoPGPData.cpp \ dsig/DSIGReferenceList.cpp \ dsig/DSIGKeyInfoValue.cpp \ dsig/DSIGKeyInfoDEREncoded.cpp \ dsig/DSIGXPathHere.cpp \ dsig/DSIGAlgorithmHandlerDefault.cpp \ dsig/DSIGXPathFilterExpr.cpp \ dsig/DSIGKeyInfoMgmtData.cpp \ dsig/DSIGTransformXPathFilter.cpp \ dsig/DSIGSignedInfo.cpp \ dsig/DSIGKeyInfoList.cpp \ dsig/DSIGConstants.cpp \ dsig/DSIGSignature.cpp \ dsig/DSIGTransformXSL.cpp \ dsig/DSIGObject.cpp \ dsig/DSIGTransformXPath.cpp \ dsig/DSIGTransformEnvelope.cpp \ dsig/DSIGKeyInfoName.cpp \ dsig/DSIGTransformBase64.cpp \ dsig/DSIGReference.cpp \ dsig/DSIGKeyInfoSPKIData.cpp \ dsig/DSIGTransformList.cpp \ dsig/DSIGKeyInfoX509.cpp \ dsig/DSIGKeyInfoExt.cpp \ dsig/DSIGTransform.cpp \ dsig/DSIGTransformC14n.cpp # Main Crypto interface routines enc_sources = \ enc/XSECCryptoX509.cpp \ enc/XSECKeyInfoResolverDefault.cpp \ enc/XSECCryptoUtils.cpp \ enc/XSECCryptoBase64.cpp \ enc/XSCrypt/XSCryptCryptoBase64.cpp \ enc/XSECCryptoProvider.cpp \ enc/XSECCryptoException.cpp # Framework files framework_sources = \ framework/XSECError.cpp \ framework/XSECAlgorithmMapper.cpp \ framework/XSECEnv.cpp \ framework/XSECProvider.cpp \ framework/XSECException.cpp \ framework/XSECURIResolverXerces.cpp txfm_sources = \ transformers/TXFMBase.cpp \ transformers/TXFMChain.cpp \ transformers/TXFMCipher.cpp \ transformers/TXFMParser.cpp \ transformers/TXFMSB.cpp \ transformers/TXFMEnvelope.cpp \ transformers/TXFMBase64.cpp \ transformers/TXFMXPathFilter.cpp \ transformers/TXFMSHA1.cpp \ transformers/TXFMC14n.cpp \ transformers/TXFMURL.cpp \ transformers/TXFMOutputFile.cpp \ transformers/TXFMXPath.cpp \ transformers/TXFMXSL.cpp \ transformers/TXFMDocObject.cpp \ transformers/TXFMConcatChains.cpp \ transformers/TXFMMD5.cpp # Utility files. Note we don't worry about checking # if the UNIX stuff is necessary - we just assume that # we are running on a *NIX system because compiling under # make. Cygwin compiles use the UNIX utilities, not windows utils_sources = \ utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp \ utils/unixutils/XSECURIResolverGenericUnix.cpp \ utils/unixutils/XSECBinHTTPURIInputStream.cpp \ utils/XSECBinTXFMInputStream.cpp \ utils/XSECXPathNodeList.cpp \ utils/XSECSafeBuffer.cpp \ utils/XSECTXFMInputSource.cpp \ utils/XSECDOMUtils.cpp \ utils/XSECSafeBufferFormatter.cpp \ utils/XSECSOAPRequestorSimple.cpp \ utils/XSECNameSpaceExpander.cpp \ utils/XSECPlatformUtils.cpp # XML Encryption xenc_sources = \ xenc/impl/XENCCipherReferenceImpl.cpp \ xenc/impl/XENCEncryptionMethodImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.hpp \ xenc/impl/XENCCipherValueImpl.cpp \ xenc/impl/XENCCipherImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.hpp \ xenc/impl/XENCCipherDataImpl.hpp \ xenc/impl/XENCEncryptionMethodImpl.hpp \ xenc/impl/XENCAlgorithmHandlerDefault.cpp \ xenc/impl/XENCEncryptedDataImpl.cpp \ xenc/impl/XENCEncryptedTypeImpl.hpp \ xenc/impl/XENCCipherDataImpl.cpp \ xenc/impl/XENCEncryptedDataImpl.hpp \ xenc/impl/XENCCipherValueImpl.hpp \ xenc/impl/XENCEncryptedTypeImpl.cpp \ xenc/impl/XENCCipherImpl.cpp \ xenc/impl/XENCEncryptedKeyImpl.cpp \ xenc/impl/XENCCipherReferenceImpl.hpp # XML Key Management xkms_sources = \ xkms/XKMSConstants.cpp \ xkms/impl/XKMSCompoundRequestImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.cpp \ xkms/impl/XKMSRegisterResultImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.cpp \ xkms/impl/XKMSValidateResultImpl.hpp \ xkms/impl/XKMSRevokeResultImpl.hpp \ xkms/impl/XKMSCompoundResultImpl.cpp \ xkms/impl/XKMSRevokeKeyBindingImpl.cpp \ xkms/impl/XKMSCompoundResultImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp \ xkms/impl/XKMSQueryKeyBindingImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.cpp \ xkms/impl/XKMSValidateResultImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.hpp \ xkms/impl/XKMSAuthenticationImpl.cpp \ xkms/impl/XKMSNotBoundAuthenticationImpl.hpp \ xkms/impl/XKMSCompoundRequestImpl.hpp \ xkms/impl/XKMSPendingRequestImpl.hpp \ xkms/impl/XKMSStatusResultImpl.cpp \ xkms/impl/XKMSStatusImpl.hpp \ xkms/impl/XKMSRegisterRequestImpl.hpp \ xkms/impl/XKMSReissueRequestImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.hpp \ xkms/impl/XKMSRequestAbstractTypeImpl.cpp \ xkms/impl/XKMSRespondWithImpl.cpp \ xkms/impl/XKMSResponseMechanismImpl.hpp \ xkms/impl/XKMSResultImpl.hpp \ xkms/impl/XKMSReissueResultImpl.cpp \ xkms/impl/XKMSAuthenticationImpl.hpp \ xkms/impl/XKMSMessageAbstractTypeImpl.cpp \ xkms/impl/XKMSRevokeResultImpl.cpp \ xkms/impl/XKMSStatusResultImpl.hpp \ xkms/impl/XKMSReissueKeyBindingImpl.hpp \ xkms/impl/XKMSRespondWithImpl.hpp \ xkms/impl/XKMSRevokeRequestImpl.cpp \ xkms/impl/XKMSPendingRequestImpl.cpp \ xkms/impl/XKMSRecoverResultImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.cpp \ xkms/impl/XKMSStatusRequestImpl.hpp \ xkms/impl/XKMSRecoverRequestImpl.hpp \ xkms/impl/XKMSRecoverKeyBindingImpl.cpp \ xkms/impl/XKMSRSAKeyPairImpl.cpp \ xkms/impl/XKMSMessageAbstractTypeImpl.hpp \ xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.hpp \ xkms/impl/XKMSLocateResultImpl.hpp \ xkms/impl/XKMSLocateRequestImpl.cpp \ xkms/impl/XKMSResultTypeImpl.cpp \ xkms/impl/XKMSRecoverKeyBindingImpl.hpp \ xkms/impl/XKMSResultImpl.cpp \ xkms/impl/XKMSValidityIntervalImpl.cpp \ xkms/impl/XKMSRegisterRequestImpl.cpp \ xkms/impl/XKMSReissueResultImpl.hpp \ xkms/impl/XKMSStatusImpl.cpp \ xkms/impl/XKMSReissueRequestImpl.hpp \ xkms/impl/XKMSStatusRequestImpl.cpp \ xkms/impl/XKMSReissueKeyBindingImpl.cpp \ xkms/impl/XKMSKeyBindingImpl.hpp \ xkms/impl/XKMSValidateRequestImpl.hpp \ xkms/impl/XKMSKeyBindingAbstractTypeImpl.hpp \ xkms/impl/XKMSResultTypeImpl.hpp \ xkms/impl/XKMSMessageFactoryImpl.cpp \ xkms/impl/XKMSRevokeRequestImpl.hpp \ xkms/impl/XKMSResponseMechanismImpl.cpp \ xkms/impl/XKMSNotBoundAuthentication.cpp \ xkms/impl/XKMSLocateRequestImpl.hpp \ xkms/impl/XKMSLocateResultImpl.cpp \ xkms/impl/XKMSRequestAbstractTypeImpl.hpp \ xkms/impl/XKMSQueryKeyBindingImpl.cpp \ xkms/impl/XKMSUseKeyWithImpl.cpp \ xkms/impl/XKMSMessageFactoryImpl.hpp \ xkms/impl/XKMSPrototypeKeyBindingImpl.hpp \ xkms/impl/XKMSRegisterResultImpl.hpp # Conditional crypto routines openssl_sources = \ enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp \ enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp \ enc/OpenSSL/OpenSSLCryptoHash.cpp \ enc/OpenSSL/OpenSSLCryptoProvider.cpp \ enc/OpenSSL/OpenSSLCryptoX509.cpp \ enc/OpenSSL/OpenSSLCryptoBase64.cpp \ enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp \ enc/OpenSSL/OpenSSLCryptoKeyEC.cpp \ enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp \ enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp nss_sources = \ enc/NSS/NSSCryptoX509.cpp \ enc/NSS/NSSCryptoHashHMAC.cpp \ enc/NSS/NSSCryptoHash.cpp \ enc/NSS/NSSCryptoKeyDSA.cpp \ enc/NSS/NSSCryptoProvider.cpp \ enc/NSS/NSSCryptoSymmetricKey.cpp \ enc/NSS/NSSCryptoKeyRSA.cpp \ enc/NSS/NSSCryptoKeyHMAC.cpp # # Now the library specific build items # libxml_security_c_la_LDFLAGS = -version-info 17:3:0 EXTRA_DIST = \ utils/winutils/XSECURIResolverGenericWin32.cpp \ utils/winutils/XSECSOAPRequestorSimpleWin32.cpp \ utils/winutils/XSECBinHTTPURIInputStream.cpp \ utils/winutils/XSECURIResolverGenericWin32.hpp \ utils/winutils/XSECBinHTTPURIInputStream.hpp \ enc/WinCAPI/WinCAPICryptoProvider.cpp \ enc/WinCAPI/WinCAPICryptoKeyHMAC.hpp \ enc/WinCAPI/WinCAPICryptoHash.cpp \ enc/WinCAPI/WinCAPICryptoKeyDSA.cpp \ enc/WinCAPI/WinCAPICryptoHashHMAC.hpp \ enc/WinCAPI/WinCAPICryptoKeyDSA.hpp \ enc/WinCAPI/WinCAPICryptoSymmetricKey.hpp \ enc/WinCAPI/WinCAPICryptoX509.hpp \ enc/WinCAPI/WinCAPICryptoKeyRSA.hpp \ enc/WinCAPI/WinCAPICryptoX509.cpp \ enc/WinCAPI/WinCAPICryptoHashHMAC.cpp \ enc/WinCAPI/WinCAPICryptoHash.hpp \ enc/WinCAPI/WinCAPICryptoKeyRSA.cpp \ enc/WinCAPI/WinCAPICryptoProvider.hpp \ enc/WinCAPI/WinCAPICryptoSymmetricKey.cpp \ enc/WinCAPI/WinCAPICryptoKeyHMAC.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(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 xsec/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xsec/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libxml-security-c.la: $(libxml_security_c_la_OBJECTS) $(libxml_security_c_la_DEPENDENCIES) $(EXTRA_libxml_security_c_la_DEPENDENCIES) $(AM_V_CXXLD)$(libxml_security_c_la_LINK) -rpath $(libdir) $(libxml_security_c_la_OBJECTS) $(libxml_security_c_la_LIBADD) $(LIBS) 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 clean-noinstPROGRAMS: @list='$(noinst_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 c14n$(EXEEXT): $(c14n_OBJECTS) $(c14n_DEPENDENCIES) $(EXTRA_c14n_DEPENDENCIES) @rm -f c14n$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(c14n_OBJECTS) $(c14n_LDADD) $(LIBS) checksig$(EXEEXT): $(checksig_OBJECTS) $(checksig_DEPENDENCIES) $(EXTRA_checksig_DEPENDENCIES) @rm -f checksig$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(checksig_OBJECTS) $(checksig_LDADD) $(LIBS) cipher$(EXEEXT): $(cipher_OBJECTS) $(cipher_DEPENDENCIES) $(EXTRA_cipher_DEPENDENCIES) @rm -f cipher$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(cipher_OBJECTS) $(cipher_LDADD) $(LIBS) siginf$(EXEEXT): $(siginf_OBJECTS) $(siginf_DEPENDENCIES) $(EXTRA_siginf_DEPENDENCIES) @rm -f siginf$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(siginf_OBJECTS) $(siginf_LDADD) $(LIBS) simpleDecrypt$(EXEEXT): $(simpleDecrypt_OBJECTS) $(simpleDecrypt_DEPENDENCIES) $(EXTRA_simpleDecrypt_DEPENDENCIES) @rm -f simpleDecrypt$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(simpleDecrypt_OBJECTS) $(simpleDecrypt_LDADD) $(LIBS) simpleEncrypt$(EXEEXT): $(simpleEncrypt_OBJECTS) $(simpleEncrypt_DEPENDENCIES) $(EXTRA_simpleEncrypt_DEPENDENCIES) @rm -f simpleEncrypt$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(simpleEncrypt_OBJECTS) $(simpleEncrypt_LDADD) $(LIBS) simpleHMAC$(EXEEXT): $(simpleHMAC_OBJECTS) $(simpleHMAC_DEPENDENCIES) $(EXTRA_simpleHMAC_DEPENDENCIES) @rm -f simpleHMAC$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(simpleHMAC_OBJECTS) $(simpleHMAC_LDADD) $(LIBS) simpleValidate$(EXEEXT): $(simpleValidate_OBJECTS) $(simpleValidate_DEPENDENCIES) $(EXTRA_simpleValidate_DEPENDENCIES) @rm -f simpleValidate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(simpleValidate_OBJECTS) $(simpleValidate_LDADD) $(LIBS) templatesign$(EXEEXT): $(templatesign_OBJECTS) $(templatesign_DEPENDENCIES) $(EXTRA_templatesign_DEPENDENCIES) @rm -f templatesign$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(templatesign_OBJECTS) $(templatesign_LDADD) $(LIBS) txfmout$(EXEEXT): $(txfmout_OBJECTS) $(txfmout_DEPENDENCIES) $(EXTRA_txfmout_DEPENDENCIES) @rm -f txfmout$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(txfmout_OBJECTS) $(txfmout_LDADD) $(LIBS) xklient$(EXEEXT): $(xklient_OBJECTS) $(xklient_DEPENDENCIES) $(EXTRA_xklient_DEPENDENCIES) @rm -f xklient$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xklient_OBJECTS) $(xklient_LDADD) $(LIBS) xtest$(EXEEXT): $(xtest_OBJECTS) $(xtest_DEPENDENCIES) $(EXTRA_xtest_DEPENDENCIES) @rm -f xtest$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xtest_OBJECTS) $(xtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AnonymousResolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGAlgorithmHandlerDefault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGConstants.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoDEREncoded.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoExt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoMgmtData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoPGPData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoSPKIData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoValue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGKeyInfoX509.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGReference.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGReferenceList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGSignature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGSignedInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransform.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformBase64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformC14n.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformEnvelope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformXPath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformXPathFilter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGTransformXSL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGXPathFilterExpr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DSIGXPathHere.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IOStreamOutputter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InteropResolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoHash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoHashHMAC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoKeyDSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoKeyHMAC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoKeyRSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoProvider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoSymmetricKey.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NSSCryptoX509.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoBase64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoHash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoHashHMAC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoKeyDSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoKeyEC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoKeyHMAC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoKeyRSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoProvider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoSymmetricKey.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenSSLCryptoX509.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMBase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMBase64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMC14n.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMChain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMCipher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMConcatChains.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMDocObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMEnvelope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMMD5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMOutputFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMParser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMSB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMSHA1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMURL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMXPath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMXPathFilter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TXFMXSL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCAlgorithmHandlerDefault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCCipherDataImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCCipherImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCCipherReferenceImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCCipherValueImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCEncryptedDataImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCEncryptedKeyImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCEncryptedTypeImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XENCEncryptionMethodImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSAuthenticationImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSCompoundRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSCompoundResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSConstants.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSKeyBindingAbstractTypeImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSLocateRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSLocateResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSMessageAbstractTypeImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSMessageFactoryImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSNotBoundAuthentication.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSPendingRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSPrototypeKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSQueryKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRSAKeyPairImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRecoverKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRecoverRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRecoverResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRegisterRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRegisterResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSReissueKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSReissueRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSReissueResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRequestAbstractTypeImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRespondWithImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSResponseMechanismImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSResultTypeImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRevokeKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRevokeRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSRevokeResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSStatusImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSStatusRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSStatusResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSUnverifiedKeyBindingImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSUseKeyWithImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSValidateRequestImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSValidateResultImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKMSValidityIntervalImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSCryptCryptoBase64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECAlgorithmMapper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECBinHTTPURIInputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECBinTXFMInputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECC14n20010315.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCanon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCryptoBase64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCryptoException.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCryptoProvider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCryptoUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECCryptoX509.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECDOMUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECException.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECKeyInfoResolverDefault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECNameSpaceExpander.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECPlatformUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECProvider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECSOAPRequestorSimple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECSOAPRequestorSimpleUnix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECSafeBuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECSafeBufferFormatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECTXFMInputSource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECURIResolverGenericUnix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECURIResolverXerces.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECXMLNSStack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSECXPathNodeList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XencInteropResolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c14n.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipher.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleDecrypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleEncrypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleHMAC.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleValidate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/templatesign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/txfmout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xklient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< XSECC14n20010315.lo: canon/XSECC14n20010315.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECC14n20010315.lo -MD -MP -MF $(DEPDIR)/XSECC14n20010315.Tpo -c -o XSECC14n20010315.lo `test -f 'canon/XSECC14n20010315.cpp' || echo '$(srcdir)/'`canon/XSECC14n20010315.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECC14n20010315.Tpo $(DEPDIR)/XSECC14n20010315.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='canon/XSECC14n20010315.cpp' object='XSECC14n20010315.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECC14n20010315.lo `test -f 'canon/XSECC14n20010315.cpp' || echo '$(srcdir)/'`canon/XSECC14n20010315.cpp XSECXMLNSStack.lo: canon/XSECXMLNSStack.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECXMLNSStack.lo -MD -MP -MF $(DEPDIR)/XSECXMLNSStack.Tpo -c -o XSECXMLNSStack.lo `test -f 'canon/XSECXMLNSStack.cpp' || echo '$(srcdir)/'`canon/XSECXMLNSStack.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECXMLNSStack.Tpo $(DEPDIR)/XSECXMLNSStack.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='canon/XSECXMLNSStack.cpp' object='XSECXMLNSStack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECXMLNSStack.lo `test -f 'canon/XSECXMLNSStack.cpp' || echo '$(srcdir)/'`canon/XSECXMLNSStack.cpp XSECCanon.lo: canon/XSECCanon.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCanon.lo -MD -MP -MF $(DEPDIR)/XSECCanon.Tpo -c -o XSECCanon.lo `test -f 'canon/XSECCanon.cpp' || echo '$(srcdir)/'`canon/XSECCanon.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCanon.Tpo $(DEPDIR)/XSECCanon.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='canon/XSECCanon.cpp' object='XSECCanon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCanon.lo `test -f 'canon/XSECCanon.cpp' || echo '$(srcdir)/'`canon/XSECCanon.cpp DSIGKeyInfoPGPData.lo: dsig/DSIGKeyInfoPGPData.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoPGPData.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoPGPData.Tpo -c -o DSIGKeyInfoPGPData.lo `test -f 'dsig/DSIGKeyInfoPGPData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoPGPData.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoPGPData.Tpo $(DEPDIR)/DSIGKeyInfoPGPData.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoPGPData.cpp' object='DSIGKeyInfoPGPData.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoPGPData.lo `test -f 'dsig/DSIGKeyInfoPGPData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoPGPData.cpp DSIGReferenceList.lo: dsig/DSIGReferenceList.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGReferenceList.lo -MD -MP -MF $(DEPDIR)/DSIGReferenceList.Tpo -c -o DSIGReferenceList.lo `test -f 'dsig/DSIGReferenceList.cpp' || echo '$(srcdir)/'`dsig/DSIGReferenceList.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGReferenceList.Tpo $(DEPDIR)/DSIGReferenceList.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGReferenceList.cpp' object='DSIGReferenceList.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGReferenceList.lo `test -f 'dsig/DSIGReferenceList.cpp' || echo '$(srcdir)/'`dsig/DSIGReferenceList.cpp DSIGKeyInfoValue.lo: dsig/DSIGKeyInfoValue.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoValue.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoValue.Tpo -c -o DSIGKeyInfoValue.lo `test -f 'dsig/DSIGKeyInfoValue.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoValue.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoValue.Tpo $(DEPDIR)/DSIGKeyInfoValue.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoValue.cpp' object='DSIGKeyInfoValue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoValue.lo `test -f 'dsig/DSIGKeyInfoValue.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoValue.cpp DSIGKeyInfoDEREncoded.lo: dsig/DSIGKeyInfoDEREncoded.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoDEREncoded.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoDEREncoded.Tpo -c -o DSIGKeyInfoDEREncoded.lo `test -f 'dsig/DSIGKeyInfoDEREncoded.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoDEREncoded.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoDEREncoded.Tpo $(DEPDIR)/DSIGKeyInfoDEREncoded.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoDEREncoded.cpp' object='DSIGKeyInfoDEREncoded.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoDEREncoded.lo `test -f 'dsig/DSIGKeyInfoDEREncoded.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoDEREncoded.cpp DSIGXPathHere.lo: dsig/DSIGXPathHere.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGXPathHere.lo -MD -MP -MF $(DEPDIR)/DSIGXPathHere.Tpo -c -o DSIGXPathHere.lo `test -f 'dsig/DSIGXPathHere.cpp' || echo '$(srcdir)/'`dsig/DSIGXPathHere.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGXPathHere.Tpo $(DEPDIR)/DSIGXPathHere.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGXPathHere.cpp' object='DSIGXPathHere.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGXPathHere.lo `test -f 'dsig/DSIGXPathHere.cpp' || echo '$(srcdir)/'`dsig/DSIGXPathHere.cpp DSIGAlgorithmHandlerDefault.lo: dsig/DSIGAlgorithmHandlerDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGAlgorithmHandlerDefault.lo -MD -MP -MF $(DEPDIR)/DSIGAlgorithmHandlerDefault.Tpo -c -o DSIGAlgorithmHandlerDefault.lo `test -f 'dsig/DSIGAlgorithmHandlerDefault.cpp' || echo '$(srcdir)/'`dsig/DSIGAlgorithmHandlerDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGAlgorithmHandlerDefault.Tpo $(DEPDIR)/DSIGAlgorithmHandlerDefault.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGAlgorithmHandlerDefault.cpp' object='DSIGAlgorithmHandlerDefault.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGAlgorithmHandlerDefault.lo `test -f 'dsig/DSIGAlgorithmHandlerDefault.cpp' || echo '$(srcdir)/'`dsig/DSIGAlgorithmHandlerDefault.cpp DSIGXPathFilterExpr.lo: dsig/DSIGXPathFilterExpr.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGXPathFilterExpr.lo -MD -MP -MF $(DEPDIR)/DSIGXPathFilterExpr.Tpo -c -o DSIGXPathFilterExpr.lo `test -f 'dsig/DSIGXPathFilterExpr.cpp' || echo '$(srcdir)/'`dsig/DSIGXPathFilterExpr.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGXPathFilterExpr.Tpo $(DEPDIR)/DSIGXPathFilterExpr.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGXPathFilterExpr.cpp' object='DSIGXPathFilterExpr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGXPathFilterExpr.lo `test -f 'dsig/DSIGXPathFilterExpr.cpp' || echo '$(srcdir)/'`dsig/DSIGXPathFilterExpr.cpp DSIGKeyInfoMgmtData.lo: dsig/DSIGKeyInfoMgmtData.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoMgmtData.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoMgmtData.Tpo -c -o DSIGKeyInfoMgmtData.lo `test -f 'dsig/DSIGKeyInfoMgmtData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoMgmtData.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoMgmtData.Tpo $(DEPDIR)/DSIGKeyInfoMgmtData.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoMgmtData.cpp' object='DSIGKeyInfoMgmtData.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoMgmtData.lo `test -f 'dsig/DSIGKeyInfoMgmtData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoMgmtData.cpp DSIGTransformXPathFilter.lo: dsig/DSIGTransformXPathFilter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformXPathFilter.lo -MD -MP -MF $(DEPDIR)/DSIGTransformXPathFilter.Tpo -c -o DSIGTransformXPathFilter.lo `test -f 'dsig/DSIGTransformXPathFilter.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXPathFilter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformXPathFilter.Tpo $(DEPDIR)/DSIGTransformXPathFilter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformXPathFilter.cpp' object='DSIGTransformXPathFilter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformXPathFilter.lo `test -f 'dsig/DSIGTransformXPathFilter.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXPathFilter.cpp DSIGSignedInfo.lo: dsig/DSIGSignedInfo.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGSignedInfo.lo -MD -MP -MF $(DEPDIR)/DSIGSignedInfo.Tpo -c -o DSIGSignedInfo.lo `test -f 'dsig/DSIGSignedInfo.cpp' || echo '$(srcdir)/'`dsig/DSIGSignedInfo.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGSignedInfo.Tpo $(DEPDIR)/DSIGSignedInfo.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGSignedInfo.cpp' object='DSIGSignedInfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGSignedInfo.lo `test -f 'dsig/DSIGSignedInfo.cpp' || echo '$(srcdir)/'`dsig/DSIGSignedInfo.cpp DSIGKeyInfoList.lo: dsig/DSIGKeyInfoList.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoList.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoList.Tpo -c -o DSIGKeyInfoList.lo `test -f 'dsig/DSIGKeyInfoList.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoList.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoList.Tpo $(DEPDIR)/DSIGKeyInfoList.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoList.cpp' object='DSIGKeyInfoList.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoList.lo `test -f 'dsig/DSIGKeyInfoList.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoList.cpp DSIGConstants.lo: dsig/DSIGConstants.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGConstants.lo -MD -MP -MF $(DEPDIR)/DSIGConstants.Tpo -c -o DSIGConstants.lo `test -f 'dsig/DSIGConstants.cpp' || echo '$(srcdir)/'`dsig/DSIGConstants.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGConstants.Tpo $(DEPDIR)/DSIGConstants.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGConstants.cpp' object='DSIGConstants.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGConstants.lo `test -f 'dsig/DSIGConstants.cpp' || echo '$(srcdir)/'`dsig/DSIGConstants.cpp DSIGSignature.lo: dsig/DSIGSignature.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGSignature.lo -MD -MP -MF $(DEPDIR)/DSIGSignature.Tpo -c -o DSIGSignature.lo `test -f 'dsig/DSIGSignature.cpp' || echo '$(srcdir)/'`dsig/DSIGSignature.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGSignature.Tpo $(DEPDIR)/DSIGSignature.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGSignature.cpp' object='DSIGSignature.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGSignature.lo `test -f 'dsig/DSIGSignature.cpp' || echo '$(srcdir)/'`dsig/DSIGSignature.cpp DSIGTransformXSL.lo: dsig/DSIGTransformXSL.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformXSL.lo -MD -MP -MF $(DEPDIR)/DSIGTransformXSL.Tpo -c -o DSIGTransformXSL.lo `test -f 'dsig/DSIGTransformXSL.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXSL.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformXSL.Tpo $(DEPDIR)/DSIGTransformXSL.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformXSL.cpp' object='DSIGTransformXSL.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformXSL.lo `test -f 'dsig/DSIGTransformXSL.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXSL.cpp DSIGObject.lo: dsig/DSIGObject.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGObject.lo -MD -MP -MF $(DEPDIR)/DSIGObject.Tpo -c -o DSIGObject.lo `test -f 'dsig/DSIGObject.cpp' || echo '$(srcdir)/'`dsig/DSIGObject.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGObject.Tpo $(DEPDIR)/DSIGObject.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGObject.cpp' object='DSIGObject.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGObject.lo `test -f 'dsig/DSIGObject.cpp' || echo '$(srcdir)/'`dsig/DSIGObject.cpp DSIGTransformXPath.lo: dsig/DSIGTransformXPath.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformXPath.lo -MD -MP -MF $(DEPDIR)/DSIGTransformXPath.Tpo -c -o DSIGTransformXPath.lo `test -f 'dsig/DSIGTransformXPath.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXPath.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformXPath.Tpo $(DEPDIR)/DSIGTransformXPath.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformXPath.cpp' object='DSIGTransformXPath.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformXPath.lo `test -f 'dsig/DSIGTransformXPath.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformXPath.cpp DSIGTransformEnvelope.lo: dsig/DSIGTransformEnvelope.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformEnvelope.lo -MD -MP -MF $(DEPDIR)/DSIGTransformEnvelope.Tpo -c -o DSIGTransformEnvelope.lo `test -f 'dsig/DSIGTransformEnvelope.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformEnvelope.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformEnvelope.Tpo $(DEPDIR)/DSIGTransformEnvelope.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformEnvelope.cpp' object='DSIGTransformEnvelope.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformEnvelope.lo `test -f 'dsig/DSIGTransformEnvelope.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformEnvelope.cpp DSIGKeyInfoName.lo: dsig/DSIGKeyInfoName.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoName.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoName.Tpo -c -o DSIGKeyInfoName.lo `test -f 'dsig/DSIGKeyInfoName.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoName.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoName.Tpo $(DEPDIR)/DSIGKeyInfoName.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoName.cpp' object='DSIGKeyInfoName.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoName.lo `test -f 'dsig/DSIGKeyInfoName.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoName.cpp DSIGTransformBase64.lo: dsig/DSIGTransformBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformBase64.lo -MD -MP -MF $(DEPDIR)/DSIGTransformBase64.Tpo -c -o DSIGTransformBase64.lo `test -f 'dsig/DSIGTransformBase64.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformBase64.Tpo $(DEPDIR)/DSIGTransformBase64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformBase64.cpp' object='DSIGTransformBase64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformBase64.lo `test -f 'dsig/DSIGTransformBase64.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformBase64.cpp DSIGReference.lo: dsig/DSIGReference.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGReference.lo -MD -MP -MF $(DEPDIR)/DSIGReference.Tpo -c -o DSIGReference.lo `test -f 'dsig/DSIGReference.cpp' || echo '$(srcdir)/'`dsig/DSIGReference.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGReference.Tpo $(DEPDIR)/DSIGReference.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGReference.cpp' object='DSIGReference.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGReference.lo `test -f 'dsig/DSIGReference.cpp' || echo '$(srcdir)/'`dsig/DSIGReference.cpp DSIGKeyInfoSPKIData.lo: dsig/DSIGKeyInfoSPKIData.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoSPKIData.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoSPKIData.Tpo -c -o DSIGKeyInfoSPKIData.lo `test -f 'dsig/DSIGKeyInfoSPKIData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoSPKIData.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoSPKIData.Tpo $(DEPDIR)/DSIGKeyInfoSPKIData.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoSPKIData.cpp' object='DSIGKeyInfoSPKIData.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoSPKIData.lo `test -f 'dsig/DSIGKeyInfoSPKIData.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoSPKIData.cpp DSIGTransformList.lo: dsig/DSIGTransformList.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformList.lo -MD -MP -MF $(DEPDIR)/DSIGTransformList.Tpo -c -o DSIGTransformList.lo `test -f 'dsig/DSIGTransformList.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformList.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformList.Tpo $(DEPDIR)/DSIGTransformList.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformList.cpp' object='DSIGTransformList.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformList.lo `test -f 'dsig/DSIGTransformList.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformList.cpp DSIGKeyInfoX509.lo: dsig/DSIGKeyInfoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoX509.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoX509.Tpo -c -o DSIGKeyInfoX509.lo `test -f 'dsig/DSIGKeyInfoX509.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoX509.Tpo $(DEPDIR)/DSIGKeyInfoX509.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoX509.cpp' object='DSIGKeyInfoX509.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoX509.lo `test -f 'dsig/DSIGKeyInfoX509.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoX509.cpp DSIGKeyInfoExt.lo: dsig/DSIGKeyInfoExt.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGKeyInfoExt.lo -MD -MP -MF $(DEPDIR)/DSIGKeyInfoExt.Tpo -c -o DSIGKeyInfoExt.lo `test -f 'dsig/DSIGKeyInfoExt.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoExt.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGKeyInfoExt.Tpo $(DEPDIR)/DSIGKeyInfoExt.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGKeyInfoExt.cpp' object='DSIGKeyInfoExt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGKeyInfoExt.lo `test -f 'dsig/DSIGKeyInfoExt.cpp' || echo '$(srcdir)/'`dsig/DSIGKeyInfoExt.cpp DSIGTransform.lo: dsig/DSIGTransform.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransform.lo -MD -MP -MF $(DEPDIR)/DSIGTransform.Tpo -c -o DSIGTransform.lo `test -f 'dsig/DSIGTransform.cpp' || echo '$(srcdir)/'`dsig/DSIGTransform.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransform.Tpo $(DEPDIR)/DSIGTransform.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransform.cpp' object='DSIGTransform.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransform.lo `test -f 'dsig/DSIGTransform.cpp' || echo '$(srcdir)/'`dsig/DSIGTransform.cpp DSIGTransformC14n.lo: dsig/DSIGTransformC14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DSIGTransformC14n.lo -MD -MP -MF $(DEPDIR)/DSIGTransformC14n.Tpo -c -o DSIGTransformC14n.lo `test -f 'dsig/DSIGTransformC14n.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformC14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DSIGTransformC14n.Tpo $(DEPDIR)/DSIGTransformC14n.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dsig/DSIGTransformC14n.cpp' object='DSIGTransformC14n.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DSIGTransformC14n.lo `test -f 'dsig/DSIGTransformC14n.cpp' || echo '$(srcdir)/'`dsig/DSIGTransformC14n.cpp XSECCryptoX509.lo: enc/XSECCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCryptoX509.lo -MD -MP -MF $(DEPDIR)/XSECCryptoX509.Tpo -c -o XSECCryptoX509.lo `test -f 'enc/XSECCryptoX509.cpp' || echo '$(srcdir)/'`enc/XSECCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCryptoX509.Tpo $(DEPDIR)/XSECCryptoX509.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECCryptoX509.cpp' object='XSECCryptoX509.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCryptoX509.lo `test -f 'enc/XSECCryptoX509.cpp' || echo '$(srcdir)/'`enc/XSECCryptoX509.cpp XSECKeyInfoResolverDefault.lo: enc/XSECKeyInfoResolverDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECKeyInfoResolverDefault.lo -MD -MP -MF $(DEPDIR)/XSECKeyInfoResolverDefault.Tpo -c -o XSECKeyInfoResolverDefault.lo `test -f 'enc/XSECKeyInfoResolverDefault.cpp' || echo '$(srcdir)/'`enc/XSECKeyInfoResolverDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECKeyInfoResolverDefault.Tpo $(DEPDIR)/XSECKeyInfoResolverDefault.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECKeyInfoResolverDefault.cpp' object='XSECKeyInfoResolverDefault.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECKeyInfoResolverDefault.lo `test -f 'enc/XSECKeyInfoResolverDefault.cpp' || echo '$(srcdir)/'`enc/XSECKeyInfoResolverDefault.cpp XSECCryptoUtils.lo: enc/XSECCryptoUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCryptoUtils.lo -MD -MP -MF $(DEPDIR)/XSECCryptoUtils.Tpo -c -o XSECCryptoUtils.lo `test -f 'enc/XSECCryptoUtils.cpp' || echo '$(srcdir)/'`enc/XSECCryptoUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCryptoUtils.Tpo $(DEPDIR)/XSECCryptoUtils.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECCryptoUtils.cpp' object='XSECCryptoUtils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCryptoUtils.lo `test -f 'enc/XSECCryptoUtils.cpp' || echo '$(srcdir)/'`enc/XSECCryptoUtils.cpp XSECCryptoBase64.lo: enc/XSECCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCryptoBase64.lo -MD -MP -MF $(DEPDIR)/XSECCryptoBase64.Tpo -c -o XSECCryptoBase64.lo `test -f 'enc/XSECCryptoBase64.cpp' || echo '$(srcdir)/'`enc/XSECCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCryptoBase64.Tpo $(DEPDIR)/XSECCryptoBase64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECCryptoBase64.cpp' object='XSECCryptoBase64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCryptoBase64.lo `test -f 'enc/XSECCryptoBase64.cpp' || echo '$(srcdir)/'`enc/XSECCryptoBase64.cpp XSCryptCryptoBase64.lo: enc/XSCrypt/XSCryptCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSCryptCryptoBase64.lo -MD -MP -MF $(DEPDIR)/XSCryptCryptoBase64.Tpo -c -o XSCryptCryptoBase64.lo `test -f 'enc/XSCrypt/XSCryptCryptoBase64.cpp' || echo '$(srcdir)/'`enc/XSCrypt/XSCryptCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSCryptCryptoBase64.Tpo $(DEPDIR)/XSCryptCryptoBase64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSCrypt/XSCryptCryptoBase64.cpp' object='XSCryptCryptoBase64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSCryptCryptoBase64.lo `test -f 'enc/XSCrypt/XSCryptCryptoBase64.cpp' || echo '$(srcdir)/'`enc/XSCrypt/XSCryptCryptoBase64.cpp XSECCryptoProvider.lo: enc/XSECCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCryptoProvider.lo -MD -MP -MF $(DEPDIR)/XSECCryptoProvider.Tpo -c -o XSECCryptoProvider.lo `test -f 'enc/XSECCryptoProvider.cpp' || echo '$(srcdir)/'`enc/XSECCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCryptoProvider.Tpo $(DEPDIR)/XSECCryptoProvider.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECCryptoProvider.cpp' object='XSECCryptoProvider.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCryptoProvider.lo `test -f 'enc/XSECCryptoProvider.cpp' || echo '$(srcdir)/'`enc/XSECCryptoProvider.cpp XSECCryptoException.lo: enc/XSECCryptoException.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECCryptoException.lo -MD -MP -MF $(DEPDIR)/XSECCryptoException.Tpo -c -o XSECCryptoException.lo `test -f 'enc/XSECCryptoException.cpp' || echo '$(srcdir)/'`enc/XSECCryptoException.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECCryptoException.Tpo $(DEPDIR)/XSECCryptoException.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/XSECCryptoException.cpp' object='XSECCryptoException.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECCryptoException.lo `test -f 'enc/XSECCryptoException.cpp' || echo '$(srcdir)/'`enc/XSECCryptoException.cpp XSECError.lo: framework/XSECError.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECError.lo -MD -MP -MF $(DEPDIR)/XSECError.Tpo -c -o XSECError.lo `test -f 'framework/XSECError.cpp' || echo '$(srcdir)/'`framework/XSECError.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECError.Tpo $(DEPDIR)/XSECError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECError.cpp' object='XSECError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECError.lo `test -f 'framework/XSECError.cpp' || echo '$(srcdir)/'`framework/XSECError.cpp XSECAlgorithmMapper.lo: framework/XSECAlgorithmMapper.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECAlgorithmMapper.lo -MD -MP -MF $(DEPDIR)/XSECAlgorithmMapper.Tpo -c -o XSECAlgorithmMapper.lo `test -f 'framework/XSECAlgorithmMapper.cpp' || echo '$(srcdir)/'`framework/XSECAlgorithmMapper.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECAlgorithmMapper.Tpo $(DEPDIR)/XSECAlgorithmMapper.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECAlgorithmMapper.cpp' object='XSECAlgorithmMapper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECAlgorithmMapper.lo `test -f 'framework/XSECAlgorithmMapper.cpp' || echo '$(srcdir)/'`framework/XSECAlgorithmMapper.cpp XSECEnv.lo: framework/XSECEnv.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECEnv.lo -MD -MP -MF $(DEPDIR)/XSECEnv.Tpo -c -o XSECEnv.lo `test -f 'framework/XSECEnv.cpp' || echo '$(srcdir)/'`framework/XSECEnv.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECEnv.Tpo $(DEPDIR)/XSECEnv.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECEnv.cpp' object='XSECEnv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECEnv.lo `test -f 'framework/XSECEnv.cpp' || echo '$(srcdir)/'`framework/XSECEnv.cpp XSECProvider.lo: framework/XSECProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECProvider.lo -MD -MP -MF $(DEPDIR)/XSECProvider.Tpo -c -o XSECProvider.lo `test -f 'framework/XSECProvider.cpp' || echo '$(srcdir)/'`framework/XSECProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECProvider.Tpo $(DEPDIR)/XSECProvider.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECProvider.cpp' object='XSECProvider.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECProvider.lo `test -f 'framework/XSECProvider.cpp' || echo '$(srcdir)/'`framework/XSECProvider.cpp XSECException.lo: framework/XSECException.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECException.lo -MD -MP -MF $(DEPDIR)/XSECException.Tpo -c -o XSECException.lo `test -f 'framework/XSECException.cpp' || echo '$(srcdir)/'`framework/XSECException.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECException.Tpo $(DEPDIR)/XSECException.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECException.cpp' object='XSECException.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECException.lo `test -f 'framework/XSECException.cpp' || echo '$(srcdir)/'`framework/XSECException.cpp XSECURIResolverXerces.lo: framework/XSECURIResolverXerces.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECURIResolverXerces.lo -MD -MP -MF $(DEPDIR)/XSECURIResolverXerces.Tpo -c -o XSECURIResolverXerces.lo `test -f 'framework/XSECURIResolverXerces.cpp' || echo '$(srcdir)/'`framework/XSECURIResolverXerces.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECURIResolverXerces.Tpo $(DEPDIR)/XSECURIResolverXerces.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='framework/XSECURIResolverXerces.cpp' object='XSECURIResolverXerces.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECURIResolverXerces.lo `test -f 'framework/XSECURIResolverXerces.cpp' || echo '$(srcdir)/'`framework/XSECURIResolverXerces.cpp TXFMBase.lo: transformers/TXFMBase.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMBase.lo -MD -MP -MF $(DEPDIR)/TXFMBase.Tpo -c -o TXFMBase.lo `test -f 'transformers/TXFMBase.cpp' || echo '$(srcdir)/'`transformers/TXFMBase.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMBase.Tpo $(DEPDIR)/TXFMBase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMBase.cpp' object='TXFMBase.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMBase.lo `test -f 'transformers/TXFMBase.cpp' || echo '$(srcdir)/'`transformers/TXFMBase.cpp TXFMChain.lo: transformers/TXFMChain.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMChain.lo -MD -MP -MF $(DEPDIR)/TXFMChain.Tpo -c -o TXFMChain.lo `test -f 'transformers/TXFMChain.cpp' || echo '$(srcdir)/'`transformers/TXFMChain.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMChain.Tpo $(DEPDIR)/TXFMChain.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMChain.cpp' object='TXFMChain.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMChain.lo `test -f 'transformers/TXFMChain.cpp' || echo '$(srcdir)/'`transformers/TXFMChain.cpp TXFMCipher.lo: transformers/TXFMCipher.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMCipher.lo -MD -MP -MF $(DEPDIR)/TXFMCipher.Tpo -c -o TXFMCipher.lo `test -f 'transformers/TXFMCipher.cpp' || echo '$(srcdir)/'`transformers/TXFMCipher.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMCipher.Tpo $(DEPDIR)/TXFMCipher.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMCipher.cpp' object='TXFMCipher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMCipher.lo `test -f 'transformers/TXFMCipher.cpp' || echo '$(srcdir)/'`transformers/TXFMCipher.cpp TXFMParser.lo: transformers/TXFMParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMParser.lo -MD -MP -MF $(DEPDIR)/TXFMParser.Tpo -c -o TXFMParser.lo `test -f 'transformers/TXFMParser.cpp' || echo '$(srcdir)/'`transformers/TXFMParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMParser.Tpo $(DEPDIR)/TXFMParser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMParser.cpp' object='TXFMParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMParser.lo `test -f 'transformers/TXFMParser.cpp' || echo '$(srcdir)/'`transformers/TXFMParser.cpp TXFMSB.lo: transformers/TXFMSB.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMSB.lo -MD -MP -MF $(DEPDIR)/TXFMSB.Tpo -c -o TXFMSB.lo `test -f 'transformers/TXFMSB.cpp' || echo '$(srcdir)/'`transformers/TXFMSB.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMSB.Tpo $(DEPDIR)/TXFMSB.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMSB.cpp' object='TXFMSB.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMSB.lo `test -f 'transformers/TXFMSB.cpp' || echo '$(srcdir)/'`transformers/TXFMSB.cpp TXFMEnvelope.lo: transformers/TXFMEnvelope.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMEnvelope.lo -MD -MP -MF $(DEPDIR)/TXFMEnvelope.Tpo -c -o TXFMEnvelope.lo `test -f 'transformers/TXFMEnvelope.cpp' || echo '$(srcdir)/'`transformers/TXFMEnvelope.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMEnvelope.Tpo $(DEPDIR)/TXFMEnvelope.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMEnvelope.cpp' object='TXFMEnvelope.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMEnvelope.lo `test -f 'transformers/TXFMEnvelope.cpp' || echo '$(srcdir)/'`transformers/TXFMEnvelope.cpp TXFMBase64.lo: transformers/TXFMBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMBase64.lo -MD -MP -MF $(DEPDIR)/TXFMBase64.Tpo -c -o TXFMBase64.lo `test -f 'transformers/TXFMBase64.cpp' || echo '$(srcdir)/'`transformers/TXFMBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMBase64.Tpo $(DEPDIR)/TXFMBase64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMBase64.cpp' object='TXFMBase64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMBase64.lo `test -f 'transformers/TXFMBase64.cpp' || echo '$(srcdir)/'`transformers/TXFMBase64.cpp TXFMXPathFilter.lo: transformers/TXFMXPathFilter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMXPathFilter.lo -MD -MP -MF $(DEPDIR)/TXFMXPathFilter.Tpo -c -o TXFMXPathFilter.lo `test -f 'transformers/TXFMXPathFilter.cpp' || echo '$(srcdir)/'`transformers/TXFMXPathFilter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMXPathFilter.Tpo $(DEPDIR)/TXFMXPathFilter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMXPathFilter.cpp' object='TXFMXPathFilter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMXPathFilter.lo `test -f 'transformers/TXFMXPathFilter.cpp' || echo '$(srcdir)/'`transformers/TXFMXPathFilter.cpp TXFMSHA1.lo: transformers/TXFMSHA1.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMSHA1.lo -MD -MP -MF $(DEPDIR)/TXFMSHA1.Tpo -c -o TXFMSHA1.lo `test -f 'transformers/TXFMSHA1.cpp' || echo '$(srcdir)/'`transformers/TXFMSHA1.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMSHA1.Tpo $(DEPDIR)/TXFMSHA1.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMSHA1.cpp' object='TXFMSHA1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMSHA1.lo `test -f 'transformers/TXFMSHA1.cpp' || echo '$(srcdir)/'`transformers/TXFMSHA1.cpp TXFMC14n.lo: transformers/TXFMC14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMC14n.lo -MD -MP -MF $(DEPDIR)/TXFMC14n.Tpo -c -o TXFMC14n.lo `test -f 'transformers/TXFMC14n.cpp' || echo '$(srcdir)/'`transformers/TXFMC14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMC14n.Tpo $(DEPDIR)/TXFMC14n.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMC14n.cpp' object='TXFMC14n.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMC14n.lo `test -f 'transformers/TXFMC14n.cpp' || echo '$(srcdir)/'`transformers/TXFMC14n.cpp TXFMURL.lo: transformers/TXFMURL.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMURL.lo -MD -MP -MF $(DEPDIR)/TXFMURL.Tpo -c -o TXFMURL.lo `test -f 'transformers/TXFMURL.cpp' || echo '$(srcdir)/'`transformers/TXFMURL.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMURL.Tpo $(DEPDIR)/TXFMURL.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMURL.cpp' object='TXFMURL.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMURL.lo `test -f 'transformers/TXFMURL.cpp' || echo '$(srcdir)/'`transformers/TXFMURL.cpp TXFMOutputFile.lo: transformers/TXFMOutputFile.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMOutputFile.lo -MD -MP -MF $(DEPDIR)/TXFMOutputFile.Tpo -c -o TXFMOutputFile.lo `test -f 'transformers/TXFMOutputFile.cpp' || echo '$(srcdir)/'`transformers/TXFMOutputFile.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMOutputFile.Tpo $(DEPDIR)/TXFMOutputFile.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMOutputFile.cpp' object='TXFMOutputFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMOutputFile.lo `test -f 'transformers/TXFMOutputFile.cpp' || echo '$(srcdir)/'`transformers/TXFMOutputFile.cpp TXFMXPath.lo: transformers/TXFMXPath.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMXPath.lo -MD -MP -MF $(DEPDIR)/TXFMXPath.Tpo -c -o TXFMXPath.lo `test -f 'transformers/TXFMXPath.cpp' || echo '$(srcdir)/'`transformers/TXFMXPath.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMXPath.Tpo $(DEPDIR)/TXFMXPath.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMXPath.cpp' object='TXFMXPath.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMXPath.lo `test -f 'transformers/TXFMXPath.cpp' || echo '$(srcdir)/'`transformers/TXFMXPath.cpp TXFMXSL.lo: transformers/TXFMXSL.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMXSL.lo -MD -MP -MF $(DEPDIR)/TXFMXSL.Tpo -c -o TXFMXSL.lo `test -f 'transformers/TXFMXSL.cpp' || echo '$(srcdir)/'`transformers/TXFMXSL.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMXSL.Tpo $(DEPDIR)/TXFMXSL.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMXSL.cpp' object='TXFMXSL.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMXSL.lo `test -f 'transformers/TXFMXSL.cpp' || echo '$(srcdir)/'`transformers/TXFMXSL.cpp TXFMDocObject.lo: transformers/TXFMDocObject.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMDocObject.lo -MD -MP -MF $(DEPDIR)/TXFMDocObject.Tpo -c -o TXFMDocObject.lo `test -f 'transformers/TXFMDocObject.cpp' || echo '$(srcdir)/'`transformers/TXFMDocObject.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMDocObject.Tpo $(DEPDIR)/TXFMDocObject.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMDocObject.cpp' object='TXFMDocObject.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMDocObject.lo `test -f 'transformers/TXFMDocObject.cpp' || echo '$(srcdir)/'`transformers/TXFMDocObject.cpp TXFMConcatChains.lo: transformers/TXFMConcatChains.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMConcatChains.lo -MD -MP -MF $(DEPDIR)/TXFMConcatChains.Tpo -c -o TXFMConcatChains.lo `test -f 'transformers/TXFMConcatChains.cpp' || echo '$(srcdir)/'`transformers/TXFMConcatChains.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMConcatChains.Tpo $(DEPDIR)/TXFMConcatChains.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMConcatChains.cpp' object='TXFMConcatChains.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMConcatChains.lo `test -f 'transformers/TXFMConcatChains.cpp' || echo '$(srcdir)/'`transformers/TXFMConcatChains.cpp TXFMMD5.lo: transformers/TXFMMD5.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TXFMMD5.lo -MD -MP -MF $(DEPDIR)/TXFMMD5.Tpo -c -o TXFMMD5.lo `test -f 'transformers/TXFMMD5.cpp' || echo '$(srcdir)/'`transformers/TXFMMD5.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/TXFMMD5.Tpo $(DEPDIR)/TXFMMD5.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='transformers/TXFMMD5.cpp' object='TXFMMD5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TXFMMD5.lo `test -f 'transformers/TXFMMD5.cpp' || echo '$(srcdir)/'`transformers/TXFMMD5.cpp XSECSOAPRequestorSimpleUnix.lo: utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECSOAPRequestorSimpleUnix.lo -MD -MP -MF $(DEPDIR)/XSECSOAPRequestorSimpleUnix.Tpo -c -o XSECSOAPRequestorSimpleUnix.lo `test -f 'utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECSOAPRequestorSimpleUnix.Tpo $(DEPDIR)/XSECSOAPRequestorSimpleUnix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp' object='XSECSOAPRequestorSimpleUnix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECSOAPRequestorSimpleUnix.lo `test -f 'utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp XSECURIResolverGenericUnix.lo: utils/unixutils/XSECURIResolverGenericUnix.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECURIResolverGenericUnix.lo -MD -MP -MF $(DEPDIR)/XSECURIResolverGenericUnix.Tpo -c -o XSECURIResolverGenericUnix.lo `test -f 'utils/unixutils/XSECURIResolverGenericUnix.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECURIResolverGenericUnix.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECURIResolverGenericUnix.Tpo $(DEPDIR)/XSECURIResolverGenericUnix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/unixutils/XSECURIResolverGenericUnix.cpp' object='XSECURIResolverGenericUnix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECURIResolverGenericUnix.lo `test -f 'utils/unixutils/XSECURIResolverGenericUnix.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECURIResolverGenericUnix.cpp XSECBinHTTPURIInputStream.lo: utils/unixutils/XSECBinHTTPURIInputStream.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECBinHTTPURIInputStream.lo -MD -MP -MF $(DEPDIR)/XSECBinHTTPURIInputStream.Tpo -c -o XSECBinHTTPURIInputStream.lo `test -f 'utils/unixutils/XSECBinHTTPURIInputStream.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECBinHTTPURIInputStream.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECBinHTTPURIInputStream.Tpo $(DEPDIR)/XSECBinHTTPURIInputStream.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/unixutils/XSECBinHTTPURIInputStream.cpp' object='XSECBinHTTPURIInputStream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECBinHTTPURIInputStream.lo `test -f 'utils/unixutils/XSECBinHTTPURIInputStream.cpp' || echo '$(srcdir)/'`utils/unixutils/XSECBinHTTPURIInputStream.cpp XSECBinTXFMInputStream.lo: utils/XSECBinTXFMInputStream.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECBinTXFMInputStream.lo -MD -MP -MF $(DEPDIR)/XSECBinTXFMInputStream.Tpo -c -o XSECBinTXFMInputStream.lo `test -f 'utils/XSECBinTXFMInputStream.cpp' || echo '$(srcdir)/'`utils/XSECBinTXFMInputStream.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECBinTXFMInputStream.Tpo $(DEPDIR)/XSECBinTXFMInputStream.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECBinTXFMInputStream.cpp' object='XSECBinTXFMInputStream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECBinTXFMInputStream.lo `test -f 'utils/XSECBinTXFMInputStream.cpp' || echo '$(srcdir)/'`utils/XSECBinTXFMInputStream.cpp XSECXPathNodeList.lo: utils/XSECXPathNodeList.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECXPathNodeList.lo -MD -MP -MF $(DEPDIR)/XSECXPathNodeList.Tpo -c -o XSECXPathNodeList.lo `test -f 'utils/XSECXPathNodeList.cpp' || echo '$(srcdir)/'`utils/XSECXPathNodeList.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECXPathNodeList.Tpo $(DEPDIR)/XSECXPathNodeList.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECXPathNodeList.cpp' object='XSECXPathNodeList.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECXPathNodeList.lo `test -f 'utils/XSECXPathNodeList.cpp' || echo '$(srcdir)/'`utils/XSECXPathNodeList.cpp XSECSafeBuffer.lo: utils/XSECSafeBuffer.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECSafeBuffer.lo -MD -MP -MF $(DEPDIR)/XSECSafeBuffer.Tpo -c -o XSECSafeBuffer.lo `test -f 'utils/XSECSafeBuffer.cpp' || echo '$(srcdir)/'`utils/XSECSafeBuffer.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECSafeBuffer.Tpo $(DEPDIR)/XSECSafeBuffer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECSafeBuffer.cpp' object='XSECSafeBuffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECSafeBuffer.lo `test -f 'utils/XSECSafeBuffer.cpp' || echo '$(srcdir)/'`utils/XSECSafeBuffer.cpp XSECTXFMInputSource.lo: utils/XSECTXFMInputSource.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECTXFMInputSource.lo -MD -MP -MF $(DEPDIR)/XSECTXFMInputSource.Tpo -c -o XSECTXFMInputSource.lo `test -f 'utils/XSECTXFMInputSource.cpp' || echo '$(srcdir)/'`utils/XSECTXFMInputSource.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECTXFMInputSource.Tpo $(DEPDIR)/XSECTXFMInputSource.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECTXFMInputSource.cpp' object='XSECTXFMInputSource.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECTXFMInputSource.lo `test -f 'utils/XSECTXFMInputSource.cpp' || echo '$(srcdir)/'`utils/XSECTXFMInputSource.cpp XSECDOMUtils.lo: utils/XSECDOMUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECDOMUtils.lo -MD -MP -MF $(DEPDIR)/XSECDOMUtils.Tpo -c -o XSECDOMUtils.lo `test -f 'utils/XSECDOMUtils.cpp' || echo '$(srcdir)/'`utils/XSECDOMUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECDOMUtils.Tpo $(DEPDIR)/XSECDOMUtils.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECDOMUtils.cpp' object='XSECDOMUtils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECDOMUtils.lo `test -f 'utils/XSECDOMUtils.cpp' || echo '$(srcdir)/'`utils/XSECDOMUtils.cpp XSECSafeBufferFormatter.lo: utils/XSECSafeBufferFormatter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECSafeBufferFormatter.lo -MD -MP -MF $(DEPDIR)/XSECSafeBufferFormatter.Tpo -c -o XSECSafeBufferFormatter.lo `test -f 'utils/XSECSafeBufferFormatter.cpp' || echo '$(srcdir)/'`utils/XSECSafeBufferFormatter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECSafeBufferFormatter.Tpo $(DEPDIR)/XSECSafeBufferFormatter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECSafeBufferFormatter.cpp' object='XSECSafeBufferFormatter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECSafeBufferFormatter.lo `test -f 'utils/XSECSafeBufferFormatter.cpp' || echo '$(srcdir)/'`utils/XSECSafeBufferFormatter.cpp XSECSOAPRequestorSimple.lo: utils/XSECSOAPRequestorSimple.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECSOAPRequestorSimple.lo -MD -MP -MF $(DEPDIR)/XSECSOAPRequestorSimple.Tpo -c -o XSECSOAPRequestorSimple.lo `test -f 'utils/XSECSOAPRequestorSimple.cpp' || echo '$(srcdir)/'`utils/XSECSOAPRequestorSimple.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECSOAPRequestorSimple.Tpo $(DEPDIR)/XSECSOAPRequestorSimple.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECSOAPRequestorSimple.cpp' object='XSECSOAPRequestorSimple.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECSOAPRequestorSimple.lo `test -f 'utils/XSECSOAPRequestorSimple.cpp' || echo '$(srcdir)/'`utils/XSECSOAPRequestorSimple.cpp XSECNameSpaceExpander.lo: utils/XSECNameSpaceExpander.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECNameSpaceExpander.lo -MD -MP -MF $(DEPDIR)/XSECNameSpaceExpander.Tpo -c -o XSECNameSpaceExpander.lo `test -f 'utils/XSECNameSpaceExpander.cpp' || echo '$(srcdir)/'`utils/XSECNameSpaceExpander.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECNameSpaceExpander.Tpo $(DEPDIR)/XSECNameSpaceExpander.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECNameSpaceExpander.cpp' object='XSECNameSpaceExpander.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECNameSpaceExpander.lo `test -f 'utils/XSECNameSpaceExpander.cpp' || echo '$(srcdir)/'`utils/XSECNameSpaceExpander.cpp XSECPlatformUtils.lo: utils/XSECPlatformUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XSECPlatformUtils.lo -MD -MP -MF $(DEPDIR)/XSECPlatformUtils.Tpo -c -o XSECPlatformUtils.lo `test -f 'utils/XSECPlatformUtils.cpp' || echo '$(srcdir)/'`utils/XSECPlatformUtils.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XSECPlatformUtils.Tpo $(DEPDIR)/XSECPlatformUtils.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils/XSECPlatformUtils.cpp' object='XSECPlatformUtils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XSECPlatformUtils.lo `test -f 'utils/XSECPlatformUtils.cpp' || echo '$(srcdir)/'`utils/XSECPlatformUtils.cpp XENCCipherReferenceImpl.lo: xenc/impl/XENCCipherReferenceImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCCipherReferenceImpl.lo -MD -MP -MF $(DEPDIR)/XENCCipherReferenceImpl.Tpo -c -o XENCCipherReferenceImpl.lo `test -f 'xenc/impl/XENCCipherReferenceImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherReferenceImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCCipherReferenceImpl.Tpo $(DEPDIR)/XENCCipherReferenceImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCCipherReferenceImpl.cpp' object='XENCCipherReferenceImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCCipherReferenceImpl.lo `test -f 'xenc/impl/XENCCipherReferenceImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherReferenceImpl.cpp XENCEncryptionMethodImpl.lo: xenc/impl/XENCEncryptionMethodImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCEncryptionMethodImpl.lo -MD -MP -MF $(DEPDIR)/XENCEncryptionMethodImpl.Tpo -c -o XENCEncryptionMethodImpl.lo `test -f 'xenc/impl/XENCEncryptionMethodImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptionMethodImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCEncryptionMethodImpl.Tpo $(DEPDIR)/XENCEncryptionMethodImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCEncryptionMethodImpl.cpp' object='XENCEncryptionMethodImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCEncryptionMethodImpl.lo `test -f 'xenc/impl/XENCEncryptionMethodImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptionMethodImpl.cpp XENCCipherValueImpl.lo: xenc/impl/XENCCipherValueImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCCipherValueImpl.lo -MD -MP -MF $(DEPDIR)/XENCCipherValueImpl.Tpo -c -o XENCCipherValueImpl.lo `test -f 'xenc/impl/XENCCipherValueImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherValueImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCCipherValueImpl.Tpo $(DEPDIR)/XENCCipherValueImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCCipherValueImpl.cpp' object='XENCCipherValueImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCCipherValueImpl.lo `test -f 'xenc/impl/XENCCipherValueImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherValueImpl.cpp XENCAlgorithmHandlerDefault.lo: xenc/impl/XENCAlgorithmHandlerDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCAlgorithmHandlerDefault.lo -MD -MP -MF $(DEPDIR)/XENCAlgorithmHandlerDefault.Tpo -c -o XENCAlgorithmHandlerDefault.lo `test -f 'xenc/impl/XENCAlgorithmHandlerDefault.cpp' || echo '$(srcdir)/'`xenc/impl/XENCAlgorithmHandlerDefault.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCAlgorithmHandlerDefault.Tpo $(DEPDIR)/XENCAlgorithmHandlerDefault.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCAlgorithmHandlerDefault.cpp' object='XENCAlgorithmHandlerDefault.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCAlgorithmHandlerDefault.lo `test -f 'xenc/impl/XENCAlgorithmHandlerDefault.cpp' || echo '$(srcdir)/'`xenc/impl/XENCAlgorithmHandlerDefault.cpp XENCEncryptedDataImpl.lo: xenc/impl/XENCEncryptedDataImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCEncryptedDataImpl.lo -MD -MP -MF $(DEPDIR)/XENCEncryptedDataImpl.Tpo -c -o XENCEncryptedDataImpl.lo `test -f 'xenc/impl/XENCEncryptedDataImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedDataImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCEncryptedDataImpl.Tpo $(DEPDIR)/XENCEncryptedDataImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCEncryptedDataImpl.cpp' object='XENCEncryptedDataImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCEncryptedDataImpl.lo `test -f 'xenc/impl/XENCEncryptedDataImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedDataImpl.cpp XENCCipherDataImpl.lo: xenc/impl/XENCCipherDataImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCCipherDataImpl.lo -MD -MP -MF $(DEPDIR)/XENCCipherDataImpl.Tpo -c -o XENCCipherDataImpl.lo `test -f 'xenc/impl/XENCCipherDataImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherDataImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCCipherDataImpl.Tpo $(DEPDIR)/XENCCipherDataImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCCipherDataImpl.cpp' object='XENCCipherDataImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCCipherDataImpl.lo `test -f 'xenc/impl/XENCCipherDataImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherDataImpl.cpp XENCEncryptedTypeImpl.lo: xenc/impl/XENCEncryptedTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCEncryptedTypeImpl.lo -MD -MP -MF $(DEPDIR)/XENCEncryptedTypeImpl.Tpo -c -o XENCEncryptedTypeImpl.lo `test -f 'xenc/impl/XENCEncryptedTypeImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCEncryptedTypeImpl.Tpo $(DEPDIR)/XENCEncryptedTypeImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCEncryptedTypeImpl.cpp' object='XENCEncryptedTypeImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCEncryptedTypeImpl.lo `test -f 'xenc/impl/XENCEncryptedTypeImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedTypeImpl.cpp XENCCipherImpl.lo: xenc/impl/XENCCipherImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCCipherImpl.lo -MD -MP -MF $(DEPDIR)/XENCCipherImpl.Tpo -c -o XENCCipherImpl.lo `test -f 'xenc/impl/XENCCipherImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCCipherImpl.Tpo $(DEPDIR)/XENCCipherImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCCipherImpl.cpp' object='XENCCipherImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCCipherImpl.lo `test -f 'xenc/impl/XENCCipherImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCCipherImpl.cpp XENCEncryptedKeyImpl.lo: xenc/impl/XENCEncryptedKeyImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XENCEncryptedKeyImpl.lo -MD -MP -MF $(DEPDIR)/XENCEncryptedKeyImpl.Tpo -c -o XENCEncryptedKeyImpl.lo `test -f 'xenc/impl/XENCEncryptedKeyImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedKeyImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XENCEncryptedKeyImpl.Tpo $(DEPDIR)/XENCEncryptedKeyImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xenc/impl/XENCEncryptedKeyImpl.cpp' object='XENCEncryptedKeyImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XENCEncryptedKeyImpl.lo `test -f 'xenc/impl/XENCEncryptedKeyImpl.cpp' || echo '$(srcdir)/'`xenc/impl/XENCEncryptedKeyImpl.cpp XKMSConstants.lo: xkms/XKMSConstants.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSConstants.lo -MD -MP -MF $(DEPDIR)/XKMSConstants.Tpo -c -o XKMSConstants.lo `test -f 'xkms/XKMSConstants.cpp' || echo '$(srcdir)/'`xkms/XKMSConstants.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSConstants.Tpo $(DEPDIR)/XKMSConstants.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/XKMSConstants.cpp' object='XKMSConstants.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSConstants.lo `test -f 'xkms/XKMSConstants.cpp' || echo '$(srcdir)/'`xkms/XKMSConstants.cpp XKMSCompoundRequestImpl.lo: xkms/impl/XKMSCompoundRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSCompoundRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSCompoundRequestImpl.Tpo -c -o XKMSCompoundRequestImpl.lo `test -f 'xkms/impl/XKMSCompoundRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSCompoundRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSCompoundRequestImpl.Tpo $(DEPDIR)/XKMSCompoundRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSCompoundRequestImpl.cpp' object='XKMSCompoundRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSCompoundRequestImpl.lo `test -f 'xkms/impl/XKMSCompoundRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSCompoundRequestImpl.cpp XKMSRecoverRequestImpl.lo: xkms/impl/XKMSRecoverRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRecoverRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRecoverRequestImpl.Tpo -c -o XKMSRecoverRequestImpl.lo `test -f 'xkms/impl/XKMSRecoverRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRecoverRequestImpl.Tpo $(DEPDIR)/XKMSRecoverRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRecoverRequestImpl.cpp' object='XKMSRecoverRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRecoverRequestImpl.lo `test -f 'xkms/impl/XKMSRecoverRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverRequestImpl.cpp XKMSRegisterResultImpl.lo: xkms/impl/XKMSRegisterResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRegisterResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRegisterResultImpl.Tpo -c -o XKMSRegisterResultImpl.lo `test -f 'xkms/impl/XKMSRegisterResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRegisterResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRegisterResultImpl.Tpo $(DEPDIR)/XKMSRegisterResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRegisterResultImpl.cpp' object='XKMSRegisterResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRegisterResultImpl.lo `test -f 'xkms/impl/XKMSRegisterResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRegisterResultImpl.cpp XKMSRecoverResultImpl.lo: xkms/impl/XKMSRecoverResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRecoverResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRecoverResultImpl.Tpo -c -o XKMSRecoverResultImpl.lo `test -f 'xkms/impl/XKMSRecoverResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRecoverResultImpl.Tpo $(DEPDIR)/XKMSRecoverResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRecoverResultImpl.cpp' object='XKMSRecoverResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRecoverResultImpl.lo `test -f 'xkms/impl/XKMSRecoverResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverResultImpl.cpp XKMSCompoundResultImpl.lo: xkms/impl/XKMSCompoundResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSCompoundResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSCompoundResultImpl.Tpo -c -o XKMSCompoundResultImpl.lo `test -f 'xkms/impl/XKMSCompoundResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSCompoundResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSCompoundResultImpl.Tpo $(DEPDIR)/XKMSCompoundResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSCompoundResultImpl.cpp' object='XKMSCompoundResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSCompoundResultImpl.lo `test -f 'xkms/impl/XKMSCompoundResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSCompoundResultImpl.cpp XKMSRevokeKeyBindingImpl.lo: xkms/impl/XKMSRevokeKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRevokeKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRevokeKeyBindingImpl.Tpo -c -o XKMSRevokeKeyBindingImpl.lo `test -f 'xkms/impl/XKMSRevokeKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRevokeKeyBindingImpl.Tpo $(DEPDIR)/XKMSRevokeKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRevokeKeyBindingImpl.cpp' object='XKMSRevokeKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRevokeKeyBindingImpl.lo `test -f 'xkms/impl/XKMSRevokeKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeKeyBindingImpl.cpp XKMSKeyBindingAbstractTypeImpl.lo: xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSKeyBindingAbstractTypeImpl.lo -MD -MP -MF $(DEPDIR)/XKMSKeyBindingAbstractTypeImpl.Tpo -c -o XKMSKeyBindingAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSKeyBindingAbstractTypeImpl.Tpo $(DEPDIR)/XKMSKeyBindingAbstractTypeImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp' object='XKMSKeyBindingAbstractTypeImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSKeyBindingAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp XKMSPrototypeKeyBindingImpl.lo: xkms/impl/XKMSPrototypeKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSPrototypeKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSPrototypeKeyBindingImpl.Tpo -c -o XKMSPrototypeKeyBindingImpl.lo `test -f 'xkms/impl/XKMSPrototypeKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSPrototypeKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSPrototypeKeyBindingImpl.Tpo $(DEPDIR)/XKMSPrototypeKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSPrototypeKeyBindingImpl.cpp' object='XKMSPrototypeKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSPrototypeKeyBindingImpl.lo `test -f 'xkms/impl/XKMSPrototypeKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSPrototypeKeyBindingImpl.cpp XKMSValidateResultImpl.lo: xkms/impl/XKMSValidateResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSValidateResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSValidateResultImpl.Tpo -c -o XKMSValidateResultImpl.lo `test -f 'xkms/impl/XKMSValidateResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidateResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSValidateResultImpl.Tpo $(DEPDIR)/XKMSValidateResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSValidateResultImpl.cpp' object='XKMSValidateResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSValidateResultImpl.lo `test -f 'xkms/impl/XKMSValidateResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidateResultImpl.cpp XKMSAuthenticationImpl.lo: xkms/impl/XKMSAuthenticationImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSAuthenticationImpl.lo -MD -MP -MF $(DEPDIR)/XKMSAuthenticationImpl.Tpo -c -o XKMSAuthenticationImpl.lo `test -f 'xkms/impl/XKMSAuthenticationImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSAuthenticationImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSAuthenticationImpl.Tpo $(DEPDIR)/XKMSAuthenticationImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSAuthenticationImpl.cpp' object='XKMSAuthenticationImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSAuthenticationImpl.lo `test -f 'xkms/impl/XKMSAuthenticationImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSAuthenticationImpl.cpp XKMSStatusResultImpl.lo: xkms/impl/XKMSStatusResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSStatusResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSStatusResultImpl.Tpo -c -o XKMSStatusResultImpl.lo `test -f 'xkms/impl/XKMSStatusResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSStatusResultImpl.Tpo $(DEPDIR)/XKMSStatusResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSStatusResultImpl.cpp' object='XKMSStatusResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSStatusResultImpl.lo `test -f 'xkms/impl/XKMSStatusResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusResultImpl.cpp XKMSReissueRequestImpl.lo: xkms/impl/XKMSReissueRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSReissueRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSReissueRequestImpl.Tpo -c -o XKMSReissueRequestImpl.lo `test -f 'xkms/impl/XKMSReissueRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSReissueRequestImpl.Tpo $(DEPDIR)/XKMSReissueRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSReissueRequestImpl.cpp' object='XKMSReissueRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSReissueRequestImpl.lo `test -f 'xkms/impl/XKMSReissueRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueRequestImpl.cpp XKMSKeyBindingImpl.lo: xkms/impl/XKMSKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSKeyBindingImpl.Tpo -c -o XKMSKeyBindingImpl.lo `test -f 'xkms/impl/XKMSKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSKeyBindingImpl.Tpo $(DEPDIR)/XKMSKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSKeyBindingImpl.cpp' object='XKMSKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSKeyBindingImpl.lo `test -f 'xkms/impl/XKMSKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSKeyBindingImpl.cpp XKMSRequestAbstractTypeImpl.lo: xkms/impl/XKMSRequestAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRequestAbstractTypeImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRequestAbstractTypeImpl.Tpo -c -o XKMSRequestAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSRequestAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRequestAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRequestAbstractTypeImpl.Tpo $(DEPDIR)/XKMSRequestAbstractTypeImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRequestAbstractTypeImpl.cpp' object='XKMSRequestAbstractTypeImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRequestAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSRequestAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRequestAbstractTypeImpl.cpp XKMSRespondWithImpl.lo: xkms/impl/XKMSRespondWithImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRespondWithImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRespondWithImpl.Tpo -c -o XKMSRespondWithImpl.lo `test -f 'xkms/impl/XKMSRespondWithImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRespondWithImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRespondWithImpl.Tpo $(DEPDIR)/XKMSRespondWithImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRespondWithImpl.cpp' object='XKMSRespondWithImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRespondWithImpl.lo `test -f 'xkms/impl/XKMSRespondWithImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRespondWithImpl.cpp XKMSReissueResultImpl.lo: xkms/impl/XKMSReissueResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSReissueResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSReissueResultImpl.Tpo -c -o XKMSReissueResultImpl.lo `test -f 'xkms/impl/XKMSReissueResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSReissueResultImpl.Tpo $(DEPDIR)/XKMSReissueResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSReissueResultImpl.cpp' object='XKMSReissueResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSReissueResultImpl.lo `test -f 'xkms/impl/XKMSReissueResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueResultImpl.cpp XKMSMessageAbstractTypeImpl.lo: xkms/impl/XKMSMessageAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSMessageAbstractTypeImpl.lo -MD -MP -MF $(DEPDIR)/XKMSMessageAbstractTypeImpl.Tpo -c -o XKMSMessageAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSMessageAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSMessageAbstractTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSMessageAbstractTypeImpl.Tpo $(DEPDIR)/XKMSMessageAbstractTypeImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSMessageAbstractTypeImpl.cpp' object='XKMSMessageAbstractTypeImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSMessageAbstractTypeImpl.lo `test -f 'xkms/impl/XKMSMessageAbstractTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSMessageAbstractTypeImpl.cpp XKMSRevokeResultImpl.lo: xkms/impl/XKMSRevokeResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRevokeResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRevokeResultImpl.Tpo -c -o XKMSRevokeResultImpl.lo `test -f 'xkms/impl/XKMSRevokeResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRevokeResultImpl.Tpo $(DEPDIR)/XKMSRevokeResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRevokeResultImpl.cpp' object='XKMSRevokeResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRevokeResultImpl.lo `test -f 'xkms/impl/XKMSRevokeResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeResultImpl.cpp XKMSRevokeRequestImpl.lo: xkms/impl/XKMSRevokeRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRevokeRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRevokeRequestImpl.Tpo -c -o XKMSRevokeRequestImpl.lo `test -f 'xkms/impl/XKMSRevokeRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRevokeRequestImpl.Tpo $(DEPDIR)/XKMSRevokeRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRevokeRequestImpl.cpp' object='XKMSRevokeRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRevokeRequestImpl.lo `test -f 'xkms/impl/XKMSRevokeRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRevokeRequestImpl.cpp XKMSPendingRequestImpl.lo: xkms/impl/XKMSPendingRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSPendingRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSPendingRequestImpl.Tpo -c -o XKMSPendingRequestImpl.lo `test -f 'xkms/impl/XKMSPendingRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSPendingRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSPendingRequestImpl.Tpo $(DEPDIR)/XKMSPendingRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSPendingRequestImpl.cpp' object='XKMSPendingRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSPendingRequestImpl.lo `test -f 'xkms/impl/XKMSPendingRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSPendingRequestImpl.cpp XKMSValidateRequestImpl.lo: xkms/impl/XKMSValidateRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSValidateRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSValidateRequestImpl.Tpo -c -o XKMSValidateRequestImpl.lo `test -f 'xkms/impl/XKMSValidateRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidateRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSValidateRequestImpl.Tpo $(DEPDIR)/XKMSValidateRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSValidateRequestImpl.cpp' object='XKMSValidateRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSValidateRequestImpl.lo `test -f 'xkms/impl/XKMSValidateRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidateRequestImpl.cpp XKMSRecoverKeyBindingImpl.lo: xkms/impl/XKMSRecoverKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRecoverKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRecoverKeyBindingImpl.Tpo -c -o XKMSRecoverKeyBindingImpl.lo `test -f 'xkms/impl/XKMSRecoverKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRecoverKeyBindingImpl.Tpo $(DEPDIR)/XKMSRecoverKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRecoverKeyBindingImpl.cpp' object='XKMSRecoverKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRecoverKeyBindingImpl.lo `test -f 'xkms/impl/XKMSRecoverKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRecoverKeyBindingImpl.cpp XKMSRSAKeyPairImpl.lo: xkms/impl/XKMSRSAKeyPairImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRSAKeyPairImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRSAKeyPairImpl.Tpo -c -o XKMSRSAKeyPairImpl.lo `test -f 'xkms/impl/XKMSRSAKeyPairImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRSAKeyPairImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRSAKeyPairImpl.Tpo $(DEPDIR)/XKMSRSAKeyPairImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRSAKeyPairImpl.cpp' object='XKMSRSAKeyPairImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRSAKeyPairImpl.lo `test -f 'xkms/impl/XKMSRSAKeyPairImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRSAKeyPairImpl.cpp XKMSUnverifiedKeyBindingImpl.lo: xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSUnverifiedKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSUnverifiedKeyBindingImpl.Tpo -c -o XKMSUnverifiedKeyBindingImpl.lo `test -f 'xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSUnverifiedKeyBindingImpl.Tpo $(DEPDIR)/XKMSUnverifiedKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp' object='XKMSUnverifiedKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSUnverifiedKeyBindingImpl.lo `test -f 'xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp XKMSLocateRequestImpl.lo: xkms/impl/XKMSLocateRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSLocateRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSLocateRequestImpl.Tpo -c -o XKMSLocateRequestImpl.lo `test -f 'xkms/impl/XKMSLocateRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSLocateRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSLocateRequestImpl.Tpo $(DEPDIR)/XKMSLocateRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSLocateRequestImpl.cpp' object='XKMSLocateRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSLocateRequestImpl.lo `test -f 'xkms/impl/XKMSLocateRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSLocateRequestImpl.cpp XKMSResultTypeImpl.lo: xkms/impl/XKMSResultTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSResultTypeImpl.lo -MD -MP -MF $(DEPDIR)/XKMSResultTypeImpl.Tpo -c -o XKMSResultTypeImpl.lo `test -f 'xkms/impl/XKMSResultTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResultTypeImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSResultTypeImpl.Tpo $(DEPDIR)/XKMSResultTypeImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSResultTypeImpl.cpp' object='XKMSResultTypeImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSResultTypeImpl.lo `test -f 'xkms/impl/XKMSResultTypeImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResultTypeImpl.cpp XKMSResultImpl.lo: xkms/impl/XKMSResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSResultImpl.Tpo -c -o XKMSResultImpl.lo `test -f 'xkms/impl/XKMSResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSResultImpl.Tpo $(DEPDIR)/XKMSResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSResultImpl.cpp' object='XKMSResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSResultImpl.lo `test -f 'xkms/impl/XKMSResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResultImpl.cpp XKMSValidityIntervalImpl.lo: xkms/impl/XKMSValidityIntervalImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSValidityIntervalImpl.lo -MD -MP -MF $(DEPDIR)/XKMSValidityIntervalImpl.Tpo -c -o XKMSValidityIntervalImpl.lo `test -f 'xkms/impl/XKMSValidityIntervalImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidityIntervalImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSValidityIntervalImpl.Tpo $(DEPDIR)/XKMSValidityIntervalImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSValidityIntervalImpl.cpp' object='XKMSValidityIntervalImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSValidityIntervalImpl.lo `test -f 'xkms/impl/XKMSValidityIntervalImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSValidityIntervalImpl.cpp XKMSRegisterRequestImpl.lo: xkms/impl/XKMSRegisterRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSRegisterRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSRegisterRequestImpl.Tpo -c -o XKMSRegisterRequestImpl.lo `test -f 'xkms/impl/XKMSRegisterRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRegisterRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSRegisterRequestImpl.Tpo $(DEPDIR)/XKMSRegisterRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSRegisterRequestImpl.cpp' object='XKMSRegisterRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSRegisterRequestImpl.lo `test -f 'xkms/impl/XKMSRegisterRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSRegisterRequestImpl.cpp XKMSStatusImpl.lo: xkms/impl/XKMSStatusImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSStatusImpl.lo -MD -MP -MF $(DEPDIR)/XKMSStatusImpl.Tpo -c -o XKMSStatusImpl.lo `test -f 'xkms/impl/XKMSStatusImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSStatusImpl.Tpo $(DEPDIR)/XKMSStatusImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSStatusImpl.cpp' object='XKMSStatusImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSStatusImpl.lo `test -f 'xkms/impl/XKMSStatusImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusImpl.cpp XKMSStatusRequestImpl.lo: xkms/impl/XKMSStatusRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSStatusRequestImpl.lo -MD -MP -MF $(DEPDIR)/XKMSStatusRequestImpl.Tpo -c -o XKMSStatusRequestImpl.lo `test -f 'xkms/impl/XKMSStatusRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusRequestImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSStatusRequestImpl.Tpo $(DEPDIR)/XKMSStatusRequestImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSStatusRequestImpl.cpp' object='XKMSStatusRequestImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSStatusRequestImpl.lo `test -f 'xkms/impl/XKMSStatusRequestImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSStatusRequestImpl.cpp XKMSReissueKeyBindingImpl.lo: xkms/impl/XKMSReissueKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSReissueKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSReissueKeyBindingImpl.Tpo -c -o XKMSReissueKeyBindingImpl.lo `test -f 'xkms/impl/XKMSReissueKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSReissueKeyBindingImpl.Tpo $(DEPDIR)/XKMSReissueKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSReissueKeyBindingImpl.cpp' object='XKMSReissueKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSReissueKeyBindingImpl.lo `test -f 'xkms/impl/XKMSReissueKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSReissueKeyBindingImpl.cpp XKMSMessageFactoryImpl.lo: xkms/impl/XKMSMessageFactoryImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSMessageFactoryImpl.lo -MD -MP -MF $(DEPDIR)/XKMSMessageFactoryImpl.Tpo -c -o XKMSMessageFactoryImpl.lo `test -f 'xkms/impl/XKMSMessageFactoryImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSMessageFactoryImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSMessageFactoryImpl.Tpo $(DEPDIR)/XKMSMessageFactoryImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSMessageFactoryImpl.cpp' object='XKMSMessageFactoryImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSMessageFactoryImpl.lo `test -f 'xkms/impl/XKMSMessageFactoryImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSMessageFactoryImpl.cpp XKMSResponseMechanismImpl.lo: xkms/impl/XKMSResponseMechanismImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSResponseMechanismImpl.lo -MD -MP -MF $(DEPDIR)/XKMSResponseMechanismImpl.Tpo -c -o XKMSResponseMechanismImpl.lo `test -f 'xkms/impl/XKMSResponseMechanismImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResponseMechanismImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSResponseMechanismImpl.Tpo $(DEPDIR)/XKMSResponseMechanismImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSResponseMechanismImpl.cpp' object='XKMSResponseMechanismImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSResponseMechanismImpl.lo `test -f 'xkms/impl/XKMSResponseMechanismImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSResponseMechanismImpl.cpp XKMSNotBoundAuthentication.lo: xkms/impl/XKMSNotBoundAuthentication.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSNotBoundAuthentication.lo -MD -MP -MF $(DEPDIR)/XKMSNotBoundAuthentication.Tpo -c -o XKMSNotBoundAuthentication.lo `test -f 'xkms/impl/XKMSNotBoundAuthentication.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSNotBoundAuthentication.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSNotBoundAuthentication.Tpo $(DEPDIR)/XKMSNotBoundAuthentication.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSNotBoundAuthentication.cpp' object='XKMSNotBoundAuthentication.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSNotBoundAuthentication.lo `test -f 'xkms/impl/XKMSNotBoundAuthentication.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSNotBoundAuthentication.cpp XKMSLocateResultImpl.lo: xkms/impl/XKMSLocateResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSLocateResultImpl.lo -MD -MP -MF $(DEPDIR)/XKMSLocateResultImpl.Tpo -c -o XKMSLocateResultImpl.lo `test -f 'xkms/impl/XKMSLocateResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSLocateResultImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSLocateResultImpl.Tpo $(DEPDIR)/XKMSLocateResultImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSLocateResultImpl.cpp' object='XKMSLocateResultImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSLocateResultImpl.lo `test -f 'xkms/impl/XKMSLocateResultImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSLocateResultImpl.cpp XKMSQueryKeyBindingImpl.lo: xkms/impl/XKMSQueryKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSQueryKeyBindingImpl.lo -MD -MP -MF $(DEPDIR)/XKMSQueryKeyBindingImpl.Tpo -c -o XKMSQueryKeyBindingImpl.lo `test -f 'xkms/impl/XKMSQueryKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSQueryKeyBindingImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSQueryKeyBindingImpl.Tpo $(DEPDIR)/XKMSQueryKeyBindingImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSQueryKeyBindingImpl.cpp' object='XKMSQueryKeyBindingImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSQueryKeyBindingImpl.lo `test -f 'xkms/impl/XKMSQueryKeyBindingImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSQueryKeyBindingImpl.cpp XKMSUseKeyWithImpl.lo: xkms/impl/XKMSUseKeyWithImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XKMSUseKeyWithImpl.lo -MD -MP -MF $(DEPDIR)/XKMSUseKeyWithImpl.Tpo -c -o XKMSUseKeyWithImpl.lo `test -f 'xkms/impl/XKMSUseKeyWithImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSUseKeyWithImpl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XKMSUseKeyWithImpl.Tpo $(DEPDIR)/XKMSUseKeyWithImpl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='xkms/impl/XKMSUseKeyWithImpl.cpp' object='XKMSUseKeyWithImpl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XKMSUseKeyWithImpl.lo `test -f 'xkms/impl/XKMSUseKeyWithImpl.cpp' || echo '$(srcdir)/'`xkms/impl/XKMSUseKeyWithImpl.cpp OpenSSLCryptoHashHMAC.lo: enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoHashHMAC.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoHashHMAC.Tpo -c -o OpenSSLCryptoHashHMAC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoHashHMAC.Tpo $(DEPDIR)/OpenSSLCryptoHashHMAC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp' object='OpenSSLCryptoHashHMAC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoHashHMAC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp OpenSSLCryptoKeyRSA.lo: enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoKeyRSA.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoKeyRSA.Tpo -c -o OpenSSLCryptoKeyRSA.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoKeyRSA.Tpo $(DEPDIR)/OpenSSLCryptoKeyRSA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp' object='OpenSSLCryptoKeyRSA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoKeyRSA.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp OpenSSLCryptoHash.lo: enc/OpenSSL/OpenSSLCryptoHash.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoHash.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoHash.Tpo -c -o OpenSSLCryptoHash.lo `test -f 'enc/OpenSSL/OpenSSLCryptoHash.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoHash.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoHash.Tpo $(DEPDIR)/OpenSSLCryptoHash.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoHash.cpp' object='OpenSSLCryptoHash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoHash.lo `test -f 'enc/OpenSSL/OpenSSLCryptoHash.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoHash.cpp OpenSSLCryptoProvider.lo: enc/OpenSSL/OpenSSLCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoProvider.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoProvider.Tpo -c -o OpenSSLCryptoProvider.lo `test -f 'enc/OpenSSL/OpenSSLCryptoProvider.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoProvider.Tpo $(DEPDIR)/OpenSSLCryptoProvider.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoProvider.cpp' object='OpenSSLCryptoProvider.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoProvider.lo `test -f 'enc/OpenSSL/OpenSSLCryptoProvider.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoProvider.cpp OpenSSLCryptoX509.lo: enc/OpenSSL/OpenSSLCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoX509.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoX509.Tpo -c -o OpenSSLCryptoX509.lo `test -f 'enc/OpenSSL/OpenSSLCryptoX509.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoX509.Tpo $(DEPDIR)/OpenSSLCryptoX509.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoX509.cpp' object='OpenSSLCryptoX509.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoX509.lo `test -f 'enc/OpenSSL/OpenSSLCryptoX509.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoX509.cpp OpenSSLCryptoBase64.lo: enc/OpenSSL/OpenSSLCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoBase64.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoBase64.Tpo -c -o OpenSSLCryptoBase64.lo `test -f 'enc/OpenSSL/OpenSSLCryptoBase64.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoBase64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoBase64.Tpo $(DEPDIR)/OpenSSLCryptoBase64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoBase64.cpp' object='OpenSSLCryptoBase64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoBase64.lo `test -f 'enc/OpenSSL/OpenSSLCryptoBase64.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoBase64.cpp OpenSSLCryptoKeyDSA.lo: enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoKeyDSA.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoKeyDSA.Tpo -c -o OpenSSLCryptoKeyDSA.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoKeyDSA.Tpo $(DEPDIR)/OpenSSLCryptoKeyDSA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp' object='OpenSSLCryptoKeyDSA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoKeyDSA.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp OpenSSLCryptoKeyEC.lo: enc/OpenSSL/OpenSSLCryptoKeyEC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoKeyEC.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoKeyEC.Tpo -c -o OpenSSLCryptoKeyEC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyEC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyEC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoKeyEC.Tpo $(DEPDIR)/OpenSSLCryptoKeyEC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoKeyEC.cpp' object='OpenSSLCryptoKeyEC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoKeyEC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyEC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyEC.cpp OpenSSLCryptoSymmetricKey.lo: enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoSymmetricKey.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoSymmetricKey.Tpo -c -o OpenSSLCryptoSymmetricKey.lo `test -f 'enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoSymmetricKey.Tpo $(DEPDIR)/OpenSSLCryptoSymmetricKey.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp' object='OpenSSLCryptoSymmetricKey.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoSymmetricKey.lo `test -f 'enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp OpenSSLCryptoKeyHMAC.lo: enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OpenSSLCryptoKeyHMAC.lo -MD -MP -MF $(DEPDIR)/OpenSSLCryptoKeyHMAC.Tpo -c -o OpenSSLCryptoKeyHMAC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/OpenSSLCryptoKeyHMAC.Tpo $(DEPDIR)/OpenSSLCryptoKeyHMAC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp' object='OpenSSLCryptoKeyHMAC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OpenSSLCryptoKeyHMAC.lo `test -f 'enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp' || echo '$(srcdir)/'`enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp NSSCryptoX509.lo: enc/NSS/NSSCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoX509.lo -MD -MP -MF $(DEPDIR)/NSSCryptoX509.Tpo -c -o NSSCryptoX509.lo `test -f 'enc/NSS/NSSCryptoX509.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoX509.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoX509.Tpo $(DEPDIR)/NSSCryptoX509.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoX509.cpp' object='NSSCryptoX509.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoX509.lo `test -f 'enc/NSS/NSSCryptoX509.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoX509.cpp NSSCryptoHashHMAC.lo: enc/NSS/NSSCryptoHashHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoHashHMAC.lo -MD -MP -MF $(DEPDIR)/NSSCryptoHashHMAC.Tpo -c -o NSSCryptoHashHMAC.lo `test -f 'enc/NSS/NSSCryptoHashHMAC.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoHashHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoHashHMAC.Tpo $(DEPDIR)/NSSCryptoHashHMAC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoHashHMAC.cpp' object='NSSCryptoHashHMAC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoHashHMAC.lo `test -f 'enc/NSS/NSSCryptoHashHMAC.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoHashHMAC.cpp NSSCryptoHash.lo: enc/NSS/NSSCryptoHash.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoHash.lo -MD -MP -MF $(DEPDIR)/NSSCryptoHash.Tpo -c -o NSSCryptoHash.lo `test -f 'enc/NSS/NSSCryptoHash.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoHash.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoHash.Tpo $(DEPDIR)/NSSCryptoHash.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoHash.cpp' object='NSSCryptoHash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoHash.lo `test -f 'enc/NSS/NSSCryptoHash.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoHash.cpp NSSCryptoKeyDSA.lo: enc/NSS/NSSCryptoKeyDSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoKeyDSA.lo -MD -MP -MF $(DEPDIR)/NSSCryptoKeyDSA.Tpo -c -o NSSCryptoKeyDSA.lo `test -f 'enc/NSS/NSSCryptoKeyDSA.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyDSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoKeyDSA.Tpo $(DEPDIR)/NSSCryptoKeyDSA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoKeyDSA.cpp' object='NSSCryptoKeyDSA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoKeyDSA.lo `test -f 'enc/NSS/NSSCryptoKeyDSA.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyDSA.cpp NSSCryptoProvider.lo: enc/NSS/NSSCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoProvider.lo -MD -MP -MF $(DEPDIR)/NSSCryptoProvider.Tpo -c -o NSSCryptoProvider.lo `test -f 'enc/NSS/NSSCryptoProvider.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoProvider.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoProvider.Tpo $(DEPDIR)/NSSCryptoProvider.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoProvider.cpp' object='NSSCryptoProvider.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoProvider.lo `test -f 'enc/NSS/NSSCryptoProvider.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoProvider.cpp NSSCryptoSymmetricKey.lo: enc/NSS/NSSCryptoSymmetricKey.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoSymmetricKey.lo -MD -MP -MF $(DEPDIR)/NSSCryptoSymmetricKey.Tpo -c -o NSSCryptoSymmetricKey.lo `test -f 'enc/NSS/NSSCryptoSymmetricKey.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoSymmetricKey.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoSymmetricKey.Tpo $(DEPDIR)/NSSCryptoSymmetricKey.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoSymmetricKey.cpp' object='NSSCryptoSymmetricKey.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoSymmetricKey.lo `test -f 'enc/NSS/NSSCryptoSymmetricKey.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoSymmetricKey.cpp NSSCryptoKeyRSA.lo: enc/NSS/NSSCryptoKeyRSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoKeyRSA.lo -MD -MP -MF $(DEPDIR)/NSSCryptoKeyRSA.Tpo -c -o NSSCryptoKeyRSA.lo `test -f 'enc/NSS/NSSCryptoKeyRSA.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyRSA.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoKeyRSA.Tpo $(DEPDIR)/NSSCryptoKeyRSA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoKeyRSA.cpp' object='NSSCryptoKeyRSA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoKeyRSA.lo `test -f 'enc/NSS/NSSCryptoKeyRSA.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyRSA.cpp NSSCryptoKeyHMAC.lo: enc/NSS/NSSCryptoKeyHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NSSCryptoKeyHMAC.lo -MD -MP -MF $(DEPDIR)/NSSCryptoKeyHMAC.Tpo -c -o NSSCryptoKeyHMAC.lo `test -f 'enc/NSS/NSSCryptoKeyHMAC.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/NSSCryptoKeyHMAC.Tpo $(DEPDIR)/NSSCryptoKeyHMAC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enc/NSS/NSSCryptoKeyHMAC.cpp' object='NSSCryptoKeyHMAC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NSSCryptoKeyHMAC.lo `test -f 'enc/NSS/NSSCryptoKeyHMAC.cpp' || echo '$(srcdir)/'`enc/NSS/NSSCryptoKeyHMAC.cpp c14n.o: tools/c14n/c14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT c14n.o -MD -MP -MF $(DEPDIR)/c14n.Tpo -c -o c14n.o `test -f 'tools/c14n/c14n.cpp' || echo '$(srcdir)/'`tools/c14n/c14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c14n.Tpo $(DEPDIR)/c14n.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/c14n/c14n.cpp' object='c14n.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o c14n.o `test -f 'tools/c14n/c14n.cpp' || echo '$(srcdir)/'`tools/c14n/c14n.cpp c14n.obj: tools/c14n/c14n.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT c14n.obj -MD -MP -MF $(DEPDIR)/c14n.Tpo -c -o c14n.obj `if test -f 'tools/c14n/c14n.cpp'; then $(CYGPATH_W) 'tools/c14n/c14n.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/c14n/c14n.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c14n.Tpo $(DEPDIR)/c14n.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/c14n/c14n.cpp' object='c14n.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o c14n.obj `if test -f 'tools/c14n/c14n.cpp'; then $(CYGPATH_W) 'tools/c14n/c14n.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/c14n/c14n.cpp'; fi` checksig.o: tools/checksig/checksig.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT checksig.o -MD -MP -MF $(DEPDIR)/checksig.Tpo -c -o checksig.o `test -f 'tools/checksig/checksig.cpp' || echo '$(srcdir)/'`tools/checksig/checksig.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/checksig.Tpo $(DEPDIR)/checksig.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/checksig.cpp' object='checksig.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o checksig.o `test -f 'tools/checksig/checksig.cpp' || echo '$(srcdir)/'`tools/checksig/checksig.cpp checksig.obj: tools/checksig/checksig.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT checksig.obj -MD -MP -MF $(DEPDIR)/checksig.Tpo -c -o checksig.obj `if test -f 'tools/checksig/checksig.cpp'; then $(CYGPATH_W) 'tools/checksig/checksig.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/checksig.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/checksig.Tpo $(DEPDIR)/checksig.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/checksig.cpp' object='checksig.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o checksig.obj `if test -f 'tools/checksig/checksig.cpp'; then $(CYGPATH_W) 'tools/checksig/checksig.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/checksig.cpp'; fi` AnonymousResolver.o: tools/checksig/AnonymousResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AnonymousResolver.o -MD -MP -MF $(DEPDIR)/AnonymousResolver.Tpo -c -o AnonymousResolver.o `test -f 'tools/checksig/AnonymousResolver.cpp' || echo '$(srcdir)/'`tools/checksig/AnonymousResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/AnonymousResolver.Tpo $(DEPDIR)/AnonymousResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/AnonymousResolver.cpp' object='AnonymousResolver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AnonymousResolver.o `test -f 'tools/checksig/AnonymousResolver.cpp' || echo '$(srcdir)/'`tools/checksig/AnonymousResolver.cpp AnonymousResolver.obj: tools/checksig/AnonymousResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AnonymousResolver.obj -MD -MP -MF $(DEPDIR)/AnonymousResolver.Tpo -c -o AnonymousResolver.obj `if test -f 'tools/checksig/AnonymousResolver.cpp'; then $(CYGPATH_W) 'tools/checksig/AnonymousResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/AnonymousResolver.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/AnonymousResolver.Tpo $(DEPDIR)/AnonymousResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/AnonymousResolver.cpp' object='AnonymousResolver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AnonymousResolver.obj `if test -f 'tools/checksig/AnonymousResolver.cpp'; then $(CYGPATH_W) 'tools/checksig/AnonymousResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/AnonymousResolver.cpp'; fi` InteropResolver.o: tools/checksig/InteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InteropResolver.o -MD -MP -MF $(DEPDIR)/InteropResolver.Tpo -c -o InteropResolver.o `test -f 'tools/checksig/InteropResolver.cpp' || echo '$(srcdir)/'`tools/checksig/InteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/InteropResolver.Tpo $(DEPDIR)/InteropResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/InteropResolver.cpp' object='InteropResolver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InteropResolver.o `test -f 'tools/checksig/InteropResolver.cpp' || echo '$(srcdir)/'`tools/checksig/InteropResolver.cpp InteropResolver.obj: tools/checksig/InteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InteropResolver.obj -MD -MP -MF $(DEPDIR)/InteropResolver.Tpo -c -o InteropResolver.obj `if test -f 'tools/checksig/InteropResolver.cpp'; then $(CYGPATH_W) 'tools/checksig/InteropResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/InteropResolver.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/InteropResolver.Tpo $(DEPDIR)/InteropResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/checksig/InteropResolver.cpp' object='InteropResolver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InteropResolver.obj `if test -f 'tools/checksig/InteropResolver.cpp'; then $(CYGPATH_W) 'tools/checksig/InteropResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/checksig/InteropResolver.cpp'; fi` cipher.o: tools/cipher/cipher.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cipher.o -MD -MP -MF $(DEPDIR)/cipher.Tpo -c -o cipher.o `test -f 'tools/cipher/cipher.cpp' || echo '$(srcdir)/'`tools/cipher/cipher.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cipher.Tpo $(DEPDIR)/cipher.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/cipher/cipher.cpp' object='cipher.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cipher.o `test -f 'tools/cipher/cipher.cpp' || echo '$(srcdir)/'`tools/cipher/cipher.cpp cipher.obj: tools/cipher/cipher.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cipher.obj -MD -MP -MF $(DEPDIR)/cipher.Tpo -c -o cipher.obj `if test -f 'tools/cipher/cipher.cpp'; then $(CYGPATH_W) 'tools/cipher/cipher.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/cipher/cipher.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cipher.Tpo $(DEPDIR)/cipher.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/cipher/cipher.cpp' object='cipher.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cipher.obj `if test -f 'tools/cipher/cipher.cpp'; then $(CYGPATH_W) 'tools/cipher/cipher.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/cipher/cipher.cpp'; fi` XencInteropResolver.o: tools/cipher/XencInteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XencInteropResolver.o -MD -MP -MF $(DEPDIR)/XencInteropResolver.Tpo -c -o XencInteropResolver.o `test -f 'tools/cipher/XencInteropResolver.cpp' || echo '$(srcdir)/'`tools/cipher/XencInteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XencInteropResolver.Tpo $(DEPDIR)/XencInteropResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/cipher/XencInteropResolver.cpp' object='XencInteropResolver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XencInteropResolver.o `test -f 'tools/cipher/XencInteropResolver.cpp' || echo '$(srcdir)/'`tools/cipher/XencInteropResolver.cpp XencInteropResolver.obj: tools/cipher/XencInteropResolver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XencInteropResolver.obj -MD -MP -MF $(DEPDIR)/XencInteropResolver.Tpo -c -o XencInteropResolver.obj `if test -f 'tools/cipher/XencInteropResolver.cpp'; then $(CYGPATH_W) 'tools/cipher/XencInteropResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/cipher/XencInteropResolver.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/XencInteropResolver.Tpo $(DEPDIR)/XencInteropResolver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/cipher/XencInteropResolver.cpp' object='XencInteropResolver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XencInteropResolver.obj `if test -f 'tools/cipher/XencInteropResolver.cpp'; then $(CYGPATH_W) 'tools/cipher/XencInteropResolver.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/cipher/XencInteropResolver.cpp'; fi` siginf.o: tools/siginf/siginf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT siginf.o -MD -MP -MF $(DEPDIR)/siginf.Tpo -c -o siginf.o `test -f 'tools/siginf/siginf.cpp' || echo '$(srcdir)/'`tools/siginf/siginf.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/siginf.Tpo $(DEPDIR)/siginf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/siginf/siginf.cpp' object='siginf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o siginf.o `test -f 'tools/siginf/siginf.cpp' || echo '$(srcdir)/'`tools/siginf/siginf.cpp siginf.obj: tools/siginf/siginf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT siginf.obj -MD -MP -MF $(DEPDIR)/siginf.Tpo -c -o siginf.obj `if test -f 'tools/siginf/siginf.cpp'; then $(CYGPATH_W) 'tools/siginf/siginf.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/siginf/siginf.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/siginf.Tpo $(DEPDIR)/siginf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/siginf/siginf.cpp' object='siginf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o siginf.obj `if test -f 'tools/siginf/siginf.cpp'; then $(CYGPATH_W) 'tools/siginf/siginf.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/siginf/siginf.cpp'; fi` simpleDecrypt.o: samples/simpleDecrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleDecrypt.o -MD -MP -MF $(DEPDIR)/simpleDecrypt.Tpo -c -o simpleDecrypt.o `test -f 'samples/simpleDecrypt.cpp' || echo '$(srcdir)/'`samples/simpleDecrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleDecrypt.Tpo $(DEPDIR)/simpleDecrypt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleDecrypt.cpp' object='simpleDecrypt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleDecrypt.o `test -f 'samples/simpleDecrypt.cpp' || echo '$(srcdir)/'`samples/simpleDecrypt.cpp simpleDecrypt.obj: samples/simpleDecrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleDecrypt.obj -MD -MP -MF $(DEPDIR)/simpleDecrypt.Tpo -c -o simpleDecrypt.obj `if test -f 'samples/simpleDecrypt.cpp'; then $(CYGPATH_W) 'samples/simpleDecrypt.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleDecrypt.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleDecrypt.Tpo $(DEPDIR)/simpleDecrypt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleDecrypt.cpp' object='simpleDecrypt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleDecrypt.obj `if test -f 'samples/simpleDecrypt.cpp'; then $(CYGPATH_W) 'samples/simpleDecrypt.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleDecrypt.cpp'; fi` IOStreamOutputter.o: samples/IOStreamOutputter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT IOStreamOutputter.o -MD -MP -MF $(DEPDIR)/IOStreamOutputter.Tpo -c -o IOStreamOutputter.o `test -f 'samples/IOStreamOutputter.cpp' || echo '$(srcdir)/'`samples/IOStreamOutputter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/IOStreamOutputter.Tpo $(DEPDIR)/IOStreamOutputter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/IOStreamOutputter.cpp' object='IOStreamOutputter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o IOStreamOutputter.o `test -f 'samples/IOStreamOutputter.cpp' || echo '$(srcdir)/'`samples/IOStreamOutputter.cpp IOStreamOutputter.obj: samples/IOStreamOutputter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT IOStreamOutputter.obj -MD -MP -MF $(DEPDIR)/IOStreamOutputter.Tpo -c -o IOStreamOutputter.obj `if test -f 'samples/IOStreamOutputter.cpp'; then $(CYGPATH_W) 'samples/IOStreamOutputter.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/IOStreamOutputter.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/IOStreamOutputter.Tpo $(DEPDIR)/IOStreamOutputter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/IOStreamOutputter.cpp' object='IOStreamOutputter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o IOStreamOutputter.obj `if test -f 'samples/IOStreamOutputter.cpp'; then $(CYGPATH_W) 'samples/IOStreamOutputter.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/IOStreamOutputter.cpp'; fi` simpleEncrypt.o: samples/simpleEncrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleEncrypt.o -MD -MP -MF $(DEPDIR)/simpleEncrypt.Tpo -c -o simpleEncrypt.o `test -f 'samples/simpleEncrypt.cpp' || echo '$(srcdir)/'`samples/simpleEncrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleEncrypt.Tpo $(DEPDIR)/simpleEncrypt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleEncrypt.cpp' object='simpleEncrypt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleEncrypt.o `test -f 'samples/simpleEncrypt.cpp' || echo '$(srcdir)/'`samples/simpleEncrypt.cpp simpleEncrypt.obj: samples/simpleEncrypt.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleEncrypt.obj -MD -MP -MF $(DEPDIR)/simpleEncrypt.Tpo -c -o simpleEncrypt.obj `if test -f 'samples/simpleEncrypt.cpp'; then $(CYGPATH_W) 'samples/simpleEncrypt.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleEncrypt.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleEncrypt.Tpo $(DEPDIR)/simpleEncrypt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleEncrypt.cpp' object='simpleEncrypt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleEncrypt.obj `if test -f 'samples/simpleEncrypt.cpp'; then $(CYGPATH_W) 'samples/simpleEncrypt.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleEncrypt.cpp'; fi` simpleHMAC.o: samples/simpleHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleHMAC.o -MD -MP -MF $(DEPDIR)/simpleHMAC.Tpo -c -o simpleHMAC.o `test -f 'samples/simpleHMAC.cpp' || echo '$(srcdir)/'`samples/simpleHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleHMAC.Tpo $(DEPDIR)/simpleHMAC.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleHMAC.cpp' object='simpleHMAC.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleHMAC.o `test -f 'samples/simpleHMAC.cpp' || echo '$(srcdir)/'`samples/simpleHMAC.cpp simpleHMAC.obj: samples/simpleHMAC.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleHMAC.obj -MD -MP -MF $(DEPDIR)/simpleHMAC.Tpo -c -o simpleHMAC.obj `if test -f 'samples/simpleHMAC.cpp'; then $(CYGPATH_W) 'samples/simpleHMAC.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleHMAC.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleHMAC.Tpo $(DEPDIR)/simpleHMAC.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleHMAC.cpp' object='simpleHMAC.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleHMAC.obj `if test -f 'samples/simpleHMAC.cpp'; then $(CYGPATH_W) 'samples/simpleHMAC.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleHMAC.cpp'; fi` simpleValidate.o: samples/simpleValidate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleValidate.o -MD -MP -MF $(DEPDIR)/simpleValidate.Tpo -c -o simpleValidate.o `test -f 'samples/simpleValidate.cpp' || echo '$(srcdir)/'`samples/simpleValidate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleValidate.Tpo $(DEPDIR)/simpleValidate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleValidate.cpp' object='simpleValidate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleValidate.o `test -f 'samples/simpleValidate.cpp' || echo '$(srcdir)/'`samples/simpleValidate.cpp simpleValidate.obj: samples/simpleValidate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpleValidate.obj -MD -MP -MF $(DEPDIR)/simpleValidate.Tpo -c -o simpleValidate.obj `if test -f 'samples/simpleValidate.cpp'; then $(CYGPATH_W) 'samples/simpleValidate.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleValidate.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/simpleValidate.Tpo $(DEPDIR)/simpleValidate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='samples/simpleValidate.cpp' object='simpleValidate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpleValidate.obj `if test -f 'samples/simpleValidate.cpp'; then $(CYGPATH_W) 'samples/simpleValidate.cpp'; else $(CYGPATH_W) '$(srcdir)/samples/simpleValidate.cpp'; fi` templatesign.o: tools/templatesign/templatesign.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT templatesign.o -MD -MP -MF $(DEPDIR)/templatesign.Tpo -c -o templatesign.o `test -f 'tools/templatesign/templatesign.cpp' || echo '$(srcdir)/'`tools/templatesign/templatesign.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/templatesign.Tpo $(DEPDIR)/templatesign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/templatesign/templatesign.cpp' object='templatesign.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o templatesign.o `test -f 'tools/templatesign/templatesign.cpp' || echo '$(srcdir)/'`tools/templatesign/templatesign.cpp templatesign.obj: tools/templatesign/templatesign.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT templatesign.obj -MD -MP -MF $(DEPDIR)/templatesign.Tpo -c -o templatesign.obj `if test -f 'tools/templatesign/templatesign.cpp'; then $(CYGPATH_W) 'tools/templatesign/templatesign.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/templatesign/templatesign.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/templatesign.Tpo $(DEPDIR)/templatesign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/templatesign/templatesign.cpp' object='templatesign.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o templatesign.obj `if test -f 'tools/templatesign/templatesign.cpp'; then $(CYGPATH_W) 'tools/templatesign/templatesign.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/templatesign/templatesign.cpp'; fi` txfmout.o: tools/txfmout/txfmout.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT txfmout.o -MD -MP -MF $(DEPDIR)/txfmout.Tpo -c -o txfmout.o `test -f 'tools/txfmout/txfmout.cpp' || echo '$(srcdir)/'`tools/txfmout/txfmout.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/txfmout.Tpo $(DEPDIR)/txfmout.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/txfmout/txfmout.cpp' object='txfmout.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o txfmout.o `test -f 'tools/txfmout/txfmout.cpp' || echo '$(srcdir)/'`tools/txfmout/txfmout.cpp txfmout.obj: tools/txfmout/txfmout.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT txfmout.obj -MD -MP -MF $(DEPDIR)/txfmout.Tpo -c -o txfmout.obj `if test -f 'tools/txfmout/txfmout.cpp'; then $(CYGPATH_W) 'tools/txfmout/txfmout.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/txfmout/txfmout.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/txfmout.Tpo $(DEPDIR)/txfmout.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/txfmout/txfmout.cpp' object='txfmout.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o txfmout.obj `if test -f 'tools/txfmout/txfmout.cpp'; then $(CYGPATH_W) 'tools/txfmout/txfmout.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/txfmout/txfmout.cpp'; fi` xklient.o: tools/xklient/xklient.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xklient.o -MD -MP -MF $(DEPDIR)/xklient.Tpo -c -o xklient.o `test -f 'tools/xklient/xklient.cpp' || echo '$(srcdir)/'`tools/xklient/xklient.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xklient.Tpo $(DEPDIR)/xklient.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/xklient/xklient.cpp' object='xklient.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xklient.o `test -f 'tools/xklient/xklient.cpp' || echo '$(srcdir)/'`tools/xklient/xklient.cpp xklient.obj: tools/xklient/xklient.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xklient.obj -MD -MP -MF $(DEPDIR)/xklient.Tpo -c -o xklient.obj `if test -f 'tools/xklient/xklient.cpp'; then $(CYGPATH_W) 'tools/xklient/xklient.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/xklient/xklient.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xklient.Tpo $(DEPDIR)/xklient.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/xklient/xklient.cpp' object='xklient.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xklient.obj `if test -f 'tools/xklient/xklient.cpp'; then $(CYGPATH_W) 'tools/xklient/xklient.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/xklient/xklient.cpp'; fi` xtest.o: tools/xtest/xtest.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xtest.o -MD -MP -MF $(DEPDIR)/xtest.Tpo -c -o xtest.o `test -f 'tools/xtest/xtest.cpp' || echo '$(srcdir)/'`tools/xtest/xtest.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xtest.Tpo $(DEPDIR)/xtest.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/xtest/xtest.cpp' object='xtest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xtest.o `test -f 'tools/xtest/xtest.cpp' || echo '$(srcdir)/'`tools/xtest/xtest.cpp xtest.obj: tools/xtest/xtest.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xtest.obj -MD -MP -MF $(DEPDIR)/xtest.Tpo -c -o xtest.obj `if test -f 'tools/xtest/xtest.cpp'; then $(CYGPATH_W) 'tools/xtest/xtest.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/xtest/xtest.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xtest.Tpo $(DEPDIR)/xtest.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tools/xtest/xtest.cpp' object='xtest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xtest.obj `if test -f 'tools/xtest/xtest.cpp'; then $(CYGPATH_W) 'tools/xtest/xtest.cpp'; else $(CYGPATH_W) '$(srcdir)/tools/xtest/xtest.cpp'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-canonincludeHEADERS: $(canoninclude_HEADERS) @$(NORMAL_INSTALL) @list='$(canoninclude_HEADERS)'; test -n "$(canonincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(canonincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(canonincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(canonincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(canonincludedir)" || exit $$?; \ done uninstall-canonincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(canoninclude_HEADERS)'; test -n "$(canonincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(canonincludedir)'; $(am__uninstall_files_from_dir) install-dsigincludeHEADERS: $(dsiginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(dsiginclude_HEADERS)'; test -n "$(dsigincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dsigincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dsigincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dsigincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(dsigincludedir)" || exit $$?; \ done uninstall-dsigincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(dsiginclude_HEADERS)'; test -n "$(dsigincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(dsigincludedir)'; $(am__uninstall_files_from_dir) install-encincludeHEADERS: $(encinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(encinclude_HEADERS)'; test -n "$(encincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(encincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(encincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(encincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(encincludedir)" || exit $$?; \ done uninstall-encincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(encinclude_HEADERS)'; test -n "$(encincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(encincludedir)'; $(am__uninstall_files_from_dir) install-frameworkincludeHEADERS: $(frameworkinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(frameworkinclude_HEADERS)'; test -n "$(frameworkincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(frameworkincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(frameworkincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(frameworkincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(frameworkincludedir)" || exit $$?; \ done uninstall-frameworkincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(frameworkinclude_HEADERS)'; test -n "$(frameworkincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(frameworkincludedir)'; $(am__uninstall_files_from_dir) install-nssincludeHEADERS: $(nssinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(nssinclude_HEADERS)'; test -n "$(nssincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(nssincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(nssincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(nssincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(nssincludedir)" || exit $$?; \ done uninstall-nssincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nssinclude_HEADERS)'; test -n "$(nssincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(nssincludedir)'; $(am__uninstall_files_from_dir) install-opensslincludeHEADERS: $(opensslinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(opensslinclude_HEADERS)'; test -n "$(opensslincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(opensslincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(opensslincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(opensslincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(opensslincludedir)" || exit $$?; \ done uninstall-opensslincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(opensslinclude_HEADERS)'; test -n "$(opensslincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(opensslincludedir)'; $(am__uninstall_files_from_dir) install-transformersincludeHEADERS: $(transformersinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(transformersinclude_HEADERS)'; test -n "$(transformersincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(transformersincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(transformersincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(transformersincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(transformersincludedir)" || exit $$?; \ done uninstall-transformersincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(transformersinclude_HEADERS)'; test -n "$(transformersincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(transformersincludedir)'; $(am__uninstall_files_from_dir) install-unixutilsincludeHEADERS: $(unixutilsinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(unixutilsinclude_HEADERS)'; test -n "$(unixutilsincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(unixutilsincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(unixutilsincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(unixutilsincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(unixutilsincludedir)" || exit $$?; \ done uninstall-unixutilsincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(unixutilsinclude_HEADERS)'; test -n "$(unixutilsincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(unixutilsincludedir)'; $(am__uninstall_files_from_dir) install-utilsincludeHEADERS: $(utilsinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(utilsinclude_HEADERS)'; test -n "$(utilsincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(utilsincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(utilsincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(utilsincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(utilsincludedir)" || exit $$?; \ done uninstall-utilsincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(utilsinclude_HEADERS)'; test -n "$(utilsincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(utilsincludedir)'; $(am__uninstall_files_from_dir) install-xencincludeHEADERS: $(xencinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(xencinclude_HEADERS)'; test -n "$(xencincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xencincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xencincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xencincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(xencincludedir)" || exit $$?; \ done uninstall-xencincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(xencinclude_HEADERS)'; test -n "$(xencincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xencincludedir)'; $(am__uninstall_files_from_dir) install-xkmsincludeHEADERS: $(xkmsinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(xkmsinclude_HEADERS)'; test -n "$(xkmsincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xkmsincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xkmsincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xkmsincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(xkmsincludedir)" || exit $$?; \ done uninstall-xkmsincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(xkmsinclude_HEADERS)'; test -n "$(xkmsincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xkmsincludedir)'; $(am__uninstall_files_from_dir) install-xscryptincludeHEADERS: $(xscryptinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(xscryptinclude_HEADERS)'; test -n "$(xscryptincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xscryptincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xscryptincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xscryptincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(xscryptincludedir)" || exit $$?; \ done uninstall-xscryptincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(xscryptinclude_HEADERS)'; test -n "$(xscryptincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xscryptincludedir)'; $(am__uninstall_files_from_dir) 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 $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(canonincludedir)" "$(DESTDIR)$(dsigincludedir)" "$(DESTDIR)$(encincludedir)" "$(DESTDIR)$(frameworkincludedir)" "$(DESTDIR)$(nssincludedir)" "$(DESTDIR)$(opensslincludedir)" "$(DESTDIR)$(transformersincludedir)" "$(DESTDIR)$(unixutilsincludedir)" "$(DESTDIR)$(utilsincludedir)" "$(DESTDIR)$(xencincludedir)" "$(DESTDIR)$(xkmsincludedir)" "$(DESTDIR)$(xscryptincludedir)"; 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-libLTLIBRARIES \ clean-libtool clean-noinstPROGRAMS 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-canonincludeHEADERS \ install-dsigincludeHEADERS install-encincludeHEADERS \ install-frameworkincludeHEADERS install-nssincludeHEADERS \ install-opensslincludeHEADERS \ install-transformersincludeHEADERS \ install-unixutilsincludeHEADERS install-utilsincludeHEADERS \ install-xencincludeHEADERS install-xkmsincludeHEADERS \ install-xscryptincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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 uninstall-canonincludeHEADERS \ uninstall-dsigincludeHEADERS uninstall-encincludeHEADERS \ uninstall-frameworkincludeHEADERS uninstall-libLTLIBRARIES \ uninstall-nssincludeHEADERS uninstall-opensslincludeHEADERS \ uninstall-transformersincludeHEADERS \ uninstall-unixutilsincludeHEADERS \ uninstall-utilsincludeHEADERS uninstall-xencincludeHEADERS \ uninstall-xkmsincludeHEADERS uninstall-xscryptincludeHEADERS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-noinstPROGRAMS 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-canonincludeHEADERS install-data install-data-am \ install-dsigincludeHEADERS install-dvi install-dvi-am \ install-encincludeHEADERS install-exec install-exec-am \ install-exec-hook install-frameworkincludeHEADERS install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-nssincludeHEADERS \ install-opensslincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip \ install-transformersincludeHEADERS \ install-unixutilsincludeHEADERS install-utilsincludeHEADERS \ install-xencincludeHEADERS install-xkmsincludeHEADERS \ install-xscryptincludeHEADERS 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 \ uninstall-canonincludeHEADERS uninstall-dsigincludeHEADERS \ uninstall-encincludeHEADERS uninstall-frameworkincludeHEADERS \ uninstall-libLTLIBRARIES uninstall-nssincludeHEADERS \ uninstall-opensslincludeHEADERS \ uninstall-transformersincludeHEADERS \ uninstall-unixutilsincludeHEADERS \ uninstall-utilsincludeHEADERS uninstall-xencincludeHEADERS \ uninstall-xkmsincludeHEADERS uninstall-xscryptincludeHEADERS .PRECIOUS: Makefile install-exec-hook: for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done # 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: xml-security-c-1.7.3/xsec/xkms/impl/000755 001751 001751 00000000000 12477614644 020501 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/xkms/XKMSNotBoundAuthentication.hpp000644 001751 001751 00000006161 12003301053 025354 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSNotBoundAuthentication := Interface for ValidityInterval elements * * $Id: XKMSNotBoundAuthentication.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSNOTBOUNDAUTHENTICATION_INCLUDE #define XKMSNOTBOUNDAUTHENTICATION_INCLUDE // XSEC Includes #include /** * @ingroup xkms */ /** * @brief Interface definition for the NotBoundAuthentication elements * * The \ Element used within an \ * element to pass a pass phrase of some kind that authenticates the X-KRSS * request. * * The schema definition for NotBoundAuthentication is as follows : * * \verbatim \endverbatim */ class XKMSNotBoundAuthentication { /** @name Constructors and Destructors */ //@{ protected: XKMSNotBoundAuthentication() {}; public: virtual ~XKMSNotBoundAuthentication() {}; //@} /** @name Get Methods */ //@{ /** * \brief Get the protocol URI * * A \ has a protocol attribute defining the * protocol being used to authenticate the request. * * @return The string holding the URI of the protocol */ virtual const XMLCh * getProtocol(void) const = 0; /** * \brief Get the value * * Returns the authentication value. * * @return A string holding the base64 encoded authentication value */ virtual const XMLCh * getValue(void) const = 0; //@} /** @name Set Methods */ //@{ /** * \brief Set the protocol * * @param uri String containing the URI to set as the protocol */ virtual void setProtocol(const XMLCh * uri) = 0; /** * \brief Set the authentication value * * @param value Base64 encoded value to set as the authentication value */ virtual void setValue(const XMLCh * value) = 0; //@} private: // Unimplemented XKMSNotBoundAuthentication(const XKMSNotBoundAuthentication &); XKMSNotBoundAuthentication & operator = (const XKMSNotBoundAuthentication &); }; #endif /* XKMSNOTBOUNDAUTHENTICATION_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSValidateResult.hpp000644 001751 001751 00000006721 12003301053 023656 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateResult := Interface for ValidateResult Messages * * $Id: XKMSValidateResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDATERESULT_INCLUDE #define XKMSVALIDATERESULT_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBinding; class XKMSUnverifiedKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the ValidateResult elements * * The \ is one of the fundamental message types of * the XKISS service. It is used by the Validate service to return a key * and the bindings for that key. * * The schema definition for ValidateResult is as follows : * * \verbatim \endverbatim */ class XKMSValidateResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSValidateResult() {}; public: virtual ~XKMSValidateResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name KeyBinding handling */ //@{ /** * \brief Find number of KeyBinding elements * * @returns the number of KeyBinding items within the ValidateResult */ virtual int getKeyBindingSize(void) const = 0; /* * \brief Obtain an KeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the KeyBinding referenced by "item" */ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0; /* * \brief Append a new KeyBinding element * * Allows callers to append a new KeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @param status The status (Valid, Invalid or Indeterminate) of this * key * @returns the newly created KeyBinding object (already inserted * in the ValidateResult */ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0; //@} private: // Unimplemented XKMSValidateResult(const XKMSValidateResult &); XKMSValidateResult & operator = (const XKMSValidateResult &); }; #endif /* XKMSVALIDATERESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSValidityInterval.hpp000644 001751 001751 00000006327 12003301053 024222 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidityInterval := Interface for ValidityInterval elements * * $Id: XKMSValidityInterval.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDITYINTERVAL_INCLUDE #define XKMSVALIDITYINTERVAL_INCLUDE // XSEC Includes #include /** * @ingroup xkms */ /** * @brief Interface definition for the ValidityInterval elements * * The \ Element is used to define the dates within which * a key is valid. * * The schema definition for ValidityInterval is as follows : * * \verbatim \endverbatim */ class XKMSValidityInterval { /** @name Constructors and Destructors */ //@{ protected: XKMSValidityInterval() {}; public: virtual ~XKMSValidityInterval() {}; //@} /** @name Get Methods */ //@{ /** * \brief Get the start date for the key * * Defines the first instance in time from which the key is valid. At any time * before this, the key is invalid. * * @return The NotBefore value (or NULL if none was defined) */ virtual const XMLCh * getNotBefore(void) const = 0; /** * \brief Get the end date for the key * * Defines the first instance in time from which the key is invalid. At this time * or after, the key is invalid. * * @return The NotOnOrAfter value (or NULL if none was defined) */ virtual const XMLCh * getNotOnOrAfter(void) const = 0; //@} /** @name Set Methods */ //@{ /** * \brief Set the start date for the key * * Defines the first instance in time from which the key is valid. At any time * before this, the key is invalid. * * @param val value to set */ virtual void setNotBefore(const XMLCh * val) = 0; /** * \brief Set the end date for the key * * Defines the first instance in time from which the key is invalid. At this time * or after, the key is invalid. * * @param val value to set */ virtual void setNotOnOrAfter(const XMLCh * val) = 0; //@} private: // Unimplemented XKMSValidityInterval(const XKMSValidityInterval &); XKMSValidityInterval & operator = (const XKMSValidityInterval &); }; #endif /* XKMSVALIDITYINTERVAL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSStatusRequest.hpp000644 001751 001751 00000006163 12003301053 023562 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusRequest := Interface for StatusRequest Messages * * $Id: XKMSStatusRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUSREQUEST_INCLUDE #define XKMSSTATUSREQUEST_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the StatusRequest elements * * The \ is used in Asynchronous processing. A client * uses the StatusRequest element to request a determine whether a * request for which the original response was "Pending" is now ready. * * The schema definition for StatusRequest is as follows : * * \verbatim \endverbatim */ class XKMSStatusRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSStatusRequest() {}; public: virtual ~XKMSStatusRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Return the ResponseId * * The ResponseId equates to the Id of the first response the service returned, * which must (by definition) have had a response code of "Pending". Together * with the OriginalRequestId, this can be used by the service to uniquley * identify the original request for which this StatusRequest refers. * * @return A pointer to the XMLCh string holding the ResponseId */ virtual const XMLCh * getResponseId(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** * \brief Set the ResponseId * * Allows a calling application to over-ride the configured responseId * * @param responseId The new responseId for this element */ virtual void setResponseId(const XMLCh * responseId) = 0; //@} private: // Unimplemented XKMSStatusRequest(const XKMSStatusRequest &); XKMSStatusRequest & operator = (const XKMSStatusRequest &); }; #endif /* XKMSSTATUSREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRegisterRequest.hpp000644 001751 001751 00000012345 12003301053 024062 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterRequest := Interface for RegisterRequest Messages * * $Id: XKMSRegisterRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREGISTERREQUEST_INCLUDE #define XKMSREGISTERREQUEST_INCLUDE // XSEC Includes #include #include class DSIGSignature; class XKMSAuthentication; class XKMSPrototypeKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the RegisterRequest elements * * The \ is one of the fundamental message types of * the X-KRMS service. It is used by a client wishing to register a * key with a service. * * The schema definition for RegisterRequest is as follows : * * \verbatim \endverbatim */ class XKMSRegisterRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRegisterRequest() {}; public: virtual ~XKMSRegisterRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the PrototypKeyBinding element * * The PrototypeKeyBinding element is the core of the RegisterRequest message, and * defines the key information that will be sent to the server for registration. * * @returns A pointer to the XKMSPrototypeKeyBinding element */ virtual XKMSPrototypeKeyBinding * getPrototypeKeyBinding(void) const = 0; /** * \brief Get the Authentication element * * The Authentication element of the RegisterRequest is used by the client to * authenticate the request to the server. * * @return A pointer to the Authentication structure */ virtual XKMSAuthentication * getAuthentication (void) const = 0; /** * \brief Get the signature used to prove possession of the private key * * When the client presents a request for a key generated by them, this element * is used to show that the client is authorised to make this request using this * key. * * @return A pointer to the proof of possession Signature object (or NULL if none * was defined */ virtual DSIGSignature * getProofOfPossessionSignature(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a PrototypeKeyBinding element * * Set a PrototypeKeyBinding element in the Request message. The returned * object can be manipulated to add KeyInfo elements to the Request. * * @returns A pointer to the newly created PrototypeKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSPrototypeKeyBinding * addPrototypeKeyBinding(void) = 0; /** \brief Add an Authentication element * * Set a Authentication element in the Request message. The returned * object can be manipulated to add Authentication information to the request. * * @returns A pointer to the newly created Authenticaton object, or * the pointer to extant object if one already existed. */ virtual XKMSAuthentication * addAuthentication(void) = 0; /** * \brief Add a ProofOfPossession signature to the message * * Allows the application to add a new ProofOfPossession signature into a * RegisterRequest element * * @note the client application will need to set the key and sign the * message - however the appropriate reference (to the PrototypeKeyBinding * element) will be set. This implies that the PrototypeKeyBinding *must* * be added prior to the call to this method. * * @returns the new Signature structure */ virtual DSIGSignature * addProofOfPossessionSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1) = 0; //@} private: // Unimplemented XKMSRegisterRequest(const XKMSRegisterRequest &); XKMSRegisterRequest & operator = (const XKMSRegisterRequest &); }; #endif /* XKMSREGISTERREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSPendingRequest.hpp000644 001751 001751 00000006445 12003301053 023666 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPendingRequest := Interface for PendingRequest Messages * * $Id: XKMSPendingRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSPENDINGREQUEST_INCLUDE #define XKMSPENDINGREQUEST_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the PendingRequest elements * * The \ is used in Asynchronous processing. A client * uses the PendingRequest element to request a response to a request that * was placed in the past, and to which the service originally provided * a "Pending" response - i.e. work yet to be done. * * The schema definition for PendingRequest is as follows : * * \verbatim \endverbatim */ class XKMSPendingRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSPendingRequest() {}; public: virtual ~XKMSPendingRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Return the ResponseId * * The ResponseId equates to the Id of the first response the service returned, * which must (by definition) have had a response code of "Pending". Together * with the OriginalRequestId, this can be used by the service to uniquley * identify the original request for which this PendingRequest refers. * * @return A pointer to the XMLCh string holding the ResponseId */ virtual const XMLCh * getResponseId(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** * \brief Set the ResponseId * * Allows a calling application to over-ride the configured responseId * * @param responseId The new responseId for this element */ virtual void setResponseId(const XMLCh * responseId) = 0; //@} private: // Unimplemented XKMSPendingRequest(const XKMSPendingRequest &); XKMSPendingRequest & operator = (const XKMSPendingRequest &); }; #endif /* XKMSPENDINGREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSCompoundRequest.hpp000644 001751 001751 00000014227 12003301053 024063 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundRequest := Interface for CompoundRequest Messages * * $Id: XKMSCompoundRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSCOMPOUNDREQUEST_INCLUDE #define XKMSCOMPOUNDREQUEST_INCLUDE // XSEC Includes #include #include class XKMSLocateRequest; class XKMSValidateRequest; class XKMSRegisterRequest; class XKMSRevokeRequest; class XKMSReissueRequest; class XKMSRecoverRequest; /** * @ingroup xkms */ /** * @brief Interface definition for the CompoundRequest elements * * The \ is used to merge a number of separate requests * into a single message. It is a very simple type - simply a holding * Request that has all the sub-requests held within it. * * The schema definition for CompoundRequest is as follows : * * \verbatim \endverbatim */ class XKMSCompoundRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSCompoundRequest() {}; public: virtual ~XKMSCompoundRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the number of requests within the compound request * * This class holds a list of requests that can be accessed using the * getRequestListItem method. This method allows an application to determine * how many request items there are. * * @returns The size of the request list */ virtual int getRequestListSize(void) = 0; /** * \brief Obtain a request item * * Obtain a particular request from the list of requests held in this * compound object * * @returns The nominated item */ virtual XKMSRequestAbstractType * getRequestListItem(int item) = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a LocateRequest item * * Appends a LocateRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSLocateRequest structure */ virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; /** \brief Add a ValidateRequest item * * Appends a ValidateRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSValidateRequest structure */ virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; /** \brief Add a RegisterRequest item * * Appends a RegisterRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSValidateRequest structure */ virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; /** \brief Add a RevokeRequest item * * Appends a RevokeRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRevokeRequest structure */ virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; /** \brief Add a RecoverRequest item * * Appends a RecoverRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRecoverRequest structure */ virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; /** \brief Add a ReissueRequest item * * Appends a ReissueRequest to the CompoundRequest object and returns the newly * created object * * @param service URI * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSReissueRequest structure */ virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, const XMLCh * id = NULL) = 0; //@} private: // Unimplemented XKMSCompoundRequest(const XKMSCompoundRequest &); XKMSCompoundRequest & operator = (const XKMSCompoundRequest &); }; #endif /* XKMSCOMPOUNDREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSUseKeyWith.hpp000644 001751 001751 00000005742 12003301053 022771 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUseKeyWith := Interface for UseKeyWith Messages * * $Id: XKMSUseKeyWith.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSUSEKEYWITH_INCLUDE #define XKMSUSEKEYWITH_INCLUDE // XSEC Includes #include /** * @ingroup xkms */ /** * @brief Interface definition UseKeyWith elements * * \ elements are played insied KeyBinding elements and identify * applications and application identifiers that correspond with the keys being * found. * * The schema definition for UseKeyWith is as follows : * * \verbatim \endverbatim */ class XKMSUseKeyWith { /** @name Constructors and Destructors */ //@{ protected: XKMSUseKeyWith() {}; public: virtual ~XKMSUseKeyWith() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the URI associated with the application for which this * identifier applies * * @returns a library owned XMLCh string containing the URI */ virtual const XMLCh * getApplication(void) const = 0; /** * \brief Obtain the identifier string that should be used to locate a key * * @returns a library owned XMLCh string containing the URI */ virtual const XMLCh * getIdentifier(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** * \brief Set the Application string * * param uri URI String identifying the application */ virtual void setApplication(const XMLCh * uri) = 0; /** * \brief Set the Identifier string * * param identifier String identifying the key */ virtual void setIdentifier(const XMLCh * identifier) = 0; //@} private: // Unimplemented XKMSUseKeyWith(const XKMSUseKeyWith &); XKMSUseKeyWith & operator = (const XKMSUseKeyWith &); }; #endif /* XKMSUSEKEYWITH_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSValidateRequest.hpp000644 001751 001751 00000006433 12003301053 024030 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateRequest := Interface for ValidateRequest Messages * * $Id: XKMSValidateRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDATEREQUETS_INCLUDE #define XKMSVALIDATEREQUETS_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the ValidateRequest elements * * The \ is one of the fundamental message types of * the XKISS service. It is used by the Validate service to find a key * and return a set of key bindings for that key. * * The schema definition for ValidateRequest is as follows : * * \verbatim \endverbatim */ class XKMSValidateRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSValidateRequest() {}; public: virtual ~XKMSValidateRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the QueryKeyBinding element * * The QueryKeyBinding element is the core of the ValidateRequest message, and * defines the public key information that will be sent to the server. * * @returns A pointer to the XKMSQueryKeyBinding element */ virtual XKMSQueryKeyBinding * getQueryKeyBinding(void) = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a QueryKeyBinding element * * Set a QueryKeyBinding element in the ValidateRequest message. The returned * object can be manipulated to add KeyInfo elements to the ValidateRequest. * * @returns A pointer to the newly created QueryKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSQueryKeyBinding * addQueryKeyBinding(void) = 0; //@} private: // Unimplemented XKMSValidateRequest(const XKMSValidateRequest &); XKMSValidateRequest & operator = (const XKMSValidateRequest &); }; #endif /* XKMSVALIDATEREQUETS_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSUnverifiedKeyBinding.hpp000644 001751 001751 00000004663 12003301053 024775 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUnverifiedKeyBinding := Interface for UnverifiedKeyBinding elements * * $Id: XKMSUnverifiedKeyBinding.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSUNVERIFIEDKEYBINDING_INCLUDE #define XKMSUNVERIFIEDKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the UnverifiedKeyBinding elements * * The \ Element is used in a LocateResult message to * provide results to a client. Such results should be treated by the client * without any trust - they are literally "unverified" * * The schema definition for UnverifiedKeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSUnverifiedKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSUnverifiedKeyBinding() {}; public: virtual ~XKMSUnverifiedKeyBinding() {}; private: // Unimplemented XKMSUnverifiedKeyBinding(const XKMSUnverifiedKeyBinding &); XKMSUnverifiedKeyBinding & operator = (const XKMSUnverifiedKeyBinding &); }; #endif /* XKMSUNVERIFIEDKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSLocateResult.hpp000644 001751 001751 00000006650 12003301053 023335 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateResult := Interface for LocateResult Messages * * $Id: XKMSLocateResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSLOCATERESULT_INCLUDE #define XKMSLOCATERESULT_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; class XKMSUnverifiedKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the LocateResult elements * * The \ is one of the fundamental message types of * the XKISS service. It is used by the Locate service to return a key * and the bindings for that key. * * The schema definition for LocateResponse is as follows : * * \verbatim \endverbatim */ class XKMSLocateResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSLocateResult() {}; public: virtual ~XKMSLocateResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name UnverifiedKeyBinding handling */ //@{ /** * \brief Find number of UnverifiedKeyBinding elements * * @returns the number of UnverifiedKeyBinding items within the LocateResult */ virtual int getUnverifiedKeyBindingSize(void) const = 0; /* * \brief Obtain an UnverifiedKeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the UnverifiedKeyBinding referenced by "item" */ virtual XKMSUnverifiedKeyBinding * getUnverifiedKeyBindingItem(int item) const = 0; /* * \brief Append a new UnverifiedKeyBinding element * * Allows callers to append a new UnverifiedKeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @returns the newly created UnverifiedKeyBinding object (already inserted * in the LocateResult */ virtual XKMSUnverifiedKeyBinding * appendUnverifiedKeyBindingItem(void ) = 0; //@} private: // Unimplemented XKMSLocateResult(const XKMSLocateResult &); XKMSLocateResult & operator = (const XKMSLocateResult &); }; #endif /* XKMSLOCATERESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRespondWith.hpp000644 001751 001751 00000005724 12003301053 023176 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRespondWith:= Interface for RespondWith elements * * $Id: XKMSRespondWith.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESPONDWITH_INCLUDE #define XKMSRESPONDWITH_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the RespondWith element * * The \ is a very simple element structure that * allows a requestor to instruct the service on what kind of information * is to be presented back to the caller. * * The schema definition for RespondWith is as follows : * * \verbatim \endverbatim */ class XKMSRespondWith { /** @name Constructors and Destructors */ //@{ protected: XKMSRespondWith() {}; public: virtual ~XKMSRespondWith() {}; /** @name Getter Interface Methods */ //@{ /* * \brief Obtain the element at the head of this structure * * @returns the owning Element for this structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Get the RespondWith string for this element * * Each RespondWith element has a text node that defines the Key type to * be returned. * * @returns a pointer to the RespondWith string for this element - note that the * xkms namespace part of the QName (if any) is stripped away. */ virtual const XMLCh * getRespondWithString(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the String within the RespondWith element * * Allows a calling application to set a new RespondWith string * * @param str The string to set (overwriting any previous value). Do not add * any local name part - this will be added by the implementation. * @note The library does not check that the string is a value RespondWith string. */ virtual void setRespondWithString(const XMLCh * str) = 0; //@} private: // Unimplemented XKMSRespondWith(const XKMSRespondWith &); XKMSRespondWith & operator = (const XKMSRespondWith &); }; #endif /* XKMSRESPONDWITH_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSQueryKeyBinding.hpp000644 001751 001751 00000004430 12003301053 023772 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSQueryKeyBinding := Interface for QueryKeyBinding elements * * $Id: XKMSQueryKeyBinding.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSQUERYKEYBINDING_INCLUDE #define XKMSQUERYKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the QueryKeyBinding elements * * The \ Element is used in a request message to a server * to ask the server as to whether particular key bindings are permitted for * a given key. * * The schema definition for QueryKeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSQueryKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSQueryKeyBinding() {}; public: virtual ~XKMSQueryKeyBinding() {}; private: // Unimplemented XKMSQueryKeyBinding(const XKMSQueryKeyBinding &); XKMSQueryKeyBinding & operator = (const XKMSQueryKeyBinding &); }; #endif /* XKMSQUERYKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSPrototypeKeyBinding.hpp000644 001751 001751 00000010120 12003301053 024663 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPrototypeKeyBinding := Interface for KeyBinding elements * * $Id: XKMSPrototypeKeyBinding.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSPROTOTYPEKEYBINDING_INCLUDE #define XKMSPROTOTYPEKEYBINDING_INCLUDE // XSEC Includes #include #include class XKMSValidityInterval; /** * @ingroup xkms */ /** * @brief Interface definition for the KeyBinding elements * * The \ Element is used in a result message to a client * to provide information on a particular key. * * The schema definition for KeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus; class XKMSPrototypeKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSPrototypeKeyBinding() {}; public: virtual ~XKMSPrototypeKeyBinding() {}; //@} /** @name Get Methods */ //@{ /** * \brief Get the suggested ValidityInterval for this key * * Clients can suggest a Validity period for a key using this element. * Such requests can (of course) be ignored by the server * * @return The ValditityInterval object or NULL if none was defined */ virtual XKMSValidityInterval * getValidityInterval(void) const = 0; /** * \brief Obtain the RevocationCodeIdentifier to be used for this key * * The client can provide a revocation code when registering a new key. * The code provided initially is a double MACd version of the client's * revocation pass phrase. * * Should the client later wish to later revoke their key, they should provde * the single MACd version which can then be converted to the double MAC by * the server - thus validating the code without ever passing anything over * the wire that will directly compromise the key until the final revoke request * * @return A pointer to the base64 encoded HMAC output */ virtual const XMLCh * getRevocationCodeIdentifier(void) const = 0; //@} /** @name Set Methods */ //@{ /** * \brief Set the Validity Interval for this key * * @param notBefore - dateTime string to set the NotBefore item as (NULL to clear) * @param notOnOrAfter - dateTime string to set the NotOnOrAfter item as (NULL to clear) */ virtual void setValidityInterval(const XMLCh * notBefore, const XMLCh * notOnOrAfter) = 0; /** * \brief Set the RevocationCodeIdentifier * * Sets the revocation code identifer * * @param identifier string containing base64 encoded HMAC value */ virtual void setRevocationCodeIdentifier(const XMLCh * identifier) = 0; //@} private: // Unimplemented XKMSPrototypeKeyBinding(const XKMSPrototypeKeyBinding &); XKMSPrototypeKeyBinding & operator = (const XKMSPrototypeKeyBinding &); }; #endif /* XKMSPROTOTYPEKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSKeyBindingAbstractType.hpp000644 001751 001751 00000023142 12003301053 025273 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBindingAbstractType := Interface for base schema of XKMS messages * * $Id: XKMSKeyBindingAbstractType.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSKEYBINDINGABSTRACTTYPE_INCLUDE #define XKMSKEYBINDINGABSTRACTTYPE_INCLUDE // XSEC Includes #include class DSIGKeyInfoList; class DSIGKeyInfoMgmtData; class DSIGKeyInfoName; class DSIGKeyInfoPGPData; class DSIGKeyInfoSPKIData; class DSIGKeyInfoValue; class DSIGKeyInfoX509; class XKMSUseKeyWith; XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup xkms */ /** * @brief Interface definition for the KeyBindingAbstractType * * The \ is an abstract type on which all * KeyBinding components are build. * * The schema definition for KeyBindingAbstractType is as follows : * * \verbatim \endverbatim */ class XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSKeyBindingAbstractType() {}; public: virtual ~XKMSKeyBindingAbstractType() {}; /** @name Getter Interface Methods */ //@{ /* * \brief Obtain the base Element for this structure * * @returns the Element node at the head of the DOM structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Get the Id for the KeyBinding * * All KeyBinding elements MAY have an Id attribute that * identifies the binding. This method is used to retrieve a pointer * to the Id string. * * @returns a pointer to the Id string (owned by the library) */ virtual const XMLCh * getId(void) const = 0; /** * \brief Obtain the KeyInfo elements for this KeyBinding * * KeyBinding elements may provide information about the keys that are being * bound. * * @returns A KeyInfoList object containing all the KeyInfo elements */ virtual DSIGKeyInfoList * getKeyInfoList(void) const = 0; /** * \brief Determine if an Encryption key usage is set * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. * * @returns whether the Encryption KeyUsage element is set */ virtual bool getEncryptionKeyUsage(void) const = 0; /** * \brief Determine if an Signature key usage is set * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. * * @returns whether the Signature KeyUsage element is set */ virtual bool getSignatureKeyUsage(void) const = 0; /** * \brief Determine if an Exchange key usage is set * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. * * @returns whether the Exchange KeyUsage element is set */ virtual bool getExchangeKeyUsage(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the Id URI for the Message * * Allows a calling application to set a new Id for the * KeyBinding * * @param id The Id to set - if NULL, the library will generate a random Id */ virtual void setId(const XMLCh * id = NULL) = 0; /** * \brief Set Encryption key usage on * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. When first created, all these elements * are off (which indicates that all are permitted). * * This call activates the Encryption key usage for this KeyBinding */ virtual void setEncryptionKeyUsage(void) = 0; /** * \brief Set Signature key usage on * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. When first created, all these elements * are off (which indicates that all are permitted). * * This call activates the Signature key usage for this KeyBinding */ virtual void setSignatureKeyUsage(void) = 0; /** * \brief Set Exchange key usage on * * KeyBinding elements may define Encryption, Signature of Exchange as being * permitted for a particular key. When first created, all these elements * are off (which indicates that all are permitted). * * This call activates the Exchange key usage for this KeyBinding */ virtual void setExchangeKeyUsage(void) = 0; //@} /** @name KeyInfo Element Manipulation */ //@{ /** * \brief Get the list of \ elements. * *

This function recovers list that contains the KeyInfo elements * read in from the DOM document.

* * @returns A pointer to the (library owned) KeyInfo list, or NULL * if none exists in the KeyBinding. */ virtual DSIGKeyInfoList * getKeyInfoList(void) = 0; /** * \brief Clear out all KeyInfo elements in the KeyBinding. * * This function will delete all KeyInfo elements from both the KeyBinding * object and the associated DOM. * */ virtual void clearKeyInfo(void) = 0; /** * \brief Append a DSA KeyValue element * * Add a new KeyInfo element for a DSA Value * * @param P Base64 encoded value of P * @param Q Base64 encoded value of Q * @param G Base64 encoded value of G * @param Y Base64 encoded value of Y * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) = 0; /** * \brief Append a RSA KeyValue element * * Add a new KeyInfo element for a RSA Value * * @param modulus Base64 encoded value of the modulus * @param exponent Base64 encoded value of exponent * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) = 0; /** * \brief Append a X509Data element. * * Add a new KeyInfo element for X509 data. * * @note The added element is empty. The caller must make use of the * returned object to set the required values. * * @returns A pointer to the created object. */ virtual DSIGKeyInfoX509 * appendX509Data(void) = 0; /** * \brief Append a KeyName element. * * Add a new KeyInfo element for a key name. * * @param name The name of the key to set in the XML * @param isDName Treat the name as a Distinguished name and encode accordingly * @returns A pointer to the created object */ virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) = 0; /** * \brief Append a PGPData element. * * Add a new KeyInfo element for a PGP key. * * @param id The ID of the key to set in the XML (base64 encoded - NULL if none) * @param packet The Packet information to set in the XML (base64 encoded - * NULL if none) * @returns A pointer to the created object */ virtual DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet) = 0; /** * \brief Append a SPKIData element * * Add a new KeyInfo element for a set of SPKI S-expressions * * @param sexp The initial S-expression to set in the SPKIData element * @returns A pointer to the created object */ virtual DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp) = 0; /** * \brief Append a MgmtData element * * Add a new KeyInfo element for Management Data * * @param data The string to set in the MgmtData element * @returns A pointer to the created object */ virtual DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data) = 0; //@} /** @name UseKeyWith handling */ //@{ /** * \brief Find number of UseKeyWith elements * * @returns the number of UseKeyWith items within the KeyBinding */ virtual int getUseKeyWithSize(void) const = 0; /* * \brief Obtain an UseKeyWith item * * @param item Index of the item to return (0 = first element) * @returns the UseKeyWith referenced by "item" */ virtual XKMSUseKeyWith * getUseKeyWithItem(int item) const = 0; /* * \brief Append a new UnverifiedKeyBinding element * * Allows callers to append a new UnverifiedKeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @returns the newly created UnverifiedKeyBinding object (already inserted * in the LocateResult */ virtual XKMSUseKeyWith * appendUseKeyWithItem( const XMLCh * application, const XMLCh * identifier) = 0; //@} private: // Unimplemented XKMSKeyBindingAbstractType(const XKMSKeyBindingAbstractType &); XKMSKeyBindingAbstractType & operator = (const XKMSKeyBindingAbstractType &); }; #endif /* XKMSKEYBINDINGABSTRACTTYPE_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSMessageAbstractType.hpp000644 001751 001751 00000020414 12003301053 024633 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageAbstractType := Interface for base schema of XKMS messages * * $Id: XKMSMessageAbstractType.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSMESSAGEABSTRACTTYPE_INCLUDE #define XKMSMESSAGEABSTRACTTYPE_INCLUDE // XSEC Includes #include #include class DSIGSignature; XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup xkms */ /** * @brief Interface definition for the MessageAbstractType * * The \ is an abstract type on which all * other XKMS messages are built. All request/response messages * have : *
    *
  • Id The unique ID of this message
  • *
  • Service The URI of the service for which this message is * destined or comes from.
  • *
  • Nonce (Optional) Random data used to defend against replay attacks. *
* * In addition, such messages may have : * *
    *
  • Signature Validating authenticity of this message
  • *
  • MessageExtension Used for extensibility
  • *
  • OpaqueClientData Used for application specific info
  • *
* * The schema definition for MessageAbstractType is as follows : * * \verbatim \endverbatim */ class XKMSMessageAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSMessageAbstractType() {}; public: enum messageType { None, /** A default value that indicates something hasn't been set */ /* X-KISS messages */ CompoundRequest, /** A CompoundRequest message - holding multiple requests */ CompoundResult, /** A CompoundResult message - holding multiple results */ LocateRequest, /** A LocateRequest message */ LocateResult, /** A LocateResult message */ ValidateRequest, /** A ValidateRequest message */ ValidateResult, /** A ValidateResult message */ PendingRequest, /** A PendingRequest message (Asynchronous protocol) */ StatusRequest, /** A StatusRequest message (Asynchronous protocol) */ StatusResult, /** A StatusResult message (Asynchronous protocol) */ Result, /** A non-specific result message */ /* X-KRSS messages */ RegisterRequest, /** A RegisterReqeust message */ RegisterResult, /** A RegisterResult message */ RevokeRequest, /** A RevokeRequest message */ RevokeResult, /** A RevokeResult message */ RecoverRequest, /** A RecoverRequest message */ RecoverResult, /** A RecoverResult message */ ReissueRequest, /** A ReissueRequest message */ ReissueResult /** A ReissueResult message */ }; virtual ~XKMSMessageAbstractType() {}; /** @name Message Manipulation Methods */ //@{ virtual messageType getMessageType(void) = 0; /** @name Getter Interface Methods */ //@{ /** * \brief Find out whether this is a signed Message * * @returns true if the message is signed */ virtual bool isSigned(void) const = 0; /** * \brief Retrieve the Signature information (if any is attached) * * All XKMS messages MAY have a \ node that is used * to attest to the validity of the message. * * @returns The DSIGSignature object associated with this Message, * or NULL if none is defined */ virtual DSIGSignature * getSignature(void) const = 0; /* * \brief Obtain the base Element for this structure * * @returns the Element node at the head of the DOM structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Get the Id for the Message * * All messages are required to have an Id attribute that uniquely * identifies the message. This method is used to retrieve a pointer * to the Id string. * * @returns a pointer to the Id string (owned by the library) */ virtual const XMLCh * getId(void) const = 0; /** * \brief Get the Service identifier for this message * * All Messages are associated with a particular XKMS service. This * method can be used to retrieve the Service URI for a particular * message. * * @returns a pointer to the Service URI string (owned by the library) * */ virtual const XMLCh * getService(void) const = 0; /** * \brief Get the Nonce of the message * * All messages MAY have a nonce, used to provide cryptographically * random data that will help defend against a replay attack. * * @returns A string (owned by the library) providing the nonce data in * base64 encoded form. If no Nonce is set, NULL is returned. */ virtual const XMLCh * getNonce(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the Id URI for the Message * * Allows a calling application to set a new Id for the * message * * Note: Great care should be taken on resetting Id attributes, as * they are used to track a particular transaction through its * liefcycle. * * @param id The Id to set */ virtual void setId(const XMLCh * id) = 0; /** * \brief Set the Service for the Message * * Used to set a new service URI for a particular message. In general, * the service attribute would not be expected to change. * * * @param service String to set in the Service attribute. */ virtual void setService(const XMLCh * service) = 0; /** * \brief Set the Nonce value * * Allows the application to set a new Nonce value (overwriting any * that is currently set). * * @param uri String (base64 encoded data) to set in the Nonce attribute. * @note no checking of this string is done by the library - it * is assumed that it is a valid base64 encoding. */ virtual void setNonce(const XMLCh * uri) = 0; /** * \brief Add a signature to the message * * Allows an application to sign the message * * @returns the new Signature structure */ virtual DSIGSignature * addSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1) = 0; //@} /** @name Opaque client data handling */ //@{ /** * \brief Find the number of \ elements * * The \ element can have multiple * \ children. This method allows an application * to determine how many such children exist * * @return Number of \ elements */ virtual int getOpaqueClientDataSize(void) = 0; /* * \brief Get the nth item in the OpaqueClientData list * * @param item The item to return * @returns the string of the nth item in the OpaqueClientData list. * */ virtual const XMLCh * getOpaqueClientDataItemStr(int item) = 0; /* * \brief Append an item to the OpaqueClientData list * * @param item Base64 string to append to the list. Will be * wrapped in a OpaqueData element. */ virtual void appendOpaqueClientDataItem(const XMLCh * item) = 0; //@} private: // Unimplemented XKMSMessageAbstractType(const XKMSMessageAbstractType &); XKMSMessageAbstractType & operator = (const XKMSMessageAbstractType &); }; #endif /* XKMSMESSAGEABSTRACTTYPE_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSMessageFactory.hpp000644 001751 001751 00000111172 12003301053 023637 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageFactory := Interface for the factory used to produce XKMS msgs * * $Id: XKMSMessageFactory.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSMESSAGEFACTORY_INCLUDE #define XKMSMESSAGEFACTORY_INCLUDE // XSEC Includes #include #include #include class DSIGSignature; class XKMSCompoundRequest; class XKMSCompoundResult; class XKMSLocateRequest; class XKMSLocateResult; class XKMSRequestAbstractType; class XKMSResult; class XKMSValidateRequest; class XKMSValidateResult; class XKMSPendingRequest; class XKMSStatusRequest; class XKMSStatusResult; class XKMSRegisterRequest; class XKMSRegisterResult; class XKMSRevokeResult; class XKMSRevokeRequest; class XKMSRecoverResult; class XKMSRecoverRequest; class XKMSReissueResult; class XKMSReissueRequest; XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @defgroup xkms XML Key Management System Implementation * *

The classes in this group implement the W3C XKMS 2.0 * specification. Users should interact with these classes * via the XKMSMessageFactory class (for consuming and producing * XKMS messages) and the XKMSClient class (for actually * performing XKMS calls to a server)

* */ /*@{*/ /** * @brief Interface definition for the XKMSMessageFactory class * * The XKMSMessageFactory classes are used to provide an interface * to applicataions to produce and consume XKMS messages. No logic * is defined within the class, other than that necessary to (for * example) generate a response message using a request message as * a base. * * Client apps that wish to make use of XKMS should generally use * the XKMSClient class. */ class XKMSMessageFactory { /** @name Constructors and Destructors */ //@{ protected: XKMSMessageFactory() {}; public: virtual ~XKMSMessageFactory() {}; /** @name Methods to build XKMS message objects from existing XML */ //@{ /** * \brief Load a message from an existing XML document * * Reads in the XML document and produces the corresponding XKMS * message object. Callers should make use of the ::getMessageType * method to determine what type of message they are actually * working with. * * @param elt The element at the head of the XKMS structure */ virtual XKMSMessageAbstractType * newMessageFromDOM( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * elt) = 0; //@} /** @name Methods for building new X-KISS messages from scratch */ //@{ /** * \brief Create a new \ message. * * Generates a new CompoundRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSCompoundRequest structure */ virtual XKMSCompoundRequest * createCompoundRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new CompoundRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSCompoundRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleteing the CompoundRequest object will not * delete the DOM document as well. */ virtual XKMSCompoundRequest * createCompoundRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new LocateRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSLocateRequest structure */ virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new LocateRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSLocateRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleteing the LocateRequest object will not * delete the DOM document as well. */ virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ValidateRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSValidateRequest structure */ virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new ValidateRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSValidateRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the LocateRequest object will not * delete the DOM document as well. */ virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new PendingRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSPendingRequest structure */ virtual XKMSPendingRequest * createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new PendingRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSPendingRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the PendingRequest object will not * delete the DOM document as well. */ virtual XKMSPendingRequest * createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new StatusRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSStatusRequest structure */ virtual XKMSStatusRequest * createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new StatusRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSStatusRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the StatusRequest object will not * delete the DOM document as well. */ virtual XKMSStatusRequest * createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new LocateResult message from scratch, building the DOM * as it goes. The response will be based on a input LocateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSLocateResponse structure */ virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new LocateResult message from scratch, building the DOM * as it goes. The response will be based on a input LocateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSLocateResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleteing the LocateRequest object will not * delete the DOM document as well. */ virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ValidateResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSLocateResponse structure */ virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new ValidateResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSValidateResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleteing the ValidateRequest object will not * delete the DOM document as well. */ virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new CompoundResult message from scratch, building the DOM * as it goes. The response will be based on a input CompoundRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSLocateResponse structure */ virtual XKMSCompoundResult * createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new CompoundResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSCompoundResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleteing the ValidateRequest object will not * delete the DOM document as well. */ virtual XKMSCompoundResult * createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new Result message from scratch, building the DOM * as it goes. The response will be based on an input Request message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSResult structure */ virtual XKMSResult * createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new Result message from scratch, building the DOM * as it goes. The response will be based on a input Request message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new Response structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the Request object will not * delete the DOM document as well. */ virtual XKMSResult * createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new StatusResult message from scratch, building the DOM * as it goes. The response will be based on a input StatusRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSStatusRessult structure */ virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new StatusResult message from scratch, building the DOM * as it goes. The response will be based on a input StatusRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSStatusResult structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the StatusResult object will not * delete the DOM document as well. */ virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; //@} /** @name Methods for building new X-KRSS messages from scratch */ //@{ /** * \brief Create a new \ message. * * Generates a new RegisterRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRegisterRequest structure */ virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RegisterRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRegisterRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RegisterRequest object will not * delete the DOM document as well. */ virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RegisterResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRegisterResponse structure */ virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RegisterResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRegisterResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RegisterRequest object will not * delete the DOM document as well. */ virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RevokeRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRevokeRequest structure */ virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RevokeRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRevokeRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RevokeRequest object will not * delete the DOM document as well. */ virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RevokeResult message from scratch, building the DOM * as it goes. The response will be based on a input RevokeRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRevokeResponse structure */ virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RevokeResult message from scratch, building the DOM * as it goes. The response will be based on a input RevokeRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRevokeResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RevokeRequest object will not * delete the DOM document as well. */ virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RecoverRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRecoverRequest structure */ virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RecoverRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSRecoverRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RecoverRequest object will not * delete the DOM document as well. */ virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RecoverResult message from scratch, building the DOM * as it goes. The response will be based on a input RecoverRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRecoverResponse structure */ virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new RecoverResult message from scratch, building the DOM * as it goes. The response will be based on a input RecoverRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSRecoverResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the RecoverRequest object will not * delete the DOM document as well. */ virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ReissueRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Document to create the DOM structure within. The caller * will need to embed the DOM structure at the appropriate place in the * document (using a call to getElement to find the top level element) * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSReissueRequest structure */ virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new ReissueRequest message from scratch, building the DOM * as it goes. * * @param service URI * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @returns the new XKMSReissueRequest structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the ReissueRequest object will not * delete the DOM document as well. */ virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ReissueResult message from scratch, building the DOM * as it goes. The response will be based on a input ReissueRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSReissueResponse structure */ virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message and surrounding document * * Generates a new ReissueResult message from scratch, building the DOM * as it goes. The response will be based on a input ReissueRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param doc Will be used to return the newly created document element in. * @param id Value to set in the Id field. If NULL, the library will * generate a new Unique Id value. * @param rmaj Major result code * @param rmin Minor result code * @returns the new XKMSReissueResponse structure * @note Like all the xsec library functions, the document is owned by * the calling application. Deleting the ReissueRequest object will not * delete the DOM document as well. */ virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; //@} /** @name Environment Manipulation Functions */ //@{ /** * \brief Set the prefix be used for the DSIG namespace. * * @param prefix The UTF-16 encoided NS prefix to use for the XML * Digital Signature nodes */ virtual void setDSIGNSPrefix(const XMLCh * prefix) = 0; /** * \brief Set the prefix be used for the Exclusive Canonicalisation namespace. * * The Exclusive Canonicalisation specification defines a new namespace for the * InclusiveNamespaces node. This function can be used to set the prefix * that the library will use when creating nodes within this namespace. * *

xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#"

* * If no prefix is set, the default namespace will be used * * @param prefix The UTF-16 encoided NS prefix to use for the XML * Exclusive Canonicalisation nodes */ virtual void setECNSPrefix(const XMLCh * prefix) = 0; /** * \brief Set the prefix be used for the XPath-Filter2 namespace. * * The XPathFilter definition uses its own namespace. This * method can be used to set the prefix that the library will use * when creating elements in this namespace * *

xmlns:ds="http://www.w3.org/2002/06/xmldsig-filter2"

* * If no prefix is set, the default namespace will be used * * @param prefix The UTF-16 encoided NS prefix to use for the XPath * filter nodes */ virtual void setXPFNSPrefix(const XMLCh * prefix) = 0; /** * \brief Set the prefix be used for the XML Encryption namespace. * * @param prefix The UTF-16 encoided NS prefix to use for the XML * Encryption nodes */ virtual void setXENCNSPrefix(const XMLCh * prefix) = 0; /** * \brief Set the prefix be used for the XKMS Namespace * * @param prefix The UTF-16 encoided NS prefix to use for the XKMS * nodes */ virtual void setXKMSNSPrefix(const XMLCh * prefix) = 0; //@} /** @name Message Conversions */ //@{ /** * \brief Convert to a Request type * * Used to convert a MessageAbstractType to a RequestAbstractType * * @param msg The message to convert * @return the same message typecast to a RequestAbstractType (if NULL otherwise) * otherwise */ virtual XKMSRequestAbstractType * toRequestAbstractType(XKMSMessageAbstractType *msg) = 0; /** * \brief Convert to a Result type * * Used to convert a MessageAbstractType to a ResultType * * @param msg The message to convert * @return the same message typecast to a ResultType (if OK - NULL otherwise) * otherwise */ virtual XKMSResultType * toResultType(XKMSMessageAbstractType *msg) = 0; //@} private: // Unimplemented XKMSMessageFactory(const XKMSMessageFactory &); XKMSMessageFactory & operator = (const XKMSMessageFactory &); }; #endif /* XKMSMESSAGEFACTORY_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSConstants.hpp000644 001751 001751 00000012471 12003301053 022701 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSConstants := Definitions of varius XKMS constants (mainly strings) * * $Id: XKMSConstants.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSCONSTANTS_HEADER #define XKMSCONSTANTS_HEADER // Xerces #include // Name Spaces #define URI_ID_XKMS "http://www.w3.org/2002/03/xkms#" //#define URI_ID_XKMS "http://www.w3.org/2004/07/xkms#" #define URI_ID_SOAP11 "http://schemas.xmlsoap.org/soap/envelope/" #define URI_ID_SOAP12 "http://www.w3.org/2003/05/soap-envelope" // -------------------------------------------------------------------------------- // Constant Strings Class // -------------------------------------------------------------------------------- class DSIG_EXPORT XKMSConstants { public: // URI_IDs static const XMLCh * s_unicodeStrURIXKMS; static const XMLCh * s_unicodeStrURISOAP11; static const XMLCh * s_unicodeStrURISOAP12; // Tags - note all are UTF-16, but not marked as such static const XMLCh s_tagApplication[]; static const XMLCh s_tagAuthentication[]; static const XMLCh s_tagCompoundRequest[]; static const XMLCh s_tagCompoundResult[]; static const XMLCh s_tagD[]; static const XMLCh s_tagDP[]; static const XMLCh s_tagDQ[]; static const XMLCh s_tagEncryption[]; static const XMLCh s_tagExchange[]; static const XMLCh s_tagExponent[]; static const XMLCh s_tagFailure[]; static const XMLCh s_tagId[]; static const XMLCh s_tagIdentifier[]; static const XMLCh s_tagIndeterminateReason[]; static const XMLCh s_tagInvalidReason[]; static const XMLCh s_tagInverseQ[]; static const XMLCh s_tagKeyBinding[]; static const XMLCh s_tagKeyBindingAuthentication[]; static const XMLCh s_tagKeyInfo[]; static const XMLCh s_tagKeyName[]; static const XMLCh s_tagKeyUsage[]; static const XMLCh s_tagKeyValue[]; static const XMLCh s_tagLocateRequest[]; static const XMLCh s_tagLocateResult[]; static const XMLCh s_tagMessageExtension[]; static const XMLCh s_tagModulus[]; static const XMLCh s_tagNonce[]; static const XMLCh s_tagNotBoundAuthentication[]; static const XMLCh s_tagNotBefore[]; static const XMLCh s_tagNotOnOrAfter[]; static const XMLCh s_tagOpaqueClientData[]; static const XMLCh s_tagOpaqueData[]; static const XMLCh s_tagOriginalRequestId[]; static const XMLCh s_tagP[]; static const XMLCh s_tagPending[]; static const XMLCh s_tagPendingRequest[]; static const XMLCh s_tagPrivateKey[]; static const XMLCh s_tagProofOfPossession[]; static const XMLCh s_tagProtocol[]; static const XMLCh s_tagPrototypeKeyBinding[]; static const XMLCh s_tagQ[]; static const XMLCh s_tagQueryKeyBinding[]; static const XMLCh s_tagRecoverKeyBinding[]; static const XMLCh s_tagRecoverRequest[]; static const XMLCh s_tagRecoverResult[]; static const XMLCh s_tagRegisterRequest[]; static const XMLCh s_tagRegisterResult[]; static const XMLCh s_tagReissueKeyBinding[]; static const XMLCh s_tagReissueRequest[]; static const XMLCh s_tagReissueResult[]; static const XMLCh s_tagRepresent[]; static const XMLCh s_tagRequestId[]; static const XMLCh s_tagRequestSignatureValue[]; static const XMLCh s_tagRespondWith[]; static const XMLCh s_tagResponseId[]; static const XMLCh s_tagResponseLimit[]; static const XMLCh s_tagResponseMechanism[]; static const XMLCh s_tagResult[]; static const XMLCh s_tagResultMajor[]; static const XMLCh s_tagResultMinor[]; static const XMLCh s_tagRevocationCodeIdentifier[]; static const XMLCh s_tagRevocationCode[]; static const XMLCh s_tagRevokeKeyBinding[]; static const XMLCh s_tagRevokeRequest[]; static const XMLCh s_tagRevokeResult[]; static const XMLCh s_tagRSAKeyPair[]; static const XMLCh s_tagService[]; static const XMLCh s_tagSignature[]; static const XMLCh s_tagStatus[]; static const XMLCh s_tagStatusRequest[]; static const XMLCh s_tagStatusResult[]; static const XMLCh s_tagStatusValue[]; static const XMLCh s_tagSuccess[]; static const XMLCh s_tagUnverifiedKeyBinding[]; static const XMLCh s_tagUseKeyWith[]; static const XMLCh s_tagValidateRequest[]; static const XMLCh s_tagValidateResult[]; static const XMLCh s_tagValidReason[]; static const XMLCh s_tagValidityInterval[]; static const XMLCh s_tagValue[]; static const XMLCh s_tagX509Cert[]; static const XMLCh s_tagX509Chain[]; // ResultMajor codes static const XMLCh s_tagResultMajorCodes[][16]; static const XMLCh s_tagResultMinorCodes[][20]; static const XMLCh s_tagStatusValueCodes[][15]; static const XMLCh s_tagStatusReasonCodes[][17]; XKMSConstants(); static void create(); static void destroy(); }; #endif /* XKMSCONSTANTS_HEADER */ xml-security-c-1.7.3/xsec/xkms/XKMSRequestAbstractType.hpp000644 001751 001751 00000015645 12003301053 024711 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRequestAbstractType := Interface for base schema of XKMS Request messages * * $Id: XKMSRequestAbstractType.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREQUESTABSTRACTTYPE_INCLUDE #define XKMSREQUESTABSTRACTTYPE_INCLUDE // XSEC Includes #include #include class XKMSRespondWith; class XKMSResponseMechanism; /** * @ingroup xkms */ /** * @brief Interface definition for the RequestAbstractType * * The \ is an abstract type on which all * XKMS Request messages are built. * * The schema definition for RequestAbstractType is as follows : * * \verbatim \endverbatim */ class XKMSRequestAbstractType : public XKMSMessageAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRequestAbstractType() {}; public: virtual ~XKMSRequestAbstractType() {}; /** @name Getter Interface Methods */ //@{ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Get the Original Request Id for the Message * * For transactions that use multipt request/response sessions (e.g. * two stage commit or asyncronous processing), this attribute can be * used to identify the id of the original message that was processed. * * @returns a pointer to the Original Request Id string (owned by the library) */ virtual const XMLCh * getOriginalRequestId(void) const = 0; /** * \brief Get the ResponseLimit size * * A client can limit the number of keys to be returned by the service by * setting this value to the required limit. * * @returns Value of the ResponseLimit within the message. 0 if none was set */ virtual unsigned int getResponseLimit(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the Original Reqeust Id for the Message * * Allows a calling application to set a new original request Id for the * message * * @param id The Id to set as the OriginalRequestId */ virtual void setOriginalRequestId(const XMLCh * id) = 0; /** * \brief Set the ResponseLimit size * * A client can limit the number of keys to be returned by the service by * setting this value to the required limit. * * @param limit Value to set the ResponseLimit within the message */ virtual void setResponseLimit(unsigned int limit) = 0; //@} /** @name \ handling */ //@{ /** * \brief Number of RespondWith elements in this Request * * Returns the number of RespondWith elements held within this request * * @returns Number of RespondWith elements */ virtual int getRespondWithSize(void) = 0; /** * \brief Get the nth item in the RespondWith list * * @param item The item to return * @returns the nth item in the RespondWith list. * */ virtual XKMSRespondWith * getRespondWithItem(int item) = 0; /** * \brief Get the string of the nth item in the RespondWith list * * @param item The item whose string is to be returned * @returns the string of the nth item in the RespondWith list. * */ virtual const XMLCh * getRespondWithItemStr(int item) = 0; /** * \brief Append an item to the RespondWith list * * @param item XKMSRespondWith object to append to the list. * @note Once passed in, this item will be owned by the library. */ virtual void appendRespondWithItem(XKMSRespondWith * item) = 0; /** * \brief Shortcut for appending an item to the RespondWith list * * @param item String to create a RespondWith element around and * append to the list. */ virtual void appendRespondWithItem(const XMLCh * item) = 0; //@} /** @name \ handling */ //@{ /** * \brief Number of ResponseMechanism elements in this Request * * Returns the number of ResponseMechanism elements held within this request * * @returns Number of ResponseMechanism elements */ virtual int getResponseMechanismSize(void) = 0; /** * \brief Get the nth item in the ResponseMechanism list * * @param item The item to return * @returns the nth item in the ResponseMechanism list. * */ virtual XKMSResponseMechanism * getResponseMechanismItem(int item) = 0; /** * \brief Get the string of the nth item in the ResponseMechanism list * * @param item The item whose string is to be returned * @returns the string of the nth item in the RespondWith list. * */ virtual const XMLCh * getResponseMechanismItemStr(int item) = 0; /** * \brief Append an item to the ResponseMechanism list * * @param item XKMSResponseMechanism object to append to the list. * @note Once passed in, this item will be owned by the library. */ virtual void appendResponseMechanismItem(XKMSResponseMechanism * item) = 0; /** * \brief Shortcut for appending an item to the ResponseMechanism list * * @param item String to create a ResponseMechanism element around and * append to the list. */ virtual void appendResponseMechanismItem(const XMLCh * item) = 0; /** * \brief Remove a ResponseMechanism * * Removes the identified ResponseMechanism from the item * * @param item Item to remove */ virtual void removeResponseMechanismItem(int item) = 0; //@} private: // Unimplemented XKMSRequestAbstractType(const XKMSRequestAbstractType &); XKMSRequestAbstractType & operator = (const XKMSRequestAbstractType &); }; #endif /* XKMSREQUESTABSTRACTTYPE_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSResult.hpp000644 001751 001751 00000003571 12003301053 022204 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResult := Interface for Result Messages * * $Id: XKMSResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESULT_INCLUDE #define XKMSRESULT_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the Result elements * * The \ is used when an XKMS service cannot return a result * of a more specific type - e.g. when a pending request comes in for which * there is no result. It is a straight instantiation of the ResultType */ class XKMSResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSResult() {}; public: virtual ~XKMSResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} private: // Unimplemented XKMSResult(const XKMSResult &); XKMSResult & operator = (const XKMSResult &); }; #endif /* XKMSRESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSAuthentication.hpp000644 001751 001751 00000010164 12003301053 023701 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSAuthentication := Interface for ValidityInterval elements * * $Id: XKMSAuthentication.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSAUTHENTICATION_INCLUDE #define XKMSAUTHENTICATION_INCLUDE // XSEC Includes #include #include class DSIGSignature; class XKMSNotBoundAuthentication; /** * @ingroup xkms */ /** * @brief Interface definition for the Authentication elements * * The \ Element used within a number of X-KRSS requests * as the mechanism for authentication a request from a client to the server * * It can contain either a standard XML-Signature element (via a * KeyBindingAuthentication element) or a straight password (not otherwise * protected). * * The schema definition for ValidityInterval is as follows : * * \verbatim \endverbatim */ class XKMSAuthentication { /** @name Constructors and Destructors */ //@{ protected: XKMSAuthentication() {}; public: virtual ~XKMSAuthentication() {}; //@} /** @name Get Methods */ //@{ /** * \brief Get KeyBindingAuthentication signature construct * * A \ can have a \ * element as an immediate child. This element is used to hold a * XML-Signature over the PrototypeKeyBinding. * * @return The signature held in the KeyBindingAuthentication - or NULL * if none is set. */ virtual DSIGSignature * getKeyBindingAuthenticationSignature(void) const = 0; /** * \brief Get the NotBoundAuthentication structure * * The NotBoundAuthentication element is used to pass a plaintext key * along with the request message as the authentication mechanism. * * @note The XKMS Spec indicates that this element MUST NOT be used unless * there is another form of security being used to wrap the requests - * e.g. authenticated SSL. * * @return The NotBoundAuthentication structure (or NULL if none is defined) */ virtual XKMSNotBoundAuthentication * getNotBoundAuthentication(void) const = 0; //@} /** @name Set Methods */ //@{ /** * \brief Add a KeyBindingAuthentication signature to the message * * Allows the application to add a new signature into a * KeyBindingAuthentication element * * @returns the new Signature structure */ virtual DSIGSignature * addKeyBindingAuthenticationSignature( canonicalizationMethod cm = CANON_C14NE_NOC, signatureMethod sm = SIGNATURE_HMAC, hashMethod hm = HASH_SHA1) = 0; /** * \brief Set the NotBoundAuthentication value * * Allows applications to set a authentication value * * @param uri URI defining the authentication protocol * @param value Base64 encoded value to set as the authentication value */ virtual void setNotBoundAuthentication(const XMLCh * uri, const XMLCh * value) = 0; //@} private: // Unimplemented XKMSAuthentication(const XKMSAuthentication &); XKMSAuthentication & operator = (const XKMSAuthentication &); }; #endif /* XKMSAUTHENTICATION_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSLocateRequest.hpp000644 001751 001751 00000006351 12003301053 023505 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateRequest := Interface for LocateRequest Messages * * $Id: XKMSLocateRequest.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSLOCATEREQUEST_INCLUDE #define XKMSLOCATEREQUEST_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the LocateRequest elements * * The \ is one of the fundamental message types of * the XKISS service. It is used by the Locate service to find a key * and return a set of key bindings for that key. * * The schema definition for LocateRequest is as follows : * * \verbatim \endverbatim */ class XKMSLocateRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSLocateRequest() {}; public: virtual ~XKMSLocateRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the QueryKeyBinding element * * The QueryKeyBinding element is the core of the LocateRequest message, and * defines the public key information that will be sent to the server. * * @returns A pointer to the XKMSQueryKeyBinding element */ virtual XKMSQueryKeyBinding * getQueryKeyBinding(void) = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a QueryKeyBinding element * * Set a QueryKeyBinding element in the LocateRequest message. The returned * object can be manipulated to add KeyInfo elements to the LocateRequest. * * @returns A pointer to the newly created QueryKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSQueryKeyBinding * addQueryKeyBinding(void) = 0; //@} private: // Unimplemented XKMSLocateRequest(const XKMSLocateRequest &); XKMSLocateRequest & operator = (const XKMSLocateRequest &); }; #endif /* XKMSLOCATEREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSResultType.hpp000644 001751 001751 00000017406 12003301053 023050 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResultType := Interface for base schema of XKMS Request messages * * $Id: XKMSResultType.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESULTTYPE_INCLUDE #define XKMSRESULTTYPE_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the ResultType * * The \ is the base type on which Result messages * are built. (The \ element is a direct implementation) * * The schema definition for ResultType is as follows : * * \verbatim \endverbatim */ class XKMSResultType : public XKMSMessageAbstractType { public: /** * \brief Definition of Major Result codes */ enum ResultMajor { NoneMajor=0, /** No code - error! */ Success, /** Final - The operation succeeded. */ VersionMismatch, /** Final - The service does not support the protocol version specified in the request.*/ Sender, /** Final - An error occurred that was due to the message sent by the sender. */ Receiver, /** Final - An error occurred at the receiver. */ Represent, /** Not Final - The service has not acted on the request. In order for the request to be acted upon the request MUST be represented with the specified nonce in accordance with the two phase protocol */ Pending /** The request has been accepted for processing and the service will return the result asynchronously */ }; enum ResultMinor { NoneMinor=0, /** No code - no code was returned */ NoMatch, /** No match was found for the search prototype provided. Success The result code Success.NoMatch indicates that the service is authoritative for the search prototype specified and that the service positively asserts that no matches exist. Receiver The result code Receiver.NoMatch indicates that the service is not authoritative for the search prototype provided.*/ TooManyResponses, /** The request resulted in the number of responses that exceeded either the ResponseLimit value specified in the request or some other limit determined by the service. The service MAY either return a subset of the possible responses or none at all. Success The service has returned one or more responses that represent a subset of the possible responses. Receiver The service has returned no responses. */ Incomplete, /** Success Only part of the information requested could be provided. */ Failure, /** The service attempted to perform the request but the operation failed for unspecified reasons. Sender The reason for failure is attributed to the sender (e.g. the request failed schema validation). Receiver The reason for failure is attributed to the receiver (e.g. a database lookup failed).*/ Refused, /** The operation was refused. The service did not attempt to perform the request. Sender The sender failed to provide sufficient information to authenticate or authorize the request (e.g. payment not supplied) Receiver The receiver is currently refusing certain requests for unspecified reasons. */ NoAuthentication, /** Sender The operation was refused because the necessary authentication information was incorrect or missing.*/ MessageNotSupported,/** Sender The receiver does not implement the specified operation. */ UnknownResponseId, /** Sender The ResponseId for which pending status was requested is unknown to the service.*/ RepresentRequired, /** Sender The responder requires that the sender offer the represent protocol option in order to process the request.*/ NotSynchronous /** Receiver The receiver does not support synchronous processing of this type of request */ }; /** @name Constructors and Destructors */ //@{ protected: XKMSResultType() {}; public: virtual ~XKMSResultType() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Get the ResultMajor code for the message * * All result messages contain a Major Result code defining the overall * status of the request performed by the client * * @returns The ResultMajor code */ virtual ResultMajor getResultMajor(void) const = 0; /** * \brief Get the ResultMinor code for the message * * Messages may contain a minor result code that better defines the result * returned in the ResultMajor code * * @returns The ResultMinor code */ virtual ResultMinor getResultMinor(void) const = 0; /** * \brief Obtain the RequestId attribute * * The RequestId attribute matches the Id of the request message to which * this response is related. * * @returns the RequestId string */ virtual const XMLCh * getRequestId(void) const = 0; /** * \brief Obtain the value of the RequestSignatureValue element * * A request can have a ResponseMechanism of RequestSignatureValue. When this * is set, the service can place the text within the SignatureValue element into * the Result. This call allows a consumer of the result to find the value * * @returns The original signature that was on the request message */ virtual const XMLCh * getRequestSignatureValue(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set a new value for the ResultMajor of this response * * @param rmaj New value for ResultMajor for this messag */ virtual void setResultMajor(ResultMajor rmaj) = 0; /** * \brief Set a new value for the ResultMinor of this response * * @param rmin New value for ResultMajor for this message */ virtual void setResultMinor(ResultMinor rmin) = 0; /** * \brief Set the Request Id for the Message * * Allows a calling application to set a new request Id for the * message * * @param id The Id to set as the RequestId */ virtual void setRequestId(const XMLCh * id) = 0; /** * \brief Set the value of the RequestSignatureValue element * * A request can have a ResponseMechanism of RequestSignatureValue. When this * is set, the service can place the text within the SignatureValue element into * the Result. This call allows a service to set this value in a response * * @param value The base64 encoded signature value of the original request */ virtual void setRequestSignatureValue(const XMLCh * value) = 0; //@} private: // Unimplemented XKMSResultType(const XKMSResultType &); XKMSResultType & operator = (const XKMSResultType &); }; #endif /* XKMSRESULTTYPE_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSStatusResult.hpp000644 001751 001751 00000010476 12003301053 023412 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusResult := Interface for StatusResult Messages * * $Id: XKMSStatusResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUSRESULT_INCLUDE #define XKMSSTATUSRESULT_INCLUDE // XSEC Includes #include #include class XKMSQueryKeyBinding; class XKMSUnverifiedKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the StatusResult elements * * The \ is used for Asynchronous processing and * allows a client to determing whether a Pending response is ready * for return. * * The schema definition for StatusResponse is as follows : * * \verbatim \endverbatim */ class XKMSStatusResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSStatusResult() {}; public: virtual ~XKMSStatusResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name Count handling */ //@{ /** * \brief Find number of Success messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Success result code. * * @returns the number of Success messages in a pending CompoundResponse */ virtual int getSuccessCount(void) const = 0; /** * \brief Find number of Failed messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Failure result type. * * @returns the number of Failed messages in a pending CompoundResponse */ virtual int getFailureCount(void) const = 0; /** * \brief Find number of Pending messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Pending result code. * * @returns the number of Pending messages in a pending CompoundResponse */ virtual int getPendingCount(void) const = 0; /** * \brief Set the number of Success messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Success result code. * * @param count the number of Success messages in a pending CompoundResponse */ virtual void setSuccessCount(int count) = 0; /** * \brief Set the number of Failed messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Failed result code. * * @param count the number of Failed messages in a pending CompoundResponse */ virtual void setFailureCount(int count) = 0; /** * \brief Set the number of Pending messages * * A StatusResult can have a count of messages within a pending CompoundResponse * with a Pending result code. * * @param count the number of Pending messages in a pending CompoundResponse */ virtual void setPendingCount(int count) = 0; //@} private: // Unimplemented XKMSStatusResult(const XKMSStatusResult &); XKMSStatusResult & operator = (const XKMSStatusResult &); }; #endif /* XKMSSTATUSRESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSKeyBinding.hpp000644 001751 001751 00000004777 12003301053 022762 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBinding := Interface for KeyBinding elements * * $Id: XKMSKeyBinding.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSKEYBINDING_INCLUDE #define XKMSKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the KeyBinding elements * * The \ Element is used in a result message to a client * to provide information on a particular key. * * The schema definition for KeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus; class XKMSKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSKeyBinding() {}; public: virtual ~XKMSKeyBinding() {}; //@} /** @name Status handling */ //@{ /** * \brief Obtain the status element for this KeyBinding * * The \ element is used to describe to the caller the * validity of they key being described. This call is used to * obtain the status element * * @return A pointer to the XKMSStatus element */ virtual XKMSStatus * getStatus(void) const = 0; //@} private: // Unimplemented XKMSKeyBinding(const XKMSKeyBinding &); XKMSKeyBinding & operator = (const XKMSKeyBinding &); }; #endif /* XKMSKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSCompoundResult.hpp000644 001751 001751 00000023110 12003301053 023700 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundResult := Interface for CompoundResult Messages * * $Id: XKMSCompoundResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSCOMPOUNDRESULT_INCLUDE #define XKMSCOMPOUNDRESULT_INCLUDE // XSEC Includes #include #include class XKMSLocateResult; class XKMSLocateRequest; class XKMSValidateResult; class XKMSStatusResult; class XKMSStatusRequest; class XKMSValidateRequest; class XKMSRegisterRequest; class XKMSRegisterResult; class XKMSRevokeRequest; class XKMSRevokeResult; class XKMSReissueRequest; class XKMSReissueResult; class XKMSRecoverRequest; class XKMSRecoverResult; class XKMSResult; class XKMSRequestAbstractType; /** * @ingroup xkms */ /** * @brief Interface definition for the CompoundResult elements * * The \ is used to merge a number of separate requests * into a single message. It is a very simple type - simply a holding * Result that has all the sub-Results held within it. * * The schema definition for CompoundResult is as follows : * * \verbatim \endverbatim */ class XKMSCompoundResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSCompoundResult() {}; public: virtual ~XKMSCompoundResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the number of results within the compound result * * This class holds a list of results that can be accessed using the * getResultListItem method. This method allows an application to determine * how many result items there are. * * @returns The size of the Result list */ virtual int getResultListSize(void) = 0; /** * \brief Obtain a Result item * * Obtain a particular Result from the list of Results held in this * compound object * * @returns The nominated item */ virtual XKMSResultType * getResultListItem(int item) = 0; //@} /** @name Setter Interface Methods */ //@{ /** * \brief Create a new \ message. * * Generates a new LocateResult message from scratch, building the DOM * as it goes. The response will be based on a input LocateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSLocateResponse structure */ virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ValidateResult message from scratch, building the DOM * as it goes. The response will be based on a input ValidateRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSLocateResponse structure */ virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new StatusResult message from scratch, building the DOM * as it goes. The response will be based on a input StatusRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSStatusResponse structure */ virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RegisterResult message from scratch, building the DOM * as it goes. The response will be based on a input RegisterRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSRegisterResult structure */ virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RevokeResult message from scratch, building the DOM * as it goes. The response will be based on a input RevokeRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSRevokeResult structure */ virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new RecoverResult message from scratch, building the DOM * as it goes. The response will be based on a input RevokeRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSRecoverResult structure */ virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new ReissueResult message from scratch, building the DOM * as it goes. The response will be based on a input RevokeRequest message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSReissueResult structure */ virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; /** * \brief Create a new \ message. * * Generates a new Result message from scratch, building the DOM * as it goes. The response will be based on an input Request message * which is used to provide Id etc. * * @param request Request to base response on * @param id Value to set in the Id field. If NULL, the library will * @param rmaj Major result code * @param rmin Minor result code * generate a new Unique Id value. * @returns the new XKMSResult structure */ virtual XKMSResult * createResult( XKMSRequestAbstractType * request, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL) = 0; //@} private: // Unimplemented XKMSCompoundResult(const XKMSCompoundResult &); XKMSCompoundResult & operator = (const XKMSCompoundResult &); }; #endif /* XKMSCOMPOUNDRESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRegisterResult.hpp000644 001751 001751 00000013406 12003301053 023707 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterResult := Interface for RegisterResult Messages * * $Id: XKMSRegisterResult.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREGISTERRESULT_INCLUDE #define XKMSREGISTERRESULT_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBinding; class XKMSUnverifiedKeyBinding; class XKMSRSAKeyPair; class XENCCipherData; /** * @ingroup xkms */ /** * @brief Interface definition for the RegisterResult elements * * The \ is used by the X-KRSS service to response to * a user request to register a new key with the service. * * The schema definition for RegisterResult is as follows : * * \verbatim \endverbatim */ class XKMSRegisterResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSRegisterResult() {}; public: virtual ~XKMSRegisterResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name KeyBinding handling */ //@{ /** * \brief Find number of KeyBinding elements * * @returns the number of KeyBinding items within the RegisterResult */ virtual int getKeyBindingSize(void) const = 0; /* * \brief Obtain an KeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the KeyBinding referenced by "item" */ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0; /* * \brief Append a new KeyBinding element * * Allows callers to append a new KeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @param status The status (Valid, Invalid or Indeterminate) of this * key * @returns the newly created KeyBinding object (already inserted * in the RegisterResult */ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0; //@} /** @name PrivateKey handling */ //@{ /** * \brief Return the RSAKeyPair * * This call requires the passphrase used to encrypt the private key. * The implementation decrypts the PrivateKey element in the * RegisterResult and returns the resulting RSAKeyPair. * * @note The decryption is performed *inside* the RegisterResult, so * this actually modified the contents of the XML. It should never * be called twice! * * @param passPhrase The local code page version of the pass phrase * @returns the number of KeyBinding items within the RegisterResult */ virtual XKMSRSAKeyPair * getRSAKeyPair(const char * passPhrase) = 0; /** * \brief Add the RSAKeyPair in an encrypted PrivateKey * * This call requires the passphrase to encrypt the private key. * The implementation encrypts the RSAKeyPair and adds the result * to the resulting RSAKey Pair. It returns the CipherData element * to the caller (not a structure for the PrivateKey) * * @note The encryption is performed *inside* the RegisterResult, so * this actually modified the contents of the XML. It should never * be called twice! * * @param passPhrase The local code page version of the pass phrase * @param Modulus Base64 encoded string with the modulus * @param Exponent Base64 encoded string with the exponent * @param P Base64 encoded string with p * @param Q Base64 encoded string with q * @param DP Base64 encoded string with dp * @param DQ Base64 encoded string with dq * @param InverseQ Base64 encoded string with inverseq * @param D Base64 encoded string with d * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * @returns The encrypted result of adding the info */ virtual XENCEncryptedData * setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI = NULL) = 0; //@} private: // Unimplemented XKMSRegisterResult(const XKMSRegisterResult &); XKMSRegisterResult & operator = (const XKMSRegisterResult &); }; #endif /* XKMSREGISTERRESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSResponseMechanism.hpp000644 001751 001751 00000006067 12003301053 024354 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResponseMechanism:= Interface for ResponseMechanism elements * * $Id: XKMSResponseMechanism.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESPONSEMECHANISM_INCLUDE #define XKMSRESPONSEMECHANISM_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the ResponseMechanism element * * The \ is a very simple element structure that * allows a requestor to pass extended protocol information * * The schema definition for ResponseMechanism is as follows : * * \verbatim \endverbatim */ class XKMSResponseMechanism { /** @name Constructors and Destructors */ //@{ protected: XKMSResponseMechanism() {}; public: virtual ~XKMSResponseMechanism() {}; /** @name Getter Interface Methods */ //@{ /* * \brief Obtain the element at the head of this structure * * @returns the owning Element for this structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Get the ResponseMechanism string for this element * * Each ResponseMechanism element has a text node that defines the Key type to * be returned. * * @returns a pointer to the ResponseMechanism string for this element - note that the * xkms namespace part of the QName (if any) is stripped away. */ virtual const XMLCh * getResponseMechanismString(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the String within the ResponseMechanism element * * Allows a calling application to set a new ResponseMechanism string * * @param str The string to set (overwriting any previous value). Do not add * any local name part - this will be added by the library. * @note The library does not check that the string is a valid ResponseMechanism string. */ virtual void setResponseMechanismString(const XMLCh * str) = 0; //@} private: // Unimplemented XKMSResponseMechanism(const XKMSResponseMechanism &); XKMSResponseMechanism & operator = (const XKMSResponseMechanism &); }; #endif /* XKMSRESPONSEMECHANISM_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSStatus.hpp000644 001751 001751 00000011500 12003301053 022200 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatus := Interface for Status elements (in KeyBinding) * * $Id: XKMSStatus.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUS_INCLUDE #define XKMSSTATUS_INCLUDE // XSEC Includes #include /** * @ingroup xkms */ /** * @brief Interface definition for the Status elements * * The \ Element is used in a KeyBinding message to a client * to provide status information for keys that are returned in a * ValidateResult message * * The schema definition for KeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus { /** @name Constructors and Destructors */ //@{ protected: XKMSStatus() {}; public: virtual ~XKMSStatus() {}; //@} enum StatusValue { StatusUndefined = 0, /** Error - the status value is undefined */ Valid = 1, /** Good key! */ Invalid = 2, /** Bad key! */ Indeterminate = 3 /** Smarmy key! */ }; enum StatusReason { ReasonUndefined = 0, /** The reason is undefined or unknown */ IssuerTrust = 1, /** The issuer of the info is considered good */ RevocationStatus = 2, /** Key is/is not revoked */ ValidityInterval = 3, /** Key not expired */ Signature = 4 /** Signature on the provided data is good */ }; /** @name Getter methods */ //@{ /** * \brief Get the KeyBinding status assertion * * The Status element has a StatusValue attribute that defines * the validity of the key in question * * @return the status assertion */ virtual StatusValue getStatusValue(void) const = 0; /** * \brief Find the Reason for a particular facet of status codes * * For each status reason, a Status can define a number of reasons * to return to a client. There are some controls on this (e.g. you cannot * have an InvalidReason if the actual KeyBindingStatus is Valid), but * you can have things in ValidReason and IndeterminateReason for an Invalid * result. This call allows you to find out about any facet of a reason * * @param status The particular status value you want to find a reason for * @param reason The particular reason that you want to determine is or is not * set * @return true if the particular reason is set for the given status, false * otherwise */ virtual bool getStatusReason(StatusValue status, StatusReason reason) const = 0; //@} /** @name Setter Methods */ //@{ /** * \brief Activate or de-activate a particular reason in the status result * * For each status reason, a Status can define a number of reasons * to return to a client. There are some controls on this (e.g. you cannot * have an InvalidReason if the actual KeyBindingStatus is Valid), but * you can have things in ValidReason and IndeterminateReason for an Invalid * result. This call allows you to set any facet of a reason * * @param status The particular status value you want to set a reason for * @param reason The particular reason that you want to set * @param value true to turn on the reason, false to turn it off */ virtual void setStatusReason(StatusValue status, StatusReason reason, bool value) = 0; //@} private: // Unimplemented XKMSStatus(const XKMSStatus &); XKMSStatus & operator = (const XKMSStatus &); }; #endif /* XKMSSTATUS_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRevokeRequest.hpp000644 001751 001751 00000012105 12003301053 023523 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeRequest := Interface for RegisterRequest Messages * * $Id$ * */ #ifndef XKMSREVOKEREQUEST_INCLUDE #define XKMSREVOKEREQUEST_INCLUDE // XSEC Includes #include #include #include class DSIGSignature; class XKMSAuthentication; class XKMSRevokeKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the RevokeRequest elements * * The \ is one of the message types of * the X-KRMS service. It is used when a client wishes to revoke * a key known to the service. * * The schema definition for RevokeRequest is as follows : * * \verbatim \endverbatim */ class XKMSRevokeRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRevokeRequest() {}; public: virtual ~XKMSRevokeRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the PrototypKeyBinding element * * The PrototypeKeyBinding element is the core of the RegisterRequest message, and * defines the key information that will be sent to the server for registration. * * @returns A pointer to the XKMSPrototypeKeyBinding element */ virtual XKMSRevokeKeyBinding * getRevokeKeyBinding(void) const = 0; /** * \brief Get the Authentication element * * The Authentication element of the RegisterRequest is used by the client to * authenticate the request to the server. * * @return A pointer to the Authentication structure */ virtual XKMSAuthentication * getAuthentication (void) const = 0; /** * \brief Get the revocation code for the request * * This element is used by the client to provide a MAC of a pass phrase that * proves to the service tha the client has the authority to revoke this * key. * * @return A pointer to string representing the base64 encoded * revocation code, or NULL if none was defined */ virtual const XMLCh * getRevocationCode(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a RevokeKeyBinding element * * Set a RevokeKeyBinding element in the Request message. The returned * object can be manipulated to add KeyInfo elements to the Request. * * @param status The status value to add into the RevokeKeyBinding structure * @returns A pointer to the newly created RevokeKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSRevokeKeyBinding * addRevokeKeyBinding(XKMSStatus::StatusValue status) = 0; /** \brief Add an Authentication element * * Set a Authentication element in the Request message. The returned * object can be manipulated to add Authentication information to the request. * * @returns A pointer to the newly created Authenticaton object, or * the pointer to extant object if one already existed. */ virtual XKMSAuthentication * addAuthentication(void) = 0; /** * \brief Add a RevocationCode to the message * * Allows the client to add a new Revocation Code string * RevokeRequest element * * @param code the base64 representation of the revocation code */ virtual void addRevocationCode(const XMLCh * code) = 0; //@} private: // Unimplemented XKMSRevokeRequest(const XKMSRevokeRequest &); XKMSRevokeRequest & operator = (const XKMSRevokeRequest &); }; #endif /* XKMSREVOKEREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRevokeResult.hpp000644 001751 001751 00000006634 12003301053 023363 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeResult := Interface for RegisterResult Messages * * $Id:$ * */ #ifndef XKMSREVOKERESULT_INCLUDE #define XKMSREVOKERESULT_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the RegisterResult elements * * The \ is used by the X-KRSS service to response to * a user request to register a new key with the service. * * The schema definition for RegisterResult is as follows : * * \verbatim \endverbatim */ class XKMSRevokeResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSRevokeResult() {}; public: virtual ~XKMSRevokeResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name KeyBinding handling */ //@{ /** * \brief Find number of KeyBinding elements * * @returns the number of KeyBinding items within the RegisterResult */ virtual int getKeyBindingSize(void) const = 0; /* * \brief Obtain an KeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the KeyBinding referenced by "item" */ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0; /* * \brief Append a new KeyBinding element * * Allows callers to append a new KeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @param status The status (Valid, Invalid or Indeterminate) of this * key * @returns the newly created KeyBinding object (already inserted * in the RegisterResult */ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0; //@} private: // Unimplemented XKMSRevokeResult(const XKMSRevokeResult &); XKMSRevokeResult & operator = (const XKMSRevokeResult &); }; #endif /* XKMSREVOKERESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRecoverKeyBinding.hpp000644 001751 001751 00000004554 12003301053 024301 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverKeyBinding := Interface for KeyBinding elements * * $Id$ * */ #ifndef XKMSRECOVERKEYBINDING_INCLUDE #define XKMSRECOVERKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the RecoverKeyBinding elements * * The \ Element is used in a request to Recover * a particular key from an XKRS service * * The schema definition for RecoverKeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus; class XKMSRecoverKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRecoverKeyBinding() {}; public: virtual ~XKMSRecoverKeyBinding() {}; //@} /** @name Status handling */ //@{ /** * \brief Obtain the status element for this KeyBinding * * The \ element is used to describe to the caller the * validity of they key being described. This call is used to * obtain the status element * * @return A pointer to the XKMSStatus element */ virtual XKMSStatus * getStatus(void) const = 0; //@} private: // Unimplemented XKMSRecoverKeyBinding(const XKMSRecoverKeyBinding &); XKMSRecoverKeyBinding & operator = (const XKMSRecoverKeyBinding &); }; #endif /* XKMSRECOVERKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRevokeKeyBinding.hpp000644 001751 001751 00000004532 12003301053 024123 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeKeyBinding := Interface for KeyBinding elements * * $Id:$ * */ #ifndef XKMSREVOKEKEYBINDING_INCLUDE #define XKMSREVOKEKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the RevokeKeyBinding elements * * The \ Element is used in a request to revoke * a particular key from an XKRS service * * The schema definition for RevokeKeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus; class XKMSRevokeKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRevokeKeyBinding() {}; public: virtual ~XKMSRevokeKeyBinding() {}; //@} /** @name Status handling */ //@{ /** * \brief Obtain the status element for this KeyBinding * * The \ element is used to describe to the caller the * validity of they key being described. This call is used to * obtain the status element * * @return A pointer to the XKMSStatus element */ virtual XKMSStatus * getStatus(void) const = 0; //@} private: // Unimplemented XKMSRevokeKeyBinding(const XKMSRevokeKeyBinding &); XKMSRevokeKeyBinding & operator = (const XKMSRevokeKeyBinding &); }; #endif /* XKMSREVOKEKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRSAKeyPair.hpp000644 001751 001751 00000010345 12003301053 022635 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRSAKeyPair := Interface for RSAKeyPair elements * * $Id:$ * */ #ifndef XKMSRSAKEYPAIR_INCLUDE #define XKMSRSAKEYPAIR_INCLUDE // XSEC Includes #include /** * @ingroup xkms */ /** * @brief Interface definition for the RSAKeyPair * * The \ is one of the few XKMS elements that is not * directly part of an XKMS Message. It is sent in RegisterResult * and RecoverResult messages as a CipherData. * * This element allows the service to provide back to the user * a complete RSA key - including the private components. The various * components that make up an RSA key are all provided in Base64 format * (CryptoBinary type) * * The schema definition for RSAKeyPair is as follows : * * \verbatim \endverbatim * * @note There are no "set" methods for this class. It is designed * to be created "atomically" via the XKMSMessageFactory class and not * altered. */ class XKMSRSAKeyPair { public: /** @name Constructors and Destructors */ //@{ protected: XKMSRSAKeyPair() {}; public: virtual ~XKMSRSAKeyPair() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Get the Modulus of the key pair * * @returns The Modulus in base64 encoding */ virtual const XMLCh * getModulus(void) const = 0; /** * \brief Get the Exponent of the key pair * * @returns The Exponent in base64 encoding */ virtual const XMLCh * getExponent(void) const = 0; /** * \brief Get the P of the key pair * * @returns The P in base64 encoding */ virtual const XMLCh * getP(void) const = 0; /** * \brief Get the Q of the key pair * * @returns The Q in base64 encoding */ virtual const XMLCh * getQ(void) const = 0; /** * \brief Get the DP of the key pair * * @returns The DP in base64 encoding */ virtual const XMLCh * getDP(void) const = 0; /** * \brief Get the DQ of the key pair * * @returns The DQ in base64 encoding */ virtual const XMLCh * getDQ(void) const = 0; /** * \brief Get the InverseQ of the key pair * * @returns The InverseQ in base64 encoding */ virtual const XMLCh * getInverseQ(void) const = 0; /** * \brief Get the D of the key pair * * @returns The D in base64 encoding */ virtual const XMLCh * getD(void) const = 0; //@} private: // Unimplemented XKMSRSAKeyPair(const XKMSRSAKeyPair &); XKMSRSAKeyPair & operator = (const XKMSRSAKeyPair &); }; #endif /* XKMSRSAKEYPAIR_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRecoverResult.hpp000644 001751 001751 00000013553 12003301053 023533 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverResult := Interface for RecoverResult Messages * * $Id$ * */ #ifndef XKMSRECOVERRESULT_INCLUDE #define XKMSRECOVERRESULT_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBinding; class XKMSUnverifiedKeyBinding; class XKMSRSAKeyPair; class XENCCipherData; /** * @ingroup xkms */ /** * @brief Interface definition for the RecoverResult elements * * The \ is used by the X-KRSS service to response to * a user request to Recover a new key with the service. * * The schema definition for RecoverResult is as follows : * * \verbatim \endverbatim */ class XKMSRecoverResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSRecoverResult() {}; public: virtual ~XKMSRecoverResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name KeyBinding handling */ //@{ /** * \brief Find number of KeyBinding elements * * @returns the number of KeyBinding items within the RecoverResult */ virtual int getKeyBindingSize(void) const = 0; /* * \brief Obtain an KeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the KeyBinding referenced by "item" */ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0; /* * \brief Append a new KeyBinding element * * Allows callers to append a new KeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @param status The status (Valid, Invalid or Indeterminate) of this * key * @returns the newly created KeyBinding object (already inserted * in the RecoverResult */ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0; //@} /** @name PrivateKey handling */ //@{ /** * \brief Return the RSAKeyPair * * This call requires the passphrase used to encrypt the private key. * The implementation decrypts the PrivateKey element in the * RecoverResult and returns the resulting RSAKeyPair. * * @note The decryption is performed *inside* the RecoverResult, so * this actually modified the contents of the XML. It should never * be called twice! * * @param passPhrase The local code page version of the pass phrase * @returns the number of KeyBinding items within the RecoverResult */ virtual XKMSRSAKeyPair * getRSAKeyPair(const char * passPhrase) = 0; /** * \brief Add the RSAKeyPair in an encrypted PrivateKey * * This call requires the passphrase to encrypt the private key. * The implementation encrypts the RSAKeyPair and adds the result * to the resulting RSAKey Pair. It returns the CipherData element * to the caller (not a structure for the PrivateKey) * * @note The encryption is performed *inside* the RecoverResult, so * this actually modified the contents of the XML. It should never * be called twice! * * @param passPhrase The local code page version of the pass phrase * @param Modulus Base64 encoded string with the modulus * @param Exponent Base64 encoded string with the exponent * @param P Base64 encoded string with p * @param Q Base64 encoded string with q * @param DP Base64 encoded string with dp * @param DQ Base64 encoded string with dq * @param InverseQ Base64 encoded string with inverseq * @param D Base64 encoded string with d * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * @returns The encrypted result of adding the info */ virtual XENCEncryptedData * setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI = NULL) = 0; //@} private: // Unimplemented XKMSRecoverResult(const XKMSRecoverResult &); XKMSRecoverResult & operator = (const XKMSRecoverResult &); }; #endif /* XKMSRECOVERRESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSReissueResult.hpp000644 001751 001751 00000006673 12003301053 023552 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueResult := Interface for RegisterResult Messages * * $Id$ * */ #ifndef XKMSREISSUERESULT_INCLUDE #define XKMSREISSUERESULT_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the ReissueResult elements * * The \ is used by the X-KRSS service to response to * a user request to reissue a key from the service - e.g. for a new * cert * * The schema definition for ReissueResult is as follows : * * \verbatim \endverbatim */ class XKMSReissueResult : public XKMSResultType { /** @name Constructors and Destructors */ //@{ protected: XKMSReissueResult() {}; public: virtual ~XKMSReissueResult() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name KeyBinding handling */ //@{ /** * \brief Find number of KeyBinding elements * * @returns the number of KeyBinding items within the ReissueResult */ virtual int getKeyBindingSize(void) const = 0; /* * \brief Obtain an KeyBinding item * * @param item Index of the item to return (0 = first element) * @returns the KeyBinding referenced by "item" */ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0; /* * \brief Append a new KeyBinding element * * Allows callers to append a new KeyBinding item. * The item is initially empty of KeyInfo elements - these must be added * by the caller. * * @param status The status (Valid, Invalid or Indeterminate) of this * key * @returns the newly created KeyBinding object (already inserted * in the ReissueResult */ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0; //@} private: // Unimplemented XKMSReissueResult(const XKMSReissueResult &); XKMSReissueResult & operator = (const XKMSReissueResult &); }; #endif /* XKMSREISSUERESULT_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSRecoverRequest.hpp000644 001751 001751 00000010455 12003301053 023703 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverRequest := Interface for RegisterRequest Messages * * $Id$ * */ #ifndef XKMSRECOVERREQUEST_INCLUDE #define XKMSRECOVERREQUEST_INCLUDE // XSEC Includes #include #include #include class DSIGSignature; class XKMSAuthentication; class XKMSRecoverKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the RecoverRequest elements * * The \ is one of the message types of * the X-KRMS service. It is used when a client wishes to recover * a private key known to the service. * * The schema definition for RecoverRequest is as follows : * * \verbatim \endverbatim */ class XKMSRecoverRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSRecoverRequest() {}; public: virtual ~XKMSRecoverRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the RecoverKeyBinding element * * The RecoverKeyBinding element is the core of the RecoverRequest message, and * defines the key information that a recover is required for. * * @returns A pointer to the XKMSPrototypeKeyBinding element */ virtual XKMSRecoverKeyBinding * getRecoverKeyBinding(void) const = 0; /** * \brief Get the Authentication element * * The Authentication element of the RecoverRequest is used by the client to * authenticate the request to the server. * * @return A pointer to the Authentication structure */ virtual XKMSAuthentication * getAuthentication (void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a RecoverKeyBinding element * * Set a RecoverKeyBinding element in the Request message. The returned * object can be manipulated to add KeyInfo elements to the Request. * * @param status The status value to add into the RecoverKeyBinding structure * @returns A pointer to the newly created RecoverKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSRecoverKeyBinding * addRecoverKeyBinding(XKMSStatus::StatusValue status) = 0; /** \brief Add an Authentication element * * Set a Authentication element in the Request message. The returned * object can be manipulated to add Authentication information to the request. * * @returns A pointer to the newly created Authenticaton object, or * the pointer to extant object if one already existed. */ virtual XKMSAuthentication * addAuthentication(void) = 0; //@} private: // Unimplemented XKMSRecoverRequest(const XKMSRecoverRequest &); XKMSRecoverRequest & operator = (const XKMSRecoverRequest &); }; #endif /* XKMSRECOVERREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSReissueRequest.hpp000644 001751 001751 00000012762 12003301053 023720 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueRequest := Interface for RegisterRequest Messages * * $Id$ * */ #ifndef XKMSREISSUEREQUEST_INCLUDE #define XKMSREISSUEREQUEST_INCLUDE // XSEC Includes #include #include #include class DSIGSignature; class XKMSAuthentication; class XKMSReissueKeyBinding; /** * @ingroup xkms */ /** * @brief Interface definition for the ReissueRequest elements * * The \ is one of the message types of * the X-KRMS service. It is used when a client wishes to request * the service reissue a key binding (e.g. a cert). * * The schema definition for ReissueRequest is as follows : * * \verbatim \endverbatim */ class XKMSReissueRequest : public XKMSRequestAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSReissueRequest() {}; public: virtual ~XKMSReissueRequest() {}; /** @name Getter Interface Methods */ //@{ /** * \brief Return the element at the base of the message */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; /** * \brief Obtain the ReissueKeyBinding element * * The ReissueKeyBinding element is the core of the ReissueRequest message, and * defines the key information that a Reissue is required for. * * @returns A pointer to the XKMSPrototypeKeyBinding element */ virtual XKMSReissueKeyBinding * getReissueKeyBinding(void) const = 0; /** * \brief Get the Authentication element * * The Authentication element of the ReissueRequest is used by the client to * authenticate the request to the server. * * @return A pointer to the Authentication structure */ virtual XKMSAuthentication * getAuthentication (void) const = 0; /** * \brief Get the signature used to prove possession of the private key * * When the client presents a request for a key generated by them, this element * is used to show that the client is authorised to make this request using this * key. * * @return A pointer to the proof of possession Signature object (or NULL if none * was defined */ virtual DSIGSignature * getProofOfPossessionSignature(void) const = 0; //@} /** @name Setter Interface Methods */ //@{ /** \brief Add a ReissueKeyBinding element * * Set a ReissueKeyBinding element in the Request message. The returned * object can be manipulated to add KeyInfo elements to the Request. * * @param status The status value to add into the ReissueKeyBinding structure * @returns A pointer to the newly created ReissueKeyBinding object, or * the pointer to extant object if one already existed. */ virtual XKMSReissueKeyBinding * addReissueKeyBinding(XKMSStatus::StatusValue status) = 0; /** \brief Add an Authentication element * * Set a Authentication element in the Request message. The returned * object can be manipulated to add Authentication information to the request. * * @returns A pointer to the newly created Authenticaton object, or * the pointer to extant object if one already existed. */ virtual XKMSAuthentication * addAuthentication(void) = 0; /** * \brief Add a ProofOfPossession signature to the message * * Allows the application to add a new ProofOfPossession signature into a * ReissueRequest element * * @note the client application will need to set the key and sign the * message - however the appropriate reference (to the ReissueKeyBinding * element) will be set. This implies that the ReissueKeyBinding *must* * be added prior to the call to this method. * * @returns the new Signature structure */ virtual DSIGSignature * addProofOfPossessionSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1) = 0; //@} private: // Unimplemented XKMSReissueRequest(const XKMSReissueRequest &); XKMSReissueRequest & operator = (const XKMSReissueRequest &); }; #endif /* XKMSREISSUEREQUEST_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSReissueKeyBinding.hpp000644 001751 001751 00000004553 12003301053 024312 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeKeyBinding := Interface for KeyBinding elements * * $Id$ * */ #ifndef XKMSREISSUEKEYBINDING_INCLUDE #define XKMSREISSUEKEYBINDING_INCLUDE // XSEC Includes #include #include /** * @ingroup xkms */ /** * @brief Interface definition for the ReissueKeyBinding elements * * The \ Element is used in a request to reissue * a particular key from an XKRS service * * The schema definition for ReissueKeyBinding is as follows : * * \verbatim \endverbatim */ class XKMSStatus; class XKMSReissueKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSReissueKeyBinding() {}; public: virtual ~XKMSReissueKeyBinding() {}; //@} /** @name Status handling */ //@{ /** * \brief Obtain the status element for this KeyBinding * * The \ element is used to describe to the caller the * validity of they key being described. This call is used to * obtain the status element * * @return A pointer to the XKMSStatus element */ virtual XKMSStatus * getStatus(void) const = 0; //@} private: // Unimplemented XKMSReissueKeyBinding(const XKMSReissueKeyBinding &); XKMSReissueKeyBinding & operator = (const XKMSReissueKeyBinding &); }; #endif /* XKMSREISSUEKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/XKMSConstants.cpp000644 001751 001751 00000055357 12003301053 022706 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSConstants := Definitions of varius XKMSconstants (mainly strings) * * $Id: XKMSConstants.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constant Strings Storage // -------------------------------------------------------------------------------- const XMLCh * XKMSConstants::s_unicodeStrURIXKMS; const XMLCh * XKMSConstants::s_unicodeStrURISOAP11; const XMLCh * XKMSConstants::s_unicodeStrURISOAP12; // NOTE All tags are unicode (UTF-16) - but are not marked as such const XMLCh XKMSConstants::s_tagApplication[] = { chLatin_A, chLatin_p, chLatin_p, chLatin_l, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagAuthentication[] = { chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagCompoundRequest[] = { chLatin_C, chLatin_o, chLatin_m, chLatin_p, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagCompoundResult[] = { chLatin_C, chLatin_o, chLatin_m, chLatin_p, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagD[] = { chLatin_D, chNull }; const XMLCh XKMSConstants::s_tagDP[] = { chLatin_D, chLatin_P, chNull }; const XMLCh XKMSConstants::s_tagDQ[] = { chLatin_D, chLatin_Q, chNull }; const XMLCh XKMSConstants::s_tagEncryption[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagExchange[] = { chLatin_E, chLatin_x, chLatin_c, chLatin_h, chLatin_a, chLatin_n, chLatin_g, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagExponent[] = { chLatin_E, chLatin_x, chLatin_p, chLatin_o, chLatin_n, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagFailure[] = { chLatin_F, chLatin_a, chLatin_i, chLatin_l, chLatin_u, chLatin_r, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagId[] = { chLatin_I, chLatin_d, chNull }; const XMLCh XKMSConstants::s_tagIdentifier[] = { chLatin_I, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagInvalidReason[] = { chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_R, chLatin_e, chLatin_a, chLatin_s, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagInverseQ[] = { chLatin_I, chLatin_n, chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_e, chLatin_Q, chNull }; const XMLCh XKMSConstants::s_tagIndeterminateReason[] = { chLatin_I, chLatin_n, chLatin_d, chLatin_e, chLatin_t, chLatin_e, chLatin_r, chLatin_m, chLatin_i, chLatin_n, chLatin_a, chLatin_t, chLatin_e, chLatin_R, chLatin_e, chLatin_a, chLatin_s, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagKeyBinding[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagKeyBindingAuthentication[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagKeyInfo[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chNull }; const XMLCh XKMSConstants::s_tagKeyName[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagKeyUsage[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_U, chLatin_s, chLatin_a, chLatin_g, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagKeyValue[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagLocateRequest[] = { chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_e, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagLocateResult[] = { chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_e, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagMessageExtension[] = { chLatin_M, chLatin_e, chLatin_s, chLatin_s, chLatin_a, chLatin_g, chLatin_e, chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagModulus[] = { chLatin_M, chLatin_o, chLatin_d, chLatin_u, chLatin_l, chLatin_u, chLatin_s, chNull }; const XMLCh XKMSConstants::s_tagNonce[] = { chLatin_N, chLatin_o, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagNotBoundAuthentication[] = { chLatin_N, chLatin_o, chLatin_t, chLatin_B, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagNotBefore[] = { chLatin_N, chLatin_o, chLatin_t, chLatin_B, chLatin_e, chLatin_f, chLatin_o, chLatin_r, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagNotOnOrAfter[] = { chLatin_N, chLatin_o, chLatin_t, chLatin_O, chLatin_n, chLatin_O, chLatin_r, chLatin_A, chLatin_f, chLatin_t, chLatin_e, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagOpaqueClientData[] = { chLatin_O, chLatin_p, chLatin_a, chLatin_q, chLatin_u, chLatin_e, chLatin_C, chLatin_l, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull }; const XMLCh XKMSConstants::s_tagOpaqueData[] = { chLatin_O, chLatin_p, chLatin_a, chLatin_q, chLatin_u, chLatin_e, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull }; const XMLCh XKMSConstants::s_tagOriginalRequestId[] = { chLatin_O, chLatin_r, chLatin_i, chLatin_g, chLatin_i, chLatin_n, chLatin_a, chLatin_l, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_I, chLatin_d, chNull }; const XMLCh XKMSConstants::s_tagP[] = { chLatin_P, chNull }; const XMLCh XKMSConstants::s_tagPending[] = { chLatin_P, chLatin_e, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagPendingRequest[] = { chLatin_P, chLatin_e, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagPrivateKey[] = { chLatin_P, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_e, chLatin_K, chLatin_e, chLatin_y, chNull }; const XMLCh XKMSConstants::s_tagProofOfPossession[] = { chLatin_P, chLatin_r, chLatin_o, chLatin_o, chLatin_f, chLatin_O, chLatin_f, chLatin_P, chLatin_o, chLatin_s, chLatin_s, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagProtocol[] = { chLatin_P, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull }; const XMLCh XKMSConstants::s_tagPrototypeKeyBinding[] = { chLatin_P, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_t, chLatin_y, chLatin_p, chLatin_e, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagQ[] = { chLatin_Q, chNull }; const XMLCh XKMSConstants::s_tagQueryKeyBinding[] = { chLatin_Q, chLatin_u, chLatin_e, chLatin_r, chLatin_y, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagRecoverKeyBinding[] = { chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_v, chLatin_e, chLatin_r, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagRecoverRequest[] = { chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_v, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRecoverResult[] = { chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_v, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRegisterRequest[] = { chLatin_R, chLatin_e, chLatin_g, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRegisterResult[] = { chLatin_R, chLatin_e, chLatin_g, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagReissueKeyBinding[] = { chLatin_R, chLatin_e, chLatin_i, chLatin_s, chLatin_s, chLatin_u, chLatin_e, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagReissueRequest[] = { chLatin_R, chLatin_e, chLatin_i, chLatin_s, chLatin_s, chLatin_u, chLatin_e, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagReissueResult[] = { chLatin_R, chLatin_e, chLatin_i, chLatin_s, chLatin_s, chLatin_u, chLatin_e, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRepresent[] = { chLatin_R, chLatin_e, chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRequestId[] = { chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_I, chLatin_d, chNull }; const XMLCh XKMSConstants::s_tagRequestSignatureValue[] = { chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_S, chLatin_i, chLatin_g, chLatin_n, chLatin_a, chLatin_t, chLatin_u, chLatin_r, chLatin_e, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagRespondWith[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_d, chLatin_W, chLatin_i, chLatin_t, chLatin_h, chNull }; const XMLCh XKMSConstants::s_tagResponseId[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_I, chLatin_d, chNull }; const XMLCh XKMSConstants::s_tagResponseLimit[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_L, chLatin_i, chLatin_m, chLatin_i, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagResponseMechanism[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_M, chLatin_e, chLatin_c, chLatin_h, chLatin_a, chLatin_n, chLatin_i, chLatin_s, chLatin_m, chNull }; const XMLCh XKMSConstants::s_tagResult[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagResultMajor[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chLatin_M, chLatin_a, chLatin_j, chLatin_o, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagResultMinor[] = { chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chLatin_M, chLatin_i, chLatin_n, chLatin_o, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagRevocationCode[] = { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_C, chLatin_o, chLatin_d, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagRevocationCodeIdentifier[] = { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_C, chLatin_o, chLatin_d, chLatin_e, chLatin_I, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagRevokeKeyBinding[] = { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_k, chLatin_e, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagRevokeRequest[] = { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_k, chLatin_e, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRevokeResult[] = { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_k, chLatin_e, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagRSAKeyPair[] = { chLatin_R, chLatin_S, chLatin_A, chLatin_K, chLatin_e, chLatin_y, chLatin_P, chLatin_a, chLatin_i, chLatin_r, chNull }; const XMLCh XKMSConstants::s_tagService[] = { chLatin_S, chLatin_e, chLatin_r, chLatin_v, chLatin_i, chLatin_c, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagSignature[] = { chLatin_S, chLatin_i, chLatin_g, chLatin_n, chLatin_a, chLatin_t, chLatin_u, chLatin_r, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagStatus[] = { chLatin_S, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chNull }; const XMLCh XKMSConstants::s_tagStatusRequest[] = { chLatin_S, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagStatusResult[] = { chLatin_S, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagStatusValue[] = { chLatin_S, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagSuccess[] = { chLatin_S, chLatin_u, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull }; const XMLCh XKMSConstants::s_tagUnverifiedKeyBinding[] = { chLatin_U, chLatin_n, chLatin_v, chLatin_e, chLatin_r, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_K, chLatin_e, chLatin_y, chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XKMSConstants::s_tagUseKeyWith[] = { chLatin_U, chLatin_s, chLatin_e, chLatin_K, chLatin_e, chLatin_y, chLatin_W, chLatin_i, chLatin_t, chLatin_h, chNull }; const XMLCh XKMSConstants::s_tagValidateRequest[] = { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_a, chLatin_t, chLatin_e, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagValidateResult[] = { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_a, chLatin_t, chLatin_e, chLatin_R, chLatin_e, chLatin_s, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagValidReason[] = { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_R, chLatin_e, chLatin_a, chLatin_s, chLatin_o, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagValidityInterval[] = { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_i, chLatin_t, chLatin_y, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_r, chLatin_v, chLatin_a, chLatin_l, chNull }; const XMLCh XKMSConstants::s_tagValue[] = { chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh XKMSConstants::s_tagX509Cert[] = { chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_C, chLatin_e, chLatin_r, chLatin_t, chNull }; const XMLCh XKMSConstants::s_tagX509Chain[] = { chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_C, chLatin_h, chLatin_a, chLatin_i, chLatin_n, chNull }; const XMLCh XKMSConstants::s_tagResultMajorCodes[][16] = { { chLatin_N, chLatin_o, chLatin_n, chLatin_e, chNull }, { chLatin_S, chLatin_u, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull }, { chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_M, chLatin_i, chLatin_s, chLatin_m, chLatin_a, chLatin_t, chLatin_c, chLatin_h, chNull }, { chLatin_S, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chNull }, { chLatin_R, chLatin_e, chLatin_c, chLatin_e, chLatin_i, chLatin_v, chLatin_e, chLatin_r, chNull }, { chLatin_R, chLatin_e, chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_n, chLatin_t, chNull }, { chLatin_P, chLatin_e, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }, }; const XMLCh XKMSConstants::s_tagResultMinorCodes[][20] = { { chLatin_N, chLatin_o, chLatin_n, chLatin_e, chNull }, { chLatin_N, chLatin_o, chLatin_M, chLatin_a, chLatin_t, chLatin_c, chLatin_h, chNull }, { chLatin_T, chLatin_o, chLatin_o, chLatin_M, chLatin_a, chLatin_n, chLatin_y, chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_s, chNull }, { chLatin_I, chLatin_n, chLatin_c, chLatin_o, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_t, chLatin_e, chNull }, { chLatin_F, chLatin_a, chLatin_i, chLatin_l, chLatin_u, chLatin_r, chLatin_e, chNull }, { chLatin_R, chLatin_e, chLatin_f, chLatin_u, chLatin_s, chLatin_e, chLatin_d, chNull }, { chLatin_N, chLatin_o, chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }, { chLatin_M, chLatin_e, chLatin_s, chLatin_s, chLatin_a, chLatin_g, chLatin_e, chLatin_N, chLatin_o, chLatin_t, chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d, chNull }, { chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_I, chLatin_d, chNull }, { chLatin_R, chLatin_e, chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_n, chLatin_t, chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_i, chLatin_r, chLatin_e, chLatin_d, chNull }, { chLatin_N, chLatin_o, chLatin_t, chLatin_S, chLatin_y, chLatin_n, chLatin_c, chLatin_h, chLatin_r, chLatin_o, chLatin_n, chLatin_o, chLatin_u, chLatin_s, chNull }, }; const XMLCh XKMSConstants::s_tagStatusValueCodes[][15] = { { chLatin_U, chLatin_n, chLatin_d, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_e, chLatin_d, chNull }, { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chNull }, { chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chNull }, { chLatin_I, chLatin_n, chLatin_d, chLatin_e, chLatin_t, chLatin_e, chLatin_r, chLatin_m, chLatin_i, chLatin_n, chLatin_a, chLatin_t, chLatin_e, chNull }, }; const XMLCh XKMSConstants::s_tagStatusReasonCodes[][17] = { { chLatin_U, chLatin_n, chLatin_d, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_e, chLatin_d, chNull }, { chLatin_I, chLatin_s, chLatin_s, chLatin_u, chLatin_e, chLatin_r, chLatin_T, chLatin_r, chLatin_u, chLatin_s, chLatin_t, chNull }, { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_S, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chNull }, { chLatin_V, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_i, chLatin_t, chLatin_y, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_r, chLatin_v, chLatin_a, chLatin_l, chNull }, { chLatin_S, chLatin_i, chLatin_g, chLatin_n, chLatin_a, chLatin_t, chLatin_u, chLatin_r, chLatin_e, chNull }, }; // -------------------------------------------------------------------------------- // Constant Strings Creation and Deletion // -------------------------------------------------------------------------------- void XKMSConstants::create() { // Set up the static strings s_unicodeStrURIXKMS = XMLString::transcode(URI_ID_XKMS); s_unicodeStrURISOAP11 = XMLString::transcode(URI_ID_SOAP11); s_unicodeStrURISOAP12 = XMLString::transcode(URI_ID_SOAP12); } void XKMSConstants::destroy() { XMLCh* temp1 = const_cast(s_unicodeStrURIXKMS); XMLCh* temp2 = const_cast(s_unicodeStrURISOAP11); XMLCh* temp3 = const_cast(s_unicodeStrURISOAP12); XSEC_RELEASE_XMLCH(temp1); XSEC_RELEASE_XMLCH(temp2); XSEC_RELEASE_XMLCH(temp3); s_unicodeStrURIXKMS = NULL; s_unicodeStrURISOAP11 = NULL; s_unicodeStrURISOAP12 = NULL; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSCompoundRequestImpl.cpp000644 001751 001751 00000016363 12003301053 025644 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundRequestImpl := Implementation of CompoundRequest Messages * * $Id: XKMSCompoundRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSCompoundRequestImpl.hpp" #include "XKMSLocateRequestImpl.hpp" #include "XKMSValidateRequestImpl.hpp" #include "XKMSRegisterRequestImpl.hpp" #include "XKMSRevokeRequestImpl.hpp" #include "XKMSReissueRequestImpl.hpp" #include "XKMSRecoverRequestImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSCompoundRequestImpl::XKMSCompoundRequestImpl( const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg) { } XKMSCompoundRequestImpl::XKMSCompoundRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg) { } XKMSCompoundRequestImpl::~XKMSCompoundRequestImpl() { RequestListVectorType::iterator i; for (i = m_requestList.begin() ; i != m_requestList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSCompoundRequestImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSCompoundRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagCompoundRequest)) { throw XSECException(XSECException::XKMSError, "XKMSCompoundRequest::load - called incorrect node"); } // Load the base message m_request.load(); // Now find all Request elements DOMElement * e = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (e != NULL) { if (strEquals(getXKMSLocalName(e), XKMSConstants::s_tagLocateRequest) || strEquals(getXKMSLocalName(e), XKMSConstants::s_tagValidateRequest)) { // Have a legitimate request to load XKMSMessageAbstractTypeImpl * m = (XKMSMessageAbstractTypeImpl *) m_factory.newMessageFromDOM(e); m_requestList.push_back((XKMSRequestAbstractTypeImpl *) m); } e = findNextElementChild(e); } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSCompoundRequestImpl::createBlankCompoundRequest( const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagCompoundRequest, service, id); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSCompoundRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::CompoundRequest; } int XKMSCompoundRequestImpl::getRequestListSize(void) { return (int) m_requestList.size(); } XKMSRequestAbstractType * XKMSCompoundRequestImpl::getRequestListItem(int item) { if (item < 0 || item >= (int) m_requestList.size()) { throw XSECException(XSECException::XKMSError, "XKMSCompoundRequest::getRequestListItem - item out of range"); } return m_requestList[item]; } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- XKMSLocateRequest * XKMSCompoundRequestImpl::createLocateRequest( const XMLCh * service, const XMLCh * id) { XKMSLocateRequest * r = m_factory.createLocateRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSValidateRequest * XKMSCompoundRequestImpl::createValidateRequest( const XMLCh * service, const XMLCh * id) { XKMSValidateRequest * r = m_factory.createValidateRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRegisterRequest * XKMSCompoundRequestImpl::createRegisterRequest( const XMLCh * service, const XMLCh * id) { XKMSRegisterRequest * r = m_factory.createRegisterRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRevokeRequest * XKMSCompoundRequestImpl::createRevokeRequest( const XMLCh * service, const XMLCh * id) { XKMSRevokeRequest * r = m_factory.createRevokeRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSReissueRequest * XKMSCompoundRequestImpl::createReissueRequest( const XMLCh * service, const XMLCh * id) { XKMSReissueRequest * r = m_factory.createReissueRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRecoverRequest * XKMSCompoundRequestImpl::createRecoverRequest( const XMLCh * service, const XMLCh * id) { XKMSRecoverRequest * r = m_factory.createRecoverRequest(service, m_msg.mp_env->getParentDocument(), id); m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeKeyBindingImpl.hpp000644 001751 001751 00000004151 12003301053 025703 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeKeyBinding := Implementation for RevokeKeyBinding * * $Id:$ * */ #ifndef XKMSREVOKEKEYBINDINGIMPL_INCLUDE #define XKMSREVOKEKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSStatusImpl; class XKMSRevokeKeyBindingImpl : public XKMSRevokeKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSRevokeKeyBindingImpl( const XSECEnv * env ); XKMSRevokeKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRevokeKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRevokeKeyBinding(XKMSStatus::StatusValue status); // Interface virtual XKMSStatus * getStatus(void) const; // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: XKMSStatusImpl * mp_status; // Unimplemented XKMSRevokeKeyBindingImpl(void); XKMSRevokeKeyBindingImpl(const XKMSRevokeKeyBindingImpl &); XKMSRevokeKeyBindingImpl & operator = (const XKMSRevokeKeyBindingImpl &); }; #endif /* XKMSREVOKEKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverRequestImpl.cpp000644 001751 001751 00000017400 12003301053 025456 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverRequestImpl := Implementation for RegisterRequest Messages * * $Id$ * */ // XSEC Includes #include #include #include #include #include #include #include #include "XKMSRecoverRequestImpl.hpp" #include "XKMSRecoverKeyBindingImpl.hpp" #include "XKMSAuthenticationImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRecoverRequestImpl::XKMSRecoverRequestImpl(const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_authentication(NULL), mp_recoverKeyBinding(NULL) { } XKMSRecoverRequestImpl::XKMSRecoverRequestImpl(const XSECEnv * env, DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_authentication(NULL), mp_recoverKeyBinding(NULL) { } XKMSRecoverRequestImpl::~XKMSRecoverRequestImpl() { if (mp_authentication != NULL) delete mp_authentication; if (mp_recoverKeyBinding != NULL) delete mp_recoverKeyBinding; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSRecoverRequestImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRecoverRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRecoverRequest)) { throw XSECException(XSECException::XKMSError, "XKMSRecoverRequest::load - called on incorrect node"); } // Load the base message m_request.load(); // Now check for any RecoverKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRecoverKeyBinding)) { tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL) { XSECnew(mp_recoverKeyBinding, XKMSRecoverKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_recoverKeyBinding->load(); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRecoverRequest::load - Expected RecoverKeyBinding node"); } // Authentication Element if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagAuthentication)) { XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env, tmpElt)); mp_authentication->load(mp_recoverKeyBinding->getId()); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRecoverRequest::load - Expected Authentication node"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRecoverRequestImpl:: createBlankRecoverRequest(const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagRecoverRequest, service, id); } // -------------------------------------------------------------------------------- // MessageType // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRecoverRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RecoverRequest; } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- XKMSRecoverKeyBinding * XKMSRecoverRequestImpl::getRecoverKeyBinding(void) const { return mp_recoverKeyBinding; } XKMSAuthentication * XKMSRecoverRequestImpl::getAuthentication (void) const { return mp_authentication; } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- XKMSRecoverKeyBinding * XKMSRecoverRequestImpl::addRecoverKeyBinding(XKMSStatus::StatusValue status) { if (mp_recoverKeyBinding != NULL) return mp_recoverKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_recoverKeyBinding, XKMSRecoverKeyBindingImpl(m_msg.mp_env)); DOMElement * elt = mp_recoverKeyBinding->createBlankRecoverKeyBinding(status); // Insert DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagAuthentication) && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode)) { be = findNextElementChild(be); } if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_recoverKeyBinding; } m_msg.mp_messageAbstractTypeElement->insertBefore(elt, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_recoverKeyBinding; } XKMSAuthentication * XKMSRecoverRequestImpl::addAuthentication(void) { if (mp_authentication != NULL) return mp_authentication; if (mp_recoverKeyBinding == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRecoverRequestImpl::addAuthentication - called prior to key infos being added"); } XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env)); DOMElement * e = mp_authentication->createBlankAuthentication(mp_recoverKeyBinding->getId()); DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode)) be = findNextElementChild(be); if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_authentication; } m_msg.mp_messageAbstractTypeElement->insertBefore(e, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_authentication; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRegisterResultImpl.cpp000644 001751 001751 00000025674 12057275725 025530 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterResultImpl := Implementation of RegisterResult Messages * * $Id: XKMSRegisterResultImpl.cpp 1375700 2012-08-21 18:08:00Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include "XKMSRegisterResultImpl.hpp" #include "XKMSKeyBindingImpl.hpp" #include "XKMSRSAKeyPairImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRegisterResultImpl::XKMSRegisterResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg), mp_RSAKeyPair(NULL), mp_privateKeyElement(NULL) { } XKMSRegisterResultImpl::XKMSRegisterResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg), mp_RSAKeyPair(NULL), mp_privateKeyElement(NULL) { } XKMSRegisterResultImpl::~XKMSRegisterResultImpl() { XKMSRegisterResultImpl::KeyBindingVectorType::iterator i; for (i = m_keyBindingList.begin() ; i != m_keyBindingList.end(); ++i) { delete (*i); } if (mp_RSAKeyPair != NULL) delete mp_RSAKeyPair; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSRegisterResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRegisterResult)) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagKeyBinding); if (nl != NULL) { XKMSKeyBindingImpl * kb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_keyBindingList.push_back(kb); kb->load(); } } nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagPrivateKey); if (nl != NULL) mp_privateKeyElement = (DOMElement *) nl->item(0); // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSRegisterResultImpl::createBlankRegisterResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagRegisterResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRegisterResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RegisterResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSRegisterResultImpl::getKeyBindingSize(void) const { return (int) m_keyBindingList.size(); } XKMSKeyBinding * XKMSRegisterResultImpl::getKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_keyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getKeyBindingItem - item out of range"); } return m_keyBindingList[item]; } XKMSKeyBinding * XKMSRegisterResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) { XKMSKeyBindingImpl * u; XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env)); m_keyBindingList.push_back(u); DOMElement * e = u->createBlankKeyBinding(status); // Append the element DOMElement * c = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (c != NULL) { if (strEquals(getXKMSLocalName(c), XKMSConstants::s_tagPrivateKey)) break; } if (c != NULL) { m_msg.mp_messageAbstractTypeElement->insertBefore(e, c); if (m_msg.mp_env->getPrettyPrintFlag()) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } } else { m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } return u; } // -------------------------------------------------------------------------------- // RSAKeyPair handling // -------------------------------------------------------------------------------- XKMSRSAKeyPair * XKMSRegisterResultImpl::getRSAKeyPair(const char * passPhrase) { // Already done? if (mp_RSAKeyPair != NULL) return mp_RSAKeyPair; // Nope - can we do it? if (mp_privateKeyElement == NULL) return NULL; // Yep! Load the key unsigned char kbuf[XSEC_MAX_HASH_SIZE]; unsigned int len = CalculateXKMSKEK((unsigned char *) passPhrase, (int) strlen(passPhrase), kbuf, XSEC_MAX_HASH_SIZE); if (len == 0) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getRSAKeyPair - error deriving KEK"); } XSECProvider prov; XENCCipher * cipher = prov.newCipher(m_msg.mp_env->getParentDocument()); // Find the encrypted info DOMNode * n = findXENCNode(mp_privateKeyElement, "EncryptedData"); // Load into the Cipher class XENCEncryptedData * xed = cipher->loadEncryptedData((DOMElement *) n); if (xed == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getRSAKeyPair - error loading encrypted data"); } // Setup the appropriate key if (xed->getEncryptionMethod() == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getRSAKeyPair - no in EncryptedData"); } // Now find if we can get an algorithm for this URI XSECAlgorithmHandler *handler; handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( xed->getEncryptionMethod()->getAlgorithm()); if (handler == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getRSAKeyPair - unable to handle algorithm in EncryptedData"); } XSECCryptoKey * sk = handler->createKeyForURI( xed->getEncryptionMethod()->getAlgorithm(), (XMLByte *) kbuf, len); memset(kbuf, 0, XSEC_MAX_HASH_SIZE); cipher->setKey(sk); cipher->decryptElement(); // WooHoo - if we get this far things are looking good! DOMElement * kp = findFirstElementChild(mp_privateKeyElement); if (kp == NULL || !strEquals(getXKMSLocalName(kp), XKMSConstants::s_tagRSAKeyPair)) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::getRSAKeyPair - private key did not decrypt to RSAKeyPair"); } XSECnew(mp_RSAKeyPair, XKMSRSAKeyPairImpl(m_msg.mp_env, kp)); mp_RSAKeyPair->load(); return mp_RSAKeyPair; } XENCEncryptedData * XKMSRegisterResultImpl::setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI) { // Try to set up the key first - if this fails, don't want to have added the // XML const XMLCh * uri; safeBuffer algorithmSB; if (em != ENCRYPT_NONE) { if (encryptionMethod2URI(algorithmSB, em) != true) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::setRSAKeyPair - Unknown encryption method"); } uri = algorithmSB.sbStrToXMLCh(); } else uri = algorithmURI; // Find if we can get an algorithm for this URI XSECAlgorithmHandler *handler; handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( uri); if (handler == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::setRSAKeyPair - unable to handle algorithm"); } unsigned char kbuf[XSEC_MAX_HASH_SIZE]; unsigned int len = CalculateXKMSKEK((unsigned char *) passPhrase, (int) strlen(passPhrase), kbuf, XSEC_MAX_HASH_SIZE); if (len == 0) { throw XSECException(XSECException::XKMSError, "XKMSRegisterResult::setRSAKeyPair - error deriving KEK"); } XSECCryptoKey * sk = handler->createKeyForURI( uri, (XMLByte *) kbuf, len); memset(kbuf, 0, XSEC_MAX_HASH_SIZE); // Get some setup values safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagPrivateKey); // Create a PrivateKey to add this to DOMElement * pk = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); m_msg.mp_env->doPrettyPrint(pk); // Add it to the request doc m_msg.mp_messageAbstractTypeElement->appendChild(pk); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); // Now create the RSA structure XKMSRSAKeyPairImpl * rsa; XSECnew(rsa, XKMSRSAKeyPairImpl(m_msg.mp_env)); DOMElement * e = rsa->createBlankXKMSRSAKeyPairImpl(Modulus, Exponent, P, Q, DP, DQ, InverseQ, D); // Add it to the PrivateKey pk->appendChild(e); m_msg.mp_env->doPrettyPrint(pk); // Encrypt all of this for future use XENCCipher * cipher = m_prov.newCipher(m_msg.mp_env->getParentDocument()); cipher->setKey(sk); cipher->encryptElementContent(pk, ENCRYPT_NONE, uri); // Now load the encrypted data back in return cipher->loadEncryptedData(findFirstElementChild(pk)); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverResultImpl.cpp000644 001751 001751 00000026342 12057275725 025342 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverResultImpl := Implementation of RecoverResult Messages * * $Id$ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include "XKMSRecoverResultImpl.hpp" #include "XKMSKeyBindingImpl.hpp" #include "XKMSRSAKeyPairImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRecoverResultImpl::XKMSRecoverResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg), mp_RSAKeyPair(NULL), mp_privateKeyElement(NULL) { } XKMSRecoverResultImpl::XKMSRecoverResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg), mp_RSAKeyPair(NULL), mp_privateKeyElement(NULL) { } XKMSRecoverResultImpl::~XKMSRecoverResultImpl() { XKMSRecoverResultImpl::KeyBindingVectorType::iterator i; for (i = m_keyBindingList.begin() ; i != m_keyBindingList.end(); ++i) { delete (*i); } if (mp_RSAKeyPair != NULL) delete mp_RSAKeyPair; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSRecoverResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRecoverResult)) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagKeyBinding); if (nl != NULL) { XKMSKeyBindingImpl * kb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_keyBindingList.push_back(kb); kb->load(); } } nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagPrivateKey); if (nl != NULL) mp_privateKeyElement = (DOMElement *) nl->item(0); // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSRecoverResultImpl::createBlankRecoverResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagRecoverResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRecoverResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RecoverResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSRecoverResultImpl::getKeyBindingSize(void) const { return (int) m_keyBindingList.size(); } XKMSKeyBinding * XKMSRecoverResultImpl::getKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_keyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getKeyBindingItem - item out of range"); } return m_keyBindingList[item]; } XKMSKeyBinding * XKMSRecoverResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) { XKMSKeyBindingImpl * u; XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env)); m_keyBindingList.push_back(u); DOMElement * e = u->createBlankKeyBinding(status); // Append the element DOMElement * c = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (c != NULL) { if (strEquals(getXKMSLocalName(c), XKMSConstants::s_tagPrivateKey)) break; } if (c != NULL) { m_msg.mp_messageAbstractTypeElement->insertBefore(e, c); if (m_msg.mp_env->getPrettyPrintFlag()) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } } else { m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } return u; } // -------------------------------------------------------------------------------- // RSAKeyPair handling // -------------------------------------------------------------------------------- XKMSRSAKeyPair * XKMSRecoverResultImpl::getRSAKeyPair(const char * passPhrase) { // Already done? if (mp_RSAKeyPair != NULL) return mp_RSAKeyPair; // Nope - can we do it? if (mp_privateKeyElement == NULL) return NULL; // Yep! Load the key unsigned char kbuf[XSEC_MAX_HASH_SIZE]; unsigned int len = CalculateXKMSKEK((unsigned char *) passPhrase, (int) strlen(passPhrase), kbuf, XSEC_MAX_HASH_SIZE); if (len == 0) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getRSAKeyPair - error deriving KEK"); } XSECProvider prov; XENCCipher * cipher = prov.newCipher(m_msg.mp_env->getParentDocument()); // Find the encrypted info DOMNode * n = findXENCNode(mp_privateKeyElement, "EncryptedData"); // Load into the Cipher class XENCEncryptedData * xed = cipher->loadEncryptedData((DOMElement *) n); if (xed == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getRSAKeyPair - error loading encrypted data"); } // Setup the appropriate key if (xed->getEncryptionMethod() == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getRSAKeyPair - no in EncryptedData"); } // Now find if we can get an algorithm for this URI XSECAlgorithmHandler *handler; handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( xed->getEncryptionMethod()->getAlgorithm()); if (handler == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getRSAKeyPair - unable to handle algorithm in EncryptedData"); } XSECCryptoKey * sk = handler->createKeyForURI( xed->getEncryptionMethod()->getAlgorithm(), (XMLByte *) kbuf, len); memset(kbuf, 0, XSEC_MAX_HASH_SIZE); cipher->setKey(sk); cipher->decryptElement(); // WooHoo - if we get this far things are looking good! DOMElement * kp = findFirstElementChild(mp_privateKeyElement); if (kp == NULL || !strEquals(getXKMSLocalName(kp), XKMSConstants::s_tagRSAKeyPair)) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::getRSAKeyPair - private key did not decrypt to RSAKeyPair"); } XSECnew(mp_RSAKeyPair, XKMSRSAKeyPairImpl(m_msg.mp_env, kp)); mp_RSAKeyPair->load(); return mp_RSAKeyPair; } XENCEncryptedData * XKMSRecoverResultImpl::setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI) { // Try to set up the key first - if this fails, don't want to have added the // XML const XMLCh * uri; safeBuffer algorithmSB; if (em != ENCRYPT_NONE) { if (encryptionMethod2URI(algorithmSB, em) != true) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::setRSAKeyPair - Unknown encryption method"); } uri = algorithmSB.sbStrToXMLCh(); } else uri = algorithmURI; // Find if we can get an algorithm for this URI XSECAlgorithmHandler *handler; handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( uri); if (handler == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::setRSAKeyPair - unable to handle algorithm"); } unsigned char kbuf[XSEC_MAX_HASH_SIZE]; unsigned int len = CalculateXKMSKEK((unsigned char *) passPhrase, (int) strlen(passPhrase), kbuf, XSEC_MAX_HASH_SIZE); if (len == 0) { throw XSECException(XSECException::XKMSError, "XKMSRecoverResult::setRSAKeyPair - error deriving KEK"); } XSECCryptoKey * sk = handler->createKeyForURI( uri, (XMLByte *) kbuf, len); memset(kbuf, 0, XSEC_MAX_HASH_SIZE); // Get some setup values safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagPrivateKey); // Create a PrivateKey to add this to DOMElement * pk = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); m_msg.mp_env->doPrettyPrint(pk); // Add it to the request doc m_msg.mp_messageAbstractTypeElement->appendChild(pk); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); // Now create the RSA structure XKMSRSAKeyPairImpl * rsa; XSECnew(rsa, XKMSRSAKeyPairImpl(m_msg.mp_env)); DOMElement * e = rsa->createBlankXKMSRSAKeyPairImpl(Modulus, Exponent, P, Q, DP, DQ, InverseQ, D); // Add it to the PrivateKey pk->appendChild(e); m_msg.mp_env->doPrettyPrint(pk); // Encrypt all of this for future use XENCCipher * cipher = m_prov.newCipher(m_msg.mp_env->getParentDocument()); cipher->setKey(sk); cipher->encryptElementContent(pk, ENCRYPT_NONE, uri); // Now load the encrypted data back in return cipher->loadEncryptedData(findFirstElementChild(pk)); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidateResultImpl.hpp000644 001751 001751 00000005164 12003301053 025441 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateResultImpl := Implementation of ValidateResult Messages * * $Id: XKMSValidateResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDATERESULTIMPL_INCLUDE #define XKMSVALIDATERESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSKeyBindingImpl; class XKMSValidateResultImpl : public XKMSValidateResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSValidateResultImpl( const XSECEnv * env ); XKMSValidateResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSValidateResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankValidateResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getKeyBindingSize(void) const; virtual XKMSKeyBinding * getKeyBindingItem(int item) const; virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyBindingVectorType; #else typedef std::vector KeyBindingVectorType; #endif KeyBindingVectorType m_keyBindingList; // Unimplemented XKMSValidateResultImpl(const XKMSValidateResultImpl &); XKMSValidateResultImpl & operator = (const XKMSValidateResultImpl &); }; #endif /* XKMSVALIDATERESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeResultImpl.hpp000644 001751 001751 00000005310 12003301053 025134 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeResultImpl := Implementation of RegisterResult Messages * * $Id: XKMSRevokeResultImpl.hpp 351366 2005-06-04 11:44:55Z blautenb $ * */ #ifndef XKMSREVOKERESULTIMPL_INCLUDE #define XKMSREVOKERESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSKeyBindingImpl; class XKMSRevokeResultImpl : public XKMSRevokeResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRevokeResultImpl( const XSECEnv * env ); XKMSRevokeResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRevokeResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRevokeResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getKeyBindingSize(void) const; virtual XKMSKeyBinding * getKeyBindingItem(int item) const; virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyBindingVectorType; #else typedef std::vector KeyBindingVectorType; #endif KeyBindingVectorType m_keyBindingList; // Unimplemented XKMSRevokeResultImpl(void); XKMSRevokeResultImpl(const XKMSRevokeResultImpl &); XKMSRevokeResultImpl & operator = (const XKMSRevokeResultImpl &); }; #endif /* XKMSREVOKERESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSCompoundResultImpl.cpp000644 001751 001751 00000020713 12003301053 025464 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundResultImpl := Implementation of CompoundResult Messages * * $Id: XKMSCompoundResultImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSCompoundResultImpl.hpp" #include "XKMSLocateResultImpl.hpp" #include "XKMSStatusResultImpl.hpp" #include "XKMSValidateResultImpl.hpp" #include "XKMSRegisterResultImpl.hpp" #include "XKMSRevokeResultImpl.hpp" #include "XKMSReissueResultImpl.hpp" #include "XKMSRecoverResultImpl.hpp" #include "XKMSResultImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSCompoundResultImpl::XKMSCompoundResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSCompoundResultImpl::XKMSCompoundResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg){ } XKMSCompoundResultImpl::~XKMSCompoundResultImpl() { ResultListVectorType::iterator i; for (i = m_resultList.begin() ; i != m_resultList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSCompoundResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSCompoundResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagCompoundResult)) { throw XSECException(XSECException::XKMSError, "XKMSCompoundResult::load - called incorrect node"); } // Load the base message m_result.load(); // Now find all Result elements DOMElement * e = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (e != NULL) { if (strEquals(getXKMSLocalName(e), XKMSConstants::s_tagLocateResult) || strEquals(getXKMSLocalName(e), XKMSConstants::s_tagValidateResult)) { // Have a legitimate Result to load XKMSMessageAbstractTypeImpl * m = (XKMSMessageAbstractTypeImpl *) m_factory.newMessageFromDOM(e); m_resultList.push_back((XKMSResultTypeImpl *) m); } e = findNextElementChild(e); } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSCompoundResultImpl::createBlankCompoundResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagCompoundResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSCompoundResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::CompoundResult; } int XKMSCompoundResultImpl::getResultListSize(void) { return (int) m_resultList.size(); } XKMSResultType * XKMSCompoundResultImpl::getResultListItem(int item) { if (item < 0 || item >= (int) m_resultList.size()) { throw XSECException(XSECException::XKMSError, "XKMSCompoundResult::getResultListItem - item out of range"); } return m_resultList[item]; } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- XKMSLocateResult * XKMSCompoundResultImpl::createLocateResult( XKMSLocateRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSLocateResult * r = m_factory.createLocateResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSValidateResult * XKMSCompoundResultImpl::createValidateResult( XKMSValidateRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSValidateResult * r = m_factory.createValidateResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSStatusResult * XKMSCompoundResultImpl::createStatusResult( XKMSStatusRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSStatusResult * r = m_factory.createStatusResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRegisterResult * XKMSCompoundResultImpl::createRegisterResult( XKMSRegisterRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSRegisterResult * r = m_factory.createRegisterResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRevokeResult * XKMSCompoundResultImpl::createRevokeResult( XKMSRevokeRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSRevokeResult * r = m_factory.createRevokeResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSRecoverResult * XKMSCompoundResultImpl::createRecoverResult( XKMSRecoverRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSRecoverResult * r = m_factory.createRecoverResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSReissueResult * XKMSCompoundResultImpl::createReissueResult( XKMSReissueRequest * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSReissueResult * r = m_factory.createReissueResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } XKMSResult * XKMSCompoundResultImpl::createResult( XKMSRequestAbstractType * request, ResultMajor rmaj, ResultMinor rmin, const XMLCh * id) { XKMSResult * r = m_factory.createResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id); m_resultList.push_back((XKMSResultTypeImpl*) r); m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement()); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return r; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeKeyBindingImpl.cpp000644 001751 001751 00000007415 12003301053 025704 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeKeyBindingImpl := Implementation for RevokeKeyBinding * * $Id:$ * */ // XSEC Includes #include #include #include #include #include #include "XKMSRevokeKeyBindingImpl.hpp" #include "XKMSStatusImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRevokeKeyBindingImpl::XKMSRevokeKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { mp_status = NULL; } XKMSRevokeKeyBindingImpl::XKMSRevokeKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { mp_status = NULL; } XKMSRevokeKeyBindingImpl::~XKMSRevokeKeyBindingImpl() { if (mp_status != NULL) delete mp_status; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSRevokeKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRevokeKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); /* Find the status element */ DOMNodeList * nl = mp_keyBindingAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagStatus); if (nl == NULL || nl->getLength() != 1) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRevokeKeyBinding::load - Status value not found"); } XSECnew(mp_status, XKMSStatusImpl(mp_env, (DOMElement*) nl->item(0))); mp_status->load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRevokeKeyBindingImpl::createBlankRevokeKeyBinding(XKMSStatus::StatusValue status) { DOMElement * ret = XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagRevokeKeyBinding); mp_env->doPrettyPrint(ret); // Create the status element XSECnew(mp_status, XKMSStatusImpl(mp_env)); ret->appendChild(mp_status->createBlankStatus(status)); mp_env->doPrettyPrint(ret); // Must have an Id XKMSKeyBindingAbstractTypeImpl::setId(); return ret; } // -------------------------------------------------------------------------------- // Status handling // -------------------------------------------------------------------------------- XKMSStatus * XKMSRevokeKeyBindingImpl::getStatus(void) const { return mp_status; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSCompoundResultImpl.hpp000644 001751 001751 00000010040 12003301053 025461 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundResultImpl := Implementation of CompoundResult Messages * * $Id: XKMSCompoundResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSCOMPOUNDRESULTIMPL_INCLUDE #define XKMSCOMPOUNDRESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include "XKMSMessageFactoryImpl.hpp" class XKMSCompoundResultImpl : public XKMSCompoundResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSCompoundResultImpl( const XSECEnv * env ); XKMSCompoundResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSCompoundResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankCompoundResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Getter methods virtual int getResultListSize(void); virtual XKMSResultType * getResultListItem(int item); // Setter Methods virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSResult * createResult( XKMSRequestAbstractType * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, ResultMajor rmaj, ResultMinor rmin = XKMSResultTypeImpl::NoneMinor, const XMLCh * id = NULL); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector ResultListVectorType; #else typedef std::vector ResultListVectorType; #endif ResultListVectorType m_resultList; /* Used to consume and produce messages in the list */ XKMSMessageFactoryImpl m_factory; // Unimplemented XKMSCompoundResultImpl(const XKMSCompoundResultImpl &); XKMSCompoundResultImpl & operator = (const XKMSCompoundResultImpl &); }; #endif /* XKMSCOMPOUNDRESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSUnverifiedKeyBindingImpl.hpp000644 001751 001751 00000004006 12003301053 026547 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUnverifiedKeyBindingImpl := Implementation for UnverifiedKeyBinding * * $Id: XKMSUnverifiedKeyBindingImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSUNVERIFIEDKEYBINDINGIMPL_INCLUDE #define XKMSUNVERIFIEDKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSUnverifiedKeyBindingImpl : public XKMSUnverifiedKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSUnverifiedKeyBindingImpl( const XSECEnv * env ); XKMSUnverifiedKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSUnverifiedKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankUnverifiedKeyBinding(void); // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: // Unimplemented XKMSUnverifiedKeyBindingImpl(void); XKMSUnverifiedKeyBindingImpl(const XKMSUnverifiedKeyBindingImpl &); XKMSUnverifiedKeyBindingImpl & operator = (const XKMSUnverifiedKeyBindingImpl &); }; #endif /* XKMSUNVERIFIEDKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp000644 001751 001751 00000034400 12003301053 027050 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBindingAbstractTypeImpl := Implementation of base for KeyBinding elements * * $Id: XKMSKeyBindingAbstractTypeImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" #include "XKMSUseKeyWithImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructor/Destructor // -------------------------------------------------------------------------------- XKMSKeyBindingAbstractTypeImpl::XKMSKeyBindingAbstractTypeImpl( const XSECEnv * env) : mp_keyBindingAbstractTypeElement(NULL), mp_env(env), mp_idAttr(NULL), mp_keyUsageSignatureElement(NULL), mp_keyUsageEncryptionElement(NULL), mp_keyUsageExchangeElement(NULL), mp_keyInfoElement(NULL) { XSECnew(mp_keyInfoList, DSIGKeyInfoList(mp_env)); } XKMSKeyBindingAbstractTypeImpl::XKMSKeyBindingAbstractTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : mp_keyBindingAbstractTypeElement(node), mp_env(env), mp_idAttr(NULL), mp_keyUsageSignatureElement(NULL), mp_keyUsageEncryptionElement(NULL), mp_keyUsageExchangeElement(NULL), mp_keyInfoElement(NULL) { XSECnew(mp_keyInfoList, DSIGKeyInfoList(mp_env)); } XKMSKeyBindingAbstractTypeImpl::~XKMSKeyBindingAbstractTypeImpl() { if (mp_keyInfoList != NULL) delete mp_keyInfoList; UseKeyWithVectorType::iterator i; for (i = m_useKeyWithList.begin(); i != m_useKeyWithList.end(); ++i) delete (*i); } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSKeyBindingAbstractTypeImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSKeyBindingAbstractTypeImpl::load - called on empty DOM"); } // Id mp_idAttr = mp_keyBindingAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId); DOMElement * tmpElt = findFirstElementChild(mp_keyBindingAbstractTypeElement); if (tmpElt != NULL && strEquals(getDSIGLocalName(tmpElt), XKMSConstants::s_tagKeyInfo)) { if (mp_keyInfoList != NULL) delete mp_keyInfoList; XSECnew(mp_keyInfoList, DSIGKeyInfoList(mp_env)); mp_keyInfoList->loadListFromXML(tmpElt); mp_keyInfoElement = tmpElt; tmpElt = findNextElementChild(tmpElt); } while (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagKeyUsage)) { DOMNode * txt = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (txt == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSKeyBindingAbstractTypeImpl::load - Require text node beneath "); } const XMLCh * usageStr = txt->getNodeValue(); int index = XMLString::indexOf(usageStr, chPound); if (index == -1 || XMLString::compareNString(usageStr, XKMSConstants::s_unicodeStrURIXKMS, index)) { throw XSECException(XSECException::XKMSError, "XKMSResultType::load - KeyUsage not in XKMS Name Space"); } usageStr = &usageStr[index+1]; if (strEquals(usageStr, XKMSConstants::s_tagEncryption)) { mp_keyUsageEncryptionElement = tmpElt; } else if (strEquals(usageStr, XKMSConstants::s_tagExchange)) { mp_keyUsageExchangeElement = tmpElt; } else if (strEquals(usageStr, XKMSConstants::s_tagSignature)) { mp_keyUsageSignatureElement = tmpElt; } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSKeyBindingAbstractTypeImpl::load - require Encryption, Exchange or Signature text node beneath "); } tmpElt = findNextElementChild(tmpElt); } while (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagUseKeyWith)) { XKMSUseKeyWithImpl *ukw; XSECnew(ukw, XKMSUseKeyWithImpl(mp_env, tmpElt)); m_useKeyWithList.push_back(ukw); ukw->load(); tmpElt = findNextElementChild(tmpElt); } } // -------------------------------------------------------------------------------- // Create Blank // -------------------------------------------------------------------------------- DOMElement * XKMSKeyBindingAbstractTypeImpl::createBlankKeyBindingAbstractType(const XMLCh * tag) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, tag); mp_keyBindingAbstractTypeElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_keyBindingAbstractTypeElement); return mp_keyBindingAbstractTypeElement; } // -------------------------------------------------------------------------------- // Getter methods // -------------------------------------------------------------------------------- DOMElement * XKMSKeyBindingAbstractTypeImpl::getElement(void) const { return mp_keyBindingAbstractTypeElement; } const XMLCh * XKMSKeyBindingAbstractTypeImpl::getId(void) const { return (mp_idAttr != NULL ? mp_idAttr->getNodeValue() : NULL); } DSIGKeyInfoList * XKMSKeyBindingAbstractTypeImpl::getKeyInfoList(void) const { return mp_keyInfoList; } bool XKMSKeyBindingAbstractTypeImpl::getEncryptionKeyUsage(void) const { return (mp_keyUsageEncryptionElement != NULL || (mp_keyUsageExchangeElement == NULL && mp_keyUsageSignatureElement == NULL)); } bool XKMSKeyBindingAbstractTypeImpl::getSignatureKeyUsage(void) const { return (mp_keyUsageSignatureElement != NULL || (mp_keyUsageExchangeElement == NULL && mp_keyUsageEncryptionElement == NULL)); } bool XKMSKeyBindingAbstractTypeImpl::getExchangeKeyUsage(void) const { return (mp_keyUsageExchangeElement != NULL || (mp_keyUsageEncryptionElement == NULL && mp_keyUsageSignatureElement == NULL)); } // -------------------------------------------------------------------------------- // KeyInfo elements // -------------------------------------------------------------------------------- DSIGKeyInfoList * XKMSKeyBindingAbstractTypeImpl::getKeyInfoList() { return mp_keyInfoList; } void XKMSKeyBindingAbstractTypeImpl::clearKeyInfo(void) { if (mp_keyInfoElement == NULL) return; if (mp_keyBindingAbstractTypeElement->removeChild(mp_keyInfoElement) != mp_keyInfoElement) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Attempted to remove KeyInfo node but it is no longer a child of "); } mp_keyInfoElement->release(); // No longer required mp_keyInfoElement = NULL; // Clear out the list mp_keyInfoList->empty(); } void XKMSKeyBindingAbstractTypeImpl::createKeyInfoElement(void) { if (mp_keyInfoElement != NULL) return; safeBuffer str; const XMLCh * prefixNS = mp_env->getDSIGNSPrefix(); makeQName(str, prefixNS, "KeyInfo"); mp_keyInfoElement = mp_keyInfoList->createKeyInfo(); // Needs to be first element DOMNode * insertBefore = mp_keyBindingAbstractTypeElement->getFirstChild(); if (insertBefore != NULL) { if (mp_env->getPrettyPrintFlag() == true) mp_keyBindingAbstractTypeElement->insertBefore(mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), insertBefore); mp_keyBindingAbstractTypeElement->insertBefore(mp_keyInfoElement, insertBefore); } else { mp_keyBindingAbstractTypeElement->appendChild(mp_keyInfoElement); mp_env->doPrettyPrint(mp_keyBindingAbstractTypeElement); } // Need to add the DS namespace if (prefixNS[0] == '\0') { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefixNS); } mp_keyInfoElement->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIDSIG); } DSIGKeyInfoName * XKMSKeyBindingAbstractTypeImpl::appendKeyName(const XMLCh * name, bool isDName) { createKeyInfoElement(); return mp_keyInfoList->appendKeyName(name, isDName); } DSIGKeyInfoValue * XKMSKeyBindingAbstractTypeImpl::appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) { createKeyInfoElement(); return mp_keyInfoList->appendDSAKeyValue(P, Q, G, Y); } DSIGKeyInfoValue * XKMSKeyBindingAbstractTypeImpl::appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) { createKeyInfoElement(); return mp_keyInfoList->appendRSAKeyValue(modulus, exponent); } DSIGKeyInfoX509 * XKMSKeyBindingAbstractTypeImpl::appendX509Data(void) { createKeyInfoElement(); return mp_keyInfoList->appendX509Data(); } DSIGKeyInfoPGPData * XKMSKeyBindingAbstractTypeImpl::appendPGPData(const XMLCh * id, const XMLCh * packet) { createKeyInfoElement(); return mp_keyInfoList->appendPGPData(id, packet); } DSIGKeyInfoSPKIData * XKMSKeyBindingAbstractTypeImpl::appendSPKIData(const XMLCh * sexp) { createKeyInfoElement(); return mp_keyInfoList->appendSPKIData(sexp); } DSIGKeyInfoMgmtData * XKMSKeyBindingAbstractTypeImpl::appendMgmtData(const XMLCh * data) { createKeyInfoElement(); return mp_keyInfoList->appendMgmtData(data); } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- void XKMSKeyBindingAbstractTypeImpl::setId(const XMLCh * id) { // Setup the id XMLCh * myId; if (id == NULL) myId = generateId(); mp_keyBindingAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id ? id : myId); if (id == NULL) XSEC_RELEASE_XMLCH(myId); #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) mp_keyBindingAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId); #endif mp_idAttr = mp_keyBindingAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId); } DOMElement * XKMSKeyBindingAbstractTypeImpl::setKeyUsage(const XMLCh * usage) { /* Create the element and string*/ safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagKeyUsage); /* Create the element */ DOMElement * e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); str.sbXMLChCat(usage); e->appendChild(doc->createTextNode(str.rawXMLChBuffer())); /* Now find where it goes */ DOMElement * t = findFirstElementChild(mp_keyBindingAbstractTypeElement); while (t != NULL) { if (!strEquals(getDSIGLocalName(t), XKMSConstants::s_tagKeyInfo) && !strEquals(getXKMSLocalName(t), XKMSConstants::s_tagKeyUsage)) break; t = findNextElementChild(t); } // Append the element if (t == NULL) { mp_keyBindingAbstractTypeElement->appendChild(e); mp_env->doPrettyPrint(mp_keyBindingAbstractTypeElement); } else { mp_keyBindingAbstractTypeElement->insertBefore(e, t); if (mp_env->getPrettyPrintFlag()) { mp_keyBindingAbstractTypeElement->insertBefore( mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), t); } } return e; } void XKMSKeyBindingAbstractTypeImpl::setEncryptionKeyUsage(void) { if (mp_keyUsageEncryptionElement != NULL) return; mp_keyUsageEncryptionElement = setKeyUsage(XKMSConstants::s_tagEncryption); } void XKMSKeyBindingAbstractTypeImpl::setSignatureKeyUsage(void) { if (mp_keyUsageSignatureElement != NULL) return; mp_keyUsageSignatureElement = setKeyUsage(XKMSConstants::s_tagSignature); } void XKMSKeyBindingAbstractTypeImpl::setExchangeKeyUsage(void) { if (mp_keyUsageExchangeElement != NULL) return; mp_keyUsageExchangeElement = setKeyUsage(XKMSConstants::s_tagExchange); } // -------------------------------------------------------------------------------- // UseKeyWith handling // -------------------------------------------------------------------------------- int XKMSKeyBindingAbstractTypeImpl::getUseKeyWithSize(void) const { return (int) m_useKeyWithList.size(); } XKMSUseKeyWith * XKMSKeyBindingAbstractTypeImpl::getUseKeyWithItem(int item) const { if (item < 0 || item >= (int) m_useKeyWithList.size()) { throw XSECException(XSECException::XKMSError, "XKMSKeyBindingAbstractType::getUseKeyWithItem - item out of range"); } return m_useKeyWithList[item]; } XKMSUseKeyWith * XKMSKeyBindingAbstractTypeImpl::appendUseKeyWithItem( const XMLCh * application, const XMLCh * identifier) { XKMSUseKeyWithImpl * u; XSECnew(u, XKMSUseKeyWithImpl(mp_env)); m_useKeyWithList.push_back(u); DOMElement * e = u->createBlankUseKeyWith(application, identifier); // Find where to append the element DOMElement * t = findFirstElementChild(mp_keyBindingAbstractTypeElement); while (t != NULL) { if (!strEquals(getDSIGLocalName(t), XKMSConstants::s_tagKeyInfo) && !strEquals(getXKMSLocalName(t), XKMSConstants::s_tagKeyUsage) && !strEquals(getXKMSLocalName(t), XKMSConstants::s_tagUseKeyWith)) break; t = findNextElementChild(t); } // Append the element if (t == NULL) { mp_keyBindingAbstractTypeElement->appendChild(e); mp_env->doPrettyPrint(mp_keyBindingAbstractTypeElement); } else { mp_keyBindingAbstractTypeElement->insertBefore(e, t); if (mp_env->getPrettyPrintFlag()) { mp_keyBindingAbstractTypeElement->insertBefore( mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), t); } } return u; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRSAKeyPairImpl.hpp000644 001751 001751 00000005206 12003301053 024420 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRSAKeyPairImpl := Implementation class for RSAKeyPair elements * * $Id:$ * */ #ifndef XKMSRSAKEYPAIRIMPL_INCLUDE #define XKMSRSAKEYPAIRIMPL_INCLUDE // XSEC Includes #include #include class XSECEnv; class XKMSRSAKeyPairImpl : public XKMSRSAKeyPair { public: /* Constructors and Destructors */ XKMSRSAKeyPairImpl( const XSECEnv * env ); XKMSRSAKeyPairImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRSAKeyPairImpl() ; // load void load(void); // Create from scratch - tag is the element name to create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankXKMSRSAKeyPairImpl( const XMLCh * Modulus, const XMLCh * Exponent, const XMLCh * P, const XMLCh * Q, const XMLCh * DO, const XMLCh * DQ, const XMLCh * InverseQ, const XMLCh * D); // Interface methods virtual const XMLCh * getModulus(void) const; virtual const XMLCh * getExponent(void) const; virtual const XMLCh * getP(void) const; virtual const XMLCh * getQ(void) const; virtual const XMLCh * getDP(void) const; virtual const XMLCh * getDQ(void) const; virtual const XMLCh * getInverseQ(void) const; virtual const XMLCh * getD(void) const; private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_RSAKeyPairElement; const XMLCh * mp_Modulus; const XMLCh * mp_Exponent; const XMLCh * mp_P; const XMLCh * mp_Q; const XMLCh * mp_DP; const XMLCh * mp_DQ; const XMLCh * mp_InverseQ; const XMLCh * mp_D; // Unimplemented XKMSRSAKeyPairImpl(); XKMSRSAKeyPairImpl(const XKMSRSAKeyPairImpl &); XKMSRSAKeyPairImpl & operator = (const XKMSRSAKeyPairImpl &); }; #endif /* XKMSRSAKEYPAIRIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSQueryKeyBindingImpl.hpp000644 001751 001751 00000003650 12003301053 025560 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSQueryKeyBindingImpl := Implementation for QueryKeyBinding * * $Id: XKMSQueryKeyBindingImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSQUERYKEYBINDINGIMPL_INCLUDE #define XKMSQUERYKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSQueryKeyBindingImpl : public XKMSQueryKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSQueryKeyBindingImpl( const XSECEnv * env ); XKMSQueryKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSQueryKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankQueryKeyBinding(void); // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: // Unimplemented XKMSQueryKeyBindingImpl(void); XKMSQueryKeyBindingImpl(const XKMSQueryKeyBindingImpl &); XKMSQueryKeyBindingImpl & operator = (const XKMSQueryKeyBindingImpl &); }; #endif /* XKMSQUERYKEYBINDING_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSPrototypeKeyBindingImpl.cpp000644 001751 001751 00000013762 12003301053 026460 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPrototypeKeyBindingImpl := Implementation of PrototypeKeyBinding elements * * $Id: XKMSPrototypeKeyBindingImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSPrototypeKeyBindingImpl.hpp" #include "XKMSValidityIntervalImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSPrototypeKeyBindingImpl::XKMSPrototypeKeyBindingImpl(const XSECEnv * env) : XKMSKeyBindingAbstractTypeImpl(env), mp_validityInterval(NULL), mp_revocationCodeIdentifierElement(NULL) { } XKMSPrototypeKeyBindingImpl::XKMSPrototypeKeyBindingImpl(const XSECEnv * env, DOMElement * node) : XKMSKeyBindingAbstractTypeImpl(env, node), mp_validityInterval(NULL), mp_revocationCodeIdentifierElement(NULL) { } XKMSPrototypeKeyBindingImpl::~XKMSPrototypeKeyBindingImpl() { if (mp_validityInterval != NULL) delete mp_validityInterval; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSPrototypeKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSPrototypeKeyBindingImpl::load - called on empty DOM"); } DOMElement * tmpElt = findFirstElementChild(mp_keyBindingAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagValidityInterval) && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevocationCodeIdentifier)) tmpElt = findNextElementChild(tmpElt); if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagValidityInterval)) { XSECnew(mp_validityInterval, XKMSValidityIntervalImpl(mp_env, tmpElt)); mp_validityInterval->load(); tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevocationCodeIdentifier)) { mp_revocationCodeIdentifierElement = tmpElt; } XKMSKeyBindingAbstractTypeImpl::load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSPrototypeKeyBindingImpl::createBlankPrototypeKeyBinding(void) { DOMElement * ret = XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagPrototypeKeyBinding); // Must have an Id XKMSKeyBindingAbstractTypeImpl::setId(); return ret; } // -------------------------------------------------------------------------------- // Get methods // -------------------------------------------------------------------------------- XKMSValidityInterval * XKMSPrototypeKeyBindingImpl::getValidityInterval(void) const { return mp_validityInterval; } const XMLCh * XKMSPrototypeKeyBindingImpl::getRevocationCodeIdentifier(void) const { if (mp_revocationCodeIdentifierElement == NULL) return NULL; DOMNode * t = findFirstChildOfType(mp_revocationCodeIdentifierElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSPrototypeKeyBindingImpl::getRevocationCodeIdentifier - expected TEXT node"); } return t->getNodeValue(); } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- void XKMSPrototypeKeyBindingImpl::setValidityInterval(const XMLCh * notBefore, const XMLCh * notOnOrAfter) { XSECnew(mp_validityInterval, XKMSValidityIntervalImpl(mp_env)); DOMElement * e = mp_validityInterval->createBlankValidityInterval(notBefore, notOnOrAfter); // Now insert if (mp_revocationCodeIdentifierElement != NULL) { mp_keyBindingAbstractTypeElement->insertBefore(e, mp_revocationCodeIdentifierElement); if (mp_env->getPrettyPrintFlag() == true) { mp_keyBindingAbstractTypeElement->insertBefore( mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), mp_revocationCodeIdentifierElement); } } else mp_keyBindingAbstractTypeElement->appendChild(e); } void XKMSPrototypeKeyBindingImpl::setRevocationCodeIdentifier(const XMLCh * identifier) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagRevocationCodeIdentifier); mp_revocationCodeIdentifierElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_keyBindingAbstractTypeElement->appendChild(mp_revocationCodeIdentifierElement); mp_env->doPrettyPrint(mp_keyBindingAbstractTypeElement); mp_revocationCodeIdentifierElement->appendChild( mp_env->getParentDocument()->createTextNode(identifier)); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidateResultImpl.cpp000644 001751 001751 00000011614 12003301053 025431 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateResultImpl := Implementation of ValidateResult Messages * * $Id: XKMSValidateResultImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSValidateResultImpl.hpp" #include "XKMSKeyBindingImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSValidateResultImpl::XKMSValidateResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSValidateResultImpl::XKMSValidateResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { } XKMSValidateResultImpl::~XKMSValidateResultImpl() { XKMSValidateResultImpl::KeyBindingVectorType::iterator i; for (i = m_keyBindingList.begin() ; i != m_keyBindingList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSValidateResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSValidateResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagValidateResult)) { throw XSECException(XSECException::XKMSError, "XKMSValidateResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagKeyBinding); if (nl != NULL) { XKMSKeyBindingImpl * kb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_keyBindingList.push_back(kb); kb->load(); } } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSValidateResultImpl::createBlankValidateResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagValidateResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSValidateResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::ValidateResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSValidateResultImpl::getKeyBindingSize(void) const { return (int) m_keyBindingList.size(); } XKMSKeyBinding * XKMSValidateResultImpl::getKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_keyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSValidateResult::getKeyBindingItem - item out of range"); } return m_keyBindingList[item]; } XKMSKeyBinding * XKMSValidateResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) { XKMSKeyBindingImpl * u; XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env)); m_keyBindingList.push_back(u); DOMElement * e = u->createBlankKeyBinding(status); // Append the element m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return u; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSAuthenticationImpl.cpp000644 001751 001751 00000017426 12003301053 025467 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSAuthenticationImpl := Implementation of Authentication elements * * $Id: XKMSAuthenticationImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSAuthenticationImpl.hpp" #include "XKMSNotBoundAuthenticationImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructor/Destructor // -------------------------------------------------------------------------------- XKMSAuthenticationImpl::XKMSAuthenticationImpl(const XSECEnv * env) : mp_env(env), mp_authenticationElement(NULL), mp_keyBindingAuthenticationSignatureElement(NULL), mp_keyBindingAuthenticationSignature(NULL), mp_notBoundAuthentication(NULL) { } XKMSAuthenticationImpl::XKMSAuthenticationImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_authenticationElement(node), mp_keyBindingAuthenticationSignatureElement(NULL), mp_keyBindingAuthenticationSignature(NULL), mp_notBoundAuthentication(NULL) { } XKMSAuthenticationImpl::~XKMSAuthenticationImpl() { if (mp_notBoundAuthentication != NULL) delete mp_notBoundAuthentication; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSAuthenticationImpl::load(const XMLCh * id) { if (mp_authenticationElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSAuthenticationImpl::load - called on empty DOM"); } // Store for later use mp_keyBindingId = id; DOMElement * tmpElt = findFirstElementChild(mp_authenticationElement); if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagKeyBindingAuthentication)) { // Find the signature mp_keyBindingAuthenticationSignatureElement = (DOMElement *) findFirstElementChild(tmpElt); while (mp_keyBindingAuthenticationSignatureElement != NULL && !strEquals(getDSIGLocalName(mp_keyBindingAuthenticationSignatureElement), XKMSConstants::s_tagSignature)) { mp_keyBindingAuthenticationSignatureElement= findNextElementChild(mp_keyBindingAuthenticationSignatureElement); } // The provider will take care of cleaning this up later. if (mp_keyBindingAuthenticationSignatureElement != NULL) { mp_keyBindingAuthenticationSignature = m_prov.newSignatureFromDOM( mp_keyBindingAuthenticationSignatureElement->getOwnerDocument(), mp_keyBindingAuthenticationSignatureElement); mp_keyBindingAuthenticationSignature->load(); // Check the signature is across the correct input DSIGReferenceList * rl = mp_keyBindingAuthenticationSignature->getReferenceList(); if (rl->getSize() != 1) { throw XSECException(XSECException::XKMSError, "XKMSAuthenticationImpl::load - KeyBindingAuthentication Signature with incorrect number of references found (should be 1)"); } safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_keyBindingId); if (!strEquals(rl->item(0)->getURI(), sb.rawXMLChBuffer())) { throw XSECException(XSECException::XKMSError, "XKMSAuthenticationImpl::load - KeyBindingAuthentication Signature refers to incorrect Id (should be for KeyBinding)"); } // We don't actually check the signature as we have no key material to do so! } tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagNotBoundAuthentication)) { XSECnew(mp_notBoundAuthentication, XKMSNotBoundAuthenticationImpl(mp_env, tmpElt)); mp_notBoundAuthentication->load(); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSAuthenticationImpl::createBlankAuthentication(const XMLCh * id) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagAuthentication); mp_authenticationElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_authenticationElement); // This isn't used immediately - it is simply held for when we create a signature mp_keyBindingId = id; return mp_authenticationElement; } // -------------------------------------------------------------------------------- // Interfacet - Get // -------------------------------------------------------------------------------- DSIGSignature * XKMSAuthenticationImpl::getKeyBindingAuthenticationSignature(void) const { return mp_keyBindingAuthenticationSignature; } XKMSNotBoundAuthentication * XKMSAuthenticationImpl::getNotBoundAuthentication(void) const { return mp_notBoundAuthentication; } // -------------------------------------------------------------------------------- // Interface - Set // -------------------------------------------------------------------------------- DSIGSignature * XKMSAuthenticationImpl::addKeyBindingAuthenticationSignature( canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { if (mp_keyBindingId == NULL) { throw XSECException(XSECException::XKMSError, "XKMSAuthenticationImpl::addKeyBindingAuthenticationSignature - called prior to key infos being added"); } DSIGSignature * ret = m_prov.newSignature(); DOMElement * elt = ret->createBlankSignature(mp_env->getParentDocument(), cm, sm, hm); /* Create the enveloping reference */ safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_keyBindingId); DSIGReference *ref = ret->createReference(sb.rawXMLChBuffer()); ref->appendCanonicalizationTransform(CANON_C14NE_COM); /* Embed the signature in the document inside a KeyBindingAuthentication element */ safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagKeyBindingAuthentication); DOMElement * t = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(t); t->appendChild(elt); mp_env->doPrettyPrint(t); mp_authenticationElement->appendChild(t); mp_env->doPrettyPrint(mp_authenticationElement); return ret; } void XKMSAuthenticationImpl::setNotBoundAuthentication( const XMLCh * uri, const XMLCh * value) { XSECnew(mp_notBoundAuthentication, XKMSNotBoundAuthenticationImpl(mp_env)); mp_authenticationElement->appendChild(mp_notBoundAuthentication->createBlankNotBoundAuthentication(uri, value)); mp_env->doPrettyPrint(mp_authenticationElement); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSNotBoundAuthenticationImpl.hpp000644 001751 001751 00000004615 12003301053 027141 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSNotBoundAuthenticationImpl := Interface for NotBoundAuthentication elements * * $Id: XKMSNotBoundAuthenticationImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSNOTBOUNDAUTHENTICATIONIMPL_INCLUDE #define XKMSNOTBOUNDAUTHENTICATIONIMPL_INCLUDE #include #include class XKMSNotBoundAuthenticationImpl : public XKMSNotBoundAuthentication { public: /* Constructors and Destructors */ XKMSNotBoundAuthenticationImpl( const XSECEnv * env ); XKMSNotBoundAuthenticationImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSNotBoundAuthenticationImpl(); // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankNotBoundAuthentication(const XMLCh * protocol, const XMLCh * value); // Get interfaces virtual const XMLCh * getProtocol(void) const; virtual const XMLCh * getValue(void) const; // Set Methods virtual void setProtocol(const XMLCh * uri); virtual void setValue(const XMLCh * value); //@} private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_notBoundAuthenticationElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_protocolAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_valueAttr; // Unimplemented XKMSNotBoundAuthenticationImpl(void); XKMSNotBoundAuthenticationImpl(const XKMSNotBoundAuthenticationImpl &); XKMSNotBoundAuthenticationImpl & operator = (const XKMSNotBoundAuthenticationImpl &); }; #endif /* XKMSNOTBOUNDAUTHENTICATIONIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSCompoundRequestImpl.hpp000644 001751 001751 00000006501 12003301053 025642 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSCompoundRequestImpl := Implementation of CompoundRequest Messages * * $Id: XKMSCompoundRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSCOMPOUNDREQUESTIMPL_INCLUDE #define XKMSCOMPOUNDREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" #include "XKMSMessageFactoryImpl.hpp" class XKMSQueryKeyRequestImpl; class XKMSCompoundRequestImpl : public XKMSCompoundRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSCompoundRequestImpl( const XSECEnv * env ); XKMSCompoundRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSCompoundRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankCompoundRequest( const XMLCh * service, const XMLCh * id = NULL); // Getter methods virtual int getRequestListSize(void); virtual XKMSRequestAbstractType * getRequestListItem(int item); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); // Setter Methods virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, const XMLCh * id = NULL); virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, const XMLCh * id = NULL); virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, const XMLCh * id = NULL); virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, const XMLCh * id = NULL); virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, const XMLCh * id = NULL); virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, const XMLCh * id = NULL); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector RequestListVectorType; #else typedef std::vector RequestListVectorType; #endif RequestListVectorType m_requestList; /* Used to consume and produce messages in the list */ XKMSMessageFactoryImpl m_factory; // Unimplemented XKMSCompoundRequestImpl(const XKMSCompoundRequestImpl &); XKMSCompoundRequestImpl & operator = (const XKMSCompoundRequestImpl &); }; #endif /* XKMSCOMPOUNDREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSPendingRequestImpl.hpp000644 001751 001751 00000004615 12003301053 025446 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPendingRequestImpl := Implementation of PendingRequest Messages * * $Id: XKMSPendingRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSPENDINGREQUESTIMPL_INCLUDE #define XKMSPENDINGREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSPendingRequestImpl : public XKMSPendingRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSPendingRequestImpl( const XSECEnv * env ); XKMSPendingRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSPendingRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankPendingRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual const XMLCh * getResponseId(void) const; /* Setter interface methods */ virtual void setResponseId(const XMLCh * responseId); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_responseIdAttr; // Unimplemented XKMSPendingRequestImpl(const XKMSPendingRequestImpl &); XKMSPendingRequestImpl & operator = (const XKMSPendingRequestImpl &); }; #endif /* XKMSPENDINGREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusResultImpl.cpp000644 001751 001751 00000013606 12003301053 025166 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusResultImpl := Implementation of StatusResult Messages * * $Id: XKMSStatusResultImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSStatusResultImpl.hpp" #include "XKMSUnverifiedKeyBindingImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSStatusResultImpl::XKMSStatusResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { mp_successAttr = NULL; mp_failureAttr = NULL; mp_pendingAttr = NULL; } XKMSStatusResultImpl::XKMSStatusResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { mp_successAttr = NULL; mp_failureAttr = NULL; mp_pendingAttr = NULL; } XKMSStatusResultImpl::~XKMSStatusResultImpl() { } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSStatusResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSStatusResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagStatusResult)) { throw XSECException(XSECException::XKMSError, "XKMSStatusResult::load - called incorrect node"); } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSStatusResultImpl::createBlankStatusResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagStatusResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSStatusResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::StatusResult; } // -------------------------------------------------------------------------------- // Result count handling // -------------------------------------------------------------------------------- int XKMSStatusResultImpl::getSuccessCount(void) const { if (mp_successAttr == NULL) return 0; unsigned int val; XMLString::textToBin(mp_successAttr->getNodeValue(), val); return (int) val; } int XKMSStatusResultImpl::getFailureCount(void) const { if (mp_failureAttr == NULL) return 0; unsigned int val; XMLString::textToBin(mp_failureAttr->getNodeValue(), val); return (int) val; } int XKMSStatusResultImpl::getPendingCount(void) const { if (mp_pendingAttr == NULL) return 0; unsigned int val; XMLString::textToBin(mp_pendingAttr->getNodeValue(), val); return (int) val; } void XKMSStatusResultImpl::setSuccessCount(int count) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSStatusResult::setSuccessCount - called on non-initialised structure"); } XMLCh val[16]; XMLString::binToText(count, val, 16, 10); m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagSuccess, val); mp_successAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagSuccess); } void XKMSStatusResultImpl::setFailureCount(int count) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSStatusResult::setFailureCount - called on non-initialised structure"); } XMLCh val[16]; XMLString::binToText(count, val, 16, 10); m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagFailure, val); mp_failureAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagFailure); } void XKMSStatusResultImpl::setPendingCount(int count) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSStatusResult::setPendingCount - called on non-initialised structure"); } XMLCh val[16]; XMLString::binToText(count, val, 16, 10); m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagPending, val); mp_pendingAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagPending); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusImpl.hpp000644 001751 001751 00000004257 12003301053 023776 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusImpl := Implementation for Status elements (in KeyBinding) * * $Id: XKMSStatusImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUSIMPL_INCLUDE #define XKMSSTATUSIMPL_INCLUDE // XSEC Includes #include #include class XKMSStatusImpl : public XKMSStatus { public: XKMSStatusImpl( const XSECEnv * env ); XKMSStatusImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSStatusImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankStatus(StatusValue status); /* Getter Interface Methods */ virtual StatusValue getStatusValue(void) const; virtual bool getStatusReason(StatusValue status, StatusReason reason) const; /* Setter Methods */ virtual void setStatusReason(StatusValue status, StatusReason reason, bool value); private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_statusElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_statusValueAttr; StatusValue m_statusValue; /* Record values of each status */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * m_statusReasons[3][4]; // Unimplemented XKMSStatusImpl(const XKMSStatusImpl &); XKMSStatusImpl & operator = (const XKMSStatusImpl &); }; #endif /* XKMSSTATUSIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRegisterRequestImpl.hpp000644 001751 001751 00000006046 12003301053 025646 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterRequestImpl := Implementation for RegisterRequest Messages * * $Id: XKMSRegisterRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREGISTERREQUESTIMPL_INCLUDE #define XKMSREGISTERREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSAuthenticationImpl; class XKMSPrototypeKeyBindingImpl; class DSIGSignature; class XKMSRegisterRequestImpl : public XKMSRegisterRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRegisterRequestImpl( const XSECEnv * env ); XKMSRegisterRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRegisterRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRegisterRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSPrototypeKeyBinding * getPrototypeKeyBinding(void) const; virtual XKMSAuthentication * getAuthentication (void) const; virtual DSIGSignature * getProofOfPossessionSignature(void) const; /* Setter Interface Methods */ virtual XKMSPrototypeKeyBinding * addPrototypeKeyBinding(void); virtual XKMSAuthentication * addAuthentication(void); virtual DSIGSignature * addProofOfPossessionSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XKMSAuthenticationImpl * mp_authentication; XKMSPrototypeKeyBindingImpl * mp_prototypeKeyBinding; DSIGSignature * mp_proofOfPossessionSignature; XSECProvider m_prov; // For creating the signature // Unimplemented XKMSRegisterRequestImpl(void); XKMSRegisterRequestImpl(const XKMSRegisterRequestImpl &); XKMSRegisterRequestImpl & operator = (const XKMSRegisterRequestImpl &); }; #endif /* XKMSREGISTERREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueRequestImpl.cpp000644 001751 001751 00000025537 12003301053 025502 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueRequestImpl := Implementation for ReissueRequest Messages * * $Id: XKMSReissueRequestImpl.cpp 351366 2005-06-04 11:44:55Z blautenb $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSReissueRequestImpl.hpp" #include "XKMSAuthenticationImpl.hpp" #include "XKMSReissueKeyBindingImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSReissueRequestImpl::XKMSReissueRequestImpl(const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_authentication(NULL), mp_reissueKeyBinding(NULL), mp_proofOfPossessionSignature(NULL) { } XKMSReissueRequestImpl::XKMSReissueRequestImpl(const XSECEnv * env, DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_authentication(NULL), mp_reissueKeyBinding(NULL), mp_proofOfPossessionSignature(NULL) { } XKMSReissueRequestImpl::~XKMSReissueRequestImpl() { if (mp_authentication != NULL) delete mp_authentication; if (mp_reissueKeyBinding != NULL) delete mp_reissueKeyBinding; // Provider will take care of the proofOfPossession signature } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSReissueRequestImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSReissueRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagReissueRequest)) { throw XSECException(XSECException::XKMSError, "XKMSReissueRequest::load - called on incorrect node"); } // Load the base message m_request.load(); // Now check for any ReissueKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagReissueKeyBinding)) { tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL) { XSECnew(mp_reissueKeyBinding, XKMSReissueKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_reissueKeyBinding->load(); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSReissueRequest::load - Expected ReissueKeyBinding node"); } // Authentication Element if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagAuthentication)) { XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env, tmpElt)); mp_authentication->load(mp_reissueKeyBinding->getId()); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSReissueRequest::load - Expected Authentication node"); } if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagProofOfPossession)) { // Find the signature DOMElement * sigElt = (DOMElement *) findFirstElementChild(tmpElt); if (sigElt == NULL || !strEquals(getDSIGLocalName(sigElt), XKMSConstants::s_tagSignature)) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSReissueRequest::load - Expected Signature child of ProofOfPossession"); } // The provider will take care of cleaning this up later. mp_proofOfPossessionSignature = m_prov.newSignatureFromDOM(m_msg.mp_env->getParentDocument(), sigElt); mp_proofOfPossessionSignature->load(); // Check the signature is across the correct input DSIGReferenceList * rl = mp_proofOfPossessionSignature->getReferenceList(); if (rl->getSize() != 1) { throw XSECException(XSECException::XKMSError, "XKMSReissueRequestImpl::load - ProofOfPossession Signature with incorrect number of references found (should be 1)"); } safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_reissueKeyBinding->getId()); if (!strEquals(rl->item(0)->getURI(), sb.rawXMLChBuffer())) { throw XSECException(XSECException::XKMSError, "XKMSReissueRequestImpl::load - ProofOfPossession Signature refers to incorrect Id (should be for ReissueKeyBinding)"); } // We don't actually check the signature as we have no key material to do so! } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSReissueRequestImpl:: createBlankReissueRequest(const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagReissueRequest, service, id); } // -------------------------------------------------------------------------------- // MessageType // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSReissueRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::ReissueRequest; } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- XKMSReissueKeyBinding * XKMSReissueRequestImpl::getReissueKeyBinding(void) const { return mp_reissueKeyBinding; } XKMSAuthentication * XKMSReissueRequestImpl::getAuthentication (void) const { return mp_authentication; } DSIGSignature * XKMSReissueRequestImpl::getProofOfPossessionSignature(void) const { return mp_proofOfPossessionSignature; } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- XKMSReissueKeyBinding * XKMSReissueRequestImpl::addReissueKeyBinding(XKMSStatus::StatusValue status) { if (mp_reissueKeyBinding != NULL) return mp_reissueKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_reissueKeyBinding, XKMSReissueKeyBindingImpl(m_msg.mp_env)); DOMElement * elt = mp_reissueKeyBinding->createBlankReissueKeyBinding(status); // Insert DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagAuthentication) && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagProofOfPossession)) { be = findNextElementChild(be); } if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_reissueKeyBinding; } m_msg.mp_messageAbstractTypeElement->insertBefore(elt, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_reissueKeyBinding; } XKMSAuthentication * XKMSReissueRequestImpl::addAuthentication(void) { if (mp_authentication != NULL) return mp_authentication; if (mp_reissueKeyBinding == NULL) { throw XSECException(XSECException::XKMSError, "XKMSReissueRequestImpl::addAuthentication - called prior to key infos being added"); } XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env)); DOMElement * e = mp_authentication->createBlankAuthentication(mp_reissueKeyBinding->getId()); DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagProofOfPossession)) be = findNextElementChild(be); if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_authentication; } m_msg.mp_messageAbstractTypeElement->insertBefore(e, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_authentication; } DSIGSignature * XKMSReissueRequestImpl::addProofOfPossessionSignature( canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { DSIGSignature * ret = m_prov.newSignature(); DOMElement * elt = ret->createBlankSignature(m_msg.mp_env->getParentDocument(), cm, sm, hm); /* Create the enveloping reference */ safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_reissueKeyBinding->getId()); DSIGReference *ref = ret->createReference(sb.rawXMLChBuffer()); ref->appendCanonicalizationTransform(CANON_C14NE_COM); /* Embed the signature in the document inside a KeyBindingAuthentication element */ safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagProofOfPossession); DOMElement * t = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); m_msg.mp_env->doPrettyPrint(t); t->appendChild(elt); m_msg.mp_env->doPrettyPrint(t); // Now append into the ReissueRequest m_msg.mp_messageAbstractTypeElement->appendChild(t); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return ret; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSKeyBindingImpl.cpp000644 001751 001751 00000007072 12003301053 024527 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBindingImpl := Implementation for KeyBinding * * $Id: XKMSKeyBindingImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include "XKMSKeyBindingImpl.hpp" #include "XKMSStatusImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSKeyBindingImpl::XKMSKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { mp_status = NULL; } XKMSKeyBindingImpl::XKMSKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { mp_status = NULL; } XKMSKeyBindingImpl::~XKMSKeyBindingImpl() { if (mp_status != NULL) delete mp_status; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); /* Find the status element */ DOMNodeList * nl = mp_keyBindingAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagStatus); if (nl == NULL || nl->getLength() != 1) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSKeyBinding::load - Status value not found"); } XSECnew(mp_status, XKMSStatusImpl(mp_env, (DOMElement*) nl->item(0))); mp_status->load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSKeyBindingImpl::createBlankKeyBinding(XKMSStatus::StatusValue status) { DOMElement * ret = XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagKeyBinding); mp_env->doPrettyPrint(ret); // Create the status element XSECnew(mp_status, XKMSStatusImpl(mp_env)); ret->appendChild(mp_status->createBlankStatus(status)); mp_env->doPrettyPrint(ret); return ret; } // -------------------------------------------------------------------------------- // Status handling // -------------------------------------------------------------------------------- XKMSStatus * XKMSKeyBindingImpl::getStatus(void) const { return mp_status; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSUseKeyWithImpl.hpp000644 001751 001751 00000004353 12003301053 024551 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUseKeyWithImpl := Implementation of UseKeyWith Messages * * $Id: XKMSUseKeyWithImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSUSEKEYWITHIMPL_INCLUDE #define XKMSUSEKEYWITHIMPL_INCLUDE // XSEC Includes #include #include class XKMSUseKeyWithImpl : public XKMSUseKeyWith { public: XKMSUseKeyWithImpl( const XSECEnv * env ); XKMSUseKeyWithImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSUseKeyWithImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankUseKeyWith( const XMLCh * application, const XMLCh * identifier); // Interface methods virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const; virtual const XMLCh * getApplication(void) const; virtual const XMLCh * getIdentifier(void) const; virtual void setApplication(const XMLCh * uri); virtual void setIdentifier(const XMLCh * identifier); protected: XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_useKeyWithElement; const XSECEnv * mp_env; private: XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_applicationAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_identifierAttr; // Unimplemented XKMSUseKeyWithImpl(const XKMSUseKeyWithImpl &); XKMSUseKeyWithImpl & operator = (const XKMSUseKeyWithImpl &); }; #endif /* XKMSUSEKEYWITHIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRequestAbstractTypeImpl.cpp000644 001751 001751 00000025274 12003301053 026466 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRequestAbstractTypeImpl := Implementation class for XKMS Request messages * * $Id: XKMSRequestAbstractTypeImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSRequestAbstractTypeImpl.hpp" #include "XKMSRespondWithImpl.hpp" #include "XKMSResponseMechanismImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRequestAbstractTypeImpl::XKMSRequestAbstractTypeImpl( const XSECEnv * env) : m_msg(env) { mp_originalRequestIdAttr = NULL; mp_responseLimitAttr = NULL; } XKMSRequestAbstractTypeImpl::XKMSRequestAbstractTypeImpl( const XSECEnv * env, DOMElement * node) : m_msg(env, node) { mp_originalRequestIdAttr = NULL; mp_responseLimitAttr = NULL; } XKMSRequestAbstractTypeImpl::~XKMSRequestAbstractTypeImpl() { RespondWithVectorType::iterator i; for (i = m_respondWithList.begin(); i != m_respondWithList.end(); ++i) { delete (*i); } ResponseMechanismVectorType::iterator j; for (j = m_responseMechanismList.begin(); j != m_responseMechanismList.end(); ++j) { delete (*j); } }; // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSRequestAbstractTypeImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractType::load - called on empty DOM"); } // Get any respond with elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagRespondWith); if (nl != NULL) { XKMSRespondWithImpl * rw; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(rw, XKMSRespondWithImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); rw->load(); m_respondWithList.push_back(rw); } } // Get any ResponseMechanism elements nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagResponseMechanism); if (nl != NULL) { XKMSResponseMechanismImpl * rm; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(rm, XKMSResponseMechanismImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); rm->load(); m_responseMechanismList.push_back(rm); } } mp_originalRequestIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagOriginalRequestId); mp_responseLimitAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseLimit); m_msg.load(); } // -------------------------------------------------------------------------------- // Create from scratch // -------------------------------------------------------------------------------- DOMElement * XKMSRequestAbstractTypeImpl::createBlankRequestAbstractType( const XMLCh * tag, const XMLCh * service, const XMLCh * id) { return m_msg.createBlankMessageAbstractType(tag, service, id); } // -------------------------------------------------------------------------------- // Get/Set interface methods // -------------------------------------------------------------------------------- const XMLCh * XKMSRequestAbstractTypeImpl::getOriginalRequestId(void) const { if (mp_originalRequestIdAttr != NULL) return mp_originalRequestIdAttr->getNodeValue(); return NULL; } void XKMSRequestAbstractTypeImpl::setOriginalRequestId(const XMLCh * id) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSRequestAbstractType::setOriginalRequestId - called on non-initialised structure"); } m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagOriginalRequestId, id); mp_originalRequestIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagOriginalRequestId); } unsigned int XKMSRequestAbstractTypeImpl::getResponseLimit(void) const { if (mp_responseLimitAttr == NULL) return 0; unsigned int ret; if (!XMLString::textToBin(mp_responseLimitAttr->getValue(), ret)) return 0; return ret; } void XKMSRequestAbstractTypeImpl::setResponseLimit(unsigned int limit) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSRequestAbstractType::setResponseLimit - called on non-initialised structure"); } /* Convert the number to a string */ XMLCh limitStr[10]; XMLString::binToText(limit, limitStr, 9, 10); m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagResponseLimit, limitStr); mp_responseLimitAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseLimit); } // -------------------------------------------------------------------------------- // RespondWith handling // -------------------------------------------------------------------------------- int XKMSRequestAbstractTypeImpl::getRespondWithSize(void) { return (int) m_respondWithList.size(); } XKMSRespondWith * XKMSRequestAbstractTypeImpl::getRespondWithItem(int item) { if (item < 0 || item >= (int) m_respondWithList.size()) { throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractTypeImpl::getRespondWithItem - item out of range"); } return m_respondWithList[item]; } const XMLCh * XKMSRequestAbstractTypeImpl::getRespondWithItemStr(int item) { if (item < 0 || item >= (int) m_respondWithList.size()) { throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractTypeImpl::getRespondWithItem - item out of range"); } return m_respondWithList[item]->getRespondWithString(); } void XKMSRequestAbstractTypeImpl::appendRespondWithItem(XKMSRespondWith * item) { } void XKMSRequestAbstractTypeImpl::appendRespondWithItem(const XMLCh * item) { XKMSRespondWithImpl * rw; XSECnew(rw, XKMSRespondWithImpl(m_msg.mp_env)); // Create the RespondWith object DOMElement * elt = rw->createBlankRespondWith(item); // Add to the item DOMElement * c = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (c != NULL) { if (!strEquals(getXKMSLocalName(c), XKMSConstants::s_tagResponseMechanism)) break; } if (c != NULL) { m_msg.mp_messageAbstractTypeElement->insertBefore(elt, c); if (m_msg.mp_env->getPrettyPrintFlag()) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } } else { m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } // Add to the list m_respondWithList.push_back(rw); } // -------------------------------------------------------------------------------- // ResponseMechanism handling // -------------------------------------------------------------------------------- int XKMSRequestAbstractTypeImpl::getResponseMechanismSize(void) { return (int) m_responseMechanismList.size(); } XKMSResponseMechanism * XKMSRequestAbstractTypeImpl::getResponseMechanismItem(int item) { if (item < 0 || item >= (int) m_responseMechanismList.size()) { throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractTypeImpl::getResponseMechanismItem - item out of range"); } return m_responseMechanismList[item]; } const XMLCh * XKMSRequestAbstractTypeImpl::getResponseMechanismItemStr(int item) { if (item < 0 || item >= (int) m_responseMechanismList.size()) { throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractTypeImpl::getResponseMechanismItem - item out of range"); } return m_responseMechanismList[item]->getResponseMechanismString(); } void XKMSRequestAbstractTypeImpl::appendResponseMechanismItem(XKMSResponseMechanism * item) { } void XKMSRequestAbstractTypeImpl::appendResponseMechanismItem(const XMLCh * item) { XKMSResponseMechanismImpl * rw; XSECnew(rw, XKMSResponseMechanismImpl(m_msg.mp_env)); // Create the ResponseMechanism object DOMElement * elt = rw->createBlankResponseMechanism(item); // Add to the item DOMElement * c = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (c != NULL) { if (!strEquals(getXKMSLocalName(c), XKMSConstants::s_tagResponseMechanism)) break; c = findNextElementChild(c); } if (c != NULL) { m_msg.mp_messageAbstractTypeElement->insertBefore(elt, c); if (m_msg.mp_env->getPrettyPrintFlag()) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } } else { m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } // Add to the list m_responseMechanismList.push_back(rw); } void XKMSRequestAbstractTypeImpl::removeResponseMechanismItem(int item) { if (item < 0 || item >= (int) m_responseMechanismList.size()) { throw XSECException(XSECException::RequestAbstractTypeError, "XKMSRequestAbstractTypeImpl::getResponseMechanismItem - item out of range"); } XKMSResponseMechanism *rm = m_responseMechanismList[item]; DOMNode * m = rm->getElement(); m->getParentNode()->removeChild(m); m->release(); // Now clean up our structure. ResponseMechanismVectorType::iterator i; int j = 0; i = m_responseMechanismList.begin(); while (j < item) { j++; i++; } m_responseMechanismList.erase(i); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRespondWithImpl.cpp000644 001751 001751 00000011322 12003301053 024743 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRespondWithImpl := Implementation of XKMSRespondWith * * $Id: XKMSRespondWithImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSRespondWithImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRespondWithImpl::XKMSRespondWithImpl(const XSECEnv * env) : mp_env(env), mp_respondWithTextNode(NULL) {} XKMSRespondWithImpl::XKMSRespondWithImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : mp_env(env), mp_respondWithElement(node), mp_respondWithTextNode(NULL) { } XKMSRespondWithImpl::~XKMSRespondWithImpl() {} // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSRespondWithImpl::load(void) { if (mp_respondWithElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRespondWith::load - called on empty DOM"); } mp_respondWithTextNode = findFirstChildOfType(mp_respondWithElement, DOMNode::TEXT_NODE); if (mp_respondWithTextNode == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRespondWith::load - Expected TEXT node beneath element"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRespondWithImpl::createBlankRespondWith(const XMLCh * item) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagRespondWith); mp_respondWithElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); // Create the RespondWith item str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); str.sbXMLChCat(item); mp_respondWithTextNode = doc->createTextNode(str.rawXMLChBuffer()); mp_respondWithElement->appendChild(mp_respondWithTextNode); return mp_respondWithElement; } // -------------------------------------------------------------------------------- // Get interface // -------------------------------------------------------------------------------- const XMLCh * XKMSRespondWithImpl::getRespondWithString(void) const { if (mp_respondWithTextNode == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRespondWith::getRespondWithString - Attempt to get prior to initialisation"); } const XMLCh * r = mp_respondWithTextNode->getNodeValue(); int index = XMLString::indexOf(r, chPound); if (index == -1 || XMLString::compareNString(r, XKMSConstants::s_unicodeStrURIXKMS, index)) { throw XSECException(XSECException::XKMSError, "XKMSRespondWith::getRespondWithString - Item not in XKMS Name Space"); } return &r[index+1]; } // -------------------------------------------------------------------------------- // Set interface // -------------------------------------------------------------------------------- void XKMSRespondWithImpl::setRespondWithString(const XMLCh * str) { if (mp_respondWithTextNode == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRespondWith::setRespondWithString - Attempt to set prior to initialisation"); } safeBuffer sb; sb.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); sb.sbXMLChCat(str); mp_respondWithTextNode->setNodeValue(sb.rawXMLChBuffer()); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSResponseMechanismImpl.hpp000644 001751 001751 00000004415 12003301053 026132 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResponseMechanismImpl := Implementation of XKMSResponseMechanism * * $Id: XKMSResponseMechanismImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESPONSEMECHANISMIMPL_INCLUDE #define XKMSRESPONSEMECHANISMIMPL_INCLUDE // XSEC Includes #include #include class XSECEnv; class XKMSResponseMechanismImpl : public XKMSResponseMechanism { public: XKMSResponseMechanismImpl(const XSECEnv * env); XKMSResponseMechanismImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSResponseMechanismImpl(); // load void load(void); XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankResponseMechanism( const XMLCh * item); /* Getter Interface Methods */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const { return mp_responseMechanismElement; } virtual const XMLCh * getResponseMechanismString(void) const; /* Setter interface methods */ virtual void setResponseMechanismString(const XMLCh * str); //@} private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_responseMechanismElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_responseMechanismTextNode; // Unimplemented XKMSResponseMechanismImpl(const XKMSResponseMechanismImpl &); XKMSResponseMechanismImpl & operator = (const XKMSResponseMechanismImpl &); }; #endif /* XKMSRESPONSEMECHANISMIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSResultImpl.hpp000644 001751 001751 00000004030 12003301053 023756 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResultImpl := Implementation of Result Messages * * $Id: XKMSResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESULTIMPL_INCLUDE #define XKMSRESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" class XKMSResultImpl : public XKMSResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSResultImpl( const XSECEnv * env ); XKMSResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: // Unimplemented XKMSResultImpl(const XKMSResultImpl &); XKMSResultImpl & operator = (const XKMSResultImpl &); }; #endif /* XKMSRESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueResultImpl.cpp000644 001751 001751 00000011735 12003301053 025323 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueResultImpl := Implementation of RegisterResult Messages * * $Id$ * */ #include #include #include #include #include #include "XKMSReissueResultImpl.hpp" #include "XKMSKeyBindingImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSReissueResultImpl::XKMSReissueResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSReissueResultImpl::XKMSReissueResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { } XKMSReissueResultImpl::~XKMSReissueResultImpl() { XKMSReissueResultImpl::KeyBindingVectorType::iterator i; for (i = m_keyBindingList.begin() ; i != m_keyBindingList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSReissueResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSReissueResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagReissueResult)) { throw XSECException(XSECException::XKMSError, "XKMSReissueResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagKeyBinding); if (nl != NULL) { XKMSKeyBindingImpl * kb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_keyBindingList.push_back(kb); kb->load(); } } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSReissueResultImpl::createBlankReissueResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagReissueResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSReissueResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::ReissueResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSReissueResultImpl::getKeyBindingSize(void) const { return (int) m_keyBindingList.size(); } XKMSKeyBinding * XKMSReissueResultImpl::getKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_keyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSReissueResult::getKeyBindingItem - item out of range"); } return m_keyBindingList[item]; } XKMSKeyBinding * XKMSReissueResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) { XKMSKeyBindingImpl * u; XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env)); m_keyBindingList.push_back(u); DOMElement * e = u->createBlankKeyBinding(status); // Append the element m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return u; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSAuthenticationImpl.hpp000644 001751 001751 00000005746 12003301053 025476 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSAuthenticationImpl := Implementation of Authentication elements * * $Id: XKMSAuthenticationImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSAUTHENTICATIONIMPL_INCLUDE #define XKMSAUTHENTICATIONIMPL_INCLUDE // XSEC Includes #include #include #include class XKMSKeyBindingAuthenticationImpl; class XKMSNotBoundAuthenticationImpl; class XSECEnv; XSEC_DECLARE_XERCES_CLASS(DOMElement); class XKMSAuthenticationImpl : public XKMSAuthentication { public: /* Constructors and Destructors */ XKMSAuthenticationImpl( const XSECEnv * env ); XKMSAuthenticationImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSAuthenticationImpl() ; // Load // The Authentication load is a bit different to others, as it needs // to know the Id of the KeyBinding that it is authentication so that it // can check it is valid in the signature void load(const XMLCh * id); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankAuthentication(const XMLCh * id); // Interface GET methods virtual DSIGSignature * getKeyBindingAuthenticationSignature(void) const; virtual XKMSNotBoundAuthentication * getNotBoundAuthentication(void) const; // Interface Set methods virtual DSIGSignature * addKeyBindingAuthenticationSignature( canonicalizationMethod cm = CANON_C14NE_NOC, signatureMethod sm = SIGNATURE_HMAC, hashMethod hm = HASH_SHA1); virtual void setNotBoundAuthentication(const XMLCh * uri, const XMLCh * value); private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_authenticationElement; XSECProvider m_prov; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyBindingAuthenticationSignatureElement; DSIGSignature * mp_keyBindingAuthenticationSignature; XKMSNotBoundAuthenticationImpl * mp_notBoundAuthentication; const XMLCh * mp_keyBindingId; // Unimplemented XKMSAuthenticationImpl(void); XKMSAuthenticationImpl(const XKMSAuthenticationImpl &); XKMSAuthenticationImpl & operator = (const XKMSAuthenticationImpl &); }; #endif /* XKMSAUTHENTICATIONIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.cpp000644 001751 001751 00000032074 12003301053 026416 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageAbstractTypeImpl := Implementation class for base XKMS messages * * $Id: XKMSMessageAbstractTypeImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include "XKMSMessageAbstractTypeImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSMessageAbstractTypeImpl::XKMSMessageAbstractTypeImpl( const XSECEnv * env) : mp_env(env), mp_messageAbstractTypeElement(NULL), mp_idAttr(NULL), mp_serviceAttr(NULL), mp_nonceAttr(NULL), mp_signatureElement(NULL), mp_opaqueClientDataElement(NULL), mp_signature(NULL) { m_opaqueClientDataSize = 0; } XKMSMessageAbstractTypeImpl::XKMSMessageAbstractTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : mp_env(env), mp_messageAbstractTypeElement(node), mp_idAttr(NULL), mp_serviceAttr(NULL), mp_nonceAttr(NULL), mp_signatureElement(NULL), mp_opaqueClientDataElement(NULL), mp_signature(NULL) { m_opaqueClientDataSize = 0; } XKMSMessageAbstractTypeImpl::~XKMSMessageAbstractTypeImpl() { // We own the environment, so we delete it. delete mp_env; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSMessageAbstractTypeImpl::load(void) { if (mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::load - called on empty DOM"); } // Id mp_idAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId); // Service mp_serviceAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagService); // Nonce mp_nonceAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagNonce); // Id and Service MUST be set for a message to be OK if (mp_idAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSMessageAbstractType::load - Id attribute not found"); } if (mp_serviceAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSMessageAbstractType::load - Service attribute not found"); } // Check for node mp_signatureElement = (DOMElement *) findFirstChildOfType(mp_messageAbstractTypeElement, DOMNode::ELEMENT_NODE); while (mp_signatureElement != NULL && !strEquals(getDSIGLocalName(mp_signatureElement), XKMSConstants::s_tagSignature)) { mp_signatureElement = findNextElementChild(mp_signatureElement); } // The provider will take care of cleaning this up later. if (mp_signatureElement != NULL) { mp_signature = m_prov.newSignatureFromDOM(mp_signatureElement->getOwnerDocument(), mp_signatureElement); mp_signature->load(); } // Cheque for OpaqueClientData mp_opaqueClientDataElement = (DOMElement *) findFirstChildOfType(mp_messageAbstractTypeElement, DOMNode::ELEMENT_NODE); while (mp_opaqueClientDataElement != NULL && !strEquals(getXKMSLocalName(mp_opaqueClientDataElement), XKMSConstants::s_tagOpaqueClientData)) { mp_opaqueClientDataElement = findNextElementChild(mp_opaqueClientDataElement); } if (mp_opaqueClientDataElement != NULL) { DOMElement * c = findFirstElementChild(mp_opaqueClientDataElement); while (c != NULL) { if (!strEquals(getXKMSLocalName(c), XKMSConstants::s_tagOpaqueData)) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSMessageAbstractType::load - Only children allowed for "); } if (findFirstChildOfType(c, DOMNode::TEXT_NODE) == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSMessageAbstractType::load - OpaqueData elements require a text child containing Base64 data"); } ++m_opaqueClientDataSize; c = findNextElementChild(c); } } } // -------------------------------------------------------------------------------- // Create blank // -------------------------------------------------------------------------------- DOMElement * XKMSMessageAbstractTypeImpl::createBlankMessageAbstractType( const XMLCh * tag, const XMLCh * service, const XMLCh * id) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, tag); mp_messageAbstractTypeElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); // Set namespace if (prefix[0] == chNull) { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } mp_messageAbstractTypeElement->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), XKMSConstants::s_unicodeStrURIXKMS); mp_env->doPrettyPrint(mp_messageAbstractTypeElement); // Setup the service URI mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagService, service); mp_serviceAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagService); // Setup the id XMLCh * myId; if (id == NULL) myId = generateId(); mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id ? id : myId); if (id == NULL) XSEC_RELEASE_XMLCH(myId); #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId); #endif mp_idAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId); // Nonce is blank at start mp_nonceAttr = NULL; return mp_messageAbstractTypeElement; } // -------------------------------------------------------------------------------- // Getter interfaces // -------------------------------------------------------------------------------- bool XKMSMessageAbstractTypeImpl::isSigned(void) const { return mp_signature != NULL; } DSIGSignature * XKMSMessageAbstractTypeImpl::getSignature(void) const { return mp_signature; } DOMElement * XKMSMessageAbstractTypeImpl::getElement(void) const { return mp_messageAbstractTypeElement; } const XMLCh * XKMSMessageAbstractTypeImpl::getId(void) const { return (mp_idAttr != NULL ? mp_idAttr->getNodeValue() : NULL); } const XMLCh * XKMSMessageAbstractTypeImpl::getService(void) const { return (mp_serviceAttr != NULL ? mp_serviceAttr->getNodeValue() : NULL); } const XMLCh * XKMSMessageAbstractTypeImpl::getNonce(void) const { return (mp_nonceAttr != NULL ? mp_nonceAttr->getNodeValue() : NULL); } // -------------------------------------------------------------------------------- // Setter Interfaces // -------------------------------------------------------------------------------- void XKMSMessageAbstractTypeImpl::setId(const XMLCh * id) { if (mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::setId - called on non-initialised structure"); } mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagId, id); #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) mp_messageAbstractTypeElement->setIdAttributeNS(NULL, XKMSConstants::s_tagId); #endif mp_idAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId); } void XKMSMessageAbstractTypeImpl::setService(const XMLCh * service) { if (mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::setService - called on non-initialised structure"); } mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagService, service); mp_serviceAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagService); } void XKMSMessageAbstractTypeImpl::setNonce(const XMLCh * uri) { if (mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::setNonce - called on non-initialised structure"); } mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagNonce, uri); mp_nonceAttr = mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagNonce); } DSIGSignature * XKMSMessageAbstractTypeImpl::addSignature( canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { DSIGSignature * ret = m_prov.newSignature(); DOMElement * elt = ret->createBlankSignature(mp_env->getParentDocument(), cm, sm, hm); /* Create the enveloping reference */ safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(getId()); DSIGReference *ref = ret->createReference(sb.rawXMLChBuffer()); ref->appendEnvelopedSignatureTransform(); ref->appendCanonicalizationTransform(CANON_C14NE_COM); /* Embed the signature in the document */ DOMNode * c = mp_messageAbstractTypeElement->getFirstChild(); if (c != NULL) { if (mp_env->getPrettyPrintFlag() == true) { mp_messageAbstractTypeElement->insertBefore( mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } mp_messageAbstractTypeElement->insertBefore(elt, c); } else mp_messageAbstractTypeElement->appendChild(elt); mp_signature = ret; return ret; } // -------------------------------------------------------------------------------- // Opaque Client Data interface // -------------------------------------------------------------------------------- int XKMSMessageAbstractTypeImpl::getOpaqueClientDataSize(void) { return m_opaqueClientDataSize; } const XMLCh * XKMSMessageAbstractTypeImpl::getOpaqueClientDataItemStr(int item) { if (item < 0 || item > m_opaqueClientDataSize) { throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::getOpaqueClientDataItemStr - index out of range"); } DOMElement * c = findFirstElementChild(mp_opaqueClientDataElement); int i = 0; while (i < item) { c = findNextElementChild(c); if (c == NULL) { throw XSECException(XSECException::MessageAbstractTypeError, "XKMSMessageAbstractType::getOpaqueClientDataItemStr - index unexpectedly out of range"); } ++i; } return findFirstChildOfType(c, DOMNode::TEXT_NODE)->getNodeValue(); } void XKMSMessageAbstractTypeImpl::appendOpaqueClientDataItem(const XMLCh * item) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); if (mp_opaqueClientDataElement == NULL) { makeQName(str, prefix, XKMSConstants::s_tagOpaqueClientData); mp_opaqueClientDataElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_opaqueClientDataElement); /* Have to insert before anything else in the message */ DOMElement * te; te = findFirstElementChild(mp_messageAbstractTypeElement); while (te != NULL && strEquals(getXKMSLocalName(te), XKMSConstants::s_tagSignature)) te = findNextElementChild(te); if (te == NULL) { mp_messageAbstractTypeElement->appendChild(mp_opaqueClientDataElement); mp_env->doPrettyPrint(mp_messageAbstractTypeElement); } else { mp_messageAbstractTypeElement->insertBefore(mp_opaqueClientDataElement, te); if (mp_env->getPrettyPrintFlag()) { mp_messageAbstractTypeElement->insertBefore( mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), te); } } } makeQName(str, prefix, XKMSConstants::s_tagOpaqueData); DOMElement * e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); e->appendChild(doc->createTextNode(item)); mp_opaqueClientDataElement->appendChild(e); mp_env->doPrettyPrint(mp_opaqueClientDataElement); m_opaqueClientDataSize++; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeResultImpl.cpp000644 001751 001751 00000011710 12003301053 025130 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeResultImpl := Implementation of RegisterResult Messages * * $Id:$ * */ #include #include #include #include #include #include "XKMSRevokeResultImpl.hpp" #include "XKMSKeyBindingImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRevokeResultImpl::XKMSRevokeResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSRevokeResultImpl::XKMSRevokeResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { } XKMSRevokeResultImpl::~XKMSRevokeResultImpl() { XKMSRevokeResultImpl::KeyBindingVectorType::iterator i; for (i = m_keyBindingList.begin() ; i != m_keyBindingList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSRevokeResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRevokeResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRevokeResult)) { throw XSECException(XSECException::XKMSError, "XKMSRevokeResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagKeyBinding); if (nl != NULL) { XKMSKeyBindingImpl * kb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_keyBindingList.push_back(kb); kb->load(); } } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSRevokeResultImpl::createBlankRevokeResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagRevokeResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRevokeResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RevokeResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSRevokeResultImpl::getKeyBindingSize(void) const { return (int) m_keyBindingList.size(); } XKMSKeyBinding * XKMSRevokeResultImpl::getKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_keyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSRevokeResult::getKeyBindingItem - item out of range"); } return m_keyBindingList[item]; } XKMSKeyBinding * XKMSRevokeResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) { XKMSKeyBindingImpl * u; XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env)); m_keyBindingList.push_back(u); DOMElement * e = u->createBlankKeyBinding(status); // Append the element m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return u; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusResultImpl.hpp000644 001751 001751 00000005216 12003301053 025171 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusResultImpl := Implementation of StatusResult Messages * * $Id: XKMSStatusResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUSRESULTIMPL_INCLUDE #define XKMSSTATUSRESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSUnverifiedKeyBindingImpl; class XKMSStatusResultImpl : public XKMSStatusResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSStatusResultImpl( const XSECEnv * env ); XKMSStatusResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSStatusResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankStatusResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getSuccessCount(void) const; virtual int getFailureCount(void) const; virtual int getPendingCount(void) const; virtual void setSuccessCount(int count); virtual void setFailureCount(int count); virtual void setPendingCount(int count); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_successAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_failureAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_pendingAttr; // Unimplemented XKMSStatusResultImpl(const XKMSStatusResultImpl &); XKMSStatusResultImpl & operator = (const XKMSStatusResultImpl &); }; #endif /* XKMSSTATUSRESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueKeyBindingImpl.hpp000644 001751 001751 00000004171 12003301053 026071 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueKeyBinding := Implementation for ReissueKeyBinding * * $Id$ * */ #ifndef XKMSREISSUEKEYBINDINGIMPL_INCLUDE #define XKMSREISSUEKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSStatusImpl; class XKMSReissueKeyBindingImpl : public XKMSReissueKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSReissueKeyBindingImpl( const XSECEnv * env ); XKMSReissueKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSReissueKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankReissueKeyBinding(XKMSStatus::StatusValue status); // Interface virtual XKMSStatus * getStatus(void) const; // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: XKMSStatusImpl * mp_status; // Unimplemented XKMSReissueKeyBindingImpl(void); XKMSReissueKeyBindingImpl(const XKMSReissueKeyBindingImpl &); XKMSReissueKeyBindingImpl & operator = (const XKMSReissueKeyBindingImpl &); }; #endif /* XKMSREISSUEKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRespondWithImpl.hpp000644 001751 001751 00000004211 12003301053 024747 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRespondWithImpl := Implementation of XKMSRespondWith * * $Id: XKMSRespondWithImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESPONDWITHIMPL_INCLUDE #define XKMSRESPONDWITHIMPL_INCLUDE // XSEC Includes #include #include class XSECEnv; class XKMSRespondWithImpl : public XKMSRespondWith { public: XKMSRespondWithImpl(const XSECEnv * env); XKMSRespondWithImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRespondWithImpl(); // load void load(void); XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRespondWith( const XMLCh * item); /* Getter Interface Methods */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const { return mp_respondWithElement; } virtual const XMLCh * getRespondWithString(void) const; /* Setter interface methods */ virtual void setRespondWithString(const XMLCh * str); //@} private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_respondWithElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_respondWithTextNode; // Unimplemented XKMSRespondWithImpl(const XKMSRespondWithImpl &); XKMSRespondWithImpl & operator = (const XKMSRespondWithImpl &); }; #endif /* XKMSRESPONDWITHIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeRequestImpl.cpp000644 001751 001751 00000021766 12003301053 025316 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeRequestImpl := Implementation for RegisterRequest Messages * * $Id:$ * */ // XSEC Includes #include #include #include #include #include #include #include #include "XKMSRevokeRequestImpl.hpp" #include "XKMSRevokeKeyBindingImpl.hpp" #include "XKMSAuthenticationImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRevokeRequestImpl::XKMSRevokeRequestImpl(const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_authentication(NULL), mp_revokeKeyBinding(NULL), mp_revocationCodeElement(NULL) { } XKMSRevokeRequestImpl::XKMSRevokeRequestImpl(const XSECEnv * env, DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_authentication(NULL), mp_revokeKeyBinding(NULL), mp_revocationCodeElement(NULL) { } XKMSRevokeRequestImpl::~XKMSRevokeRequestImpl() { if (mp_authentication != NULL) delete mp_authentication; if (mp_revokeKeyBinding != NULL) delete mp_revokeKeyBinding; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSRevokeRequestImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRevokeRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRevokeRequest)) { throw XSECException(XSECException::XKMSError, "XKMSRevokeRequest::load - called on incorrect node"); } // Load the base message m_request.load(); // Now check for any RevokeKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevokeKeyBinding)) { tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL) { XSECnew(mp_revokeKeyBinding, XKMSRevokeKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_revokeKeyBinding->load(); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRevokeRequest::load - Expected RevokeKeyBinding node"); } // Authentication Element | RevocationCode Element if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagAuthentication)) { XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env, tmpElt)); mp_authentication->load(mp_revokeKeyBinding->getId()); } else if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevocationCode)) { mp_revocationCodeElement = tmpElt; } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRevokeRequest::load - Expected Authentication or RevocationCode nodes"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRevokeRequestImpl:: createBlankRevokeRequest(const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagRevokeRequest, service, id); } // -------------------------------------------------------------------------------- // MessageType // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRevokeRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RevokeRequest; } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- XKMSRevokeKeyBinding * XKMSRevokeRequestImpl::getRevokeKeyBinding(void) const { return mp_revokeKeyBinding; } XKMSAuthentication * XKMSRevokeRequestImpl::getAuthentication (void) const { return mp_authentication; } const XMLCh * XKMSRevokeRequestImpl::getRevocationCode(void) const { if (mp_revocationCodeElement == NULL) return NULL; DOMNode * t = findFirstChildOfType(mp_revocationCodeElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRevokeRequestImpl::getRevocationCode - expected TEXT node"); } return t->getNodeValue(); } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- XKMSRevokeKeyBinding * XKMSRevokeRequestImpl::addRevokeKeyBinding(XKMSStatus::StatusValue status) { if (mp_revokeKeyBinding != NULL) return mp_revokeKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_revokeKeyBinding, XKMSRevokeKeyBindingImpl(m_msg.mp_env)); DOMElement * elt = mp_revokeKeyBinding->createBlankRevokeKeyBinding(status); // Insert DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagAuthentication) && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode)) { be = findNextElementChild(be); } if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_revokeKeyBinding; } m_msg.mp_messageAbstractTypeElement->insertBefore(elt, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_revokeKeyBinding; } XKMSAuthentication * XKMSRevokeRequestImpl::addAuthentication(void) { if (mp_authentication != NULL) return mp_authentication; if (mp_revokeKeyBinding == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRevokeRequestImpl::addAuthentication - called prior to key infos being added"); } XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env)); DOMElement * e = mp_authentication->createBlankAuthentication(mp_revokeKeyBinding->getId()); DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode)) be = findNextElementChild(be); if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_authentication; } m_msg.mp_messageAbstractTypeElement->insertBefore(e, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_authentication; } void XKMSRevokeRequestImpl::addRevocationCode(const XMLCh * code) { safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagRevocationCode); mp_revocationCodeElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); m_msg.mp_messageAbstractTypeElement->appendChild(mp_revocationCodeElement); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); mp_revocationCodeElement->appendChild( m_msg.mp_env->getParentDocument()->createTextNode(code)); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSPendingRequestImpl.cpp000644 001751 001751 00000011501 12003301053 025431 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPendingRequestImpl := Implementation of PendingRequest Messages * * $Id: XKMSPendingRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSPendingRequestImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSPendingRequestImpl::XKMSPendingRequestImpl( const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_responseIdAttr(NULL) { } XKMSPendingRequestImpl::XKMSPendingRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_responseIdAttr(NULL) { } XKMSPendingRequestImpl::~XKMSPendingRequestImpl() { } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSPendingRequestImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSPendingRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagPendingRequest)) { throw XSECException(XSECException::XKMSError, "XKMSPendingRequest::load - called incorrect node"); } // Load the base message m_request.load(); // Now check for ResponseId attribute mp_responseIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseId); if (mp_responseIdAttr == NULL) { // Attempt to load an empty element throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSPendingRequest::load - No ResponseId attribute found"); } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSPendingRequestImpl::createBlankPendingRequest( const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagPendingRequest, service, id); // return XKMSRequestAbstractTypeImpl::createBlankMessageAbstractType( // MAKE_UNICODE_STRING("ValidateRequest"), service, id); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSPendingRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::PendingRequest; } const XMLCh * XKMSPendingRequestImpl::getResponseId(void) const { if (mp_responseIdAttr == NULL) { // Attempt read when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSPendingRequest::getResponseId - called on non-initialised structure"); } return mp_responseIdAttr->getNodeValue(); } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- void XKMSPendingRequestImpl::setResponseId(const XMLCh * responseId) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSPendingRequest::setResponseId - called on non-initialised structure"); } m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagResponseId, responseId); mp_responseIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseId); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverResultImpl.hpp000644 001751 001751 00000006356 12003301053 025321 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverResultImpl := Implementation of RecoverResult Messages * * $Id$ * */ #ifndef XKMSRECOVERRESULTIMPL_INCLUDE #define XKMSRECOVERRESULTIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSKeyBindingImpl; class XKMSRSAKeyPairImpl; class XENCCipherImpl; class XKMSRecoverResultImpl : public XKMSRecoverResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRecoverResultImpl( const XSECEnv * env ); XKMSRecoverResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRecoverResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRecoverResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getKeyBindingSize(void) const; virtual XKMSKeyBinding * getKeyBindingItem(int item) const; virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status); virtual XKMSRSAKeyPair * getRSAKeyPair(const char * passPhrase); virtual XENCEncryptedData * setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI = NULL); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyBindingVectorType; #else typedef std::vector KeyBindingVectorType; #endif KeyBindingVectorType m_keyBindingList; XKMSRSAKeyPairImpl * mp_RSAKeyPair; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_privateKeyElement; // To handle the cipher XSECProvider m_prov; // Unimplemented XKMSRecoverResultImpl(void); XKMSRecoverResultImpl(const XKMSRecoverResultImpl &); XKMSRecoverResultImpl & operator = (const XKMSRecoverResultImpl &); }; #endif /* XKMSRECOVERRESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidateRequestImpl.cpp000644 001751 001751 00000011651 12003301053 025604 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateRequestImpl := Implementation of ValidateRequest Messages * * $Id: XKMSValidateRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSValidateRequestImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSValidateRequestImpl::XKMSValidateRequestImpl( const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_queryKeyBindingElement(NULL), mp_queryKeyBinding(NULL) { } XKMSValidateRequestImpl::XKMSValidateRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_queryKeyBinding(NULL) { } XKMSValidateRequestImpl::~XKMSValidateRequestImpl() { if (mp_queryKeyBinding != NULL) delete mp_queryKeyBinding; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSValidateRequestImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSValidateRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagValidateRequest)) { throw XSECException(XSECException::XKMSError, "XKMSValidateRequest::load - called incorrect node"); } // Load the base message m_request.load(); // Now check for any QueryKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagQueryKeyBinding)) tmpElt = findNextElementChild(tmpElt); if (tmpElt != NULL) { XSECnew(mp_queryKeyBinding, XKMSQueryKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_queryKeyBinding->load(); mp_queryKeyBindingElement = tmpElt; } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSValidateRequestImpl::createBlankValidateRequest( const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagValidateRequest, service, id); // return XKMSRequestAbstractTypeImpl::createBlankMessageAbstractType( // MAKE_UNICODE_STRING("ValidateRequest"), service, id); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSValidateRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::ValidateRequest; } XKMSQueryKeyBinding * XKMSValidateRequestImpl::getQueryKeyBinding(void) { return mp_queryKeyBinding; } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- XKMSQueryKeyBinding * XKMSValidateRequestImpl::addQueryKeyBinding(void) { if (mp_queryKeyBinding != NULL) return mp_queryKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_queryKeyBinding, XKMSQueryKeyBindingImpl(m_msg.mp_env)); mp_queryKeyBindingElement = mp_queryKeyBinding->createBlankQueryKeyBinding(); if (m_msg.mp_messageAbstractTypeElement->getFirstChild() == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } m_msg.mp_messageAbstractTypeElement->appendChild(mp_queryKeyBindingElement); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_queryKeyBinding; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusRequestImpl.hpp000644 001751 001751 00000004573 12003301053 025350 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusRequestImpl := Implementation of StatusRequest Messages * * $Id: XKMSStatusRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSSTATUSREQUESTIMPL_INCLUDE #define XKMSSTATUSREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSStatusRequestImpl : public XKMSStatusRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSStatusRequestImpl( const XSECEnv * env ); XKMSStatusRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSStatusRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankStatusRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual const XMLCh * getResponseId(void) const; /* Setter interface methods */ virtual void setResponseId(const XMLCh * responseId); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_responseIdAttr; // Unimplemented XKMSStatusRequestImpl(const XKMSStatusRequestImpl &); XKMSStatusRequestImpl & operator = (const XKMSStatusRequestImpl &); }; #endif /* XKMSSTATUSREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverRequestImpl.hpp000644 001751 001751 00000005425 12003301053 025467 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverRequestImpl := Implementation for RecoverRequest Messages * * $Id$ * */ #ifndef XKMSRECOVERREQUESTIMPL_INCLUDE #define XKMSRECOVERREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSAuthenticationImpl; class DSIGSignature; class XKMSRecoverKeyBindingImpl; class XKMSRecoverRequestImpl : public XKMSRecoverRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRecoverRequestImpl( const XSECEnv * env ); XKMSRecoverRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRecoverRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRecoverRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSRecoverKeyBinding * getRecoverKeyBinding(void) const; virtual XKMSAuthentication * getAuthentication (void) const; /* Setter Interface Methods */ virtual XKMSRecoverKeyBinding * addRecoverKeyBinding(XKMSStatus::StatusValue status); virtual XKMSAuthentication * addAuthentication(void); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XKMSAuthenticationImpl * mp_authentication; XKMSRecoverKeyBindingImpl * mp_recoverKeyBinding; XSECProvider m_prov; // For creating the signature // Unimplemented XKMSRecoverRequestImpl(void); XKMSRecoverRequestImpl(const XKMSRecoverRequestImpl &); XKMSRecoverRequestImpl & operator = (const XKMSRecoverRequestImpl &); }; #endif /* XKMSRECOVERREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverKeyBindingImpl.cpp000644 001751 001751 00000007434 12003301053 026057 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverKeyBindingImpl := Implementation for RecoverKeyBinding * * $Id$ * */ // XSEC Includes #include #include #include #include #include #include "XKMSRecoverKeyBindingImpl.hpp" #include "XKMSStatusImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRecoverKeyBindingImpl::XKMSRecoverKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { mp_status = NULL; } XKMSRecoverKeyBindingImpl::XKMSRecoverKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { mp_status = NULL; } XKMSRecoverKeyBindingImpl::~XKMSRecoverKeyBindingImpl() { if (mp_status != NULL) delete mp_status; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSRecoverKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRecoverKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); /* Find the status element */ DOMNodeList * nl = mp_keyBindingAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagStatus); if (nl == NULL || nl->getLength() != 1) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRecoverKeyBinding::load - Status value not found"); } XSECnew(mp_status, XKMSStatusImpl(mp_env, (DOMElement*) nl->item(0))); mp_status->load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRecoverKeyBindingImpl::createBlankRecoverKeyBinding(XKMSStatus::StatusValue status) { DOMElement * ret = XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagRecoverKeyBinding); mp_env->doPrettyPrint(ret); // Create the status element XSECnew(mp_status, XKMSStatusImpl(mp_env)); ret->appendChild(mp_status->createBlankStatus(status)); mp_env->doPrettyPrint(ret); // Must have an Id XKMSKeyBindingAbstractTypeImpl::setId(); return ret; } // -------------------------------------------------------------------------------- // Status handling // -------------------------------------------------------------------------------- XKMSStatus * XKMSRecoverKeyBindingImpl::getStatus(void) const { return mp_status; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRSAKeyPairImpl.cpp000644 001751 001751 00000012165 12003301053 024415 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRSAKeyPairImpl := Implementation class for RSAKeyPair elements * * $Id:$ * */ // XSEC Includes #include #include #include #include #include #include "XKMSRSAKeyPairImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE #define XKMS_GET_RSA_VAL(XVAL) e = (DOMElement *) findNextElementChild(e); \ if (e == NULL || !strEquals(getXKMSLocalName(e), XKMSConstants::s_tag##XVAL) || \ ((t = findFirstChildOfType(e, DOMNode::TEXT_NODE)) == NULL)) { \ throw XSECException(XSECException::ExpectedXKMSChildNotFound, \ "XKMSRSAKeyPair::load - Expected node"); \ } \ mp_##XVAL = t->getNodeValue(); #define XKMS_SET_RSA_VAL(XVAL) makeQName(str, prefix, XKMSConstants::s_tag##XVAL); \ e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, \ str.rawXMLChBuffer());\ e->appendChild(doc->createTextNode(XVAL));\ mp_RSAKeyPairElement->appendChild(e);\ mp_env->doPrettyPrint(mp_RSAKeyPairElement); #define XKMS_RET_RSA_VAL(XVAL) const XMLCh * XKMSRSAKeyPairImpl::get##XVAL (void) const {\ return mp_##XVAL;} // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRSAKeyPairImpl::XKMSRSAKeyPairImpl(const XSECEnv * env) : mp_env(env), mp_RSAKeyPairElement(NULL), mp_Modulus(NULL), mp_Exponent(NULL), mp_P(NULL), mp_Q(NULL), mp_DP(NULL), mp_DQ(NULL), mp_InverseQ(NULL), mp_D(NULL) {} XKMSRSAKeyPairImpl::XKMSRSAKeyPairImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_RSAKeyPairElement(node), mp_Modulus(NULL), mp_Exponent(NULL), mp_P(NULL), mp_Q(NULL), mp_DP(NULL), mp_DQ(NULL), mp_InverseQ(NULL), mp_D(NULL) {} XKMSRSAKeyPairImpl::~XKMSRSAKeyPairImpl() {} // -------------------------------------------------------------------------------- // load // -------------------------------------------------------------------------------- void XKMSRSAKeyPairImpl::load(void) { if (mp_RSAKeyPairElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRSAKeyPair::load - called on empty DOM"); } DOMElement * e; DOMNode * t; // Check for Modulus node e = (DOMElement *) findFirstElementChild(mp_RSAKeyPairElement); if (e == NULL || !strEquals(getXKMSLocalName(e), XKMSConstants::s_tagModulus) || ((t = findFirstChildOfType(e, DOMNode::TEXT_NODE)) == NULL)) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRSAKeyPair::load - Expected node"); } mp_Modulus = t->getNodeValue(); XKMS_GET_RSA_VAL(Exponent); XKMS_GET_RSA_VAL(P); XKMS_GET_RSA_VAL(Q); XKMS_GET_RSA_VAL(DP); XKMS_GET_RSA_VAL(DQ); XKMS_GET_RSA_VAL(InverseQ); XKMS_GET_RSA_VAL(D); } // -------------------------------------------------------------------------------- // Build from Scratch // -------------------------------------------------------------------------------- DOMElement * XKMSRSAKeyPairImpl::createBlankXKMSRSAKeyPairImpl( const XMLCh * Modulus, const XMLCh * Exponent, const XMLCh * P, const XMLCh * Q, const XMLCh * DP, const XMLCh * DQ, const XMLCh * InverseQ, const XMLCh * D) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagRSAKeyPair); mp_RSAKeyPairElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_RSAKeyPairElement); /* Now add the Values element */ DOMElement * e; XKMS_SET_RSA_VAL(Modulus) XKMS_SET_RSA_VAL(Exponent) XKMS_SET_RSA_VAL(P) XKMS_SET_RSA_VAL(Q) XKMS_SET_RSA_VAL(DP) XKMS_SET_RSA_VAL(DQ) XKMS_SET_RSA_VAL(InverseQ) XKMS_SET_RSA_VAL(D) return mp_RSAKeyPairElement; } XKMS_RET_RSA_VAL(Modulus) XKMS_RET_RSA_VAL(Exponent) XKMS_RET_RSA_VAL(P) XKMS_RET_RSA_VAL(Q) XKMS_RET_RSA_VAL(DP) XKMS_RET_RSA_VAL(DQ) XKMS_RET_RSA_VAL(InverseQ) XKMS_RET_RSA_VAL(D) xml-security-c-1.7.3/xsec/xkms/impl/XKMSMessageAbstractTypeImpl.hpp000644 001751 001751 00000011673 12003301053 026425 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageAbstractTypeImpl := Implementation class for base XKMS messages * * $Id: XKMSMessageAbstractTypeImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSMESSAGEABSTRACTTYPEIMPL_INCLUDE #define XKMSMESSAGEABSTRACTTYPEIMPL_INCLUDE // XSEC Includes #include #include #include class XSECEnv; class DSIGSignature; XSEC_DECLARE_XERCES_CLASS(DOMElement); XSEC_DECLARE_XERCES_CLASS(DOMAttr); class XKMSMessageAbstractTypeImpl : public XKMSMessageAbstractType { public: /* Constructors and Destructors */ XKMSMessageAbstractTypeImpl( const XSECEnv * env ); XKMSMessageAbstractTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSMessageAbstractTypeImpl() ; // load void load(void); // Create from scratch - tag is the element name to create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankMessageAbstractType( const XMLCh * tag, const XMLCh * service, const XMLCh * id = NULL); /* Message Manipulation Methods */ virtual XKMSMessageAbstractType::messageType getMessageType(void) { return XKMSMessageAbstractType::None; } /* Getter Interface Methods */ virtual bool isSigned(void) const; virtual DSIGSignature * getSignature(void) const; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const; virtual const XMLCh * getId(void) const; virtual const XMLCh * getService(void) const; virtual const XMLCh * getNonce(void) const; /* Setter interface methods */ virtual void setId(const XMLCh * id); virtual void setService(const XMLCh * service); virtual void setNonce(const XMLCh * uri); virtual DSIGSignature * addSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1); /* Opaque Client Data interface */ virtual int getOpaqueClientDataSize(void); virtual const XMLCh * getOpaqueClientDataItemStr(int item); virtual void appendOpaqueClientDataItem(const XMLCh * item); public: const XSECEnv * mp_env; // NOTE: Owned by the base message class XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_messageAbstractTypeElement; private: XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_idAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_serviceAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_nonceAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_signatureElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_opaqueClientDataElement; XSECProvider m_prov; DSIGSignature * mp_signature; int m_opaqueClientDataSize; // Unimplemented XKMSMessageAbstractTypeImpl(void); XKMSMessageAbstractTypeImpl(const XKMSMessageAbstractTypeImpl &); XKMSMessageAbstractTypeImpl & operator = (const XKMSMessageAbstractTypeImpl &); }; #define XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS \ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * \ getElement(void) const \ {return m_msg.getElement();} \ virtual bool isSigned(void) const \ {return m_msg.isSigned();} \ virtual DSIGSignature * getSignature(void) const \ {return m_msg.getSignature();} \ virtual const XMLCh * getId(void) const \ {return m_msg.getId();} \ virtual const XMLCh * getService(void) const \ {return m_msg.getService();} \ virtual const XMLCh * getNonce(void) const \ {return m_msg.getNonce();} \ virtual void setId(const XMLCh * id) \ {m_msg.setId(id);} \ virtual void setService(const XMLCh * service) \ {m_msg.setService(service);} \ virtual void setNonce(const XMLCh * uri) \ {m_msg.setNonce(uri);} \ virtual DSIGSignature * addSignature( \ canonicalizationMethod cm = CANON_C14N_NOC, \ signatureMethod sm = SIGNATURE_DSA, \ hashMethod hm = HASH_SHA1) \ {return m_msg.addSignature(cm,sm,hm);} \ virtual int getOpaqueClientDataSize(void) \ {return m_msg.getOpaqueClientDataSize();} \ virtual const XMLCh * getOpaqueClientDataItemStr(int item) \ {return m_msg.getOpaqueClientDataItemStr(item);} \ virtual void appendOpaqueClientDataItem(const XMLCh * item) \ {m_msg.appendOpaqueClientDataItem(item);} #endif /* XKMSMESSAGEABSTRACTTYPEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSUnverifiedKeyBindingImpl.cpp000644 001751 001751 00000005171 12003301053 026546 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUnverifiedKeyBindingImpl := Implementation for UnverifiedKeyBinding * * $Id: XKMSUnverifiedKeyBindingImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include "XKMSUnverifiedKeyBindingImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSUnverifiedKeyBindingImpl::XKMSUnverifiedKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { } XKMSUnverifiedKeyBindingImpl::XKMSUnverifiedKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { } XKMSUnverifiedKeyBindingImpl::~XKMSUnverifiedKeyBindingImpl() {} // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSUnverifiedKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSUnverifiedKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSUnverifiedKeyBindingImpl::createBlankUnverifiedKeyBinding(void) { return XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagUnverifiedKeyBinding); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidityIntervalImpl.hpp000644 001751 001751 00000004465 12003301053 026006 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidityInterval := Implementation for ValidityInterval elements * * $Id: XKMSValidityIntervalImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDITYINTERVALIMPL_HEADER #define XKMSVALIDITYINTERVALIMPL_HEADER #include #include class XSECEnv; class XKMSValidityIntervalImpl : public XKMSValidityInterval { public: /* Constructors and Destructors */ XKMSValidityIntervalImpl( const XSECEnv * env ); XKMSValidityIntervalImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSValidityIntervalImpl() ; // Load void load(); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankValidityInterval(const XMLCh * notBefore, const XMLCh * notOnOrAfter); // Get methods virtual const XMLCh * getNotBefore(void) const; virtual const XMLCh * getNotOnOrAfter(void) const; // Set virtual void setNotBefore(const XMLCh * val); virtual void setNotOnOrAfter(const XMLCh * val); private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_validityIntervalElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_notBeforeElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_notOnOrAfterElement; // Unimplemented XKMSValidityIntervalImpl(void); XKMSValidityIntervalImpl(const XKMSValidityIntervalImpl &); XKMSValidityIntervalImpl & operator = (const XKMSValidityIntervalImpl &); }; #endif /* XKMSVALIDITYINTERVAL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSLocateResultImpl.hpp000644 001751 001751 00000005261 12003301053 025115 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateResultImpl := Implementation of LocateResult Messages * * $Id: XKMSLocateResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSLOCATERESULTIMPL_INCLUDE #define XKMSLOCATERESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSUnverifiedKeyBindingImpl; class XKMSLocateResultImpl : public XKMSLocateResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSLocateResultImpl( const XSECEnv * env ); XKMSLocateResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSLocateResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankLocateResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getUnverifiedKeyBindingSize(void) const; virtual XKMSUnverifiedKeyBinding * getUnverifiedKeyBindingItem(int item) const; virtual XKMSUnverifiedKeyBinding * appendUnverifiedKeyBindingItem(void); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector UnverifiedKeyBindingVectorType; #else typedef std::vector UnverifiedKeyBindingVectorType; #endif UnverifiedKeyBindingVectorType m_unverifiedKeyBindingList; // Unimplemented XKMSLocateResultImpl(const XKMSLocateResultImpl &); XKMSLocateResultImpl & operator = (const XKMSLocateResultImpl &); }; #endif /* XKMSLOCATERESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSLocateRequestImpl.cpp000644 001751 001751 00000011577 12003301053 025271 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateRequestImpl := Implementation of LocateRequest Messages * * $Id: XKMSLocateRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSLocateRequestImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSLocateRequestImpl::XKMSLocateRequestImpl( const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_queryKeyBindingElement(NULL), mp_queryKeyBinding(NULL) { } XKMSLocateRequestImpl::XKMSLocateRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_queryKeyBinding(NULL) { } XKMSLocateRequestImpl::~XKMSLocateRequestImpl() { if (mp_queryKeyBinding != NULL) delete mp_queryKeyBinding; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSLocateRequestImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSLocateRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagLocateRequest)) { throw XSECException(XSECException::XKMSError, "XKMSLocateRequest::load - called incorrect node"); } // Load the base message m_request.load(); // Now check for any QueryKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagQueryKeyBinding)) tmpElt = findNextElementChild(tmpElt); if (tmpElt != NULL) { XSECnew(mp_queryKeyBinding, XKMSQueryKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_queryKeyBinding->load(); mp_queryKeyBindingElement = tmpElt; } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSLocateRequestImpl::createBlankLocateRequest( const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagLocateRequest, service, id); // return XKMSRequestAbstractTypeImpl::createBlankMessageAbstractType( // MAKE_UNICODE_STRING("ValidateRequest"), service, id); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSLocateRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::LocateRequest; } XKMSQueryKeyBinding * XKMSLocateRequestImpl::getQueryKeyBinding(void) { return mp_queryKeyBinding; } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- XKMSQueryKeyBinding * XKMSLocateRequestImpl::addQueryKeyBinding(void) { if (mp_queryKeyBinding != NULL) return mp_queryKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_queryKeyBinding, XKMSQueryKeyBindingImpl(m_msg.mp_env)); mp_queryKeyBindingElement = mp_queryKeyBinding->createBlankQueryKeyBinding(); if (m_msg.mp_messageAbstractTypeElement->getFirstChild() == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } m_msg.mp_messageAbstractTypeElement->appendChild(mp_queryKeyBindingElement); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_queryKeyBinding; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSResultTypeImpl.cpp000644 001751 001751 00000022314 12003301053 024620 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResultTypeImpl := Implementation of base schema of XKMS Request messages * * $Id: XKMSResultTypeImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include "XKMSResultTypeImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructor Destructor // -------------------------------------------------------------------------------- XKMSResultTypeImpl::XKMSResultTypeImpl( const XSECEnv * env) : m_msg(env), mp_resultMajorAttr(NULL), mp_resultMinorAttr(NULL), mp_requestSignatureValueElement(NULL) { } XKMSResultTypeImpl::XKMSResultTypeImpl( const XSECEnv * env, DOMElement * node) : m_msg(env, node), mp_requestSignatureValueElement(NULL) { } XKMSResultTypeImpl::~XKMSResultTypeImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSResultTypeImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::ResultTypeError, "XKMSResultType::load - called on empty DOM"); } m_msg.load(); /* Now load the result attributes */ mp_resultMajorAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResultMajor); mp_resultMinorAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResultMinor); mp_requestIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagRequestId); /* Decode responses */ if (mp_resultMajorAttr == NULL) { // Attempt to load an empty element throw XSECException(XSECException::ResultTypeError, "XKMSResultType::load - No Major Response code found"); } const XMLCh * res = mp_resultMajorAttr->getNodeValue(); // Result types have now been updated, and are URIs with the XKMS namespace prepended // to the actual result value int res2 = XMLString::indexOf(res, chPound); if (res2 == -1 || XMLString::compareNString(res, XKMSConstants::s_unicodeStrURIXKMS, res2)) { throw XSECException(XSECException::ResultTypeError, "XKMSResultType::load - ResultType not in XKMS Name Space"); } res = &res[res2+1]; for (m_resultMajor = XKMSResultType::Pending; m_resultMajor > XKMSResultType::NoneMajor; m_resultMajor = (XKMSResultType::ResultMajor) (m_resultMajor-1)) { if (strEquals(XKMSConstants::s_tagResultMajorCodes[m_resultMajor], res)) break; } if (mp_resultMinorAttr != NULL) { res = mp_resultMinorAttr->getNodeValue(); int res2 = XMLString::indexOf(res, chPound); if (res2 == -1 || XMLString::compareNString(res, XKMSConstants::s_unicodeStrURIXKMS, res2)) { throw XSECException(XSECException::ResultTypeError, "XKMSResultType::load - ResultType not in XKMS Name Space"); } res = &res[res2+1]; for (m_resultMinor = XKMSResultType::NotSynchronous; m_resultMinor > XKMSResultType::NoneMinor; m_resultMinor = (XKMSResultType::ResultMinor) (m_resultMinor-1)) { if (strEquals(XKMSConstants::s_tagResultMinorCodes[m_resultMinor], res)) break; } } else m_resultMinor = XKMSResultType::NoneMinor; /* Check to see if there is a RequestSignatureValue node */ mp_requestSignatureValueElement = (DOMElement *) findFirstChildOfType(m_msg.mp_messageAbstractTypeElement, DOMNode::ELEMENT_NODE); while (mp_requestSignatureValueElement != NULL && !strEquals(getXKMSLocalName(mp_requestSignatureValueElement), XKMSConstants::s_tagRequestSignatureValue)) { mp_requestSignatureValueElement = findNextElementChild(mp_requestSignatureValueElement); } if (mp_requestSignatureValueElement != NULL) { if (findFirstChildOfType(mp_requestSignatureValueElement, DOMNode::TEXT_NODE) == NULL) { throw XSECException(XSECException::ResultTypeError, "XKMSResultType::load - RequestSignatureValue must have text node as child"); } } } // -------------------------------------------------------------------------------- // Create from scratch // -------------------------------------------------------------------------------- DOMElement * XKMSResultTypeImpl::createBlankResultType( const XMLCh * tag, const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { DOMElement * ret = m_msg.createBlankMessageAbstractType(tag, service, id); safeBuffer s; s.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); s.sbXMLChCat(XKMSConstants::s_tagResultMajorCodes[rmaj]); ret->setAttributeNS(NULL, XKMSConstants::s_tagResultMajor, s.rawXMLChBuffer()); if (rmin != XKMSResultType::NoneMinor) { s.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); s.sbXMLChCat(XKMSConstants::s_tagResultMinorCodes[rmin]); ret->setAttributeNS(NULL, XKMSConstants::s_tagResultMinor, s.rawXMLChBuffer()); } m_resultMajor = rmaj; m_resultMinor = rmin; mp_resultMajorAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResultMajor); mp_resultMinorAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResultMinor); return ret; } // -------------------------------------------------------------------------------- // Getter interface // -------------------------------------------------------------------------------- XKMSResultType::ResultMajor XKMSResultTypeImpl::getResultMajor(void) const { return m_resultMajor; } XKMSResultType::ResultMinor XKMSResultTypeImpl::getResultMinor(void) const { return m_resultMinor; } const XMLCh * XKMSResultTypeImpl::getRequestId(void) const { if (mp_requestIdAttr != NULL) return mp_requestIdAttr->getNodeValue(); return NULL; } const XMLCh * XKMSResultTypeImpl::getRequestSignatureValue(void) const { if (mp_requestSignatureValueElement != NULL) return findFirstChildOfType(mp_requestSignatureValueElement, DOMNode::TEXT_NODE)->getNodeValue(); return NULL; } // -------------------------------------------------------------------------------- // Setter interface // -------------------------------------------------------------------------------- void XKMSResultTypeImpl::setResultMajor(ResultMajor) {} void XKMSResultTypeImpl::setResultMinor(ResultMinor) {} void XKMSResultTypeImpl::setRequestId(const XMLCh * id) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSResultType::setRequestId - called on non-initialised structure"); } m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagRequestId, id); mp_requestIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagRequestId); } void XKMSResultTypeImpl::setRequestSignatureValue(const XMLCh * value) { if (mp_requestSignatureValueElement != NULL) { findFirstChildOfType(mp_requestSignatureValueElement, DOMNode::TEXT_NODE)->setNodeValue(value); return; } // Get some setup values safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagRequestSignatureValue); mp_requestSignatureValueElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_requestSignatureValueElement->appendChild(doc->createTextNode(value)); /* Find where this sits, and insert */ DOMElement * c = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (c != NULL) { if (!(strEquals(getXKMSLocalName(c), XKMSConstants::s_tagMessageExtension) || strEquals(getDSIGLocalName(c), XKMSConstants::s_tagSignature) || strEquals(getXKMSLocalName(c), XKMSConstants::s_tagOpaqueClientData))) break; } if (c != NULL) { m_msg.mp_messageAbstractTypeElement->insertBefore(mp_requestSignatureValueElement, c); if (m_msg.mp_env->getPrettyPrintFlag()) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), c); } } else { m_msg.mp_messageAbstractTypeElement->appendChild(mp_requestSignatureValueElement); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); } } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRecoverKeyBindingImpl.hpp000644 001751 001751 00000004171 12003301053 026057 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRecoverKeyBinding := Implementation for RecoverKeyBinding * * $Id$ * */ #ifndef XKMSRECOVERKEYBINDINGIMPL_INCLUDE #define XKMSRECOVERKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSStatusImpl; class XKMSRecoverKeyBindingImpl : public XKMSRecoverKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSRecoverKeyBindingImpl( const XSECEnv * env ); XKMSRecoverKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRecoverKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRecoverKeyBinding(XKMSStatus::StatusValue status); // Interface virtual XKMSStatus * getStatus(void) const; // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: XKMSStatusImpl * mp_status; // Unimplemented XKMSRecoverKeyBindingImpl(void); XKMSRecoverKeyBindingImpl(const XKMSRecoverKeyBindingImpl &); XKMSRecoverKeyBindingImpl & operator = (const XKMSRecoverKeyBindingImpl &); }; #endif /* XKMSRECOVERKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSResultImpl.cpp000644 001751 001751 00000006201 12003301053 023753 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResultImpl := Implementation of Result Messages * * $Id: XKMSResultImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSResultImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSResultImpl::XKMSResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSResultImpl::XKMSResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { } XKMSResultImpl::~XKMSResultImpl() { } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagResult)) { throw XSECException(XSECException::XKMSError, "XKMSResult::load - called incorrect node"); } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSResultImpl::createBlankResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::Result; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidityIntervalImpl.cpp000644 001751 001751 00000016444 12003301053 026001 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidityInterval := Implementation for ValidityInterval elements * * $Id: XKMSValidityIntervalImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSValidityIntervalImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSValidityIntervalImpl::XKMSValidityIntervalImpl(const XSECEnv * env) : mp_env(env), mp_validityIntervalElement(NULL), mp_notBeforeElement(NULL), mp_notOnOrAfterElement(NULL) { } XKMSValidityIntervalImpl::XKMSValidityIntervalImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_validityIntervalElement(node), mp_notBeforeElement(NULL), mp_notOnOrAfterElement(NULL) { } XKMSValidityIntervalImpl::~XKMSValidityIntervalImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSValidityIntervalImpl::load(void) { if (mp_validityIntervalElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSValidityIntervalImpl::load - called on empty DOM"); } DOMElement * tmpElt = findFirstElementChild(mp_validityIntervalElement); if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagNotBefore)) { mp_notBeforeElement = tmpElt; tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagNotOnOrAfter)) { mp_notOnOrAfterElement = tmpElt; } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSValidityIntervalImpl::createBlankValidityInterval(const XMLCh * notBefore, const XMLCh * notOnOrAfter) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagValidityInterval); mp_validityIntervalElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_validityIntervalElement); if (notBefore != NULL) { makeQName(str, prefix, XKMSConstants::s_tagNotBefore); DOMElement * e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_validityIntervalElement->appendChild(e); e->appendChild(doc->createTextNode(notBefore)); mp_env->doPrettyPrint(mp_validityIntervalElement); } if (notOnOrAfter != NULL) { makeQName(str, prefix, XKMSConstants::s_tagNotOnOrAfter); DOMElement * e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_validityIntervalElement->appendChild(e); e->appendChild(doc->createTextNode(notOnOrAfter)); mp_env->doPrettyPrint(mp_validityIntervalElement); } return mp_validityIntervalElement; } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- const XMLCh * XKMSValidityIntervalImpl::getNotBefore(void) const { if (mp_notBeforeElement == NULL) return NULL; DOMNode * t = findFirstChildOfType(mp_notBeforeElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSValidityIntervalImpl::getNotBefore - expected TEXT node"); } return t->getNodeValue(); } const XMLCh * XKMSValidityIntervalImpl::getNotOnOrAfter(void) const { if (mp_notOnOrAfterElement == NULL) return NULL; DOMNode * t = findFirstChildOfType(mp_notOnOrAfterElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSValidityIntervalImpl::getNotOnOrAfter - expected TEXT node"); } return t->getNodeValue(); } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- void XKMSValidityIntervalImpl::setNotBefore(const XMLCh * val) { if (mp_notBeforeElement == NULL) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagNotBefore); mp_notBeforeElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_notBeforeElement->appendChild(doc->createTextNode(val)); // Now insert appropriately if (mp_notOnOrAfterElement != NULL) { mp_validityIntervalElement->insertBefore(mp_notBeforeElement, mp_notOnOrAfterElement); if (mp_env->getPrettyPrintFlag() == true) { mp_validityIntervalElement->insertBefore( doc->createTextNode(DSIGConstants::s_unicodeStrNL), mp_notOnOrAfterElement); } } else { mp_validityIntervalElement->appendChild(mp_notBeforeElement); mp_env->doPrettyPrint(mp_validityIntervalElement); } return; } DOMNode * t = findFirstChildOfType(mp_notBeforeElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSValidityIntervalImpl::getNotBefore - expected TEXT node"); } t->setNodeValue(val); } void XKMSValidityIntervalImpl::setNotOnOrAfter(const XMLCh * val) { if (mp_notOnOrAfterElement == NULL) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagNotOnOrAfter); mp_notOnOrAfterElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_notOnOrAfterElement->appendChild(doc->createTextNode(val)); // Now insert appropriately mp_validityIntervalElement->appendChild(mp_notOnOrAfterElement); mp_env->doPrettyPrint(mp_validityIntervalElement); return; } DOMNode * t = findFirstChildOfType(mp_notOnOrAfterElement, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSValidityIntervalImpl::getNotOnOrAfter - expected TEXT node"); } t->setNodeValue(val); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusImpl.cpp000644 001751 001751 00000023344 12003301053 023767 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusImpl := Implementation for Status elements (in KeyBinding) * * $Id: XKMSStatusImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include "XKMSStatusImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSStatusImpl::XKMSStatusImpl( const XSECEnv * env) : mp_env(env), mp_statusElement(NULL) { m_statusValue = XKMSStatus::StatusUndefined; StatusValue i; StatusReason j; /* Clean out status codes */ for (i = Indeterminate ; i > StatusUndefined; i = (StatusValue)(i-1)) { for (j = XKMSStatus::Signature; j != XKMSStatus::ReasonUndefined; j = (XKMSStatus::StatusReason) (j-1)) { m_statusReasons[i-1][j-1] = NULL; } } } XKMSStatusImpl::XKMSStatusImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : mp_env(env), mp_statusElement(node) { m_statusValue = XKMSStatus::StatusUndefined; StatusValue i; StatusReason j; /* Clean out status codes */ for (i = Indeterminate ; i > StatusUndefined; i = (StatusValue)(i-1)) { for (j = XKMSStatus::Signature; j != XKMSStatus::ReasonUndefined; j = (XKMSStatus::StatusReason) (j-1)) { m_statusReasons[i-1][j-1] = NULL; } } } XKMSStatusImpl::~XKMSStatusImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSStatusImpl::load() { if (mp_statusElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::StatusError, "XKMSStatus::load - called on empty DOM"); } /* Load the StatusValue attribute */ mp_statusValueAttr = mp_statusElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagStatusValue); /* Decode as appropriate*/ if (mp_statusValueAttr == NULL) { // Attempt to load an empty element throw XSECException(XSECException::StatusError, "XKMSStatus::load - No StatusValue attribute found"); } const XMLCh * res = mp_statusValueAttr->getNodeValue(); // This is actually an QName, but we cheat and find the ':' character by hand // without actually checking the qualifier. // TODO - CHECK the qualifier. int res2 = XMLString::indexOf(res, chPound); if (res2 == -1 || XMLString::compareNString(res, XKMSConstants::s_unicodeStrURIXKMS, res2)) { throw XSECException(XSECException::StatusError, "XKMSStatus::load - StatusValue not in XKMS Name Space"); } res = &res[res2+1]; for (m_statusValue = XKMSStatus::Indeterminate; m_statusValue > XKMSStatus::StatusUndefined; m_statusValue = (XKMSStatus::StatusValue) (m_statusValue-1)) { if (strEquals(XKMSConstants::s_tagStatusValueCodes[m_statusValue], res)) break; } if (m_statusValue == XKMSStatus::StatusUndefined) { throw XSECException(XSECException::StatusError, "XKMSStatus::load - Unknown StatusValue provided"); } /* Now we need to run through the status values */ DOMElement * e = findFirstElementChild(mp_statusElement); while (e != NULL) { const XMLCh * vs = getXKMSLocalName(e); StatusValue v; if (strEquals(vs, XKMSConstants::s_tagValidReason)) { v = Valid; } else if (strEquals(vs, XKMSConstants::s_tagInvalidReason)) { v = Invalid; } else if (strEquals(vs, XKMSConstants::s_tagIndeterminateReason)) { v = Indeterminate; } else { throw XSECException(XSECException::StatusError, "XKMSStatus::load - Unknown Reason element"); } DOMNode *t = findFirstChildOfType(e, DOMNode::TEXT_NODE); if (t == NULL) { throw XSECException(XSECException::StatusError, "XKMSStatus::load - Expected text node child of reason element"); } /* Strip out the URI prefix */ const XMLCh * reason = t->getNodeValue(); int res = XMLString::indexOf(reason, chPound); if (res == -1 || XMLString::compareNString(reason, XKMSConstants::s_unicodeStrURIXKMS, res)) { throw XSECException(XSECException::StatusError, "XKMSStatus::load - StatusReason not in XKMS Name Space"); } reason = &reason[res+1]; /* Found out what we are! */ XKMSStatus::StatusReason i; for (i = XKMSStatus::Signature; i != XKMSStatus::ReasonUndefined; i = (XKMSStatus::StatusReason) (i-1)) { if (strEquals(XKMSConstants::s_tagStatusReasonCodes[i], reason)) break; } if (i == XKMSStatus::ReasonUndefined) { throw XSECException(XSECException::StatusError, "XKMSStatus::load - Unknown StatusReason"); } m_statusReasons[v-1][i-1] = e; e = findNextElementChild(e); } } // -------------------------------------------------------------------------------- // Create Blank Status // -------------------------------------------------------------------------------- DOMElement * XKMSStatusImpl::createBlankStatus(StatusValue status) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagStatus); mp_statusElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_statusElement); /* Now add the StatusValue element */ str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); str.sbXMLChCat(XKMSConstants::s_tagStatusValueCodes[status]); mp_statusElement->setAttributeNS(NULL, XKMSConstants::s_tagStatusValue, str.rawXMLChBuffer()); mp_statusValueAttr = mp_statusElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagStatusValue); m_statusValue = status; return mp_statusElement; } // -------------------------------------------------------------------------------- // Get methods // -------------------------------------------------------------------------------- /* Getter Interface Methods */ XKMSStatus::StatusValue XKMSStatusImpl::getStatusValue(void) const { return m_statusValue; } bool XKMSStatusImpl::getStatusReason(StatusValue status, StatusReason reason) const { if (status == StatusUndefined || reason == ReasonUndefined) { throw XSECException(XSECException::StatusError, "XKMSStatus::getStatusReason - status or reason undefined"); } return (m_statusReasons[status-1][reason-1] != NULL); } // -------------------------------------------------------------------------------- // Set methods // -------------------------------------------------------------------------------- void XKMSStatusImpl::setStatusReason(StatusValue status, StatusReason reason, bool value) { if (status == StatusUndefined || reason == ReasonUndefined) { throw XSECException(XSECException::StatusError, "XKMSStatus::setStatusReason - status or reason undefined"); } if ((m_statusReasons[status-1][reason-1] != NULL) == value) return; /* Delete if necessary */ if (value == false) { DOMNode * c = m_statusReasons[status-1][reason-1]; mp_statusElement->removeChild(c); c->release(); m_statusReasons[status-1][reason-1] = NULL; return; } /* Find a previously found element to insert before*/ DOMNode * found = NULL; m_statusValue = XKMSStatus::StatusUndefined; StatusValue i; StatusReason j = XKMSStatus::Signature; /* Clean out status codes */ for (i = Indeterminate ; i > StatusUndefined && !(i == status && j == reason); i = (StatusValue)(i-1)) { for (j = XKMSStatus::Signature; j != XKMSStatus::ReasonUndefined && !(i == status && j == reason); j = (XKMSStatus::StatusReason) (j-1)) { if (m_statusReasons[i-1][j-1] != NULL) found = m_statusReasons[i-1][j-1]; } } /* Now lets create our new element and its text child */ safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); // str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); if (status == Valid) { makeQName(str, prefix, XKMSConstants::s_tagValidReason); } else if (status == Invalid) { makeQName(str, prefix, XKMSConstants::s_tagInvalidReason); } else { makeQName(str, prefix, XKMSConstants::s_tagIndeterminateReason); } DOMElement * e = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); /* Create the text node child */ str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); str.sbXMLChCat(XKMSConstants::s_tagStatusReasonCodes[reason]); e->appendChild(doc->createTextNode(str.rawXMLChBuffer())); /* Insert at correct place */ if (found == NULL) { mp_statusElement->appendChild(e); mp_env->doPrettyPrint(mp_statusElement); } else { mp_statusElement->insertBefore(e, found); if (mp_env->getPrettyPrintFlag() == true) mp_statusElement->insertBefore(doc->createTextNode(DSIGConstants::s_unicodeStrNL), found); } m_statusReasons[status-1][reason-1] = e; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRegisterRequestImpl.cpp000644 001751 001751 00000025120 12003301053 025633 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterRequestImpl := Implementation for RegisterRequest Messages * * $Id: XKMSRegisterRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSRegisterRequestImpl.hpp" #include "XKMSAuthenticationImpl.hpp" #include "XKMSPrototypeKeyBindingImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSRegisterRequestImpl::XKMSRegisterRequestImpl(const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_authentication(NULL), mp_prototypeKeyBinding(NULL), mp_proofOfPossessionSignature(NULL) { } XKMSRegisterRequestImpl::XKMSRegisterRequestImpl(const XSECEnv * env, DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_authentication(NULL), mp_prototypeKeyBinding(NULL), mp_proofOfPossessionSignature(NULL) { } XKMSRegisterRequestImpl::~XKMSRegisterRequestImpl() { if (mp_authentication != NULL) delete mp_authentication; if (mp_prototypeKeyBinding != NULL) delete mp_prototypeKeyBinding; // Provider will take care of the proofOfPossession signature } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSRegisterRequestImpl::load(void) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSRegisterRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagRegisterRequest)) { throw XSECException(XSECException::XKMSError, "XKMSRegisterRequest::load - called on incorrect node"); } // Load the base message m_request.load(); // Now check for any PrototypeKeyBinding elements DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagPrototypeKeyBinding)) { tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL) { XSECnew(mp_prototypeKeyBinding, XKMSPrototypeKeyBindingImpl(m_msg.mp_env, tmpElt)); mp_prototypeKeyBinding->load(); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRegisterRequest::load - Expected PrototypeKeyBinding node"); } // Authentication Element if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagAuthentication)) { XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env, tmpElt)); mp_authentication->load(mp_prototypeKeyBinding->getId()); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRegisterRequest::load - Expected Authentication node"); } if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagProofOfPossession)) { // Find the signature DOMElement * sigElt = (DOMElement *) findFirstElementChild(tmpElt); if (sigElt == NULL || !strEquals(getDSIGLocalName(sigElt), XKMSConstants::s_tagSignature)) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSRegisterRequest::load - Expected Signature child of ProofOfPossession"); } // The provider will take care of cleaning this up later. mp_proofOfPossessionSignature = m_prov.newSignatureFromDOM(m_msg.mp_env->getParentDocument(), sigElt); mp_proofOfPossessionSignature->load(); // Check the signature is across the correct input DSIGReferenceList * rl = mp_proofOfPossessionSignature->getReferenceList(); if (rl->getSize() != 1) { throw XSECException(XSECException::XKMSError, "XKMSRegisterRequestImpl::load - ProofOfPossession Signature with incorrect number of references found (should be 1)"); } safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_prototypeKeyBinding->getId()); if (!strEquals(rl->item(0)->getURI(), sb.rawXMLChBuffer())) { throw XSECException(XSECException::XKMSError, "XKMSRegisterRequestImpl::load - ProofOfPossession Signature refers to incorrect Id (should be for PrototypeKeyBinding)"); } // We don't actually check the signature as we have no key material to do so! } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSRegisterRequestImpl:: createBlankRegisterRequest(const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagRegisterRequest, service, id); } // -------------------------------------------------------------------------------- // MessageType // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSRegisterRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::RegisterRequest; } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- XKMSPrototypeKeyBinding * XKMSRegisterRequestImpl::getPrototypeKeyBinding(void) const { return mp_prototypeKeyBinding; } XKMSAuthentication * XKMSRegisterRequestImpl::getAuthentication (void) const { return mp_authentication; } DSIGSignature * XKMSRegisterRequestImpl::getProofOfPossessionSignature(void) const { return mp_proofOfPossessionSignature; } // -------------------------------------------------------------------------------- // Set Methods // -------------------------------------------------------------------------------- XKMSPrototypeKeyBinding * XKMSRegisterRequestImpl::addPrototypeKeyBinding(void) { if (mp_prototypeKeyBinding != NULL) return mp_prototypeKeyBinding; // OK - Nothing exists, so we need to create from scratch XSECnew(mp_prototypeKeyBinding, XKMSPrototypeKeyBindingImpl(m_msg.mp_env)); DOMElement * elt = mp_prototypeKeyBinding->createBlankPrototypeKeyBinding(); // Insert DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagAuthentication) && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagProofOfPossession)) { be = findNextElementChild(be); } if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(elt); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_prototypeKeyBinding; } m_msg.mp_messageAbstractTypeElement->insertBefore(elt, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_prototypeKeyBinding; } XKMSAuthentication * XKMSRegisterRequestImpl::addAuthentication(void) { if (mp_authentication != NULL) return mp_authentication; if (mp_prototypeKeyBinding == NULL) { throw XSECException(XSECException::XKMSError, "XKMSRegisterRequestImpl::addAuthentication - called prior to key infos being added"); } XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env)); DOMElement * e = mp_authentication->createBlankAuthentication(mp_prototypeKeyBinding->getId()); DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement); while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagProofOfPossession)) be = findNextElementChild(be); if (be == NULL) { m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return mp_authentication; } m_msg.mp_messageAbstractTypeElement->insertBefore(e, be); if (m_msg.mp_env->getPrettyPrintFlag() == true) { m_msg.mp_messageAbstractTypeElement->insertBefore( m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), be); } return mp_authentication; } DSIGSignature * XKMSRegisterRequestImpl::addProofOfPossessionSignature( canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { DSIGSignature * ret = m_prov.newSignature(); DOMElement * elt = ret->createBlankSignature(m_msg.mp_env->getParentDocument(), cm, sm, hm); /* Create the enveloping reference */ safeBuffer sb; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chPound); sb.sbXMLChCat(mp_prototypeKeyBinding->getId()); DSIGReference *ref = ret->createReference(sb.rawXMLChBuffer()); ref->appendCanonicalizationTransform(CANON_C14NE_COM); /* Embed the signature in the document inside a KeyBindingAuthentication element */ safeBuffer str; DOMDocument *doc = m_msg.mp_env->getParentDocument(); const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagProofOfPossession); DOMElement * t = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); m_msg.mp_env->doPrettyPrint(t); t->appendChild(elt); m_msg.mp_env->doPrettyPrint(t); // Now append into the RegisterRequest m_msg.mp_messageAbstractTypeElement->appendChild(t); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return ret; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueResultImpl.hpp000644 001751 001751 00000005230 12003301053 025321 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueResultImpl := Implementation of RegisterResult Messages * * $Id$ * */ #ifndef XKMSREISSUERESULTIMPL_INCLUDE #define XKMSREISSUERESULTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSKeyBindingImpl; class XKMSReissueResultImpl : public XKMSReissueResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSReissueResultImpl( const XSECEnv * env ); XKMSReissueResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSReissueResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankReissueResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getKeyBindingSize(void) const; virtual XKMSKeyBinding * getKeyBindingItem(int item) const; virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyBindingVectorType; #else typedef std::vector KeyBindingVectorType; #endif KeyBindingVectorType m_keyBindingList; // Unimplemented XKMSReissueResultImpl(void); XKMSReissueResultImpl(const XKMSReissueResultImpl &); XKMSReissueResultImpl & operator = (const XKMSReissueResultImpl &); }; #endif /* XKMSREISSUERESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueRequestImpl.hpp000644 001751 001751 00000006072 12003301053 025500 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueRequestImpl := Implementation for ReissueRequest Messages * * $Id$ * */ #ifndef XKMSREISSUEREQUESTIMPL_INCLUDE #define XKMSREISSUEREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSAuthenticationImpl; class XKMSReissueKeyBindingImpl; class DSIGSignature; class XKMSReissueRequestImpl : public XKMSReissueRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSReissueRequestImpl( const XSECEnv * env ); XKMSReissueRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSReissueRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankReissueRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSReissueKeyBinding * getReissueKeyBinding(void) const; virtual XKMSAuthentication * getAuthentication (void) const; virtual DSIGSignature * getProofOfPossessionSignature(void) const; /* Setter Interface Methods */ virtual XKMSReissueKeyBinding * addReissueKeyBinding(XKMSStatus::StatusValue status); virtual XKMSAuthentication * addAuthentication(void); virtual DSIGSignature * addProofOfPossessionSignature( canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XKMSAuthenticationImpl * mp_authentication; XKMSReissueKeyBindingImpl * mp_reissueKeyBinding; DSIGSignature * mp_proofOfPossessionSignature; XSECProvider m_prov; // For creating the signature // Unimplemented XKMSReissueRequestImpl(void); XKMSReissueRequestImpl(const XKMSReissueRequestImpl &); XKMSReissueRequestImpl & operator = (const XKMSReissueRequestImpl &); }; #endif /* XKMSREISSUEREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSStatusRequestImpl.cpp000644 001751 001751 00000011354 12003301053 025336 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSStatusRequestImpl := Implementation of StatusRequest Messages * * $Id: XKMSStatusRequestImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSStatusRequestImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSStatusRequestImpl::XKMSStatusRequestImpl( const XSECEnv * env) : m_request(env), m_msg(m_request.m_msg), mp_responseIdAttr(NULL) { } XKMSStatusRequestImpl::XKMSStatusRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_request(env, node), m_msg(m_request.m_msg), mp_responseIdAttr(NULL) { } XKMSStatusRequestImpl::~XKMSStatusRequestImpl() { } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSStatusRequestImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSStatusRequest::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagStatusRequest)) { throw XSECException(XSECException::XKMSError, "XKMSStatusRequest::load - called incorrect node"); } // Load the base message m_request.load(); // Now check for ResponseId attribute mp_responseIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseId); if (mp_responseIdAttr == NULL) { throw XSECException(XSECException::XKMSError, "XKMSStatusRequest::load - responseId not found!"); } } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSStatusRequestImpl::createBlankStatusRequest( const XMLCh * service, const XMLCh * id) { return m_request.createBlankRequestAbstractType( XKMSConstants::s_tagStatusRequest, service, id); // return XKMSRequestAbstractTypeImpl::createBlankMessageAbstractType( // MAKE_UNICODE_STRING("ValidateRequest"), service, id); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSStatusRequestImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::StatusRequest; } const XMLCh * XKMSStatusRequestImpl::getResponseId(void) const { if (mp_responseIdAttr == NULL) { // Attempt read when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSStatusRequest::getResponseId - called on non-initialised structure"); } return mp_responseIdAttr->getNodeValue(); } // -------------------------------------------------------------------------------- // Setter methods // -------------------------------------------------------------------------------- void XKMSStatusRequestImpl::setResponseId(const XMLCh * responseId) { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt update when not initialised throw XSECException(XSECException::MessageAbstractTypeError, "XKMSStatusRequest::setResponseId - called on non-initialised structure"); } m_msg.mp_messageAbstractTypeElement->setAttributeNS(NULL, XKMSConstants::s_tagResponseId, responseId); mp_responseIdAttr = m_msg.mp_messageAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagResponseId); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSReissueKeyBindingImpl.cpp000644 001751 001751 00000007434 12003301053 026071 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSReissueKeyBindingImpl := Implementation for ReissueKeyBinding * * $Id$ * */ // XSEC Includes #include #include #include #include #include #include "XKMSReissueKeyBindingImpl.hpp" #include "XKMSStatusImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSReissueKeyBindingImpl::XKMSReissueKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { mp_status = NULL; } XKMSReissueKeyBindingImpl::XKMSReissueKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { mp_status = NULL; } XKMSReissueKeyBindingImpl::~XKMSReissueKeyBindingImpl() { if (mp_status != NULL) delete mp_status; } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSReissueKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSReissueKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); /* Find the status element */ DOMNodeList * nl = mp_keyBindingAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagStatus); if (nl == NULL || nl->getLength() != 1) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSReissueKeyBinding::load - Status value not found"); } XSECnew(mp_status, XKMSStatusImpl(mp_env, (DOMElement*) nl->item(0))); mp_status->load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSReissueKeyBindingImpl::createBlankReissueKeyBinding(XKMSStatus::StatusValue status) { DOMElement * ret = XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagReissueKeyBinding); mp_env->doPrettyPrint(ret); // Create the status element XSECnew(mp_status, XKMSStatusImpl(mp_env)); ret->appendChild(mp_status->createBlankStatus(status)); mp_env->doPrettyPrint(ret); // Must have an Id XKMSKeyBindingAbstractTypeImpl::setId(); return ret; } // -------------------------------------------------------------------------------- // Status handling // -------------------------------------------------------------------------------- XKMSStatus * XKMSReissueKeyBindingImpl::getStatus(void) const { return mp_status; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSKeyBindingImpl.hpp000644 001751 001751 00000004002 12003301053 024522 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBindingImpl := Implementation for KeyBinding * * $Id: XKMSKeyBindingImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSKEYBINDINGIMPL_INCLUDE #define XKMSKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSStatusImpl; class XKMSKeyBindingImpl : public XKMSKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: XKMSKeyBindingImpl( const XSECEnv * env ); XKMSKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSKeyBindingImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankKeyBinding(XKMSStatus::StatusValue status); // Interface virtual XKMSStatus * getStatus(void) const; // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: XKMSStatusImpl * mp_status; // Unimplemented XKMSKeyBindingImpl(void); XKMSKeyBindingImpl(const XKMSKeyBindingImpl &); XKMSKeyBindingImpl & operator = (const XKMSKeyBindingImpl &); }; #endif /* XKMSKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSValidateRequestImpl.hpp000644 001751 001751 00000005046 12003301053 025612 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSValidateRequestImpl := Implementation of ValidateRequest Messages * * $Id: XKMSValidateRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSVALIDATEREQUESTIMPL_INCLUDE #define XKMSVALIDATEREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" #include "XKMSQueryKeyBindingImpl.hpp" class XKMSQueryKeyRequestImpl; class XKMSValidateRequestImpl : public XKMSValidateRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSValidateRequestImpl( const XSECEnv * env ); XKMSValidateRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSValidateRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankValidateRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSQueryKeyBinding * getQueryKeyBinding(void); /* Setter interface methods */ virtual XKMSQueryKeyBinding * addQueryKeyBinding(void); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_queryKeyBindingElement; XKMSQueryKeyBindingImpl * mp_queryKeyBinding; // Unimplemented XKMSValidateRequestImpl(const XKMSValidateRequestImpl &); XKMSValidateRequestImpl & operator = (const XKMSValidateRequestImpl &); }; #endif /* XKMSVALIDATEREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.hpp000644 001751 001751 00000016432 12003301053 027062 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSKeyBindingAbstractTypeImpl := Implementation of base for KeyBinding elements * * $Id: XKMSKeyBindingAbstractTypeImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSKEYBINDINGABSTRACTTYPEIMPL_INCLUDE #define XKMSKEYBINDINGABSTRACTTYPEIMPL_INCLUDE // XSEC Includes #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMNode); class XSECEnv; class DSIGKeyInfoList; class XKMSUseKeyWithImpl; class XKMSKeyBindingAbstractTypeImpl : public XKMSKeyBindingAbstractType { public: /* Constructors and Destructors */ XKMSKeyBindingAbstractTypeImpl( const XSECEnv * env ); XKMSKeyBindingAbstractTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSKeyBindingAbstractTypeImpl() ; // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankKeyBindingAbstractType(const XMLCh * tag); /* Getter Interface Methods */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const; virtual const XMLCh * getId(void) const; virtual DSIGKeyInfoList * getKeyInfoList(void) const; virtual bool getEncryptionKeyUsage(void) const; virtual bool getSignatureKeyUsage(void) const; virtual bool getExchangeKeyUsage(void) const; /* Setter interface methods */ virtual void setId(const XMLCh * id = NULL); virtual void setEncryptionKeyUsage(void); virtual void setSignatureKeyUsage(void); virtual void setExchangeKeyUsage(void); /* Key Info methods */ virtual DSIGKeyInfoList * getKeyInfoList(); virtual void clearKeyInfo(void); virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y); virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent); virtual DSIGKeyInfoX509 * appendX509Data(void); virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false); virtual DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet); virtual DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp); virtual DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data); /* UseKeyWith handling */ virtual int getUseKeyWithSize(void) const; virtual XKMSUseKeyWith * getUseKeyWithItem(int item) const; virtual XKMSUseKeyWith * appendUseKeyWithItem( const XMLCh * application, const XMLCh * identifier); protected: XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyBindingAbstractTypeElement; const XSECEnv * mp_env; private: XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * setKeyUsage(const XMLCh * usage); #if defined(XSEC_NO_NAMESPACES) typedef vector UseKeyWithVectorType; #else typedef std::vector UseKeyWithVectorType; #endif UseKeyWithVectorType m_useKeyWithList; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_idAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyUsageSignatureElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyUsageEncryptionElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyUsageExchangeElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyInfoElement; DSIGKeyInfoList * mp_keyInfoList; void createKeyInfoElement(void); // Unimplemented XKMSKeyBindingAbstractTypeImpl(void); XKMSKeyBindingAbstractTypeImpl(const XKMSKeyBindingAbstractTypeImpl &); XKMSKeyBindingAbstractTypeImpl & operator = (const XKMSKeyBindingAbstractTypeImpl &); }; // Define imported methods for classes that inherit them (makes things easier) #define XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS \ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getElement();} \ virtual const XMLCh * getId(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getId();} \ virtual DSIGKeyInfoList * getKeyInfoList(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getKeyInfoList();} \ virtual bool getEncryptionKeyUsage(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getEncryptionKeyUsage();} \ virtual bool getSignatureKeyUsage(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getSignatureKeyUsage();} \ virtual bool getExchangeKeyUsage(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getExchangeKeyUsage();} \ virtual void setId(const XMLCh * id) \ {XKMSKeyBindingAbstractTypeImpl::setId(id);} \ virtual void setEncryptionKeyUsage(void) \ {XKMSKeyBindingAbstractTypeImpl::setEncryptionKeyUsage();} \ virtual void setSignatureKeyUsage(void) \ {XKMSKeyBindingAbstractTypeImpl::setSignatureKeyUsage();} \ virtual void setExchangeKeyUsage(void) \ {XKMSKeyBindingAbstractTypeImpl::setExchangeKeyUsage();} \ virtual DSIGKeyInfoList * getKeyInfoList() \ {return XKMSKeyBindingAbstractTypeImpl::getKeyInfoList();} \ virtual void clearKeyInfo(void) \ {XKMSKeyBindingAbstractTypeImpl::clearKeyInfo();} \ virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, \ const XMLCh * Q, \ const XMLCh * G, \ const XMLCh * Y) \ {return XKMSKeyBindingAbstractTypeImpl::appendDSAKeyValue(P,Q,G,Y);} \ virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, \ const XMLCh * exponent) \ {return XKMSKeyBindingAbstractTypeImpl::appendRSAKeyValue(modulus,exponent);} \ virtual DSIGKeyInfoX509 * appendX509Data(void) \ {return XKMSKeyBindingAbstractTypeImpl::appendX509Data();} \ virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) \ {return XKMSKeyBindingAbstractTypeImpl::appendKeyName(name,isDName);} \ virtual DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet) \ {return XKMSKeyBindingAbstractTypeImpl::appendPGPData(id,packet);} \ virtual DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp) \ {return XKMSKeyBindingAbstractTypeImpl::appendSPKIData(sexp);} \ virtual DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data) \ {return XKMSKeyBindingAbstractTypeImpl::appendMgmtData(data);} \ virtual int getUseKeyWithSize(void) const \ {return XKMSKeyBindingAbstractTypeImpl::getUseKeyWithSize();} \ virtual XKMSUseKeyWith * getUseKeyWithItem(int item) const \ {return XKMSKeyBindingAbstractTypeImpl::getUseKeyWithItem(item);} \ virtual XKMSUseKeyWith * appendUseKeyWithItem( \ const XMLCh * application, \ const XMLCh * identifier) \ {return XKMSKeyBindingAbstractTypeImpl::appendUseKeyWithItem(application, identifier);} #endif /* XKMSKEYBINDINGABSTRACTTYPEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSResultTypeImpl.hpp000644 001751 001751 00000007306 12003301053 024631 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResultTypeImpl := Implementation of base schema of XKMS Request messages * * $Id: XKMSResultTypeImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSRESULTTYPEIMPL_INCLUDE #define XKMSRESULTTYPEIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSMessageAbstractTypeImpl.hpp" XSEC_DECLARE_XERCES_CLASS(DOMElement); XSEC_DECLARE_XERCES_CLASS(DOMAttr); class XKMSResultTypeImpl : public XKMSResultType { public: XKMSMessageAbstractTypeImpl m_msg; public: XKMSResultTypeImpl(const XSECEnv * env); XKMSResultTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node); virtual ~XKMSResultTypeImpl(); // load void load(void); XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankResultType( const XMLCh * tag, const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); /* Note yet implemented from MessageAbstractType */ virtual messageType getMessageType(void) {return XKMSMessageAbstractType::None;} // Getter interface virtual ResultMajor getResultMajor(void) const; virtual ResultMinor getResultMinor(void) const; virtual const XMLCh * getRequestId(void) const; virtual const XMLCh * getRequestSignatureValue(void) const; // Setter interface virtual void setResultMajor(ResultMajor r); virtual void setResultMinor(ResultMinor r); virtual void setRequestId(const XMLCh * id); virtual void setRequestSignatureValue(const XMLCh * value); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_resultMajorAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_resultMinorAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_requestIdAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_requestSignatureValueElement; XKMSResultType::ResultMajor m_resultMajor; XKMSResultType::ResultMinor m_resultMinor; // Unimplemented XKMSResultTypeImpl(); XKMSResultTypeImpl(const XKMSResultTypeImpl &); XKMSResultTypeImpl & operator = (const XKMSResultTypeImpl &); }; #define XKMS_RESULTTYPE_IMPL_METHODS \ virtual ResultMajor getResultMajor(void) const \ {return m_result.getResultMajor();} \ virtual ResultMinor getResultMinor(void) const \ {return m_result.getResultMinor();} \ virtual const XMLCh * getRequestId(void) const \ {return m_result.getRequestId();} \ virtual const XMLCh * getRequestSignatureValue(void) const \ {return m_result.getRequestSignatureValue();} \ virtual void setResultMajor(ResultMajor r) \ {m_result.setResultMajor(r);} \ virtual void setResultMinor(ResultMinor r) \ {m_result.setResultMinor(r);} \ virtual void setRequestId(const XMLCh * id) \ {m_result.setRequestId(id);} \ virtual void setRequestSignatureValue(const XMLCh * value) \ {m_result.setRequestSignatureValue(value);} #endif /* XKMSRESULTTYPEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSMessageFactoryImpl.cpp000644 001751 001751 00000075347 12003301053 025432 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageFactoryImpl := Implementation of the XKMSMessageFactory class * * $Id: XKMSMessageFactoryImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include "XKMSCompoundRequestImpl.hpp" #include "XKMSCompoundResultImpl.hpp" #include "XKMSMessageFactoryImpl.hpp" #include "XKMSLocateRequestImpl.hpp" #include "XKMSLocateResultImpl.hpp" #include "XKMSStatusRequestImpl.hpp" #include "XKMSStatusResultImpl.hpp" #include "XKMSResultImpl.hpp" #include "XKMSValidateRequestImpl.hpp" #include "XKMSValidateResultImpl.hpp" #include "XKMSPendingRequestImpl.hpp" #include "XKMSRegisterRequestImpl.hpp" #include "XKMSRegisterResultImpl.hpp" #include "XKMSRevokeResultImpl.hpp" #include "XKMSRevokeRequestImpl.hpp" #include "XKMSRecoverResultImpl.hpp" #include "XKMSRecoverRequestImpl.hpp" #include "XKMSReissueResultImpl.hpp" #include "XKMSReissueRequestImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSMessageFactoryImpl::XKMSMessageFactoryImpl(void) { // Factory isn't tied to a particular document XSECnew(mp_env, XSECEnv(NULL)); mp_env->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); }; XKMSMessageFactoryImpl::~XKMSMessageFactoryImpl(void) { delete mp_env; }; // -------------------------------------------------------------------------------- // Internal methods // -------------------------------------------------------------------------------- void XKMSMessageFactoryImpl::copyRequestToResult(XKMSRequestAbstractType * req, XKMSResultType * res) { /* Set the requestId */ res->setRequestId(req->getId()); /* Copy any Opaque Data */ int i; int sz = req->getOpaqueClientDataSize(); for (i = 0; i < sz; ++i) { res->appendOpaqueClientDataItem(req->getOpaqueClientDataItemStr(i)); } /* Set RequestSignatureValue data if necessary */ sz = req->getResponseMechanismSize(); for (i = 0; i < sz; ++i) { if (strEquals(req->getResponseMechanismItemStr(i), XKMSConstants::s_tagRequestSignatureValue)) { DSIGSignature *s = req->getSignature(); if (s != NULL && res->getResultMinor() != XKMSResultType::NoAuthentication) { res->setRequestSignatureValue(s->getSignatureValue()); } break; } } } // -------------------------------------------------------------------------------- // Set/get the namespace prefix to be used when creating nodes // -------------------------------------------------------------------------------- void XKMSMessageFactoryImpl::setDSIGNSPrefix(const XMLCh * prefix) { mp_env->setDSIGNSPrefix(prefix); } void XKMSMessageFactoryImpl::setECNSPrefix(const XMLCh * prefix) { mp_env->setECNSPrefix(prefix); } void XKMSMessageFactoryImpl::setXPFNSPrefix(const XMLCh * prefix) { mp_env->setXPFNSPrefix(prefix); } void XKMSMessageFactoryImpl::setXENCNSPrefix(const XMLCh * prefix) { mp_env->setXENCNSPrefix(prefix); } void XKMSMessageFactoryImpl::setXKMSNSPrefix(const XMLCh * prefix) { mp_env->setXKMSNSPrefix(prefix); } // -------------------------------------------------------------------------------- // DOM Based construction // -------------------------------------------------------------------------------- XKMSMessageAbstractType * XKMSMessageFactoryImpl::newMessageFromDOM( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * elt) { XSECEnv * env; XSECnew(env, XSECEnv(*mp_env)); env->setParentDocument(elt->getOwnerDocument()); if (elt == NULL) { throw XSECException(XSECException::XKMSError, "XKMSMessageFactory::newMessageFromDOM - called on empty DOM"); } // See if this is a known element const XMLCh * name = getXKMSLocalName(elt); if (strEquals(name, XKMSConstants::s_tagCompoundRequest)) { // This is a message XKMSCompoundRequestImpl * ret; XSECnew(ret, XKMSCompoundRequestImpl(env, elt)); ret->load(); return (XKMSCompoundRequest*) ret; } if (strEquals(name, XKMSConstants::s_tagCompoundResult)) { // This is a message XKMSCompoundResultImpl * ret; XSECnew(ret, XKMSCompoundResultImpl(env, elt)); ret->load(); return (XKMSCompoundRequest*) ret; } if (strEquals(name, XKMSConstants::s_tagLocateRequest)) { // This is a message XKMSLocateRequestImpl * ret; XSECnew(ret, XKMSLocateRequestImpl(env, elt)); ret->load(); return (XKMSLocateRequest *) ret; } if (strEquals(name, XKMSConstants::s_tagValidateRequest)) { // This is a message XKMSValidateRequestImpl * ret; XSECnew(ret, XKMSValidateRequestImpl(env, elt)); ret->load(); return (XKMSValidateRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagLocateResult)) { // This is a message XKMSLocateResultImpl * ret; XSECnew(ret, XKMSLocateResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSLocateResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagValidateResult)) { // This is a message XKMSValidateResultImpl * ret; XSECnew(ret, XKMSValidateResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSValidateResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagResult)) { // This is a message XKMSResultImpl * ret; XSECnew(ret, XKMSResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagPendingRequest)) { // This is a message XKMSPendingRequestImpl * ret; XSECnew(ret, XKMSPendingRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSPendingRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagStatusRequest)) { // This is a message XKMSStatusRequestImpl * ret; XSECnew(ret, XKMSStatusRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSStatusRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagStatusResult)) { // This is a message XKMSStatusResultImpl * ret; XSECnew(ret, XKMSStatusResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSStatusResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagRegisterRequest)) { // This is a message XKMSRegisterRequestImpl * ret; XSECnew(ret, XKMSRegisterRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRegisterRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagRegisterResult)) { // This is a message XKMSRegisterResultImpl * ret; XSECnew(ret, XKMSRegisterResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRegisterResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagRevokeRequest)) { // This is a message XKMSRevokeRequestImpl * ret; XSECnew(ret, XKMSRevokeRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRevokeRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagRevokeResult)) { // This is a message XKMSRevokeResultImpl * ret; XSECnew(ret, XKMSRevokeResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRevokeResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagRecoverRequest)) { // This is a message XKMSRecoverRequestImpl * ret; XSECnew(ret, XKMSRecoverRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRecoverRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagRecoverResult)) { // This is a message XKMSRecoverResultImpl * ret; XSECnew(ret, XKMSRecoverResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSRecoverResult *) ret; } else if (strEquals(name, XKMSConstants::s_tagReissueRequest)) { // This is a message XKMSReissueRequestImpl * ret; XSECnew(ret, XKMSReissueRequestImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSReissueRequest *) ret; } else if (strEquals(name, XKMSConstants::s_tagReissueResult)) { // This is a message XKMSReissueResultImpl * ret; XSECnew(ret, XKMSReissueResultImpl(env, elt)); Janitor j_ret(ret); ret->load(); j_ret.release(); return (XKMSReissueResult *) ret; } delete env; return NULL; } // -------------------------------------------------------------------------------- // Construction from scratch // -------------------------------------------------------------------------------- XKMSCompoundRequest * XKMSMessageFactoryImpl::createCompoundRequest( const XMLCh * service, DOMDocument * doc, const XMLCh * id) { XKMSCompoundRequestImpl * cri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(cri, XKMSCompoundRequestImpl(tenv)); cri->createBlankCompoundRequest(service, id); return cri; } XKMSCompoundRequest * XKMSMessageFactoryImpl::createCompoundRequest( const XMLCh * service, DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSCompoundRequest * cri = createCompoundRequest(service, *doc, id); (*doc)->appendChild(cri->getElement()); return cri; } XKMSLocateRequest * XKMSMessageFactoryImpl::createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSLocateRequestImpl * lri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(lri, XKMSLocateRequestImpl(tenv)); lri->createBlankLocateRequest(service, id); return lri; } XKMSLocateRequest * XKMSMessageFactoryImpl::createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSLocateRequest * lri = createLocateRequest(service, *doc, id); (*doc)->appendChild(lri->getElement()); return lri; } XKMSValidateRequest * XKMSMessageFactoryImpl::createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSValidateRequestImpl * vri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(vri, XKMSValidateRequestImpl(tenv)); vri->createBlankValidateRequest(service, id); return vri; } XKMSValidateRequest * XKMSMessageFactoryImpl::createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSValidateRequest * vri = createValidateRequest(service, *doc, id); (*doc)->appendChild(vri->getElement()); return vri; } XKMSPendingRequest * XKMSMessageFactoryImpl::createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSPendingRequestImpl * pri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(pri, XKMSPendingRequestImpl(tenv)); pri->createBlankPendingRequest(service, id); return pri; } XKMSPendingRequest * XKMSMessageFactoryImpl::createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSPendingRequest * pri = createPendingRequest(service, *doc, id); (*doc)->appendChild(pri->getElement()); return pri; } XKMSStatusRequest * XKMSMessageFactoryImpl::createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSStatusRequestImpl* sri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(sri, XKMSStatusRequestImpl(tenv)); sri->createBlankStatusRequest(service, id); return sri; } XKMSStatusRequest * XKMSMessageFactoryImpl::createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSStatusRequest * sri = createStatusRequest(service, *doc, id); (*doc)->appendChild(sri->getElement()); return sri; } XKMSRegisterRequest * XKMSMessageFactoryImpl::createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSRegisterRequestImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRegisterRequestImpl(tenv)); rri->createBlankRegisterRequest(service, id); return rri; } XKMSRegisterRequest * XKMSMessageFactoryImpl::createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRegisterRequest * rri = createRegisterRequest(service, *doc, id); (*doc)->appendChild(rri->getElement()); return rri; } XKMSRevokeRequest * XKMSMessageFactoryImpl::createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSRevokeRequestImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRevokeRequestImpl(tenv)); rri->createBlankRevokeRequest(service, id); return rri; } XKMSRevokeRequest * XKMSMessageFactoryImpl::createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRevokeRequest * rri = createRevokeRequest(service, *doc, id); (*doc)->appendChild(rri->getElement()); return rri; } XKMSRecoverRequest * XKMSMessageFactoryImpl::createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSRecoverRequestImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRecoverRequestImpl(tenv)); rri->createBlankRecoverRequest(service, id); return rri; } XKMSRecoverRequest * XKMSMessageFactoryImpl::createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRecoverRequest * rri = createRecoverRequest(service, *doc, id); (*doc)->appendChild(rri->getElement()); return rri; } XKMSReissueRequest * XKMSMessageFactoryImpl::createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id) { XKMSReissueRequestImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSReissueRequestImpl(tenv)); rri->createBlankReissueRequest(service, id); return rri; } XKMSReissueRequest * XKMSMessageFactoryImpl::createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSReissueRequest * rri = createReissueRequest(service, *doc, id); (*doc)->appendChild(rri->getElement()); return rri; } // -------------------------------------------------------------------------------- // Create a result based on a request // -------------------------------------------------------------------------------- XKMSLocateResult * XKMSMessageFactoryImpl::createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSLocateResultImpl * lri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(lri, XKMSLocateResultImpl(tenv)); lri->createBlankLocateResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) lri); return lri; } XKMSLocateResult * XKMSMessageFactoryImpl::createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSLocateResult * lr = createLocateResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(lr->getElement()); return lr; } XKMSStatusResult * XKMSMessageFactoryImpl::createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSStatusResultImpl * sri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(sri, XKMSStatusResultImpl(tenv)); sri->createBlankStatusResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) sri); return sri; } XKMSStatusResult * XKMSMessageFactoryImpl::createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSStatusResult * sr = createStatusResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(sr->getElement()); return sr; } XKMSResult * XKMSMessageFactoryImpl::createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSResultImpl * ri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(ri, XKMSResultImpl(tenv)); ri->createBlankResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) ri); return ri; } XKMSResult * XKMSMessageFactoryImpl::createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSResult * r = createResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(r->getElement()); return r; } XKMSValidateResult * XKMSMessageFactoryImpl::createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSValidateResultImpl * vri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(vri, XKMSValidateResultImpl(tenv)); vri->createBlankValidateResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) vri); return vri; } XKMSValidateResult * XKMSMessageFactoryImpl::createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSValidateResult * vr = createValidateResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(vr->getElement()); return vr; } XKMSCompoundResult * XKMSMessageFactoryImpl::createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSCompoundResultImpl * cri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(cri, XKMSCompoundResultImpl(tenv)); cri->createBlankCompoundResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) cri); return cri; } XKMSCompoundResult * XKMSMessageFactoryImpl::createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSCompoundResult * cr = createCompoundResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(cr->getElement()); return cr; } XKMSRegisterResult * XKMSMessageFactoryImpl::createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSRegisterResultImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRegisterResultImpl(tenv)); rri->createBlankRegisterResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) rri); return rri; } XKMSRegisterResult * XKMSMessageFactoryImpl::createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRegisterResult * rr = createRegisterResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(rr->getElement()); return rr; } XKMSRevokeResult * XKMSMessageFactoryImpl::createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSRevokeResultImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRevokeResultImpl(tenv)); rri->createBlankRevokeResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) rri); return rri; } XKMSRevokeResult * XKMSMessageFactoryImpl::createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRevokeResult * rr = createRevokeResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(rr->getElement()); return rr; } XKMSReissueResult * XKMSMessageFactoryImpl::createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSReissueResultImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSReissueResultImpl(tenv)); rri->createBlankReissueResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) rri); return rri; } XKMSReissueResult * XKMSMessageFactoryImpl::createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSReissueResult * rr = createReissueResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(rr->getElement()); return rr; } XKMSRecoverResult * XKMSMessageFactoryImpl::createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { XKMSRecoverResultImpl * rri; XSECEnv * tenv; XSECnew(tenv, XSECEnv(*mp_env)); tenv->setParentDocument(doc); XSECnew(rri, XKMSRecoverResultImpl(tenv)); rri->createBlankRecoverResult(request->getService(), id, rmaj, rmin); copyRequestToResult(request, (XKMSResultTypeImpl*) rri); return rri; } XKMSRecoverResult * XKMSMessageFactoryImpl::createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin, const XMLCh * id) { // Create a document to put the element in XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); *doc = impl->createDocument(); // Embed the new structure in the document XKMSRecoverResult * rr = createRecoverResult(request, *doc, rmaj, rmin, id); (*doc)->appendChild(rr->getElement()); return rr; } // -------------------------------------------------------------------------------- // Message Conversions // -------------------------------------------------------------------------------- XKMSRequestAbstractType * XKMSMessageFactoryImpl::toRequestAbstractType(XKMSMessageAbstractType *msg) { switch (msg->getMessageType()) { case XKMSMessageAbstractType::LocateRequest : case XKMSMessageAbstractType::ValidateRequest : case XKMSMessageAbstractType::CompoundRequest : case XKMSMessageAbstractType::PendingRequest : case XKMSMessageAbstractType::RegisterRequest : case XKMSMessageAbstractType::RevokeRequest : case XKMSMessageAbstractType::RecoverRequest : case XKMSMessageAbstractType::ReissueRequest : case XKMSMessageAbstractType::StatusRequest : return (XKMSRequestAbstractType *) msg; default: return NULL; } return NULL; } XKMSResultType * XKMSMessageFactoryImpl::toResultType(XKMSMessageAbstractType *msg) { switch (msg->getMessageType()) { case XKMSMessageAbstractType::LocateResult : case XKMSMessageAbstractType::ValidateResult : case XKMSMessageAbstractType::CompoundResult : case XKMSMessageAbstractType::RegisterResult : case XKMSMessageAbstractType::RevokeResult : case XKMSMessageAbstractType::RecoverResult : case XKMSMessageAbstractType::ReissueResult : case XKMSMessageAbstractType::StatusResult : case XKMSMessageAbstractType::Result : return (XKMSResultType *) msg; default: return NULL; } return NULL; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRevokeRequestImpl.hpp000644 001751 001751 00000005673 12003301053 025322 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRevokeRequestImpl := Implementation for RevokeRequest Messages * * $Id:$ * */ #ifndef XKMSREVOKEREQUESTIMPL_INCLUDE #define XKMSREVOKEREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" class XKMSAuthenticationImpl; class DSIGSignature; class XKMSRevokeKeyBindingImpl; class XKMSRevokeRequestImpl : public XKMSRevokeRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRevokeRequestImpl( const XSECEnv * env ); XKMSRevokeRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRevokeRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRevokeRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSRevokeKeyBinding * getRevokeKeyBinding(void) const; virtual XKMSAuthentication * getAuthentication (void) const; virtual const XMLCh * getRevocationCode(void) const; /* Setter Interface Methods */ virtual XKMSRevokeKeyBinding * addRevokeKeyBinding(XKMSStatus::StatusValue status); virtual XKMSAuthentication * addAuthentication(void); virtual void addRevocationCode(const XMLCh * code); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XKMSAuthenticationImpl * mp_authentication; XKMSRevokeKeyBindingImpl * mp_revokeKeyBinding; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_revocationCodeElement; XSECProvider m_prov; // For creating the signature // Unimplemented XKMSRevokeRequestImpl(void); XKMSRevokeRequestImpl(const XKMSRevokeRequestImpl &); XKMSRevokeRequestImpl & operator = (const XKMSRevokeRequestImpl &); }; #endif /* XKMSREVOKEREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSResponseMechanismImpl.cpp000644 001751 001751 00000011730 12003301053 026123 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSResponseMechanismImpl := Implementation of XKMSResponseMechanism * * $Id: XKMSResponseMechanismImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSResponseMechanismImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSResponseMechanismImpl::XKMSResponseMechanismImpl(const XSECEnv * env) : mp_env(env), mp_responseMechanismTextNode(NULL) {} XKMSResponseMechanismImpl::XKMSResponseMechanismImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : mp_env(env), mp_responseMechanismElement(node), mp_responseMechanismTextNode(NULL) { } XKMSResponseMechanismImpl::~XKMSResponseMechanismImpl() {} // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSResponseMechanismImpl::load(void) { if (mp_responseMechanismElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSResponseMechanism::load - called on empty DOM"); } mp_responseMechanismTextNode = findFirstChildOfType(mp_responseMechanismElement, DOMNode::TEXT_NODE); if (mp_responseMechanismTextNode == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSResponseMechanism::load - Expected TEXT node beneath element"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSResponseMechanismImpl::createBlankResponseMechanism(const XMLCh * item) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagResponseMechanism); mp_responseMechanismElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); // Create the ResponseMechanism item str.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); str.sbXMLChCat(item); mp_responseMechanismTextNode = doc->createTextNode(str.rawXMLChBuffer()); mp_responseMechanismElement->appendChild(mp_responseMechanismTextNode); return mp_responseMechanismElement; } // -------------------------------------------------------------------------------- // Get interface // -------------------------------------------------------------------------------- const XMLCh * XKMSResponseMechanismImpl::getResponseMechanismString(void) const { if (mp_responseMechanismTextNode == NULL) { throw XSECException(XSECException::XKMSError, "XKMSResponseMechanism::getResponseMechanismString - Attempt to get prior to initialisation"); } const XMLCh * r = mp_responseMechanismTextNode->getNodeValue(); int index = XMLString::indexOf(r, chPound); if (index == -1 || XMLString::compareNString(r, XKMSConstants::s_unicodeStrURIXKMS, index)) { throw XSECException(XSECException::XKMSError, "XKMSResponseMechanism::getResponseMechanismString - Item not in XKMS Name Space"); } return &r[index+1]; } // -------------------------------------------------------------------------------- // Set interface // -------------------------------------------------------------------------------- void XKMSResponseMechanismImpl::setResponseMechanismString(const XMLCh * str) { if (mp_responseMechanismTextNode == NULL) { throw XSECException(XSECException::XKMSError, "XKMSResponseMechanism::setResponseMechanismString - Attempt to set prior to initialisation"); } safeBuffer sb; sb.sbXMLChIn(XKMSConstants::s_unicodeStrURIXKMS); sb.sbXMLChCat(str); mp_responseMechanismTextNode->setNodeValue(sb.rawXMLChBuffer()); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSNotBoundAuthentication.cpp000644 001751 001751 00000013145 12003301053 026310 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSNotBoundAuthenticationImpl := Implementation for NotBoundAuthentication elements * * $Id: XKMSNotBoundAuthentication.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSNotBoundAuthenticationImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSNotBoundAuthenticationImpl::XKMSNotBoundAuthenticationImpl(const XSECEnv * env) : mp_env(env), mp_notBoundAuthenticationElement(NULL), mp_protocolAttr(NULL), mp_valueAttr(NULL) { } XKMSNotBoundAuthenticationImpl::XKMSNotBoundAuthenticationImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_notBoundAuthenticationElement(node), mp_protocolAttr(NULL), mp_valueAttr(NULL) { } XKMSNotBoundAuthenticationImpl::~XKMSNotBoundAuthenticationImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSNotBoundAuthenticationImpl::load(void) { if (mp_notBoundAuthenticationElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSNotBoundAuthenticationImpl::load - called on empty DOM"); } mp_protocolAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagProtocol); mp_valueAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagValue); // Protocol and Value *must* be set if (mp_protocolAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSNotBoundAuthentication::load - Protocol attribute not found"); } if (mp_valueAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSNotBoundAuthentication::load - Value attribute not found"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSNotBoundAuthenticationImpl::createBlankNotBoundAuthentication( const XMLCh * protocol, const XMLCh * value) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagNotBoundAuthentication); mp_notBoundAuthenticationElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); // Set URI and value mp_notBoundAuthenticationElement->setAttributeNS(NULL, XKMSConstants::s_tagProtocol, protocol); mp_notBoundAuthenticationElement->setAttributeNS(NULL, XKMSConstants::s_tagValue, value); mp_env->doPrettyPrint(mp_notBoundAuthenticationElement); mp_protocolAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagProtocol); mp_valueAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagValue); return mp_notBoundAuthenticationElement; } // -------------------------------------------------------------------------------- // Get interfaces // -------------------------------------------------------------------------------- const XMLCh * XKMSNotBoundAuthenticationImpl::getProtocol(void) const { if (mp_protocolAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSNotBoundAuthenticationImpl::getProtocol- called on empty DOM"); } return mp_protocolAttr->getNodeValue(); } const XMLCh * XKMSNotBoundAuthenticationImpl::getValue(void) const { if (mp_valueAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSNotBoundAuthenticationImpl::getValue- called on empty DOM"); } return mp_valueAttr->getNodeValue(); } // -------------------------------------------------------------------------------- // Set Interfaces // -------------------------------------------------------------------------------- void XKMSNotBoundAuthenticationImpl::setProtocol(const XMLCh * uri) { mp_notBoundAuthenticationElement->setAttributeNS(NULL, XKMSConstants::s_tagProtocol, uri); mp_protocolAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagProtocol); } void XKMSNotBoundAuthenticationImpl::setValue(const XMLCh * value) { mp_notBoundAuthenticationElement->setAttributeNS(NULL, XKMSConstants::s_tagValue, value); mp_valueAttr = mp_notBoundAuthenticationElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagValue); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSUseKeyWithImpl.cpp000644 001751 001751 00000013215 12003301053 024541 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSUseKeyWithImpl := Implementation of UseKeyWith Messages * * $Id: XKMSUseKeyWithImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include "XKMSUseKeyWithImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSUseKeyWithImpl::XKMSUseKeyWithImpl(const XSECEnv * env) { mp_env = env; mp_useKeyWithElement = NULL; mp_identifierAttr = NULL; mp_applicationAttr = NULL; } XKMSUseKeyWithImpl::XKMSUseKeyWithImpl(const XSECEnv * env, DOMElement * node) { mp_env = env; mp_useKeyWithElement = node; mp_identifierAttr = NULL; mp_applicationAttr = NULL; } XKMSUseKeyWithImpl::~XKMSUseKeyWithImpl(){ } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XKMSUseKeyWithImpl::load(void) { if (mp_useKeyWithElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(mp_useKeyWithElement), XKMSConstants::s_tagUseKeyWith)) { throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::load - called incorrect node"); } // Identifier mp_identifierAttr = mp_useKeyWithElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagIdentifier); // Application mp_applicationAttr = mp_useKeyWithElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagApplication); // Identifier and Application MUST be set for a message to be OK if (mp_identifierAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSUseKeyWith::load - Identifier attribute not found"); } if (mp_applicationAttr == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSUseKeyWith::load - Application attribute not found"); } } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSUseKeyWithImpl::createBlankUseKeyWith(const XMLCh * application, const XMLCh * identifier) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXKMSNSPrefix(); makeQName(str, prefix, XKMSConstants::s_tagUseKeyWith); mp_useKeyWithElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS, str.rawXMLChBuffer()); // Setup the Application URI mp_useKeyWithElement->setAttributeNS(NULL, XKMSConstants::s_tagApplication, application); mp_applicationAttr = mp_useKeyWithElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagApplication); // Identifier mp_useKeyWithElement->setAttributeNS(NULL, XKMSConstants::s_tagIdentifier, identifier); mp_identifierAttr = mp_useKeyWithElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagIdentifier); return mp_useKeyWithElement; } // -------------------------------------------------------------------------------- // Get methods // -------------------------------------------------------------------------------- DOMElement * XKMSUseKeyWithImpl::getElement(void) const { return mp_useKeyWithElement; } const XMLCh * XKMSUseKeyWithImpl::getApplication(void) const { if (mp_applicationAttr == NULL) { throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::getApplication - called on non-loaded construct"); } return mp_applicationAttr->getNodeValue(); } const XMLCh * XKMSUseKeyWithImpl::getIdentifier(void) const { if (mp_identifierAttr == NULL) { throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::getIdentifier - called on non-loaded construct"); } return mp_identifierAttr->getNodeValue(); } // -------------------------------------------------------------------------------- // Set methods // -------------------------------------------------------------------------------- void XKMSUseKeyWithImpl::setApplication(const XMLCh * uri) { if (mp_applicationAttr == NULL) { throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::setApplication - called on non-loaded construct"); } mp_applicationAttr->setNodeValue(uri); } void XKMSUseKeyWithImpl::setIdentifier(const XMLCh * identifier) { if (mp_identifierAttr == NULL) { throw XSECException(XSECException::XKMSError, "XKMSUseKeyWith::setIdentifier - called on non-loaded construct"); } mp_identifierAttr->setNodeValue(identifier); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSLocateRequestImpl.hpp000644 001751 001751 00000005004 12003301053 025262 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateRequestImpl := Implementation of LocateRequest Messages * * $Id: XKMSLocateRequestImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSLOCATEREQUESTIMPL_INCLUDE #define XKMSLOCATEREQUESTIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSRequestAbstractTypeImpl.hpp" #include "XKMSQueryKeyBindingImpl.hpp" class XKMSQueryKeyRequestImpl; class XKMSLocateRequestImpl : public XKMSLocateRequest { public: XKMSRequestAbstractTypeImpl m_request; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSLocateRequestImpl( const XSECEnv * env ); XKMSLocateRequestImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSLocateRequestImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankLocateRequest( const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual XKMSQueryKeyBinding * getQueryKeyBinding(void); /* Setter interface methods */ virtual XKMSQueryKeyBinding * addQueryKeyBinding(void); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from RequestAbstractType */ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS private: XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_queryKeyBindingElement; XKMSQueryKeyBindingImpl * mp_queryKeyBinding; // Unimplemented XKMSLocateRequestImpl(const XKMSLocateRequestImpl &); XKMSLocateRequestImpl & operator = (const XKMSLocateRequestImpl &); }; #endif /* XKMSLOCATEREQUESTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSLocateResultImpl.cpp000644 001751 001751 00000012022 12003301053 025101 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSLocateResultImpl := Implementation of LocateResult Messages * * $Id: XKMSLocateResultImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "XKMSLocateResultImpl.hpp" #include "XKMSUnverifiedKeyBindingImpl.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSLocateResultImpl::XKMSLocateResultImpl( const XSECEnv * env) : m_result(env), m_msg(m_result.m_msg) { } XKMSLocateResultImpl::XKMSLocateResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) : m_result(env, node), m_msg(m_result.m_msg) { } XKMSLocateResultImpl::~XKMSLocateResultImpl() { XKMSLocateResultImpl::UnverifiedKeyBindingVectorType::iterator i; for (i = m_unverifiedKeyBindingList.begin() ; i != m_unverifiedKeyBindingList.end(); ++i) { delete (*i); } } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- // Load elements void XKMSLocateResultImpl::load() { if (m_msg.mp_messageAbstractTypeElement == NULL) { // Attempt to load an empty element throw XSECException(XSECException::XKMSError, "XKMSLocateResult::load - called on empty DOM"); } if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement), XKMSConstants::s_tagLocateResult)) { throw XSECException(XSECException::XKMSError, "XKMSLocateResult::load - called incorrect node"); } // Get any UnverifiedKeyBinding elements DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS( XKMSConstants::s_unicodeStrURIXKMS, XKMSConstants::s_tagUnverifiedKeyBinding); if (nl != NULL) { XKMSUnverifiedKeyBindingImpl * ukb; for (unsigned int i = 0; i < nl->getLength() ; ++ i) { XSECnew(ukb, XKMSUnverifiedKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i))); m_unverifiedKeyBindingList.push_back(ukb); ukb->load(); } } // Load the base message m_result.load(); } // -------------------------------------------------------------------------------- // Create a blank one // -------------------------------------------------------------------------------- DOMElement * XKMSLocateResultImpl::createBlankLocateResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin) { return m_result.createBlankResultType( XKMSConstants::s_tagLocateResult, service, id, rmaj, rmin); } // -------------------------------------------------------------------------------- // Get interface methods // -------------------------------------------------------------------------------- XKMSMessageAbstractType::messageType XKMSLocateResultImpl::getMessageType(void) { return XKMSMessageAbstractTypeImpl::LocateResult; } // -------------------------------------------------------------------------------- // UnverifiedKeyBinding handling // -------------------------------------------------------------------------------- int XKMSLocateResultImpl::getUnverifiedKeyBindingSize(void) const { return (int) m_unverifiedKeyBindingList.size(); } XKMSUnverifiedKeyBinding * XKMSLocateResultImpl::getUnverifiedKeyBindingItem(int item) const { if (item < 0 || item >= (int) m_unverifiedKeyBindingList.size()) { throw XSECException(XSECException::XKMSError, "XKMSLocateResult::getUnverifiedKeyBindingItem - item out of range"); } return m_unverifiedKeyBindingList[item]; } XKMSUnverifiedKeyBinding * XKMSLocateResultImpl::appendUnverifiedKeyBindingItem(void) { XKMSUnverifiedKeyBindingImpl * u; XSECnew(u, XKMSUnverifiedKeyBindingImpl(m_msg.mp_env)); m_unverifiedKeyBindingList.push_back(u); DOMElement * e = u->createBlankUnverifiedKeyBinding(); // Append the element m_msg.mp_messageAbstractTypeElement->appendChild(e); m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement); return u; } xml-security-c-1.7.3/xsec/xkms/impl/XKMSRequestAbstractTypeImpl.hpp000644 001751 001751 00000014725 12003301053 026472 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRequestAbstractTypeImpl := Implementation class for XKMS Request messages * * $Id: XKMSRequestAbstractTypeImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREQUESTABSTRACTTYPEIMPL_INCLUDE #define XKMSREQUESTABSTRACTTYPEIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSMessageAbstractTypeImpl.hpp" #include class XKMSRespondWithImpl; class XKMSResponseMechanismImpl; class XKMSRequestAbstractTypeImpl : public XKMSRequestAbstractType { public: XKMSMessageAbstractTypeImpl m_msg; public: /* Constructors and Destructors */ XKMSRequestAbstractTypeImpl( const XSECEnv * env ); XKMSRequestAbstractTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRequestAbstractTypeImpl(); virtual void load(void); // Create from scratch - tag is the element name to create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRequestAbstractType( const XMLCh * tag, const XMLCh * service, const XMLCh * id = NULL); /* Getter Interface Methods */ virtual const XMLCh * getOriginalRequestId(void) const; virtual void setOriginalRequestId(const XMLCh * id); virtual unsigned int getResponseLimit(void) const; /* Set interface methods */ virtual void setResponseLimit(unsigned int limit); /* RespondWith handling */ virtual int getRespondWithSize(void); virtual XKMSRespondWith * getRespondWithItem(int item); virtual const XMLCh * getRespondWithItemStr(int item); virtual void appendRespondWithItem(XKMSRespondWith * item); virtual void appendRespondWithItem(const XMLCh * item); /* ResponseMechanism handling */ virtual int getResponseMechanismSize(void); virtual XKMSResponseMechanism * getResponseMechanismItem(int item); virtual const XMLCh * getResponseMechanismItemStr(int item); virtual void appendResponseMechanismItem(XKMSResponseMechanism * item); virtual void appendResponseMechanismItem(const XMLCh * item); virtual void removeResponseMechanismItem(int item); /* Inherited from XKMSMessageType */ virtual messageType getMessageType(void) {return XKMSMessageAbstractType::None;} /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS #if 0 virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return XKMSMessageAbstractTypeImpl::getElement();} virtual bool isSigned(void) const {return XKMSMessageAbstractTypeImpl::isSigned();} virtual DSIGSignature * getSignature(void) const {return XKMSMessageAbstractTypeImpl::getSignature();} virtual const XMLCh * getId(void) const {return XKMSMessageAbstractTypeImpl::getId();} virtual const XMLCh * getService(void) const {return XKMSMessageAbstractTypeImpl::getService();} virtual const XMLCh * getNonce(void) const {return XKMSMessageAbstractTypeImpl::getNonce();} virtual void setId(const XMLCh * id) {XKMSMessageAbstractTypeImpl::setId(id);} virtual void setService(const XMLCh * service) {XKMSMessageAbstractTypeImpl::setService(service);} virtual void setNonce(const XMLCh * uri) {XKMSMessageAbstractTypeImpl::setNonce(uri);} #endif private: #if defined(XSEC_NO_NAMESPACES) typedef vector RespondWithVectorType; #else typedef std::vector RespondWithVectorType; #endif #if defined(XSEC_NO_NAMESPACES) typedef vector ResponseMechanismVectorType; #else typedef std::vector ResponseMechanismVectorType; #endif RespondWithVectorType m_respondWithList; // List of m_respondWith elements ResponseMechanismVectorType m_responseMechanismList;// List of responseMechanism elements XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_originalRequestIdAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr * mp_responseLimitAttr; // Unimplemented XKMSRequestAbstractTypeImpl(void); XKMSRequestAbstractTypeImpl(const XKMSRequestAbstractTypeImpl &); XKMSRequestAbstractTypeImpl & operator = (const XKMSRequestAbstractTypeImpl &); }; #define XKMS_REQUESTABSTRACTYPE_IMPL_METHODS \ virtual const XMLCh * getOriginalRequestId(void) const \ {return m_request.getOriginalRequestId();} \ virtual void setOriginalRequestId(const XMLCh * id) \ {m_request.setOriginalRequestId(id);} \ virtual int getRespondWithSize(void) \ {return m_request.getRespondWithSize();} \ virtual XKMSRespondWith * getRespondWithItem(int item) \ {return m_request.getRespondWithItem(item);} \ virtual const XMLCh * getRespondWithItemStr(int item) \ {return m_request.getRespondWithItemStr(item);} \ virtual void appendRespondWithItem(XKMSRespondWith * item) \ {m_request.appendRespondWithItem(item);} \ virtual void appendRespondWithItem(const XMLCh * item) \ {m_request.appendRespondWithItem(item);} \ virtual int getResponseMechanismSize(void) \ {return m_request.getResponseMechanismSize();} \ virtual XKMSResponseMechanism * getResponseMechanismItem(int item) \ {return m_request.getResponseMechanismItem(item);} \ virtual const XMLCh * getResponseMechanismItemStr(int item) \ {return m_request.getResponseMechanismItemStr(item);} \ virtual void appendResponseMechanismItem(XKMSResponseMechanism * item) \ {m_request.appendResponseMechanismItem(item);} \ virtual void appendResponseMechanismItem(const XMLCh * item) \ {m_request.appendResponseMechanismItem(item);} \ virtual void removeResponseMechanismItem(int item) \ {m_request.removeResponseMechanismItem(item);} \ virtual unsigned int getResponseLimit(void) const \ {return m_request.getResponseLimit();} \ virtual void setResponseLimit(unsigned int limit) \ {m_request.setResponseLimit(limit);} #endif /* XKMSREQUESTABSTRACTTYPEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSQueryKeyBindingImpl.cpp000644 001751 001751 00000005056 12003301053 025555 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSQueryKeyBindingImpl := Implementation for QueryKeyBinding * * $Id: XKMSQueryKeyBindingImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include "XKMSQueryKeyBindingImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XKMSQueryKeyBindingImpl::XKMSQueryKeyBindingImpl( const XSECEnv * env ) : XKMSKeyBindingAbstractTypeImpl(env) { } XKMSQueryKeyBindingImpl::XKMSQueryKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ) : XKMSKeyBindingAbstractTypeImpl(env, node) { } XKMSQueryKeyBindingImpl::~XKMSQueryKeyBindingImpl() {} // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XKMSQueryKeyBindingImpl::load(void) { if (mp_keyBindingAbstractTypeElement == NULL) { throw XSECException(XSECException::ExpectedXKMSChildNotFound, "XKMSQueryKeyBindingImpl::load - called on empty DOM"); } XKMSKeyBindingAbstractTypeImpl::load(); } // -------------------------------------------------------------------------------- // Create // -------------------------------------------------------------------------------- DOMElement * XKMSQueryKeyBindingImpl::createBlankQueryKeyBinding(void) { return XKMSKeyBindingAbstractTypeImpl:: createBlankKeyBindingAbstractType(XKMSConstants::s_tagQueryKeyBinding); } xml-security-c-1.7.3/xsec/xkms/impl/XKMSMessageFactoryImpl.hpp000644 001751 001751 00000023546 12003301053 025431 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSMessageFactoryImpl := Implementation of the XKMSMessageFactory class * * $Id: XKMSMessageFactoryImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSMESSAGEFACTORYIMPL_INCLUDE #define XKMSMESSAGEFACTORYIMPL_INCLUDE // XSEC Includes #include #include class XSECProvider; class XKMSCompoundRequest; class XKMSCompoundResult; class XSECEnv; class XKMSMessageFactoryImpl : public XKMSMessageFactory { protected: XKMSMessageFactoryImpl(void); public: virtual ~XKMSMessageFactoryImpl(); /* DOM based construction methods */ virtual XKMSMessageAbstractType * newMessageFromDOM( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * elt); /* Construction from scratch */ virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSLocateRequest * createLocateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSValidateRequest * createValidateRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSCompoundRequest * createCompoundRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSCompoundRequest * createCompoundRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSPendingRequest * createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, const XMLCh * id = NULL); virtual XKMSPendingRequest * createPendingRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSStatusRequest * createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSStatusRequest * createStatusRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSLocateResult * createLocateResult( XKMSLocateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSResult * createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSResult * createResult( XKMSRequestAbstractType * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSValidateResult * createValidateResult( XKMSValidateRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSCompoundResult * createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSCompoundResult * createCompoundResult( XKMSCompoundRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSStatusResult * createStatusResult( XKMSStatusRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); /* X-KRSS Construction from Scratch */ virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSRegisterRequest * createRegisterRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSRegisterResult * createRegisterResult( XKMSRegisterRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSRevokeRequest * createRevokeRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSRevokeResult * createRevokeResult( XKMSRevokeRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSRecoverRequest * createRecoverRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSRecoverResult * createRecoverResult( XKMSRecoverRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * id = NULL); virtual XKMSReissueRequest * createReissueRequest( const XMLCh * service, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, const XMLCh * id = NULL); virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); virtual XKMSReissueResult * createReissueResult( XKMSReissueRequest * request, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc, XKMSResultType::ResultMajor rmaj, XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor, const XMLCh * id = NULL); /* Conversions */ virtual XKMSRequestAbstractType * toRequestAbstractType(XKMSMessageAbstractType *msg); virtual XKMSResultType * toResultType(XKMSMessageAbstractType *msg); /* Environment Manipulation */ virtual void setDSIGNSPrefix(const XMLCh * prefix); virtual void setECNSPrefix(const XMLCh * prefix); virtual void setXPFNSPrefix(const XMLCh * prefix); virtual void setXENCNSPrefix(const XMLCh * prefix); virtual void setXKMSNSPrefix(const XMLCh * prefix); friend class XSECProvider; friend class XKMSCompoundRequestImpl; friend class XKMSCompoundResultImpl; private: // Internal methods void copyRequestToResult(XKMSRequestAbstractType * req, XKMSResultType * res); // Environment XSECEnv * mp_env; // Unimplemented XKMSMessageFactoryImpl(const XKMSMessageFactoryImpl &); XKMSMessageFactoryImpl & operator = (const XKMSMessageFactoryImpl &); }; #endif /* XKMSMESSAGEFACTORYIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSPrototypeKeyBindingImpl.hpp000644 001751 001751 00000005017 12003301053 026457 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSPrototypeKeyBindingImpl := Implementation of PrototypeKeyBinding elements * * $Id: XKMSPrototypeKeyBindingImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSPROTOTYPEKEYBINDINGIMPL_INCLUDE #define XKMSPROTOTYPEKEYBINDINGIMPL_INCLUDE // XSEC Includes #include #include #include "XKMSKeyBindingAbstractTypeImpl.hpp" class XKMSValidityIntervalImpl; class XKMSPrototypeKeyBindingImpl : public XKMSPrototypeKeyBinding, public XKMSKeyBindingAbstractTypeImpl { public: /* Constructors and Destructors */ XKMSPrototypeKeyBindingImpl( const XSECEnv * env ); XKMSPrototypeKeyBindingImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSPrototypeKeyBindingImpl(); // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankPrototypeKeyBinding(void); // Get methods virtual XKMSValidityInterval * getValidityInterval(void) const; virtual const XMLCh * getRevocationCodeIdentifier(void) const; // set methods virtual void setValidityInterval(const XMLCh * notBefore, const XMLCh * notOnOrAfter); virtual void setRevocationCodeIdentifier(const XMLCh * identifier); // Import methods from XKMSKeyBindingAbstractType XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS private: XKMSValidityIntervalImpl * mp_validityInterval; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_revocationCodeIdentifierElement; // Unimplemented XKMSPrototypeKeyBindingImpl(void); XKMSPrototypeKeyBindingImpl(const XKMSPrototypeKeyBindingImpl &); XKMSPrototypeKeyBindingImpl & operator = (const XKMSPrototypeKeyBindingImpl &); }; #endif /* XKMSPROTOTYPEKEYBINDINGIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xkms/impl/XKMSRegisterResultImpl.hpp000644 001751 001751 00000006323 12003301053 025472 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XKMSRegisterResultImpl := Implementation of RegisterResult Messages * * $Id: XKMSRegisterResultImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XKMSREGISTERRESULTIMPL_INCLUDE #define XKMSREGISTERRESULTIMPL_INCLUDE // XSEC Includes #include #include #include #include "XKMSResultTypeImpl.hpp" #include class XKMSKeyBindingImpl; class XKMSRSAKeyPairImpl; class XENCCipherImpl; class XKMSRegisterResultImpl : public XKMSRegisterResult { public: XKMSResultTypeImpl m_result; XKMSMessageAbstractTypeImpl &m_msg; public: XKMSRegisterResultImpl( const XSECEnv * env ); XKMSRegisterResultImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XKMSRegisterResultImpl(); // Load elements void load(); // Creation XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRegisterResult( const XMLCh * service, const XMLCh * id, ResultMajor rmaj, ResultMinor rmin); // Interface methods virtual int getKeyBindingSize(void) const; virtual XKMSKeyBinding * getKeyBindingItem(int item) const; virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status); virtual XKMSRSAKeyPair * getRSAKeyPair(const char * passPhrase); virtual XENCEncryptedData * setRSAKeyPair(const char * passPhrase, XMLCh * Modulus, XMLCh * Exponent, XMLCh * P, XMLCh * Q, XMLCh * DP, XMLCh * DQ, XMLCh * InverseQ, XMLCh * D, encryptionMethod em, const XMLCh * algorithmURI = NULL); /* Implemented from MessageAbstractType */ virtual messageType getMessageType(void); /* Forced inheritance from XKMSMessageAbstractTypeImpl */ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS /* Forced inheritance from XKMSResultTypeImpl */ XKMS_RESULTTYPE_IMPL_METHODS private: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyBindingVectorType; #else typedef std::vector KeyBindingVectorType; #endif KeyBindingVectorType m_keyBindingList; XKMSRSAKeyPairImpl * mp_RSAKeyPair; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_privateKeyElement; // To handle the cipher XSECProvider m_prov; // Unimplemented XKMSRegisterResultImpl(void); XKMSRegisterResultImpl(const XKMSRegisterResultImpl &); XKMSRegisterResultImpl & operator = (const XKMSRegisterResultImpl &); }; #endif /* XKMSREGISTERRESULTIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/000755 001751 001751 00000000000 12477614644 020454 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/xenc/XENCEncryptionMethod.hpp000644 001751 001751 00000012577 12003301053 024155 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptionMethod := Interface definition for EncryptionMethod element * * $Id: XENCEncryptionMethod.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef XENCENCRYPTIONMETHOD_INCLUDE #define XENCENCRYPTIONMETHOD_INCLUDE // XSEC Includes #include /** * @ingroup xenc */ /** * @brief Interface definition for the EncryptionMethod object * * The \ element holds information about the * encryption algorithm being used. * * This element is optional within an EncryptedType derivative, * but applications not making use of this need to know the * this information, otherwise the library will not be able to * decrypt the data. * * It is defined as : * \verbatim \endverbatim */ class XENCEncryptionMethod { public: XENCEncryptionMethod() {}; virtual ~XENCEncryptionMethod() {}; /** @name Getter Methods */ //@{ /** * \brief Get the algorithm * * Return the Algorithm URI representing the encryption type for this * encrypted data * * @returns the URI representing the algorithm */ virtual const XMLCh * getAlgorithm(void) const = 0; /** * \brief Get the digest method URI * * Return the Algorithm URI represtenting the Digest Method for those * encryption algorithms that require it (such as RSA with OAEP padding) * * @returns the URI representing the digest method algorithm */ virtual const XMLCh * getDigestMethod(void) const = 0; /** * \brief Get the value of the OAEPparams string * * The OAEP RSA padding method allows a user to set an optional * params string (that will be used as input to the Digest algorithm). * * @returns The string (base64 encoded value) representing the OAEP params */ virtual const XMLCh * getOAEPparams(void) const = 0; /** * \brief Get the MGF URI * * Return the Algorithm URI represtenting the Mask Generation Function for those * encryption algorithms that require it (such as RSA with OAEP padding) * * @returns the URI representing the mask generation function */ virtual const XMLCh * getMGF(void) const = 0; /** * \brief Get the KeySize that was set in this EncryptionMethod. * * This field would not normally be used for the encryption algorithms * explicitly referenced in the XML Encryption standard. It is provided * mainly for stream ciphers that have a variable key length */ virtual int getKeySize(void) const = 0; /** * \brief Get the DOM Element Node of this structure * * @returns the DOM Element Node representing the \ element */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name Setter Methods */ //@{ /** * \brief Set the value of the DigestMethod * * Sets the DigestMethod element's Algorithm attribute to the passed in * value - should be a URI string * * @param method String to set in the Algorithm attribute. Will create a * \ element if one does not already exist */ virtual void setDigestMethod(const XMLCh * method) = 0; /** * \brief Set the value of the OAEPparams string * * Sets the OAEPparams element's Text node child to the passed in * value - should be a base64 encoded value * * @param params String to set in the OAEPparams text node. Will create a * \ element if one does not already exist */ virtual void setOAEPparams(const XMLCh * params) = 0; /** * \brief Set the value of the MGF * * Sets the MGF element's Algorithm attribute to the passed in * value - should be a URI string * * @param method String to set in the Algorithm attribute. Will create a * \ element if one does not already exist */ virtual void setMGF(const XMLCh * mgf) = 0; /** * \brief Set the KeySize that in this EncryptionMethod. * * This field would not normally be used for the encryption algorithms * explicitly referenced in the XML Encryption standard. It is provided * mainly for stream ciphers that have a variable key length */ virtual void setKeySize(int size) = 0; //@} private: // Unimplemented XENCEncryptionMethod(const XENCEncryptionMethod &); XENCEncryptionMethod & operator = (const XENCEncryptionMethod &); }; #endif /* XENCENCRYPTIONMETHOD_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCEncryptedType.hpp000644 001751 001751 00000023255 12003301053 023454 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedType := Definition for holder object for EncryptedType * element * * Author(s): Berin Lautenbach * * $Id: XENCEncryptedType.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDTYPE_INCLUDE #define XENCENCRYPTEDTYPE_INCLUDE // XSEC Includes #include class XENCCipherData; class DSIGKeyInfoList; class DSIGKeyInfoName; class DSIGKeyInfoValue; class DSIGKeyInfoX509; class XENCEncryptionMethod; class XENCEncryptedKey; /** * @ingroup xenc */ /** * @brief Interface definition for the EncryptedType object * * The \ element is an abstract type on which * EncryptedData and EncryptedKey objects are built. * * This is the base class on which most of the XML Encryption * standard is built. Using classes derived from this, * calling programs can decrypt the content, determine KeyInfo * references etc. * * In general derived objects should not be used directly. * The XENCCipher class should be used to operate on them. * * The schema definition for EncryptedType is as follows : * * \verbatim \endverbatim */ class XENCEncryptedType { /** @name Constructors and Destructors */ //@{ protected: XENCEncryptedType() {}; public: virtual ~XENCEncryptedType() {}; /** @name Basic Interface Methods */ //@{ /** * \brief Retrieve the CipherData element * * CipherData elements are the sub part of the EncryptedData * that hold the actual enciphered information. * * @returns The CipherData object */ virtual XENCCipherData * getCipherData(void) const = 0; /** * \brief Retrieve the EncryptionMethod element * * The EncryptionMethod element holds information about the * encryption algorithm to be used to encrypt/decrypt the data * * This method provides a means to extract the EncryptionMethod * element from the EncryptedType * * @returns The EncryptionMethod element */ virtual XENCEncryptionMethod * getEncryptionMethod(void) const = 0; /** * \brief Get the DOM Element Node of this structure * * @returns the DOM Element Node representing the \ element */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name Getter interface Methods */ //@{ /** * \brief Get the Type URI for the EncryptedType * * If this object is an EncryptedData, it may have a * Type attribute that defines whether it is an encrypted * Element or Element Content. This method allows the caller * to see this type URI. * * @returns a pointer to the URI string (owned by the library) * or NULL if no type is set */ virtual const XMLCh * getType(void) const = 0; /** * \brief Get the MimeType of the EncryptedType * * If this object is an EncryptedData, it may have a * MimeType attribute that "describes the media type of the * data which has been encrypted" (from the XML Encryption spec). * * The XML-Security-C library makes no use of this attribute, but * it provides these functions to allow applications to set and get. * * @returns a pointer to the MimeType string (owned by the library) * or NULL if no MimeType is set */ virtual const XMLCh * getMimeType(void) const = 0; /** * \brief Get the Encoding of the EncryptedType * * If this object is an EncryptedData, it may have an * encoding attribute that describes how the data has been encoded * prior to encryption. (E.g. http://www.w3.org/2000/09/xmldsig#base64) * * The XML-Security-C library makes no use of this attribute, but * it provides these functions to allow applications to set and get. * * @returns A string (owned by the library) providing the encoding URI */ virtual const XMLCh * getEncoding(void) const = 0; //@} /** @name Setter interface methods */ //@{ /** * \brief Set the Type URI for the EncryptedType * * Allows a calling application to set a particular Type URI for * the EncryptedType. * * @note calls to encryptElement and encryptElementContent * automatically set the appropriate Type URI. * * @param uri The URI to set */ virtual void setType(const XMLCh * uri) = 0; /** * \brief Set the MimeType of the EncryptedType * * If this object is an EncryptedData, it may have a * MimeType attribute that "describes the media type of the * data which has been encrypted" (from the XML Encryption spec). * * The XML-Security-C library makes no use of this attribute, but * it provides these functions to allow applications to set and get. * * @param mimeType String to set in the MimeType attribute. * @note no checking of this string is done by the library - it * simply sets the value of the MimeType attribute to this value. */ virtual void setMimeType(const XMLCh * mimeType) = 0; /** * \brief Set the Encoding of the EncryptedType * * If this object is an EncryptedData, it may have an * encoding attribute that describes how the data has been encoded * prior to encryption. (E.g. http://www.w3.org/2000/09/xmldsig#base64) * * The XML-Security-C library makes no use of this attribute, but * it provides these functions to allow applications to set and get. * * @param uri String (URI) to set in the Encoding attribute. * @note no checking of this string is done by the library - it * simply sets the value of the Encoding attribute to this value. */ virtual void setEncoding(const XMLCh * uri) = 0; //@} /** @name KeyInfo Element Manipulation */ //@{ /** * \brief Get the list of \ elements. * *

This function recovers list that contains the KeyInfo elements * read in from the DOM document.

* *

This list should be used by calling applications to determine what key * is appropriate for decrypting the document.

* * @note The list should never be modified directly. If you need to * add keyInfo elements, call the appropriate functions in EncryptedType * * @returns A pointer to the DSIGKeyInfoList object held by the XENCCipher */ virtual DSIGKeyInfoList * getKeyInfoList(void) = 0; /** * \brief Clear out all KeyInfo elements in the signature. * * This function will delete all KeyInfo elements from both the EncryptedType * object and the associated DOM. * */ virtual void clearKeyInfo(void) = 0; /** * \brief Append a DSA KeyValue element * * Add a new KeyInfo element for a DSA Value * * @param P Base64 encoded value of P * @param Q Base64 encoded value of Q * @param G Base64 encoded value of G * @param Y Base64 encoded value of Y * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) = 0; /** * \brief Append a RSA KeyValue element * * Add a new KeyInfo element for a RSA Value * * @param modulus Base64 encoded value of the modulus * @param exponent Base64 encoded value of exponent * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) = 0; /** * \brief Append a X509Data element. * * Add a new KeyInfo element for X509 data. * * @note The added element is empty. The caller must make use of the * returned object to set the required values. * * @returns A pointer to the created object. */ virtual DSIGKeyInfoX509 * appendX509Data(void) = 0; /** * \brief Append a KeyName element. * * Add a new KeyInfo element for a key name. * * @param name The name of the key to set in the XML * @param isDName Treat the name as a Distinguished name and encode accordingly * @returns A pointer to the created object */ virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) = 0; /** * \brief Append an already created EncryptedKey. * * Add an already created EncryptedKey. * * @note The encryptedKey becomes the property of the owning EncryptedType * object and will be deleted upon its destruction. * * @param encryptedKey A pointer to the encrypted Key */ virtual void appendEncryptedKey(XENCEncryptedKey * encryptedKey) = 0; //@} private: // Unimplemented XENCEncryptedType(const XENCEncryptedType &); XENCEncryptedType & operator = (const XENCEncryptedType &); }; #endif /* XENCENCRYPTEDTYPE_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCCipherData.hpp000644 001751 001751 00000006500 12003301053 022653 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherData := Interface for CipherData elements * * $Id: XENCCipherData.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCIPHERDATA_INCLUDE #define XSECCIPHERDATA_INCLUDE // XSEC Includes #include #include #include /** * @ingroup xenc */ /** * @brief Interface definition for the CipherData object * * The \ element either holds the encrypted data (via * a CipherValue element) or a reference to the encrypted data. * * Within the library, the CipherData element can only be used to * hold and read the encrypted data. To actually decrypt/encrypt * data, an XENCEncryptedType derivative object of XENCCipher object * should be used. * * The schema for CipherData is as follows: * * \verbatim \endverbatim */ class XENCCipherData { public: /** * CipherDataType */ enum XENCCipherDataType { NO_TYPE = 0, /** Not Set */ VALUE_TYPE = 1, REFERENCE_TYPE = 2 }; /** @name Constructors and Destructors */ //@{ protected: XENCCipherData() {}; public: virtual ~XENCCipherData() {}; /** @name Get Interface Methods */ //@{ /** * \brief Find the type of Cipher Data held * * CipherData elements can hold either a CipherValue element (whose * text is the encrypted data) or a CipherReference element, where the * contents tell the library how to retrieve the encrypted data from * elsewhere. * * @returns The type of CipherData */ virtual XENCCipherDataType getCipherDataType(void) = 0; /** * \brief Get the CipherValue element * * @returns the CipherValue element, or NULL if one is not held */ virtual XENCCipherValue * getCipherValue(void) = 0; /** * \brief Get the CipherReference element * * @returns the CipherReference element, or NULL if one is not held */ virtual XENCCipherReference * getCipherReference(void) = 0; /** * \brief Get the DOM Node of this structure * * @returns the DOM Node representing the \ element */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) = 0; //@} private: // Unimplemented XENCCipherData(const XENCCipherData &); XENCCipherData & operator = (const XENCCipherData &); }; #endif /* XENCCIPHERDATA_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCEncryptedKey.hpp000644 001751 001751 00000010775 12003301053 023266 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedKey := Definition for holder object for EncryptedKey * * $Id: XENCEncryptedKey.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDKEY_INCLUDE #define XENCENCRYPTEDKEY_INCLUDE // XSEC Includes #include #include #include #include /** * @ingroup xenc */ /** * @brief Interface definition for the EncryptedKey object * * The \ element is an abstract type which builds * on the EncryptedType element for encrypted data (as opposed to * encrypted data). * * In general, this class should not be used directly. For most * applications, callers will want to use the XENCCipher class * instead. * * The schema definition for EncryptedKey is as follows: * * \verbatim \endverbatim */ class XENCEncryptedKey : public XENCEncryptedType, public DSIGKeyInfo { /** @name Constructors and Destructors */ //@{ protected: // Because we inherit from KeyInfo, we need to implement a slightly different // constructor. XENCEncryptedKey(const XSECEnv * env) : DSIGKeyInfo(env) {}; public: virtual ~XENCEncryptedKey() {}; /** @name EncryptedKey Specific Getter Methods */ //@{ /** * \brief Get the CarriedKeyName * * EncryptedKey elements MAY have a CarriedKeyName element that links * the EncryptedKey to a KeyName KeyInfo element in another EncryptedKey * or EncryptedData element. * * This method allows applications to retrieve the Carried Key Name for * the particular EncryptedKey * * @returns A pointer (owned by the library) to the CarriedKeyName string * (or NULL if none) */ virtual const XMLCh * getCarriedKeyName(void) const = 0; /** * \brief Get the Recipient name * * EncryptedKey elements MAY have a Recipient Attribute on the main * EncryptedKey element that provide a hint to the application as to who * the recipient of the key is. * * This method returns this string in cases where it has been provided * * @returns A pointer (owned by the library) to the Recipient string * (or NULL if none provided). */ virtual const XMLCh * getRecipient(void) const = 0; //@} /** @name EncryptedKey Specific Setter Methods */ //@{ /** * \brief Set the CarriedKeyName * * EncryptedKey elements MAY have a CarriedKeyName element that links * the EncryptedKey to a KeyName KeyInfo element in another EncryptedKey * or EncryptedData element. * * This method allows applications to set the Carried Key Name for * the particular EncryptedKey * * @param name String to set in the CarriedKeyName element */ virtual void setCarriedKeyName(const XMLCh * name) = 0; /** * \brief Set the Recipient name * * EncryptedKey elements MAY have a Recipient Attribute on the main * EncryptedKey element that provide a hint to the application as to who * the recipient of the key is. * * This method sets the Recipient string * * @param recipient String to set in the Recipient attribute */ virtual void setRecipient(const XMLCh * recipient) = 0; //@} private: // Unimplemented XENCEncryptedKey(const XENCEncryptedKey &); XENCEncryptedKey & operator = (const XENCEncryptedKey &); }; #endif /* XENCENCRYPTEDKEY_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCCipherValue.hpp000644 001751 001751 00000005164 12003301053 023063 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherValue := Interface definition for CipherValue element * * $Id: XENCCipherValue.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHERVALUE_INCLUDE #define XENCCIPHERVALUE_INCLUDE // XSEC Includes #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup xenc */ /** * @brief Interface definition for the CipherValue object * * The \ element holds the base64 encoded, encrypted data. * This is a very simple class that acts purely as a holder of data. * */ class XENCCipherValue { /** @name Constructors and Destructors */ //@{ protected: XENCCipherValue() {}; public: virtual ~XENCCipherValue() {}; /** @name Get Interface Methods */ //@{ /** * \brief Get the encrypted information * * CipherValue nodes contain a text child that holds the base64 encoded * cipher text that needs to be decrypted. This call will return the * base64 encoded string. * * @returns The Encrypted information in a base64 encoded string */ virtual const XMLCh * getCipherString(void) const = 0; /** * \brief Get the DOM Node of this structure * * @returns the DOM Node representing the \ element */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name Set Interface Methods */ //@{ /** * \brief Set the encrypted value * * Sets the base64 encoded string held in the CipherValue. * * @note This should not normally be called directly - use the XENCCipher * interface for normal operation * * @param value The string to set */ virtual void setCipherString(const XMLCh * value) = 0; //@} private: // Unimplemented XENCCipherValue(const XENCCipherValue &); XENCCipherValue & operator = (const XENCCipherValue &); }; #endif /* XENCCIPHERVALUE_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCEncryptedData.hpp000644 001751 001751 00000004405 12003301053 023400 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedData := Definition for holder object for EncryptedData * element * * $Id: XENCEncryptedData.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDDATA_INCLUDE #define XENCENCRYPTEDDATA_INCLUDE // XSEC Includes #include #include #include /** * @ingroup xenc */ /** * @brief Interface definition for the EncryptedData object * * The \ element is an abstract type which builds * on the EncryptedType element for encrypted data (as opposed to * encrypted keys). * * In general, this class should not be used directly. For most * applications, callers will want to use the XENCCipher class * instead. * * The schema for EncryptedData is as follows: * * \verbatim \endverbatim */ class XENCEncryptedData : public XENCEncryptedType { /** @name Constructors and Destructors */ //@{ protected: XENCEncryptedData() {}; public: virtual ~XENCEncryptedData() {}; /** @name Get Interface Methods */ //@{ //@} private: // Unimplemented XENCEncryptedData(const XENCEncryptedData &); XENCEncryptedData & operator = (const XENCEncryptedData &); }; #endif /* XENCENCRYPTEDDATA_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCCipherReference.hpp000644 001751 001751 00000013445 12003301053 023706 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherReference := Interface definition for CipherReference element * * $Id: XENCCipherReference.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHERREFERENCE_INCLUDE #define XENCCIPHERREFERENCE_INCLUDE // XSEC Includes #include #include class DSIGTransformList; class DSIGTransformBase64; class DSIGTransformXPath; class DSIGTransformXPathFilter; class DSIGTransformXSL; class DSIGTransformC14n; XSEC_DECLARE_XERCES_CLASS(DOMElement); XSEC_DECLARE_XERCES_CLASS(DOMNode); /** * @ingroup xenc */ /** * @brief Interface definition for the CipherReference object * * The \ element provides the information necessary for * an application to find the data being referenced. Like a Reference in * XML-DSIG, the CipherReference starts with a URI that provides the base * location of the data in question. * * A list of transforms may then be provided, which the library will apply * to the data found at the provided URI. It is expected that the result of * these transforms will be the raw encrypted octets, * * The schema for CipherReference is as follows: * * \verbatim \endverbatim */ class XENCCipherReference { /** @name Constructors and Destructors */ //@{ protected: XENCCipherReference() {}; public: virtual ~XENCCipherReference() {}; /** @name Get Interface Methods */ //@{ /** * \brief Obtain the transforms for this CipherReference * * Get the DSIGTransformList object for this CipherReference. Can be used to * obtain information about the transforms and also change the the transforms */ virtual DSIGTransformList * getTransforms(void) const = 0; /** * \brief Obtain the URI for this CipherReference * * @returns A pointer to the URI string for this CipherReference */ virtual const XMLCh * getURI (void) const = 0; /** * \brief Get the DOM Node of this structure * * @returns the DOM Node representing the \ element */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; //@} /** @name Set Interface Methods */ //@{ /** * \brief Append a Base64 Transform to the Reference. * * @returns The newly created Base64 transform. * @todo Move to DSIGTransformList rather than re-implement in both DSIGReference * and XENCCipherReference */ virtual DSIGTransformBase64 * appendBase64Transform() = 0; /** * \brief Append an XPath Transform to the Reference. * *

Append an XPath transform. Namespaces can be added to the * transform directly using the returned DSIGTransformXPath * structure

* * @param expr The XPath expression to be placed in the transform. * @returns The newly created XPath transform * @todo Move to DSIGTransformList rather than re-implement in both DSIGReference * and XENCCipherReference */ virtual DSIGTransformXPath * appendXPathTransform(const char * expr) = 0; /** * \brief Append an XPath-Filter2 Transform to the Reference. * * The returned DSIGTransformXPathFilter will have no actual filter * expressions loaded, but calls can be made to * DSIGTransformXPathFilter::appendTransform to add them. * * @returns The newly created XPath Filter transform * @todo Move to DSIGTransformList rather than re-implement in both DSIGReference * and XENCCipherReference */ virtual DSIGTransformXPathFilter * appendXPathFilterTransform(void) = 0; /** * \brief Append an XSLT Transform to the Reference. * *

The caller must have already create the stylesheet and turned it into * a DOM structure that is passed in as the stylesheet parameter.

* * @param stylesheet The stylesheet DOM structure to be placed in the reference. * @returns The newly create XSLT transform * @todo Move to DSIGTransformList rather than re-implement in both DSIGReference * and XENCCipherReference */ virtual DSIGTransformXSL * appendXSLTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *stylesheet) = 0; /** * \brief Append a Canonicalization Transform to the Reference. * * @param cm The type of canonicalisation to be added. * @returns The newly create canonicalisation transform * @todo Move to DSIGTransformList rather than re-implement in both DSIGReference * and XENCCipherReference */ virtual DSIGTransformC14n * appendCanonicalizationTransform(canonicalizationMethod cm) = 0; //@} private: // Unimplemented XENCCipherReference(const XENCCipherReference &); XENCCipherReference & operator = (const XENCCipherReference &); }; #endif /* XENCCIPHERREFERENCE_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/XENCCipher.hpp000644 001751 001751 00000047213 12003301053 022067 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipher := Interface definition for main encryption worker class * * $Id: XENCCipher.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHER_INCLUDE #define XENCCIPHER_INCLUDE // XSEC Includes #include #include #include // Xerces XSEC_DECLARE_XERCES_CLASS(DOMElement); XSEC_DECLARE_XERCES_CLASS(DOMDocument); XSEC_DECLARE_XERCES_CLASS(BinInputStream); class XSECCryptoKey; class XENCEncryptedData; class XENCEncryptedKey; class XSECKeyInfoResolver; class XSECBinTXFMInputStream; class TXFMChain; /** * @defgroup xenc XML Encryption Implementation * *

The classes in this group implement the XML Encryption * standard. In most cases, users should interact with these * functions via the XENCCipher class

* *\@{*/ /** * @brief Main worker class for the XSEC implementation of XML * Encryption. * * The XENCCipher class not something that is directly defined in * the XML Encryption standard. It is a control class used by the * library to generate encrypted XML information and to decrypt * information held in XML Encryption structures. * * All encryption and decryption work performed by the library is * handled within this class. The other XENC classes simply * handle marshalling and unmarshalling of the DOM data. * */ class XENCCipher { public: /** @name Constructors and Destructors */ //@{ virtual ~XENCCipher() {}; //@} /** @name Decryption Functions */ //@{ /** * \brief Decrypt the nominated element. * * Decrypts the passed in element, which must be the root * node of a \ method with a type of "#Element". * If not, the library will throw an XSECException exception. * * This is an "all in one method". The library will replace * the passed in Element (i.e. the encrypted XML data) with * the resultant plain text, after it has been parsed back into * DOM nodes * * @param element Root of EncryptedData DOM structyre to decrypt * @returns The owning document with the element replaced, or NULL * if the decryption fails for some reason (normally an exception). * @throws XSECException if the decryption fails, or if this is * not a valid EncryptedData DOM structure. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * decryptElement( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ) = 0; /** * \brief Decrypt the nominated element without replacing it. * * Decrypts the passed in element, which must be the root * node of a \ method with a type of "#Element". * If not, the library will throw an XSECException exception. Rather * than replacing the element with the decrypted content, the * result is passed to the caller as an orphaned document fragment. * * @param element Root of EncryptedData DOM structyre to decrypt * @returns The document fragment containing the decrypted node-set. * @throws XSECException if the decryption fails, or if this is * not a valid EncryptedData DOM structure. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * decryptElementDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ) = 0; /** * \brief Decrypt currently loaded element. * * Decrypts the an element that was previously passed in via * loadEncryptedData with a type of "#Element". * If not, the library will throw an XSECException exception. * * This is an "all in one method". The library will replace * the passed in Element (i.e. the encrypted XML data) with * the resultant plain text, after it has been parsed back into * DOM nodes * * @param element Root of EncryptedData DOM structyre to decrypt * @returns The owning document with the element replaced, or NULL * if the decryption fails for some reason (normally an exception). * @throws XSECException if the decryption fails, or if this is * not a valid EncryptedData DOM structure. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * decryptElement(void) = 0; /** * \brief Decrypt currently loaded element without replacing it. * * Decrypts the an element that was previously passed in via * loadEncryptedData with a type of "#Element". * If not, the library will throw an XSECException exception. * * This does not replace the currently existing DOM document. It returns * an "orphaned" document fragment containing the serialised version of the * decrypted data. * * @param element Root of EncryptedData DOM structyre to decrypt * @returns The owning document with the element replaced, or NULL * if the decryption fails for some reason (normally an exception). * @throws XSECException if the decryption fails, or if this is * not a valid EncryptedData DOM structure. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * decryptElementDetached(void) = 0; /** * \brief Decrypt the nominated element and put the output to an InputStream. * * Decrypts the passed in element, which must be the root * node of a \ method. * * This call does not change the source DOM in any way. It simply * processes the encrypted data and provides an InputStream that the * caller can read from to read the plain text data. * * @param element Root of EncryptedData DOM structyre to decrypt * @returns A BinInputStream object that the application can use to * read the decrypted data. * @throws XSECException if the decryption fails, or if this is * not a valid EncryptedData DOM structure. */ virtual XSECBinTXFMInputStream * decryptToBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ) = 0; /** * \brief Decrypt a key * * Reads in the passed in KeyInfo structure for an EncryptedKey and * decrypts the key to a buffer. * * @param encryptedKey the already loaded encryptedKey structure * @param rawKey Buffer to place the decrypted key into * @param maxKeySize Maximum number of bytes to place in the buffer */ virtual int decryptKey( XENCEncryptedKey * encryptedKey, XMLByte * rawKey, int maxKeySize ) = 0; /** * \brief Decrypt a key directly from DOM * * Loads an EncryptedKey from DOM and then decrypts the key. * If a NULL buffer is passed in, will simply load the key and return * * @param keyNode Node to load from * @param rawKey Buffer to decrypt to * @param maxKeySize Length of rawKey buffer * @returns The number of bytes decrypted */ virtual int decryptKey( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * keyNode, XMLByte * rawKey, int maxKeySize ) = 0; //@} /** @name Encryption Functions */ //@{ /** * \brief Encrypt the nominated element. * * Encrypts the passed in element and all children. The element * is replaced with an EncryptedData element * * @param element Element (and children) to encrypt * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * * @returns The owning document with the element replaced, or NULL * if the decryption fails for some reason (normally an exception). * @throws XSECException if the encryption fails. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * encryptElement( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt the nominated element without affecting the current document. * * Encrypts the passed in element and all children. The element * is not replaced - the return node is an "orphaned" subtree from * the passed in document and the original document is untouched. * * @param element Element (and children) to encrypt * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * * @returns The resulting document fragment containing the encrypted data. * @throws XSECException if the encryption fails. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * encryptElementDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt the children of the nominated element * * Encrypts the all children of the passed in element, but * leaves the element itself in place, with one new child - an * EncryptedData node of type #content * * @param element Element whose children are to be encrypted * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * * @returns The owning document with the element's children replaced, or NULL * if the decryption fails for some reason (normally an exception). * @throws XSECException if the encryption fails. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * encryptElementContent( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt the children of the nominated element * * Encrypts the all children of the passed in element. The input * DOM node set is untouched, but the function returns an orphaned * sub-tree owned by the passed in document containing the encrypted * data. * * @param element Element whose children are to be encrypted * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is passed in, this will be * used to set the algorithm URI. If this is also NULL - no * EncryptionMethod will be set. NULL Value Unsupported if em not * set! It's use could cause problems! * * @returns The resulting (orphaned) sub-tree from the passed in document * containing the encrypted data. * @throws XSECException if the encryption fails. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * encryptElementContentDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt a buffer of data as a key * * Encrypts the passed in data and creates an EncryptedKey element * * @param keyBuffer The key data to encrypt * @param keyLen Bytes to encrypt * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI If ENCRYPT_NONE is used for em, this will be * used as the algorithm URI. * * @returns The EncryptedKey element */ virtual XENCEncryptedKey * encryptKey( const unsigned char * keyBuffer, unsigned int keyLen, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt an input stream to a CipherValue * * Encrypts the data passed in via a Xerces BinInputStream and places it * directly into a new EncryptedData element that contains a CipherValue * * @param plainText The InputStream to read the plain text from * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI if ENCRYPT_NONE is used for em, this will be used * as the algorithm URI * * @returns the EncryptedData element containing the CipherValue of the data */ virtual XENCEncryptedData * encryptBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * plainText, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; /** * \brief Encrypt a TXFMChain to a CipherValue * * Encrypts the data passed in via a TXFMChain and places it * directly into a new EncryptedData element that contains a CipherValue. * * @note This is not really intended for client apps, but is used internally * and is provided for flexibility. The "formal" method is encryptBinInputStream * * @param plainText The TXFMChain to read the plain text from * @param em The encryptionMethod to use for this encryption. Use * ENCRYPT_NONE if a user defined type is required. * @param algorithmURI if ENCRYPT_NONE is used for em, this will be used * as the algorithm URI * * @returns the EncryptedData element containing the CipherValue of the data */ virtual XENCEncryptedData * encryptTXFMChain( TXFMChain * plainText, encryptionMethod em, const XMLCh * algorithmURI = NULL ) = 0; //@} /** @name Getter Functions */ //@{ /** * \brief Get owning document * * Every Cipher object is associated with an owning document (for generation of * nodes etc.) This allows callers to retrieve this value. * * @returns The DOMDocument that is used by this object */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * getDocument(void) = 0; /** * \brief Get namespace prefix for XENC nodes * * Find the string being used by the library to prefix nodes in the * xenc: namespace. * * @returns XENC namespace prefix */ virtual const XMLCh * getXENCNSPrefix(void) const = 0; /** * \brief Get the EncryptedData element * * Allows the user to get the EncryptedData element that was last processed/ * created by this XENCCipher object. * * @returns The last used EncryptedData */ virtual XENCEncryptedData * getEncryptedData(void) = 0; /** * \brief Tell caller whether PrettyPrinting is active * * @returns True if Pretty Printing is active, false if not */ virtual bool getPrettyPrint(void) = 0; /** * \brief Tell caller whether the serialisation routines will * use exclusive or normal canonicalisation. * * When serialising an element prior to encryption, the c14n * canonicalisation routines are used. By default, exclusive * c14n is used, however this can be turned off using the * setExclusiveC14nSerialisation call. This function returns * the current state of the associated flag. * * @returns True if Exclusive c14n will be used, false if standard */ virtual bool getExclusiveC14nSerialisation(void) = 0; //@} /** @name Setter Functions */ //@{ /** * \brief Set decryption key for next operation * * Set the passed in key for the next decryption/encryption * operation. * * @param key Key to use * @note This function will take ownership of the key and delete it when done. */ virtual void setKey(XSECCryptoKey * key) = 0; /** * \brief Set Key Encryption Key for next operation * * Set the passed in key for the next key decryption/encryption * operation. * * @note This key will only be used to decrypt EncryptedKey elements. * To set a key for decrypting an EncryptedData use #setKey instead. * * @param key Key to use * @note This function will take ownership of the key and delete it when done. */ virtual void setKEK(XSECCryptoKey * key) = 0; /** * \brief Register a KeyInfoResolver * * Registers a KeyInfoResolver to be used by the cipher when * it needs to find a key to be used to decrypt some ciper text * * @note The library will use the #clone() function from the resolver * to get a copy. The passed in resolver remains the property of * the calling function * * @param resolver Resolver to clone and use for resolving keys * */ virtual void setKeyInfoResolver(const XSECKeyInfoResolver * resolver) = 0; /** * \brief Set prefix for XENC nodes * * Set the namespace prefix the library will use when creating * nodes in the XENC namespace */ virtual void setXENCNSPrefix(const XMLCh * prefix) = 0; /** * \brief Set Pretty Print * * The pretty print functions controls whether the library will output * CR/LF after the elements it adds to a document * * By default the library will do pretty printing (flag is true) * * @param flag Value to set for Pretty Printing (true = do pretty printing) */ virtual void setPrettyPrint(bool flag) = 0; /** * \brief Set whether the serialisation routines will * use exclusive or normal canonicalisation. * * When serialising an element prior to encryption, the c14n * canonicalisation routines are used. By default, exclusive * c14n is used, however this can be turned off using the * setExclusiveC14nSerialisation call. * * @param flag Set for true if Exclusive c14n will be used, * false otherwise */ virtual void setExclusiveC14nSerialisation(bool flag) = 0; //@} /** @name Creation and loading Functions */ //@{ /** * \brief Create a new EncryptedData element * * Method for creating a basic Encrypted Data element. Can be used * in cases where an application needs to build this from scratch. * * In general, applications should use the higher level methods such * as #encryptElement or #encryptElementContent. * * @note The Cipher object will take on this new object as the current * EncryptedData and delete any currently being held. * * @param type Should this set up a CipherReference or a CipherValue * @param algorithm URI string to use for the Algorithm attribute in EncryptionMethod. * Set to NULL for no defined algorithm. * @param value String to set the cipher data to if the type is VALUE_TYPE. * for REFERENCE_TYPE CipherData elements, this should be the URI value. * @returns An XENCEncryptedData object */ virtual XENCEncryptedData * createEncryptedData(XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value) = 0; /** * \brief Load an EncryptedKey element * * Take a passed in EncryptedKey DOMNode and return a loaded XENCEncryptedKey * object based on the DOMNode from the passed in element. * * @param keyNode Element node to load EncryptedKey from * @returns An XENCEncryptedKey structure (owned by the caller) based on the * node. */ virtual XENCEncryptedKey * loadEncryptedKey( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * keyNode ) = 0; /** * \brief Load an EncryptedData element * * Take a passed in EncryptedData DOMNode and return a loaded XENCEncryptedData * object based on the DOMNode from the passed in element. * * @note The Cipher object will take on this new object as the current * EncryptedData and delete any currently being held. * * @param dataNode Element node to load EncryptedData from * @returns An XENCEncryptedData structure (owned by the caller) based on the * node. */ virtual XENCEncryptedData * loadEncryptedData( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * dataNode ) = 0; //@} }; /*\@}*/ #endif /* XENCCIPHER_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherReferenceImpl.cpp000644 001751 001751 00000021672 12003301053 025465 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherReference := Implementation for CipherReference element * * $Id: XENCCipherReferenceImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XENCCipherReferenceImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // String Constants // -------------------------------------------------------------------------------- static XMLCh s_CipherReference[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull }; static XMLCh s_Transforms[] = { chLatin_T, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_s, chNull }; // -------------------------------------------------------------------------------- // Constructors/Destructors // -------------------------------------------------------------------------------- XENCCipherReferenceImpl::XENCCipherReferenceImpl(const XSECEnv * env) : mp_env(env), mp_cipherReferenceElement(NULL), mp_uriAttr(NULL), mp_transformsElement(NULL), mp_transformList(NULL) { } XENCCipherReferenceImpl::XENCCipherReferenceImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_cipherReferenceElement(node), mp_uriAttr(NULL), mp_transformsElement(NULL), mp_transformList(NULL) { } XENCCipherReferenceImpl::~XENCCipherReferenceImpl() { if (mp_transformList != NULL) delete mp_transformList; } // -------------------------------------------------------------------------------- // Creation of Transforms // -------------------------------------------------------------------------------- void XENCCipherReferenceImpl::createTransformList(void) { // Creates the transforms list safeBuffer str; const XMLCh * prefix; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getXENCNSPrefix(); if (mp_transformsElement == NULL) { // Need to create a transforms node makeQName(str, prefix, "Transforms"); mp_transformsElement = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); mp_env->doPrettyPrint(mp_cipherReferenceElement); mp_cipherReferenceElement->appendChild(mp_transformsElement); mp_env->doPrettyPrint(mp_transformsElement); mp_env->doPrettyPrint(mp_cipherReferenceElement); // Create the list XSECnew(mp_transformList, DSIGTransformList()); } } void XENCCipherReferenceImpl::addTransform(DSIGTransform * txfm, DOMElement * txfmElt) { if (mp_transformList == NULL) createTransformList(); mp_transformsElement->appendChild(txfmElt); mp_env->doPrettyPrint(mp_transformsElement); mp_transformList->addTransform(txfm); } DSIGTransformBase64 * XENCCipherReferenceImpl::appendBase64Transform() { DOMElement *txfmElt; DSIGTransformBase64 * txfm; XSECnew(txfm, DSIGTransformBase64(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); addTransform(txfm, txfmElt); return txfm; } DSIGTransformXSL * XENCCipherReferenceImpl::appendXSLTransform(DOMNode * stylesheet) { DOMElement *txfmElt; DSIGTransformXSL * txfm; XSECnew(txfm, DSIGTransformXSL(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setStylesheet(stylesheet); addTransform(txfm, txfmElt); return txfm; } DSIGTransformC14n * XENCCipherReferenceImpl::appendCanonicalizationTransform(canonicalizationMethod cm) { DOMElement *txfmElt; DSIGTransformC14n * txfm; XSECnew(txfm, DSIGTransformC14n(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setCanonicalizationMethod(cm); addTransform(txfm, txfmElt); return txfm; } DSIGTransformXPath * XENCCipherReferenceImpl::appendXPathTransform(const char * expr) { DOMElement *txfmElt; DSIGTransformXPath * txfm; XSECnew(txfm, DSIGTransformXPath(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setExpression(expr); addTransform(txfm, txfmElt); return txfm; } DSIGTransformXPathFilter * XENCCipherReferenceImpl::appendXPathFilterTransform(void) { DOMElement *txfmElt; DSIGTransformXPathFilter * txfm; XSECnew(txfm, DSIGTransformXPathFilter(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); addTransform(txfm, txfmElt); mp_env->doPrettyPrint(txfmElt); return txfm; } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XENCCipherReferenceImpl::load(void) { if (mp_cipherReferenceElement == NULL) { // Attempt to load an empty encryptedType element throw XSECException(XSECException::CipherReferenceError, "XENCCipherReference::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_cipherReferenceElement), s_CipherReference)) { throw XSECException(XSECException::CipherReferenceError, "XENCCipherReference::load - called incorrect node"); } // Find the URI attribute mp_uriAttr = mp_cipherReferenceElement->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrURI); if (mp_uriAttr == NULL) { throw XSECException(XSECException::CipherReferenceError, "XENCCipherReference::load - URI attribute not found"); } // See if there are any transforms DOMElement * c = findFirstElementChild(mp_cipherReferenceElement); if (c != NULL) { if (!strEquals(getXENCLocalName(c), s_Transforms)) { throw XSECException(XSECException::CipherReferenceError, "XENCCipherReference::load - Expected Transforms, found something else"); } mp_transformsElement = c; XSECSafeBufferFormatter * formatter; XSECnew(formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); Janitor j_formatter(formatter); mp_transformList = DSIGReference::loadTransforms(c, formatter, mp_env); } } // -------------------------------------------------------------------------------- // Create a blank structure // -------------------------------------------------------------------------------- DOMElement * XENCCipherReferenceImpl::createBlankCipherReference( const XMLCh * URI) { // Clean up if (mp_transformList != NULL) { delete mp_transformList; mp_transformList = NULL; } mp_uriAttr = NULL; // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_CipherReference); mp_cipherReferenceElement = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); // Set the URI Attribute mp_cipherReferenceElement->setAttributeNS(NULL, DSIGConstants::s_unicodeStrURI, URI); // Find the URI mp_uriAttr = mp_cipherReferenceElement->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrURI); if (mp_uriAttr == NULL) { throw XSECException(XSECException::CipherReferenceError, "XENCCipherReference::createBlankReference - URI attribute not found after creation"); } return mp_cipherReferenceElement; } // -------------------------------------------------------------------------------- // Get Interface methods // -------------------------------------------------------------------------------- DSIGTransformList * XENCCipherReferenceImpl::getTransforms(void) const { return mp_transformList; } const XMLCh * XENCCipherReferenceImpl::getURI (void) const { if (mp_uriAttr != NULL) return mp_uriAttr->getNodeValue(); return NULL; } DOMElement * XENCCipherReferenceImpl::getElement(void) const { return mp_cipherReferenceElement; } xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp000644 001751 001751 00000030746 12003301053 025731 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptionMethod := Interface definition for EncryptionMethod element * * $Id: XENCEncryptionMethodImpl.cpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #include #include #include #include #include "XENCEncryptionMethodImpl.hpp" #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // UNICODE Strings // -------------------------------------------------------------------------------- static XMLCh s_EncryptionMethod[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_M, chLatin_e, chLatin_t, chLatin_h, chLatin_o, chLatin_d, chNull, }; static XMLCh s_DigestMethod[] = { chLatin_D, chLatin_i, chLatin_g, chLatin_e, chLatin_s, chLatin_t, chLatin_M, chLatin_e, chLatin_t, chLatin_h, chLatin_o, chLatin_d, chNull }; static XMLCh s_MGF [] = { chLatin_M, chLatin_G, chLatin_F, chNull }; static XMLCh s_OAEPparams [] = { chLatin_O, chLatin_A, chLatin_E, chLatin_P, chLatin_p, chLatin_a, chLatin_r, chLatin_a, chLatin_m, chLatin_s, chNull }; static XMLCh s_KeySize [] = { chLatin_K, chLatin_e, chLatin_y, chLatin_S, chLatin_i, chLatin_z, chLatin_e, chNull }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- XENCEncryptionMethodImpl::XENCEncryptionMethodImpl(const XSECEnv * env) : mp_env(env), mp_encryptionMethodElement(NULL), mp_algorithmAttr(NULL), mp_digestAlgorithmAttr(NULL), mp_mgfAlgorithmAttr(NULL), mp_oaepParamsTextNode(NULL), mp_keySizeTextNode(NULL) { } XENCEncryptionMethodImpl::XENCEncryptionMethodImpl( const XSECEnv * env, DOMElement * element) : mp_env(env), mp_encryptionMethodElement(element), mp_algorithmAttr(NULL), mp_digestAlgorithmAttr(NULL), mp_mgfAlgorithmAttr(NULL), mp_oaepParamsTextNode(NULL), mp_keySizeTextNode(NULL) { } XENCEncryptionMethodImpl::~XENCEncryptionMethodImpl() { } // -------------------------------------------------------------------------------- // Load from DOM // -------------------------------------------------------------------------------- void XENCEncryptionMethodImpl::load() { if (mp_encryptionMethodElement == NULL) { // Attempt to load an empty encryptedType element throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_encryptionMethodElement), s_EncryptionMethod)) { // Attempt to load an empty encryptedData element throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - called on non EncryptionMethod node"); } // Find the type mp_algorithmAttr = mp_encryptionMethodElement->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); // Check for known children DOMElement * c = findFirstElementChild(mp_encryptionMethodElement); while (c != NULL) { if (strEquals(getDSIGLocalName(c), s_DigestMethod)) { mp_digestAlgorithmAttr = c->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); if (mp_digestAlgorithmAttr == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - Cannot find Algorithm Attribute in DigestMethod element"); } } else if (strEquals(getXENC11LocalName(c), s_MGF)) { mp_mgfAlgorithmAttr = c->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); if (mp_mgfAlgorithmAttr == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - Cannot find Algorithm Attribute in xenc11:MGF element"); } } else if (strEquals(getXENCLocalName(c), s_OAEPparams)) { mp_oaepParamsTextNode = NULL; mp_oaepParamsTextNode = findFirstChildOfType(c, DOMNode::TEXT_NODE); if (mp_oaepParamsTextNode == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - Cannot find text value of xenc:OAEPparams element"); } } else if (strEquals(getXENCLocalName(c), s_KeySize)) { mp_keySizeTextNode = NULL; mp_keySizeTextNode = findFirstChildOfType(c, DOMNode::TEXT_NODE); if (mp_keySizeTextNode == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::load - Cannot find text value of xenc:KeySize node"); } } c = findNextElementChild(c); } } // -------------------------------------------------------------------------------- // Create from scratch // -------------------------------------------------------------------------------- DOMElement * XENCEncryptionMethodImpl::createBlankEncryptedMethod(const XMLCh * algorithm) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_EncryptionMethod); mp_encryptionMethodElement = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); // Set the algorithm attribute if (algorithm != NULL) { mp_encryptionMethodElement->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, algorithm); mp_algorithmAttr = mp_encryptionMethodElement->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); } return mp_encryptionMethodElement; } // -------------------------------------------------------------------------------- // Getter functions // -------------------------------------------------------------------------------- const XMLCh * XENCEncryptionMethodImpl::getDigestMethod(void) const { if (mp_digestAlgorithmAttr != NULL) return mp_digestAlgorithmAttr->getNodeValue(); return NULL; } const XMLCh * XENCEncryptionMethodImpl::getMGF(void) const { if (mp_mgfAlgorithmAttr != NULL) return mp_mgfAlgorithmAttr->getNodeValue(); return NULL; } const XMLCh * XENCEncryptionMethodImpl::getOAEPparams(void) const { if (mp_oaepParamsTextNode != NULL) { return mp_oaepParamsTextNode->getNodeValue(); } return NULL; } const XMLCh * XENCEncryptionMethodImpl::getAlgorithm(void) const { if (mp_algorithmAttr != NULL) { return mp_algorithmAttr->getNodeValue(); } return NULL; } int XENCEncryptionMethodImpl::getKeySize(void) const { if(mp_keySizeTextNode != NULL) { const XMLCh * keyVal = mp_keySizeTextNode->getNodeValue(); unsigned int res = 0; if (!XMLString::textToBin(keyVal, res)) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::getKeySize - Cannot convert KeySize to integer"); } return (int) res; } return 0; } // -------------------------------------------------------------------------------- // Setter functions // -------------------------------------------------------------------------------- void XENCEncryptionMethodImpl::setDigestMethod(const XMLCh * method) { if (mp_digestAlgorithmAttr == NULL) { // Need to create if (mp_oaepParamsTextNode == NULL && mp_mgfAlgorithmAttr == NULL && mp_keySizeTextNode == NULL) { mp_env->doPrettyPrint(mp_encryptionMethodElement); } // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, s_DigestMethod); DOMElement *e = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_encryptionMethodElement->appendChild(e); mp_env->doPrettyPrint(mp_encryptionMethodElement); e->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, method); // Set namespace if (prefix[0] == XERCES_CPP_NAMESPACE_QUALIFIER chNull) { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } e->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIDSIG); // Now retrieve for later use mp_digestAlgorithmAttr = e->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); if (mp_digestAlgorithmAttr == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::setDigestMethod - Error creating Algorithm Attribute"); } } else { mp_digestAlgorithmAttr->setNodeValue(method); } } void XENCEncryptionMethodImpl::setMGF(const XMLCh * mgf) { if (mp_mgfAlgorithmAttr == NULL) { // Need to create if (mp_oaepParamsTextNode == NULL && mp_digestAlgorithmAttr == NULL && mp_keySizeTextNode == NULL) { mp_env->doPrettyPrint(mp_encryptionMethodElement); } // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENC11NSPrefix(); makeQName(str, prefix, s_MGF); DOMElement *e = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC11, str.rawXMLChBuffer()); mp_encryptionMethodElement->appendChild(e); mp_env->doPrettyPrint(mp_encryptionMethodElement); e->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, mgf); // Set namespace if (prefix[0] == XERCES_CPP_NAMESPACE_QUALIFIER chNull) { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } e->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIXENC11); // Now retrieve for later use mp_mgfAlgorithmAttr = e->getAttributeNodeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); if (mp_mgfAlgorithmAttr == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionMethod::setMGF - Error creating Algorithm Attribute"); } } else { mp_mgfAlgorithmAttr->setNodeValue(mgf); } } void XENCEncryptionMethodImpl::setOAEPparams(const XMLCh * params) { if (mp_oaepParamsTextNode == NULL) { // Need to create if (mp_mgfAlgorithmAttr == NULL && mp_digestAlgorithmAttr == NULL && mp_keySizeTextNode == NULL) { mp_env->doPrettyPrint(mp_encryptionMethodElement); } // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_OAEPparams); DOMNode* inspoint = NULL; DOMElement *e = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); if (mp_keySizeTextNode != NULL) { inspoint = mp_keySizeTextNode->getParentNode()->getNextSibling(); } else { inspoint = mp_encryptionMethodElement->getFirstChild(); } mp_encryptionMethodElement->insertBefore(e, inspoint); mp_env->doPrettyPrint(mp_encryptionMethodElement); e->appendChild(mp_oaepParamsTextNode = doc->createTextNode(params)); } else { mp_oaepParamsTextNode->setNodeValue(params); } } void XENCEncryptionMethodImpl::setKeySize(int size) { // First map the int to an XMLCh string XMLCh sizeXMLCh[10]; XMLString::binToText((unsigned int) size, sizeXMLCh, 9, 10); if (mp_keySizeTextNode == NULL) { // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_KeySize); DOMElement *e = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); mp_encryptionMethodElement->insertBefore(e, mp_encryptionMethodElement->getFirstChild()); mp_env->doPrettyPrint(mp_encryptionMethodElement); e->appendChild(mp_keySizeTextNode = doc->createTextNode(sizeXMLCh)); } else { mp_keySizeTextNode->setNodeValue(sizeXMLCh); } } xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedKeyImpl.hpp000644 001751 001751 00000010734 12003301053 025044 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedKeyImpl := Implementation for holder object for EncryptedKey * * $Id: XENCEncryptedKeyImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDKEYIMPL_INCLUDE #define XENCENCRYPTEDKEYIMPL_INCLUDE // XSEC Includes #include #include #include "XENCCipherImpl.hpp" #include "XENCEncryptedTypeImpl.hpp" XSEC_DECLARE_XERCES_CLASS(DOMNode); class XENCEncryptedKeyImpl : public XENCEncryptedKey, public XENCEncryptedTypeImpl { public: XENCEncryptedKeyImpl(const XSECEnv * env); XENCEncryptedKeyImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCEncryptedKeyImpl(); void load(void); // Create a blank EncryptedKey DOM structure XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankEncryptedKey(XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value); // KeyInfo Interface methods virtual const XMLCh * getKeyName(void) const {return NULL;} virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_ENCRYPTEDKEY;} // Inherited from XENCEncryptedData - need to re-implement virtual XENCCipherData * getCipherData(void) const {return XENCEncryptedTypeImpl::getCipherData();} virtual DSIGKeyInfoList * getKeyInfoList(void) {return XENCEncryptedTypeImpl::getKeyInfoList();} virtual XENCEncryptionMethod * getEncryptionMethod(void) const {return XENCEncryptedTypeImpl::getEncryptionMethod();} virtual void clearKeyInfo(void) {XENCEncryptedTypeImpl::clearKeyInfo();} virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) {return XENCEncryptedTypeImpl::appendDSAKeyValue(P, Q, G, Y);} virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) {return XENCEncryptedTypeImpl::appendRSAKeyValue(modulus, exponent);} virtual DSIGKeyInfoX509 * appendX509Data(void) {return XENCEncryptedTypeImpl::appendX509Data();} virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) {return XENCEncryptedTypeImpl::appendKeyName(name, isDName);} virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return XENCEncryptedTypeImpl::getElement();} virtual void appendEncryptedKey(XENCEncryptedKey * encryptedKey) {XENCEncryptedTypeImpl::appendEncryptedKey(encryptedKey);} // Get methods virtual const XMLCh * getType(void) const {return XENCEncryptedTypeImpl::getType();} virtual const XMLCh * getMimeType(void) const {return XENCEncryptedTypeImpl::getMimeType();} virtual const XMLCh * getEncoding(void) const {return XENCEncryptedTypeImpl::getEncoding();} // Set methods virtual void setType(const XMLCh * uri) {XENCEncryptedTypeImpl::setType(uri);} virtual void setMimeType(const XMLCh * mimeType) {XENCEncryptedTypeImpl::setMimeType(mimeType);} virtual void setEncoding(const XMLCh * uri) {XENCEncryptedTypeImpl::setEncoding(uri);} // EncryptedKey specific Getter Methods virtual const XMLCh * getCarriedKeyName(void) const; virtual const XMLCh * getRecipient(void) const; // EncryptedKey specific setter methods virtual void setCarriedKeyName(const XMLCh * name); virtual void setRecipient(const XMLCh * recipient); private: // Unimplemented XENCEncryptedKeyImpl(void); XENCEncryptedKeyImpl(const XENCEncryptedKeyImpl &); XENCEncryptedKeyImpl & operator = (const XENCEncryptedKeyImpl &); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_carriedKeyNameTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_recipientAttr; }; #endif /* XENCENCRYPTEDKEYIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherValueImpl.cpp000644 001751 001751 00000011271 12003301053 024635 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherValueImpl := Implementation for CipherValue elements * * $Id: XENCCipherValueImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include "XENCCipherValueImpl.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // String Constants // -------------------------------------------------------------------------------- static XMLCh s_CipherValue[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull, }; // -------------------------------------------------------------------------------- // Constructors/Destructors // -------------------------------------------------------------------------------- XENCCipherValueImpl::XENCCipherValueImpl(const XSECEnv * env) : mp_env(env), mp_cipherValueElement(NULL), mp_cipherString(NULL) { } XENCCipherValueImpl::XENCCipherValueImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_cipherValueElement(node), mp_cipherString(NULL) { } XENCCipherValueImpl::~XENCCipherValueImpl() { if (mp_cipherString != NULL) XSEC_RELEASE_XMLCH(mp_cipherString); } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XENCCipherValueImpl::load(void) { if (mp_cipherValueElement == NULL) { // Attempt to load an empty encryptedType element throw XSECException(XSECException::CipherValueError, "XENCCipherData::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_cipherValueElement), s_CipherValue)) { throw XSECException(XSECException::CipherValueError, "XENCCipherData::load - called incorrect node"); } // Just gather the text children and continue safeBuffer txt; gatherChildrenText(mp_cipherValueElement, txt); // Get a copy mp_cipherString = XMLString::replicate(txt.rawXMLChBuffer()); } // -------------------------------------------------------------------------------- // Create a blank structure // -------------------------------------------------------------------------------- DOMElement * XENCCipherValueImpl::createBlankCipherValue( const XMLCh * value) { // Rest if (mp_cipherString != NULL) { XSEC_RELEASE_XMLCH(mp_cipherString); mp_cipherString = NULL; } // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_CipherValue); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); mp_cipherValueElement = ret; // Append the value ret->appendChild(doc->createTextNode(value)); mp_cipherString = XMLString::replicate(value);; return ret; } // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- const XMLCh * XENCCipherValueImpl::getCipherString(void) const { return mp_cipherString; } void XENCCipherValueImpl::setCipherString(const XMLCh * value) { if (mp_cipherValueElement == NULL) { throw XSECException(XSECException::CipherValueError, "XENCCipherData::setCipherString - called on empty DOM"); } // Find first text child DOMNode * txt = findFirstChildOfType(mp_cipherValueElement, DOMNode::TEXT_NODE); if (txt == NULL) { throw XSECException(XSECException::CipherValueError, "XENCCipherData::setCipherString - Error finding text node"); } txt->setNodeValue(value); if (mp_cipherString != NULL) XSEC_RELEASE_XMLCH(mp_cipherString); mp_cipherString = XMLString::replicate(value); } xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherImpl.hpp000644 001751 001751 00000013004 12003301053 023641 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherImpl := Implementation of the main encryption worker class * * $Id: XENCCipherImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHERIMPL_INCLUDE #define XENCCIPHERIMPL_INCLUDE // XSEC Includes #include #include class safeBuffer; class XSECProvider; class XENCEncryptedDataImpl; class TXFMChain; class XSECEnv; class XSECKeyInfoResolver; class XSECPlatformUtils; class DSIGKeyInfoList; XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMDocumentFragment); class XENCCipherImpl : public XENCCipher { public: virtual ~XENCCipherImpl(); // Implementation for decrypting elements XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * decryptElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * decryptElementDetached(XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * decryptElement(void); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * decryptElementDetached(void); XSECBinTXFMInputStream * decryptToBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ); // Decrypting Keys virtual int decryptKey(XENCEncryptedKey * encryptedKey, XMLByte * rawKey, int maxKeySize); virtual int decryptKey( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * keyNode, XMLByte * rawKey, int maxKeySize ); // Implementation for encryption Elements XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * encryptElement( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * uri = NULL); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * encryptElementContent( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * encryptElementDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * uri = NULL); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * encryptElementContentDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI = NULL); // Encrypt a key virtual XENCEncryptedKey * encryptKey( const unsigned char * keyBuffer, unsigned int keyLen, encryptionMethod em, const XMLCh * algorithmURI = NULL ); // Encrypt octet streams virtual XENCEncryptedData * encryptBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * plainText, encryptionMethod em, const XMLCh * algorithmURI = NULL ); virtual XENCEncryptedData * encryptTXFMChain( TXFMChain * plainText, encryptionMethod em, const XMLCh * algorithmURI = NULL ); // Getter methods XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * getDocument(void) {return mp_doc;} const XMLCh * getXENCNSPrefix(void) const; virtual XENCEncryptedData * getEncryptedData(void); bool getPrettyPrint(void); bool getExclusiveC14nSerialisation(void); // Setter methods void setKey(XSECCryptoKey * key); void setKEK(XSECCryptoKey * key); void setKeyInfoResolver(const XSECKeyInfoResolver * resolver); void setXENCNSPrefix(const XMLCh * prefix); void setPrettyPrint(bool flag); void setExclusiveC14nSerialisation(bool flag); // Creation methods XENCEncryptedData * createEncryptedData(XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value); virtual XENCEncryptedKey * loadEncryptedKey( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * keyNode ); virtual XENCEncryptedData * loadEncryptedData( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * dataNode ); protected: // Initialisation static void Initialise(void); protected: // Protected to prevent direct creation of objects XENCCipherImpl(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc); private: // Internal functions XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentFragment * deSerialise( safeBuffer &content, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * ctx ); XSECCryptoKey * decryptKeyFromKeyInfoList(DSIGKeyInfoList * kil); // Unimplemented constructor XENCCipherImpl(); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; // Document against which this will operate // Current working object XENCEncryptedDataImpl * mp_encryptedData; // Key XSECCryptoKey * mp_key; bool m_keyDerived; // Was this derived or loaded? // KEK XSECCryptoKey * mp_kek; bool m_kekDerived; // Was this derived or loaded? // Environment XSECEnv * mp_env; // Resolvers XSECKeyInfoResolver * mp_keyInfoResolver; // Use exclusive canonicalisation? bool m_useExcC14nSerialisation; friend class XSECProvider; friend class XSECPlatformUtils; }; #endif /* XENCCIPHERIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCAlgorithmHandlerDefault.hpp000644 001751 001751 00000007657 12003301053 026357 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmHandlerDefault := Interface class to define handling of * default encryption algorithms * * $Id: XENCAlgorithmHandlerDefault.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef XENCALGHANDLERDEFAULT_INCLUDE #define XENCALGHANDLERDEFAULT_INCLUDE // XSEC Includes #include #include class TXFMChain; class XENCEncryptionMethod; class XSECCryptoKey; // Xerces class XENCAlgorithmHandlerDefault : public XSECAlgorithmHandler { public: virtual ~XENCAlgorithmHandlerDefault() {}; virtual unsigned int decryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ); virtual bool appendDecryptCipherTXFM( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc ); virtual bool encryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ); virtual XSECCryptoKey * createKeyForURI( const XMLCh * uri, const unsigned char * keyBuffer, unsigned int keyLen ); virtual XSECAlgorithmHandler * clone(void) const; // Unsupported Signature ops virtual unsigned int signToSafeBuffer( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key, unsigned int outputLength, safeBuffer & result ); virtual bool appendSignatureHashTxfm( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key ); virtual bool verifyBase64Signature( TXFMChain * inputBytes, const XMLCh * URI, const char * sig, unsigned int outputLength, XSECCryptoKey * key ); virtual bool appendHashTxfm( TXFMChain * inputBytes, const XMLCh * URI ); private: void mapURIToKey(const XMLCh * uri, XSECCryptoKey * key, XSECCryptoKey::KeyType &kt, XSECCryptoSymmetricKey::SymmetricKeyType &skt, bool &isSymmetricKeyWrap, XSECCryptoSymmetricKey::SymmetricKeyMode &skm, unsigned int& taglen); unsigned int doRSADecryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result); bool doRSAEncryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result); unsigned int doGCMDecryptToSafeBuffer( TXFMChain * cipherText, XSECCryptoKey * key, unsigned int taglen, safeBuffer & result); unsigned int unwrapKeyAES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result); unsigned int unwrapKey3DES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result); bool wrapKeyAES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result); bool wrapKey3DES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result); }; /*\@}*/ #endif /* XENCALGHANDLERDEFAULT_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherDataImpl.hpp000644 001751 001751 00000004564 12003301053 024446 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherDataImpl := Implementation of CipherData elements * * $Id: XENCCipherDataImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCIPHERDATAIMPL_INCLUDE #define XSECCIPHERDATAIMPL_INCLUDE // XSEC Includes #include #include #include "XENCCipherImpl.hpp" class XENCCipherValueImpl; class XENCCipherReferenceImpl; XSEC_DECLARE_XERCES_CLASS(DOMNode); class XENCCipherDataImpl : public XENCCipherData { public: XENCCipherDataImpl(const XSECEnv * env); XENCCipherDataImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCCipherDataImpl(); // Load elements void load(); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankCipherData(XENCCipherData::XENCCipherDataType type, const XMLCh * value); // Interface methods virtual XENCCipherDataType getCipherDataType(void); virtual XENCCipherValue * getCipherValue(void); virtual XENCCipherReference * getCipherReference(void); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) {return mp_cipherDataElement;} private: // Unimplemented constructor XENCCipherDataImpl(); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_cipherDataElement; // Node at head of structure XENCCipherDataType m_cipherDataType; // Is this a value or a reference? XENCCipherValueImpl * mp_cipherValue; // Cipher value node XENCCipherReferenceImpl * mp_cipherReference; // Cipher Reference node }; #endif /* XENCCIPHERDATAIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptionMethodImpl.hpp000644 001751 001751 00000005602 12003301053 025727 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptionMethod := Interface definition for EncryptionMethod element * * $Id: XENCEncryptionMethodImpl.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef XENCENCRYPTIONMETHODIMPL_INCLUDE #define XENCENCRYPTIONMETHODIMPL_INCLUDE // XSEC Includes #include #include class XSECEnv; XSEC_DECLARE_XERCES_CLASS(DOMNode); class XENCEncryptionMethodImpl : public XENCEncryptionMethod { public: XENCEncryptionMethodImpl(const XSECEnv * env); XENCEncryptionMethodImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ); virtual ~XENCEncryptionMethodImpl(); // Load elements void load(); // Create from scratch XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankEncryptedMethod( const XMLCh * algorithm); // Interface const XMLCh * getAlgorithm(void) const; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return mp_encryptionMethodElement;} virtual const XMLCh * getDigestMethod(void) const; virtual const XMLCh * getMGF(void) const; virtual const XMLCh * getOAEPparams(void) const; virtual int getKeySize(void) const; virtual void setDigestMethod(const XMLCh * method); virtual void setMGF(const XMLCh * mgf); virtual void setOAEPparams(const XMLCh * params); virtual void setKeySize(int size); private: // Unimplemented XENCEncryptionMethodImpl(); XENCEncryptionMethodImpl(const XENCEncryptionMethodImpl &); XENCEncryptionMethodImpl & operator = (const XENCEncryptionMethodImpl &); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_encryptionMethodElement; // Node at head of structure XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_algorithmAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_digestAlgorithmAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_mgfAlgorithmAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_oaepParamsTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keySizeTextNode; }; #endif /* XENCENCRYPTIONMETHODIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp000644 001751 001751 00000112227 12147777032 026367 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmHandlerDefault := Interface class to define handling of * default encryption algorithms * * $Id: XENCAlgorithmHandlerDefault.cpp 1482595 2013-05-14 21:24:14Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include #include #include #include "../../utils/XSECAutoPtr.hpp" #include "XENCAlgorithmHandlerDefault.hpp" #include #include XERCES_CPP_NAMESPACE_USE #define _MY_MAX_KEY_SIZE 2048 unsigned char s_3DES_CMS_IV [] = { 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 }; unsigned char s_AES_IV [] = { 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6 }; // -------------------------------------------------------------------------------- // Compare URI to key type // -------------------------------------------------------------------------------- void XENCAlgorithmHandlerDefault::mapURIToKey(const XMLCh * uri, XSECCryptoKey * key, XSECCryptoKey::KeyType &kt, XSECCryptoSymmetricKey::SymmetricKeyType &skt, bool &isSymmetricKeyWrap, XSECCryptoSymmetricKey::SymmetricKeyMode &skm, unsigned int& taglen) { if (key == NULL) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::mapURIToKey - trying to process a NULL key"); } XSECCryptoSymmetricKey * keySymmetric; bool keyOK = false; kt = key->getKeyType(); skt = XSECCryptoSymmetricKey::KEY_NONE; isSymmetricKeyWrap = false; skm = XSECCryptoSymmetricKey::MODE_NONE; taglen = 0; switch (kt) { case XSECCryptoKey::KEY_RSA_PUBLIC : case XSECCryptoKey::KEY_RSA_PAIR : case XSECCryptoKey::KEY_RSA_PRIVATE : keyOK = strEquals(uri, DSIGConstants::s_unicodeStrURIRSA_1_5) || strEquals(uri, DSIGConstants::s_unicodeStrURIRSA_OAEP_MGFP1) || strEquals(uri, DSIGConstants::s_unicodeStrURIRSA_OAEP); break; case XSECCryptoKey::KEY_SYMMETRIC : keySymmetric = (XSECCryptoSymmetricKey *) key; if (keySymmetric != NULL) { skt = keySymmetric->getSymmetricKeyType(); switch (skt) { case XSECCryptoSymmetricKey::KEY_3DES_192 : if (strEquals(uri, DSIGConstants::s_unicodeStrURIKW_3DES)) { keyOK = true; isSymmetricKeyWrap = true; skm = XSECCryptoSymmetricKey::MODE_CBC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURI3DES_CBC)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_CBC; } break; case XSECCryptoSymmetricKey::KEY_AES_128 : if (strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES128) || strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES128_PAD)) { keyOK = true; isSymmetricKeyWrap = true; skm = XSECCryptoSymmetricKey::MODE_ECB; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES128_CBC)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_CBC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES128_GCM)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_GCM; taglen = 16; } break; case XSECCryptoSymmetricKey::KEY_AES_192 : if (strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES192) || strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES192_PAD)) { keyOK = true; isSymmetricKeyWrap = true; skm = XSECCryptoSymmetricKey::MODE_ECB; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES192_CBC)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_CBC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES192_GCM)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_GCM; taglen = 16; } break; case XSECCryptoSymmetricKey::KEY_AES_256 : if (strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES256) || strEquals(uri, DSIGConstants::s_unicodeStrURIKW_AES256_PAD)) { keyOK = true; isSymmetricKeyWrap = true; skm = XSECCryptoSymmetricKey::MODE_ECB; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES256_CBC)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_CBC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES256_GCM)) { keyOK = true; skm = XSECCryptoSymmetricKey::MODE_GCM; taglen = 16; } break; default: break; } } break; default: break; } if (keyOK == false) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::mapURIToKey - key inappropriate for URI"); } } // -------------------------------------------------------------------------------- // AES Key wrap/unwrap // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::unwrapKeyAES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result) { // Cat the encrypted key XMLByte buf[_MY_MAX_KEY_SIZE]; XMLByte aesBuf[16]; XMLByte aesOutBuf[16]; TXFMBase * b = cipherText->getLastTxfm(); unsigned int sz = (unsigned int) b->readBytes(buf, _MY_MAX_KEY_SIZE); if (sz <= 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - AES Wrapped Key not found"); } if (sz == _MY_MAX_KEY_SIZE) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Key to decrypt too big!"); } // Find number of blocks, and ensure we are a multiple of 64 bits if (sz % 8 != 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - AES wrapped key not a multiple of 64"); } // Do the decrypt - this cast will throw if wrong, but we should // not have been able to get through algorithm checks otherwise XSECCryptoSymmetricKey * sk = (XSECCryptoSymmetricKey *) key; int blocks = sz / 8; int n = blocks - 1; for (int j = 5; j >= 0; j--) { for (int i = n ; i > 0 ; --i) { // Gather blocks to decrypt // A memcpy(aesBuf, buf, 8); // Ri memcpy(&aesBuf[8], &buf[8 * i], 8); // A mod t aesBuf[7] ^= ((n * j) + i); // do decrypt sk->decryptInit(false, XSECCryptoSymmetricKey::MODE_ECB); // No padding int sz = sk->decrypt(aesBuf, aesOutBuf, 16, 16); sz += sk->decryptFinish(&aesOutBuf[sz], 16 - sz); if (sz != 16) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Error performing decrypt in AES Unwrap"); } // Copy back to where we are // A memcpy(buf, aesOutBuf, 8); // Ri memcpy(&buf[8 * i], &aesOutBuf[8], 8); } } // Check is valid if (memcmp(buf, s_AES_IV, 8) != 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - decrypt failed - AES IV is not correct"); } // Copy to safebuffer result.sbMemcpyIn(&buf[8], n * 8); return n * 8; } bool XENCAlgorithmHandlerDefault::wrapKeyAES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result) { // get the raw key XMLByte buf[_MY_MAX_KEY_SIZE + 8]; memcpy(buf, s_AES_IV, 8); XMLByte aesBuf[16]; XMLByte aesOutBuf[32]; // Give this an extra block for WinCAPI TXFMBase * b = cipherText->getLastTxfm(); unsigned int sz = (unsigned int) b->readBytes(&buf[8], _MY_MAX_KEY_SIZE); if (sz <= 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Key not found"); } if (sz == _MY_MAX_KEY_SIZE) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Key to encrypt too big!"); } // Find number of blocks, and ensure we are a multiple of 64 bits if (sz % 8 != 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - AES wrapped key not a multiple of 64"); } // Do the decrypt - this cast will throw if wrong, but we should // not have been able to get through algorithm checks otherwise XSECCryptoSymmetricKey * sk = (XSECCryptoSymmetricKey *) key; int n = sz / 8; for (int j = 0; j <= 5; ++j) { for (int i = 1 ; i <= n ; ++i) { // Gather blocks to decrypt // A memcpy(aesBuf, buf, 8); // Ri memcpy(&aesBuf[8], &buf[8 * i], 8); // do encrypt sk->encryptInit(false, XSECCryptoSymmetricKey::MODE_ECB); int sz = sk->encrypt(aesBuf, aesOutBuf, 16, 32); sz += sk->encryptFinish(&aesOutBuf[sz], 32 - sz); if (sz != 16) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Error performing encrypt in AES wrap"); } // Copy back to where we are // A memcpy(buf, aesOutBuf, 8); // A mod t buf[7] ^= ((n * j) + i); // Ri memcpy(&buf[8 * i], &aesOutBuf[8], 8); } } // Now we have to base64 encode XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!b64) { throw XSECException(XSECException::CryptoProviderError, "XENCAlgorithmHandlerDefault - Error getting base64 encoder in AES wrap"); } Janitor j_b64(b64); unsigned char * b64Buffer; int bufLen = ((n + 1) * 8) * 3; XSECnew(b64Buffer, unsigned char[bufLen + 1]);// Overkill ArrayJanitor j_b64Buffer(b64Buffer); b64->encodeInit(); int outputLen = b64->encode (buf, (n+1) * 8, b64Buffer, bufLen); outputLen += b64->encodeFinish(&b64Buffer[outputLen], bufLen - outputLen); b64Buffer[outputLen] = '\0'; // Copy to safebuffer result.sbStrcpyIn((const char *) b64Buffer); return true; } // -------------------------------------------------------------------------------- // DES CMS Key wrap/unwrap // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::unwrapKey3DES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result) { // Perform an unwrap on the key safeBuffer cipherSB; // Cat the encrypted key XMLByte buf[_MY_MAX_KEY_SIZE]; TXFMBase * b = cipherText->getLastTxfm(); unsigned int offset = 0; unsigned int sz = (unsigned int) b->readBytes(buf, _MY_MAX_KEY_SIZE); while (sz > 0) { cipherSB.sbMemcpyIn(offset, buf, sz); offset += sz; sz = (unsigned int) b->readBytes(buf, _MY_MAX_KEY_SIZE); } if (offset > _MY_MAX_KEY_SIZE) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Key to decrypt too big!"); } // Do the decrypt - this cast will throw if wrong, but we should // not have been able to get through algorithm checks otherwise XSECCryptoSymmetricKey * sk = (XSECCryptoSymmetricKey *) key; sk->decryptInit(false, XSECCryptoSymmetricKey::MODE_CBC, s_3DES_CMS_IV); // If key is bigger than this, then we have a problem sz = sk->decrypt(cipherSB.rawBuffer(), buf, offset, _MY_MAX_KEY_SIZE); sz += sk->decryptFinish(&buf[sz], _MY_MAX_KEY_SIZE - sz); if (sz <= 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - Error decrypting key!"); } // We now have the first cut, reverse the cipher text XMLByte buf2[_MY_MAX_KEY_SIZE]; for (unsigned int i = 0; i < sz; ++ i) { buf2[sz - i - 1] = buf[i]; } // decrypt again sk->decryptInit(false); offset = sk->decrypt(buf2, buf, sz, _MY_MAX_KEY_SIZE); offset += sk->decryptFinish(&buf[offset], _MY_MAX_KEY_SIZE - offset); // Calculate the CMS Key Checksum XSECCryptoHash * sha1 = XSECPlatformUtils::g_cryptoProvider->hashSHA1(); if (!sha1) { throw XSECException(XSECException::CryptoProviderError, "XENCAlgorithmHandlerDefault - Error getting SHA-1 object in 3DES unwrap"); } Janitor j_sha1(sha1); sha1->reset(); sha1->hash(buf, offset - 8); sha1->finish(buf2, _MY_MAX_KEY_SIZE); // Compare for (unsigned int j = 0; j < 8; ++j) { if (buf[offset - 8 + j] != buf2[j]) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::unwrapKey3DES - CMS Key Checksum does not match"); } } result.sbMemcpyIn(buf, offset - 8); return offset - 8; } bool XENCAlgorithmHandlerDefault::wrapKey3DES( TXFMChain * cipherText, XSECCryptoKey * key, safeBuffer & result) { // Cat the plaintext key XMLByte buf[_MY_MAX_KEY_SIZE + 16]; TXFMBase * b = cipherText->getLastTxfm(); int offset = 0; unsigned int sz = (unsigned int) b->readBytes(buf, _MY_MAX_KEY_SIZE); if (sz <= 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::wrapKey3DES - Unable to read key"); } if (sz >= _MY_MAX_KEY_SIZE) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::wrapKey3DES - Key to decrypt too big!"); } if (sz % 8 != 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::wrapKey3DES - Key to encrypt not a multiple of 8 bytes"); } // Calculate the CMS Key Checksum // Do the first encrypt XMLByte buf2[_MY_MAX_KEY_SIZE + 16]; XSECCryptoHash * sha1 = XSECPlatformUtils::g_cryptoProvider->hashSHA1(); if (!sha1) { throw XSECException(XSECException::CryptoProviderError, "XENCAlgorithmHandlerDefault - Error getting SHA-1 object in 3DES wrap"); } Janitor j_sha1(sha1); sha1->reset(); sha1->hash(buf, sz); sha1->finish(buf2, _MY_MAX_KEY_SIZE); for (int j = 0; j < 8 ; ++j) buf[sz++] = buf2[j]; // Do the first encrypt - this cast will throw if wrong, but we should // not have been able to get through algorithm checks otherwise XSECCryptoSymmetricKey * sk = (XSECCryptoSymmetricKey *) key; sk->encryptInit(false); // If key is bigger than this, then we have a problem sz = sk->encrypt(buf, buf2, sz, _MY_MAX_KEY_SIZE); sz += sk->encryptFinish(&buf2[sz], _MY_MAX_KEY_SIZE - sz); if (sz <= 0) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::wrapKey3DES - Error encrypting key!"); } // We now have the first cut, reverse the cipher text for (unsigned int i = 0; i < sz; ++ i) { buf[sz - i - 1] = buf2[i]; } // encrypt again sk->encryptInit(false, XSECCryptoSymmetricKey::MODE_CBC, s_3DES_CMS_IV); offset = sk->encrypt(buf, buf2, sz, _MY_MAX_KEY_SIZE); offset += sk->encryptFinish(&buf2[offset], _MY_MAX_KEY_SIZE - offset); // Base64 encode XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!b64) { throw XSECException(XSECException::CryptoProviderError, "XENCAlgorithmHandlerDefault - Error getting base64 encoder in 3DES wrap"); } Janitor j_b64(b64); unsigned char * b64Buffer; int bufLen = (offset + 9) * 3; XSECnew(b64Buffer, unsigned char[bufLen + 1]);// Overkill ArrayJanitor j_b64Buffer(b64Buffer); b64->encodeInit(); int outputLen = b64->encode (&buf2[8], offset-8, b64Buffer, bufLen); outputLen += b64->encodeFinish(&b64Buffer[outputLen], bufLen - outputLen); b64Buffer[outputLen] = '\0'; // Copy to safebuffer result.sbStrcpyIn((const char *) b64Buffer); return true; } // -------------------------------------------------------------------------------- // InputStream decryption // -------------------------------------------------------------------------------- bool XENCAlgorithmHandlerDefault::appendDecryptCipherTXFM( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc ) { // We only support this for bulk Symmetric key algorithms XSECCryptoKey::KeyType kt; XSECCryptoSymmetricKey::SymmetricKeyType skt; bool isKeyWrap = false; XSECCryptoSymmetricKey::SymmetricKeyMode skm; unsigned int taglen; mapURIToKey(encryptionMethod->getAlgorithm(), key, kt, skt, isKeyWrap, skm, taglen); if (kt != XSECCryptoKey::KEY_SYMMETRIC || isKeyWrap == true) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::appendDecryptCipherTXFM - only supports bulk symmetric algorithms"); } if (skm == XSECCryptoSymmetricKey::MODE_GCM) { // GCM doesn't fit the pipelined model of the existing code, so we have a custom // routine that decrypts to a safeBuffer directly. safeBuffer result; unsigned int sz = doGCMDecryptToSafeBuffer(cipherText, key, taglen, result); // Now we hijack the original tansform chain with a safeBuffer-sourced link. TXFMSB* tsb; XSECnew(tsb, TXFMSB(doc)); tsb->setInput(result, sz); cipherText->appendTxfm(tsb); result.cleanseBuffer(); return true; } // Add the decryption TXFM TXFMCipher* tcipher; XSECnew(tcipher, TXFMCipher(doc, key, false)); cipherText->appendTxfm(tcipher); return true; } // -------------------------------------------------------------------------------- // GCM SafeBuffer decryption // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::doGCMDecryptToSafeBuffer( TXFMChain * cipherText, XSECCryptoKey * key, unsigned int taglen, safeBuffer & result) { // Only works with symmetric key if (key->getKeyType() != XSECCryptoKey::KEY_SYMMETRIC) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - GCM Decrypt must use symmetric key"); } // First read in all the data so we can get to the tag. safeBuffer cipherBuf(""); XMLByte inbuf[3072]; unsigned int szTotal = 0, sz = cipherText->getLastTxfm()->readBytes(inbuf, 3072); while (sz > 0) { cipherBuf.sbMemcpyIn(szTotal, inbuf, sz); szTotal += sz; sz = cipherText->getLastTxfm()->readBytes(inbuf, 3072); } if (szTotal <= taglen) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - GCM ciphertext size not large enough to include authentication tag"); } const unsigned char* cipherPtr = cipherBuf.rawBuffer(); // Init the cipher with the tag at the end of the cipher text and omit it from later decryption. szTotal -= taglen; ((XSECCryptoSymmetricKey*) key)->decryptInit(false, XSECCryptoSymmetricKey::MODE_GCM, NULL, cipherPtr + szTotal, taglen); unsigned int plainOffset = 0; do { // Feed the data in at most 2048-byte chunks. sz = ((XSECCryptoSymmetricKey*) key)->decrypt(cipherPtr, inbuf, (szTotal > 2048 ? 2048 : szTotal), 3072); cipherPtr += (szTotal > 2048 ? 2048 : szTotal); szTotal -= (szTotal > 2048 ? 2048 : szTotal); if (sz > 0) { result.sbMemcpyIn(plainOffset, inbuf, sz); plainOffset += sz; } } while (szTotal > 0); // Wrap it up. sz = ((XSECCryptoSymmetricKey*) key)->decryptFinish(inbuf, 3072); if (sz > 0) { result.sbMemcpyIn(plainOffset, inbuf, sz); plainOffset += sz; } // In case any plaintext is left lying around. memset(inbuf, 0, 3072); return plainOffset; } // -------------------------------------------------------------------------------- // RSA SafeBuffer decryption // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::doRSADecryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, DOMDocument * doc, safeBuffer & result) { // Only works with RSA_PRIVATE or PAIR if (key->getKeyType() == XSECCryptoKey::KEY_RSA_PUBLIC) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - RSA Decrypt must use private key"); } // Know this is an RSA key, so just cast XSECCryptoKeyRSA * rsa = (XSECCryptoKeyRSA *) key; // Allocate an output buffer unsigned char * decBuf; XSECnew(decBuf, unsigned char[rsa->getLength()]); ArrayJanitor j_decBuf(decBuf); // Input TXFMBase * b = cipherText->getLastTxfm(); safeBuffer cipherSB; XMLByte buf[1024]; unsigned int offset = 0; unsigned int bytesRead = (unsigned int) b->readBytes(buf, 1024); while (bytesRead > 0) { cipherSB.sbMemcpyIn(offset, buf, bytesRead); offset += bytesRead; bytesRead = (unsigned int) b->readBytes(buf, 1024); } unsigned int decryptLen; // Now we find out what kind of padding if (strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_1_5)) { // Do decrypt decryptLen = rsa->privateDecrypt(cipherSB.rawBuffer(), decBuf, offset, rsa->getLength(), XSECCryptoKeyRSA::PAD_PKCS_1_5, HASH_NONE); } else if (strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_OAEP_MGFP1) || strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_OAEP)) { hashMethod hm; const XMLCh* digmeth = encryptionMethod->getDigestMethod(); // Is this a URI we recognize? if (!digmeth|| !*digmeth) { hm = HASH_SHA1; } else if (!XSECmapURIToHashMethod(digmeth, hm)) { safeBuffer sb; sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown Digest URI : "); sb.sbXMLChCat(digmeth); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } const XMLCh* mgfalg = encryptionMethod->getMGF(); if (mgfalg && *mgfalg) { maskGenerationFunc mgf; if (!XSECmapURIToMaskGenerationFunc(mgfalg, mgf)) { safeBuffer sb; sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown MGF URI : "); sb.sbXMLChCat(mgfalg); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } rsa->setMGF(mgf); } // Read out any OAEP params unsigned char * oaepParamsBuf = NULL; const XMLCh * oaepParams = encryptionMethod->getOAEPparams(); unsigned int sz = 0; if (oaepParams != NULL) { XSECAutoPtrChar oaepParamsStr(oaepParams); unsigned int bufLen = (unsigned int) strlen(oaepParamsStr.get()); oaepParamsBuf = new unsigned char[bufLen]; ArrayJanitor j_oaepParamsBuf(oaepParamsBuf); XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); b64->decodeInit(); sz = b64->decode((unsigned char *) oaepParamsStr.get(), bufLen, oaepParamsBuf, bufLen); sz += b64->decodeFinish(&oaepParamsBuf[sz], bufLen - sz); rsa->setOAEPparams(oaepParamsBuf, sz); } else rsa->setOAEPparams(NULL, 0); decryptLen = rsa->privateDecrypt(cipherSB.rawBuffer(), decBuf, offset, rsa->getLength(), XSECCryptoKeyRSA::PAD_OAEP_MGFP1, hm); } else { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::doRSADecryptToSafeBuffer - Unknown padding type"); } // Copy to output result.sbMemcpyIn(decBuf, decryptLen); memset(decBuf, 0, decryptLen); return decryptLen; } // -------------------------------------------------------------------------------- // SafeBuffer decryption // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::decryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, DOMDocument * doc, safeBuffer & result ) { XSECCryptoKey::KeyType kt; XSECCryptoSymmetricKey::SymmetricKeyType skt; bool isKeyWrap = false; XSECCryptoSymmetricKey::SymmetricKeyMode skm; unsigned int taglen; if (encryptionMethod == NULL) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::decryptToSafeBuffer - Cannot operate with NULL encryption Method"); } // Check the uri against the key type mapURIToKey(encryptionMethod->getAlgorithm(), key, kt, skt, isKeyWrap, skm, taglen); // RSA? if (kt == XSECCryptoKey::KEY_RSA_PAIR || kt == XSECCryptoKey::KEY_RSA_PUBLIC || kt == XSECCryptoKey::KEY_RSA_PRIVATE) { return doRSADecryptToSafeBuffer(cipherText, encryptionMethod, key, doc, result); } // Ensure is symmetric before we continue if (kt != XSECCryptoKey::KEY_SYMMETRIC) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::decryptToSafeBuffer - Not an RSA key, but not symmetric"); } // Key wrap? if (isKeyWrap == true) { if (skt == XSECCryptoSymmetricKey::KEY_AES_128 || skt == XSECCryptoSymmetricKey::KEY_AES_192 || skt == XSECCryptoSymmetricKey::KEY_AES_256) { return unwrapKeyAES(cipherText, key, result); } else if (skt == XSECCryptoSymmetricKey::KEY_3DES_192) { return unwrapKey3DES(cipherText, key, result); } else { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::decryptToSafeBuffer - don't know how to do key wrap for algorithm"); } } if (skm == XSECCryptoSymmetricKey::MODE_GCM) { // GCM doesn't fit the pipelined model of the existing code, so we have a custom // routine that decrypts to a safeBuffer directly. return doGCMDecryptToSafeBuffer(cipherText, key, taglen, result); } // It's symmetric and it's not a key wrap or GCM, so just treat as a block algorithm. TXFMCipher * tcipher; XSECnew(tcipher, TXFMCipher(doc, key, false)); cipherText->appendTxfm(tcipher); // Do the decrypt to the safeBuffer. result.sbStrcpyIn(""); unsigned int offset = 0; XMLByte buf[1024]; TXFMBase * b = cipherText->getLastTxfm(); unsigned int bytesRead = (unsigned int) b->readBytes(buf, 1024); while (bytesRead > 0) { result.sbMemcpyIn(offset, buf, bytesRead); offset += bytesRead; bytesRead = (unsigned int) b->readBytes(buf, 1024); } result[offset] = '\0'; return offset; } // -------------------------------------------------------------------------------- // RSA SafeBuffer encryption // -------------------------------------------------------------------------------- bool XENCAlgorithmHandlerDefault::doRSAEncryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ) { // Only works with RSA_PRIVATE or PAIR if (key->getKeyType() == XSECCryptoKey::KEY_RSA_PRIVATE) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - RSA Encrypt must use public key"); } XSECCryptoKeyRSA * rsa = (XSECCryptoKeyRSA *) key; // Allocate an output buffer unsigned char * encBuf; XSECnew(encBuf, unsigned char[rsa->getLength()]); ArrayJanitor j_encBuf(encBuf); // Input TXFMBase * b = plainText->getLastTxfm(); safeBuffer plainSB; plainSB.isSensitive(); XMLByte buf[1024]; unsigned int offset = 0; unsigned int bytesRead = (unsigned int) b->readBytes(buf, 1024); while (bytesRead > 0) { plainSB.sbMemcpyIn(offset, buf, bytesRead); offset += bytesRead; bytesRead = (unsigned int) b->readBytes(buf, 1024); } unsigned int encryptLen; // Do decrypt if (strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_1_5)) { encryptLen = rsa->publicEncrypt(plainSB.rawBuffer(), encBuf, offset, rsa->getLength(), XSECCryptoKeyRSA::PAD_PKCS_1_5, HASH_NONE); } else if (strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_OAEP_MGFP1) || strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_OAEP)) { hashMethod hm; if (encryptionMethod->getDigestMethod() == NULL) { hm = HASH_SHA1; encryptionMethod->setDigestMethod(DSIGConstants::s_unicodeStrURISHA1); } else if (!XSECmapURIToHashMethod(encryptionMethod->getDigestMethod(), hm)) { safeBuffer sb; sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown Digest URI : "); sb.sbXMLChCat(encryptionMethod->getDigestMethod()); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } const XMLCh* mgfalg = encryptionMethod->getMGF(); if (mgfalg && *mgfalg) { maskGenerationFunc mgf; if (!XSECmapURIToMaskGenerationFunc(mgfalg, mgf)) { safeBuffer sb; sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown MGF URI : "); sb.sbXMLChCat(mgfalg); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } rsa->setMGF(mgf); } else if (rsa->getMGF() != MGF1_SHA1) { safeBuffer sb; if (maskGenerationFunc2URI(sb, rsa->getMGF())) encryptionMethod->setMGF(sb.rawXMLChBuffer()); } // Check for OAEP params int oaepParamsLen = rsa->getOAEPparamsLen(); if (oaepParamsLen > 0) { unsigned char * oaepParamsB64; XSECnew(oaepParamsB64, unsigned char[oaepParamsLen * 2]); ArrayJanitor j_oaepParamsB64(oaepParamsB64); XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); b64->encodeInit(); int sz = b64->encode(rsa->getOAEPparams(), oaepParamsLen, oaepParamsB64, oaepParamsLen *2); sz += b64->encodeFinish(&oaepParamsB64[sz], (oaepParamsLen * 2) - sz); oaepParamsB64[sz] = '\0'; XSECAutoPtrXMLCh xBuf((char *) oaepParamsB64); encryptionMethod->setOAEPparams(xBuf.get()); } encryptLen = rsa->publicEncrypt(plainSB.rawBuffer(), encBuf, offset, rsa->getLength(), XSECCryptoKeyRSA::PAD_OAEP_MGFP1, hm); } else { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::doRSAEncryptToSafeBuffer - Unknown padding type"); } // Now need to base64 encode XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); b64->encodeInit(); encryptLen = b64->encode(encBuf, encryptLen, buf, 1024); result.sbMemcpyIn(buf, encryptLen); unsigned int finalLen = b64->encodeFinish(buf, 1024); result.sbMemcpyIn(encryptLen, buf, finalLen); result[encryptLen + finalLen] = '\0'; // This is a string, so set the buffer correctly result.setBufferType(safeBuffer::BUFFER_CHAR); return true; } // -------------------------------------------------------------------------------- // SafeBuffer encryption // -------------------------------------------------------------------------------- bool XENCAlgorithmHandlerDefault::encryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ) { XSECCryptoKey::KeyType kt; XSECCryptoSymmetricKey::SymmetricKeyType skt; bool isKeyWrap = false; XSECCryptoSymmetricKey::SymmetricKeyMode skm; unsigned int taglen; if (encryptionMethod == NULL) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::encryptToSafeBuffer - Cannot operate with NULL encryption Method"); } // Check the uri against the key type mapURIToKey(encryptionMethod->getAlgorithm(), key, kt, skt, isKeyWrap, skm, taglen); // RSA? if (kt == XSECCryptoKey::KEY_RSA_PRIVATE || kt == XSECCryptoKey::KEY_RSA_PUBLIC || kt == XSECCryptoKey::KEY_RSA_PAIR) { return doRSAEncryptToSafeBuffer(plainText, encryptionMethod, key, doc, result); } // Ensure is symmetric before we continue if (kt != XSECCryptoKey::KEY_SYMMETRIC) { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::encryptToSafeBuffer - Not an RSA key, but not symmetric"); } if (isKeyWrap == true) { if (skt == XSECCryptoSymmetricKey::KEY_AES_128 || skt == XSECCryptoSymmetricKey::KEY_AES_192 || skt == XSECCryptoSymmetricKey::KEY_AES_256) { return wrapKeyAES(plainText, key, result); } if (skt == XSECCryptoSymmetricKey::KEY_3DES_192) { return wrapKey3DES(plainText, key, result); } else { throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault::decryptToSafeBuffer - don't know how to do key wrap for algorithm"); } } // Must be bulk symmetric - do the encryption TXFMCipher *tcipher; XSECnew(tcipher, TXFMCipher(doc, key, true, skm, taglen)); plainText->appendTxfm(tcipher); // Transform to Base64 TXFMBase64 * tb64; XSECnew(tb64, TXFMBase64(doc, false)); plainText->appendTxfm(tb64); // Read into the safeBuffer result = ""; result << plainText->getLastTxfm(); return true; } // -------------------------------------------------------------------------------- // Key Creation // -------------------------------------------------------------------------------- XSECCryptoKey * XENCAlgorithmHandlerDefault::createKeyForURI( const XMLCh * uri, const unsigned char * keyBuffer, unsigned int keyLen ) { XSECCryptoSymmetricKey * sk = NULL; if (strEquals(uri, DSIGConstants::s_unicodeStrURI3DES_CBC)) { if (keyLen < 192 / 8) throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - key size was invalid"); sk = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES128_CBC) || strEquals(uri, DSIGConstants::s_unicodeStrURIAES128_GCM)) { if (keyLen < 128 / 8) throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - key size was invalid"); sk = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES192_CBC) || strEquals(uri, DSIGConstants::s_unicodeStrURIAES192_GCM)) { if (keyLen < 192 / 8) throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - key size was invalid"); sk = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_192); } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIAES256_CBC) || strEquals(uri, DSIGConstants::s_unicodeStrURIAES256_GCM)) { if (keyLen < 256 / 8) throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - key size was invalid"); sk = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); } if (sk != NULL) { sk->setKey(keyBuffer, keyLen); return sk; } throw XSECException(XSECException::CipherError, "XENCAlgorithmHandlerDefault - URI Provided, but cannot create associated key"); } // -------------------------------------------------------------------------------- // Clone // -------------------------------------------------------------------------------- XSECAlgorithmHandler * XENCAlgorithmHandlerDefault::clone(void) const { XENCAlgorithmHandlerDefault * ret; XSECnew(ret, XENCAlgorithmHandlerDefault); return ret; } // -------------------------------------------------------------------------------- // Unsupported operations // -------------------------------------------------------------------------------- unsigned int XENCAlgorithmHandlerDefault::signToSafeBuffer( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key, unsigned int outputLength, safeBuffer & result) { throw XSECException(XSECException::AlgorithmMapperError, "XENCAlgorithmHandlerDefault - Signature operations not supported"); } bool XENCAlgorithmHandlerDefault::appendSignatureHashTxfm( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key) { throw XSECException(XSECException::AlgorithmMapperError, "XENCAlgorithmHandlerDefault - Signature operations not supported"); } bool XENCAlgorithmHandlerDefault::verifyBase64Signature( TXFMChain * inputBytes, const XMLCh * URI, const char * sig, unsigned int outputLength, XSECCryptoKey * key) { throw XSECException(XSECException::AlgorithmMapperError, "XENCAlgorithmHandlerDefault - Signature operations not supported"); } bool XENCAlgorithmHandlerDefault::appendHashTxfm( TXFMChain * inputBytes, const XMLCh * URI) { throw XSECException(XSECException::AlgorithmMapperError, "XENCAlgorithmHandlerDefault - Hash operations not supported"); } xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedDataImpl.cpp000644 001751 001751 00000006764 12003301053 025170 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedDataImpl := Implementation for holder object for EncryptedData * * $Id: XENCEncryptedDataImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include "XENCCipherImpl.hpp" #include "XENCEncryptedDataImpl.hpp" #include "XENCCipherDataImpl.hpp" #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // UNICODE Strings // -------------------------------------------------------------------------------- static XMLCh s_EncryptedData[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_e, chLatin_d, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull, }; // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XENCEncryptedDataImpl::XENCEncryptedDataImpl(const XSECEnv * env) : XENCEncryptedTypeImpl(env) { } XENCEncryptedDataImpl::XENCEncryptedDataImpl(const XSECEnv * env, DOMElement * node) : XENCEncryptedTypeImpl(env, node) { } XENCEncryptedDataImpl::~XENCEncryptedDataImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XENCEncryptedDataImpl::load(void) { if (mp_encryptedTypeElement == NULL) { // Attempt to load an empty encryptedData element throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedData::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_encryptedTypeElement), s_EncryptedData)) { // Attempt to load an empty encryptedData element throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedData::load - called on non EncryptedData node"); } // Now call the virtual function we overloaded to get here. XENCEncryptedTypeImpl::load(); } // -------------------------------------------------------------------------------- // Create from scratch // -------------------------------------------------------------------------------- DOMElement * XENCEncryptedDataImpl::createBlankEncryptedData( XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value) { return createBlankEncryptedType(s_EncryptedData, type, algorithm, value); } // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedTypeImpl.hpp000644 001751 001751 00000011771 12003301053 025237 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedTypeImpl := Implementation of the EncryptedType interface * element * * $Id: XENCEncryptedTypeImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDTYPEIMPL_INCLUDE #define XENCENCRYPTEDTYPEIMPL_INCLUDE // XSEC Includes #include #include #include // Forward declarations XSEC_DECLARE_XERCES_CLASS(DOMNode); class XENCCipherDataImpl; class XENCEncryptionMethodImpl; class TXFMChain; class XSECEnv; class XENCEncryptedTypeImpl : public XENCEncryptedType { public: XENCEncryptedTypeImpl(const XSECEnv * env); XENCEncryptedTypeImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCEncryptedTypeImpl(); // Load elements void load(); // Create from scratch. LocalName is the name of the owning element XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankEncryptedType( XMLCh * localName, XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value); // Interface Methods virtual XENCCipherData * getCipherData(void) const; virtual DSIGKeyInfoList * getKeyInfoList(void) {return &m_keyInfoList;} virtual XENCEncryptionMethod * getEncryptionMethod(void) const; virtual void clearKeyInfo(void); /** * \brief Append a DSA KeyValue element * * Add a new KeyInfo element for a DSA Value * * @param P Base64 encoded value of P * @param Q Base64 encoded value of Q * @param G Base64 encoded value of G * @param Y Base64 encoded value of Y * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y); /** * \brief Append a RSA KeyValue element * * Add a new KeyInfo element for a RSA Value * * @param modulus Base64 encoded value of the modulus * @param exponent Base64 encoded value of exponent * @returns A pointer to the created object. */ virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent); /** * \brief Append a X509Data element. * * Add a new KeyInfo element for X509 data. * * @note The added element is empty. The caller must make use of the * returned object to set the required values. * * @returns A pointer to the created object. */ virtual DSIGKeyInfoX509 * appendX509Data(void); virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false); virtual void appendEncryptedKey(XENCEncryptedKey * encryptedKey); // Get methods virtual const XMLCh * getType(void) const; virtual const XMLCh * getMimeType(void) const; virtual const XMLCh * getEncoding(void) const; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return mp_encryptedTypeElement;}; // Set methods virtual void setType(const XMLCh * uri); virtual void setMimeType(const XMLCh * mimeType); virtual void setEncoding(const XMLCh * uri); protected: // Create the txfm list - gives as output a TXFM chain with // the output being the raw encrypted data TXFMChain * createCipherTXFMChain(void); // Worker function to start building the KeyInfo list void createKeyInfoElement(void); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_encryptedTypeElement; // Node at head of structure XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_keyInfoElement; // Any underlying KeyInfo XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_cipherDataElement; // CipherData structure XENCCipherDataImpl * mp_cipherData; XENCEncryptionMethodImpl * mp_encryptionMethod; // Hold the XML Digital Signature KeyInfo list DSIGKeyInfoList m_keyInfoList; // Type URI XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_typeAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_mimeTypeAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_encodingAttr; friend class XENCCipherImpl; private: // Un-implemented XENCEncryptedTypeImpl(); XENCEncryptedTypeImpl(const XENCEncryptedTypeImpl &); XENCEncryptedTypeImpl & operator = (const XENCEncryptedTypeImpl &); }; #endif /* XENCENCRYPTEDTYPEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherDataImpl.cpp000644 001751 001751 00000014013 12003301053 024427 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherDataImpl := Implementation of CipherData elements * * $Id: XENCCipherDataImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include "XENCCipherDataImpl.hpp" #include "XENCCipherValueImpl.hpp" #include "XENCCipherReferenceImpl.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // String Constants // -------------------------------------------------------------------------------- static XMLCh s_CipherData[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull, }; static XMLCh s_CipherValue[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull, }; static XMLCh s_CipherReference[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_R, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull, }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- XENCCipherDataImpl::XENCCipherDataImpl(const XSECEnv * env) : mp_env(env), mp_cipherDataElement(NULL), mp_cipherValue(NULL), mp_cipherReference(NULL) { } XENCCipherDataImpl::XENCCipherDataImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_cipherDataElement(node), mp_cipherValue(NULL), mp_cipherReference(NULL) { } XENCCipherDataImpl::~XENCCipherDataImpl() { if (mp_cipherValue != NULL) delete mp_cipherValue; if (mp_cipherReference != NULL) delete mp_cipherReference; } // -------------------------------------------------------------------------------- // Load DOM // -------------------------------------------------------------------------------- void XENCCipherDataImpl::load() { if (mp_cipherDataElement == NULL) { // Attempt to load an empty encryptedType element throw XSECException(XSECException::CipherDataError, "XENCCipherData::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_cipherDataElement), s_CipherData)) { throw XSECException(XSECException::CipherDataError, "XENCCipherData::load - called incorrect node"); } // Find out whether this is a CipherValue or CipherReference and load // appropriately DOMElement *tmpElt = findFirstElementChild(mp_cipherDataElement); if (tmpElt != NULL && strEquals(getXENCLocalName(tmpElt), s_CipherValue)) { m_cipherDataType = VALUE_TYPE; XSECnew(mp_cipherValue, XENCCipherValueImpl(mp_env, tmpElt)); mp_cipherValue->load(); } else if (tmpElt != NULL && strEquals(getXENCLocalName(tmpElt), s_CipherReference)) { m_cipherDataType = REFERENCE_TYPE; XSECnew(mp_cipherReference, XENCCipherReferenceImpl(mp_env, tmpElt)); mp_cipherReference->load(); } else { throw XSECException(XSECException::ExpectedXENCChildNotFound, "XENCCipherData::load - expected or "); } } // -------------------------------------------------------------------------------- // Create a blank structure // -------------------------------------------------------------------------------- DOMElement * XENCCipherDataImpl::createBlankCipherData( XENCCipherData::XENCCipherDataType type, const XMLCh * value) { // Reset if (mp_cipherValue != NULL) { delete mp_cipherValue; mp_cipherValue = NULL; } m_cipherDataType = NO_TYPE; // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_CipherData); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); mp_cipherDataElement = ret; mp_env->doPrettyPrint(ret); // Set the type if (type == VALUE_TYPE) { // Should also set in the DOM m_cipherDataType = VALUE_TYPE; // Create the Cipher Value XSECnew(mp_cipherValue, XENCCipherValueImpl(mp_env)); DOMNode * cipherValueNode = mp_cipherValue->createBlankCipherValue(value); ret->appendChild(cipherValueNode); mp_env->doPrettyPrint(ret); } else if (type == REFERENCE_TYPE) { m_cipherDataType = REFERENCE_TYPE; // Create the Cipher Reference XSECnew(mp_cipherReference, XENCCipherReferenceImpl(mp_env)); DOMNode * cipherReferenceNode = mp_cipherReference->createBlankCipherReference(value); ret->appendChild(cipherReferenceNode); mp_env->doPrettyPrint(ret); } return ret; } // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- // Interface methods XENCCipherDataImpl::XENCCipherDataType XENCCipherDataImpl::getCipherDataType(void) { return m_cipherDataType; } XENCCipherValue * XENCCipherDataImpl::getCipherValue(void) { return mp_cipherValue; } XENCCipherReference * XENCCipherDataImpl::getCipherReference(void) { return mp_cipherReference; } xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedDataImpl.hpp000644 001751 001751 00000007621 12003301053 025166 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedDataImpl := Implementation for holder object for EncryptedData * * $Id: XENCEncryptedDataImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCENCRYPTEDDATAIMPL_INCLUDE #define XENCENCRYPTEDDATAIMPL_INCLUDE // XSEC Includes #include #include #include "XENCCipherImpl.hpp" #include "XENCEncryptedTypeImpl.hpp" XSEC_DECLARE_XERCES_CLASS(DOMNode); class XENCEncryptedDataImpl : public XENCEncryptedData, public XENCEncryptedTypeImpl { public: XENCEncryptedDataImpl(const XSECEnv * env); XENCEncryptedDataImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCEncryptedDataImpl(); void load(void); // Create a blank EncryptedData DOM structure XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankEncryptedData(XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value); // Interface methods // Inherited from XENCEncryptedData - need to re-implement virtual XENCCipherData * getCipherData(void) const {return XENCEncryptedTypeImpl::getCipherData();} virtual DSIGKeyInfoList * getKeyInfoList(void) {return XENCEncryptedTypeImpl::getKeyInfoList();} virtual XENCEncryptionMethod * getEncryptionMethod(void) const {return XENCEncryptedTypeImpl::getEncryptionMethod();} virtual void clearKeyInfo(void) {XENCEncryptedTypeImpl::clearKeyInfo();} virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) {return XENCEncryptedTypeImpl::appendDSAKeyValue(P, Q, G, Y);} virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) {return XENCEncryptedTypeImpl::appendRSAKeyValue(modulus, exponent);} virtual DSIGKeyInfoX509 * appendX509Data(void) {return XENCEncryptedTypeImpl::appendX509Data();} virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) {return XENCEncryptedTypeImpl::appendKeyName(name, isDName);} virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return XENCEncryptedTypeImpl::getElement();} virtual void appendEncryptedKey(XENCEncryptedKey * encryptedKey) {XENCEncryptedTypeImpl::appendEncryptedKey(encryptedKey);} // Get methods virtual const XMLCh * getType(void) const {return XENCEncryptedTypeImpl::getType();} virtual const XMLCh * getMimeType(void) const {return XENCEncryptedTypeImpl::getMimeType();} virtual const XMLCh * getEncoding(void) const {return XENCEncryptedTypeImpl::getEncoding();} // Set methods virtual void setType(const XMLCh * uri) {XENCEncryptedTypeImpl::setType(uri);} virtual void setMimeType(const XMLCh * mimeType) {XENCEncryptedTypeImpl::setMimeType(mimeType);} virtual void setEncoding(const XMLCh * uri) {XENCEncryptedTypeImpl::setEncoding(uri);} private: // Unimplemented XENCEncryptedDataImpl(void); XENCEncryptedDataImpl(const XENCEncryptedDataImpl &); XENCEncryptedDataImpl & operator = (const XENCEncryptedDataImpl &); }; #endif /* XENCENCRYPTEDDATAIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherValueImpl.hpp000644 001751 001751 00000004353 12003301053 024645 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherValueImpl := Implementation for CipherValue elements * * $Id: XENCCipherValueImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHERVALUEIMPL_INCLUDE #define XENCCIPHERVALUEIMPL_INCLUDE // XSEC Includes #include #include #include "XENCCipherImpl.hpp" XSEC_DECLARE_XERCES_CLASS(DOMNode); class XSECEnv; class XENCCipherValueImpl : public XENCCipherValue { public: XENCCipherValueImpl(const XSECEnv * env); XENCCipherValueImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCCipherValueImpl(); // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankCipherValue(const XMLCh * value); // Interface methods virtual const XMLCh * getCipherString(void) const; virtual void setCipherString(const XMLCh * value); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const {return mp_cipherValueElement;} private: // Unimplemented constructors XENCCipherValueImpl(const XENCCipherValueImpl &); XENCCipherValueImpl & operator = (const XENCCipherValueImpl &); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_cipherValueElement; // This is held as a string, not a node as we might have multiple text // nodes making up the string XMLCh * mp_cipherString; }; #endif /* XENCCIPHERVALUEIMPL_INCLUDE */ xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedTypeImpl.cpp000644 001751 001751 00000034714 12003301053 025234 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedTypeImpl := Implementation of the EncryptedType interface * element * * $Id: XENCEncryptedTypeImpl.cpp 1350038 2012-06-13 22:21:29Z scantor $ * */ #include #include "XENCCipherImpl.hpp" #include "XENCCipherDataImpl.hpp" #include "XENCEncryptedTypeImpl.hpp" #include "XENCEncryptionMethodImpl.hpp" #include "../../utils/XSECAutoPtr.hpp" #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // UNICODE Strings // -------------------------------------------------------------------------------- static XMLCh s_EncryptionMethod[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_M, chLatin_e, chLatin_t, chLatin_h, chLatin_o, chLatin_d, chNull, }; static XMLCh s_KeyInfo[] = { chLatin_K, chLatin_e, chLatin_y, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chNull, }; static XMLCh s_CipherData[] = { chLatin_C, chLatin_i, chLatin_p, chLatin_h, chLatin_e, chLatin_r, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull, }; static XMLCh s_Type[] = { chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; static XMLCh s_MimeType[] = { chLatin_M, chLatin_i, chLatin_m, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; static XMLCh s_Encoding[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- XENCEncryptedTypeImpl::XENCEncryptedTypeImpl(const XSECEnv * env) : mp_env(env), mp_encryptedTypeElement(NULL), mp_keyInfoElement(NULL), mp_cipherDataElement(NULL), mp_cipherData(NULL), mp_encryptionMethod(NULL), m_keyInfoList(env), mp_typeAttr(NULL), mp_mimeTypeAttr(NULL), mp_encodingAttr(NULL) { } XENCEncryptedTypeImpl::XENCEncryptedTypeImpl(const XSECEnv * env, DOMElement * node) : mp_env(env), mp_encryptedTypeElement(node), mp_keyInfoElement(NULL), mp_cipherDataElement(NULL), mp_cipherData(NULL), mp_encryptionMethod(NULL), m_keyInfoList(env), mp_typeAttr(NULL), mp_mimeTypeAttr(NULL), mp_encodingAttr(NULL) { } XENCEncryptedTypeImpl::~XENCEncryptedTypeImpl() { if (mp_cipherData != NULL) delete mp_cipherData; if (mp_encryptionMethod != NULL) delete mp_encryptionMethod; } // -------------------------------------------------------------------------------- // Load DOM Structures // -------------------------------------------------------------------------------- void XENCEncryptedTypeImpl::load() { if (mp_encryptedTypeElement == NULL) { // Attempt to load an empty encryptedType element throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedType::load - called on empty DOM"); } // Type mp_typeAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Type); // MimeType mp_mimeTypeAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_MimeType); // Encoding mp_encodingAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Encoding); // Don't know what the node name should be (held by super class), // so go straight to the children DOMElement *tmpElt = (DOMElement *) findFirstChildOfType(mp_encryptedTypeElement, DOMNode::ELEMENT_NODE); if (tmpElt != NULL && strEquals(getXENCLocalName(tmpElt), s_EncryptionMethod)) { XSECnew(mp_encryptionMethod, XENCEncryptionMethodImpl(mp_env, tmpElt)); mp_encryptionMethod->load(); tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL && strEquals(getDSIGLocalName(tmpElt), s_KeyInfo)) { // Load mp_keyInfoElement = tmpElt; m_keyInfoList.loadListFromXML(tmpElt); // Find the next node tmpElt = findNextElementChild(tmpElt); } if (tmpElt != NULL && strEquals(getXENCLocalName(tmpElt), s_CipherData)) { mp_cipherDataElement = tmpElt; XSECnew(mp_cipherData, XENCCipherDataImpl(mp_env, tmpElt)); mp_cipherData->load(); tmpElt = findNextElementChild(tmpElt); } else { throw XSECException(XSECException::ExpectedXENCChildNotFound, "Expected child of "); } // Should check for EncryptionProperties } // -------------------------------------------------------------------------------- // Create a blank structure // -------------------------------------------------------------------------------- DOMElement * XENCEncryptedTypeImpl::createBlankEncryptedType( XMLCh * localName, XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value) { // Reset mp_cipherData = NULL; mp_encryptionMethod = NULL; // Get some setup values safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getXENCNSPrefix(); makeQName(str, prefix, localName); mp_encryptedTypeElement = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); // Set namespace if (prefix[0] == XERCES_CPP_NAMESPACE_QUALIFIER chNull) { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } mp_encryptedTypeElement->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIXENC); mp_env->doPrettyPrint(mp_encryptedTypeElement); // Create the EncryptionMethod if (algorithm != NULL) { XSECnew(mp_encryptionMethod, XENCEncryptionMethodImpl(mp_env)); DOMNode * encryptionMethodNode = mp_encryptionMethod->createBlankEncryptedMethod(algorithm); mp_encryptedTypeElement->appendChild(encryptionMethodNode); mp_env->doPrettyPrint(mp_encryptedTypeElement); } // Create the cipher Data XSECnew(mp_cipherData, XENCCipherDataImpl(mp_env)); mp_cipherDataElement = mp_cipherData->createBlankCipherData(type, value); // Add to EncryptedType mp_encryptedTypeElement->appendChild(mp_cipherDataElement); mp_env->doPrettyPrint(mp_encryptedTypeElement); return mp_encryptedTypeElement; } // -------------------------------------------------------------------------------- // Create a txfm chain for this transform list // -------------------------------------------------------------------------------- TXFMChain * XENCEncryptedTypeImpl::createCipherTXFMChain(void) { if (mp_cipherData->getCipherDataType() == XENCCipherData::VALUE_TYPE) { TXFMChain * chain; // Given we already have this in memory, we transcode to // local code page and then transform XSECAutoPtrChar b64(mp_cipherData->getCipherValue()->getCipherString()); try { TXFMSB *sb; XSECnew(sb, TXFMSB(mp_env->getParentDocument())); safeBuffer temp(b64.get()); sb->setInput(temp); // Create a chain XSECnew(chain, TXFMChain(sb)); // Create a base64 decoder TXFMBase64 * tb64; XSECnew(tb64, TXFMBase64(mp_env->getParentDocument())); chain->appendTxfm(tb64); return chain; } catch (...) { throw; } } else if (mp_cipherData->getCipherDataType() == XENCCipherData::REFERENCE_TYPE) { TXFMChain * chain; TXFMBase * b = DSIGReference::getURIBaseTXFM(mp_env->getParentDocument(), mp_cipherData->getCipherReference()->getURI(), mp_env); chain = DSIGReference::createTXFMChainFromList(b, mp_cipherData->getCipherReference()->getTransforms()); Janitor j_chain(chain); if (chain->getLastTxfm()->getOutputType() == TXFMBase::DOM_NODES) { TXFMC14n * c14n; XSECnew(c14n, TXFMC14n(mp_env->getParentDocument())); chain->appendTxfm(c14n); } j_chain.release(); return chain; } else { throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedType::createDecryptionTXFMChain - Unknown type of CipherData"); } } // -------------------------------------------------------------------------------- // Get Methods // -------------------------------------------------------------------------------- XENCCipherData * XENCEncryptedTypeImpl::getCipherData(void) const { return mp_cipherData; } XENCEncryptionMethod * XENCEncryptedTypeImpl::getEncryptionMethod(void) const { return mp_encryptionMethod; } // -------------------------------------------------------------------------------- // KeyInfo elements // -------------------------------------------------------------------------------- void XENCEncryptedTypeImpl::clearKeyInfo(void) { if (mp_keyInfoElement == NULL) return; if (mp_encryptedTypeElement->removeChild(mp_keyInfoElement) != mp_keyInfoElement) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Attempted to remove KeyInfo node but it is no longer a child of "); } mp_keyInfoElement->release(); // No longer required mp_keyInfoElement = NULL; // Clear out the list m_keyInfoList.empty(); } void XENCEncryptedTypeImpl::createKeyInfoElement(void) { if (mp_keyInfoElement != NULL) return; safeBuffer str; const XMLCh * prefixNS = mp_env->getDSIGNSPrefix(); makeQName(str, prefixNS, "KeyInfo"); mp_keyInfoElement = m_keyInfoList.createKeyInfo(); // Place the node before the CipherData node if (mp_cipherDataElement == NULL) { throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedTypeImpl::createKeyInfoElement - unable to find CipherData node"); } mp_encryptedTypeElement->insertBefore(mp_keyInfoElement, mp_cipherDataElement); if (mp_env->getPrettyPrintFlag() == true) mp_encryptedTypeElement->insertBefore(mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL), mp_cipherDataElement); // Need to add the DS namespace if (prefixNS[0] == '\0') { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefixNS); } mp_keyInfoElement->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIDSIG); } DSIGKeyInfoValue * XENCEncryptedTypeImpl::appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) { createKeyInfoElement(); return m_keyInfoList.appendDSAKeyValue(P, Q, G, Y); } DSIGKeyInfoValue * XENCEncryptedTypeImpl::appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) { createKeyInfoElement(); return m_keyInfoList.appendRSAKeyValue(modulus, exponent); } DSIGKeyInfoX509 * XENCEncryptedTypeImpl::appendX509Data(void) { createKeyInfoElement(); return m_keyInfoList.appendX509Data(); } DSIGKeyInfoName * XENCEncryptedTypeImpl::appendKeyName(const XMLCh * name, bool isDName) { createKeyInfoElement(); return m_keyInfoList.appendKeyName(name, isDName); } void XENCEncryptedTypeImpl::appendEncryptedKey(XENCEncryptedKey * encryptedKey) { createKeyInfoElement(); m_keyInfoList.addAndInsertKeyInfo(encryptedKey); } // -------------------------------------------------------------------------------- // Type URI handling // -------------------------------------------------------------------------------- const XMLCh * XENCEncryptedTypeImpl::getType(void) const { if (mp_typeAttr != NULL) return mp_typeAttr->getNodeValue(); return NULL; } void XENCEncryptedTypeImpl::setType(const XMLCh * uri) { if (mp_typeAttr != NULL) { mp_typeAttr->setNodeValue(uri); } else { // Need to create the node mp_encryptedTypeElement->setAttributeNS(NULL, s_Type, uri); mp_typeAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Type); if (mp_typeAttr == NULL) { throw XSECException(XSECException::InternalError, "XENCEncryptedTypeImpl::setTypeURI - Cannot find the attribute I just added"); } } } // -------------------------------------------------------------------------------- // MimeType handling // -------------------------------------------------------------------------------- const XMLCh * XENCEncryptedTypeImpl::getMimeType(void) const { if (mp_mimeTypeAttr != NULL) return mp_mimeTypeAttr->getNodeValue(); return NULL; } void XENCEncryptedTypeImpl::setMimeType(const XMLCh * mimeType) { if (mp_mimeTypeAttr != NULL) { mp_mimeTypeAttr->setNodeValue(mimeType); } else { // Need to create the node mp_encryptedTypeElement->setAttributeNS(NULL, s_MimeType, mimeType); mp_mimeTypeAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_MimeType); if (mp_mimeTypeAttr == NULL) { throw XSECException(XSECException::InternalError, "XENCEncryptedTypeImpl::setMimeType - Cannot find the attribute I just added"); } } } // -------------------------------------------------------------------------------- // Encoding handling // -------------------------------------------------------------------------------- const XMLCh * XENCEncryptedTypeImpl::getEncoding(void) const { if (mp_encodingAttr != NULL) return mp_encodingAttr->getNodeValue(); return NULL; } void XENCEncryptedTypeImpl::setEncoding(const XMLCh * uri) { if (mp_encodingAttr != NULL) { mp_encodingAttr->setNodeValue(uri); } else { // Need to create the node mp_encryptedTypeElement->setAttributeNS(NULL, s_Encoding, uri); mp_encodingAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Encoding); if (mp_encodingAttr == NULL) { throw XSECException(XSECException::InternalError, "XENCEncryptedTypeImpl::setEncodingURI - Cannot find the attribute I just added"); } } } xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherImpl.cpp000644 001751 001751 00000104110 12157707211 023653 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherImpl := Implementation of the main encryption worker class * * $Id: XENCCipherImpl.cpp 1493962 2013-06-17 22:32:41Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XENCCipherImpl.hpp" #include "XENCEncryptedDataImpl.hpp" #include "XENCEncryptedKeyImpl.hpp" #include "XENCEncryptionMethodImpl.hpp" #include "XENCAlgorithmHandlerDefault.hpp" #include #include #include #include #include #include // With all the characters - just uplift entire thing XERCES_CPP_NAMESPACE_USE #include using std::cout; // -------------------------------------------------------------------------------- // Constant Strings // -------------------------------------------------------------------------------- const XMLCh s_tagname[] = { chLatin_f, chLatin_r, chLatin_a, chLatin_g, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh s_noData[] = { chLatin_n, chLatin_o, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull }; const XMLCh s_ds[] = { chLatin_d, chLatin_s, chNull }; // -------------------------------------------------------------------------------- // Constructors // -------------------------------------------------------------------------------- XENCCipherImpl::XENCCipherImpl(DOMDocument * doc) : mp_doc(doc), mp_encryptedData(NULL), mp_key(NULL), mp_kek(NULL), mp_keyInfoResolver(NULL) { XSECnew(mp_env, XSECEnv(doc)); mp_env->setDSIGNSPrefix(s_ds); m_keyDerived = false; m_kekDerived = false; m_useExcC14nSerialisation = true; } XENCCipherImpl::~XENCCipherImpl() { if (mp_encryptedData != NULL) delete mp_encryptedData; if (mp_key != NULL) delete mp_key; if (mp_kek != NULL) delete mp_kek; if (mp_env != NULL) delete mp_env; if (mp_keyInfoResolver != NULL) delete mp_keyInfoResolver; } // -------------------------------------------------------------------------------- // Initialiser // -------------------------------------------------------------------------------- void XENCCipherImpl::Initialise(void) { XENCAlgorithmHandlerDefault def; // Register default encryption algorithm handlers XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURI3DES_CBC, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES128_CBC, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES192_CBC, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES256_CBC, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES128_GCM, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES192_GCM, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIAES256_GCM, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_3DES, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES128, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES192, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES256, def); //XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES128_PAD, def); //XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES192_PAD, def); //XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIKW_AES256_PAD, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_1_5, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_OAEP_MGFP1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_OAEP, def); } // -------------------------------------------------------------------------------- // Set/get the namespace prefix to be used when creating nodes // -------------------------------------------------------------------------------- void XENCCipherImpl::setXENCNSPrefix(const XMLCh * prefix) { mp_env->setXENCNSPrefix(prefix); } const XMLCh * XENCCipherImpl::getXENCNSPrefix(void) const { return mp_env->getXENCNSPrefix(); } // -------------------------------------------------------------------------------- // Key Info resolvers // -------------------------------------------------------------------------------- void XENCCipherImpl::setKeyInfoResolver(const XSECKeyInfoResolver * resolver) { if (mp_keyInfoResolver != NULL) delete mp_keyInfoResolver; mp_keyInfoResolver = resolver->clone(); } // -------------------------------------------------------------------------------- // Key Info resolvers // -------------------------------------------------------------------------------- XENCEncryptedData * XENCCipherImpl::getEncryptedData(void) { return mp_encryptedData; } // -------------------------------------------------------------------------------- // Keys // -------------------------------------------------------------------------------- void XENCCipherImpl::setKey(XSECCryptoKey * key) { if (mp_key != NULL) delete mp_key; mp_key = key; m_keyDerived = false; } void XENCCipherImpl::setKEK(XSECCryptoKey * key) { if (mp_kek != NULL) delete mp_kek; mp_kek = key; m_kekDerived = false; } // -------------------------------------------------------------------------------- // Serialise/Deserialise an element // -------------------------------------------------------------------------------- DOMDocumentFragment * XENCCipherImpl::deSerialise(safeBuffer &content, DOMNode * ctx) { DOMDocumentFragment * result; // Create the context to parse the document against safeBuffer sb, sbt; sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); //sb.sbXMLChAppendCh(chUnicodeMarker); //sb.sbXMLChCat8("<"); sb.sbXMLChAppendCh(chOpenAngle); sb.sbXMLChCat(s_tagname); // Run through each node up to the document node and find any // xmlns: nodes that may be needed during the parse of the decrypted content DOMNode * ctxParent = ctx->getParentNode(); DOMNode * wk = ctxParent; while (wk != NULL) { DOMNamedNodeMap * atts = wk->getAttributes(); XMLSize_t length; if (atts != NULL) length = atts->getLength(); else length = 0; for (XMLSize_t i = 0; i < length; ++i) { DOMNode * att = atts->item(i); if (strEquals(att->getNodeName(), DSIGConstants::s_unicodeStrXmlns) || (XMLString::compareNString(att->getNodeName(), DSIGConstants::s_unicodeStrXmlns, 5) == 0 && att->getNodeName()[5] == chColon)) { // Check to see if this node has already been found DOMNode * p = ctxParent; bool found = false; while (p != wk) { DOMNamedNodeMap * tstAtts = p->getAttributes(); if (tstAtts != NULL && tstAtts->getNamedItem(att->getNodeName()) != NULL) { found = true; break; } p = p->getParentNode(); } if (found == false) { // This is an attribute node that needs to be added sb.sbXMLChAppendCh(chSpace); sb.sbXMLChCat(att->getNodeName()); sb.sbXMLChAppendCh(chEqual); sb.sbXMLChAppendCh(chDoubleQuote); sb.sbXMLChCat(att->getNodeValue()); sb.sbXMLChAppendCh(chDoubleQuote); } } } wk = wk->getParentNode(); } sb.sbXMLChAppendCh(chCloseAngle); char* prefix = transcodeToUTF8(sb.rawXMLChBuffer()); sbt = prefix; XSEC_RELEASE_XMLCH(prefix); const char * crcb = content.rawCharBuffer(); int offset = 0; if (crcb[0] == '<' && crcb[1] == '?') { // Have a PI prefix - get rid of it int i = 2; while (crcb[i] != '\0' && crcb[i] != '>') ++i; if (crcb[i] == '>') offset = i + 1; } sbt.sbStrcatIn(&crcb[offset]); // Terminate the string sb.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); sb.sbXMLChAppendCh(chOpenAngle); sb.sbXMLChAppendCh(chForwardSlash); sb.sbXMLChCat(s_tagname); sb.sbXMLChAppendCh(chCloseAngle); char* trailer = transcodeToUTF8(sb.rawXMLChBuffer()); sbt.sbStrcatIn(trailer); XSEC_RELEASE_XMLCH(trailer); // Create an input source xsecsize_t bytes = XMLString::stringLen(sbt.rawCharBuffer()); MemBufInputSource memIS((const XMLByte*) sbt.rawBuffer(), bytes, "XSECMem"); XercesDOMParser parser; parser.setDoNamespaces(true); parser.setLoadExternalDTD(false); SecurityManager securityManager; securityManager.setEntityExpansionLimit(XSEC_ENTITY_EXPANSION_LIMIT); parser.setSecurityManager(&securityManager); parser.parse(memIS); xsecsize_t errorCount = parser.getErrorCount(); if (errorCount > 0) throw XSECException(XSECException::CipherError, "Errors occured during de-serialisation of decrypted element content"); DOMDocument * doc = parser.getDocument(); // Create a DocumentFragment to hold the children of the parsed doc element DOMDocument *ctxDocument = ctx->getOwnerDocument(); result = ctxDocument->createDocumentFragment(); Janitor j_result(result); // Now get the children of the document into a DOC fragment DOMNode * fragElt = doc->getDocumentElement(); DOMNode * child; if (fragElt != NULL) { child = fragElt->getFirstChild(); } else { throw XSECException(XSECException::CipherError, "XENCCipher::deSerialse - re-parsed document unexpectedly empty"); } while (child != NULL) { result->appendChild(ctxDocument->importNode(child, true)); child = child->getNextSibling(); } // Done! j_result.release(); return result; } // -------------------------------------------------------------------------------- // Decrypt an Element and replace in original document // -------------------------------------------------------------------------------- XSECCryptoKey * XENCCipherImpl::decryptKeyFromKeyInfoList(DSIGKeyInfoList * kil) { XSECCryptoKey * ret = NULL; XSECAlgorithmHandler *handler; int kLen = (int) kil->getSize(); for (int i = 0; ret == NULL && i < kLen; ++i) { if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_ENCRYPTEDKEY) { XENCEncryptedKey * ek = (XENCEncryptedKey*) (kil->item(i)); volatile XMLByte buffer[1024]; try { // Have to cast off volatile int keySize = decryptKey(ek, (XMLByte *) buffer, 1024); if (keySize > 0) { // Try to map the key XENCEncryptionMethod * encryptionMethod = mp_encryptedData->getEncryptionMethod(); if (encryptionMethod != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( mp_encryptedData->getEncryptionMethod()->getAlgorithm()); if (handler != NULL) ret = handler->createKeyForURI(mp_encryptedData->getEncryptionMethod()->getAlgorithm(), (XMLByte *) buffer, keySize); } } } catch (XSECCryptoException &) { /* Do nothing - this is likely to be a bad decrypt on a public key */ } catch (...) { memset((void *) buffer, 0, 1024); throw; } // Clear out the key buffer memset((void *) buffer, 0, 1024); } } return ret; } XENCEncryptedData * XENCCipherImpl::loadEncryptedData(DOMElement * element) { // First of all load the element if (mp_encryptedData != NULL) delete mp_encryptedData; XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env, element)); // Load mp_encryptedData->load(); return mp_encryptedData; } DOMDocument * XENCCipherImpl::decryptElement(DOMElement * element) { // First of all load the element if (mp_encryptedData != NULL) delete mp_encryptedData; XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env, element)); // Load mp_encryptedData->load(); return decryptElement(); } DOMNode * XENCCipherImpl::decryptElementDetached(DOMElement * element) { // First of all load the element if (mp_encryptedData != NULL) delete mp_encryptedData; XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env, element)); // Load mp_encryptedData->load(); return decryptElementDetached(); } DOMNode * XENCCipherImpl::decryptElementDetached(void) { XSECAlgorithmHandler *handler; if (mp_encryptedData == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - no element loaded for decryption"); } // Check that this is a valid type const XMLCh * typeURI = mp_encryptedData->getType(); if (typeURI != NULL && !strEquals(typeURI, DSIGConstants::s_unicodeStrURIXENC_ELEMENT) && !strEquals(typeURI, DSIGConstants::s_unicodeStrURIXENC_CONTENT)) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - Type not Element or Content"); } if (m_keyDerived && mp_key) { delete mp_key; mp_key = NULL; } // Make sure we have a key before we do anything else too drastic if (mp_key == NULL) { if (mp_keyInfoResolver != NULL) mp_key = mp_keyInfoResolver->resolveKey(mp_encryptedData->getKeyInfoList()); if (mp_key == NULL) { mp_key = decryptKeyFromKeyInfoList(mp_encryptedData->getKeyInfoList()); } if (mp_key == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - No key set and cannot resolve"); } m_keyDerived = true; } // Get the raw encrypted data TXFMChain * c = mp_encryptedData->createCipherTXFMChain(); Janitor j_c(c); // Get the Algorithm handler for the algorithm XENCEncryptionMethod * encryptionMethod = mp_encryptedData->getEncryptionMethod(); if (encryptionMethod != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(mp_encryptedData->getEncryptionMethod()->getAlgorithm()); } else { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(XSECAlgorithmMapper::s_defaultEncryptionMapping); } safeBuffer sb(""); unsigned int decryptLen; if (handler != NULL) { decryptLen = handler->decryptToSafeBuffer(c, mp_encryptedData->getEncryptionMethod(), mp_key, mp_env->getParentDocument(), sb); } else { // Very strange if we get here - any problems should throw an // exception in the AlgorithmMapper. throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - Error retrieving a handler for algorithm"); } sb[decryptLen] = '\0'; // Now de-serialise DOMElement * element = mp_encryptedData->getElement(); DOMDocumentFragment * frag = deSerialise(sb, element); return frag; } DOMDocument * XENCCipherImpl::decryptElement(void) { // Call the worker DOMElement * element = mp_encryptedData->getElement(); DOMDocumentFragment * frag = (DOMDocumentFragment *) decryptElementDetached(); if (frag != NULL) { // Have something to replace current element with DOMNode * p = element->getParentNode(); // By inserting the DocumentFragment, we effectively insert the children p->replaceChild(frag, element); // Delete the frag and the old element frag->release(); element->release(); } return mp_env->getParentDocument(); } // -------------------------------------------------------------------------------- // Decrypt data to an input stream // -------------------------------------------------------------------------------- XSECBinTXFMInputStream * XENCCipherImpl::decryptToBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element ) { XSECAlgorithmHandler *handler; // First of all load the element if (mp_encryptedData != NULL) delete mp_encryptedData; XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env, element)); // Load mp_encryptedData->load(); // Check key is valid if (m_keyDerived && mp_key) { delete mp_key; mp_key = NULL; } // Make sure we have a key before we do anything else too drastic if (mp_key == NULL) { if (mp_keyInfoResolver != NULL) mp_key = mp_keyInfoResolver->resolveKey(mp_encryptedData->getKeyInfoList()); if (mp_key == NULL) { mp_key = decryptKeyFromKeyInfoList(mp_encryptedData->getKeyInfoList()); } if (mp_key == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptToBinInputStream - No key set and cannot resolve"); } m_keyDerived = true; } // Get the raw encrypted data TXFMChain * c = mp_encryptedData->createCipherTXFMChain(); Janitor j_c(c); // Get the Algorithm handler for the algorithm XENCEncryptionMethod * encryptionMethod = mp_encryptedData->getEncryptionMethod(); if (encryptionMethod != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( mp_encryptedData->getEncryptionMethod()->getAlgorithm()); } else { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( XSECAlgorithmMapper::s_defaultEncryptionMapping); } if (handler != NULL) { if (handler->appendDecryptCipherTXFM(c, mp_encryptedData->getEncryptionMethod(), mp_key, mp_env->getParentDocument()) != true) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptToBinInputStream - error appending final transform"); } } else { // Very strange if we get here - any problems should throw an // exception in the AlgorithmMapper. throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - Error retrieving a handler for algorithm"); } // Wrap in a Bin input stream XSECBinTXFMInputStream * ret; ret = new XSECBinTXFMInputStream(c); // Probs with MSVC++ mean no XSECnew j_c.release(); // Now owned by "ret" return ret; } // -------------------------------------------------------------------------------- // Decrypt a key in an XENCEncryptedKey element // -------------------------------------------------------------------------------- int XENCCipherImpl::decryptKey(XENCEncryptedKey * encryptedKey, XMLByte * rawKey, int maxKeySize) { // Check KEK is valid if (m_kekDerived && mp_kek) { delete mp_kek; mp_kek = NULL; } // Make sure we have a key before we do anything else too drastic if (mp_kek == NULL) { if (mp_keyInfoResolver != NULL) mp_kek = mp_keyInfoResolver->resolveKey(encryptedKey->getKeyInfoList()); if (mp_kek == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptKey - No KEK set and cannot resolve"); } m_kekDerived = true; } // Get the raw encrypted data TXFMChain * c = ((XENCEncryptedKeyImpl *) encryptedKey)->createCipherTXFMChain(); Janitor j_c(c); // Get the Algorithm handler for the algorithm XENCEncryptionMethod * encryptionMethod = encryptedKey->getEncryptionMethod(); XSECAlgorithmHandler *handler; if (encryptionMethod != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(encryptedKey->getEncryptionMethod()->getAlgorithm()); } else { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(XSECAlgorithmMapper::s_defaultEncryptionMapping); } safeBuffer sb(""); unsigned int keySize; if (handler != NULL) { keySize = handler->decryptToSafeBuffer(c, encryptedKey->getEncryptionMethod(), mp_kek, mp_env->getParentDocument(), sb); } else { // Very strange if we get here - any problems should throw an // exception in the AlgorithmMapper. throw XSECException(XSECException::CipherError, "XENCCipherImpl::decryptElement - Error retrieving a handler for algorithm"); } keySize = (keySize < (unsigned int) maxKeySize ? keySize : (unsigned int) maxKeySize); memcpy(rawKey, sb.rawBuffer(), keySize); return keySize; } // -------------------------------------------------------------------------------- // Decrypt a key from a DOM structure // -------------------------------------------------------------------------------- int XENCCipherImpl::decryptKey(DOMElement * keyNode, XMLByte * rawKey, int maxKeySize) { XENCEncryptedKey * encryptedKey = loadEncryptedKey(keyNode); Janitor j_encryptedKey(encryptedKey); // Now decrypt! return decryptKey(encryptedKey, rawKey, maxKeySize); } XENCEncryptedKey * XENCCipherImpl::loadEncryptedKey(DOMElement * keyNode) { XENCEncryptedKeyImpl * encryptedKey; XSECnew(encryptedKey, XENCEncryptedKeyImpl(mp_env, keyNode)); Janitor j_encryptedKey(encryptedKey); // Load encryptedKey->load(); j_encryptedKey.release(); return encryptedKey; } // -------------------------------------------------------------------------------- // Encrypt a BinInputStream // -------------------------------------------------------------------------------- XENCEncryptedData * XENCCipherImpl::encryptBinInputStream( XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * plainText, encryptionMethod em, const XMLCh * algorithmURI) { TXFMURL * uri; XSECnew(uri, TXFMURL(mp_doc, NULL)); uri->setInput(plainText); TXFMChain c(uri); return encryptTXFMChain(&c, em, algorithmURI); } // -------------------------------------------------------------------------------- // Encrypt a TXFMChain // -------------------------------------------------------------------------------- XENCEncryptedData * XENCCipherImpl::encryptTXFMChain(TXFMChain * plainText, encryptionMethod em, const XMLCh * algorithmURI) { // Make sure we have a key before we do anything too drastic if (mp_key == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptElement - No key set"); } // Map the encryption method to a URI safeBuffer algorithmSB; const XMLCh * algorithm; if (em == ENCRYPT_NONE) { algorithm = algorithmURI; } else { if (encryptionMethod2URI(algorithmSB, em) != true) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptElement - Unknown encryption method"); } algorithm = algorithmSB.sbStrToXMLCh(); } // Create the element with a dummy encrypted value if (mp_encryptedData != NULL) { delete mp_encryptedData; mp_encryptedData = NULL; } XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env)); mp_encryptedData->createBlankEncryptedData(XENCCipherData::VALUE_TYPE, algorithm, s_noData); // Perform the encryption XSECAlgorithmHandler *handler; if (algorithm != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(algorithm); } else { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(XSECAlgorithmMapper::s_defaultEncryptionMapping); } safeBuffer sb; if (handler != NULL) { handler->encryptToSafeBuffer(plainText, mp_encryptedData->getEncryptionMethod(), mp_key, mp_env->getParentDocument(), sb); } else { // Very strange if we get here - any problems should throw an // exception in the AlgorithmMapper. throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptTXFMChain - Error retrieving a handler for algorithm"); } // Set the value XENCCipherValue * val = mp_encryptedData->getCipherData()->getCipherValue(); val->setCipherString(sb.sbStrToXMLCh()); return mp_encryptedData; } // -------------------------------------------------------------------------------- // Encrypt a key // -------------------------------------------------------------------------------- XENCEncryptedKey * XENCCipherImpl::encryptKey(const unsigned char * keyBuffer, unsigned int keyLen, encryptionMethod em, const XMLCh * algorithmURI) { if (mp_kek == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptKey - No KEK set"); } // Map the encryption method to a URI safeBuffer algorithmSB; const XMLCh * algorithm; if (em == ENCRYPT_NONE) { algorithm = algorithmURI; } else { if (encryptionMethod2URI(algorithmSB, em) != true) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptKey - Unknown encryption method"); } algorithm = algorithmSB.sbStrToXMLCh(); } // Create the element with a dummy encrypted value XENCEncryptedKeyImpl * encryptedKey; XSECnew(encryptedKey, XENCEncryptedKeyImpl(mp_env)); Janitor j_encryptedKey(encryptedKey); encryptedKey->createBlankEncryptedKey(XENCCipherData::VALUE_TYPE, algorithm, s_noData); // Create a transform chain to do pass the key to the encrypto safeBuffer rawKey; rawKey.isSensitive(); rawKey.sbMemcpyIn(keyBuffer, keyLen); TXFMSB * tsb; XSECnew(tsb, TXFMSB(mp_doc)); TXFMChain * c; XSECnew(c, TXFMChain(tsb)); Janitor j_c(c); tsb->setInput(rawKey, keyLen); // Perform the encryption XSECAlgorithmHandler *handler; if (algorithm != NULL) { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(algorithm); } else { handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(XSECAlgorithmMapper::s_defaultEncryptionMapping); } safeBuffer sb; if (handler != NULL) { handler->encryptToSafeBuffer(c, encryptedKey->getEncryptionMethod(), mp_kek, mp_env->getParentDocument(), sb); } else { // Very strange if we get here - any problems should throw an // exception in the AlgorithmMapper. throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptKey - Error retrieving a handler for algorithm"); } // Set the value XENCCipherValue * val = encryptedKey->getCipherData()->getCipherValue(); val->setCipherString(sb.sbStrToXMLCh()); j_encryptedKey.release(); return encryptedKey; } // -------------------------------------------------------------------------------- // Create an EncryptedData element // -------------------------------------------------------------------------------- XENCEncryptedData * XENCCipherImpl::createEncryptedData(XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value) { // Clean out anything currently being used if (mp_encryptedData != NULL) { delete mp_encryptedData; mp_encryptedData = NULL; } // Create a new EncryptedData element XSECnew(mp_encryptedData, XENCEncryptedDataImpl(mp_env)); mp_encryptedData->createBlankEncryptedData(type, algorithm, value); return mp_encryptedData; } // -------------------------------------------------------------------------------- // Encrypt an element // -------------------------------------------------------------------------------- DOMNode * XENCCipherImpl::encryptElementDetached(DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI) { // Make sure we have a key before we do anything too drastic if (mp_key == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptElement - No key set"); } // Create a transform chain to do the encryption TXFMDocObject * tdocObj; XSECnew(tdocObj, TXFMDocObject(mp_doc)); TXFMChain * c; XSECnew(c, TXFMChain(tdocObj)); Janitor j_c(c); tdocObj->setInput(mp_doc, element); // Now need to serialise the element - easiest to just use a canonicaliser TXFMC14n *tc14n; XSECnew(tc14n, TXFMC14n(mp_doc)); c->appendTxfm(tc14n); tc14n->activateComments(); if (m_useExcC14nSerialisation) tc14n->setExclusive(); // Do the hard work encryptTXFMChain(c, em, algorithmURI); mp_encryptedData->setType(DSIGConstants::s_unicodeStrURIXENC_ELEMENT); return mp_encryptedData->getElement(); } DOMDocument * XENCCipherImpl::encryptElement(DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI) { // Do the actual encryption work encryptElementDetached(element, em, algorithmURI); // Replace original element DOMNode * p = element->getParentNode(); if (p == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptElement - Passed in element has no parent"); } p->replaceChild(mp_encryptedData->getElement(), element); // Clear up the old child element->release(); return mp_doc; } // -------------------------------------------------------------------------------- // Encrypt an element's children // -------------------------------------------------------------------------------- DOMDocument * XENCCipherImpl::encryptElementContent( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI) { // Do the work encryptElementContentDetached(element, em, algorithmURI); // Delete current children DOMNode * n = element->getFirstChild(); while (n != NULL) { element->removeChild(n); n->release(); n = element->getFirstChild(); } // Now add the EncryptedData element->appendChild(mp_encryptedData->getElement()); return mp_doc; } DOMNode * XENCCipherImpl::encryptElementContentDetached( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * element, encryptionMethod em, const XMLCh * algorithmURI) { // Make sure we have a key before we do anything too drastic if (mp_key == NULL) { throw XSECException(XSECException::CipherError, "XENCCipherImpl::encryptElement - No key set"); } // Create a transform chain to do the encryption // We use a concat transformer so we can concatinate the bytestreams // from the serialisation of each child in turn TXFMConcatChains * tcat; XSECnew(tcat, TXFMConcatChains(mp_doc)); TXFMChain * c; XSECnew(c, TXFMChain(tcat)); Janitor j_c(c); DOMNode *n = element->getFirstChild(); while (n != NULL) { TXFMDocObject * tdocObj; XSECnew(tdocObj, TXFMDocObject(mp_doc)); TXFMChain * tc; XSECnew(tc, TXFMChain(tdocObj)); // Add to the concat object, which will own it, so if anything throws // the memory will be released. tcat->setInput(tc); tdocObj->setInput(mp_doc, n); // Now need to serialise the element - easiest to just use a canonicaliser TXFMC14n *tc14n; XSECnew(tc14n, TXFMC14n(mp_doc)); tc->appendTxfm(tc14n); tc14n->activateComments(); if (m_useExcC14nSerialisation) tc14n->setExclusive(); n = n->getNextSibling(); } encryptTXFMChain(c, em, algorithmURI); mp_encryptedData->setType(DSIGConstants::s_unicodeStrURIXENC_CONTENT); return mp_encryptedData->getElement(); } // -------------------------------------------------------------------------------- // Pretty Print functions // -------------------------------------------------------------------------------- void XENCCipherImpl::setExclusiveC14nSerialisation(bool flag) { m_useExcC14nSerialisation = flag; } bool XENCCipherImpl::getExclusiveC14nSerialisation(void) { return m_useExcC14nSerialisation; } // -------------------------------------------------------------------------------- // Exclusive C14n serialisation setting // -------------------------------------------------------------------------------- void XENCCipherImpl::setPrettyPrint(bool flag) { mp_env->setPrettyPrintFlag(flag); } bool XENCCipherImpl::getPrettyPrint(void) { return mp_env->getPrettyPrintFlag(); } xml-security-c-1.7.3/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp000644 001751 001751 00000014743 12003301053 025043 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCEncryptedKeyImpl := Implementation for holder object for EncryptedKeys * * $Id: XENCEncryptedKeyImpl.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include "XENCCipherImpl.hpp" #include "XENCEncryptedKeyImpl.hpp" #include "XENCCipherDataImpl.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // UNICODE Strings // -------------------------------------------------------------------------------- static XMLCh s_EncryptedKey[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_e, chLatin_d, chLatin_K, chLatin_e, chLatin_y, chNull }; static XMLCh s_CarriedKeyName[] = { chLatin_C, chLatin_a, chLatin_r, chLatin_r, chLatin_i, chLatin_e, chLatin_d, chLatin_K, chLatin_e, chLatin_y, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; static XMLCh s_Recipient[] = { chLatin_R, chLatin_e, chLatin_c, chLatin_i, chLatin_p, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull }; // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XENCEncryptedKeyImpl::XENCEncryptedKeyImpl(const XSECEnv * env) : XENCEncryptedKey(env), XENCEncryptedTypeImpl(env), mp_carriedKeyNameTextNode(NULL), mp_recipientAttr(NULL) { } XENCEncryptedKeyImpl::XENCEncryptedKeyImpl(const XSECEnv * env, DOMElement * node) : XENCEncryptedKey(env), XENCEncryptedTypeImpl(env, node), mp_carriedKeyNameTextNode(NULL), mp_recipientAttr(NULL) { } XENCEncryptedKeyImpl::~XENCEncryptedKeyImpl() { } // -------------------------------------------------------------------------------- // Load // -------------------------------------------------------------------------------- void XENCEncryptedKeyImpl::load(void) { if (mp_encryptedTypeElement == NULL) { // Attempt to load an empty encryptedData element throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedKey::load - called on empty DOM"); } if (!strEquals(getXENCLocalName(mp_encryptedTypeElement), s_EncryptedKey)) { // Attempt to load an empty encryptedKey element throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedKey::load - called on non EncryptedData node"); } // Now call the virtual function we overloaded to get here. XENCEncryptedTypeImpl::load(); // Set up the keyInfo node mp_keyInfoDOMNode = mp_encryptedTypeElement; // Find the Recipient Attribute mp_recipientAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Recipient); // Now load specific EncryptedKey elements DOMNode * c = findFirstChildOfType(mp_encryptedTypeElement, DOMNode::ELEMENT_NODE); while (c != NULL) { if (strEquals(getXENCLocalName(c), s_CarriedKeyName)) { // Have a CarriedKeyName node mp_carriedKeyNameTextNode = findFirstChildOfType(c, DOMNode::TEXT_NODE); } c = findNextElementChild(c); } } // -------------------------------------------------------------------------------- // Create from scratch // -------------------------------------------------------------------------------- DOMElement * XENCEncryptedKeyImpl::createBlankEncryptedKey( XENCCipherData::XENCCipherDataType type, const XMLCh * algorithm, const XMLCh * value) { DOMElement * ret = createBlankEncryptedType(s_EncryptedKey, type, algorithm, value); // Set up the KeyInfo information mp_keyInfoDOMNode = mp_encryptedTypeElement; return ret; } // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- const XMLCh * XENCEncryptedKeyImpl::getCarriedKeyName(void) const { if (mp_carriedKeyNameTextNode != NULL) return mp_carriedKeyNameTextNode->getNodeValue(); return NULL; } const XMLCh * XENCEncryptedKeyImpl::getRecipient(void) const { if (mp_recipientAttr != NULL) return mp_recipientAttr->getNodeValue(); return NULL; } void XENCEncryptedKeyImpl::setCarriedKeyName(const XMLCh * name) { if (mp_carriedKeyNameTextNode == NULL) { // Get some setup values safeBuffer str; DOMDocument *doc = XENCEncryptedTypeImpl::mp_env->getParentDocument(); const XMLCh * prefix = XENCEncryptedTypeImpl::mp_env->getXENCNSPrefix(); makeQName(str, prefix, s_CarriedKeyName); DOMElement *e = doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer()); mp_encryptedTypeElement->appendChild(e); XENCEncryptedTypeImpl::mp_env->doPrettyPrint(mp_encryptedTypeElement); mp_carriedKeyNameTextNode = doc->createTextNode(name); e->appendChild(mp_carriedKeyNameTextNode); } else { mp_carriedKeyNameTextNode->setNodeValue(name); } } void XENCEncryptedKeyImpl::setRecipient(const XMLCh * recipient) { if (mp_recipientAttr == NULL) { if (mp_encryptedTypeElement->getNodeType() != DOMNode::ELEMENT_NODE) { throw XSECException(XSECException::EncryptedTypeError, "XENCEncryptedKeyImpl::setRecipient - encryptedTypeNode is not an Element"); } mp_encryptedTypeElement->setAttributeNS(NULL, s_Recipient, recipient); // Now retrieve for later use mp_recipientAttr = mp_encryptedTypeElement->getAttributeNodeNS(NULL, s_Recipient); if (mp_recipientAttr == NULL) { throw XSECException(XSECException::EncryptionMethodError, "XENCEncryptionKey::setRecipient - Error creating Recipient Attribute"); } } else { mp_recipientAttr->setNodeValue(recipient); } } xml-security-c-1.7.3/xsec/xenc/impl/XENCCipherReferenceImpl.hpp000644 001751 001751 00000005516 12003301053 025471 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XENCCipherReference := Implementation for CipherReference element * * $Id: XENCCipherReferenceImpl.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XENCCIPHERREFERENCEIMPL_INCLUDE #define XENCCIPHERREFERENCEIMPL_INCLUDE // XSEC Includes #include #include XSEC_DECLARE_XERCES_CLASS(DOMNode); class DSIGTransformList; class XSECEnv; class DSIGTransform; class XENCCipherReferenceImpl : public XENCCipherReference { public: XENCCipherReferenceImpl(const XSECEnv * env); XENCCipherReferenceImpl( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node ); virtual ~XENCCipherReferenceImpl(); // Load void load(void); // Create XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankCipherReference(const XMLCh * URI); // Get methods virtual DSIGTransformList * getTransforms(void) const; virtual const XMLCh * getURI (void) const; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const; // Set methods virtual DSIGTransformBase64 * appendBase64Transform(); virtual DSIGTransformXPath * appendXPathTransform(const char * expr); virtual DSIGTransformXPathFilter * appendXPathFilterTransform(void); virtual DSIGTransformXSL * appendXSLTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *stylesheet); virtual DSIGTransformC14n * appendCanonicalizationTransform(canonicalizationMethod cm); private: // Unimplemented XENCCipherReferenceImpl(const XENCCipherReference &); XENCCipherReferenceImpl & operator = (const XENCCipherReference &); // Private functions void createTransformList(void); void addTransform(DSIGTransform * txfm, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * txfmElt); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_cipherReferenceElement; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_uriAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_transformsElement; DSIGTransformList * mp_transformList; }; #endif /* XENCCIPHERREFERENCE_INCLUDE */ xml-security-c-1.7.3/xsec/utils/unixutils/000755 001751 001751 00000000000 12477614644 021762 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/utils/winutils/000755 001751 001751 00000000000 12477614645 021575 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/utils/XSECAutoPtr.hpp000644 001751 001751 00000005613 12003301052 022460 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAutoPtr := internal classes for RAII handling of transcoded data * * Author(s): Scott Cantor * * $Id:$ * */ #ifndef XSECAUTOPTR_INCLUDE #define XSECAUTOPTR_INCLUDE #include #include XSEC_USING_XERCES(XMLString); /** * \addtogroup internal * @{ */ /** * A minimal auto_ptr-like class that can copy or transcode a buffer into * the local code page and free the result automatically. * * Needed because a standard auto_ptr would use delete on the resulting * pointer. */ class XSECAutoPtrChar { XSECAutoPtrChar(const XSECAutoPtrChar&); XSECAutoPtrChar& operator=(const XSECAutoPtrChar&); public: XSECAutoPtrChar() : m_buf(NULL) { } XSECAutoPtrChar(const XMLCh* src) : m_buf(xercesc::XMLString::transcode(src)) { } XSECAutoPtrChar(const char* src) : m_buf(xercesc::XMLString::replicate(src)) { } ~XSECAutoPtrChar() { XSEC_RELEASE_XMLCH(m_buf); } const char* get() const { return m_buf; } char* release() { char* temp=m_buf; m_buf=NULL; return temp; } private: char* m_buf; }; /** * A minimal auto_ptr-like class that can copy or transcode a buffer into * 16-bit Unicode and free the result automatically. * * Needed because a standard auto_ptr would use delete on the resulting * pointer. */ class XSECAutoPtrXMLCh { XSECAutoPtrXMLCh(const XSECAutoPtrXMLCh&); XSECAutoPtrXMLCh& operator=(const XSECAutoPtrXMLCh&); public: XSECAutoPtrXMLCh() : m_buf(NULL) { } XSECAutoPtrXMLCh(const char* src) : m_buf(xercesc::XMLString::transcode(src)) { } XSECAutoPtrXMLCh(const XMLCh* src) : m_buf(xercesc::XMLString::replicate(src)) { } ~XSECAutoPtrXMLCh() { XSEC_RELEASE_XMLCH(m_buf); } const XMLCh* get() const { return m_buf; } XMLCh* release() { XMLCh* temp=m_buf; m_buf=NULL; return temp; } private: XMLCh* m_buf; }; /** @} */ #endif /* XSECAUTOPTR_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECSafeBuffer.hpp000644 001751 001751 00000013026 12003301052 023067 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSafeBuffer := a class for storing expanding amounts of information. * * Author(s): Berin Lautenbach * * $Id: XSECSafeBuffer.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECSAFEBUFFER_INCLUDE #define XSECSAFEBUFFER_INCLUDE #include #include class TXFMBase; /** * \addtogroup internal * @{ */ #define DEFAULT_SAFE_BUFFER_SIZE 1024 // Default size for a safe Buffer /** *\brief Manage buffers of arbitrary size * * The safeBuffer class is used internally in the library * to manage buffers of bytes or UTF-16 characters. * * It's a fairly innefficient class, as buffers are continually * being wrapped, coppied and enlarged, but given the nature of the * library, a single class that manipulates buffers of variable * size was felt to be preferable, * * The safeBuffer is not exposed through interface classes that * might be used by external functions. In these cases, a * pointer to a XMLCh * buffer is used by preference. */ class CANON_EXPORT safeBuffer { public: // For checking we are operating on the buffer correctly enum bufferType { BUFFER_UNKNOWN = 0, BUFFER_CHAR = 1, BUFFER_UNICODE = 2 }; safeBuffer(); safeBuffer(const safeBuffer & other); safeBuffer(xsecsize_t initialSize); safeBuffer(const char * inStr, xsecsize_t initialSize = DEFAULT_SAFE_BUFFER_SIZE); ~safeBuffer(); static void init(void); // "IN" functions - these read in information to the buffer void sbStrcpyIn(const char * inStr); void sbStrcpyIn(const safeBuffer & inStr); void sbStrncpyIn(const char * inStr, xsecsize_t n); void sbStrncpyIn(const safeBuffer & inStr, xsecsize_t n); void sbStrcatIn(const char * inStr); void sbStrcatIn(const safeBuffer & inStr); void sbStrncatIn(const char * inStr, xsecsize_t n); void sbStrinsIn(const char * inStr, xsecsize_t offset); void sbMemcpyIn(const void * inBuf, xsecsize_t n); void sbMemcpyIn(xsecsize_t offset, const void * inBuf, xsecsize_t n); void sbMemcpyOut(void * outBuf, xsecsize_t n) const; void sbMemshift(xsecsize_t toOffset, xsecsize_t fromOffset, xsecsize_t len); // Comparison functions int sbStrncmp(const char * inStr, xsecsize_t n) const; int sbOffsetStrcmp(const char * inStr, xsecsize_t offset) const; int sbOffsetStrncmp(const char * inStr, xsecsize_t offset, xsecsize_t n) const; int sbStrcmp(const char * inStr) const; int sbStrcmp(const safeBuffer & inStr) const; #ifdef XSEC_XERCES_64BITSAFE long sbStrstr(const char * inStr) const; long sbOffsetStrstr(const char * inStr, xsecsize_t offset) const; // XMLCh versions long sbStrstr(const XMLCh * inStr) const; #else int sbStrstr(const char * inStr) const; int sbOffsetStrstr(const char * inStr, xsecsize_t offset) const; // XMLCh versions int sbStrstr(const XMLCh * inStr) const; #endif void sbStrinsIn(const XMLCh * inStr, xsecsize_t offset); // XMLCh and char common functions void sbStrlwr(void); // Lowercase the string // Operators unsigned char & operator[](xsecsize_t n); safeBuffer & operator= (const safeBuffer & cpy); safeBuffer & operator= (const XMLCh * inStr); safeBuffer & operator << (TXFMBase * t); // Get functions xsecsize_t sbStrlen(void) const; xsecsize_t sbRawBufferSize(void) const; // raw buffer manipulation const unsigned char * rawBuffer() const; const char * rawCharBuffer() const; const XMLCh * rawXMLChBuffer() const; void resize(xsecsize_t sz); // NOTE : Only grows void setBufferType(bufferType bt); // Use with care // Unicode (UTF-16 manipulation) const XMLCh * sbStrToXMLCh(void) const; // Note does not affect internal buffer void sbTranscodeIn(const XMLCh * inStr); // Create a local string from UTF-16 void sbTranscodeIn(const char * inStr); // Create a UTF-16 string from local void sbXMLChIn(const XMLCh * in); // Buffer holds XMLCh * void sbXMLChAppendCh(const XMLCh c); // Append a Unicode character to the buffer void sbXMLChCat(const XMLCh *str); // Append a UTF-16 string to the buffer void sbXMLChCat(const char * str); // Append a (transcoded) local string to the buffer void sbXMLChCat8(const char * str); // Append a (transcoded) UTF-8 string to the buffer // Sensitive data functions void isSensitive(void); void cleanseBuffer(void); private: // Internal function that is used to get a string size and // then re-allocate if necessary void checkAndExpand(xsecsize_t size); void checkBufferType(bufferType bt) const; unsigned char * buffer; xsecsize_t bufferSize; mutable XMLCh * mp_XMLCh; bufferType m_bufferType; // For XMLCh manipulation static size_t size_XMLCh; // For sensitive data bool m_isSensitive; }; /** @} */ #endif /* XSECSAFEBUFFER_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECSOAPRequestor.hpp000644 001751 001751 00000005505 12003301052 023536 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSOAPRequestor:= Interface class used by the XKMS client code to * perform a SOAP request and receive response. * * * $Id: XSECSOAPRequestor.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECSOAPREQUESTOR_INCLUDE #define XSECSOAPREQUESTOR_INCLUDE #include XSEC_DECLARE_XERCES_CLASS(DOMDocument); /** * @brief Interface for SOAP Requests * @ingroup interfaces * * The XKMS client code needs to be able to call on a SOAP requestor * implementation that will handle wrapping the request in a SOAP msg * and transporting it to the SOAP server. This class defines the * interface used by the client code to make this happen. * * Implementors need to wrap the passed in DOM document in a SOAP 1.1 * or SOAP 1.2 msg. E.g. (SOAP 1.2) * \verbatim XKMS Request Message element \endverbatim * * SOAP implentors may want/need to add other headers. * */ class DSIG_EXPORT XSECSOAPRequestor { public : /** @name Constructors and Destructors */ //@{ XSECSOAPRequestor() {} virtual ~XSECSOAPRequestor() {} //@} /** @name Interface methods */ /** * \brief Do a SOAP request * * Performs a request based on the passed in DOM document and * the indicated URI. The function is expected to return a pointer * to the parsed result message (with the SOAP envelope removed) * * The implementing object is expected to know how to get the * wrapped message to the server that will process the request * * @param request The DOM document containing the message to be * wrapped and sent. * @returns The DOM document representing the result, with all * SOAP headers removed */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doRequest(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * request) = 0; }; #endif /* XSECSOAPREQUESTOR_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECTXFMInputSource.hpp000644 001751 001751 00000005055 12003301052 024041 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECTXFMInputSource := Transfomer InputSource for Xerces Parser. * * $Id: XSECTXFMInputSource.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECTXFMINPUTSOURCE_INCLUDE #define XSECTXFMINPUTSOURCE_INCLUDE #include #include class TXFMChain; XSEC_DECLARE_XERCES_CLASS(BinInputStream); /** * @brief InputSource wrapper for a TXFMList. * @ingroup interfaces * * This class provides a wrapper for a TXFMList. It is used to provide * an input to the Xerces Parser. * * @note This is a one-off use class. In the process of providing bytes to * the parser, it runs through the transforms, which (currently) cannot be * reset. * */ class DSIG_EXPORT XSECTXFMInputSource : public XERCES_CPP_NAMESPACE_QUALIFIER InputSource { public : /** @name Constructors and Destructors */ //@{ /** * \brief Construct around an existing transform list * * @param lst The final TXFM element in the input chain. * @param deleteWhenDone Flag to instruct the class to delete the chain when * done. By default set to true. */ XSECTXFMInputSource(TXFMChain * lst, bool deleteWhenDone = true); /** * \brief Destructor * * Delete the object. If deleteWhenDone was set during construction, will * delete the chain if it has not already been done. */ virtual ~XSECTXFMInputSource(); //@} /** @name Stream management methods */ //@{ /** * \brief Interface method * * Returns an InputStream that can be read by the parser */ XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream* makeStream() const; //@} private : mutable TXFMChain * mp_chain; // End point of list bool m_deleteWhenDone; // Do we delete? }; #endif /* XSECTXFMINPUTSOURCE_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECNameSpaceExpander.hpp000644 001751 001751 00000012533 12003301052 024404 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECNameSpaceHolder := Container class for holding and managing the name space stack * Used when running through a DOM document * * $Id: XSECNameSpaceExpander.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECNAMESPACEEXPANDER_HEADER #define XSECNAMESPACEEXPANDER_HEADER // XSEC Includes #include #include #include // Xerces Includes XSEC_DECLARE_XERCES_CLASS(DOMDocument); XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMElement); #include // -------------------------------------------------------------------------------- // Structure Definition for the nodes within the list of nodes // -------------------------------------------------------------------------------- struct XSECNameSpaceEntry { // Variables safeBuffer m_name; // The name for this name space XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_node; // The Element Node owner XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_att; // The added attribute node }; // -------------------------------------------------------------------------------- // Class definition for the list // -------------------------------------------------------------------------------- /** * @ingroup pubsig */ /*\@{*/ /** * @brief Class to "expand" name spaces * * For most things, a DOM model interoperates well with XPath. Unfortunately, * name-spaces are the one main problem. In particular, the XPath spec * states that every element node has an attribute node for its own * namespaces, and one for namespaces above that are in scope. * * In the DOM scheme of things, a namespace is only available in the node in * which it is defined. Normally this is not a problem, you can just just * refer backwards until you find the namespace you need. However, for XPath * expressions that select namespace nodes, we need to actually promulgate * the name-spaces down to every node where they are visible so that the XPath * selection will work properly. * * This is important for Canonicalisation of the found nodes, but we cannot * do this only in the canonicaliser as it does not internally understand how * to do DSIG style XPath. So the XPath is done externally, and the * resultant node set (including any selected "Expanded" attribute nodes). * are passed in. * * The expander therefore handles the propogation of the namespace nodes, and * removes the propogated nodes when it goes out of scope (or when * deleteAddedNamespaces() is called). * */ class CANON_EXPORT XSECNameSpaceExpander { #if defined(XALAN_NO_NAMESPACES) typedef vector NameSpaceEntryListVectorType; #else typedef std::vector NameSpaceEntryListVectorType; #endif public: /** @name Constructors and Destructors */ //@{ /** * \brief Main constructure * * Use this constructor to expand namespaces through an entire document. * * @param d The DOM document to be expanded. */ XSECNameSpaceExpander(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *d); // Constructor /** * \brief Fragment constructor * * Use this constructor to expand namespaces in a given fragment only. * @note The fragment does not need to be rooted in an actual document. * * @param f The starting element of the fragment to be expanded. */ XSECNameSpaceExpander(XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *f); // frag Constructor ~XSECNameSpaceExpander(); // Default destructor //@} // Operate /** * \brief Expand namespaces. * * Perform the expansion operation and create a list of all added nodes. */ void expandNameSpaces(void); /** * \brief Collapse name-spaces * * Delete all namespaces added in exandNameSpaces() (using the list that * was created at that time */ void deleteAddedNamespaces(void); // Check if a node is an added node bool nodeWasAdded(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n); private: // Functions XSECNameSpaceExpander(void); // No default constructor void recurse(XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *n); // data NameSpaceEntryListVectorType m_lst; // List of added name spaces XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; // The owner document XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_fragment; // If we are doing a fragment bool m_expanded; // Have we expanded already? XSECSafeBufferFormatter * mp_formatter; }; #endif /* XSECNAMESPACEEXPANDER_HEADER */ xml-security-c-1.7.3/xsec/utils/XSECSOAPRequestorSimple.hpp000644 001751 001751 00000007117 12003301052 024711 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSOAPRequestorSimple := (Very) Basic implementation of a SOAP * HTTP wrapper for testing the client code. * * * $Id: XSECSOAPRequestorSimple.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECSOAPREQUESTORSIMPLE_INCLUDE #define XSECSOAPREQUESTORSIMPLE_INCLUDE #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMDocument); /** * @ingroup xkms */ /*\@{*/ /** * @brief Basic HTTP implementation for SOAP Requests * * The XKMS client code needs to be able to call on a SOAP requestor * implementation that will handle wrapping the request in a SOAP msg * and transporting it to the SOAP server. This class provides a very * naieve implementation that wraps the message and does a basic * HTTP POST to get the message to the end server. * */ class DSIG_EXPORT XSECSOAPRequestorSimple : public XSECSOAPRequestor { public : /** * Envelope Enumeration */ enum envelopeType { ENVELOPE_NONE, /** No envelope - straight HTTP request */ ENVELOPE_SOAP11, /** SOAP 1.1 envelope (default) */ ENVELOPE_SOAP12 /** SOAP 1.2 envelope */ }; /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Create a SOAP requestor that can be used to access a specific * server * * @param uri The URI of the server that will be accessed. * @note The URI must be http://... */ XSECSOAPRequestorSimple(const XMLCh * uri); virtual ~XSECSOAPRequestorSimple(); //@} /** @name Interface methods */ //@{ /** * \brief Do a SOAP request * * Performs a request based on the passed in DOM document and * the indicated URI. The function is returns a pointer * to the parsed result message (with the SOAP envelope removed) * * @param request The DOM document containing the message to be * wrapped and sent. * @returns The DOM document representing the result, with all * SOAP headers removed */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doRequest(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * request); //@} /** @name Configuration methods */ //@{ /** * \brief Set the envelope type * * The requestor can do a SOAP 1.1, SOAP 1.2 or no envelope around the * message. This call allows the apllication to set the type. * * By default, the requestor uses a SOAP 1.1 envelope * * @param et - the type of envelope to use */ void setEnvelopeType(envelopeType et); private: char * wrapAndSerialise(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * request); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parseAndUnwrap(const char * buf, unsigned int len); XERCES_CPP_NAMESPACE_QUALIFIER XMLUri m_uri; envelopeType m_envelopeType; }; #endif /* XSECSOAPREQUESTORSIMPLE_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECXPathNodeList.hpp000644 001751 001751 00000011570 12003301052 023547 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECXPathNodeList := A structure to hold node lists from XPath * evaluations * * Author(s): Berin Lautenbach * * $Id: XSECXPathNodeList.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECXPATHNODELIST_INCLUDE #define XSECXPATHNODELIST_INCLUDE // XSEC #include // Xerces XSEC_DECLARE_XERCES_CLASS(DOMNode) #define _XSEC_NODELIST_DEFAULT_SIZE 100 /** * @ingroup internal */ /** * \brief Class for holding lists of DOMNodes. * * This class is used primarily for holding lists of nodes found during XPath * processing. It is also used for xpath-filter which requires multiple list * comparisons. * * It is not implemented using one of the container classes as it has the * potential to become a real bottleneck. It could potentially be implemented * as a hash list based on names of nodes (or even pointers). * */ class DSIG_EXPORT XSECXPathNodeList { public: /** @name Constructors, Destructors and operators */ //@{ XSECXPathNodeList(unsigned int initialSize = _XSEC_NODELIST_DEFAULT_SIZE); /** * \brief Copy Constructor * * @note The XSEC Library generally passes NodeLists around as pointers. * There is a LARGE overhead associated with re-creating lists, so we * try to avoid doing it unless necessary. */ XSECXPathNodeList(const XSECXPathNodeList &other); ~XSECXPathNodeList(); /** * \brief Assignment Operator. * * Set one node list equal to another. * * @note Do not do this frequently, particularly for large lists * as it will replicate the entire list and is a fairly expensive * operation * * @param toCopy The list to be copied from */ XSECXPathNodeList & operator= (const XSECXPathNodeList & toCopy); //@} /** @name Adding and Deleting nodes */ //@{ /** *\brief Add a node to the list. * * Checks to see whether the node is already in the list, and if not * adds it. * * @param n The node to add. */ void addNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n); /** * \brief Remove a node from the list. * * Given a node, find it in the list and (if it exists) delete it from the list. * * @param n The node to be removed. */ void removeNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n); /** * \brief Clear out the entire list, deleting all entries. * */ void clear(void); //@} /** @name Reading List Functions */ //@{ /** * \brief Check if a node exists in the list. * * @param n The node to find in the list. */ bool hasNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n) const; /** * \brief Get the first node in the list. * * Returns the first node in the list of nodes and resets the search list. * * @returns The first node in the list or NULL if none exist */ const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getFirstNode(void) const; /** * \brief Get the next node in the list * * Returns the next node in the list. * * @returns The next node in the list of NULL if none exist */ const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getNextNode(void) const; //@} /** @name Manipulating Nodesets */ //@{ /** *\brief Intersect with nodeset * * Delete any nodes in my list that are not in the intersect list * * @param toIntersect The list to intersect with. */ void intersect(const XSECXPathNodeList &toIntersect); //@} private: /* Implement an unbalanced binary search tree */ typedef struct s_btn { struct s_btn * l; // Left struct s_btn * r; // Right struct s_btn * p; // Parent const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * v; // Value long h; // Height } btn; // Internal functions btn * findNodeIndex(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n) const; void delete_tree(btn * t); btn * copy_tree(btn * t) const ; long balance_count(btn * t) const; void rotate_left(btn * t); void rotate_right(btn * t); long calc_height(btn * t); btn * mp_tree; // The tree unsigned int m_num; // Number of elements in the tree mutable btn * mp_current; // current point in list for getNextNode }; #endif /* XSECXPATHNODELIST_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECSafeBufferFormatter.hpp000644 001751 001751 00000011503 12147777032 025001 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSafeBufferFormatter := Class for formatting DOMStrings into SafeBuffers * * Author(s): Berin Lautenbach * * $Id: XSECSafeBufferFormatter.hpp 1482601 2013-05-14 21:31:27Z scantor $ * */ #ifndef XSECSAFEBUFFERFORMATTER_INCLUDE #define XSECSAFEBUFFERFORMATTER_INCLUDE // XSEC includes #include // Xerces includes #include /** @addtogroup internal * @{ */ class sbFormatTarget : public XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatTarget { public: sbFormatTarget() {m_offset = 0;} ~sbFormatTarget() {} void setBuffer (safeBuffer * toSet) {m_buffer = toSet;}; // ----------------------------------------------------------------------- // Implementations of the format target interface // Based on Xerces/Xalan example code // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const xsecsize_t count, XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter * const formatter) { m_buffer->sbMemcpyIn(m_offset, (char *) toWrite, count); m_buffer->setBufferType(safeBuffer::BUFFER_CHAR); m_offset += count; (*m_buffer)[m_offset] = '\0'; }; void reset(void) {m_offset = 0;(*m_buffer)[0] = '\0';} private: sbFormatTarget(const sbFormatTarget& other); void operator=(const sbFormatTarget& rhs); safeBuffer * m_buffer; // Buffer to write to xsecsize_t m_offset; }; /** * \brief Formatter for outputting to a safeBuffer * * The XSECSafeBufferFormatter class is used as an internal class * to perform encoding translations with a safeBuffer as a target */ class CANON_EXPORT XSECSafeBufferFormatter { XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter * formatter; // To actually perform the formatting safeBuffer formatBuffer; // Storage of translated strings sbFormatTarget * sbf; // Format target used by XMLFormatter public: // Constructor XSECSafeBufferFormatter( const XMLCh * const outEncoding, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::EscapeFlags escapeFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::NoEscapes, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRepFlags unrepFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRep_Fail ); XSECSafeBufferFormatter( const char * const outEncoding, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::EscapeFlags escapeFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::NoEscapes, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRepFlags unrepFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRep_Fail ); // Destructor ~XSECSafeBufferFormatter(); // Reimplementation of XMLFormatter functions void formatBuf ( const XMLCh *const toFormat, const xsecsize_t count, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::EscapeFlags escapeFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::DefaultEscape, const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRepFlags unrepFlags=XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::DefaultUnRep ); // Format a buffer XSECSafeBufferFormatter& operator<< ( const XMLCh *const toFormat); // Format a buffer XSECSafeBufferFormatter& operator<< ( const XMLCh toFormat); // Format a character const XMLCh* getEncodingName ()const; // Get current encoding void setEscapeFlags (const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::EscapeFlags newFlags); void setUnRepFlags (const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRepFlags newFlags); XSECSafeBufferFormatter& operator<< (const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::EscapeFlags newFlags); XSECSafeBufferFormatter& operator<< (const XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter::UnRepFlags newFlags); // Friends for working with safestrings friend safeBuffer& operator<< (safeBuffer &to, const XSECSafeBufferFormatter & from); private: // Unimplemented XSECSafeBufferFormatter() {}; }; /** @} */ #endif /* XSECSAFEBUFFERFORMATTER_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECDOMUtils.hpp000644 001751 001751 00000015433 12003301052 022523 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECDOMUtils:= Utilities to manipulate DOM within XML-SECURITY * * Author(s): Berin Lautenbach * * $Id: XSECDOMUtils.hpp 1350044 2012-06-13 22:31:37Z scantor $ * */ #ifndef XSECDOMUTILS_HEADER #define XSECDOMUTILS_HEADER // XSEC #include #include #include // Xerces #include #include #define COMPARE_STRING_LENGTH 256 // -------------------------------------------------------------------------------- // "Quick" Transcode Class (low performance) // -------------------------------------------------------------------------------- class DSIG_EXPORT XMLT { public: XMLT(const char * str); ~XMLT(void); XMLCh * getUnicodeStr(void); private: XMLCh * mp_unicodeStr; XMLT(); }; #define MAKE_UNICODE_STRING(str) XMLT(str).getUnicodeStr() // -------------------------------------------------------------------------------- // Utilities to manipulate namespaces // -------------------------------------------------------------------------------- const XMLCh DSIG_EXPORT * getDSIGLocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getDSIG11LocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getECLocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getXPFLocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getXENCLocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getXENC11LocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); const XMLCh DSIG_EXPORT * getXKMSLocalName(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node); // -------------------------------------------------------------------------------- // Do UTF-8 <-> UTF-16 transcoding // -------------------------------------------------------------------------------- XMLCh DSIG_EXPORT * transcodeFromUTF8(const unsigned char * src); char DSIG_EXPORT * transcodeToUTF8(const XMLCh * src); // -------------------------------------------------------------------------------- // Find a nominated DSIG/XENC node in a document // -------------------------------------------------------------------------------- XERCES_CPP_NAMESPACE_QUALIFIER DOMNode DSIG_EXPORT * findDSIGNode(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n, const char * nodeName); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode DSIG_EXPORT * findXENCNode(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n, const char * nodeName); // -------------------------------------------------------------------------------- // Find particular type of node child // -------------------------------------------------------------------------------- XERCES_CPP_NAMESPACE_QUALIFIER DOMNode DSIG_EXPORT * findFirstChildOfType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::NodeType t); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode DSIG_EXPORT * findNextChildOfType(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::NodeType t); XERCES_CPP_NAMESPACE_QUALIFIER DOMElement DSIG_EXPORT * findFirstElementChild(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n); XERCES_CPP_NAMESPACE_QUALIFIER DOMElement DSIG_EXPORT * findNextElementChild(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n); // -------------------------------------------------------------------------------- // Make a QName // -------------------------------------------------------------------------------- safeBuffer DSIG_EXPORT &makeQName(safeBuffer & qname, safeBuffer &prefix, const char * localName); safeBuffer DSIG_EXPORT &makeQName(safeBuffer & qname, const XMLCh *prefix, const char * localName); safeBuffer DSIG_EXPORT &makeQName(safeBuffer & qname, const XMLCh *prefix, const XMLCh * localName); // -------------------------------------------------------------------------------- // Gather text from children // -------------------------------------------------------------------------------- void DSIG_EXPORT gatherChildrenText(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * parent, safeBuffer &output); // -------------------------------------------------------------------------------- // String decode/encode // -------------------------------------------------------------------------------- /* * Distinguished names have a particular encoding that needs to be performed prior * to enclusion in the DOM */ XMLCh * encodeDName(const XMLCh * toEncode); XMLCh * decodeDName(const XMLCh * toDecode); // -------------------------------------------------------------------------------- // Generate Ids // -------------------------------------------------------------------------------- XMLCh DSIG_EXPORT * generateId(unsigned int bytes = 16); // -------------------------------------------------------------------------------- // String Functions // -------------------------------------------------------------------------------- // Remove escape (%XX) characters from URIs and return a new buffer containing the // "cleaned" string XMLCh * cleanURIEscapes(const XMLCh * str); inline bool strEquals (const XMLCh * str1, const XMLCh *str2) { return (XMLString::compareString(str1, str2) == 0); } inline bool strEquals (const char * str1, const char *str2) { return (XMLString::compareString(str1, str2) == 0); } inline bool strEquals (const char * str1, const XMLCh * str2) { bool ret; XMLCh * str1XMLCh = XMLString::transcode(str1); if (str1XMLCh != NULL) { ret = (XMLString::compareString(str1XMLCh, str2) == 0); XSEC_RELEASE_XMLCH(str1XMLCh); } else ret = false; return ret; } inline bool strEquals (const XMLCh * str1, const char * str2) { bool ret; XMLCh * str2XMLCh = XMLString::transcode(str2); if (str2XMLCh != NULL) { ret = (XMLString::compareString(str1, str2XMLCh) == 0); XSEC_RELEASE_XMLCH(str2XMLCh); } else ret = false; return ret; } #endif /* XSECDOMUTILS_HEADER */ xml-security-c-1.7.3/xsec/utils/XSECBinTXFMInputStream.hpp000644 001751 001751 00000007457 12003301052 024475 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinTXFMInputStream := Implement the BinInputStream around Transforms. * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #ifndef XSECBINTXFMINPUTSTREAM_INCLUDE #define XSECBINTXFMINPUTSTREAM_INCLUDE #include #include class TXFMChain; class TXFMBase; /** * @defgroup interfaces Classes that interface applications to XML Security C. * * These classes and files provide interfaces to allow the XSEC library to link * to other libraries or to allow other libraries/applications to interface * to XSEC. * @{ */ /** * @brief BinInputSource wrapper for a TXFMChain. * * This class provides a wrapper for a TXFMChain. It can be used to either provide * a nice interface to applications wishing to read the BYTESTREAM output of a * TXFM chain, or, as it is derived from BinInputStream, provide an input to the * Xerces Parser. * */ class DSIG_EXPORT XSECBinTXFMInputStream : public XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream { public : /** @name Constructors and Destructors */ //@{ /** * \brief Construct around an existing transform list * * @param lst The input TXFM chain. * @param deleteWhenDone Flag to instruct the class to delete the chain when * done. By default set to true. */ XSECBinTXFMInputStream(TXFMChain * lst, bool deleteWhenDone = true); /** * \brief Destructor * * Delete the object. If deleteWhenDone was set during construction, will * delete the chain if it has not already been done. */ virtual ~XSECBinTXFMInputStream(); //@} /** @name Stream management methods */ //@{ /** * \brief Reset the stream. * * @note At this time simply deletes the TXFM chain - many TXFMs do not * have an ability to reset. */ void reset(); //@} /** @name Interface */ //@{ /** * \brief Current position in stream. * * @returns Bytes already returned. */ #ifdef XSEC_XERCES_64BITSAFE virtual XMLFilePos curPos() const; #else virtual unsigned int curPos() const; #endif /** * \brief Retrieve the required number of bytes and return * * Retrieve up to the requested number of bytes. Does not always * retrieve as much as requested, but will always retrieve something * until completed. * * @note When complete, will return 0 and delete the TXFM chain if * requested to do so in the constructor. * @param toFill The buffer that will be read into. * @param maxToRead Maximum number of bytes to return * @returns The number of bytes read or 0 if complete. */ virtual xsecsize_t readBytes(XMLByte* const toFill, const xsecsize_t maxToRead); #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* getContentType() const; #endif private : TXFMBase * mp_txfm; // End point of list TXFMChain * mp_chain; // The actual chain bool m_deleteWhenDone; // Do we delete? bool m_deleted; // Have we deleted? bool m_done; // Are we done? xsecsize_t m_currentIndex; // How much read? }; #endif xml-security-c-1.7.3/xsec/utils/XSECPlatformUtils.hpp000644 001751 001751 00000015620 12003301052 023666 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECPlatformUtils:= To support the platform we run in * * Author(s): Berin Lautenbach * * $Id: XSECPlatformUtils.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECPLATFORMUTILS_INCLUDE #define XSECPLATFORMUTILS_INCLUDE #include // XSEC #include #include class TXFMBase; class XSECAlgorithmMapper; class XSECAlgorithmHandler; #include /** * \brief High level library interface class. * @ingroup internal * * This class is used primarily to initialise the library and * communicate high level parameters that will be common to all * objects from the class in any given session. * * It is primarily a static class. */ class DSIG_EXPORT XSECPlatformUtils { public : /** * \brief Number of times initialise has been called * * initCount can be read by any class or function to determine how * many times the library has been initialised. */ static int initCount; /** * \brief The main cryptographic provider * * This pointer can be used to determine the primary crypto * provider registered in the library. * * Individual signatures can over-ride this default. * */ static XSECCryptoProvider * g_cryptoProvider; /** * \brief The global Algorithm Mapper * * The algorithm mapper is used to map algorithm type URI strings * to algorithm implementations. Note that this is a level of * indirection above actual cryptographic algorithms. For example: * * URI = http://www.w3.org/2001/04/xmlenc#tripledes-cbc * * is the URI for 3DES in CBC mode. The mapper will return an * algorithm handler that understands what this means in terms of * IVs and how to call the XSECCryptoKey interface. It then uses the * cryptographic provider to actually perform the encryption. * * This allows applications to provide new algorithm types. The * mapper is used to map the type string to the means of doing the * encryption, and a new XSECCryptoKey derivative can be provided * to perform the actual crypo work. * * @note The provider should only be added to via the * XSECPlatformUtils::registerAlgorithmHandler() call. * * @see #addAlgorithmHandler() */ static const XSECAlgorithmMapper * g_algorithmMapper; /** * \brief Initialise the library * * Must be called prior to using any functions in the library. * * Primarily sets up static variables used by all classes in the * library. * * @param p A pointer to a XSECCryptoProvider object that the library * should use for cryptographic functions. If p == NULL, the library * will instantiate an OpenSSLCryptoProvider object. */ static void Initialise(XSECCryptoProvider * p = NULL); /** * \brief Set a new crypto provider * * Set the crypto provider to the value passed in. Any current provider * is deleted. * * @note This is not thread-safe. It should be called prior to any real * usage of the library. * * @param p A pointer to a XSECCryptoProvider object that the library * should use for cryptographic functions. * @note Ownership of the provider is passed to the library, which will * delete it at Termination. */ static void SetCryptoProvider(XSECCryptoProvider * p); /** * \brief Add a new algorithm Handler * * Application developers can extend the XSECAlgorithmHandler class to * implement new cryptographic algorithms. This will then allow the * library to call the provided handler whenever trying to process a * type it doesn't understand. * * Any handler previously registered for this URI will be overwritten, * allowing callers to overwrite the handlers for default URIs. * * @see XSECAlgorithmHandler * @note This is not thread safe. Algorithm handlers should * be added prior to any processing of signatures etc. * @param uri Type URI that maps to this handler * @param handler The handler to be used whenever this URI is seen by * the library. */ static void registerAlgorithmHandler(const XMLCh * uri, const XSECAlgorithmHandler & handler); /** * \brief Indicate an algorithm is approved for use, implying others are not. * * @see XSECAlgorithmHandler * @note This is not thread safe. Algorithms should * be whitelisted prior to any processing of signatures etc. * @param URI algorithm to whitelist */ static void whitelistAlgorithm(const XMLCh* URI); /** * \brief Indicate an algorithm is not approved for use, implying others are. * * @see XSECAlgorithmHandler * @note This is not thread safe. Algorithms should * be blacklisted prior to any processing of signatures etc. * @param URI algorithm to blacklist */ static void blacklistAlgorithm(const XMLCh* URI); typedef TXFMBase* TransformFactory(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument*); /** * \brief Installs logging support during Reference processing * * The function provided will be called during Reference computation * to obtain a transform interface to place at the end of the * transform chain. It will be given the chance to log or preserve * the result of applying transforms to References during signing * and verification operations. */ static void SetReferenceLoggingSink(TransformFactory* factory); /** * \brief Returns a transform for logging of Reference processing * * @param doc the DOM document containing the data being processed * @return a transform to install for logging of Reference data, or NULL */ static TXFMBase* GetReferenceLoggingSink(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* doc); /** * \brief Terminate * * Should be called prior to any program exist to allow the library * to cleanly delete any memory associated with the library as a whole. * * @note Do not call this function while any xml-security-c object * remain instantiated. The results of doing so is undefined, and could * cause bad results. */ static void Terminate(void); private: static TransformFactory* g_loggingSink; }; #endif /* XSECPLATFORMUTILS_INCLUDE */ xml-security-c-1.7.3/xsec/utils/XSECBinTXFMInputStream.cpp000644 001751 001751 00000005356 12003301052 024464 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinTXFMInputStream := Implement the BinInputStream around Transforms. * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include #include #include #include // --------------------------------------------------------------------------- // Constructors/Destructors // --------------------------------------------------------------------------- XSECBinTXFMInputStream::XSECBinTXFMInputStream(TXFMChain * lst, bool deleteWhenDone) : mp_txfm(lst->getLastTxfm()), mp_chain(lst), m_deleteWhenDone(deleteWhenDone), m_deleted(false), m_done(false), m_currentIndex(0) { if (mp_txfm->getOutputType() != TXFMBase::BYTE_STREAM) { throw XSECException(XSECException::TransformError, "Cannot wrapper a non BYTE_STREAM TXFM with XSECBinTXFMInputStream"); } } XSECBinTXFMInputStream::~XSECBinTXFMInputStream() { if (m_deleteWhenDone == true && m_deleted == false) { delete mp_chain; m_deleted = true; } } // --------------------------------------------------------------------------- // Stream methods // --------------------------------------------------------------------------- void XSECBinTXFMInputStream::reset(void) {} #ifdef XSEC_XERCES_64BITSAFE XMLFilePos #else unsigned int #endif XSECBinTXFMInputStream::curPos() const { return m_currentIndex; } xsecsize_t XSECBinTXFMInputStream::readBytes(XMLByte* const toFill, const xsecsize_t maxToRead) { if (m_done == true) return 0; xsecsize_t bytesRead = mp_txfm->readBytes(toFill, maxToRead); if (bytesRead == 0) { if (m_deleteWhenDone) { delete mp_chain; mp_txfm = 0; mp_chain = 0; m_deleted = true; } m_done = true; } m_currentIndex += bytesRead; return bytesRead; } #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* XSECBinTXFMInputStream::getContentType() const { return NULL; } #endif xml-security-c-1.7.3/xsec/utils/XSECXPathNodeList.cpp000644 001751 001751 00000027731 12003301052 023550 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECXPathNodeList := A structure to hold node lists from XPath * evaluations * * $Id: XSECXPathNodeList.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors. // -------------------------------------------------------------------------------- XSECXPathNodeList::XSECXPathNodeList(unsigned int initialSize) { m_num = 0; mp_tree = NULL; } XSECXPathNodeList::XSECXPathNodeList(const XSECXPathNodeList &other) { m_num = other.m_num; mp_tree = copy_tree(other.mp_tree); mp_current = NULL; } XSECXPathNodeList::~XSECXPathNodeList() { // Delete all the elements in the node list delete_tree(mp_tree); } XSECXPathNodeList & XSECXPathNodeList::operator= (const XSECXPathNodeList & toCopy) { // For now simply delete the old list and set with the new // Large overhead as we call other functions, but simplest way to // implement for now mp_tree = copy_tree(toCopy.mp_tree); m_num = toCopy.m_num; mp_current = NULL; return *this; } // -------------------------------------------------------------------------------- // Utility Functions. // -------------------------------------------------------------------------------- XSECXPathNodeList::btn * XSECXPathNodeList::findNodeIndex(const DOMNode *n) const { btn * t = mp_tree; while (t != NULL && t->v != n) { if (n > t->v) t = t->r; else t = t->l; } return t; } void XSECXPathNodeList::delete_tree(btn * t) { if (t == NULL) return; btn * parent, * n; n = t; while (n != NULL) { if (n->l) n = n->l; else if (n->r) n = n->r; else { parent = n->p; if (parent != NULL) { if (parent->l == n) parent->l = NULL; else parent->r = NULL; } // Delete this node delete n; n = parent; } } } XSECXPathNodeList::btn * XSECXPathNodeList::copy_tree(btn * t) const { if (t == NULL) return NULL; btn * n, *c, *cp, *ret; c = cp = NULL; n = t; bool create = true; ret = NULL; while (n != NULL) { if (create) { XSECnew(c, btn); c->l = NULL; c->r = NULL; c->v = n->v; // R we at top? if (ret == NULL) { ret = c; c->p = NULL; cp = NULL; } else { c->p = cp; if (cp != NULL) { if (n->p->l == n) cp->l = c; else cp->r = c; } } } // Go down! if (c->l == NULL && n->l != NULL) { cp = c; n = n->l; create = true; } else if (c->r == NULL && n->r != NULL) { cp = c; n = n->r; create = true; } else { // Go Back Up! n = n->p; c = cp; if (cp != NULL) cp = cp->p; create = false; } } return ret; } // -------------------------------------------------------------------------------- // Adding and Deleting Nodes. // -------------------------------------------------------------------------------- long XSECXPathNodeList::balance_count(btn * t) const { if (t == NULL) return 0; long r = (t->r == NULL ? 0 : t->r->h); long l = (t->l == NULL ? 0 : t->l->h); return r - l; } long XSECXPathNodeList::calc_height(btn * t) { if (t == NULL) return 0; if (t->l == NULL) { if (t->r == NULL) return 1; return t->r->h + 1; } else { if (t->r == NULL) return t->l->h + 1; } return ((t->l->h > t->r->h ? t->l->h : t->r->h) + 1); } void XSECXPathNodeList::rotate_right(btn * t) { // Rotate me right! btn * lc = t->l; // First - are we at the root? if (t == mp_tree) { lc->p = NULL; mp_tree = lc; } else { if (t->p->l == t) { t->p->l = lc; } else { t->p->r = lc; } lc->p = t->p; } // Do the rotate t->l = lc->r; if (t->l) t->l->p = t; lc->r = t; t->p = lc; // Recalculate heights lc = t; while (lc != NULL) { lc->h = calc_height(lc); lc = lc->p; } } void XSECXPathNodeList::rotate_left(btn * t) { // Rotate me left! btn * rc = t->r; // First - are we at the root? if (t == mp_tree) { rc->p = NULL; mp_tree = rc; } else { if (t->p->r == t) { t->p->r = rc; } else { t->p->l = rc; } rc->p = t->p; } // Do the rotate t->r = rc->l; if (t->r) t->r->p = t; rc->l = t; t->p = rc; // Recalculate heights rc = t; while (rc != NULL) { rc->h = calc_height(rc); rc = rc->p; } } void XSECXPathNodeList::addNode(const DOMNode *n) { btn * v; if (m_num == 0) { XSECnew(mp_tree, btn); mp_tree->l = mp_tree->r = NULL; mp_tree->v = n; mp_tree->p = NULL; mp_tree->h = 1; m_num = 1; return; } // Find the node btn * t = mp_tree; btn * last = NULL; while (t != NULL && t->v != n) { last = t; if (n > t->v) t = t->r; else t = t->l; } if (t != NULL) // Node already exists in tree! return; // Work out the insertion. XSECnew(v, btn); v->v = n; v->r = v->l = NULL; v->h = 1; v->p = last; // Determine on which leg to place the new value if (n > last->v) last->r = v; else last->l = v; // Recalculate heights t = last; long newh; while (t != NULL) { newh = calc_height(t); if (newh > t->h) { t->h = newh; t = t->p; } else // If the height is the same here, then nothing will have changed above t = NULL; } // Rebalance! t = last; while (t != NULL) { long bal = balance_count(t); long balrc = balance_count(t->r); long ballc = balance_count(t->l); // Case 1 - Balance is OK if (bal <= 1 && bal >= -1) { // Do nothing! } // Case 2a - Balance is -2 and LC = -1 else if (bal == -2 && ballc == -1) { // Rotate current node right rotate_right(t); } // Or balance is +2 and RC = +1 else if (bal == 2 && balrc == 1) { // Rotate current node left rotate_left(t); } // Case 2b = Balance is -2 and LC = +1 else if (bal == -2 && ballc == 1) { // Double Right rotation rotate_left(t->l); rotate_right(t); } else { rotate_right(t->r); rotate_left(t); } t = t->p; } } void XSECXPathNodeList::removeNode(const DOMNode *n) { btn * t, * last; last = NULL; btn * i = findNodeIndex(n); if (i == NULL) // Not found! return; // Delete from tree if (i == mp_tree) { // Bugger - we are at the top of the tree // OK - No children? if (i->l == NULL && i->r == NULL) { // WooHoo! Easy! delete mp_tree; mp_tree = NULL; } // One Child? if (i->l != NULL && i->r == NULL) { // WooHoo! Easy! mp_tree = i->l; mp_tree->p = NULL; delete i; } if (i->r != NULL && i->l == NULL) { // WooHoo! Easy! mp_tree = i->r; mp_tree->p = NULL; delete i; } // Oh dear = we have two children and now some heartache if (i->r->l == NULL && i->r->r == NULL) { // No subtree on right hand side. mp_tree = mp_tree->l; mp_tree->p = NULL; t = mp_tree->r; last = mp_tree; while (t != NULL) { last = t; if (i->r->v < t->v) t = t->l; else t = t->r; } if (i->r->v < last->v) { last->l = i->r; i->r->p = last; } else { last->r = i->r; i->r->p = last; } } else { // Need to find the "in-order" successor t = i->r; while (t != NULL) { last = t; t=t->l; } if (last == i->r) { // can't have been a left hand leg on the next node!) last->l = i->l; if (last->l != NULL) last->l->p = last; mp_tree = last; last->p = NULL; delete i; } else { // OK - Last is now the next biggest node, and it doesn;t // have anything on it's left (otherwise there would be something smaller) last->p->l = last->r; last->r->p = last->p; last->l = i->l; last->r = i->r; if (last->r != NULL) last->r->p = last; if (last->l != NULL) last->l->p = last; mp_tree = last; last->p = NULL; delete i; } } } else { /* i != mp_tree */ // OK - No children? if (i->l == NULL && i->r == NULL) { // WooHoo! Easy! if (i->p->l == i) i->p->l = NULL; else i->p->r = NULL; delete i; } // One Child? if (i->l != NULL && i->r == NULL) { // WooHoo! Easy! if (i->p->l == i) { i->p->l = i->l; i->l->p = i->p; } else { i->p->r = i->l; i->r->p = i->p; } delete i; } if (i->r != NULL && i->l == NULL) { // WooHoo! Easy! if (i->p->l == i) { i->p->l = i->r; i->r->p = i->p; } else { i->p->r = i->r; i->r->p = i->p; } delete i; } // Oh dear = we have two children and now some heartache if (i->r->l == NULL && i->r->r == NULL) { // No subtree on right hand side. if (i->p->l == i) { // Was left hand child i->p->l = i->l; i->l->p = i->p; t = i->l; // Find insertion point for dangling node while (t != NULL) { last = t; t = t->r; } last->r = i->r; i->r->p = last; } else { // Was right hand child i->p->r = i->l; i->l->p = i->p; t = i->l; // Find insertion point for dangling node while (t != NULL) { last = t; t = t->r; } last->r = i->r; i->r->p = last; } } else { // Subtree - so need to find the "in-order" successor t = i->r; while (t != NULL) { last = t; t=t->l; } // OK - Last is now the next biggest node, and it doesn;t // have anything on it's left (otherwise there would be something smaller) last->p->l = last->r; last->r->p = last->p; last->l = i->l; last->r = i->r; if (last->r != NULL) last->r->p = last; if (last->l != NULL) last->l->p = last; mp_tree = last; last->p = NULL; delete i; } } m_num--; } void XSECXPathNodeList::clear() { m_num = 0; delete_tree(mp_tree); mp_tree = NULL; } // -------------------------------------------------------------------------------- // Information functions. // -------------------------------------------------------------------------------- bool XSECXPathNodeList::hasNode(const DOMNode *n) const { btn * i = findNodeIndex(n); return (i != NULL); } const DOMNode *XSECXPathNodeList::getFirstNode(void) const { if (mp_tree == NULL) return NULL; // Find the smallest node mp_current = mp_tree; while (mp_current->l != NULL) mp_current = mp_current->l; return mp_current->v; } const DOMNode *XSECXPathNodeList::getNextNode(void) const { if (mp_current == NULL) return NULL; btn * t = mp_current; if (t->r != NULL) { // Find next biggest node t = t->r; while (t->l != NULL) t = t->l; mp_current = t; } else { // Go backwards! t = mp_current->p; while (t != NULL && t->r == mp_current) { mp_current = t; t = t->p; } if (t == NULL) { mp_current = NULL; return NULL; } mp_current = t; } return t->v; } // -------------------------------------------------------------------------------- // Intersect with another list // -------------------------------------------------------------------------------- void XSECXPathNodeList::intersect(const XSECXPathNodeList &toIntersect) { // Create a new list XSECXPathNodeList ret; const DOMNode * n = getFirstNode(); while (n != NULL) { if (toIntersect.hasNode(n)) ret.addNode(n); n = getNextNode(); } // Swap lists btn * t = mp_tree; mp_tree = ret.mp_tree; ret.mp_tree = t; m_num = ret.m_num; return; } xml-security-c-1.7.3/xsec/utils/XSECSafeBuffer.cpp000644 001751 001751 00000035671 12003301052 023074 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSafeBuffer := a class for storing expanding amounts of information. * * Author(s): Berin Lautenbach * * $Id: XSECSafeBuffer.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC includes #include #include #include #include #include XSEC_USING_XERCES(XMLString); // Standard includes #include #include size_t safeBuffer::size_XMLCh; #if defined (_MSC_VER) #pragma warning(disable: 4311) #endif void safeBuffer::checkAndExpand(xsecsize_t size) { // For a given size, check it will fit (with one byte spare) // and expand if necessary if (size + 1 < bufferSize) return; // Make the new size twice the size of the new string requirement xsecsize_t newBufferSize = size * 2; unsigned char * newBuffer = new unsigned char[newBufferSize]; memset((void *) newBuffer, 0, newBufferSize); memcpy(newBuffer, buffer, bufferSize); // If we are sensitive, clean the old buffer if (m_isSensitive == true) cleanseBuffer(); // clean up bufferSize = newBufferSize; delete[] buffer; buffer = newBuffer; } void safeBuffer::checkBufferType(bufferType bt) const { if (bt != m_bufferType) { throw XSECException(XSECException::SafeBufferError, "Attempt to perform an operation on a buffer of incorrect type"); } } void safeBuffer::setBufferType(bufferType bt) { m_bufferType = bt; } void safeBuffer::resize(xsecsize_t sz) { checkAndExpand(sz); } safeBuffer::safeBuffer(xsecsize_t initialSize) { // Initialise the buffer with a set size string bufferSize = initialSize; buffer = new unsigned char[initialSize]; memset((void *) buffer, 0, bufferSize); mp_XMLCh = NULL; m_isSensitive = false; } safeBuffer::safeBuffer() { bufferSize = DEFAULT_SAFE_BUFFER_SIZE; buffer = new unsigned char[bufferSize]; memset((void *) buffer, 0, bufferSize); mp_XMLCh = NULL; m_bufferType = BUFFER_UNKNOWN; m_isSensitive = false; } safeBuffer::safeBuffer(const char * inStr, xsecsize_t initialSize) { // Initialise with a string bufferSize = ((xsecsize_t) strlen(inStr) > initialSize ? (xsecsize_t) (strlen(inStr) * 2) : initialSize); buffer = new unsigned char[bufferSize]; memset((void *) buffer, 0, bufferSize); strcpy((char *) buffer, inStr); mp_XMLCh = NULL; m_bufferType = BUFFER_CHAR; m_isSensitive = false; } safeBuffer::safeBuffer(const safeBuffer & other) { // Copy constructor bufferSize = other.bufferSize; buffer = new unsigned char [bufferSize]; memcpy(buffer, other.buffer, bufferSize); if (other.mp_XMLCh != NULL) { mp_XMLCh = XMLString::replicate(other.mp_XMLCh); } else { mp_XMLCh = NULL; } m_bufferType = other.m_bufferType; m_isSensitive = other.m_isSensitive; } safeBuffer::~safeBuffer() { if (buffer != NULL) { if (m_isSensitive == true) cleanseBuffer(); delete[] buffer; } if (mp_XMLCh != NULL) XSEC_RELEASE_XMLCH(mp_XMLCh); } void safeBuffer::init (void) { size_XMLCh = sizeof(XMLCh); } // "IN" functions - these read in information to the buffer void safeBuffer::sbStrcpyIn(const char * inStr) { // Copy a string into the safe buffer checkAndExpand((xsecsize_t) strlen(inStr)); strcpy((char *) buffer, inStr); m_bufferType = BUFFER_CHAR; } void safeBuffer::sbStrcpyIn(const safeBuffer & inStr) { inStr.checkBufferType(BUFFER_CHAR); checkAndExpand((xsecsize_t) strlen((char *) inStr.buffer)); strcpy((char *) buffer, (char *) inStr.buffer); m_bufferType = BUFFER_CHAR; } void safeBuffer::sbStrncpyIn(const char * inStr, xsecsize_t n) { xsecsize_t len = (xsecsize_t) strlen(inStr); checkAndExpand((n < len) ? n : len); strncpy((char *) buffer, inStr, n); m_bufferType = BUFFER_CHAR; } void safeBuffer::sbStrncpyIn(const safeBuffer & inStr, xsecsize_t n) { inStr.checkBufferType(BUFFER_CHAR); checkAndExpand(n); strncpy((char *) buffer, (char *) inStr.buffer, n); buffer[n] = '\0'; m_bufferType = BUFFER_CHAR; } void safeBuffer::sbStrcatIn(const char * inStr) { checkBufferType(BUFFER_CHAR); checkAndExpand((xsecsize_t) (strlen((char *) buffer) + strlen(inStr))); strcat((char *) buffer, inStr); } void safeBuffer::sbStrcatIn(const safeBuffer & inStr) { checkBufferType(BUFFER_CHAR); checkAndExpand((xsecsize_t) (strlen((char *) buffer) + strlen((char *) inStr.buffer) + 2)); strcat((char *) buffer, (char *) inStr.buffer); } void safeBuffer::sbStrncatIn(const char * inStr, xsecsize_t n) { checkBufferType(BUFFER_CHAR); xsecsize_t len = (xsecsize_t) strlen(inStr); checkAndExpand(((n < len) ? n : len) + (xsecsize_t) strlen((char *) buffer) + 2); strncat((char *) buffer, inStr, n); } void safeBuffer::sbMemcpyIn(const void * inBuf, xsecsize_t n) { checkAndExpand(n); memcpy(buffer, inBuf, n); m_bufferType = BUFFER_UNKNOWN; } void safeBuffer::sbMemcpyIn(xsecsize_t offset, const void * inBuf, xsecsize_t n) { checkAndExpand(n + offset); memcpy(&buffer[offset], inBuf, n); m_bufferType = BUFFER_UNKNOWN; } void safeBuffer::sbStrinsIn(const char * inStr, xsecsize_t offset) { checkBufferType(BUFFER_CHAR); xsecsize_t bl = (xsecsize_t) strlen((char *) buffer); xsecsize_t il = (xsecsize_t) strlen((char *) inStr); if (offset > bl) { throw XSECException(XSECException::SafeBufferError, "Attempt to insert string after termination point"); } checkAndExpand(bl + il); memmove(&buffer[offset + il], &buffer[offset], bl - offset + 1); memcpy(&buffer[offset], inStr, il); } void safeBuffer::sbStrinsIn(const XMLCh * inStr, xsecsize_t offset) { checkBufferType(BUFFER_UNICODE); xsecsize_t bl = XMLString::stringLen((XMLCh *) buffer) * size_XMLCh; xsecsize_t il = XMLString::stringLen((XMLCh *) inStr) * size_XMLCh; xsecsize_t xoffset = offset * size_XMLCh; if (xoffset > bl) { throw XSECException(XSECException::SafeBufferError, "Attempt to insert string after termination point"); } checkAndExpand(bl + il); memmove(&buffer[xoffset + il], &buffer[xoffset], bl - xoffset + size_XMLCh); memcpy(&buffer[xoffset], inStr, il); } void safeBuffer::sbMemcpyOut(void *outBuf, xsecsize_t n) const { // WARNING - JUST ASSUMES OUTPUT BUFFER LONG ENOUGH // ALSO MAKES NO ASSUMPTION OF THE BUFFER TYPE memcpy(outBuf, buffer, n); } void safeBuffer::sbMemshift(xsecsize_t toOffset, xsecsize_t fromOffset, xsecsize_t len) { // Move data in the buffer around checkAndExpand(len + (toOffset > fromOffset ? toOffset : fromOffset)); memmove(&buffer[toOffset], &buffer[fromOffset], len); } // Comparisons int safeBuffer::sbStrncmp(const char *inStr, xsecsize_t n) const { checkBufferType(BUFFER_CHAR); return (strncmp((char *) buffer, inStr, n)); } int safeBuffer::sbStrcmp(const char *inStr) const { checkBufferType(BUFFER_CHAR); return (strcmp((char *) buffer, inStr)); } int safeBuffer::sbStrcmp(const safeBuffer & inStr) const { checkBufferType(BUFFER_CHAR); return (strcmp((char *) buffer, (char *) inStr.buffer)); } int safeBuffer::sbOffsetStrcmp(const char * inStr, xsecsize_t offset) const { checkBufferType(BUFFER_CHAR); xsecsize_t bl = (xsecsize_t) strlen((char *) buffer); if (offset > bl) return -1; return (strcmp((char *) &buffer[offset], inStr)); } int safeBuffer::sbOffsetStrncmp(const char * inStr, xsecsize_t offset, xsecsize_t n) const { checkBufferType(BUFFER_CHAR); xsecsize_t bl = (xsecsize_t) strlen((char *) buffer); if (offset > bl) return -1; return (strncmp((char *) &buffer[offset], inStr, n)); } #ifdef XSEC_XERCES_64BITSAFE long safeBuffer::sbStrstr(const char * inStr) const { #else int safeBuffer::sbStrstr(const char * inStr) const { #endif checkBufferType(BUFFER_CHAR); char* p = strstr((char *) buffer, inStr); if (p == NULL) return -1; long d = (unsigned long) p - (unsigned long) buffer; if (d < 0 || d > bufferSize) return -1; return d; } #ifdef XSEC_XERCES_64BITSAFE long safeBuffer::sbStrstr(const XMLCh * inStr) const { #else int safeBuffer::sbStrstr(const XMLCh * inStr) const { #endif checkBufferType(BUFFER_UNICODE); XMLCh* p = XMLString::findAny((XMLCh *) buffer, inStr); if (p == NULL) return -1; long d = ((unsigned long) ((p - (unsigned long) buffer)) / size_XMLCh); if (d < 0 || d > bufferSize) return -1; return d; } #ifdef XSEC_XERCES_64BITSAFE long safeBuffer::sbOffsetStrstr(const char * inStr, xsecsize_t offset) const { #else int safeBuffer::sbOffsetStrstr(const char * inStr, xsecsize_t offset) const { #endif checkBufferType(BUFFER_CHAR); xsecsize_t bl = (xsecsize_t) strlen((char *) buffer); if (offset > bl) return -1; char* p = strstr((char *) &buffer[offset], inStr); if (p == NULL) return -1; long d = (unsigned long) p - (unsigned long) buffer; if (d < 0 || d > bufferSize) return -1; return d; } // XMLCh and char common functions void safeBuffer::sbStrlwr(void) { if (m_bufferType == BUFFER_UNKNOWN) { throw XSECException(XSECException::SafeBufferError, "Attempt to perform an operation on a buffer of incorrect type"); } if (m_bufferType == BUFFER_CHAR) { xsecsize_t i, l = (xsecsize_t) strlen((char *) buffer); for (i = 0; i < l; ++i) { if (buffer[i] >= 'A' && buffer[i] <= 'Z') buffer[i] = (buffer[i] - 'A') + 'a'; } } else { XMLCh * b = (XMLCh *) buffer; xsecsize_t i, l = XMLString::stringLen(b); for (i = 0; i < l; ++i) { if (b[i] >= XERCES_CPP_NAMESPACE_QUALIFIER chLatin_A && b[i] <= XERCES_CPP_NAMESPACE_QUALIFIER chLatin_Z) b[i] = (b[i] - XERCES_CPP_NAMESPACE_QUALIFIER chLatin_A) + XERCES_CPP_NAMESPACE_QUALIFIER chLatin_a; } } } // Operators unsigned char & safeBuffer::operator[](xsecsize_t n) { // If the character is outside our range (but +ve), then simply increase // the buffer size - NOTE: it is not our problem if the caller does // not realise they are outside the buffer, we are simply trying to ensure // the call is "safe" checkAndExpand(n); return buffer[n]; } safeBuffer & safeBuffer::operator= (const safeBuffer & cpy) { if (bufferSize != cpy.bufferSize) { if (bufferSize != 0) { if (m_isSensitive == true) cleanseBuffer(); delete [] buffer; } buffer = new unsigned char [cpy.bufferSize]; bufferSize = cpy.bufferSize; } memcpy(buffer, cpy.buffer, bufferSize); m_bufferType = cpy.m_bufferType; // Once we are sensitive, we are always sensitive m_isSensitive = m_isSensitive || cpy.m_isSensitive; return *this; } safeBuffer & safeBuffer::operator= (const XMLCh * inStr) { checkAndExpand(XMLString::stringLen(inStr) * size_XMLCh); XMLString::copyString((XMLCh *) buffer, inStr); m_bufferType = BUFFER_UNICODE; return *this; } safeBuffer & safeBuffer::operator << (TXFMBase * t) { // Read into buffer the output of the transform xsecsize_t offset = 0; unsigned char inBuf[2048]; xsecsize_t bytesRead; while ((bytesRead = t->readBytes(inBuf, 2000)) > 0) { checkAndExpand(offset + bytesRead + 1); memcpy(&buffer[offset], inBuf, bytesRead); offset += bytesRead; } m_bufferType = BUFFER_CHAR; buffer[offset] = '\0'; return *this; } // Unicode Functions const XMLCh * safeBuffer::sbStrToXMLCh(void) const { checkBufferType(BUFFER_CHAR); if (mp_XMLCh != NULL) XSEC_RELEASE_XMLCH(mp_XMLCh); mp_XMLCh = XMLString::transcode((char *) buffer); return mp_XMLCh; } void safeBuffer::sbTranscodeIn(const XMLCh * inStr) { // Transcode the string to the local code page and store in the buffer char * t; t = XMLString::transcode(inStr); assert (t != 0); // Now copy into our local buffer - a bit inefficient but better in the long run // as a buffer that is the exact size is likely to be deleted anyway during a // concat operation xsecsize_t len = (xsecsize_t) strlen(t) + 1; checkAndExpand(len); strcpy((char *) buffer, t); m_bufferType = BUFFER_CHAR; XSEC_RELEASE_XMLCH(t); } void safeBuffer::sbTranscodeIn(const char * inStr) { // Transcode the string to the local code page and store in the buffer XMLCh * t; t = XMLString::transcode(inStr); assert (t != 0); // Copy into local buffer xsecsize_t len = XMLString::stringLen(t) + 1; len *= (xsecsize_t) size_XMLCh; checkAndExpand(len); XMLString::copyString((XMLCh *) buffer, t); m_bufferType = BUFFER_UNICODE; XSEC_RELEASE_XMLCH(t); } void safeBuffer::sbXMLChIn(const XMLCh * in) { checkAndExpand((XMLString::stringLen(in) + 1) * size_XMLCh); XMLString::copyString((XMLCh *) buffer, in); m_bufferType = BUFFER_UNICODE; } void safeBuffer::sbXMLChAppendCh(const XMLCh c) { checkBufferType(BUFFER_UNICODE); xsecsize_t len = XMLString::stringLen((XMLCh *) buffer); checkAndExpand((len + 2) * size_XMLCh); ((XMLCh *) buffer)[len++] = c; ((XMLCh *) buffer)[len] = 0; } void safeBuffer::sbXMLChCat(const XMLCh *str) { checkBufferType(BUFFER_UNICODE); xsecsize_t len = XMLString::stringLen((XMLCh *) buffer) * size_XMLCh; len += XMLString::stringLen(str) * size_XMLCh; len += (2 * ((xsecsize_t) size_XMLCh)); checkAndExpand(len); XMLString::catString((XMLCh *) buffer, str); } void safeBuffer::sbXMLChCat(const char * str) { checkBufferType(BUFFER_UNICODE); xsecsize_t len = XMLString::stringLen((XMLCh *) buffer) * size_XMLCh; XMLCh * t = XMLString::transcode(str); assert (t != NULL); len += XMLString::stringLen(t); len += (xsecsize_t) (2 * size_XMLCh); checkAndExpand(len); XMLString::catString((XMLCh *) buffer, t); XSEC_RELEASE_XMLCH(t); } void safeBuffer::sbXMLChCat8(const char * str) { checkBufferType(BUFFER_UNICODE); XMLCh * toAdd = transcodeFromUTF8((const unsigned char *) str); sbXMLChCat(toAdd); XSEC_RELEASE_XMLCH(toAdd); } // Get functions xsecsize_t safeBuffer::sbStrlen(void) const { checkBufferType(BUFFER_CHAR); return (xsecsize_t) (strlen ((char *) buffer)); } xsecsize_t safeBuffer::sbRawBufferSize(void) const { return bufferSize; } // raw buffer manipulation const unsigned char * safeBuffer::rawBuffer() const { return buffer; } const char * safeBuffer::rawCharBuffer() const { return (char *) buffer; } const XMLCh * safeBuffer::rawXMLChBuffer() const { return (XMLCh *) buffer; } // Sensitive data functions void safeBuffer::isSensitive(void) { m_isSensitive = true; } void safeBuffer::cleanseBuffer(void) { // Cleanse the main buffer for (xsecsize_t i = 0; i < bufferSize; ++i) buffer[i] = 0; } xml-security-c-1.7.3/xsec/utils/XSECTXFMInputSource.cpp000644 001751 001751 00000004013 12003301052 024025 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECTXFMInputSource := Transfomer InputSource for Xerces Parser. * * $Id: XSECTXFMInputSource.cpp 1125514 2011-05-20 19:08:33Z scantor $ * * */ #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XSECTXFMInputSource::XSECTXFMInputSource(TXFMChain * chain, bool deleteWhenDone) : mp_chain(chain), m_deleteWhenDone(deleteWhenDone) { } XSECTXFMInputSource::~XSECTXFMInputSource() { } // -------------------------------------------------------------------------------- // Create the stream // -------------------------------------------------------------------------------- BinInputStream* XSECTXFMInputSource::makeStream() const { XSECBinTXFMInputStream * ret; // Have to do direct due to strange issues with MSVC++ and DEBUG_NEW ret = new XSECBinTXFMInputStream(mp_chain, m_deleteWhenDone); return ret; } xml-security-c-1.7.3/xsec/utils/XSECDOMUtils.cpp000644 001751 001751 00000044115 12003301052 022515 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECDOMUtils:= Utilities to manipulate DOM within XML-SECURITY * * $Id: XSECDOMUtils.cpp 1350044 2012-06-13 22:31:37Z scantor $ * */ // XSEC #include #include #include // Xerces #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Utilities to manipulate DSIG namespaces // -------------------------------------------------------------------------------- const XMLCh * getDSIGLocalName(const DOMNode *node) { if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIDSIG)) return NULL; //DOMString(""); else return node->getLocalName(); } const XMLCh * getDSIG11LocalName(const DOMNode *node) { if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIDSIG11)) return NULL; //DOMString(""); else return node->getLocalName(); } const XMLCh * getECLocalName(const DOMNode * node) { // Exclusive Canonicalisation namespace // Probably should have a generic function if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIEC)) return NULL; else return node->getLocalName(); } const XMLCh * getXPFLocalName(const DOMNode * node) { // XPath Filter namespace if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIXPF)) return NULL; else return node->getLocalName(); } const XMLCh * getXENCLocalName(const DOMNode *node) { // XML Encryption namespace node if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIXENC)) return NULL; else return node->getLocalName(); } const XMLCh * getXENC11LocalName(const DOMNode *node) { // XML Encryption 1.1 namespace node if (!strEquals(node->getNamespaceURI(), DSIGConstants::s_unicodeStrURIXENC11)) return NULL; else return node->getLocalName(); } const XMLCh * getXKMSLocalName(const DOMNode *node) { // XKMS namespace node if (!strEquals(node->getNamespaceURI(), XKMSConstants::s_unicodeStrURIXKMS)) return NULL; else return node->getLocalName(); } // -------------------------------------------------------------------------------- // Find a nominated DSIG node in a document // -------------------------------------------------------------------------------- DOMNode *findDSIGNode(DOMNode *n, const char * nodeName) { const XMLCh * name = getDSIGLocalName(n); if (strEquals(name, nodeName)) { return n; } DOMNode *child = n->getFirstChild(); while (child != NULL) { DOMNode *ret = findDSIGNode(child, nodeName); if (ret != NULL) return ret; child = child->getNextSibling(); } return child; } // -------------------------------------------------------------------------------- // Find a nominated XENC node in a document // -------------------------------------------------------------------------------- DOMNode *findXENCNode(DOMNode *n, const char * nodeName) { const XMLCh * name = getXENCLocalName(n); if (strEquals(name, nodeName)) { return n; } DOMNode *child = n->getFirstChild(); while (child != NULL) { DOMNode *ret = findXENCNode(child, nodeName); if (ret != NULL) return ret; child = child->getNextSibling(); } return child; } // -------------------------------------------------------------------------------- // Find particular type of node child // -------------------------------------------------------------------------------- DOMNode *findFirstChildOfType(DOMNode *n, DOMNode::NodeType t) { DOMNode *c; if (n == NULL) return n; c = n->getFirstChild(); while (c != NULL && c->getNodeType() != t) c = c->getNextSibling(); return c; } DOMNode * findNextChildOfType(DOMNode *n, DOMNode::NodeType t) { DOMNode * s = n; if (s == NULL) return s; do { s = s->getNextSibling(); } while (s != NULL && s->getNodeType() != t); return s; } DOMElement *findFirstElementChild(DOMNode *n) { DOMNode *c; if (n == NULL) return NULL; c = n->getFirstChild(); while (c != NULL && c->getNodeType() != DOMNode::ELEMENT_NODE) c = c->getNextSibling(); return (DOMElement *) c; } DOMElement * findNextElementChild(DOMNode *n) { DOMNode * s = n; if (s == NULL) return NULL; do { s = s->getNextSibling(); } while (s != NULL && s->getNodeType() != DOMNode::ELEMENT_NODE); return (DOMElement *) s; } // -------------------------------------------------------------------------------- // Make a QName // -------------------------------------------------------------------------------- safeBuffer &makeQName(safeBuffer & qname, safeBuffer &prefix, const char * localName) { if (prefix[0] == '\0') { qname = localName; } else { qname = prefix; qname.sbStrcatIn(":"); qname.sbStrcatIn(localName); } return qname; } safeBuffer &makeQName(safeBuffer & qname, const XMLCh *prefix, const char * localName) { if (prefix == NULL || prefix[0] == 0) { qname.sbTranscodeIn(localName); } else { qname.sbXMLChIn(prefix); qname.sbXMLChAppendCh(XERCES_CPP_NAMESPACE_QUALIFIER chColon); qname.sbXMLChCat(localName); // Will transcode } return qname; } safeBuffer &makeQName(safeBuffer & qname, const XMLCh *prefix, const XMLCh * localName) { if (prefix == NULL || prefix[0] == 0) { qname.sbXMLChIn(localName); } else { qname.sbXMLChIn(prefix); qname.sbXMLChAppendCh(XERCES_CPP_NAMESPACE_QUALIFIER chColon); qname.sbXMLChCat(localName); } return qname; } // -------------------------------------------------------------------------------- // "Quick" Transcode (low performance) // -------------------------------------------------------------------------------- XMLT::XMLT(const char * str) { mp_unicodeStr = XMLString::transcode(str); } XMLT::~XMLT (void) { XSEC_RELEASE_XMLCH(mp_unicodeStr); } XMLCh * XMLT::getUnicodeStr(void) { return mp_unicodeStr; } // -------------------------------------------------------------------------------- // Gather text from children // -------------------------------------------------------------------------------- void gatherChildrenText(DOMNode * parent, safeBuffer &output) { DOMNode * c = parent->getFirstChild(); output.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); while (c != NULL) { if (c->getNodeType() == DOMNode::TEXT_NODE) output.sbXMLChCat(c->getNodeValue()); c = c->getNextSibling(); } } // -------------------------------------------------------------------------------- // Some UTF8 utilities // -------------------------------------------------------------------------------- XMLCh * transcodeFromUTF8(const unsigned char * src) { // Take a UTF-8 buffer and transcode to UTF-16 safeBuffer fullDest; fullDest.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); XMLCh outputBuf[2050]; // Used to record byte sizes unsigned char charSizes[2050]; // Grab a transcoder XMLTransService::Codes failReason; #if defined(XSEC_XERCES_REQUIRES_MEMMGR) XMLTranscoder* t = XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8", failReason, 2*1024, XMLPlatformUtils::fgMemoryManager); #else XMLTranscoder* t = XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8", failReason, 2*1024); #endif Janitor j_t(t); // Need to loop through, 2K at a time xsecsize_t bytesEaten, bytesEatenCounter; xsecsize_t charactersEaten; xsecsize_t totalBytesEaten = 0; xsecsize_t bytesToEat = XMLString::stringLen((char *) src); while (totalBytesEaten < bytesToEat) { xsecsize_t toEat = bytesToEat - totalBytesEaten; if (toEat > 2048) toEat = 2048; t->transcodeFrom(&src[totalBytesEaten], toEat, outputBuf, 2048, bytesEaten, charSizes); // Determine how many characters were used bytesEatenCounter = 0; charactersEaten = 0; while (bytesEatenCounter < bytesEaten) { bytesEatenCounter += charSizes[charactersEaten++]; } outputBuf[charactersEaten] = chNull; fullDest.sbXMLChCat(outputBuf); totalBytesEaten += bytesEaten; } // Dup and output return XMLString::replicate(fullDest.rawXMLChBuffer()); } char DSIG_EXPORT * transcodeToUTF8(const XMLCh * src) { // Take a UTF-16 buffer and transcode to UTF-8 safeBuffer fullDest(""); unsigned char outputBuf[2050]; // Grab a transcoder XMLTransService::Codes failReason; #if defined(XSEC_XERCES_REQUIRES_MEMMGR) XMLTranscoder* t = XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8", failReason, 2*1024, XMLPlatformUtils::fgMemoryManager); #else XMLTranscoder* t = XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF-8", failReason, 2*1024); #endif Janitor j_t(t); // Need to loop through, 2K at a time xsecsize_t charactersEaten, charactersOutput; xsecsize_t totalCharsEaten = 0; xsecsize_t charsToEat = XMLString::stringLen(src); while (totalCharsEaten < charsToEat) { xsecsize_t toEat = charsToEat - totalCharsEaten; if (toEat > 2048) toEat = 2048; charactersOutput = t->transcodeTo(&src[totalCharsEaten], toEat, (unsigned char * const) outputBuf, 2048, charactersEaten, XMLTranscoder::UnRep_RepChar); outputBuf[charactersOutput] = '\0'; fullDest.sbStrcatIn((char *) outputBuf); totalCharsEaten += charactersEaten; } // Dup and output return XMLString::replicate(fullDest.rawCharBuffer()); } // -------------------------------------------------------------------------------- // String decode/encode // -------------------------------------------------------------------------------- /* * Distinguished names have a particular encoding that needs to be performed prior * to enclusion in the DOM */ XMLCh * encodeDName(const XMLCh * toEncode) { XERCES_CPP_NAMESPACE_USE; safeBuffer result; static XMLCh s_strEncodedSpace[] = { chBackSlash, chDigit_2, chDigit_0, chNull }; result.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); if (toEncode == NULL) { return NULL; } // Find where the trailing whitespace starts const XMLCh * ws = &toEncode[XMLString::stringLen(toEncode)]; *ws--; while (ws != toEncode && (*ws == '\t' || *ws == '\r' || *ws ==' ' || *ws == '\n')) *ws--; // Set to first white space character, if we didn't get back to the start if (toEncode != ws) *ws++; // Now run through each character and encode if necessary const XMLCh * i = toEncode; if (*i == chPound) { // "#" Characters escaped at the start of a string result.sbXMLChAppendCh(chBackSlash); } while (*i != chNull && i != ws) { if (*i <= 0x09) { result.sbXMLChAppendCh(chBackSlash); result.sbXMLChAppendCh(chDigit_0); result.sbXMLChAppendCh(chDigit_0 + *i); } else if (*i <= 0x0f) { result.sbXMLChAppendCh(chBackSlash); result.sbXMLChAppendCh(chDigit_0); result.sbXMLChAppendCh(chLatin_A + *i); } else if (*i <= 0x19) { result.sbXMLChAppendCh(chBackSlash); result.sbXMLChAppendCh(chDigit_1); result.sbXMLChAppendCh(chDigit_0 + *i); } else if (*i <= 0x1f) { result.sbXMLChAppendCh(chBackSlash); result.sbXMLChAppendCh(chDigit_1); result.sbXMLChAppendCh(chLatin_A + *i); } else if (*i == chComma) { // Determine if this is an RDN separator const XMLCh *j = i; *j++; while (*j != chComma && *j != chEqual && *j != chNull) *j++; if (*j != chEqual) result.sbXMLChAppendCh(chBackSlash); result.sbXMLChAppendCh(*i); } else { if (*i == chPlus || *i == chDoubleQuote || *i == chBackSlash || *i == chOpenAngle || *i == chCloseAngle || *i == chSemiColon) { result.sbXMLChAppendCh(chBackSlash); } result.sbXMLChAppendCh(*i); } *i++; } // Now encode trailing white space while (*i != chNull) { if (*i == ' ') result.sbXMLChCat(s_strEncodedSpace); else result.sbXMLChAppendCh(*i); *i++; } return XMLString::replicate(result.rawXMLChBuffer()); } XMLCh * decodeDName(const XMLCh * toDecode) { // Take an encoded name and decode to a normal XMLCh string XERCES_CPP_NAMESPACE_USE; safeBuffer result; result.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); if (toDecode == NULL) { return NULL; } const XMLCh * i = toDecode; if (*i == chBackSlash && i[1] == chPound) { result.sbXMLChAppendCh(chPound); *i++; *i++; } while (*i != chNull) { if (*i == chBackSlash) { *i++; if (*i == chDigit_0) { *i++; if (*i >= chDigit_0 && *i <= chDigit_9) { result.sbXMLChAppendCh(*i - chDigit_0); } else if (*i >= chLatin_A && *i <= chLatin_F) { result.sbXMLChAppendCh(10 + *i - chLatin_A); } else if (*i >= chLatin_a && *i <= chLatin_f) { result.sbXMLChAppendCh(10 + *i - chLatin_a); } else { throw XSECException(XSECException::DNameDecodeError, "Unexpected escaped character in Distinguished name"); } } else if (*i == chDigit_1) { *i++; if (*i >= chDigit_0 && *i <= chDigit_9) { result.sbXMLChAppendCh(16 + *i - chDigit_0); } else if (*i >= chLatin_A && *i <= chLatin_F) { result.sbXMLChAppendCh(26 + *i - chLatin_A); } else if (*i >= chLatin_a && *i <= chLatin_f) { result.sbXMLChAppendCh(26 + *i - chLatin_a); } else { throw XSECException(XSECException::DNameDecodeError, "Unexpected escaped character in Distinguished name"); } } else if (*i == chDigit_2) { *i++; if (*i == '0') { result.sbXMLChAppendCh(' '); } else { throw XSECException(XSECException::DNameDecodeError, "Unexpected escaped character in Distinguished name"); } } else if (*i == chComma || *i == chPlus || *i == chDoubleQuote || *i == chBackSlash || *i == chOpenAngle || *i == chCloseAngle || *i == chSemiColon) { result.sbXMLChAppendCh(*i); } else { throw XSECException(XSECException::DNameDecodeError, "Unexpected escaped character in Distinguished name"); } *i++; } else { result.sbXMLChAppendCh(*i++); } } return XMLString::replicate(result.rawXMLChBuffer()); } // -------------------------------------------------------------------------------- // Misc string functions // -------------------------------------------------------------------------------- // These three functions are pretty much lifted from XMLURL.cpp in Xerces static bool isHexDigit(const XMLCh toCheck) { if ((toCheck >= chDigit_0) && (toCheck <= chDigit_9) || (toCheck >= chLatin_A) && (toCheck <= chLatin_F) || (toCheck >= chLatin_a) && (toCheck <= chLatin_f)) { return true; } return false; } static unsigned int xlatHexDigit(const XMLCh toXlat) { if ((toXlat >= chDigit_0) && (toXlat <= chDigit_9)) return (unsigned int)(toXlat - chDigit_0); if ((toXlat >= chLatin_A) && (toXlat <= chLatin_F)) return (unsigned int)(toXlat - chLatin_A) + 10; return (unsigned int)(toXlat - chLatin_a) + 10; } XMLCh * cleanURIEscapes(const XMLCh * uriPath) { XMLByte *ptr, *utf8Path; xsecsize_t len = XMLString::stringLen(uriPath); ptr = utf8Path = new XMLByte[len + 1]; for (xsecsize_t i = 0; i < len; i++) { unsigned int value = uriPath[i]; if (value > 255) { delete[] utf8Path; throw XSECException(XSECException::ErrorOpeningURI, "Wide character in URI"); } if (value == chPercent) { if (!(i + 2 < len && isHexDigit(uriPath[i + 1]) && isHexDigit(uriPath[i + 2]))) { delete[] utf8Path; throw XSECException(XSECException::ErrorOpeningURI, "Bad escape sequence in URI"); } value = (xlatHexDigit(uriPath[i + 1]) * 16) + (xlatHexDigit(uriPath[i + 2])); i += 2; } *(ptr++) = (XMLByte) value; } *ptr = 0; try { XMLCh* unicodePath = transcodeFromUTF8(utf8Path); delete[] utf8Path; return unicodePath; } catch (XMLException&) { } delete[] utf8Path; throw XSECException(XSECException::ErrorOpeningURI, "Failed to transcode URI from UTF-8"); } // -------------------------------------------------------------------------------- // Generate Ids // -------------------------------------------------------------------------------- void makeHexByte(XMLCh * h, unsigned char b) { unsigned char toConvert = (b & 0xf0); toConvert = (toConvert >> 4); if (toConvert < 10) h[0] = chDigit_0 + toConvert; else h[0] = chLatin_a + toConvert - 10; toConvert = (b & 0xf); if (toConvert < 10) h[1] = chDigit_0 + toConvert; else h[1] = chLatin_a + toConvert - 10; } XMLCh * generateId(unsigned int bytes) { unsigned char b[128]; XMLCh id[258]; unsigned int toGen = (bytes > 128 ? 16 : bytes); // Get the appropriate amount of random data // Need to zeroise to ensure valgrind is happy memset(b, 0, 128); memset(id, 0, sizeof(id)); if (XSECPlatformUtils::g_cryptoProvider->getRandom(b, toGen) != toGen) { throw XSECException(XSECException::CryptoProviderError, "generateId - could not obtain enough random"); } id[0] = chLatin_I; unsigned int i; for (i = 0; i < toGen; ++i) { makeHexByte(&id[1+(i*2)], b[i]); } id[1+(i*2)] = chNull; return XMLString::replicate(id); } xml-security-c-1.7.3/xsec/utils/XSECSafeBufferFormatter.cpp000644 001751 001751 00000007535 12003301052 024756 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSafeBufferFormatter := Class for formatting DOMStrings into SafeBuffers * * $Id: XSECSafeBufferFormatter.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // Constructor XSECSafeBufferFormatter::XSECSafeBufferFormatter( const XMLCh * const outEncoding, const XMLFormatter::EscapeFlags escapeFlags, const XMLFormatter::UnRepFlags unrepFlags) { sbf = new sbFormatTarget(); sbf->setBuffer(&formatBuffer); #if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION) formatter = new XMLFormatter(outEncoding, 0, sbf, escapeFlags, unrepFlags); #else XSECnew(formatter, XMLFormatter(outEncoding, sbf, escapeFlags, unrepFlags)); #endif } XSECSafeBufferFormatter::XSECSafeBufferFormatter( const char * const outEncoding, const XMLFormatter::EscapeFlags escapeFlags, const XMLFormatter::UnRepFlags unrepFlags) { sbf = new sbFormatTarget(); sbf->setBuffer(&formatBuffer); #if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION) formatter = new XMLFormatter(outEncoding, 0, sbf, escapeFlags, unrepFlags); #else XSECnew(formatter, XMLFormatter(outEncoding, sbf, escapeFlags, unrepFlags)); #endif } // Destructor XSECSafeBufferFormatter::~XSECSafeBufferFormatter() { if (formatter != NULL) delete formatter; if (sbf != NULL) delete sbf; } // Reimplementation of XMLFormatter functions void XSECSafeBufferFormatter::formatBuf ( const XMLCh *const toFormat, const xsecsize_t count, const XMLFormatter::EscapeFlags escapeFlags, const XMLFormatter::UnRepFlags unrepFlags) { formatter->formatBuf(toFormat, count, escapeFlags, unrepFlags); } XSECSafeBufferFormatter& XSECSafeBufferFormatter::operator<< (const XMLCh *const toFormat) { sbf->reset(); *formatter << toFormat; return *this; } XSECSafeBufferFormatter& XSECSafeBufferFormatter::operator<< (const XMLCh toFormat) { sbf->reset(); *formatter << toFormat; return *this; } const XMLCh* XSECSafeBufferFormatter::getEncodingName ()const { return formatter->getEncodingName(); } void XSECSafeBufferFormatter::setEscapeFlags (const XMLFormatter::EscapeFlags newFlags) { formatter->setEscapeFlags(newFlags); } void XSECSafeBufferFormatter::setUnRepFlags (const XMLFormatter::UnRepFlags newFlags) { formatter->setUnRepFlags(newFlags); } XSECSafeBufferFormatter& XSECSafeBufferFormatter::operator<< (const XMLFormatter::EscapeFlags newFlags) { *formatter << newFlags; return *this; } XSECSafeBufferFormatter& XSECSafeBufferFormatter::operator<< (const XMLFormatter::UnRepFlags newFlags) { *formatter << newFlags; return *this; } // Friends for working with safestrings safeBuffer& operator<< (safeBuffer &to, const XSECSafeBufferFormatter & from) { // Simply copy out the format buffer, but zeroise the original first to = from.formatBuffer; return to; } xml-security-c-1.7.3/xsec/utils/XSECSOAPRequestorSimple.cpp000644 001751 001751 00000022710 12157707211 024721 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSOAPRequestorSimple := (Very) Basic implementation of a SOAP * HTTP wrapper for testing the client code. * * * $Id: XSECSOAPRequestorSimple.cpp 1493962 2013-06-17 22:32:41Z scantor $ * */ #include #include #include #include #include #include "../utils/XSECAutoPtr.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Strings for constructing SOAP envelopes // -------------------------------------------------------------------------------- static XMLCh s_prefix[] = { chLatin_e, chLatin_n, chLatin_v, chNull }; static XMLCh s_Envelope[] = { chLatin_E, chLatin_n, chLatin_v, chLatin_e, chLatin_l, chLatin_o, chLatin_p, chLatin_e, chNull }; static XMLCh s_Body[] = { chLatin_B, chLatin_o, chLatin_d, chLatin_y, chNull }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- /* NOTE: This is initialised via the platform specific code */ XSECSOAPRequestorSimple::~XSECSOAPRequestorSimple() { } // -------------------------------------------------------------------------------- // Wrap and serialise the request message // -------------------------------------------------------------------------------- char * XSECSOAPRequestorSimple::wrapAndSerialise(DOMDocument * request) { // Prepare the serialiser XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); Janitor j_theSerializer(theSerializer); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); MemBufFormatTarget *formatTarget = new MemBufFormatTarget; Janitor j_formatTarget(formatTarget); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); Janitor j_theSerializer(theSerializer); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); MemBufFormatTarget *formatTarget = new MemBufFormatTarget; Janitor j_formatTarget(formatTarget); #endif if (m_envelopeType != ENVELOPE_NONE) { // Create a new document to wrap the request in safeBuffer str; makeQName(str, s_prefix, s_Envelope); DOMDocument *doc; if (m_envelopeType == ENVELOPE_SOAP11) { doc = impl->createDocument( XKMSConstants::s_unicodeStrURISOAP11, str.rawXMLChBuffer(), NULL); DOMElement *rootElem = doc->getDocumentElement(); makeQName(str, s_prefix, s_Body); DOMElement *body = doc->createElementNS( XKMSConstants::s_unicodeStrURISOAP11, str.rawXMLChBuffer()); rootElem->appendChild(body); // Now replicate the request into the document DOMElement * reqElement = (DOMElement *) doc->importNode(request->getDocumentElement(), true); body->appendChild(reqElement); } else { doc = impl->createDocument( XKMSConstants::s_unicodeStrURISOAP12, str.rawXMLChBuffer(), NULL); DOMElement *rootElem = doc->getDocumentElement(); makeQName(str, s_prefix, s_Body); DOMElement *body = doc->createElementNS( XKMSConstants::s_unicodeStrURISOAP12, str.rawXMLChBuffer()); rootElem->appendChild(body); // Now replicate the request into the document DOMElement * reqElement = (DOMElement *) doc->importNode(request->getDocumentElement(), true); body->appendChild(reqElement); } // OK - Now we have the SOAP request as a document, we serialise to a string buffer // and return #if defined (XSEC_XERCES_DOMLSSERIALIZER) theSerializer->write(doc, theOutput); #else theSerializer->writeNode(formatTarget, *doc); #endif doc->release(); } else { #if defined (XSEC_XERCES_DOMLSSERIALIZER) theSerializer->write(request, theOutput); #else theSerializer->writeNode(formatTarget, *request); #endif } // Now replicate the buffer return XMLString::replicate((const char *) formatTarget->getRawBuffer()); } // -------------------------------------------------------------------------------- // UnWrap and de-serialise the response message // -------------------------------------------------------------------------------- DOMDocument * XSECSOAPRequestorSimple::parseAndUnwrap(const char * buf, unsigned int len) { XercesDOMParser parser; parser.setDoNamespaces(true); parser.setLoadExternalDTD(false); SecurityManager securityManager; securityManager.setEntityExpansionLimit(XSEC_ENTITY_EXPANSION_LIMIT); parser.setSecurityManager(&securityManager); // Create an input source MemBufInputSource memIS((const XMLByte*) buf, len, "XSECMem"); parser.parse(memIS); xsecsize_t errorCount = parser.getErrorCount(); if (errorCount > 0) throw XSECException(XSECException::HTTPURIInputStreamError, "Error parsing response message"); if (m_envelopeType == ENVELOPE_NONE) { return parser.adoptDocument(); } DOMDocument * responseDoc = parser.getDocument(); // Must be a SOAP message of some kind - so lets remove the wrapper. // First create a new document for the Response message XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMDocument * retDoc = impl->createDocument(); // Find the base of the response DOMNode * e = responseDoc->getDocumentElement(); e = e->getFirstChild(); while (e != NULL && (e->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(e->getLocalName(), "Body"))) e = e->getNextSibling(); if (e == NULL) throw XSECException(XSECException::HTTPURIInputStreamError, "Could not find SOAP body"); e = findFirstChildOfType(e, DOMNode::ELEMENT_NODE); if (e == NULL) throw XSECException(XSECException::HTTPURIInputStreamError, "Could not find message within SOAP body"); /* See if this is a soap fault */ if (strEquals(e->getLocalName(), "Fault")) { // Something has gone wrong somewhere! safeBuffer sb; sb.sbTranscodeIn("SOAP Fault : "); // Find the fault code e = findFirstElementChild(e); while (e != NULL && !strEquals(e->getLocalName(), "Code")) e = findNextElementChild(e); if (e != NULL) { DOMNode * c = findFirstElementChild(e); while (c != NULL && !strEquals(c->getLocalName(), "Value")) c = findNextElementChild(c); if (c != NULL) { DOMNode * t = findFirstChildOfType(c, DOMNode::TEXT_NODE); if (t != NULL) { sb.sbXMLChCat(t->getNodeValue()); sb.sbXMLChCat(" : "); } } } // Find the reason while (e != NULL && !strEquals(e->getLocalName(), "Reason")) e = findNextElementChild(e); if (e != NULL) { DOMNode * t = findFirstChildOfType(e, DOMNode::TEXT_NODE); if (t != NULL) { sb.sbXMLChCat(t->getNodeValue()); } } retDoc->release(); XSECAutoPtrChar msg(sb.rawXMLChBuffer()); throw XSECException(XSECException::HTTPURIInputStreamError, msg.get()); } retDoc->appendChild(retDoc->importNode(e, true)); return retDoc; } // -------------------------------------------------------------------------------- // Envelope Type handling // -------------------------------------------------------------------------------- void XSECSOAPRequestorSimple::setEnvelopeType(envelopeType et) { m_envelopeType = et; } xml-security-c-1.7.3/xsec/utils/XSECNameSpaceExpander.cpp000644 001751 001751 00000012167 12003301052 024402 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECNameSpaceExander := Class for expanding out a document's name space axis * and then shrinking again * * $Id: XSECNameSpaceExpander.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include XERCES_CPP_NAMESPACE_USE XSECNameSpaceExpander::XSECNameSpaceExpander(DOMDocument *d) { mp_doc = d; mp_fragment = d->getDocumentElement(); XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); m_expanded = false; } XSECNameSpaceExpander::XSECNameSpaceExpander(DOMElement *f) { mp_doc = NULL; mp_fragment = f; XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); m_expanded = false; } XSECNameSpaceExpander::~XSECNameSpaceExpander() { if (mp_formatter != NULL) delete mp_formatter; } void XSECNameSpaceExpander::recurse(DOMElement *n) { // Recursively go down the tree adding namespaces DOMNode *p = n->getParentNode(); if (p->getNodeType() != DOMNode::ELEMENT_NODE) return; DOMNamedNodeMap *pmap = p->getAttributes(); XMLSize_t psize = pmap->getLength(); DOMNamedNodeMap *nmap = n->getAttributes(); safeBuffer pname, pURI, nURI; DOMNode *finder; XSECNameSpaceEntry * tmpEnt; for (XMLSize_t i = 0; i < psize; i++) { // Run through each parent node to find namespaces pname << (*mp_formatter << pmap->item(i)->getNodeName()); // See if this is an xmlns node if (pname.sbStrncmp("xmlns", 5) == 0) { // It is - see if it already exists finder = nmap->getNamedItem(pname.sbStrToXMLCh()); if (finder == 0) { // Need to add n->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, pmap->item(i)->getNodeName(), pmap->item(i)->getNodeValue()); // Add it to the list so it can be removed later XSECnew(tmpEnt, XSECNameSpaceEntry); tmpEnt->m_name.sbStrcpyIn(pname); tmpEnt->mp_node = n; tmpEnt->mp_att = nmap->getNamedItem(pname.sbStrToXMLCh()); m_lst.push_back(tmpEnt); } } } // Do the children DOMNode *c; c = n->getFirstChild(); while (c != NULL) { if (c->getNodeType() == DOMNode::ELEMENT_NODE) recurse((DOMElement *) c); c = c->getNextSibling(); } } int attNodeCount(DOMElement * d) { XMLSize_t ret; ret = d->getAttributes()->getLength(); DOMNode *c; c = d->getFirstChild(); while (c != NULL) { if (c->getNodeType() == DOMNode::ELEMENT_NODE) ret += attNodeCount((DOMElement *) c); c = c->getNextSibling(); } return (int) ret; } void XSECNameSpaceExpander::expandNameSpaces(void) { if (m_expanded) return; // Don't do this twice! DOMElement *docElt; // The document element - do not expand it's namespaces docElt = mp_fragment; //mp_doc->getDocumentElement(); int count = attNodeCount(docElt); DOMNode *c; c = docElt->getFirstChild(); while (c != NULL) { if (c->getNodeType() == DOMNode::ELEMENT_NODE) recurse((DOMElement *) c); c = c->getNextSibling(); } m_expanded = true; count = attNodeCount(docElt); } void XSECNameSpaceExpander::deleteAddedNamespaces(void) { NameSpaceEntryListVectorType::size_type size = m_lst.size(); XSECNameSpaceEntry *e; DOMElement *docElt = mp_fragment; //mp_doc->getDocumentElement(); int count = attNodeCount(docElt); NameSpaceEntryListVectorType::size_type i; for (i = 0; i < size; ++i) { // Delete the element attribute, and then this node e = m_lst[i]; if (e->m_name[5] == ':') e->mp_node->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING((char *) &((e->m_name.rawBuffer())[6]))); else e->mp_node->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING((char *) e->m_name.rawBuffer())); // Delete the entry delete e; } // Now done - empty everything m_lst.clear(); m_expanded = false; count = attNodeCount(docElt); } bool XSECNameSpaceExpander::nodeWasAdded(DOMNode *n) { NameSpaceEntryListVectorType::size_type size = m_lst.size(); XSECNameSpaceEntry *e; NameSpaceEntryListVectorType::size_type i; for (i = 0; i < size; ++i) { // Delete the element attribute, and then this node e = m_lst[i]; if (e->mp_att == n) return true; } return false; } xml-security-c-1.7.3/xsec/utils/XSECPlatformUtils.cpp000644 001751 001751 00000011117 12003301052 023656 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECPlatformUtils:= To support the platform we run in * * Author(s): Berin Lautenbach * * $Id: XSECPlatformUtils.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include "../xenc/impl/XENCCipherImpl.hpp" XERCES_CPP_NAMESPACE_USE #if defined(_WIN32) #include #endif #if defined (XSEC_HAVE_OPENSSL) # include #endif #if defined (XSEC_HAVE_WINCAPI) # include #endif #if defined (XSEC_HAVE_NSS) # include #endif // Static data used by all of XSEC int XSECPlatformUtils::initCount = 0; XSECCryptoProvider * XSECPlatformUtils::g_cryptoProvider = NULL; // Have a const copy for external usage const XSECAlgorithmMapper * XSECPlatformUtils::g_algorithmMapper = NULL; XSECAlgorithmMapper * internalMapper = NULL; XSECPlatformUtils::TransformFactory* XSECPlatformUtils::g_loggingSink = NULL; // Determine default crypto provider #if defined (XSEC_HAVE_OPENSSL) # define XSEC_DEFAULT_PROVIDER OpenSSLCryptoProvider() #else # if defined (XSEC_HAVE_WINCAPI) # define XSEC_DEFAULT_PROVIDER WinCAPICryptoProvider() # else # if defined (XSEC_HAVE_NSS) # define XSEC_DEFAULT_PROVIDER NSSCryptoProvider() # endif # endif #endif TXFMBase* TXFMOutputFileFactory(DOMDocument* doc) { TXFMOutputFile* sink = new TXFMOutputFile(doc); if (sink) sink->setFile(getenv("XSEC_DEBUG_FILE")); return sink; } void XSECPlatformUtils::Initialise(XSECCryptoProvider * p) { if (++initCount > 1) return; if (p != NULL) g_cryptoProvider = p; else #if defined XSEC_DEFAULT_PROVIDER XSECnew(g_cryptoProvider, XSEC_DEFAULT_PROVIDER); #else throw XSECException(XSECException::CryptoProviderError, "XSECPlatformUtils::Initialise() called with NULL provider, but no default defined"); #endif // Set up necessary constants DSIGConstants::create(); XKMSConstants::create(); // Initialise the safeBuffer system safeBuffer::init(); // Initialise Algorithm Mapper XSECnew(internalMapper, XSECAlgorithmMapper); g_algorithmMapper = internalMapper; // Initialise the XENCCipherImpl class XENCCipherImpl::Initialise(); // Initialise the DSIGSignature class DSIGSignature::Initialise(); const char* sink = getenv("XSEC_DEBUG_FILE"); if (sink && *sink) g_loggingSink = TXFMOutputFileFactory; }; void XSECPlatformUtils::SetCryptoProvider(XSECCryptoProvider * p) { if (g_cryptoProvider != NULL) delete g_cryptoProvider; g_cryptoProvider = p; } void XSECPlatformUtils::SetReferenceLoggingSink(TransformFactory* factory) { g_loggingSink = factory; } TXFMBase* XSECPlatformUtils::GetReferenceLoggingSink(DOMDocument* doc) { return (g_loggingSink ? g_loggingSink(doc) : NULL); } void XSECPlatformUtils::Terminate(void) { if (--initCount > 0) return; // Clean out the algorithm mapper delete internalMapper; if (g_cryptoProvider != NULL) delete g_cryptoProvider; DSIGConstants::destroy(); XKMSConstants::destroy(); // Destroy anything platform specific #if defined(_WIN32) XSECBinHTTPURIInputStream::Cleanup(); #endif } void XSECPlatformUtils::registerAlgorithmHandler( const XMLCh * uri, const XSECAlgorithmHandler & handler) { internalMapper->registerHandler(uri, handler); } void XSECPlatformUtils::whitelistAlgorithm(const XMLCh* uri) { internalMapper->whitelistAlgorithm(uri); } void XSECPlatformUtils::blacklistAlgorithm(const XMLCh* uri) { internalMapper->blacklistAlgorithm(uri); } xml-security-c-1.7.3/xsec/utils/winutils/XSECURIResolverGenericWin32.cpp000644 001751 001751 00000016272 12003301052 027237 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverGenericWin32 := A URI Resolver that will work "out of * the box" with Windows. Re-implements * much Xerces code, but allows us to * handle HTTP redirects as is required by * the DSIG Standard * * Author(s): Berin Lautenbach * * $Id: XSECURIResolverGenericWin32.cpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.12 2005/05/29 00:06:55 blautenb * Update localhost check to include an empty hostname - reported by Vincent Finn on security-dev@xml 27/5/2005 * * Revision 1.11 2005/02/03 13:56:22 milan * Apache licence fix. * * Revision 1.10 2004/02/21 08:26:54 blautenb * Use XMLString::release rather than delete[] for all Xerces strings * * Revision 1.9 2004/02/08 10:25:40 blautenb * Convert to Apache 2.0 license * * Revision 1.8 2004/01/26 00:16:04 blautenb * Remove escapes from URI before retrieving a path on the file system * * Revision 1.7 2003/09/11 11:11:05 blautenb * Cleaned up usage of Xerces namespace - no longer inject into global namespace in headers * * Revision 1.6 2003/07/28 12:52:46 blautenb * Fixed a bug with DEBUG_NEW when compiling with Xalan 1.6 * * Revision 1.5 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.4 2003/05/22 11:42:06 blautenb * Updates so Windows version will compile with Xerces 2.3 * * Revision 1.3 2003/05/10 07:23:36 blautenb * Updates to support anonymous references * * Revision 1.2 2003/02/17 11:21:45 blautenb * Work around for Xerces XMLUri bug * * Revision 1.1 2003/02/12 09:45:29 blautenb * Win32 Re-implementation of Xerces URIResolver to support re-directs * * */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #include #include #include "../../utils/XSECAutoPtr.hpp" static const XMLCh gFileScheme[] = { chLatin_f, chLatin_i, chLatin_l, chLatin_e, chNull }; static const XMLCh gHttpScheme[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chNull }; #if XERCES_VERSION_MAJOR == 2 && XERCES_VERSION_MINOR < 3 static const XMLCh DOTDOT_SLASH[] = { chPeriod, chPeriod, chForwardSlash, chNull }; #endif XSECURIResolverGenericWin32::XSECURIResolverGenericWin32() : mp_baseURI(NULL) { }; XSECURIResolverGenericWin32::~XSECURIResolverGenericWin32() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } // ----------------------------------------------------------------------- // Resolve a URI that is passed in // ----------------------------------------------------------------------- BinInputStream * XSECURIResolverGenericWin32::resolveURI(const XMLCh * uri) { XSEC_USING_XERCES(BinInputStream); XSEC_USING_XERCES(XMLUri); XSEC_USING_XERCES(XMLUni); XSEC_USING_XERCES(Janitor); XSEC_USING_XERCES(BinFileInputStream); XMLUri * xmluri; if (uri == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericWin32 - anonymous references not supported in default URI Resolvers"); } // Create the appropriate XMLUri objects if (mp_baseURI != NULL) { XMLUri * turi; #if defined(XSEC_XERCES_BROKEN_XMLURI) // XMLUri relative paths are broken, so we need to strip out ".." // Doesn't fix the whole problem, but gets us somewhere XSECAutoPtrXMLCh b(mp_baseURI); XSECAutoPtrXMLCh r(uri); int index = 0; while (XMLString::startsWith(&(r.get()[index]), DOTDOT_SLASH)) { // Strip the last segment of the base int lastIndex = XMLString::lastIndexOf(b.get(), XERCES_CPP_NAMESPACE_QUALIFIER chForwardSlash); if (lastIndex > 0) const_cast(b.get())[lastIndex] = 0; index += 3; } XSECnew(turi, XMLUri(b.get())); Janitor j_turi(turi); XSECnew(xmluri, XMLUri(turi, &(r.get()[index]))); #else turi = new XMLUri(mp_baseURI); Janitor j_turi(turi); xmluri = new XMLUri(turi, uri); #endif } else { xmluri = new XMLUri(uri); } Janitor j_xmluri(xmluri); // Determine what kind of URI this is and how to handle it. if (!XMLString::compareIString(xmluri->getScheme(), gFileScheme)) { // This is a file. We only really understand if this is localhost if (xmluri->getHost() == NULL || xmluri->getHost()[0] == chNull || !XMLString::compareIString(xmluri->getHost(), XMLUni::fgLocalHostString) || !XMLString::compareIString(xmluri->getHost(), XMLUni::fgEmptyString)) { // Clean hex escapes XMLCh * realPath = cleanURIEscapes(xmluri->getPath()); // Localhost BinFileInputStream* retStrm = new BinFileInputStream(realPath); XSEC_RELEASE_XMLCH(realPath); if (!retStrm->getIsOpen()) { delete retStrm; return 0; } return retStrm; } else { throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericWin32 - unable to open non-localhost file"); } } // Is the scheme a HTTP? if (!XMLString::compareIString(xmluri->getScheme(), gHttpScheme)) { // Pass straight to our local XSECBinHTTPUriInputStream XSECBinHTTPURIInputStream *ret; ret = new XSECBinHTTPURIInputStream(*xmluri); return ret; } throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericWin32 - unknown URI scheme"); } // ----------------------------------------------------------------------- // Clone me // ----------------------------------------------------------------------- XSECURIResolver * XSECURIResolverGenericWin32::clone(void) { XSECURIResolverGenericWin32 * ret; ret = new XSECURIResolverGenericWin32(); if (this->mp_baseURI != NULL) ret->mp_baseURI = XMLString::replicate(this->mp_baseURI); else ret->mp_baseURI = NULL; return ret; } // ----------------------------------------------------------------------- // Set a base URI to map any incoming files against // ----------------------------------------------------------------------- void XSECURIResolverGenericWin32::setBaseURI(const XMLCh * uri) { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); mp_baseURI = XMLString::replicate(uri); } xml-security-c-1.7.3/xsec/utils/winutils/XSECSOAPRequestorSimpleWin32.cpp000644 001751 001751 00000031170 12003301052 027401 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSOAPRequestorSimpleWin32 := (Very) Basic implementation of a SOAP * HTTP wrapper for testing the client code. * * * $Id: XSECSOAPRequestorSimpleWin32.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include "../../utils/XSECAutoPtr.hpp" #define _WINSOCKAPI_ #define INCL_WINSOCK_API_TYPEDEFS 1 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- XSECSOAPRequestorSimple::XSECSOAPRequestorSimple(const XMLCh * uri) : m_uri(uri) { XSECBinHTTPURIInputStream::ExternalInitialize(); m_envelopeType = ENVELOPE_SOAP11; } // -------------------------------------------------------------------------------- // Interface // -------------------------------------------------------------------------------- DOMDocument * XSECSOAPRequestorSimple::doRequest(DOMDocument * request) { char * content = wrapAndSerialise(request); // First we need to serialise char fBuffer[4000]; char * fBufferEnd; char * fBufferPos; // // Pull all of the parts of the URL out of th m_uri object, and transcode them // and transcode them back to ASCII. // const XMLCh* hostName = m_uri.getHost(); XSECAutoPtrChar hostNameAsCharStar(hostName); const XMLCh* path = m_uri.getPath(); XSECAutoPtrChar pathAsCharStar(path); const XMLCh* fragment = m_uri.getFragment(); XSECAutoPtrChar fragmentAsCharStar(fragment); const XMLCh* query = m_uri.getQueryString(); XSECAutoPtrChar queryAsCharStar(query); unsigned short portNumber = (unsigned short) m_uri.getPort(); // If no number is set, go with port 80 if (portNumber == USHRT_MAX) portNumber = 80; // // Set up a socket. // struct hostent* hostEntPtr = 0; struct sockaddr_in sa; if ((hostEntPtr = XSECBinHTTPURIInputStream::gethostbyname(hostNameAsCharStar.get())) == NULL) { unsigned long numAddress = XSECBinHTTPURIInputStream::inet_addr(hostNameAsCharStar.get()); if (numAddress == INADDR_NONE) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported resolving IP address"); } if ((hostEntPtr = XSECBinHTTPURIInputStream::gethostbyaddr((const char *) &numAddress, sizeof(unsigned long), AF_INET)) == NULL) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported resolving IP address"); } } memcpy((void *) &sa.sin_addr, (const void *) hostEntPtr->h_addr, hostEntPtr->h_length); sa.sin_family = hostEntPtr->h_addrtype; sa.sin_port = XSECBinHTTPURIInputStream::htons(portNumber); SOCKET s = XSECBinHTTPURIInputStream::socket(hostEntPtr->h_addrtype, SOCK_STREAM, 0); if (s == INVALID_SOCKET) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported creating socket"); } if (XSECBinHTTPURIInputStream::connect((unsigned short) s, (struct sockaddr *) &sa, sizeof(sa)) == SOCKET_ERROR) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported connecting to socket"); } // Set a flag so we know that the headers have not been read yet. bool fHeaderRead = false; // The port is open and ready to go. // Build up the http POST command to send to the server. // To do: We should really support http 1.1. This implementation // is weak. memset(fBuffer, 0, sizeof(fBuffer)); strcpy(fBuffer, "POST "); strcat(fBuffer, pathAsCharStar.get()); if (queryAsCharStar.get() != 0) { // Tack on a ? before the fragment strcat(fBuffer,"?"); strcat(fBuffer, queryAsCharStar.get()); } if (fragmentAsCharStar.get() != 0) { strcat(fBuffer, fragmentAsCharStar.get()); } strcat(fBuffer, " HTTP/1.0\r\n"); strcat(fBuffer, "Content-Type: text/xml; charset=utf-8\r\n"); strcat(fBuffer, "Host: "); strcat(fBuffer, hostNameAsCharStar.get()); if (portNumber != 80) { strcat(fBuffer, ":"); int i = (int) strlen(fBuffer); _itoa(portNumber, fBuffer+i, 10); } strcat(fBuffer, "\r\n"); strcat(fBuffer, "Content-Length: "); int i = (int) strlen(fBuffer); _itoa((int) strlen(content), fBuffer+i, 10); strcat(fBuffer, "\r\n"); strcat(fBuffer, "SOAPAction: \"\"\r\n"); /* strcat(fBuffer, "Connection: Close\r\n"); strcat(fBuffer, "Cache-Control: no-cache\r\n");*/ strcat(fBuffer, "\r\n"); // Now the content // strcat(fBuffer, content); // Send the http request int lent = (int) strlen(fBuffer); int aLent = 0; if ((aLent = XSECBinHTTPURIInputStream::send((unsigned short) s, fBuffer, lent, 0)) != lent) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported writing to socket"); } // Now the content lent = (int) strlen(content); aLent = 0; if ((aLent = XSECBinHTTPURIInputStream::send((unsigned short) s, content, lent, 0)) != lent) { XSEC_RELEASE_XMLCH(content); // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported writing to socket"); } XSEC_RELEASE_XMLCH(content); // // get the response, check the http header for errors from the server. // memset(fBuffer, 0, sizeof(fBuffer)); aLent = XSECBinHTTPURIInputStream::recv((unsigned short) s, fBuffer, sizeof(fBuffer)-1, 0); if (aLent == SOCKET_ERROR || aLent == 0) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBuffer+aLent; *fBufferEnd = 0; do { // Find the break between the returned http header and any data. // (Delimited by a blank line) // Hang on to any data for use by the first read from this XSECBinHTTPURIInputStream. // fBufferPos = strstr(fBuffer, "\r\n\r\n"); if (fBufferPos != 0) { fBufferPos += 4; *(fBufferPos-2) = 0; fHeaderRead = true; } else { fBufferPos = strstr(fBuffer, "\n\n"); if (fBufferPos != 0) { fBufferPos += 2; *(fBufferPos-1) = 0; fHeaderRead = true; } else { // // Header is not yet read, do another recv() to get more data... aLent = XSECBinHTTPURIInputStream::recv((unsigned short) s, fBufferEnd, ((int) sizeof(fBuffer) - 1) - (int)(fBufferEnd - fBuffer), 0); if (aLent == SOCKET_ERROR || aLent == 0) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBufferEnd + aLent; *fBufferEnd = 0; } } } while(fHeaderRead == false); // Make sure the header includes an HTTP 200 OK response. // char *p = strstr(fBuffer, "HTTP"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "XSECSOAPRequestorSimple - Error reported reading socket"); } int httpResponse = atoi(p); // Check for redirect or permanently moved if (httpResponse == 302 || httpResponse == 301) { //Once grows, should use a switch char redirectBuf[256]; int q; // Find the "Location:" string p = strstr(p, "Location:"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } // Now read p++; for (q=0; q < 255 && p[q] != '\r' && p[q] !='\n'; ++q) redirectBuf[q] = p[q]; redirectBuf[q] = '\0'; // Try to find this location m_uri = XMLUri(XMLString::transcode(redirectBuf)); return doRequest(request); } else if (httpResponse != 200) { // Most likely a 404 Not Found error. // Should recognize and handle the forwarding responses. // char * q = strstr(p, "\n"); if (q == NULL) q = strstr(p, "\r"); if (q != NULL) *q = '\0'; safeBuffer sb; sb.sbStrcpyIn("SOAPRequestorSimple HTTP Error : "); if (strlen(p) < 256) sb.sbStrcatIn(p); throw XSECException(XSECException::HTTPURIInputStreamError, sb.rawCharBuffer()); } /* Now find out how long the return is */ p = strstr(fBuffer, "Content-Length:"); int responseLength; if (p == NULL) { // Need to work it out from the amount of data returned responseLength = -1; } else { p = strchr(p, ' '); p++; responseLength = atoi(p); } safeBuffer responseBuffer; lent = (int) (fBufferEnd - fBufferPos); responseBuffer.sbMemcpyIn(fBufferPos, lent); while (responseLength == -1 || lent < responseLength) { aLent = XSECBinHTTPURIInputStream::recv((unsigned short)s, fBuffer, sizeof(fBuffer)-1, 0); if (aLent > 0) { responseBuffer.sbMemcpyIn(lent, fBuffer, aLent); lent += aLent; } else { responseLength = 0; } } if (lent <= 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "XSECSOAPRequestorSimple - Zero length response from server"); } return parseAndUnwrap(responseBuffer.rawCharBuffer(), lent); # if 0 p = strstr(fBuffer, "Content-Length:"); if (p == NULL) { throw XSECException(XSECException::HTTPURIInputStreamError, "Content-Length required in SOAP HTTP Response"); } p = strchr(p, ' '); p++; int responseLength = atoi(p); char * responseBuffer; XSECnew(responseBuffer, char[responseLength]); ArrayJanitor j_responseBuffer(responseBuffer); lent = fBufferEnd - fBufferPos; memcpy(responseBuffer, fBufferPos, lent); while (lent < responseLength) { aLent = XSECBinHTTPURIInputStream::recv((unsigned short) s, &responseBuffer[lent], responseLength - lent, 0); lent += aLent; } return parseAndUnwrap(responseBuffer, responseLength); #endif } xml-security-c-1.7.3/xsec/utils/winutils/XSECBinHTTPURIInputStream.cpp000644 001751 001751 00000037554 12462320141 026741 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinHTTPURIInputStream := Re-implementation of the Xerces * BinHTTPURLInputStream. Allows us to make * some small changes to support the requirements * of XMLDSIG (notably re-directs) * * NOTE: Much code taken from Xerces, and the cross platform interfacing is * no-where near as nice. * * $Id: XSECBinHTTPURIInputStream.cpp 1655509 2015-01-29 02:15:59Z scantor $ * */ #include #define _WINSOCKAPI_ #define INCL_WINSOCK_API_TYPEDEFS 1 #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #include #include "../../utils/XSECAutoPtr.hpp" static HMODULE gWinsockLib = NULL; static LPFN_GETHOSTBYNAME gWSgethostbyname = NULL; static LPFN_INET_ADDR gWSinet_addr = NULL; static LPFN_GETHOSTBYADDR gWSgethostbyaddr = NULL; static LPFN_HTONS gWShtons = NULL; static LPFN_SOCKET gWSsocket = NULL; static LPFN_CONNECT gWSconnect = NULL; static LPFN_SEND gWSsend = NULL; static LPFN_RECV gWSrecv = NULL; static LPFN_SHUTDOWN gWSshutdown = NULL; static LPFN_CLOSESOCKET gWSclosesocket = NULL; static LPFN_WSACLEANUP gWSACleanup = NULL; bool XSECBinHTTPURIInputStream::fInitialized = false; XMLMutex* XSECBinHTTPURIInputStream::fInitMutex = 0; // Ported from Xerces 2.x, now missing on 3.x, so I'm inlining it. static void* compareAndSwap(void** toFill, const void* const newValue, const void* const toCompare) { #if defined _WIN64 return ::InterlockedCompareExchangePointer(toFill, (void*)newValue, (void*)toCompare); #else void* result; __asm { mov eax, toCompare; mov ebx, newValue; mov ecx, toFill lock cmpxchg [ecx], ebx; mov result, eax; } return result; #endif } void XSECBinHTTPURIInputStream::Initialize() { // // Initialize the WinSock library here. // WORD wVersionRequested; WSADATA wsaData; LPFN_WSASTARTUP startup = NULL; if(gWinsockLib == NULL) { gWinsockLib = LoadLibrary(_T("WSOCK32")); if(gWinsockLib == NULL) { ThrowXML(NetAccessorException, XMLExcepts::NetAcc_InitFailed); } else { startup = (LPFN_WSASTARTUP) GetProcAddress(gWinsockLib,"WSAStartup"); gWSACleanup = (LPFN_WSACLEANUP) GetProcAddress(gWinsockLib,"WSACleanup"); gWSgethostbyname = (LPFN_GETHOSTBYNAME) GetProcAddress(gWinsockLib,"gethostbyname"); gWSinet_addr = (LPFN_INET_ADDR) GetProcAddress(gWinsockLib,"inet_addr"); gWSgethostbyaddr = (LPFN_GETHOSTBYADDR) GetProcAddress(gWinsockLib,"gethostbyaddr"); gWShtons = (LPFN_HTONS) GetProcAddress(gWinsockLib,"htons"); gWSsocket = (LPFN_SOCKET) GetProcAddress(gWinsockLib,"socket"); gWSconnect = (LPFN_CONNECT) GetProcAddress(gWinsockLib,"connect"); gWSsend = (LPFN_SEND) GetProcAddress(gWinsockLib,"send"); gWSrecv = (LPFN_RECV) GetProcAddress(gWinsockLib,"recv"); gWSshutdown = (LPFN_SHUTDOWN) GetProcAddress(gWinsockLib,"shutdown"); gWSclosesocket = (LPFN_CLOSESOCKET) GetProcAddress(gWinsockLib,"closesocket"); if(startup == NULL || gWSACleanup == NULL || gWSgethostbyname == NULL || gWSinet_addr == NULL || gWSgethostbyaddr == NULL || gWShtons == NULL || gWSsocket == NULL || gWSconnect == NULL || gWSsend == NULL || gWSrecv == NULL || gWSshutdown == NULL || gWSclosesocket == NULL) { gWSACleanup = NULL; Cleanup(); ThrowXML(NetAccessorException, XMLExcepts::NetAcc_InitFailed); } } } wVersionRequested = MAKEWORD( 2, 2 ); int err = (*startup)(wVersionRequested, &wsaData); if (err != 0) { // Call WSAGetLastError() to get the last error. ThrowXML(NetAccessorException, XMLExcepts::NetAcc_InitFailed); } fInitialized = true; } void XSECBinHTTPURIInputStream::Cleanup() { if(fInitialized) { if(gWSACleanup) (*gWSACleanup)(); gWSACleanup = NULL; FreeLibrary(gWinsockLib); gWinsockLib = NULL; gWSgethostbyname = NULL; gWSinet_addr = NULL; gWSgethostbyaddr = NULL; gWShtons = NULL; gWSsocket = NULL; gWSconnect = NULL; gWSsend = NULL; gWSrecv = NULL; gWSshutdown = NULL; gWSclosesocket = NULL; fInitialized = false; delete fInitMutex; fInitMutex = 0; } } hostent* XSECBinHTTPURIInputStream::gethostbyname(const char* name) { return (*gWSgethostbyname)(name); } unsigned long XSECBinHTTPURIInputStream::inet_addr(const char* cp) { return (*gWSinet_addr)(cp); } hostent* XSECBinHTTPURIInputStream::gethostbyaddr(const char* addr,int len,int type) { return (*gWSgethostbyaddr)(addr,len,type); } unsigned short XSECBinHTTPURIInputStream::htons(unsigned short hostshort) { return (*gWShtons)(hostshort); } unsigned short XSECBinHTTPURIInputStream::socket(int af,int type,int protocol) { return (unsigned short) (*gWSsocket)(af,type,protocol); } int XSECBinHTTPURIInputStream::connect(unsigned short s,const sockaddr* name,int namelen) { return (*gWSconnect)(s,name,namelen); } int XSECBinHTTPURIInputStream::send(unsigned short s,const char* buf,int len,int flags) { return (*gWSsend)(s,buf,len,flags); } int XSECBinHTTPURIInputStream::recv(unsigned short s,char* buf,int len,int flags) { return (*gWSrecv)(s,buf,len,flags); } int XSECBinHTTPURIInputStream::shutdown(unsigned int s,int how) { return (*gWSshutdown)(s,how); } int XSECBinHTTPURIInputStream::closesocket(unsigned int socket) { return (*gWSclosesocket)(socket); } unsigned int XSECBinHTTPURIInputStream::getSocketHandle(const XMLUri& urlSource) { // // Pull all of the parts of the URL out of th urlSource object, and transcode them // and transcode them back to ASCII. // const XMLCh* hostName = urlSource.getHost(); XSECAutoPtrChar hostNameAsCharStar(hostName); const XMLCh* path = urlSource.getPath(); XSECAutoPtrChar pathAsCharStar(path); const XMLCh* fragment = urlSource.getFragment(); XSECAutoPtrChar fragmentAsCharStar(fragment); const XMLCh* query = urlSource.getQueryString(); XSECAutoPtrChar queryAsCharStar(query); unsigned short portNumber = (unsigned short) urlSource.getPort(); // If no number is set, go with port 80 if (portNumber == USHRT_MAX) portNumber = 80; // // Set up a socket. // struct hostent* hostEntPtr = 0; struct sockaddr_in sa; if ((hostEntPtr = gethostbyname(hostNameAsCharStar.get())) == NULL) { unsigned long numAddress = inet_addr(hostNameAsCharStar.get()); if (numAddress == INADDR_NONE) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported resolving IP address"); } if ((hostEntPtr = gethostbyaddr((const char *) &numAddress, sizeof(unsigned long), AF_INET)) == NULL) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported resolving IP address"); } } memcpy((void *) &sa.sin_addr, (const void *) hostEntPtr->h_addr, hostEntPtr->h_length); sa.sin_family = hostEntPtr->h_addrtype; sa.sin_port = htons(portNumber); SOCKET s = socket(hostEntPtr->h_addrtype, SOCK_STREAM, 0); if (s == INVALID_SOCKET) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported creating socket"); } if (connect((unsigned short) s, (struct sockaddr *) &sa, sizeof(sa)) == SOCKET_ERROR) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported connecting to socket"); } // Set a flag so we know that the headers have not been read yet. bool fHeaderRead = false; // The port is open and ready to go. // Build up the http GET command to send to the server. // To do: We should really support http 1.1. This implementation // is weak. memset(fBuffer, 0, sizeof(fBuffer)); strcpy(fBuffer, "GET "); strcat(fBuffer, pathAsCharStar.get()); if (queryAsCharStar.get() != 0) { // Tack on a ? before the fragment strcat(fBuffer,"?"); strcat(fBuffer, queryAsCharStar.get()); } if (fragmentAsCharStar.get() != 0) { strcat(fBuffer, fragmentAsCharStar.get()); } strcat(fBuffer, " HTTP/1.0\r\n"); strcat(fBuffer, "Host: "); strcat(fBuffer, hostNameAsCharStar.get()); if (portNumber != 80) { strcat(fBuffer, ":"); int i = (int) strlen(fBuffer); _itoa(portNumber, fBuffer+i, 10); } strcat(fBuffer, "\r\n\r\n"); // Send the http request int lent = (int) strlen(fBuffer); int aLent = 0; if ((aLent = send((unsigned short) s, fBuffer, lent, 0)) != lent) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported writing to socket"); } // // get the response, check the http header for errors from the server. // memset(fBuffer, 0, sizeof(fBuffer)); aLent = recv((unsigned short) s, fBuffer, sizeof(fBuffer)-1, 0); if (aLent == SOCKET_ERROR || aLent == 0) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBuffer+aLent; *fBufferEnd = 0; do { // Find the break between the returned http header and any data. // (Delimited by a blank line) // Hang on to any data for use by the first read from this XSECBinHTTPURIInputStream. // fBufferPos = strstr(fBuffer, "\r\n\r\n"); if (fBufferPos != 0) { fBufferPos += 4; *(fBufferPos-2) = 0; fHeaderRead = true; } else { fBufferPos = strstr(fBuffer, "\n\n"); if (fBufferPos != 0) { fBufferPos += 2; *(fBufferPos-1) = 0; fHeaderRead = true; } else { // // Header is not yet read, do another recv() to get more data... aLent = (unsigned int) recv((unsigned short) s, fBufferEnd, ((int) sizeof(fBuffer) - 1) - (int) (fBufferEnd - fBuffer), 0); if (aLent == SOCKET_ERROR || aLent == 0) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBufferEnd + aLent; *fBufferEnd = 0; } } } while(fHeaderRead == false); // Make sure the header includes an HTTP 200 OK response. // char *p = strstr(fBuffer, "HTTP"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } int httpResponse = atoi(p); // Check for redirect or permanently moved if (httpResponse == 302 || httpResponse == 301) { //Once grows, should use a switch char redirectBuf[256]; int q; // Find the "Location:" string p = strstr(p, "Location:"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } // Now read p++; for (q=0; q < 255 && p[q] != '\r' && p[q] !='\n'; ++q) redirectBuf[q] = p[q]; redirectBuf[q] = '\0'; // Try to find this location XSECAutoPtrXMLCh redirectBufTrans(redirectBuf); return getSocketHandle(XMLUri(redirectBufTrans.get())); } else if (httpResponse != 200) { // Most likely a 404 Not Found error. // Should recognize and handle the forwarding responses. // throw XSECException(XSECException::HTTPURIInputStreamError, "Unknown HTTP response received"); } return (unsigned int) s; } XSECBinHTTPURIInputStream::XSECBinHTTPURIInputStream(const XMLUri& urlSource) : fSocketHandle(0) , fBytesProcessed(0) { if(!fInitialized) { if (!fInitMutex) { XMLMutex* tmpMutex = new XMLMutex; if (compareAndSwap((void**)&fInitMutex, tmpMutex, 0)) { // Someone beat us to it, so let's clean up ours delete tmpMutex; } } XMLMutexLock lock(fInitMutex); if (!fInitialized) { Initialize(); } } fSocketHandle = getSocketHandle(urlSource); } void XSECBinHTTPURIInputStream::ExternalInitialize(void) { if(!fInitialized) { if (!fInitMutex) { XMLMutex* tmpMutex = new XMLMutex; if (compareAndSwap((void**)&fInitMutex, tmpMutex, 0)) { // Someone beat us to it, so let's clean up ours delete tmpMutex; } } XMLMutexLock lock(fInitMutex); if (!fInitialized) { Initialize(); } } } XSECBinHTTPURIInputStream::~XSECBinHTTPURIInputStream() { shutdown(fSocketHandle, SD_BOTH); closesocket(fSocketHandle); } // // readBytes // xsecsize_t XSECBinHTTPURIInputStream::readBytes(XMLByte* const toFill , const xsecsize_t maxToRead) { xsecsize_t len = (xsecsize_t) (fBufferEnd - fBufferPos); if (len > 0) { // If there's any data left over in the buffer into which we first // read from the server (to get the http header), return that. if (len > maxToRead) len = maxToRead; memcpy(toFill, fBufferPos, len); fBufferPos += len; } else { // There was no data in the local buffer. // Read some from the socket, straight into our caller's buffer. // len = recv(fSocketHandle, (char *) toFill, maxToRead, 0); if (len == SOCKET_ERROR) { // Call WSAGetLastError() to get the error number. throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } } fBytesProcessed += len; return len; } #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* XSECBinHTTPURIInputStream::getContentType() const { return NULL; } #endif xml-security-c-1.7.3/xsec/utils/winutils/XSECURIResolverGenericWin32.hpp000644 001751 001751 00000007222 12003301052 027237 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverGenericWin32 := A URI Resolver that will work "out of * the box" with Windows. Re-implements * much Xerces code, but allows us to * handle HTTP redirects as is required by * the DSIG Standard * * $Id: XSECURIResolverGenericWin32.hpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.6 2005/02/03 13:56:22 milan * Apache licence fix. * * Revision 1.5 2004/02/08 10:25:40 blautenb * Convert to Apache 2.0 license * * Revision 1.4 2003/09/11 11:11:05 blautenb * Cleaned up usage of Xerces namespace - no longer inject into global namespace in headers * * Revision 1.3 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.2 2003/02/13 10:19:43 blautenb * Updated Xerces exceptions to Xsec exception * * Revision 1.1 2003/02/12 09:45:29 blautenb * Win32 Re-implementation of Xerces URIResolver to support re-directs * * */ #ifndef XSECURIRESOLVERGENERICWIN32_INCLUDE #define XSECURIRESOLVERGENERICWIN32_INCLUDE #include #include #include #include /** * @ingroup pubsig */ /*\@{*/ /** * @brief Generic Windows URI Resolver. * * The XML Digital Signature standard makes heavy use of URIs to * identify information to be referenced and signed. * * This class implements the XSECURIResolver for Windows32, re-using * much of the Xerces code. * * @todo Re-implement using the Windows Internet API */ class DSIG_EXPORT XSECURIResolverGenericWin32 : public XSECURIResolver { public: /** @name Constructors and Destructors */ //@{ XSECURIResolverGenericWin32(); virtual ~XSECURIResolverGenericWin32(); //@} /** @name Interface Methods */ //@{ /** * \brief Create a BYTE_STREAM from a URI. * * The resolver is required to take the input URI and * dereference it to an actual stream of octets. * * The octets are provided back to the library using * the Xerces BinInputStream class. * * @note The returned stream is "owned" by the caller, which * will delete it when processing is complete. * @param uri The string containing the URI to be de-referenced. * @returns The octet stream corresponding to the URI. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * resolveURI(const XMLCh * uri); /** * \brief Clone the resolver to be installed in a new object. * * When URIResolvers are passed into signatures and other * objects, they are cloned and control of the original object * is left with the caller. * */ virtual XSECURIResolver * clone(void); //@} /** @name Class specific functions */ //@{ /** * \brief Set the base URI for relative URIs. * */ void setBaseURI(const XMLCh * uri); //@} private: XMLCh * mp_baseURI; }; #endif /* XSECURIRESOLVERGENERICWIN32_INCLUDE */ xml-security-c-1.7.3/xsec/utils/winutils/XSECBinHTTPURIInputStream.hpp000644 001751 001751 00000012345 12003301052 026724 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinHTTPURIInputStream := Re-implementation of the Xerces * BinHTTPURLInputStream. Allows us to make * some small changes to support the requirements * of XMLDSIG (notably re-directs) * * NOTE: Much code taken from Xerces, and the cross platform interfacing is * no-where near as nice. * * Author(s): Berin Lautenbach * * $Id: XSECBinHTTPURIInputStream.hpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.7 2005/02/03 13:56:22 milan * Apache licence fix. * * Revision 1.6 2004/04/21 10:14:49 blautenb * Clean windows build with overarching SimpleSOAPRequestor * * Revision 1.5 2004/04/16 12:07:23 blautenb * Skeleton code for XKMS MessageFactory * * Revision 1.4 2004/02/08 10:25:40 blautenb * Convert to Apache 2.0 license * * Revision 1.3 2003/09/11 11:11:05 blautenb * Cleaned up usage of Xerces namespace - no longer inject into global namespace in headers * * Revision 1.2 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.1 2003/02/12 09:45:29 blautenb * Win32 Re-implementation of Xerces URIResolver to support re-directs * * */ #ifndef XSECBINHTTPURIINPUTSTREAM_HEADER #define XSECBINHTTPURIINPUTSTREAM_HEADER #include #include #include #include #include // // This class implements the BinInputStream interface specified by the XML // parser. // struct hostent; struct sockaddr; class XSECSOAPRequestorSimple; class DSIG_EXPORT XSECBinHTTPURIInputStream : public XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream { public : XSECBinHTTPURIInputStream(const XERCES_CPP_NAMESPACE_QUALIFIER XMLUri& urlSource); ~XSECBinHTTPURIInputStream(); #ifdef XSEC_XERCES_64BITSAFE XMLFilePos curPos() const; #else unsigned int curPos() const; #endif xsecsize_t readBytes(XMLByte* const toFill, const xsecsize_t maxToRead); #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* getContentType() const; #endif static void Cleanup(); friend class XSECSOAPRequestorSimple; protected: /* * These are called by other classes that use the loaded DLL * * Actually - this is cheating of the worst kind, but it * provides a quick way to make these calls available outside the library */ static void ExternalInitialize(void); static hostent* gethostbyname(const char* name); static unsigned long inet_addr(const char* cp); static hostent* gethostbyaddr(const char* addr,int len,int type); static unsigned short htons(unsigned short hostshort); static unsigned short socket(int af,int type,int protocol); static int connect(unsigned short s,const sockaddr* name,int namelen); static int send(unsigned short s,const char* buf,int len,int flags); static int recv(unsigned short s,char* buf,int len,int flags); static int shutdown(unsigned int s,int how); static int closesocket(unsigned int socket); private : // ----------------------------------------------------------------------- // Private data members // // fSocketHandle // The socket representing the connection to the remote file. // We deliberately did not define the type to be SOCKET, so as to // avoid bringing in any Windows header into this file. // fBytesProcessed // Its a rolling count of the number of bytes processed off this // input stream. // fBuffer // Holds the http header, plus the first part of the actual // data. Filled at the time the stream is opened, data goes // out to user in response to readBytes(). // fBufferPos, fBufferEnd // Pointers into fBuffer, showing start and end+1 of content // that readBytes must return. // ----------------------------------------------------------------------- unsigned int fSocketHandle; xsecsize_t fBytesProcessed; char fBuffer[4000]; char * fBufferEnd; char * fBufferPos; static bool fInitialized; static XERCES_CPP_NAMESPACE_QUALIFIER XMLMutex* fInitMutex; static void Initialize(); unsigned int getSocketHandle(const XERCES_CPP_NAMESPACE_QUALIFIER XMLUri& urlSource); }; inline #ifdef XSEC_XERCES_64BITSAFE XMLFilePos #else unsigned int #endif XSECBinHTTPURIInputStream::curPos() const { return fBytesProcessed; } #endif // XSECBINHTTPURIINPUTSTREAM_HEADER xml-security-c-1.7.3/xsec/utils/unixutils/XSECURIResolverGenericUnix.hpp000644 001751 001751 00000007041 12003301052 027445 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverGenericWin32 := A URI Resolver that will work "out of * the box" with UNIX. Re-implements * much Xerces code, but allows us to * handle HTTP redirects as is required by * the DSIG Standard * * Author(s): Berin Lautenbach * * $Id: XSECURIResolverGenericUnix.hpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.5 2005/02/03 13:55:08 milan * Apache licence fix. * * Revision 1.4 2004/02/08 10:50:22 blautenb * Update to Apache 2.0 license * * Revision 1.3 2003/09/11 11:29:12 blautenb * Fix Xerces namespace usage in *NIX build * * Revision 1.2 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.1 2003/02/12 11:21:04 blautenb * UNIX generic URI resolver * * */ #ifndef XSECURIRESOLVERGENERICUNIX_INCLUDE #define XSECURIRESOLVERGENERICUNIX_INCLUDE #include #include #include /** * @ingroup pubsig */ /*\@{*/ /** * @brief Generic UNIX URI Resolver. * * The XML Digital Signature standard makes heavy use of URIs to * identify information to be referenced and signed. * * This class implements the XSECURIResolver for UNIX, re-using * much of the Xerces code. * * @todo Implement a "pluggable" URI resolver that allows developers * to plug in different classes for different schemes */ class DSIG_EXPORT XSECURIResolverGenericUnix : public XSECURIResolver { public: /** @name Constructors and Destructors */ //@{ XSECURIResolverGenericUnix(); virtual ~XSECURIResolverGenericUnix(); //@} /** @name Interface Methods */ //@{ /** * \brief Create a BYTE_STREAM from a URI. * * The resolver is required to take the input URI and * dereference it to an actual stream of octets. * * The octets are provided back to the library using * the Xerces BinInputStream class. * * @note The returned stream is "owned" by the caller, which * will delete it when processing is complete. * @param uri The string containing the URI to be de-referenced. * @returns The octet stream corresponding to the URI. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * resolveURI(const XMLCh * uri); /** * \brief Clone the resolver to be installed in a new object. * * When URIResolvers are passed into signatures and other * objects, they are cloned and control of the original object * is left with the caller. * */ virtual XSECURIResolver * clone(void); //@} /** @name Class specific functions */ //@{ /** * \brief Set the base URI for relative URIs. * */ void setBaseURI(const XMLCh * uri); //@} private: XMLCh * mp_baseURI; }; #endif /* XSECURIRESOLVERGENERICUNIX_INCLUDE */ xml-security-c-1.7.3/xsec/utils/unixutils/XSECBinHTTPURIInputStream.hpp000644 001751 001751 00000007345 12003301052 027116 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinHTTPURIInputStream := Re-implementation of Xerces BinHTTPInputStream * Allows us to modify and create an input * stream that follows re-directs which is * necessary to fully support XML-DSIG interop * tests * * Author(s): Berin Lautenbach * * $Id: XSECBinHTTPURIInputStream.hpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.5 2005/02/03 13:55:08 milan * Apache licence fix. * * Revision 1.4 2004/02/08 10:50:22 blautenb * Update to Apache 2.0 license * * Revision 1.3 2003/09/11 11:29:12 blautenb * Fix Xerces namespace usage in *NIX build * * Revision 1.2 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.1 2003/02/12 11:21:03 blautenb * UNIX generic URI resolver * * */ #ifndef UNIXXSECBINHTTPURIINPUTSTREAM_HEADER #define UNIXXSECBINHTTPURIINPUTSTREAM_HEADER #include #include #include #include // // This class implements the BinInputStream interface specified by the XML // parser. // class DSIG_EXPORT XSECBinHTTPURIInputStream : public XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream { public : XSECBinHTTPURIInputStream(const XERCES_CPP_NAMESPACE_QUALIFIER XMLUri& urlSource); ~XSECBinHTTPURIInputStream(); #ifdef XSEC_XERCES_64BITSAFE XMLFilePos curPos() const; #else unsigned int curPos() const; #endif xsecsize_t readBytes ( XMLByte* const toFill , const xsecsize_t maxToRead ); #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* getContentType() const; #endif private : // ----------------------------------------------------------------------- // Private data members // // fSocket // The socket representing the connection to the remote file. // fBytesProcessed // Its a rolling count of the number of bytes processed off this // input stream. // fBuffer // Holds the http header, plus the first part of the actual // data. Filled at the time the stream is opened, data goes // out to user in response to readBytes(). // fBufferPos, fBufferEnd // Pointers into fBuffer, showing start and end+1 of content // that readBytes must return. // ----------------------------------------------------------------------- int getSocketHandle(const XERCES_CPP_NAMESPACE_QUALIFIER XMLUri& urlSource); int fSocket; xsecsize_t fBytesProcessed; char fBuffer[4000]; char * fBufferEnd; char * fBufferPos; }; inline #ifdef XSEC_XERCES_64BITSAFE XMLFilePos #else unsigned int #endif XSECBinHTTPURIInputStream::curPos() const { return fBytesProcessed; } #endif // UNIXXSECBINHTTPURIINPUTSTREAM_HEADER xml-security-c-1.7.3/xsec/utils/unixutils/XSECSOAPRequestorSimpleUnix.cpp000644 001751 001751 00000024054 12003301052 027613 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECSOAPRequestorSimple := (Very) Basic implementation of a SOAP * HTTP wrapper for testing the client code. * * * $Id: XSECSOAPRequestorSimpleUnix.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../../utils/XSECAutoPtr.hpp" #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Platform specific constructor // -------------------------------------------------------------------------------- XSECSOAPRequestorSimple::XSECSOAPRequestorSimple(const XMLCh * uri) : m_uri(uri) { } // -------------------------------------------------------------------------------- // Interface // -------------------------------------------------------------------------------- DOMDocument * XSECSOAPRequestorSimple::doRequest(DOMDocument * request) { char * content = wrapAndSerialise(request); // First we need to serialise char fBuffer[4000]; char * fBufferEnd; char * fBufferPos; // // Pull all of the parts of the URL out of th m_uri object, and transcode them // and transcode them back to ASCII. // const XMLCh* hostName = m_uri.getHost(); XSECAutoPtrChar hostNameAsCharStar(hostName); const XMLCh* path = m_uri.getPath(); XSECAutoPtrChar pathAsCharStar(path); const XMLCh* fragment = m_uri.getFragment(); XSECAutoPtrChar fragmentAsCharStar(fragment); const XMLCh* query = m_uri.getQueryString(); XSECAutoPtrChar queryAsCharStar(query); unsigned short portNumber = (unsigned short) m_uri.getPort(); // If no number is set, go with port 80 if (portNumber == USHRT_MAX) portNumber = 80; // // Set up a socket. // struct hostent* hostEntPtr = 0; struct sockaddr_in sa; if ((hostEntPtr = gethostbyname(hostNameAsCharStar.get())) == NULL) { unsigned long numAddress = inet_addr(hostNameAsCharStar.get()); if (numAddress == 0) { ThrowXML(NetAccessorException, XMLExcepts::NetAcc_TargetResolution); } if ((hostEntPtr = gethostbyaddr((char *) &numAddress, sizeof(unsigned long), AF_INET)) == NULL) { ThrowXML(NetAccessorException, XMLExcepts::NetAcc_TargetResolution); } } memcpy((void *) &sa.sin_addr, (const void *) hostEntPtr->h_addr, hostEntPtr->h_length); sa.sin_family = hostEntPtr->h_addrtype; sa.sin_port = htons(portNumber); int s = socket(hostEntPtr->h_addrtype, SOCK_STREAM, 0); if (s < 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error creating socket"); } if (connect(s, (struct sockaddr *) &sa, sizeof(sa)) < 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error connecting to end server"); } // The port is open and ready to go. // Build up the http GET command to send to the server. // To do: We should really support http 1.1. This implementation // is weak. memset(fBuffer, 0, sizeof(fBuffer)); strcpy(fBuffer, "POST "); strcat(fBuffer, pathAsCharStar.get()); if (queryAsCharStar.get() != 0) { // Tack on a ? before the fragment strcat(fBuffer,"?"); strcat(fBuffer, queryAsCharStar.get()); } if (fragmentAsCharStar.get() != 0) { strcat(fBuffer, fragmentAsCharStar.get()); } strcat(fBuffer, " HTTP/1.0\r\n"); strcat(fBuffer, "Content-Type: text/xml; charset=utf-8\r\n"); strcat(fBuffer, "Host: "); strcat(fBuffer, hostNameAsCharStar.get()); if (portNumber != 80) { int i = strlen(fBuffer); sprintf(fBuffer+i, ":%d", portNumber); } strcat(fBuffer, "\r\n"); strcat(fBuffer, "Content-Length: "); int i = (int) strlen(fBuffer); sprintf(fBuffer+i, "%d", strlen(content)); strcat(fBuffer, "\r\n"); strcat(fBuffer, "SOAPAction: \"\"\r\n"); /* strcat(fBuffer, "Connection: Close\r\n"); strcat(fBuffer, "Cache-Control: no-cache\r\n");*/ strcat(fBuffer, "\r\n"); // Now the content strcat(fBuffer, content); // Send the http request int lent = strlen(fBuffer); int aLent = 0; if ((aLent = write(s, (void *) fBuffer, lent)) != lent) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error writing to socket"); } // // get the response, check the http header for errors from the server. // aLent = read(s, (void *)fBuffer, sizeof(fBuffer)-1); /* fBuffer[aLent] = '\0'; printf(fBuffer); */ if (aLent <= 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBuffer+aLent; *fBufferEnd = 0; // Find the break between the returned http header and any data. // (Delimited by a blank line) // Hang on to any data for use by the first read from this BinHTTPURLInputStream. // bool headerRead = false; do { fBufferPos = strstr(fBuffer, "\r\n\r\n"); if (fBufferPos != 0) { fBufferPos += 4; *(fBufferPos-2) = 0; headerRead = true; } else { fBufferPos = strstr(fBuffer, "\n\n"); if (fBufferPos != 0) { fBufferPos += 2; *(fBufferPos-1) = 0; headerRead = true; } else { // // Header is not yet read, do another recv() to get more data... aLent = read(s, fBufferEnd, (sizeof(fBuffer) - 1) - (fBufferEnd - fBuffer)); if (aLent <= 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBufferEnd + aLent; *fBufferEnd = 0; } } } while(headerRead == false); // Make sure the header includes an HTTP 200 OK response. // char *p = strstr(fBuffer, "HTTP"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } int httpResponse = atoi(p); if (httpResponse == 302 || httpResponse == 301) { //Once grows, should use a switch char redirectBuf[256]; int q; // Find the "Location:" string p = strstr(p, "Location:"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } // Now read p++; for (q=0; q < 255 && p[q] != '\r' && p[q] !='\n'; ++q) redirectBuf[q] = p[q]; redirectBuf[q] = '\0'; // Try to find this location #if 0 // Does not work in Xerces 2.1 as there is no XMLUri::operator= m_uri = XMLUri(XMLString::transcode(redirectBuf)); return doRequest(request); #endif XMLCh * recString = XMLString::transcode(redirectBuf); XSECSOAPRequestorSimple recurse(recString); XSEC_RELEASE_XMLCH(recString); return recurse.doRequest(request); } else if (httpResponse != 200) { // Most likely a 404 Not Found error. // Should recognize and handle the forwarding responses. // char * q = strstr(p, "\n"); if (q == NULL) q = strstr(p, "\r"); if (q != NULL) *q = '\0'; safeBuffer sb; sb.sbStrcpyIn("SOAPRequestorSimple HTTP Error : "); if (strlen(p) < 256) sb.sbStrcatIn(p); throw XSECException(XSECException::HTTPURIInputStreamError, sb.rawCharBuffer()); } /* Now find out how long the return is */ p = strstr(fBuffer, "Content-Length:"); int responseLength; if (p == NULL) { // Need to work it out from the amount of data returned responseLength = -1; } else { p = strchr(p, ' '); p++; responseLength = atoi(p); } safeBuffer responseBuffer; lent = fBufferEnd - fBufferPos; responseBuffer.sbMemcpyIn(fBufferPos, lent); while (responseLength == -1 || lent < responseLength) { aLent = read(s, (void *)fBuffer, sizeof(fBuffer)-1); if (aLent > 0) { responseBuffer.sbMemcpyIn(lent, fBuffer, aLent); lent += aLent; } else { responseLength = 0; } } return parseAndUnwrap(responseBuffer.rawCharBuffer(), lent); #if 0 char * responseBuffer; XSECnew(responseBuffer, char[responseLength]); ArrayJanitor j_responseBuffer(responseBuffer); lent = fBufferEnd - fBufferPos; memcpy(responseBuffer, fBufferPos, lent); while (lent < responseLength) { aLent = read(s, &responseBuffer[lent], responseLength - lent); lent += aLent; } return parseAndUnwrap(responseBuffer, responseLength); #endif } xml-security-c-1.7.3/xsec/utils/unixutils/XSECURIResolverGenericUnix.cpp000644 001751 001751 00000016347 12003301052 027451 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverGenericUnix := A URI Resolver that will work "out of * the box" with UNIX. Re-implements * much Xerces code, but allows us to * handle HTTP redirects as is required by * the DSIG Standard * * Author(s): Berin Lautenbach * * $Id: XSECURIResolverGenericUnix.cpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.11 2005/02/03 13:55:08 milan * Apache licence fix. * * Revision 1.10 2004/10/10 07:00:34 blautenb * Compile with Xerces 2.1 * * Revision 1.9 2004/02/21 08:26:54 blautenb * Use XMLString::release rather than delete[] for all Xerces strings * * Revision 1.8 2004/02/08 10:50:22 blautenb * Update to Apache 2.0 license * * Revision 1.7 2004/02/03 11:00:03 blautenb * Add Space handling to UNIX URL handling * * Revision 1.6 2004/01/26 00:29:48 blautenb * Check for Xerces new way of handling NULL hostnames in URIs * * Revision 1.5 2003/09/11 11:29:12 blautenb * Fix Xerces namespace usage in *NIX build * * Revision 1.4 2003/07/05 10:30:38 blautenb * Copyright update * * Revision 1.3 2003/05/10 07:23:36 blautenb * Updates to support anonymous references * * Revision 1.2 2003/02/20 10:35:10 blautenb * Fix for broken Xerces XMLUri * * Revision 1.1 2003/02/12 11:21:03 blautenb * UNIX generic URI resolver * * */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #include #include #include "../../utils/XSECAutoPtr.hpp" static const XMLCh gFileScheme[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_f, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_i, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_l, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_e, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; static const XMLCh gHttpScheme[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_h, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_t, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_t, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_p, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; #if XERCES_VERSION_MAJOR == 2 && XERCES_VERSION_MINOR < 3 static const XMLCh DOTDOT_SLASH[] = { XERCES_CPP_NAMESPACE_QUALIFIER chPeriod, XERCES_CPP_NAMESPACE_QUALIFIER chPeriod, XERCES_CPP_NAMESPACE_QUALIFIER chForwardSlash, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; #endif XSECURIResolverGenericUnix::XSECURIResolverGenericUnix() : mp_baseURI(NULL) { }; XSECURIResolverGenericUnix::~XSECURIResolverGenericUnix() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } // ----------------------------------------------------------------------- // Resolve a URI that is passed in // ----------------------------------------------------------------------- BinInputStream * XSECURIResolverGenericUnix::resolveURI(const XMLCh * uri) { XSEC_USING_XERCES(BinInputStream); XSEC_USING_XERCES(XMLUri); XSEC_USING_XERCES(XMLUni); XSEC_USING_XERCES(Janitor); XSEC_USING_XERCES(BinFileInputStream); XMLUri * xmluri; if (uri == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericUnix - anonymous references not supported in default URI Resolvers"); } // Create the appropriate XMLUri objects if (mp_baseURI != NULL) { XMLUri * turi; #if XERCES_VERSION_MAJOR == 2 && XERCES_VERSION_MINOR < 3 // XMLUri relative paths are broken, so we need to strip out ".." XSECAutoPtrXMLCh b(mp_baseURI); XSECAutoPtrXMLCh r(uri); int index = 0; while (XMLString::startsWith(&(r.get()[index]), DOTDOT_SLASH)) { // Strip the last segment of the base int lastIndex = XMLString::lastIndexOf(b.get(), XERCES_CPP_NAMESPACE_QUALIFIER chForwardSlash); if (lastIndex > 0) const_cast(b.get())[lastIndex] = 0; index += 3; } XSECnew(turi, XMLUri(b.get())); Janitor j_turi(turi); XSECnew(xmluri, XMLUri(turi, &(r.get()[index]))); #else XSECnew(turi, XMLUri(mp_baseURI)); Janitor j_turi(turi); XSECnew(xmluri, XMLUri(turi, uri)); #endif } else { XSECnew(xmluri, XMLUri(uri)); } Janitor j_xmluri(xmluri); // Determine what kind of URI this is and how to handle it. if (!XMLString::compareIString(xmluri->getScheme(), gFileScheme)) { // This is a file. We only really understand if this is localhost // XMLUri has already cleaned of escape characters (%xx) if (xmluri->getHost() == NULL || xmluri->getHost()[0] == chNull || !XMLString::compareIString(xmluri->getHost(), XMLUni::fgLocalHostString)) { // Clean hex escapes XMLCh * realPath = cleanURIEscapes(xmluri->getPath()); // Localhost BinFileInputStream* retStrm = new BinFileInputStream(realPath); XSEC_RELEASE_XMLCH(realPath); if (!retStrm->getIsOpen()) { delete retStrm; return 0; } return retStrm; } else { throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericUnix - unable to open non-localhost file"); } } // Is the scheme a HTTP? if (!XMLString::compareIString(xmluri->getScheme(), gHttpScheme)) { // Pass straight to our local XSECBinHTTPUriInputStream XSECBinHTTPURIInputStream *ret; XSECnew(ret, XSECBinHTTPURIInputStream(*xmluri)); return ret; } throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverGenericUnix - unknown URI scheme"); } // ----------------------------------------------------------------------- // Clone me // ----------------------------------------------------------------------- XSECURIResolver * XSECURIResolverGenericUnix::clone(void) { XSECURIResolverGenericUnix * ret; ret = new XSECURIResolverGenericUnix(); if (this->mp_baseURI != NULL) ret->mp_baseURI = XMLString::replicate(this->mp_baseURI); else ret->mp_baseURI = NULL; return ret; } // ----------------------------------------------------------------------- // Set a base URI to map any incoming files against // ----------------------------------------------------------------------- void XSECURIResolverGenericUnix::setBaseURI(const XMLCh * uri) { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); mp_baseURI = XMLString::replicate(uri); } xml-security-c-1.7.3/xsec/utils/unixutils/XSECBinHTTPURIInputStream.cpp000644 001751 001751 00000022406 12003301052 027104 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECBinHTTPURIInputStream := Re-implementation of Xerces BinHTTPInputStream * Allows us to modify and create an input * stream that follows re-directs which is * necessary to fully support XML-DSIG interop * tests * * Author(s): Berin Lautenbach * * $Id: XSECBinHTTPURIInputStream.cpp 1125514 2011-05-20 19:08:33Z scantor $ * * $Log$ * Revision 1.8 2005/02/03 13:55:08 milan * Apache licence fix. * * Revision 1.7 2004/02/08 10:50:22 blautenb * Update to Apache 2.0 license * * Revision 1.6 2003/09/11 11:29:12 blautenb * Fix Xerces namespace usage in *NIX build * * Revision 1.5 2003/07/05 10:30:37 blautenb * Copyright update * * Revision 1.4 2003/05/19 12:31:00 blautenb * Cleaned up constants so can compile under INTEL compiler * * Revision 1.3 2003/03/23 09:49:49 blautenb * Silly mistype in == * * Revision 1.2 2003/03/15 22:41:46 blautenb * Add 301 (permanently moved) support * * Revision 1.1 2003/02/12 11:21:03 blautenb * UNIX generic URI resolver * * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../../utils/XSECAutoPtr.hpp" #include #include #include #include #include XERCES_CPP_NAMESPACE_USE int XSECBinHTTPURIInputStream::getSocketHandle(const XMLUri& urlSource) { // // Pull all of the parts of the URL out of th urlSource object, and transcode them // and transcode them back to ASCII. // const XMLCh* hostName = urlSource.getHost(); XSECAutoPtrChar hostNameAsCharStar(hostName); const XMLCh* path = urlSource.getPath(); XSECAutoPtrChar pathAsCharStar(path); const XMLCh* fragment = urlSource.getFragment(); XSECAutoPtrChar fragmentAsCharStar(fragment); const XMLCh* query = urlSource.getQueryString(); XSECAutoPtrChar queryAsCharStar(query); unsigned short portNumber = (unsigned short) urlSource.getPort(); if (portNumber == USHRT_MAX) portNumber = 80; // // Set up a socket. // struct hostent* hostEntPtr = 0; struct sockaddr_in sa; if ((hostEntPtr = gethostbyname(hostNameAsCharStar.get())) == NULL) { unsigned long numAddress = inet_addr(hostNameAsCharStar.get()); if (numAddress == 0) { ThrowXML(NetAccessorException, XMLExcepts::NetAcc_TargetResolution); } if ((hostEntPtr = gethostbyaddr((char *) &numAddress, sizeof(unsigned long), AF_INET)) == NULL) { ThrowXML(NetAccessorException, XMLExcepts::NetAcc_TargetResolution); } } memcpy((void *) &sa.sin_addr, (const void *) hostEntPtr->h_addr, hostEntPtr->h_length); sa.sin_family = hostEntPtr->h_addrtype; sa.sin_port = htons(portNumber); int s = socket(hostEntPtr->h_addrtype, SOCK_STREAM, 0); if (s < 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error creating socket"); } if (connect(s, (struct sockaddr *) &sa, sizeof(sa)) < 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error connecting to end server"); } // The port is open and ready to go. // Build up the http GET command to send to the server. // To do: We should really support http 1.1. This implementation // is weak. strcpy(fBuffer, "GET "); strcat(fBuffer, pathAsCharStar.get()); if (queryAsCharStar.get() != 0) { size_t n = strlen(fBuffer); fBuffer[n] = XERCES_CPP_NAMESPACE_QUALIFIER chQuestion; fBuffer[n+1] = XERCES_CPP_NAMESPACE_QUALIFIER chNull; strcat(fBuffer, queryAsCharStar.get()); } if (fragmentAsCharStar.get() != 0) { strcat(fBuffer, fragmentAsCharStar.get()); } strcat(fBuffer, " HTTP/1.0\r\n"); strcat(fBuffer, "Host: "); strcat(fBuffer, hostNameAsCharStar.get()); if (portNumber != 80) { int i = strlen(fBuffer); sprintf(fBuffer+i, ":%d", portNumber); // _itoa(portNumber, fBuffer+i, 10); } strcat(fBuffer, "\r\n\r\n"); // Send the http request int lent = strlen(fBuffer); int aLent = 0; if ((aLent = write(s, (void *) fBuffer, lent)) != lent) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error writing to socket"); } // // get the response, check the http header for errors from the server. // aLent = read(s, (void *)fBuffer, sizeof(fBuffer)-1); if (aLent <= 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } fBufferEnd = fBuffer+aLent; *fBufferEnd = 0; // Find the break between the returned http header and any data. // (Delimited by a blank line) // Hang on to any data for use by the first read from this BinHTTPURLInputStream. // fBufferPos = strstr(fBuffer, "\r\n\r\n"); if (fBufferPos != 0) { fBufferPos += 4; *(fBufferPos-2) = 0; } else { fBufferPos = strstr(fBuffer, "\n\n"); if (fBufferPos != 0) { fBufferPos += 2; *(fBufferPos-1) = 0; } else fBufferPos = fBufferEnd; } // Make sure the header includes an HTTP 200 OK response. // char *p = strstr(fBuffer, "HTTP"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } int httpResponse = atoi(p); if (httpResponse == 302 || httpResponse == 301) { //Once grows, should use a switch char redirectBuf[256]; int q; // Find the "Location:" string p = strstr(p, "Location:"); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } p = strchr(p, ' '); if (p == 0) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reported reading socket"); } // Now read p++; for (q=0; q < 255 && p[q] != '\r' && p[q] !='\n'; ++q) redirectBuf[q] = p[q]; redirectBuf[q] = '\0'; // Try to find this location XSECAutoPtrXMLCh redirectBufTrans(redirectBuf); return getSocketHandle(XMLUri(redirectBufTrans.get())); } else if (httpResponse != 200) { // Most likely a 404 Not Found error. // Should recognize and handle the forwarding responses. // throw XSECException(XSECException::HTTPURIInputStreamError, "Unknown HTTP Response"); } return s; } XSECBinHTTPURIInputStream::XSECBinHTTPURIInputStream(const XMLUri& urlSource) : fSocket(0) , fBytesProcessed(0) { fSocket = getSocketHandle(urlSource); } XSECBinHTTPURIInputStream::~XSECBinHTTPURIInputStream() { shutdown(fSocket, 2); close(fSocket); } xsecsize_t XSECBinHTTPURIInputStream::readBytes(XMLByte* const toFill , const xsecsize_t maxToRead) { xsecsize_t len = fBufferEnd - fBufferPos; if (len > 0) { // If there's any data left over in the buffer into which we first // read from the server (to get the http header), return that. if (len > maxToRead) len = maxToRead; memcpy(toFill, fBufferPos, len); fBufferPos += len; } else { // There was no data in the local buffer. // Read some from the socket, straight into our caller's buffer. // len = read(fSocket, (void *) toFill, maxToRead); if (len == UINT_MAX) { throw XSECException(XSECException::HTTPURIInputStreamError, "Error reading from Socket"); } } fBytesProcessed += len; return len; } #ifdef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE const XMLCh* XSECBinHTTPURIInputStream::getContentType() const { return NULL; } #endif xml-security-c-1.7.3/xsec/transformers/TXFMXPathFilter.hpp000644 001751 001751 00000006246 12003301053 024661 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXPath := Class that performs XPath transforms * * $Id: TXFMXPathFilter.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #if !defined (TXFMXPATHFILTER_HEADER) #define TXFMXPATHFILTER_HEADER #include #include #include #include // Xerces XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMNamedNodeMap); class TXFMXPathFilterExpr; class XSECSafeBufferFormatter; struct filterSetHolder { XSECXPathNodeList * lst; xpathFilterType type; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * ancestorInScope; }; #ifndef XSEC_NO_XPATH /** * \brief Transformer to handle XPath transforms * @ingroup internal */ class DSIG_EXPORT TXFMXPathFilter : public TXFMBase { public: TXFMXPathFilter(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMXPathFilter(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // XPathFilter unique void evaluateExprs(DSIGTransformXPathFilter::exprVectorType * exprs); XSECXPathNodeList * evaluateSingleExpr(DSIGXPathFilterExpr *expr); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); virtual XSECXPathNodeList & getXPathNodeList(); private: typedef std::vector lstsVectorType; TXFMXPathFilter(); void walkDocument(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n); bool checkNodeInScope(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n); bool checkNodeInInput(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * attParent); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * document; XSECXPathNodeList m_xpathFilterMap; lstsVectorType m_lsts; XSECSafeBufferFormatter * mp_formatter; /* Used to hold details during tree-walk */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_fragment; XSECXPathNodeList * mp_inputList; }; #endif #endif /* XPATHFILTER_HEADER */ xml-security-c-1.7.3/xsec/transformers/TXFMSHA1.hpp000644 001751 001751 00000004150 12003301053 023153 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMSHA1 := Class that performs a SHA1 transform * * $Id: TXFMSHA1.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include /** * \brief Transformer to handle create a SHA-1 hash from a chain * @ingroup internal */ class DSIG_EXPORT TXFMSHA1 : public TXFMBase { private: XSECCryptoHash * mp_h; // To hold the hash unsigned char md_value[CRYPTO_MAX_HASH_SIZE]; // Final output unsigned int md_len; // Length of digest unsigned int toOutput; // Amount still to output public: TXFMSHA1(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, hashMethod hm = HASH_SHA1, XSECCryptoKey * key = NULL); ~TXFMSHA1(); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to set input data virtual void setInput(TXFMBase * inputT); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMSHA1(); }; xml-security-c-1.7.3/xsec/transformers/TXFMParser.hpp000644 001751 001751 00000004714 12003301053 023721 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMParser := A transformer used to transform a byte stream to DOM Nodes * * $Id: TXFMParser.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMPARSER_INCLUDE #define TXFMPARSER_INCLUDE #include /** * \brief Transformer to handle move between bytes and DOM * @ingroup internal * * THere is no "parser" transformation defined in DSIG, however there * is a requirement to be able to move between a byte stream and * a list of nodes. For example, if a ref URI points to an external * document, and the first transformation on that document is an * XPath expression, then the library uses this class to translate the * BYTE stream to a DOM document. */ class DSIG_EXPORT TXFMParser : public TXFMBase { public: // Constructors and destructors TXFMParser(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *); ~TXFMParser(); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to set input data virtual void setInput(TXFMBase * newInput); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); // Name space management virtual bool nameSpacesExpanded(void); virtual void expandNameSpaces(void); private: TXFMParser(); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_parsedDoc; }; #endif /* #define TXFMPARSER_INCLUDE */ xml-security-c-1.7.3/xsec/transformers/TXFMOutputFile.hpp000644 001751 001751 00000004554 12003301053 024567 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMOutputFile := Transform that outputs the byte stream to a file without changing * the actual data in any way * * $Id: TXFMOutputFile.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMOUTPUTFILE_INCLUDE #define TXFMOUTPUTFILE_INCLUDE #include #include using std::ofstream; /** * \brief Transformer to handle file output transforms * @ingroup internal * * This transformer simply reads from the input transform * and passes the bytes to the transformer that reads from it. * * On the way through, the writes are written to an output * stream (a file). This is primarily a debugging tool. */ class DSIG_EXPORT TXFMOutputFile : public TXFMBase { private: ofstream f; public: TXFMOutputFile(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc) : TXFMBase(doc) {input = NULL;} ~TXFMOutputFile(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // Set output file bool setFile(char * const fileName); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMOutputFile(); }; #endif /* #define TXFMOUTPUTFILE_INCLUDE */ xml-security-c-1.7.3/xsec/transformers/TXFMURL.hpp000644 001751 001751 00000004411 12003301053 023121 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMURL := Class that takes an input URL to start of a transform pipe * * $Id: TXFMURL.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include // Xerces #include /** * \brief Base transformer for URL inputs to chains. Also used to * provide a method to provide a BinInputStream as an input method * * @ingroup internal */ class DSIG_EXPORT TXFMURL : public TXFMBase { private: XSECURIResolver * mp_resolver; // Resolver passed in XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * is; // To handle the actual input bool done; public: TXFMURL(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECURIResolver * resolver); ~TXFMURL(); // Methods to set the inputs virtual void setInput(TXFMBase *newInput); void setInput(const XMLCh * URL); void setInput(XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * inputStream); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private : TXFMURL(); }; xml-security-c-1.7.3/xsec/transformers/TXFMBase.hpp000644 001751 001751 00000010263 12003301053 023333 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMBase := Base (virtual) class that defines a DSIG Transformer * * Author(s): Berin Lautenbach * * $Id: TXFMBase.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMBASE_INCLUDE #define TXFMBASE_INCLUDE #include #include #include #include // Xalan #include #include class TXFMChain; /** @defgroup internal Internal Classes * Classes marked as internal are used internally by the xml-security-c * library. Generally there should be no requirement for these classes * to be manipulated directly by the calling applicataion. * @{ */ /** * \brief Base class for transformers * * Transformers are internal classes within the xml-security-c library * that actually perform the transformations. * * Users interface with the library should use the DSIGTransform classes, * which define the DOM nodes and allow users to manipulate the actual * transform defined. */ class DSIG_EXPORT TXFMBase { protected: TXFMBase *input; // The input source that we read from bool keepComments; // Each transform needs to tell the next whether comments are still in XSECNameSpaceExpander * mp_nse; // For expanding document name spaces XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_expansionDoc; // For expanding XSECXPathNodeList m_XPathMap; // For node lists if necessary public: TXFMBase(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc) {input = NULL; keepComments = true; mp_nse = NULL; mp_expansionDoc = doc;} virtual ~TXFMBase(); // For getting/setting input/output type enum ioType { NONE = 1, // For when there is no Input BYTE_STREAM = 2, DOM_NODES = 3 }; enum nodeType { DOM_NODE_NONE = 1, // No nodes set DOM_NODE_DOCUMENT = 2, // This is a dom document DOM_NODE_DOCUMENT_FRAGMENT = 3, // This is a fragment only DOM_NODE_DOCUMENT_NODE = 4, // This is a fragment id;d by DOM_Node DOM_NODE_XPATH_NODESET = 5 // This is a set of nodes }; // Methods to set the inputs // NOTE: If this throws an exception, the implementation class // MUST have added the newInput to it's chain to ensure that // Deletion of the chain will include everything. virtual void setInput(TXFMBase *newInput) = 0; // Methods to get tranform output type and input requirement virtual ioType getInputType(void) = 0; virtual ioType getOutputType(void) = 0; virtual nodeType getNodeType(void) = 0; // Name space expansion handling virtual bool nameSpacesExpanded(void); virtual void expandNameSpaces(void); void deleteExpandedNameSpaces(void); // Comment handling virtual void stripComments(void) { keepComments = false;} virtual void activateComments(void); virtual bool getCommentsStatus(void) {return keepComments;} // Methods to get output data // BinInputStream methods: virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill) = 0; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument() = 0; virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode() = 0; virtual const XMLCh * getFragmentId() = 0; virtual XSECXPathNodeList & getXPathNodeList() {return m_XPathMap;} // Friends and Statics friend class TXFMChain; private: TXFMBase(); }; /** @} */ #endif /* #define TXFMBASE_INCLUDE */ xml-security-c-1.7.3/xsec/transformers/TXFMCipher.hpp000644 001751 001751 00000005445 12003301053 023701 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMCipher := Class that performs a symmetric encrypt/decrypt transform * * $Id: TXFMCipher.hpp 1352681 2012-06-21 20:58:40Z scantor $ * */ #ifndef TXFMCIPHER_INCLUDE #define TXFMCIPHER_INCLUDE // XSEC Includes #include #include /** * \brief Transformer to handle symmetric encryption. * * Note that there is no particular XML DSIG/XENC transform associated * with encryption, but this is a convenient way to handle this process. * @ingroup internal */ class DSIG_EXPORT TXFMCipher : public TXFMBase { public: // Constructors and destructors TXFMCipher(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* doc, XSECCryptoKey* key, bool encrypt, XSECCryptoSymmetricKey::SymmetricKeyMode mode = XSECCryptoSymmetricKey::MODE_CBC, unsigned int taglen = 0); ~TXFMCipher(); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // TXFMCipher Unique void setKey(unsigned char * key, unsigned int keyLen); // Methods to set input data virtual void setInput(TXFMBase * newInput); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMCipher(); bool m_doEncrypt; // Are we in encrypt (or decrypt) mode unsigned int m_taglen; // Length of Authentication Tag for AEAD ciphers XSECCryptoKey * mp_cipher; // Crypto implementation bool m_complete; unsigned char m_inputBuffer[2050]; unsigned char m_outputBuffer[3072]; // Always keep 2K of data unsigned int m_remaining; // Amount remaining in output }; #endif /* TXFMCIPHER_INCLUDE */ xml-security-c-1.7.3/xsec/transformers/TXFMEnvelope.hpp000644 001751 001751 00000004347 12003301053 024244 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMEnvelope := Class that calculates an Envelope with an XPath evaluator * * $Id: TXFMEnvelope.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include // Xerces #include /** * \brief Transformer to handle envelope transforms * @ingroup internal */ class DSIG_EXPORT TXFMEnvelope : public TXFMBase { private: XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_document; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_startNode; public: TXFMEnvelope(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMEnvelope(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // Envelope unique void evaluateEnvelope(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *t); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); virtual XSECXPathNodeList & getXPathNodeList(); private: TXFMEnvelope(); }; xml-security-c-1.7.3/xsec/transformers/TXFMChain.hpp000644 001751 001751 00000003335 12003301053 023505 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMChain := List class that holds and manipulates a chain of TXFM * objects. * * Author(s): Berin Lautenbach * * $Id: TXFMChain.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMCHAIN_INCLUDE #define TXFMCHAIN_INCLUDE #include class TXFMBase; /** * \brief A holder class to take care of a chain of internal * transformer objects. * @ingroup internal */ class DSIG_EXPORT TXFMChain { public: // Constructors/destructors TXFMChain(TXFMBase * baseTxfm, bool deleteChainWhenDone = true); ~TXFMChain(); // Manipulate void appendTxfm(TXFMBase * txfm); TXFMBase * getLastTxfm(void); private: TXFMChain(); TXFMChain(TXFMChain &toCopy); TXFMBase * mp_currentTxfm; bool m_deleteChainWhenDone; void deleteTXFMChain(TXFMBase * toDelete); }; inline TXFMBase * TXFMChain::getLastTxfm(void) {return mp_currentTxfm;} #endif /* TXFMCHAIN_INCLUDE */ xml-security-c-1.7.3/xsec/transformers/TXFMMD5.hpp000644 001751 001751 00000004257 12003301053 023054 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMMD5 := Class that performs a MD5 transform * * Author(s): Berin Lautenbach * * $Id: TXFMMD5.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMMD5_INCLUDE #define TXFMMD5_INCLUDE // XSEC Includes #include #include /** * \brief Transformer to handle create a MD5-1 hash from a chain * @ingroup internal */ class DSIG_EXPORT TXFMMD5 : public TXFMBase { private: XSECCryptoHash * mp_h; // To hold the hash unsigned char md_value[CRYPTO_MAX_HASH_SIZE]; // Final output unsigned int md_len; // Length of digest unsigned int toOutput; // Amount still to output public: TXFMMD5(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECCryptoKey * key = NULL); ~TXFMMD5(); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to set input data virtual void setInput(TXFMBase * inputT); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMMD5(); }; #endif /* TXFMMD5 */ xml-security-c-1.7.3/xsec/transformers/TXFMDocObject.hpp000644 001751 001751 00000005526 12003301053 024323 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMDocObject := Class that takes an input Document object ID to start a txfm pipe * * Author(s): Berin Lautenbach * * $Id: TXFMDocObject.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMDOCOBJECT_INCLUDE #define TXFMDOCOBJECT_INCLUDE #include #include #include // Xerces #include /** * \brief Transformer that defines a document start to a transform chain * @ingroup internal */ class DSIG_EXPORT TXFMDocObject : public TXFMBase { public: TXFMDocObject(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMDocObject(); // Methods to set the inputs void setInput(TXFMBase *newInput); void setInput( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, const XMLCh * newFragmentId ); void setInput( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *newFragmentObject ); void setInput(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); // Environment - when searching for IDs we need to know about the user // environment (namely - how to handle ID attribute names) void setEnv(const XSECEnv * env); // Methods to get tranform output type and input requirement TXFMBase::ioType getInputType(void); TXFMBase::ioType getOutputType(void); TXFMBase::nodeType getNodeType(void); // Methods to get output data unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getFragmentNode(); virtual const XMLCh * getFragmentId(); private: XMLCh * fragmentId; // The identifier of the object XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * document; // The DOM document we are working with XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * fragmentObject; // The object that contains the doc fragment to use TXFMBase::nodeType type; // The type of nodes this holds const XSECEnv * mp_env; TXFMDocObject(); }; #endif xml-security-c-1.7.3/xsec/transformers/TXFMConcatChains.hpp000644 001751 001751 00000004670 12003301053 025023 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMConcatChain := Takes multiple input chains and then provides * BYTE_STREAM output for each chain in order. * * $Id: TXFMConcatChains.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include class TXFMChain; /** * \brief Transformer to handle concatination of transform chains * @ingroup internal */ class DSIG_EXPORT TXFMConcatChains : public TXFMBase { #if defined(XSEC_NO_NAMESPACES) typedef vector TXFMChainVectorType #else typedef std::vector TXFMChainVectorType; #endif #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif public: TXFMConcatChains(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMConcatChains(); // Methods to set the inputs. For the concat class, this will // append the input to the last appended chain void setInput(TXFMBase *newInput); void setInput(TXFMChain *newInputChain); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMConcatChains(); TXFMChainVectorType m_chains; TXFMBase * mp_currentTxfm; size_type m_currentChain; bool m_complete; }; xml-security-c-1.7.3/xsec/transformers/TXFMSB.hpp000644 001751 001751 00000004147 12003301053 022771 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMSB := Class that takes an input from a safeBuffer to start a pipe * * $Id: TXFMSB.hpp 1350038 2012-06-13 22:21:29Z scantor $ * */ #ifndef TXFMSB_INCLUDE #define TXFMSB_INCLUDE #include #include /** * \brief Base transformer to start a chain from a safeBuffer * @ingroup internal */ class DSIG_EXPORT TXFMSB : public TXFMBase { private: safeBuffer sb; // SafeBuffer to use xsecsize_t toOutput; // Amount left to output xsecsize_t sbs; // Size of raw buffer public: TXFMSB(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMSB(); // Methods to set the inputs virtual void setInput(TXFMBase *newInput); void setInput(const safeBuffer& sbIn); void setInput(const safeBuffer& sbIn, unsigned int sbSize); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMSB(); }; #endif xml-security-c-1.7.3/xsec/transformers/TXFMC14n.hpp000644 001751 001751 00000004272 12003301053 023171 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMBaseC14n := Class that performs C14n canonicalisation * * $Id: TXFMC14n.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include /** * \brief Transformer to handle canonicalisation transforms * @ingroup internal */ class DSIG_EXPORT TXFMC14n : public TXFMBase { private: XSECC14n20010315 * mp_c14n; // The actual canonicaliser public: TXFMC14n(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMC14n(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // Overrid comment acivation virtual void activateComments(void); // Set exclusive virtual void setExclusive(); virtual void setExclusive(safeBuffer & NSList); // Set inclusive 1.1 virtual void setInclusive11(); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMC14n(); }; xml-security-c-1.7.3/xsec/transformers/TXFMXSL.hpp000644 001751 001751 00000005617 12003301053 023136 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXSL := Class that performs XML Stylesheet Language transforms * * $Id: TXFMXSL.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include // Xerces #include // Xalan #ifndef XSEC_NO_XPATH #include #include #include #include #include #include // Xalan Namespace usage XALAN_USING_XALAN(XercesDOMSupport) XALAN_USING_XALAN(XercesParserLiaison) XALAN_USING_XALAN(XalanDocument) XALAN_USING_XALAN(XalanTransformer) #endif #ifndef XSEC_NO_XSLT /** * \brief Transformer to handle XSLT transforms * @ingroup internal */ class DSIG_EXPORT TXFMXSL : public TXFMBase { private: safeBuffer expr; // The expression being worked with XercesDOMSupport xds; XercesParserLiaison xpl; XalanDocument * xd; safeBuffer sbInDoc; XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * document; XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * docOut; // The output from the transformation public: TXFMXSL(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMXSL(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // We do our own name spaces - we have a new document! virtual bool nameSpacesExpanded(void); virtual void expandNameSpaces(void); // XSL Unique void evaluateStyleSheet(const safeBuffer &sbStyleSheet); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMXSL(); }; #endif /* No XSLT */ xml-security-c-1.7.3/xsec/transformers/TXFMXPath.hpp000644 001751 001751 00000006545 12003301053 023515 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXPath := Class that performs XPath transforms * * $Id: TXFMXPath.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef TXFMXPATH_INCLUDE #define TXFMXPATH_INCLUDE #include #include #include #include #include // Xerces XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMNamedNodeMap); // Xalan #ifndef XSEC_NO_XALAN #include #include #include #include #include #include #include #include #include #include #include #endif #ifndef XSEC_NO_XPATH /** * \brief Transformer to handle XPath transforms * @ingroup internal */ class DSIG_EXPORT TXFMXPath : public TXFMBase { private: safeBuffer expr; // The expression being worked with XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * document; XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap * XPathAtts; // Attributes that came through from the doc static bool XPathInitDone; DSIGXPathHere * here; // The function to implement here() XSECSafeBufferFormatter * formatter; public: TXFMXPath(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); ~TXFMXPath(); // Methods to set the inputs void setInput(TXFMBase *newInput); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual TXFMBase::nodeType getNodeType(void); // XPath unique void setNameSpace(XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap *xpAtts); void evaluateExpr(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *h, safeBuffer inexpr); void evaluateEnvelope(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *t); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); virtual XSECXPathNodeList & getXPathNodeList(); private: TXFMXPath(); }; #endif #endif xml-security-c-1.7.3/xsec/transformers/TXFMBase64.hpp000644 001751 001751 00000004333 12003301053 023506 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMBase64 := Class that performs a Base64 transforms * * $Id: TXFMBase64.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include /** * \brief Transformer to handle base64 transforms * @ingroup internal */ class DSIG_EXPORT TXFMBase64 : public TXFMBase { public: // Constructors and destructors TXFMBase64(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, bool decode = true); ~TXFMBase64(); // Methods to get tranform output type and input requirement virtual TXFMBase::ioType getInputType(void); virtual TXFMBase::ioType getOutputType(void); virtual nodeType getNodeType(void); // Methods to set input data virtual void setInput(TXFMBase * newInput); // Methods to get output data virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); virtual const XMLCh * getFragmentId(); private: TXFMBase64(); bool m_complete; // Is the work done unsigned char m_outputBuffer[2050]; // Always keep 2K of data unsigned char m_inputBuffer[1026]; // Always read 1026 bytes (encoding grows) unsigned int m_remaining; // How much data is left in the buffer? XSECCryptoBase64 * mp_b64; bool m_doDecode; // Are we encoding or decoding? }; xml-security-c-1.7.3/xsec/transformers/TXFMBase.cpp000644 001751 001751 00000004657 12003301053 023340 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMBase := Base (virtual) class that defines a DSIG Transformer * Given this is a pure virtual class, this file only implements friend functions * * Author(s): Berin Lautenbach * * $Id: TXFMBase.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include // ----------------------------------------------------------------------- // Ensure name spaces are reset when this is destroyed // ----------------------------------------------------------------------- TXFMBase::~TXFMBase() { if (mp_nse != NULL) { mp_nse->deleteAddedNamespaces(); delete mp_nse; mp_nse = NULL; } } // ----------------------------------------------------------------------- // For expanding name spaces when necessary // ----------------------------------------------------------------------- bool TXFMBase::nameSpacesExpanded(void) { if (mp_nse != NULL) return true; if (input != NULL) return input->nameSpacesExpanded(); return false; } void TXFMBase::expandNameSpaces(void) { if (mp_nse != NULL || (input != NULL && input->nameSpacesExpanded())) return; // Already done XSECnew(mp_nse, XSECNameSpaceExpander(mp_expansionDoc)); mp_nse->expandNameSpaces(); } void TXFMBase::deleteExpandedNameSpaces(void) { if (mp_nse != NULL) { mp_nse->deleteAddedNamespaces(); delete mp_nse; mp_nse = NULL; } if (input != NULL) input->deleteExpandedNameSpaces(); } void TXFMBase::activateComments(void) { if (input != NULL) { // Only activate them if our input had them keepComments = input->keepComments; } else keepComments = true; } xml-security-c-1.7.3/xsec/transformers/TXFMChain.cpp000644 001751 001751 00000004725 12003301053 023504 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMChain := List class that holds and manipulates a chain of TXFM * objects. * * Author(s): Berin Lautenbach * * $Id: TXFMChain.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include // ----------------------------------------------------------------------- // deleteTransformChain = easy way to delete an entire chain of transforms // ----------------------------------------------------------------------- void TXFMChain::deleteTXFMChain(TXFMBase * toDelete) { if (toDelete != NULL) { deleteTXFMChain(toDelete->input); delete toDelete; } } // -------------------------------------------------------------------------------- // Constructors/Destructors // -------------------------------------------------------------------------------- TXFMChain::TXFMChain(TXFMBase * baseTxfm, bool deleteChainWhenDone) : mp_currentTxfm(baseTxfm), m_deleteChainWhenDone(deleteChainWhenDone) { } TXFMChain::~TXFMChain() { if (m_deleteChainWhenDone) deleteTXFMChain(mp_currentTxfm); } // -------------------------------------------------------------------------------- // Read hash // -------------------------------------------------------------------------------- void TXFMChain::appendTxfm(TXFMBase * txfm) { TXFMBase * oldTxfm = mp_currentTxfm; mp_currentTxfm = txfm; // This may throw an exception, but if it does each TXFM type // Guarantees that it will have made the input part of the // chain before such an exception. So the caller can clear out // the entire chain - including the new txfm - by deleting // *this. txfm->setInput(oldTxfm); } xml-security-c-1.7.3/xsec/transformers/TXFMCipher.cpp000644 001751 001751 00000010226 12003301053 023665 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMCipher := Class that performs encryption and decryption transforms * * $Id: TXFMCipher.cpp 1352681 2012-06-21 20:58:40Z scantor $ * */ // XSEC #include #include #include #include XERCES_CPP_NAMESPACE_USE TXFMCipher::TXFMCipher(DOMDocument *doc, XSECCryptoKey * key, bool encrypt, XSECCryptoSymmetricKey::SymmetricKeyMode mode, unsigned int taglen) : TXFMBase(doc), m_doEncrypt(encrypt), m_taglen(taglen), mp_cipher(NULL), m_remaining(0) { if (key && key->getKeyType() == XSECCryptoKey::KEY_SYMMETRIC) mp_cipher = key->clone(); if (!mp_cipher) { throw XSECException(XSECException::CryptoProviderError, "Error cloning key, or not a symmetric key"); } m_complete = false; try { if (m_doEncrypt) ((XSECCryptoSymmetricKey *) (mp_cipher))->encryptInit((mode != XSECCryptoSymmetricKey::MODE_GCM), mode); else ((XSECCryptoSymmetricKey *) (mp_cipher))->decryptInit((mode != XSECCryptoSymmetricKey::MODE_GCM), mode); } catch (...) { delete mp_cipher; mp_cipher = NULL; throw; } }; TXFMCipher::~TXFMCipher() { delete mp_cipher; }; // Methods to set the inputs void TXFMCipher::setInput(TXFMBase *newInput) { input = newInput; // Set up for comments keepComments = input->getCommentsStatus(); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMCipher::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMCipher::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMCipher::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMCipher::readBytes(XMLByte * const toFill, unsigned int maxToFill) { unsigned int ret, fill, leftToFill; ret = 0; // How much have we copied? leftToFill = maxToFill; // Still have to copy in entire thing while (ret != maxToFill && (m_complete == false || m_remaining > 0)) { if (m_remaining != 0) { // Copy anything remaining in the buffer to the output fill = (leftToFill > m_remaining ? m_remaining : leftToFill); memcpy(&toFill[ret], m_outputBuffer, fill); if (fill < m_remaining) memmove(m_outputBuffer, m_outputBuffer + fill, (m_remaining - fill)); m_remaining -= fill; leftToFill -= fill; ret += fill; } // Now do some crypting if (m_complete == false && m_remaining == 0) { unsigned int sz = input->readBytes(m_inputBuffer, 2048); XSECCryptoSymmetricKey * symCipher = (XSECCryptoSymmetricKey*) mp_cipher; if (m_doEncrypt) { if (sz == 0) { m_complete = true; m_remaining = symCipher->encryptFinish(m_outputBuffer, 3072, m_taglen); } else m_remaining = symCipher->encrypt(m_inputBuffer, m_outputBuffer, sz, 3072); } else { if (sz == 0) { m_complete = true; m_remaining = symCipher->decryptFinish(m_outputBuffer, 3072); } else m_remaining = symCipher->decrypt(m_inputBuffer, m_outputBuffer, sz, 3072); } } } return ret; } DOMDocument *TXFMCipher::getDocument() { return NULL; } DOMNode * TXFMCipher::getFragmentNode() { return NULL; // Return a null node } const XMLCh * TXFMCipher::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMParser.cpp000644 001751 001751 00000007613 12157707211 023735 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMParser := A transformer used to transform a byte stream to DOM Nodes * * Author(s): Berin Lautenbach * * $Id: TXFMParser.cpp 1493962 2013-06-17 22:32:41Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE TXFMParser::TXFMParser(DOMDocument * doc) : TXFMBase(doc), mp_parsedDoc(NULL) { }; TXFMParser::~TXFMParser() { if (mp_parsedDoc != NULL) { if (mp_nse != NULL) { delete mp_nse; // Don't bother collapsing mp_nse = NULL; } mp_parsedDoc->release(); } mp_parsedDoc = NULL; }; // ----------------------------------------------------------------------- // For expanding name spaces when necessary // ----------------------------------------------------------------------- bool TXFMParser::nameSpacesExpanded(void) { // NOTE : Do not check inputs as this has its own document return (mp_nse != NULL); } void TXFMParser::expandNameSpaces(void) { if (mp_nse != NULL) return; // Already done if (mp_parsedDoc != NULL) { XSECnew(mp_nse, XSECNameSpaceExpander(mp_parsedDoc)); mp_nse->expandNameSpaces(); } } // ----------------------------------------------------------------------- // Worker function // ----------------------------------------------------------------------- void TXFMParser::setInput(TXFMBase *newInput) { // This transformer terminates all previous inputs and deletes // the chain. input = newInput; // Create a InputStream TXFMChain * chain; XSECnew(chain, TXFMChain(newInput, false)); Janitor j_chain(chain); XSECTXFMInputSource is(chain, false); // Create a XercesParser and parse! XercesDOMParser parser; parser.setDoNamespaces(true); parser.setLoadExternalDTD(false); SecurityManager securityManager; securityManager.setEntityExpansionLimit(XSEC_ENTITY_EXPANSION_LIMIT); parser.setSecurityManager(&securityManager); parser.parse(is); xsecsize_t errorCount = parser.getErrorCount(); if (errorCount > 0) throw XSECException(XSECException::XSLError, "Errors occured parsing BYTE STREAM"); mp_parsedDoc = parser.adoptDocument(); // Clean up keepComments = newInput->getCommentsStatus(); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMParser::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMParser::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMParser::getNodeType(void) { return TXFMBase::DOM_NODE_DOCUMENT; } // Methods to get output data unsigned int TXFMParser::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; } DOMDocument *TXFMParser::getDocument() { return mp_parsedDoc; } DOMNode * TXFMParser::getFragmentNode() { return NULL; // Return a null node } const XMLCh * TXFMParser::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMSB.cpp000644 001751 001751 00000005416 12003301053 022764 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMSB := Class that takes an input safeBuffer to start a transform pipe * * $Id: TXFMSB.cpp 1350038 2012-06-13 22:21:29Z scantor $ * */ #include XERCES_CPP_NAMESPACE_USE // General includes #include TXFMSB::TXFMSB(DOMDocument *doc) : TXFMBase(doc) { toOutput = 0; } TXFMSB::~TXFMSB() { } // Methods to set the inputs void TXFMSB::setInput(TXFMBase *newInput) { // We're the start of the actual data pipe, but we need to track // the pointer for chain disposal. input = newInput; return; } void TXFMSB::setInput(const safeBuffer& sbIn) { // Assume this is a string sb = sbIn; toOutput = sb.sbStrlen(); sbs = toOutput; } void TXFMSB::setInput(const safeBuffer& sbIn, unsigned int sbSize) { // Assume this is a string sb = sbIn; if (sbSize > sb.sbRawBufferSize()) toOutput = sb.sbRawBufferSize(); else toOutput = sbSize; sbs = toOutput; } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMSB::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMSB::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMSB::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMSB::readBytes(XMLByte * const toFill, unsigned int maxToFill) { // Return from the buffer unsigned int ret; if (toOutput == 0) return 0; // Check if we can just output everything left if (toOutput <= maxToFill) { memcpy((char *) toFill, &(sb.rawBuffer()[sbs - toOutput]), toOutput); ret = (unsigned int) toOutput; toOutput = 0; return ret; } // Output just some memcpy((char *) toFill, &(sb.rawBuffer()[sbs - toOutput]), maxToFill); ret = maxToFill; toOutput -= maxToFill; return ret; } DOMDocument *TXFMSB::getDocument() { return NULL; }; DOMNode * TXFMSB::getFragmentNode() { return NULL; }; const XMLCh * TXFMSB::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMEnvelope.cpp000644 001751 001751 00000012020 12003301053 024222 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMEnvelope := Class that calculates an Envelope with an XPath evaluator * * $Id: TXFMEnvelope.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include XERCES_CPP_NAMESPACE_USE TXFMEnvelope::TXFMEnvelope(DOMDocument *doc) : TXFMBase(doc) { } TXFMEnvelope::~TXFMEnvelope() { } // Methods to set the inputs void TXFMEnvelope::setInput(TXFMBase *newInput) { input = newInput; if (newInput->getOutputType() != TXFMBase::DOM_NODES) { throw XSECException(XSECException::TransformInputOutputFail, "XPath requires DOM_NODES input type"); } // Expand if necessary //this->expandNameSpaces(); keepComments = input->getCommentsStatus(); // Set up for the new document mp_document = input->getDocument(); // Now work out what we have to set up in the new processing TXFMBase::nodeType inputType = input->getNodeType(); switch (inputType) { case DOM_NODE_DOCUMENT : mp_startNode = mp_document; break; case DOM_NODE_DOCUMENT_FRAGMENT : mp_startNode = input->getFragmentNode(); break; default : throw XSECException(XSECException::EnvelopeError); // Should never get here } // Ready to evaluate } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMEnvelope::getInputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::ioType TXFMEnvelope::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMEnvelope::getNodeType(void) { return TXFMBase::DOM_NODE_XPATH_NODESET; } // Envelope (and XPath) unique void addEnvelopeNode(DOMNode *startNode, XSECXPathNodeList & XPathMap, DOMNode * sigNode) { XSEC_USING_XERCES(DOMNamedNodeMap); DOMNode *tmp; DOMNamedNodeMap *atts; XMLSize_t attsSize, i; if (startNode == sigNode) return; XPathMap.addNode(startNode); if (startNode->getNodeType() == DOMNode::ELEMENT_NODE) { atts = startNode->getAttributes(); if (atts != NULL) attsSize = atts->getLength(); else attsSize = 0; for (i = 0; i < attsSize; ++i) { tmp = atts->item(i); XPathMap.addNode(tmp); } } // Now do any childeren tmp = startNode->getFirstChild(); while (tmp != NULL) { addEnvelopeNode(tmp, XPathMap, sigNode); tmp = tmp->getNextSibling(); } } void addEnvelopeParentNSNodes(DOMNode *startNode, XSECXPathNodeList & XPathMap) { XSEC_USING_XERCES(DOMNamedNodeMap); DOMNode *tmp; DOMNamedNodeMap *atts; XMLSize_t attsSize, i; if (startNode == NULL) return; if (startNode->getNodeType() == DOMNode::ELEMENT_NODE) { atts = startNode->getAttributes(); if (atts != NULL) attsSize = atts->getLength(); else attsSize = 0; for (i = 0; i < attsSize; ++i) { tmp = atts->item(i); if (XMLString::compareNString(tmp->getNodeName(), DSIGConstants::s_unicodeStrXmlns, 5) == 0 && (tmp->getNodeName()[5] == chNull || tmp->getNodeName()[5] == chColon)) XPathMap.addNode(tmp); } } // Now do parent addEnvelopeParentNSNodes(startNode->getParentNode(), XPathMap); } void TXFMEnvelope::evaluateEnvelope(DOMNode *t) { DOMNode *sigNode; // Find the signature node sigNode = t->getParentNode(); while (sigNode != NULL && !strEquals(getDSIGLocalName(sigNode), "Signature")) sigNode = sigNode->getParentNode(); if (sigNode == NULL) { throw XSECException(XSECException::EnvelopeError, "Unable to find signature owner of node passed to Envelope Transform"); } // Check if sigNode is an ancestor of mp_startNode - if so, just return DOMNode * c = mp_startNode; while (c != NULL) { if (c == sigNode) return; c = c->getParentNode(); } addEnvelopeNode(mp_startNode, m_XPathMap, sigNode); addEnvelopeParentNSNodes(mp_startNode->getParentNode(), m_XPathMap); } // Methods to get output data unsigned int TXFMEnvelope::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; } DOMDocument *TXFMEnvelope::getDocument() { return mp_document; } DOMNode *TXFMEnvelope::getFragmentNode() { return NULL; } const XMLCh * TXFMEnvelope::getFragmentId() { return NULL; // Empty string } XSECXPathNodeList & TXFMEnvelope::getXPathNodeList() { return m_XPathMap; } xml-security-c-1.7.3/xsec/transformers/TXFMBase64.cpp000644 001751 001751 00000010453 12003301053 023501 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMBase64 := Class that performs a Base64 transform * * Author(s): Berin Lautenbach * * $Id: TXFMBase64.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include XERCES_CPP_NAMESPACE_USE TXFMBase64::TXFMBase64(DOMDocument *doc, bool decode) : TXFMBase(doc) { m_complete = false; // Nothing yet to output m_remaining = 0; m_doDecode = decode; mp_b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!mp_b64) { throw XSECException(XSECException::CryptoProviderError, "Error requesting Base64 object from Crypto Provider"); } if (decode) mp_b64->decodeInit(); else mp_b64->encodeInit(); }; TXFMBase64::~TXFMBase64() { if (mp_b64 != NULL) delete mp_b64; }; // Methods to set the inputs void TXFMBase64::setInput(TXFMBase *newInput) { input = newInput; // Set up for comments keepComments = input->getCommentsStatus(); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMBase64::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMBase64::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMBase64::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMBase64::readBytes(XMLByte * const toFill, unsigned int maxToFill) { unsigned int ret, fill, leftToFill; ret = 0; // How much have we copied? leftToFill = maxToFill; // Still have to copy in entire thing while (ret != maxToFill && (m_complete == false || m_remaining > 0)) { if (m_remaining != 0) { // Copy anything remaining in the buffer to the output fill = (leftToFill > m_remaining ? m_remaining : leftToFill); memcpy(&toFill[ret], m_outputBuffer, fill); if (fill < m_remaining) memmove(m_outputBuffer, m_outputBuffer + fill, (m_remaining - fill)); m_remaining -= fill; leftToFill -= fill; ret += fill; } // Now do some crypting if (m_complete == false && m_remaining == 0) { unsigned int sz = input->readBytes(m_inputBuffer, 1024); if (m_doDecode) { if (sz == 0) { m_complete = true; m_remaining = mp_b64->decodeFinish(m_outputBuffer, 2048); } else m_remaining = mp_b64->decode(m_inputBuffer, sz, m_outputBuffer, 2048); } else { if (sz == 0) { m_complete = true; m_remaining = mp_b64->encodeFinish(m_outputBuffer, 3072); } else m_remaining = mp_b64->encode(m_inputBuffer, sz, m_outputBuffer, 2048); } } } return ret; #if 0 unsigned int ret, fill; if (m_complete) return 0; fill = (maxToFill > 2000 ? 2000 : maxToFill); ret = 0; while (ret == 0 && !m_complete) { unsigned int sz = input->readBytes(m_base64Buffer, fill / 2); if (m_doDecode) { if (sz == 0) ret = mp_b64->decodeFinish((unsigned char *) toFill, maxToFill); else ret = mp_b64->decode(m_base64Buffer, sz, (unsigned char *) toFill, maxToFill); if (ret == 0) m_complete = true; } else { if (sz == 0) { ret = mp_b64->encodeFinish((unsigned char *) toFill, maxToFill); m_complete = true; } else ret = mp_b64->encode(m_base64Buffer, sz, (unsigned char *) toFill, maxToFill); } } return ret; #endif } DOMDocument *TXFMBase64::getDocument() { return NULL; } DOMNode * TXFMBase64::getFragmentNode() { return NULL; // Return a null node } const XMLCh * TXFMBase64::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMXPathFilter.cpp000644 001751 001751 00000037127 12003301053 024656 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXPathFilter := Class that performs XPath transforms * * $Id: TXFMXPathFilter.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #ifndef XSEC_NO_XALAN #if defined(_MSC_VER) # pragma warning(disable: 4267) #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(_MSC_VER) # pragma warning(default: 4267) #endif // Xalan namespace usage XALAN_USING_XALAN(XPathProcessorImpl) XALAN_USING_XALAN(XalanDOMString) XALAN_USING_XALAN(XercesDOMSupport) XALAN_USING_XALAN(XercesParserLiaison) XALAN_USING_XALAN(XercesDocumentWrapper) XALAN_USING_XALAN(XercesWrapperNavigator) XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XPathFactoryDefault) XALAN_USING_XALAN(XPathConstructionContextDefault) XALAN_USING_XALAN(XalanDocument) XALAN_USING_XALAN(XalanNode) XALAN_USING_XALAN(XalanDOMChar) XALAN_USING_XALAN(XPathEnvSupportDefault) XALAN_USING_XALAN(XObjectFactoryDefault) XALAN_USING_XALAN(XObjectPtr) XALAN_USING_XALAN(XPathExecutionContextDefault) XALAN_USING_XALAN(ElementPrefixResolverProxy) XALAN_USING_XALAN(XPath) XALAN_USING_XALAN(NodeRefListBase) XALAN_USING_XALAN(XSLTResultTarget) XALAN_USING_XALAN(XSLException) #endif #if !defined(XSEC_NO_XPATH) #include #define KLUDGE_PREFIX "berindsig" // Helper functions - come from DSIGXPath void setXPathNS(DOMDocument *d, DOMNamedNodeMap *xAtts, XSECXPathNodeList &addedNodes, XSECSafeBufferFormatter *formatter, XSECNameSpaceExpander * nse); void clearXPathNS(DOMDocument *d, XSECXPathNodeList &toRemove, XSECSafeBufferFormatter *formatter, XSECNameSpaceExpander * nse); bool separator(unsigned char c); XalanNode * findHereNodeFromXalan(XercesWrapperNavigator * xwn, XalanNode * n, DOMNode *h); TXFMXPathFilter::TXFMXPathFilter(DOMDocument *doc) : TXFMBase(doc) { document = NULL; XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); } TXFMXPathFilter::~TXFMXPathFilter() { lstsVectorType::iterator i; for (i = m_lsts.begin(); i != m_lsts.end(); ++i) { if ((*i)->lst != NULL) delete ((*i)->lst); delete (*i); } if (mp_formatter != NULL) delete mp_formatter; } // Methods to set the inputs void TXFMXPathFilter::setInput(TXFMBase *newInput) { if (newInput->getOutputType() == TXFMBase::BYTE_STREAM) { // Need to parse into DOM_NODES TXFMParser * parser; XSECnew(parser, TXFMParser(mp_expansionDoc)); try{ parser->setInput(newInput); } catch (...) { delete parser; input = newInput; throw; } input = parser; parser->expandNameSpaces(); } else input = newInput; // Set up for the new document document = input->getDocument(); // Expand if necessary this->expandNameSpaces(); keepComments = input->getCommentsStatus(); } XSECXPathNodeList * TXFMXPathFilter::evaluateSingleExpr(DSIGXPathFilterExpr *expr) { // Have a single expression that we wish to find the resultant nodeset // for XSECXPathNodeList addedNodes; setXPathNS(document, expr->mp_NSMap, addedNodes, mp_formatter, mp_nse); XPathProcessorImpl xppi; // The processor XercesParserLiaison xpl; #if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10 XercesDOMSupport xds(xpl); #else XercesDOMSupport xds; #endif XPathEvaluator xpe; XPathFactoryDefault xpf; XPathConstructionContextDefault xpcc; XalanDocument * xd; XalanNode * contextNode; // Xalan can throw exceptions in all functions, so do one broad catch point. try { // Map to Xalan xd = xpl.createDocument(document); // For performing mapping XercesDocumentWrapper *xdw = xpl.mapDocumentToWrapper(xd); XercesWrapperNavigator xwn(xdw); // Map the "here" node XalanNode * hereNode = NULL; hereNode = xwn.mapNode(expr->mp_xpathFilterNode); if (hereNode == NULL) { hereNode = findHereNodeFromXalan(&xwn, xd, expr->mp_exprTextNode); if (hereNode == NULL) { throw XSECException(XSECException::XPathFilterError, "Unable to find here node in Xalan Wrapper map"); } } // Now work out what we have to set up in the new processing XalanDOMString cd; // For XPath Filter, the root is always the context node cd = XalanDOMString("/"); // Root node // The context node is the "root" node contextNode = xpe.selectSingleNode( xds, xd, cd.c_str(), xd->getDocumentElement()); XPathEnvSupportDefault xpesd; XObjectFactoryDefault xof; XPathExecutionContextDefault xpec(xpesd, xds, xof); ElementPrefixResolverProxy pr(xd->getDocumentElement(), xpesd, xds); // Work around the fact that the XPath implementation is designed for XSLT, so does // not allow here() as a NCName. // THIS IS A KLUDGE AND SHOULD BE DONE BETTER int offset = 0; safeBuffer k(KLUDGE_PREFIX); k.sbStrcatIn(":"); // Map the expression into a local code page string (silly - should be XMLCh) safeBuffer exprSB; exprSB << (*mp_formatter << expr->m_expr.rawXMLChBuffer()); offset = exprSB.sbStrstr("here()"); while (offset >= 0) { if (offset == 0 || offset == 1 || (!(exprSB[offset - 1] == ':' && exprSB[offset - 2] != ':') && separator(exprSB[offset - 1]))) { exprSB.sbStrinsIn(k.rawCharBuffer(), offset); } offset = exprSB.sbOffsetStrstr("here()", offset + 11); } // Install the External function in the Environment handler if (hereNode != NULL) { xpesd.installExternalFunctionLocal(XalanDOMString(URI_ID_DSIG), XalanDOMString("here"), DSIGXPathHere(hereNode)); } XPath * xp = xpf.create(); XalanDOMString Xexpr((char *) exprSB.rawBuffer()); xppi.initXPath(*xp, xpcc, Xexpr, pr); // Now resolve XObjectPtr xObj = xp->execute(contextNode, pr, xpec); // Now map to a list that others can use (naieve list at this time) const NodeRefListBase& lst = xObj->nodeset(); int size = (int) lst.getLength(); const DOMNode *item; XSECXPathNodeList * ret; XSECnew(ret, XSECXPathNodeList); Janitor j_ret(ret); for (int i = 0; i < size; ++ i) { if (lst.item(i) == xd) ret->addNode(document); else { item = xwn.mapNode(lst.item(i)); ret->addNode(item); } } xpesd.uninstallExternalFunctionGlobal(XalanDOMString(URI_ID_DSIG), XalanDOMString("here")); clearXPathNS(document, addedNodes, mp_formatter, mp_nse); j_ret.release(); return ret; } catch (XSLException &e) { safeBuffer msg; // Whatever happens - fix any changes to the original document clearXPathNS(document, addedNodes, mp_formatter, mp_nse); // Collate the exception message into an XSEC message. msg.sbTranscodeIn("Xalan Exception : "); #if defined (XSEC_XSLEXCEPTION_RETURNS_DOMSTRING) msg.sbXMLChCat(e.getType().c_str()); #else msg.sbXMLChCat(e.getType()); #endif msg.sbXMLChCat(" caught. Message : "); msg.sbXMLChCat(e.getMessage().c_str()); throw XSECException(XSECException::XPathFilterError, msg.rawXMLChBuffer()); } catch (...) { clearXPathNS(document, addedNodes, mp_formatter, mp_nse); throw; } return NULL; } bool TXFMXPathFilter::checkNodeInInput(DOMNode * n, DOMNode * attParent) { if (mp_fragment != NULL) { DOMNode * p = n; /* Check attParent here to reduce cycles */ if (attParent != NULL) { if (p == mp_fragment) return true; p = attParent; } while (p != NULL) { if (p == mp_fragment) return true; p = p->getParentNode(); } return false; } return mp_inputList->hasNode(n); } bool TXFMXPathFilter::checkNodeInScope(DOMNode * n) { // Walk backwards through the lists lstsVectorType::iterator lstsIter; lstsIter = m_lsts.end(); filterSetHolder *sh; while (lstsIter != m_lsts.begin()) { lstsIter--; sh = *lstsIter; if (sh->ancestorInScope != NULL) { // Have an ancestor in scope, so this node is in this list if (sh->type == FILTER_UNION) // Got this far, must be OK! return true; if (sh->type == FILTER_SUBTRACT) return false; } else { if (sh->type == FILTER_INTERSECT) return false; } } return true; } #if 1 void TXFMXPathFilter::walkDocument(DOMNode * n) { // Non-recursive version DOMNode * current = n; DOMNode * next; DOMNode * attParent = NULL; /* Assign NULL to remove spurious Forte warning */ bool done = false; bool treeUp = false; DOMNamedNodeMap * atts = n->getAttributes(); int attsSize = -1; int currentAtt = -1; lstsVectorType::iterator lstsIter; while (done == false && current != NULL) { if (treeUp == true) { if (current == n) { // We are complete. done = true; } else { // Remove this node from the ancestor lists for (lstsIter = m_lsts.begin(); lstsIter != m_lsts.end(); ++lstsIter) { if ((*lstsIter)->ancestorInScope == current) { (*lstsIter)->ancestorInScope = NULL; } } // Check for another sibling next = current->getNextSibling(); if (next == NULL) { current = current->getParentNode(); treeUp = true; } else { current = next; treeUp = false; } } } /* treeUp == true */ else { // Check if the current node is in the result set. The walk the children // First check if this node is in any lists, and if so, // set the appropriate ancestor nodes (if necessary) for (lstsIter = m_lsts.begin(); lstsIter != m_lsts.end(); ++lstsIter) { if ((*lstsIter)->ancestorInScope == NULL && (*lstsIter)->lst->hasNode(current)) { (*lstsIter)->ancestorInScope = current; } // } // Now that the ancestor setup is done, check to see if this node is // in scope. if (checkNodeInScope(current) && checkNodeInInput(current, (atts != NULL ? attParent : NULL))) { m_xpathFilterMap.addNode(current); } // Now find the next node! if (atts != NULL) { // Working on an attribute list currentAtt++; if (currentAtt == attsSize) { // Attribute list complete atts = NULL; current = attParent; next = current->getFirstChild(); if (next == NULL) treeUp = true; else { current = next; treeUp = false; } } else { current = atts->item(currentAtt); } } else { // Working on an element or other non-attribute node atts = current->getAttributes(); if (atts != NULL && ((attsSize = atts->getLength()) > 0)) { currentAtt = 0; attParent = current; current = atts->item(0); treeUp = false; } else { atts = NULL; next = current->getFirstChild(); if (next != NULL) { current = next; treeUp = false; } else { treeUp = true; } } } /* ! atts == NULL */ } } /* while */ } #endif #if 0 void TXFMXPathFilter::walkDocument(DOMNode * n) { // Check if the current node is in the result set. The walk the children lstsVectorType::iterator lstsIter; // First check if this node is in any lists, and if so, // set the appropriate ancestor nodes (if necessary) for (lstsIter = m_lsts.begin(); lstsIter != m_lsts.end(); ++lstsIter) { if ((*lstsIter)->ancestorInScope == NULL && (*lstsIter)->lst->hasNode(n)) { (*lstsIter)->ancestorInScope = n; } } // Now that the ancestor setup is done, check to see if this node is // in scope. if (checkNodeInScope(n) && checkNodeInInput(n)) { m_xpathFilterMap.addNode(n); } // Do any attributes DOMNamedNodeMap * atts = n->getAttributes(); if (atts != NULL) { unsigned int s = atts->getLength(); for (unsigned int i = 0; i < s; ++i) { walkDocument(atts->item(i)); } } // Do any childeren DOMNode * c = n->getFirstChild(); while (c != NULL) { walkDocument(c); c = c->getNextSibling(); } // Now remove from ancestor lists if we are that ancestor for (lstsIter = m_lsts.begin(); lstsIter != m_lsts.end(); ++lstsIter) { if ((*lstsIter)->ancestorInScope == n) { (*lstsIter)->ancestorInScope = NULL; } } } #endif void TXFMXPathFilter::evaluateExprs(DSIGTransformXPathFilter::exprVectorType * exprs) { if (exprs == NULL || exprs->size() < 1) { throw XSECException(XSECException::XPathFilterError, "TXFMXPathFilter::evaluateExpr - no expression list set"); } DSIGTransformXPathFilter::exprVectorType::iterator i; for (i = exprs->begin(); i != exprs->end(); ++i) { XSECXPathNodeList * lst = evaluateSingleExpr(*i); filterSetHolder * sh; XSECnew(sh, filterSetHolder); sh->lst = lst; sh->type = (*i)->m_filterType; sh->ancestorInScope = NULL; if (lst != NULL) { m_lsts.push_back(sh); } } // Well we appear to have successfully run through all the nodelists! mp_fragment = NULL; mp_inputList = NULL; // Find the input nodeset TXFMBase::nodeType inputType = input->getNodeType(); switch (inputType) { case DOM_NODE_DOCUMENT : mp_fragment = document; break; case DOM_NODE_DOCUMENT_FRAGMENT : mp_fragment = input->getFragmentNode(); break; case DOM_NODE_XPATH_NODESET : mp_inputList = &(input->getXPathNodeList()); break; default : throw XSECException(XSECException::XPathFilterError, "TXFMXPathFilter::evaluateExprs - unknown input type"); } // Now just recurse through each node in the document walkDocument(document); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMXPathFilter::getInputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::ioType TXFMXPathFilter::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMXPathFilter::getNodeType(void) { return TXFMBase::DOM_NODE_XPATH_NODESET; } // Methods to get output data unsigned int TXFMXPathFilter::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; } DOMDocument *TXFMXPathFilter::getDocument() { return document; } DOMNode *TXFMXPathFilter::getFragmentNode() { return NULL; } const XMLCh * TXFMXPathFilter::getFragmentId() { return NULL; // Empty string } XSECXPathNodeList & TXFMXPathFilter::getXPathNodeList() { return m_xpathFilterMap; } #endif /* NO_XPATH */ xml-security-c-1.7.3/xsec/transformers/TXFMSHA1.cpp000644 001751 001751 00000007234 12003301053 023154 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMSHA1 := Class that performs a SHA1 transform * * $Id: TXFMSHA1.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include XERCES_CPP_NAMESPACE_USE TXFMSHA1::TXFMSHA1(DOMDocument *doc, hashMethod hm, XSECCryptoKey * key) : TXFMBase (doc) { toOutput = 0; // Nothing yet to output int hashLen = 0; switch (hm) { case HASH_SHA224 : hashLen = 224; break; case HASH_SHA256 : hashLen = 256; break; case HASH_SHA384 : hashLen = 384; break; case HASH_SHA512 : hashLen = 512; break; default: hashLen = 160; } if (key == NULL) // Get a SHA1 worker mp_h = XSECPlatformUtils::g_cryptoProvider->hashSHA(hashLen); else { // Get an HMAC Sha1 mp_h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA(hashLen); if (!mp_h) { throw XSECException(XSECException::CryptoProviderError, "Error requesting SHA1 object from Crypto Provider"); } mp_h->setKey(key); } if (!mp_h) { throw XSECException(XSECException::CryptoProviderError, "Error requesting SHA1 object from Crypto Provider"); } }; TXFMSHA1::~TXFMSHA1() { // Clean up if (mp_h) delete mp_h; }; // Methods to set the inputs //void TXFMSHA1::setInput(TXFMBase *input); // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMSHA1::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMSHA1::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMSHA1::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to set input data void TXFMSHA1::setInput(TXFMBase * inputT) { input = inputT; keepComments = input->getCommentsStatus(); // Now run through the data unsigned char buffer[1024]; unsigned int size; while ((size = input->readBytes((XMLByte *) buffer, 1024)) != 0) { #if 0 // Some useful debbugging code FILE * f = fopen("debug.out","a+b"); fwrite(buffer, size, 1, f); fclose(f); #endif mp_h->hash(buffer, size); } // Finalise md_len = mp_h->finish(md_value, CRYPTO_MAX_HASH_SIZE); toOutput = md_len; } unsigned int TXFMSHA1::readBytes(XMLByte * const toFill, unsigned int maxToFill) { unsigned int ret; if (toOutput == 0) return 0; // Check if we can just output everything left if (toOutput <= maxToFill) { memcpy((char *) toFill, &md_value[md_len - toOutput], toOutput); ret = toOutput; toOutput = 0; return ret; } // Output just some memcpy((char *) toFill, &md_value[md_len - toOutput], maxToFill); ret = maxToFill; toOutput -= maxToFill; return ret; } DOMDocument * TXFMSHA1::getDocument() { return NULL; } DOMNode * TXFMSHA1::getFragmentNode() { return NULL; // Return a null node }; const XMLCh * TXFMSHA1::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMC14n.cpp000644 001751 001751 00000007773 12003301053 023175 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMC14n := Class that performs C14n canonicalisation * * Author(s): Berin Lautenbach * * $Id: TXFMC14n.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include XERCES_CPP_NAMESPACE_USE TXFMC14n::TXFMC14n(DOMDocument *doc) : TXFMBase(doc) { mp_c14n = NULL; } TXFMC14n::~TXFMC14n() { if (mp_c14n != NULL) { delete mp_c14n; } } // Methods to set the inputs void TXFMC14n::setInput(TXFMBase *newInput) { if (newInput->getOutputType() == TXFMBase::BYTE_STREAM) { //throw XSECException(XSECException::TransformInputOutputFail, "C14n canonicalisation transform requires DOM_NODES input"); // Need to parse into DOM_NODES TXFMParser * parser; XSECnew(parser, TXFMParser(mp_expansionDoc)); try{ parser->setInput(newInput); } catch (...) { delete parser; input = newInput; // Ensure chain will be deleted. throw; } input = parser; } else input = newInput; // Set up for comments - by default we ALWAYS strip comments keepComments = false; TXFMBase::nodeType type = input->getNodeType(); switch (type) { case TXFMBase::DOM_NODE_DOCUMENT : XSECnew(mp_c14n, XSECC14n20010315(input->getDocument())); // Expand name spaces //input->expandNameSpaces(); break; case TXFMBase::DOM_NODE_DOCUMENT_NODE : case TXFMBase::DOM_NODE_DOCUMENT_FRAGMENT : XSECnew(mp_c14n, XSECC14n20010315(input->getDocument(), input->getFragmentNode())); //input->expandNameSpaces(); break; case TXFMBase::DOM_NODE_XPATH_NODESET : XSECnew(mp_c14n, XSECC14n20010315(input->getDocument())); mp_c14n->setXPathMap(input->getXPathNodeList()); break; default : throw XSECException(XSECException::XPathError); } mp_c14n->setCommentsProcessing(keepComments); // By default we strip comments // Do we use the namespace map? mp_c14n->setUseNamespaceStack(!input->nameSpacesExpanded()); } void TXFMC14n::activateComments(void) { if (input != NULL) keepComments = input->getCommentsStatus(); else keepComments = true; if (mp_c14n != NULL) mp_c14n->setCommentsProcessing(keepComments); } void TXFMC14n::setExclusive() { if (mp_c14n != NULL) mp_c14n->setExclusive(); } void TXFMC14n::setExclusive(safeBuffer & NSList) { if (mp_c14n != NULL) mp_c14n->setExclusive((char *) NSList.rawBuffer()); } void TXFMC14n::setInclusive11() { if (mp_c14n != NULL) mp_c14n->setInclusive11(); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMC14n::getInputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::ioType TXFMC14n::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMC14n::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMC14n::readBytes(XMLByte * const toFill, unsigned int maxToFill) { if (mp_c14n == NULL) return 0; return (unsigned int) mp_c14n->outputBuffer(toFill, maxToFill); } DOMDocument * TXFMC14n::getDocument() { return NULL; } DOMNode * TXFMC14n::getFragmentNode() { return NULL; } const XMLCh * TXFMC14n::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMURL.cpp000644 001751 001751 00000005735 12003301053 023126 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMURL := Class that takes an input URL to start of a transform pipe * * $Id: TXFMURL.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include // To catch exceptions #include XERCES_CPP_NAMESPACE_USE // General includes #include TXFMURL::TXFMURL(DOMDocument *doc, XSECURIResolver * resolver) : TXFMBase(doc) { is = NULL; // To ensure later able to delete if not used properly mp_resolver = resolver; done = false; } TXFMURL::~TXFMURL() { if (is != NULL) delete is; } // Methods to set the inputs void TXFMURL::setInput(TXFMBase *newInput) { // Not possible as this needs to be the start of a tranform pipe return; } void TXFMURL::setInput(const XMLCh * URL) { // Assume we have already checked that this is a valid URL if (mp_resolver != NULL) is = mp_resolver->resolveURI(URL); if (is == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "An error occurred in TXFMURL when resolving URL"); } } void TXFMURL::setInput(BinInputStream * inputStream) { if (is != NULL) delete is; is = inputStream; } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMURL::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMURL::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMURL::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMURL::readBytes(XMLByte * const toFill, unsigned int maxToFill) { XSEC_USING_XERCES(NetAccessorException); // Simply read in from the input stream unsigned int ret; if (done || is == NULL) return 0; try { ret = (unsigned int) is->readBytes(toFill, maxToFill); } catch (NetAccessorException e) { // Naieve - but assume this means the socket has closed (end of stream) ret = 0; } //if (ret < maxToFill) if (ret <= 0) done = true; return ret; } DOMDocument *TXFMURL::getDocument() { return NULL; }; DOMNode *TXFMURL::getFragmentNode() { return NULL; }; const XMLCh * TXFMURL::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMOutputFile.cpp000644 001751 001751 00000005161 12003301053 024555 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMOutputFile := Transform that outputs the byte stream to a file without changing * the actual data in any way * * $Id: TXFMOutputFile.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include XERCES_CPP_NAMESPACE_USE // Destructor TXFMOutputFile::~TXFMOutputFile() { if (f.is_open()) f.write("\n----- END -----\n", 17); f.close(); } // Methods to set the inputs void TXFMOutputFile::setInput(TXFMBase *newInput) { input = newInput; if (newInput->getOutputType() != TXFMBase::BYTE_STREAM) { throw XSECException(XSECException::TransformInputOutputFail, "OutputFile transform requires BYTE_STREAM input"); } keepComments = input->getCommentsStatus(); } bool TXFMOutputFile::setFile(char * const fileName) { // Open a file for outputting using std::ios; f.open(fileName, ios::binary|ios::out|ios::app); if (f.is_open()) { f.write("\n----- BEGIN -----\n", 19); return true; } return false; } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMOutputFile::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMOutputFile::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMOutputFile::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMOutputFile::readBytes(XMLByte * const toFill, unsigned int maxToFill) { unsigned int sz; sz = input->readBytes(toFill, maxToFill); if (f.is_open()) f.write((char *) toFill, sz); return sz; } DOMDocument * TXFMOutputFile::getDocument() { return NULL; } DOMNode * TXFMOutputFile::getFragmentNode() { return NULL; }; const XMLCh * TXFMOutputFile::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/transformers/TXFMXPath.cpp000644 001751 001751 00000032773 12003301053 023512 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXPath := Class that performs XPath transforms * * $Id: TXFMXPath.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #ifndef XSEC_NO_XALAN #if defined(_MSC_VER) # pragma warning(disable: 4267) #endif #include #include #if defined(_MSC_VER) # pragma warning(default: 4267) #endif // Xalan namespace usage XALAN_USING_XALAN(XPathProcessorImpl) XALAN_USING_XALAN(XercesDOMSupport) XALAN_USING_XALAN(XercesParserLiaison) XALAN_USING_XALAN(XercesDocumentWrapper) XALAN_USING_XALAN(XercesWrapperNavigator) XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XPathFactoryDefault) XALAN_USING_XALAN(XPathConstructionContextDefault) XALAN_USING_XALAN(XalanDocument) XALAN_USING_XALAN(XalanNode) XALAN_USING_XALAN(XalanDOMChar) XALAN_USING_XALAN(XPathEnvSupportDefault) XALAN_USING_XALAN(XObjectFactoryDefault) XALAN_USING_XALAN(XPathExecutionContextDefault) XALAN_USING_XALAN(ElementPrefixResolverProxy) XALAN_USING_XALAN(XPath) XALAN_USING_XALAN(NodeRefListBase) XALAN_USING_XALAN(XSLTResultTarget) XALAN_USING_XALAN(XSLException) #endif XERCES_CPP_NAMESPACE_USE #if !defined(XSEC_NO_XPATH) #include #define KLUDGE_PREFIX "berindsig" // Helper function void setXPathNS(DOMDocument *d, DOMNamedNodeMap *xAtts, XSECXPathNodeList &addedNodes, XSECSafeBufferFormatter *formatter, XSECNameSpaceExpander * nse) { // if set then set the name spaces in the attribute list else clear them DOMElement * e = d->getDocumentElement(); if (e == NULL) { throw XSECException(XSECException::XPathError, "Element node not found in Document"); } if (xAtts != 0) { int xAttsCount = xAtts->getLength(); // Check all is OK with the Xalan Document and first element if (d == NULL) { throw XSECException(XSECException::XPathError, "Attempt to define XPath Name Space before setInput called"); } // Run through each attribute looking for name spaces const XMLCh *xpName; safeBuffer xpNameSB; const XMLCh *xpLocalName; const XMLCh *xpValue; for (int xCounter = 0; xCounter < xAttsCount; ++xCounter) { if (nse == NULL || !nse->nodeWasAdded(xAtts->item(xCounter))) { xpName = xAtts->item(xCounter)->getNodeName(); xpNameSB << (*formatter << xpName); if (xpNameSB.sbStrncmp("xmlns", 5) == 0) { // Check whether a node of this name already exists xpLocalName = xAtts->item(xCounter)->getLocalName(); xpValue = xAtts->item(xCounter)->getNodeValue(); if (e->hasAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, xpLocalName) == false) { // Nope e->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, xpName, xpValue); addedNodes.addNode(e->getAttributeNodeNS(DSIGConstants::s_unicodeStrURIXMLNS, xpLocalName)); } } } } } // Insert the kludge namespace safeBuffer k("xmlns:"); k.sbStrcatIn(KLUDGE_PREFIX); e->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING(k.rawCharBuffer()), DSIGConstants::s_unicodeStrURIDSIG); } void clearXPathNS(DOMDocument *d, XSECXPathNodeList &toRemove, XSECSafeBufferFormatter *formatter, XSECNameSpaceExpander * nse) { // Clear the XPath name spaces in the document element attribute list DOMElement * e = d->getDocumentElement(); if (e == NULL) { throw XSECException(XSECException::XPathError, "Element node not found in Document"); } // Run through each node in the added nodes const DOMNode * r = toRemove.getFirstNode(); while (r != NULL) { e->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, r->getLocalName()); r = toRemove.getNextNode(); } e->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING(KLUDGE_PREFIX)); } TXFMXPath::TXFMXPath(DOMDocument *doc) : TXFMBase(doc) { document = NULL; XPathAtts = NULL; // Formatter is used for handling attribute name space inputs XSECnew(formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); } TXFMXPath::~TXFMXPath() { if (formatter != NULL) delete formatter; } void TXFMXPath::setNameSpace(DOMNamedNodeMap *xpAtts) { // A name space needs to be set on the document XPathAtts = xpAtts; } // Methods to set the inputs void TXFMXPath::setInput(TXFMBase *newInput) { if (newInput->getOutputType() == TXFMBase::BYTE_STREAM) { //throw XSECException(XSECException::TransformInputOutputFail, "C14n canonicalisation transform requires DOM_NODES input"); // Need to parse into DOM_NODES TXFMParser * parser; XSECnew(parser, TXFMParser(mp_expansionDoc)); try{ parser->setInput(newInput); } catch (...) { delete parser; input = newInput; throw; } input = parser; parser->expandNameSpaces(); } else input = newInput; // Set up for the new document document = input->getDocument(); // Expand if necessary this->expandNameSpaces(); keepComments = input->getCommentsStatus(); } bool separator(unsigned char c) { if (c >= 'a' && c <= 'z') return false; if (c >= 'A' && c <= 'Z') return false; return true; } XalanNode * findHereNodeFromXalan(XercesWrapperNavigator * xwn, XalanNode * n, DOMNode *h) { const DOMNode * m = xwn->mapNode(n); const XalanNode * ret; if (m == h) return n; // Not this one - check the children XalanNode * c = n->getFirstChild(); while (c != 0) { ret = findHereNodeFromXalan(xwn, c, h); if (ret != 0) return (XalanNode *) ret; c = c->getNextSibling(); } return 0; } void TXFMXPath::evaluateExpr(DOMNode *h, safeBuffer inexpr) { // Temporarily add any necessary name spaces into the document XSECXPathNodeList addedNodes; setXPathNS(document, XPathAtts, addedNodes, formatter, mp_nse); XPathProcessorImpl xppi; // The processor XercesParserLiaison xpl; #if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10 XercesDOMSupport xds(xpl); #else XercesDOMSupport xds; #endif XPathEvaluator xpe; XPathFactoryDefault xpf; XPathConstructionContextDefault xpcc; XalanDocument * xd; XalanNode * contextNode; // Xalan can throw exceptions in all functions, so do one broad catch point. try { // Map to Xalan xd = xpl.createDocument(document); // For performing mapping XercesDocumentWrapper *xdw = xpl.mapDocumentToWrapper(xd); XercesWrapperNavigator xwn(xdw); // Map the "here" node - but only if part of current document XalanNode * hereNode = NULL; if (h->getOwnerDocument() == document) { hereNode = xwn.mapNode(h); if (hereNode == NULL) { hereNode = findHereNodeFromXalan(&xwn, xd, h); if (hereNode == NULL) { throw XSECException(XSECException::XPathError, "Unable to find here node in Xalan Wrapper map"); } } } // Now work out what we have to set up in the new processing TXFMBase::nodeType inputType = input->getNodeType(); XalanDOMString cd; // For the moment assume the root is the context const XalanDOMChar * cexpr; safeBuffer contextExpr; switch (inputType) { case DOM_NODE_DOCUMENT : case DOM_NODE_XPATH_NODESET : // do XPath over the whole document and, if the input was an // XPath Nodeset, then later intersect the result with the input nodelist cd = XalanDOMString("/"); // Root node cexpr = cd.c_str(); // The context node is the "root" node contextNode = xpe.selectSingleNode( xds, xd, cexpr, xd->getDocumentElement()); break; case DOM_NODE_DOCUMENT_FRAGMENT : { // Need to map the DOM_Node that we are given from the input to the appropriate XalanNode // Create the XPath expression to find the node if (input->getFragmentId() != NULL) { contextExpr.sbTranscodeIn("//descendant-or-self::node()[attribute::Id='"); contextExpr.sbXMLChCat(input->getFragmentId()); contextExpr.sbXMLChCat("']"); // Map the node contextNode = xpe.selectSingleNode( xds, xd, contextExpr.rawXMLChBuffer(), //XalanDOMString((char *) contextExpr.rawBuffer()).c_str(), xd->getDocumentElement()); if (contextNode == NULL) { // Last Ditch contextNode = xwn.mapNode(input->getFragmentNode()); } } else contextNode = xwn.mapNode(input->getFragmentNode()); if (contextNode == NULL) { // Something wrong throw XSECException(XSECException::XPathError, "Error mapping context node"); } break; } default : throw XSECException(XSECException::XPathError); // Should never get here } safeBuffer str; XPathEnvSupportDefault xpesd; XObjectFactoryDefault xof; XPathExecutionContextDefault xpec(xpesd, xds, xof); ElementPrefixResolverProxy pr(xd->getDocumentElement(), xpesd, xds); // Work around the fact that the XPath implementation is designed for XSLT, so does // not allow here() as a NCName. // THIS IS A KLUDGE AND SHOULD BE DONE BETTER int offset = 0; safeBuffer k(KLUDGE_PREFIX); k.sbStrcatIn(":"); offset = inexpr.sbStrstr("here()"); while (offset >= 0) { if (offset == 0 || offset == 1 || (!(inexpr[offset - 1] == ':' && inexpr[offset - 2] != ':') && separator(inexpr[offset - 1]))) { inexpr.sbStrinsIn(k.rawCharBuffer(), offset); } offset = inexpr.sbOffsetStrstr("here()", offset + 11); } // Install the External function in the Environment handler if (hereNode != NULL) { xpesd.installExternalFunctionLocal(XalanDOMString(URI_ID_DSIG), XalanDOMString("here"), DSIGXPathHere(hereNode)); } str.sbStrcpyIn("(descendant-or-self::node() | descendant-or-self::node()/attribute::* | descendant-or-self::node()/namespace::*)["); str.sbStrcatIn(inexpr); str.sbStrcatIn("]"); XPath * xp = xpf.create(); XalanDOMString Xexpr((char *) str.rawBuffer()); xppi.initXPath(*xp, xpcc, Xexpr, pr); // Now resolve XObjectPtr xObj = xp->execute(contextNode, pr, xpec); // Now map to a list that others can use (naieve list at this time) const NodeRefListBase& lst = xObj->nodeset(); int size = (int) lst.getLength(); const DOMNode *item; for (int i = 0; i < size; ++ i) { if (lst.item(i) == xd) m_XPathMap.addNode(document); else { item = xwn.mapNode(lst.item(i)); m_XPathMap.addNode(item); } } if (inputType == DOM_NODE_XPATH_NODESET) { //the input list was a XPATH nodeset, so we must intersect the // results of the XPath processing done above with the input nodeset m_XPathMap.intersect(input->getXPathNodeList()); } } catch (XSLException &e) { safeBuffer msg; // Whatever happens - fix any changes to the original document clearXPathNS(document, addedNodes, formatter, mp_nse); // Collate the exception message into an XSEC message. msg.sbTranscodeIn("Xalan Exception : "); #if defined (XSEC_XSLEXCEPTION_RETURNS_DOMSTRING) msg.sbXMLChCat(e.getType().c_str()); #else msg.sbXMLChCat(e.getType()); #endif msg.sbXMLChCat(" caught. Message : "); msg.sbXMLChCat(e.getMessage().c_str()); throw XSECException(XSECException::XPathError, msg.rawXMLChBuffer()); } clearXPathNS(document, addedNodes, formatter, mp_nse); } void TXFMXPath::evaluateEnvelope(DOMNode *t) { // A special case where the XPath expression is already known if (document == NULL) { throw XSECException(XSECException::XPathError, "Attempt to define XPath Name Space before setInput called"); } DOMElement * e = document->getDocumentElement(); if (e == NULL) { throw XSECException(XSECException::XPathError, "Element node not found in Document"); } // Set the xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" e->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING("xmlns:dsig"), DSIGConstants::s_unicodeStrURIDSIG); // Evaluate evaluateExpr(t, XPATH_EXPR_ENVELOPE); // Now we are done, remove the namespace e->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING("dsig")); } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMXPath::getInputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::ioType TXFMXPath::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMXPath::getNodeType(void) { return TXFMBase::DOM_NODE_XPATH_NODESET; } // Methods to get output data unsigned int TXFMXPath::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; } DOMDocument *TXFMXPath::getDocument() { return document; } DOMNode *TXFMXPath::getFragmentNode() { return NULL; } const XMLCh * TXFMXPath::getFragmentId() { return NULL; // Empty string } XSECXPathNodeList & TXFMXPath::getXPathNodeList() { return m_XPathMap; } #endif /* NO_XPATH */ xml-security-c-1.7.3/xsec/transformers/TXFMXSL.cpp000644 001751 001751 00000013275 12157707211 023150 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMXSL := Class that performs XPath transforms * * $Id: TXFMXSL.cpp 1493962 2013-06-17 22:32:41Z scantor $ * */ #include #include #include #ifndef XSEC_NO_XSLT // Xerces #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #include #include XALAN_USING_XALAN(XSLTResultTarget) // Function used to output data to a safeBuffer extern "C" { typedef struct TransformXSLOutputHolderStruct { safeBuffer buffer; int offset; } TransformXSLOutputHolder; CallbackSizeType TransformXSLOutputFn(const char * s, CallbackSizeType sz, void * data) { TransformXSLOutputHolder * output = (TransformXSLOutputHolder *) data; output->buffer.sbMemcpyIn(output->offset, s, (int) sz); output->offset += (int) sz; output->buffer[output->offset] = '\0'; return sz; } } // ----------------------------------------------------------------------- // For expanding name spaces when necessary // ----------------------------------------------------------------------- bool TXFMXSL::nameSpacesExpanded(void) { // NOTE : Do not check inputs as this has its own document return (mp_nse != NULL); } void TXFMXSL::expandNameSpaces(void) { if (mp_nse != NULL) return; // Already done if (docOut != NULL) { XSECnew(mp_nse, XSECNameSpaceExpander(docOut)); mp_nse->expandNameSpaces(); } } // ----------------------------------------------------------------------- // Transform functions // ----------------------------------------------------------------------- TXFMXSL::TXFMXSL(DOMDocument *doc) : TXFMBase(doc), #if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10 xds(xpl) #else #if defined XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT xpl(xds) #else xpl() #endif #endif { // Zeroise all the pointers xd = NULL; } TXFMXSL::~TXFMXSL() { if (docOut != NULL) { if (mp_nse != NULL) { delete mp_nse; // Don't bother collapsing mp_nse = NULL; } docOut->release(); } } // Methods to set the inputs void TXFMXSL::setInput(TXFMBase *newInput) { input = newInput; if (newInput->getOutputType() != TXFMBase::BYTE_STREAM) { throw XSECException(XSECException::TransformInputOutputFail, "XSL requires DOM_NODES input type"); } // Should have a method to check if the input is a straight URL - if it is, just read the // URL name and create an XSLTInputSource with this as the input ID. int size = 0; int count = 0; unsigned char buf[512]; while ((count = input->readBytes((XMLByte *) buf, 512)) != 0) { sbInDoc.sbMemcpyIn(size, buf, count); size += count; } sbInDoc[size] = '\0'; } void TXFMXSL::evaluateStyleSheet(const safeBuffer &sbStyleSheet) { // Set up iostreams for input std::istrstream theXMLStream((char *) sbInDoc.rawBuffer(), (int) strlen((char *) sbInDoc.rawBuffer())); std::istrstream theXSLStream((char *) sbStyleSheet.rawBuffer(), (int) strlen((char *) sbStyleSheet.rawBuffer())); // Now resolve XalanTransformer xt; TransformXSLOutputHolder txoh; txoh.buffer.sbStrcpyIn(""); txoh.offset = 0; /*int res = */ xt.transform(&theXMLStream, &theXSLStream, (void *) & txoh, TransformXSLOutputFn); // Should check res // Now use xerces to "re parse" this back into a DOM_Nodes document XercesDOMParser * parser = new XercesDOMParser; Janitor j_parser(parser); parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); parser->setLoadExternalDTD(false); parser->setDoSchema(true); SecurityManager securityManager; parser->setSecurityManager(&securityManager); // Create an input source MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) txoh.buffer.rawBuffer(), txoh.offset, "XSECMem"); Janitor j_memIS(memIS); int errorCount = 0; parser->parse(*memIS); errorCount = parser->getErrorCount(); if (errorCount > 0) throw XSECException(XSECException::XSLError, "Errors occured when XSL result was parsed back to DOM_Nodes"); docOut = parser->adoptDocument(); // Janitors clean up } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMXSL::getInputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::ioType TXFMXSL::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMXSL::getNodeType(void) { return TXFMBase::DOM_NODE_DOCUMENT; } // Methods to get output data unsigned int TXFMXSL::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; } DOMDocument * TXFMXSL::getDocument() { return docOut; } DOMNode * TXFMXSL::getFragmentNode() { return NULL; } const XMLCh * TXFMXSL::getFragmentId() { return NULL; // Empty string } #endif /* NO_XSLT */ xml-security-c-1.7.3/xsec/transformers/TXFMDocObject.cpp000644 001751 001751 00000011305 12003301053 024306 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMDocObject := Class that takes an input Document object ID to start a txfm pipe * * $Id: TXFMDocObject.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // Construct/Destruct TXFMDocObject::TXFMDocObject(DOMDocument *doc) : TXFMBase(doc) { input = NULL; fragmentId = NULL; type = TXFMBase::DOM_NODE_NONE; // No nodes currently held mp_env = NULL; } TXFMDocObject::~TXFMDocObject() { if (fragmentId != NULL) XSEC_RELEASE_XMLCH(fragmentId); } // Methods to set the inputs void TXFMDocObject::setInput(TXFMBase *newInput) { // Probably should error, but we store it so we can later clear out pipes. input = newInput; } DOMNode * findDSIGId(DOMNode *current, const XMLCh * newFragmentId, const XSECEnv * env) { DOMNode *tmp, *ret; DOMNamedNodeMap *atts; if (current->getNodeType() == DOMNode::ELEMENT_NODE) { atts = current->getAttributes(); if (atts != NULL) { int sz = env->getIdAttributeNameListSize(); for (int i = 0; i < sz ; ++i) { if (env->getIdAttributeNameListItemIsNS(i) == false) { tmp = atts->getNamedItem(env->getIdAttributeNameListItem(i)); if (tmp != 0 && strEquals(tmp->getNodeValue(), newFragmentId)) { // Found it! return current; } } else { // This is a namespace aware Id tmp = atts->getNamedItemNS(env->getIdAttributeNameListItemNS(i), env->getIdAttributeNameListItem(i)); if (tmp != 0 && strEquals(tmp->getNodeValue(), newFragmentId)) { return current; } } } } } // Check children tmp = current->getFirstChild(); while (tmp != NULL) { if ((ret = findDSIGId(tmp, newFragmentId, env)) != 0) return ret; tmp = tmp->getNextSibling(); } return NULL; } void TXFMDocObject::setInput(DOMDocument *doc, const XMLCh * newFragmentId) { // We have a document fragment marked by an objectID string. // Now try to find the node that the objectId belongs to fragmentObject = doc->getElementById(newFragmentId); if ((fragmentObject == NULL) && (mp_env != NULL) && (mp_env->getIdByAttributeName())) { // It might be that no DSIG DTD was attached and that the ID is in a // DSIG element and the application is permitting attribute name based // Id searches fragmentObject = findDSIGId(doc, newFragmentId, mp_env); } if (fragmentObject == 0) throw XSECException(XSECException::IDNotFoundInDOMDoc); document = doc; fragmentId = XMLString::replicate(newFragmentId); type = TXFMBase::DOM_NODE_DOCUMENT_FRAGMENT; } // -------------------------------------------------------------------------------- // Env Handling // -------------------------------------------------------------------------------- void TXFMDocObject::setEnv(const XSECEnv * env) { mp_env = env; } void TXFMDocObject::setInput(DOMDocument * doc, DOMNode * newFragmentObject) { // Have a document fragment directly notified by a DOM_Node document = doc; fragmentObject = newFragmentObject; type = TXFMBase::DOM_NODE_DOCUMENT_NODE; } void TXFMDocObject::setInput(DOMDocument *doc) { document = doc; type = TXFMBase::DOM_NODE_DOCUMENT; } // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMDocObject::getInputType(void) { return TXFMBase::NONE; } TXFMBase::ioType TXFMDocObject::getOutputType(void) { return TXFMBase::DOM_NODES; } TXFMBase::nodeType TXFMDocObject::getNodeType(void) { return type; } // Methods to get output data unsigned int TXFMDocObject::readBytes(XMLByte * const toFill, unsigned int maxToFill) { return 0; // Cannot read a bytestream from a DOM_NODES transform } DOMDocument * TXFMDocObject::getDocument() { return document; } DOMNode * TXFMDocObject::getFragmentNode() { return fragmentObject; } const XMLCh * TXFMDocObject::getFragmentId() { return fragmentId; } xml-security-c-1.7.3/xsec/transformers/TXFMConcatChains.cpp000644 001751 001751 00000006430 12003301053 025012 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMConcatChain := Takes multiple input chains and then provides * BYTE_STREAM output for each chain in order. * * $Id: TXFMConcatChains.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include XERCES_CPP_NAMESPACE_USE TXFMConcatChains::TXFMConcatChains(DOMDocument *doc) : TXFMBase(doc), mp_currentTxfm(NULL), m_currentChain(0), m_complete(false) { } TXFMConcatChains::~TXFMConcatChains() { size_type i, s; s = m_chains.size(); for (i = 0; i < s; ++i) delete m_chains[i]; m_chains.clear(); } void TXFMConcatChains::setInput(TXFMBase *newInput) { size_type i = m_chains.size(); if (i == 0) { throw XSECException(XSECException::TransformInputOutputFail, "TXFMConcatChains::setInput - Cannot concatinate new base transform until at least one chain is added"); } m_chains[i-1]->getLastTxfm()->setInput(newInput); } void TXFMConcatChains::setInput(TXFMChain *newInputChain) { m_chains.push_back(newInputChain); } TXFMBase::ioType TXFMConcatChains::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMConcatChains::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMConcatChains::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to get output data unsigned int TXFMConcatChains::readBytes(XMLByte * const toFill, const unsigned int maxToFill) { if (m_complete == true) return 0; // Is this the first one? if (mp_currentTxfm == NULL) { if (m_chains.size() == 0) { throw XSECException(XSECException::TransformInputOutputFail, "TXFMConcatChains::readBytes - Cannot read bytes until chains added"); } m_currentChain = 0; mp_currentTxfm = m_chains[m_currentChain]->getLastTxfm(); } unsigned int bytesRead = 0; unsigned int lastBytesRead = 0; while (!m_complete && bytesRead < maxToFill) { lastBytesRead = mp_currentTxfm->readBytes(&toFill[bytesRead], maxToFill - bytesRead); if (lastBytesRead == 0) { if (++m_currentChain == m_chains.size()) m_complete = true; else mp_currentTxfm = m_chains[m_currentChain]->getLastTxfm(); } else { bytesRead += lastBytesRead; } } return bytesRead; } DOMDocument *TXFMConcatChains::getDocument() { return NULL; } DOMNode *TXFMConcatChains::getFragmentNode() { return NULL; } const XMLCh * TXFMConcatChains::getFragmentId() { return NULL; } xml-security-c-1.7.3/xsec/transformers/TXFMMD5.cpp000644 001751 001751 00000006172 12003301053 023045 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * TXFMMD5 := Class that performs a MD5 transform * * $Id: TXFMMD5.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include XERCES_CPP_NAMESPACE_USE // Standarad includes TXFMMD5::TXFMMD5(DOMDocument *doc, XSECCryptoKey * key) : TXFMBase (doc) { toOutput = 0; // Nothing yet to output if (key == NULL) // Get a MD5 worker mp_h = XSECPlatformUtils::g_cryptoProvider->hashMD5(); else { // Get an HMAC MD5 mp_h = XSECPlatformUtils::g_cryptoProvider->hashHMACMD5(); mp_h->setKey(key); } if (!mp_h) { throw XSECException(XSECException::CryptoProviderError, "Error requesting MD5 object from Crypto Provider"); } }; TXFMMD5::~TXFMMD5() { // Clean up if (mp_h) delete mp_h; }; // Methods to set the inputs //void TXFMMD5::setInput(TXFMBase *input); // Methods to get tranform output type and input requirement TXFMBase::ioType TXFMMD5::getInputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::ioType TXFMMD5::getOutputType(void) { return TXFMBase::BYTE_STREAM; } TXFMBase::nodeType TXFMMD5::getNodeType(void) { return TXFMBase::DOM_NODE_NONE; } // Methods to set input data void TXFMMD5::setInput(TXFMBase * inputT) { input = inputT; keepComments = input->getCommentsStatus(); // Now run through the data unsigned char buffer[1024]; unsigned int size; while ((size = input->readBytes((XMLByte *) buffer, 1024)) != 0) mp_h->hash(buffer, size); // Finalise md_len = mp_h->finish(md_value, CRYPTO_MAX_HASH_SIZE); toOutput = md_len; } unsigned int TXFMMD5::readBytes(XMLByte * const toFill, unsigned int maxToFill) { unsigned int ret; if (toOutput == 0) return 0; // Check if we can just output everything left if (toOutput <= maxToFill) { memcpy((char *) toFill, &md_value[md_len - toOutput], toOutput); ret = toOutput; toOutput = 0; return ret; } // Output just some memcpy((char *) toFill, &md_value[md_len - toOutput], maxToFill); ret = maxToFill; toOutput -= maxToFill; return ret; } DOMDocument * TXFMMD5::getDocument() { return NULL; } DOMNode * TXFMMD5::getFragmentNode() { return NULL; // Return a null node }; const XMLCh * TXFMMD5::getFragmentId() { return NULL; // Empty string } xml-security-c-1.7.3/xsec/samples/simpleDecrypt.cpp000644 001751 001751 00000013051 12003301053 023516 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * SimpleEncrypt := An application to generate an XML document (via Xerces) and encrypt * a portion of it * * $Id: simpleDecrypt.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include "IOStreamOutputter.hpp" // Xerces #include #include #include // XML-Security-C (XSEC) #include #include #include #include // Xalan #ifndef XSEC_NO_XALAN #include XALAN_USING_XALAN(XalanTransformer) #endif // OpenSSL #include #include #include XERCES_CPP_NAMESPACE_USE char letter[] = "\n\ \n\ The address of the Recipient\n\ The address of the Sender\n\ \n\ \n\ \n\ \n\ \n\ \n\ UDH9I9k6dRvlIS7fHLMONtlP24mqEDPzsjSYUg4X5SSzUFskiVaOIzhYPeF21ZeG\n\ MCmdo6wsu6TQB0XebmvJR2wgvYqDd2L2IbXZ1zj2/G7FbVsB/GSGxuQTFw22aMFd\n\ l47P8bKjxX8cUwwYFzbGAUfkgeQp5DglmnJYJPO1cTw=\n\ \n\ \n\ \n\ \n\ \n\ Q7M6QhZOqjyYXdUDOw809dGEJWkyAygRv7r3EJ8FlcY7dYpn78ON79N/ZB5wJxQt\n\ koyHvWimPWkNRlKGP10DJ42PIGDvuTnTBFHCKbvaMrEjkll8PUd8zHQ0OJIaWIYi\n\ AKydplJy2rCzppwn0bI0YQ==\n\ \n\ \n\ "; // PKCS8 PEM encoded PrivateKey structure (not Encrypted) char s_privateKey[] = "\n\ -----BEGIN RSA PRIVATE KEY-----\n\ MIICXAIBAAKBgQDQj3pktZckAzwshRnfvLhz3daNU6xpAzoHo3qjCftxDwH1RynP\n\ A5eycJVkV8mwH2C1PFktpjtQTZ2CvPjuKmUV5zEvmYzuIo6SWYaVZN/PJjzsEZMa\n\ VA+U8GhfX1YF/rsuFzXCi8r6FVd3LN//pXHEwoDGdJUdlpdVEuX1iFKlNQIDAQAB\n\ AoGAYQ7Uc7e6Xa0PvNw4XVHzOSC870pISxqQT+u5b9R+anAEhkQW5dsTJpyUOX1N\n\ RCRmGhG6oq7gnY9xRN1yr0uVfJNtc9/HnzJL7L1jeJC8Ub+zbEBvNuPDL2P21ArW\n\ tcXRycUlfRCRBLop7rfOYPXsjtboAGnQY/6hK4rOF4XGrQUCQQD3Euj+0mZqRRZ4\n\ M1yN2wVP0mKOMg2i/HZXaNeVd9X/wyBgK6b7BxHf6onf/mIBWnJnRBlvdCrSdhuT\n\ lPKEoSgvAkEA2BhfWwQihqD4qJcV65nfosjzOZG41rHX69nIqHI7Ejx5ZgeQByH9\n\ Ym96yXoSpZj9ZlFsJYNogTBBnUBjs+jL2wJAFjpVS9eR7y2X/+hfA0QZDj1XMIPA\n\ RlGANAzymDfXwNLFLuG+fAb+zK5FCSnRl12TvUabIzPIRnbptDVKPDRjcQJBALn8\n\ 0CVv+59P8HR6BR3QRBDBT8Xey+3NB4Aw42lHV9wsPHg6ThY1hPYx6MZ70IzCjmZ/\n\ 8cqfvVRjijWj86wm0z0CQFKfRfBRraOZqfmOiAB4+ILhbJwKBBO6avX9TPgMYkyN\n\ mWKCxS+9fPiy1iI+G+B9xkw2gJ9i8P81t7fsOvdTDFA=\n\ -----END RSA PRIVATE KEY-----"; int main (int argc, char **argv) { try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Use xerces to parse the document XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); parser->setDoSchema(true); // Create an input source MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) letter, (unsigned int) strlen(letter), "XSECMem"); parser->parse(*memIS); xsecsize_t errorCount = parser->getErrorCount(); if (errorCount > 0) { cerr << "Error parsing input document\n"; exit (1); } DOMDocument *doc = parser->getDocument(); /* Decrypt Operations */ try { /* Create the cipher object that we need */ XSECProvider prov; XENCCipher *cipher; cipher = prov.newCipher(doc); /* Load the private key via OpenSSL and then wrap in an OpenSSLCrypto construct */ BIO * bioMem = BIO_new(BIO_s_mem()); BIO_puts(bioMem, s_privateKey); EVP_PKEY * pk = PEM_read_bio_PrivateKey(bioMem, NULL, NULL, NULL); /* NOTE : For simplicity - no error checking here */ OpenSSLCryptoKeyRSA * k = new OpenSSLCryptoKeyRSA(pk); cipher->setKEK(k); /* Find the EncryptedData node */ DOMNode * encryptedNode = findXENCNode(doc, "EncryptedData"); /* Do the decrypt */ cipher->decryptElement((DOMElement *) encryptedNode); } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occurred during an encryption operation\n Message: " << msg << endl; exit(1); } /* Output */ docSetup(doc); cout << doc; return 0; } xml-security-c-1.7.3/xsec/samples/IOStreamOutputter.cpp000644 001751 001751 00000072460 12003301053 024322 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * IOStreamOutputer.cpp := Used by all samples that need to output a DOM document * to an IOStream * * Very ugly - should really be a class. The original * Xerces examples had this as part of a single CPP file for * One overall example - much nicer. * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include "IOStreamOutputter.hpp" #include #include #include // Uplift everything to the Xerces name space XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Much code taken from the DOMPrint Xerces example // -------------------------------------------------------------------------------- static XMLFormatter* gFormatter = 0; static XMLCh* gEncodingName = 0; static XMLFormatter::UnRepFlags gUnRepFlags = XMLFormatter::UnRep_CharRef; static const XMLCh gEndElement[] = { chOpenAngle, chForwardSlash, chNull }; static const XMLCh gEndPI[] = { chQuestion, chCloseAngle, chNull}; static const XMLCh gStartPI[] = { chOpenAngle, chQuestion, chNull }; static const XMLCh gXMLDecl1[] = { chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l , chSpace, chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i , chLatin_o, chLatin_n, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl2[] = { chDoubleQuote, chSpace, chLatin_e, chLatin_n, chLatin_c , chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chEqual , chDoubleQuote, chNull }; static const XMLCh gXMLDecl3[] = { chDoubleQuote, chSpace, chLatin_s, chLatin_t, chLatin_a , chLatin_n, chLatin_d, chLatin_a, chLatin_l, chLatin_o , chLatin_n, chLatin_e, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl4[] = { chDoubleQuote, chQuestion, chCloseAngle , chLF, chNull }; static const XMLCh gStartCDATA[] = { chOpenAngle, chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chOpenSquare, chNull }; static const XMLCh gEndCDATA[] = { chCloseSquare, chCloseSquare, chCloseAngle, chNull }; static const XMLCh gStartComment[] = { chOpenAngle, chBang, chDash, chDash, chNull }; static const XMLCh gEndComment[] = { chDash, chDash, chCloseAngle, chNull }; static const XMLCh gStartDoctype[] = { chOpenAngle, chBang, chLatin_D, chLatin_O, chLatin_C, chLatin_T, chLatin_Y, chLatin_P, chLatin_E, chSpace, chNull }; static const XMLCh gPublic[] = { chLatin_P, chLatin_U, chLatin_B, chLatin_L, chLatin_I, chLatin_C, chSpace, chDoubleQuote, chNull }; static const XMLCh gSystem[] = { chLatin_S, chLatin_Y, chLatin_S, chLatin_T, chLatin_E, chLatin_M, chSpace, chDoubleQuote, chNull }; static const XMLCh gStartEntity[] = { chOpenAngle, chBang, chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chLatin_Y, chSpace, chNull }; static const XMLCh gNotation[] = { chLatin_N, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chSpace, chDoubleQuote, chNull }; // --------------------------------------------------------------------------- // Local classes // --------------------------------------------------------------------------- class DOMPrintFormatTarget : public XMLFormatTarget { public: DOMPrintFormatTarget() {}; ~DOMPrintFormatTarget() {}; // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const xsecsize_t count, XMLFormatter * const formatter) { // Surprisingly, Solaris was the only platform on which // required the char* cast to print out the string correctly. // Without the cast, it was printing the pointer value in hex. // Quite annoying, considering every other platform printed // the string with the explicit cast to char* below. cout.write((char *) toWrite, count); }; private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- DOMPrintFormatTarget(const DOMPrintFormatTarget& other); void operator=(const DOMPrintFormatTarget& rhs); }; // --------------------------------------------------------------------------- // ostream << DOMNode // // Stream out a DOM node, and, recursively, all of its children. This // function is the heart of writing a DOM tree out as XML source. Give it // a document node and it will do the whole thing. // --------------------------------------------------------------------------- ostream& operator<<(ostream& target, DOMNode* toWrite) { // Get the name and value out for convenience const XMLCh* nodeName = toWrite->getNodeName(); const XMLCh* nodeValue = toWrite->getNodeValue(); xsecsize_t lent = XMLString::stringLen(nodeValue); switch (toWrite->getNodeType()) { case DOMNode::TEXT_NODE: { gFormatter->formatBuf(nodeValue, lent, XMLFormatter::CharEscapes); break; } case DOMNode::PROCESSING_INSTRUCTION_NODE : { *gFormatter << XMLFormatter::NoEscapes << gStartPI << nodeName; if (lent > 0) { *gFormatter << chSpace << nodeValue; } *gFormatter << XMLFormatter::NoEscapes << gEndPI; break; } case DOMNode::DOCUMENT_NODE : { DOMNode *child = toWrite->getFirstChild(); while( child != 0) { target << child; // add linefeed in requested output encoding *gFormatter << chLF; target << flush; child = child->getNextSibling(); } break; } case DOMNode::ELEMENT_NODE : { // The name has to be representable without any escapes *gFormatter << XMLFormatter::NoEscapes << chOpenAngle << nodeName; // Output the element start tag. // Output any attributes on this element DOMNamedNodeMap *attributes = toWrite->getAttributes(); XMLSize_t attrCount = attributes->getLength(); for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode *attribute = attributes->item(i); // // Again the name has to be completely representable. But the // attribute can have refs and requires the attribute style // escaping. // *gFormatter << XMLFormatter::NoEscapes << chSpace << attribute->getNodeName() << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << attribute->getNodeValue() << XMLFormatter::NoEscapes << chDoubleQuote; } // // Test for the presence of children, which includes both // text content and nested elements. // DOMNode *child = toWrite->getFirstChild(); if (child != 0) { // There are children. Close start-tag, and output children. // No escapes are legal here *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; while( child != 0) { target << child; child = child->getNextSibling(); } // // Done with children. Output the end tag. // *gFormatter << XMLFormatter::NoEscapes << gEndElement << nodeName << chCloseAngle; } else { // // There were no children. Output the short form close of // the element start tag, making it an empty-element tag. // *gFormatter << XMLFormatter::NoEscapes << chForwardSlash << chCloseAngle; } break; } case DOMNode::ENTITY_REFERENCE_NODE: { //DOMNode *child; #if 0 for (child = toWrite.getFirstChild(); child != 0; child = child.getNextSibling()) { target << child; } #else // // Instead of printing the refernece tree // we'd output the actual text as it appeared in the xml file. // This would be the case when -e option was chosen // *gFormatter << XMLFormatter::NoEscapes << chAmpersand << nodeName << chSemiColon; #endif break; } case DOMNode::CDATA_SECTION_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartCDATA << nodeValue << gEndCDATA; break; } case DOMNode::COMMENT_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartComment << nodeValue << gEndComment; break; } case DOMNode::DOCUMENT_TYPE_NODE: { DOMDocumentType *doctype = (DOMDocumentType *)toWrite;; *gFormatter << XMLFormatter::NoEscapes << gStartDoctype << nodeName; const XMLCh* id = doctype->getPublicId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gPublic << id << chDoubleQuote; id = doctype->getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << chDoubleQuote << id << chDoubleQuote; } } else { id = doctype->getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gSystem << id << chDoubleQuote; } } id = doctype->getInternalSubset(); if (id !=0) *gFormatter << XMLFormatter::NoEscapes << chOpenSquare << id << chCloseSquare; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; break; } case DOMNode::ENTITY_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartEntity << nodeName; const XMLCh * id = ((DOMEntity *)toWrite)->getPublicId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gPublic << id << chDoubleQuote; id = ((DOMEntity *)toWrite)->getSystemId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gSystem << id << chDoubleQuote; id = ((DOMEntity *)toWrite)->getNotationName(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gNotation << id << chDoubleQuote; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle << chLF; break; } /* case DOMNode::NOTATION_NODE: { const XMLCh * str; *gFormatter << gXMLDecl1 << ((DOMXMLDecl *)toWrite)->getVersion(); *gFormatter << gXMLDecl2 << gEncodingName; str = ((DOMXMLDecl *)toWrite)->getStandalone(); if (str != 0) *gFormatter << gXMLDecl3 << str; *gFormatter << gXMLDecl4; break; } */ default: cerr << "Unrecognized node type = " << (long)toWrite->getNodeType() << endl; } return target; } // --------------------------------------------------------------------------- // ostream << DOMString // // Stream out a DOM string. Doing this requires that we first transcode // to char * form in the default code page for the system // --------------------------------------------------------------------------- /*ostream& operator<< (ostream& target, const DOMString& s) { char *p = s.transcode(); target << p; delete [] p; return target; } XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s) { unsigned int lent = s.length(); if (lent <= 0) return strm; XMLCh* buf = new XMLCh[lent + 1]; XMLString::copyNString(buf, s.rawBuffer(), lent); buf[lent] = 0; strm << buf; delete [] buf; return strm; }*/ // -------------------------------------------------------------------------------- // End of outputter // -------------------------------------------------------------------------------- class DOMMemFormatTarget : public XMLFormatTarget { public: unsigned char * buffer; // Buffer to write to DOMMemFormatTarget() {}; ~DOMMemFormatTarget() {}; void setBuffer (unsigned char * toSet) {buffer = toSet;}; // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const unsigned int count, XMLFormatter * const formatter) { // Surprisingly, Solaris was the only platform on which // required the char* cast to print out the string correctly. // Without the cast, it was printing the pointer value in hex. // Quite annoying, considering every other platform printed // the string with the explicit cast to char* below. memcpy(buffer, (char *) toWrite, (int) count); buffer[count] = '\0'; }; private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- DOMMemFormatTarget(const DOMMemFormatTarget& other); void operator=(const DOMMemFormatTarget& rhs); }; // --------------------------------------------------------------------------- // ostream << DOMString // // Stream out a DOM string. Doing this requires that we first transcode // to char * form in the default code page for the system // --------------------------------------------------------------------------- DOMPrintFormatTarget *DOMtarget; DOMMemFormatTarget *MEMtarget; XMLFormatter *formatter, *MEMformatter; unsigned char *charBuffer; #if 0 // -------------------------------------------------------------------------------- // Much code taken from the DOMPrint Xerces example // -------------------------------------------------------------------------------- static XMLFormatter* gFormatter = 0; static XMLCh* gEncodingName = 0; static XMLFormatter::UnRepFlags gUnRepFlags = XMLFormatter::UnRep_CharRef; static const XMLCh gEndElement[] = { chOpenAngle, chForwardSlash, chNull }; static const XMLCh gEndPI[] = { chQuestion, chCloseAngle, chNull}; static const XMLCh gStartPI[] = { chOpenAngle, chQuestion, chNull }; static const XMLCh gXMLDecl1[] = { chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l , chSpace, chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i , chLatin_o, chLatin_n, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl2[] = { chDoubleQuote, chSpace, chLatin_e, chLatin_n, chLatin_c , chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chEqual , chDoubleQuote, chNull }; static const XMLCh gXMLDecl3[] = { chDoubleQuote, chSpace, chLatin_s, chLatin_t, chLatin_a , chLatin_n, chLatin_d, chLatin_a, chLatin_l, chLatin_o , chLatin_n, chLatin_e, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl4[] = { chDoubleQuote, chQuestion, chCloseAngle , chLF, chNull }; static const XMLCh gStartCDATA[] = { chOpenAngle, chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chOpenSquare, chNull }; static const XMLCh gEndCDATA[] = { chCloseSquare, chCloseSquare, chCloseAngle, chNull }; static const XMLCh gStartComment[] = { chOpenAngle, chBang, chDash, chDash, chNull }; static const XMLCh gEndComment[] = { chDash, chDash, chCloseAngle, chNull }; static const XMLCh gStartDoctype[] = { chOpenAngle, chBang, chLatin_D, chLatin_O, chLatin_C, chLatin_T, chLatin_Y, chLatin_P, chLatin_E, chSpace, chNull }; static const XMLCh gPublic[] = { chLatin_P, chLatin_U, chLatin_B, chLatin_L, chLatin_I, chLatin_C, chSpace, chDoubleQuote, chNull }; static const XMLCh gSystem[] = { chLatin_S, chLatin_Y, chLatin_S, chLatin_T, chLatin_E, chLatin_M, chSpace, chDoubleQuote, chNull }; static const XMLCh gStartEntity[] = { chOpenAngle, chBang, chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chLatin_Y, chSpace, chNull }; static const XMLCh gNotation[] = { chLatin_N, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chSpace, chDoubleQuote, chNull }; // --------------------------------------------------------------------------- // Local classes // --------------------------------------------------------------------------- class DOMPrintFormatTarget : public XMLFormatTarget { public: DOMPrintFormatTarget() {}; ~DOMPrintFormatTarget() {}; // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const unsigned int count, XMLFormatter * const formatter) { // Surprisingly, Solaris was the only platform on which // required the char* cast to print out the string correctly. // Without the cast, it was printing the pointer value in hex. // Quite annoying, considering every other platform printed // the string with the explicit cast to char* below. cout.write((char *) toWrite, (int) count); }; private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- DOMPrintFormatTarget(const DOMPrintFormatTarget& other); void operator=(const DOMPrintFormatTarget& rhs); }; // --------------------------------------------------------------------------- // ostream << DOM_Node // // Stream out a DOM node, and, recursively, all of its children. This // function is the heart of writing a DOM tree out as XML source. Give it // a document node and it will do the whole thing. // --------------------------------------------------------------------------- ostream& operator<<(ostream& target, DOM_Node& toWrite) { // Get the name and value out for convenience DOMString nodeName = toWrite.getNodeName(); DOMString nodeValue = toWrite.getNodeValue(); unsigned long lent = nodeValue.length(); switch (toWrite.getNodeType()) { case DOM_Node::TEXT_NODE: { gFormatter->formatBuf(nodeValue.rawBuffer(), lent, XMLFormatter::CharEscapes); break; } case DOM_Node::PROCESSING_INSTRUCTION_NODE : { *gFormatter << XMLFormatter::NoEscapes << gStartPI << nodeName; if (lent > 0) { *gFormatter << chSpace << nodeValue; } *gFormatter << XMLFormatter::NoEscapes << gEndPI; break; } case DOM_Node::DOCUMENT_NODE : { DOM_Node child = toWrite.getFirstChild(); while( child != 0) { target << child; // add linefeed in requested output encoding *gFormatter << chLF; target << flush; child = child.getNextSibling(); } break; } case DOM_Node::ELEMENT_NODE : { // The name has to be representable without any escapes *gFormatter << XMLFormatter::NoEscapes << chOpenAngle << nodeName; // Output the element start tag. // Output any attributes on this element DOM_NamedNodeMap attributes = toWrite.getAttributes(); int attrCount = attributes.getLength(); for (int i = 0; i < attrCount; i++) { DOM_Node attribute = attributes.item(i); // // Again the name has to be completely representable. But the // attribute can have refs and requires the attribute style // escaping. // *gFormatter << XMLFormatter::NoEscapes << chSpace << attribute.getNodeName() << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << attribute.getNodeValue() << XMLFormatter::NoEscapes << chDoubleQuote; } // // Test for the presence of children, which includes both // text content and nested elements. // DOM_Node child = toWrite.getFirstChild(); if (child != 0) { // There are children. Close start-tag, and output children. // No escapes are legal here *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; while( child != 0) { target << child; child = child.getNextSibling(); } // // Done with children. Output the end tag. // *gFormatter << XMLFormatter::NoEscapes << gEndElement << nodeName << chCloseAngle; } else { // // There were no children. Output the short form close of // the element start tag, making it an empty-element tag. // *gFormatter << XMLFormatter::NoEscapes << chForwardSlash << chCloseAngle; } break; } case DOM_Node::ENTITY_REFERENCE_NODE: { DOM_Node child; #if 0 for (child = toWrite.getFirstChild(); child != 0; child = child.getNextSibling()) { target << child; } #else // // Instead of printing the refernece tree // we'd output the actual text as it appeared in the xml file. // This would be the case when -e option was chosen // *gFormatter << XMLFormatter::NoEscapes << chAmpersand << nodeName << chSemiColon; #endif break; } case DOM_Node::CDATA_SECTION_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartCDATA << nodeValue << gEndCDATA; break; } case DOM_Node::COMMENT_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartComment << nodeValue << gEndComment; break; } case DOM_Node::DOCUMENT_TYPE_NODE: { DOM_DocumentType doctype = (DOM_DocumentType &)toWrite;; *gFormatter << XMLFormatter::NoEscapes << gStartDoctype << nodeName; DOMString id = doctype.getPublicId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gPublic << id << chDoubleQuote; id = doctype.getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << chDoubleQuote << id << chDoubleQuote; } } else { id = doctype.getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gSystem << id << chDoubleQuote; } } id = doctype.getInternalSubset(); if (id !=0) *gFormatter << XMLFormatter::NoEscapes << chOpenSquare << id << chCloseSquare; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; break; } case DOM_Node::ENTITY_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartEntity << nodeName; DOMString id = ((DOM_Entity &)toWrite).getPublicId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gPublic << id << chDoubleQuote; id = ((DOM_Entity &)toWrite).getSystemId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gSystem << id << chDoubleQuote; id = ((DOM_Entity &)toWrite).getNotationName(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gNotation << id << chDoubleQuote; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle << chLF; break; } case DOM_Node::XML_DECL_NODE: { DOMString str; *gFormatter << gXMLDecl1 << ((DOM_XMLDecl &)toWrite).getVersion(); *gFormatter << gXMLDecl2 << gEncodingName; str = ((DOM_XMLDecl &)toWrite).getStandalone(); if (str != 0) *gFormatter << gXMLDecl3 << str; *gFormatter << gXMLDecl4; break; } default: cerr << "Unrecognized node type = " << (long)toWrite.getNodeType() << endl; } return target; } // --------------------------------------------------------------------------- // ostream << DOMString // // Stream out a DOM string. Doing this requires that we first transcode // to char * form in the default code page for the system // --------------------------------------------------------------------------- ostream& operator<< (ostream& target, const DOMString& s) { char *p = s.transcode(); target << p; XSEC_RELEASE_XMLCH(p); return target; } XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s) { unsigned int lent = s.length(); if (lent <= 0) return strm; XMLCh* buf = new XMLCh[lent + 1]; XMLString::copyNString(buf, s.rawBuffer(), lent); buf[lent] = 0; strm << buf; delete [] buf; return strm; } #endif void docSetup(DOMDocument *doc) { // Print out the doc DOMPrintFormatTarget* formatTarget = new DOMPrintFormatTarget(); const XMLCh* encNameStr = XMLString::transcode("UTF-8"); DOMNode *aNode = doc->getFirstChild(); if (aNode->getNodeType() == DOMNode::ENTITY_NODE) { const XMLCh* aStr = ((DOMEntity *)aNode)-> #if defined XSEC_XERCES_DOMENTITYINPUTENCODING getInputEncoding(); #else getEncoding(); #endif if (!strEquals(aStr, "")) { encNameStr = aStr; } } xsecsize_t lent = XMLString::stringLen(encNameStr); gEncodingName = new XMLCh[lent + 1]; XMLString::copyNString(gEncodingName, encNameStr, lent); gEncodingName[lent] = 0; #if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION) gFormatter = new XMLFormatter("UTF-8", 0, formatTarget, XMLFormatter::NoEscapes, gUnRepFlags); #else gFormatter = new XMLFormatter("UTF-8", formatTarget, XMLFormatter::NoEscapes, gUnRepFlags); #endif } // -------------------------------------------------------------------------------- // End of outputter // -------------------------------------------------------------------------------- xml-security-c-1.7.3/xsec/samples/IOStreamOutputter.hpp000644 001751 001751 00000003601 12003301053 024316 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * IOStreamOutputer.cpp := Used by all samples that need to output a DOM document * to an IOStream * * NOTE: Much of this code came from Apache examples in the Xerces distribution * * Author(s): Berin Lautenbach * * $Id: IOStreamOutputter.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include using std::cerr; using std::cout; using std::endl; using std::ostream; using std::flush; #if !defined(XERCES_CPP_NAMESPACE_QUALIFIER) # define XERCES_CPP_NAMESPACE_QUALIFIER #endif // -------------------------------------------------------------------------------- // Much code taken from the DOMPrint Xerces example // -------------------------------------------------------------------------------- ostream& operator<<(ostream& target, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * toWrite); //ostream& operator<< (ostream& target, const DOMString& s); //XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s); void docSetup(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); xml-security-c-1.7.3/xsec/samples/simpleEncrypt.cpp000644 001751 001751 00000014646 12003301053 023543 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * SimpleEncrypt := An application to generate an XML document (via Xerces) and encrypt * a portion of it * * $Id: simpleEncrypt.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include "IOStreamOutputter.hpp" // Xerces #include // XML-Security-C (XSEC) #include #include #include #include #include #include #include // Xalan #ifndef XSEC_NO_XALAN #include XALAN_USING_XALAN(XalanTransformer) #endif // OpenSSL #include XERCES_CPP_NAMESPACE_USE DOMElement * g_toEncrypt; char cert[] = "\n\ MIIC7jCCAq6gAwIBAgICEAMwCQYHKoZIzjgEAzB5MQswCQYDVQQGEwJBVTEMMAoG\n\ A1UECBMDVmljMRIwEAYDVQQHEwlNZWxib3VybmUxHzAdBgNVBAoTFlhNTC1TZWN1\n\ cml0eS1DIFByb2plY3QxEDAOBgNVBAsTB1hTRUMtQ0ExFTATBgNVBAMTDFhTRUMt\n\ Q0EgUm9vdDAeFw0wMjEyMTIxMDEzMTlaFw0xMjEyMDkxMDEzMTlaMFYxCzAJBgNV\n\ BAYTAkFVMQwwCgYDVQQIEwNWaWMxHzAdBgNVBAoTFlhNTC1TZWN1cml0eS1DIFBy\n\ b2plY3QxGDAWBgNVBAMTD1JTQSBTYW1wbGUgQ2VydDCBnzANBgkqhkiG9w0BAQEF\n\ AAOBjQAwgYkCgYEA0I96ZLWXJAM8LIUZ37y4c93WjVOsaQM6B6N6own7cQ8B9Ucp\n\ zwOXsnCVZFfJsB9gtTxZLaY7UE2dgrz47iplFecxL5mM7iKOklmGlWTfzyY87BGT\n\ GlQPlPBoX19WBf67Lhc1wovK+hVXdyzf/6VxxMKAxnSVHZaXVRLl9YhSpTUCAwEA\n\ AaOCAQEwgf4wCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5l\n\ cmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFGq6U1SwYNRyTJGAwARirEdavfXB\n\ MIGjBgNVHSMEgZswgZiAFBKNX9CsAIsjUIFmVq4wE4wlOGC5oX2kezB5MQswCQYD\n\ VQQGEwJBVTEMMAoGA1UECBMDVmljMRIwEAYDVQQHEwlNZWxib3VybmUxHzAdBgNV\n\ BAoTFlhNTC1TZWN1cml0eS1DIFByb2plY3QxEDAOBgNVBAsTB1hTRUMtQ0ExFTAT\n\ BgNVBAMTDFhTRUMtQ0EgUm9vdIIBADAJBgcqhkjOOAQDAy8AMCwCFGoKhVPnDeg9\n\ nbEFo2KDDlG/NiUqAhRJxQPLXDhehQjn6eqQWOUlkFtA9A=="; DOMDocument *createLetter(DOMImplementation *impl) { DOMDocument *doc = impl->createDocument( 0, MAKE_UNICODE_STRING("Letter"), NULL); DOMElement *rootElem = doc->getDocumentElement(); // Add the ToAddress DOMElement *addressElem = doc->createElement(MAKE_UNICODE_STRING("ToAddress")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(addressElem); addressElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("The address of the Recipient"))); // Add the FromAddress addressElem = doc->createElement(MAKE_UNICODE_STRING("FromAddress")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(addressElem); addressElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("The address of the Sender"))); // Add some text DOMElement *textElem = doc->createElement(MAKE_UNICODE_STRING("Text")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(textElem); textElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("\nTo whom it may concern, my secret \ credit card number is : \n 0123 4567 89ab cdef\n\n...\n"))); g_toEncrypt = textElem; return doc; } int main (int argc, char **argv) { try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Create a blank Document DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(MAKE_UNICODE_STRING("Core")); // Create a letter DOMDocument *doc = createLetter(impl); try { /* Create the cipher object that we need */ XSECProvider prov; XENCCipher *cipher; cipher = prov.newCipher(doc); /* Now generate a random key that we can use to encrypt the element * * First check the status of the random generation in OpenSSL */ if (RAND_status() != 1) { cerr << "OpenSSL random generation not properly initialised" << endl; exit(1); } unsigned char keyBuf[24]; if (RAND_bytes(keyBuf, 24) == 0) { cerr << "Error obtaining 24 bytes of random from OpenSSL" << endl; exit(1); } /* Wrap this in a Symmetric 3DES key */ OpenSSLCryptoSymmetricKey * key = new OpenSSLCryptoSymmetricKey(XSECCryptoSymmetricKey::KEY_3DES_192); key->setKey(keyBuf, 24); cipher->setKey(key); /* Encrypt the element that needs to be hidden */ cipher->encryptElement(g_toEncrypt, ENCRYPT_3DES_CBC); /* Now lets create an EncryptedKey element to hold the generated key */ /* First lets load the public key in the certificate */ OpenSSLCryptoX509 * x509 = new OpenSSLCryptoX509(); x509->loadX509Base64Bin(cert, (unsigned int) strlen(cert)); /* Now set the Key Encrypting Key (NOTE: Not the normal key) */ cipher->setKEK(x509->clonePublicKey()); /* Now do the encrypt, using RSA with PKCS 1.5 padding */ XENCEncryptedKey * encryptedKey = cipher->encryptKey(keyBuf, 24, ENCRYPT_RSA_15); /* * Add the encrypted Key to the previously created EncryptedData, which * we first retrieve from the cipher object. This will automatically create * the appropriate element within the EncryptedData */ XENCEncryptedData * encryptedData = cipher->getEncryptedData(); encryptedData->appendEncryptedKey(encryptedKey); } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occurred during an encryption operation\n Message: " << msg << endl; exit(1); } /* Output */ docSetup(doc); cout << doc; return 0; } xml-security-c-1.7.3/xsec/samples/simpleHMAC.cpp000644 001751 001751 00000010674 12003301053 022624 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * SimpleHMAC := An application to generate an XML document (via Xerces) and sign it * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include "IOStreamOutputter.hpp" // Xerces #include // XML-Security-C (XSEC) #include #include #include #include // Xalan #ifndef XSEC_NO_XALAN #include XALAN_USING_XALAN(XalanTransformer) #endif XERCES_CPP_NAMESPACE_USE DOMDocument *createLetter(DOMImplementation *impl) { DOMDocument *doc = impl->createDocument( 0, MAKE_UNICODE_STRING("Letter"), NULL); DOMElement *rootElem = doc->getDocumentElement(); // Add the ToAddress DOMElement *addressElem = doc->createElement(MAKE_UNICODE_STRING("ToAddress")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(addressElem); addressElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("The address of the Recipient"))); // Add the FromAddress addressElem = doc->createElement(MAKE_UNICODE_STRING("FromAddress")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(addressElem); addressElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("The address of the Sender"))); // Add some text DOMElement *textElem = doc->createElement(MAKE_UNICODE_STRING("Text")); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(textElem); textElem->appendChild(doc->createTextNode( MAKE_UNICODE_STRING("\nTo whom it may concern\n\n...\n"))); return doc; } int main (int argc, char **argv) { try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Create a blank Document DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(MAKE_UNICODE_STRING("Core")); // Create a letter DOMDocument *doc = createLetter(impl); DOMElement *rootElem = doc->getDocumentElement(); // The signature XSECProvider prov; DSIGSignature *sig; DOMElement *sigNode; try { // Create a signature object sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); // Use it to create a blank signature DOM structure from the doc sigNode = sig->createBlankSignature(doc, CANON_C14N_COM, SIGNATURE_HMAC, HASH_SHA1); // Inser the signature DOM nodes into the doc rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); rootElem->appendChild(sigNode); rootElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("\n"))); // Create an envelope reference for the text to be signed DSIGReference * ref = sig->createReference(MAKE_UNICODE_STRING("")); ref->appendEnvelopedSignatureTransform(); // Set the HMAC Key to be the string "secret" OpenSSLCryptoKeyHMAC * hmacKey = new OpenSSLCryptoKeyHMAC(); hmacKey->setKey((unsigned char *) "secret", (unsigned int) strlen("secret")); sig->setSigningKey(hmacKey); // Add a KeyInfo element sig->appendKeyName(MAKE_UNICODE_STRING("The secret key is \"secret\"")); // Sign sig->sign(); } catch (XSECException &e) { cerr << "An error occured during a signature load\n Message: " << e.getMsg() << endl; exit(1); } // Output docSetup(doc); cout << doc; return 0; } xml-security-c-1.7.3/xsec/samples/simpleValidate.cpp000644 001751 001751 00000017063 12003301053 023644 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * simpleValidate := An application to validate an in-memory signature * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include "IOStreamOutputter.hpp" // XML-Security-C (XSEC) #include #include #include #include #include #include // Xerces #include #include #include XERCES_CPP_NAMESPACE_USE #ifndef XSEC_NO_XALAN // Xalan #include XALAN_USING_XALAN(XalanTransformer) #endif char docToValidate [4096] = "\ \n\ Widgets.Org\n\ A large widget\n\ $16.50\n\ 16 January 2010\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ n+6y945h/SvlVF9qBq+Lb4TrcOI=\n\ \n\ \n\ OmToLo8uEnK37nCFXDiZwgcsZGJ0aZ4AyECUy78DL91AHRRWdjllSQ==\n\ \n\ \n\ C=AU, ST=Vic, O=XML-Security-C Project, CN=Samples Demo Certificate\n\ \n\ \n\ \n\ \n"; char cert[] = "\n\ MIIEETCCA9GgAwIBAgICEAEwCQYHKoZIzjgEAzB5MQswCQYDVQQGEwJBVTEMMAoG\n\ A1UECBMDVmljMRIwEAYDVQQHEwlNZWxib3VybmUxHzAdBgNVBAoTFlhNTC1TZWN1\n\ cml0eS1DIFByb2plY3QxEDAOBgNVBAsTB1hTRUMtQ0ExFTATBgNVBAMTDFhTRUMt\n\ Q0EgUm9vdDAeFw0wMjExMDUwMzE1NDFaFw0wMzExMDUwMzE1NDFaMF8xCzAJBgNV\n\ BAYTAkFVMQwwCgYDVQQIEwNWaWMxHzAdBgNVBAoTFlhNTC1TZWN1cml0eS1DIFBy\n\ b2plY3QxITAfBgNVBAMTGFNhbXBsZXMgRGVtbyBDZXJ0aWZpY2F0ZTCCAbgwggEs\n\ BgcqhkjOOAQBMIIBHwKBgQDj1jBku/y6COfkxmHMLS1behxr3ah8sFAk71EyuXLy\n\ 2Ony989WUc52/5M3nNY9E/75KB3uKNcrnGY8Tfw85Wrehv7jSImCuxljtnomABTj\n\ 9LBuGL9TfYBNBJI/0jNR0GOo0kQphoKFOvldtRIwRmtU5Mcamg9e5FOEjYJCSah5\n\ rwIVAOzWxorDrF4uwMIC/ss6PfibdNgHAoGBANLAOsJjpBQx43DgnNSkVJ518Tqz\n\ IHKpg9crAsCRd+Keipt/tVnOTA29uJZMo2wUSGC8Vj7tlreMJtxDUnLcRdX6EZwj\n\ WR9nBhLpzClndctjjLF5IkzCechQk7CNKmO2Z2gaD6K/hdfMixF/LH/1iHeYjTNZ\n\ vAhcExd1PRpV0207A4GFAAKBgQDNS3VPzSAL+I71/0EneTxLIyvAlROjnLVDd5LT\n\ vEAorjepo8v5/qgXNK4O32NlNZxSOD612Mr1Q8sLYDnx006t8x01A7St8f/jcd9y\n\ dIIomKMEs2hwahHt8p/jFdRJNXFFe4gQ2DM2cKRhZTEuL9qpv2AnPIIlGqnrlo1L\n\ o4gDb6OCAQEwgf4wCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH\n\ ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFA7Em1VK6/7qc88l7n8JnIOT\n\ QEArMIGjBgNVHSMEgZswgZiAFBKNX9CsAIsjUIFmVq4wE4wlOGC5oX2kezB5MQsw\n\ CQYDVQQGEwJBVTEMMAoGA1UECBMDVmljMRIwEAYDVQQHEwlNZWxib3VybmUxHzAd\n\ BgNVBAoTFlhNTC1TZWN1cml0eS1DIFByb2plY3QxEDAOBgNVBAsTB1hTRUMtQ0Ex\n\ FTATBgNVBAMTDFhTRUMtQ0EgUm9vdIIBADAJBgcqhkjOOAQDAy8AMCwCFDA7nNZe\n\ C6gSs+N7RRq7vLmx/IjjAhRJvfPZ/hvoN8fNpTmRoHtuzkSjcQ=="; int main (int argc, char **argv) { try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Use xerces to parse the document XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); parser->setDoSchema(true); // Create an input source MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) docToValidate, (unsigned int) strlen(docToValidate), "XSECMem"); xsecsize_t errorCount = 0; parser->parse(*memIS); errorCount = parser->getErrorCount(); if (errorCount > 0) { cerr << "Error parsing input document\n"; exit (1); } DOMDocument *doc = parser->getDocument(); // Find the Amount node DOMNode *amt = doc->getDocumentElement(); if (amt != NULL) amt = amt->getFirstChild(); while (amt != NULL && (amt->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(amt->getNodeName(), "Amount"))) amt = amt->getNextSibling(); if (amt != NULL) amt = amt->getFirstChild(); if (amt == NULL || amt->getNodeType() != DOMNode::TEXT_NODE) { cerr << "Error finding amount in purchase order" << endl; exit (1); } docSetup(doc); // Now create a signature object to validate the document XSECProvider prov; DSIGSignature * sig = prov.newSignatureFromDOM(doc); try { // Use the OpenSSL interface objects to get a signing key OpenSSLCryptoX509 * x509 = new OpenSSLCryptoX509(); x509->loadX509Base64Bin(cert, (unsigned int) strlen(cert)); sig->load(); DSIGKeyInfoList * kinfList = sig->getKeyInfoList(); // See if we can find a Key Name const XMLCh * kname; DSIGKeyInfoList::size_type size, i; size = kinfList->getSize(); for (i = 0; i < size; ++i) { kname = kinfList->item(i)->getKeyName(); if (kname != NULL) { char * n = XMLString::transcode(kname); cout << "Key Name = " << n << endl; XSEC_RELEASE_XMLCH(n); } } sig->setSigningKey(x509->clonePublicKey()); cout << "Amount = " << amt << " -> "; if (sig->verify()) { cout << "Signature Valid\n"; } else { char * err = XMLString::transcode(sig->getErrMsgs()); cout << "Incorrect Signature\n"; cout << err << endl; XSEC_RELEASE_XMLCH(err); } amt->setNodeValue(MAKE_UNICODE_STRING("$0.50")); cout << "Amount = " << amt << " -> "; if (sig->verify()) { cout << "Signature Valid\n"; } else { char * err = XMLString::transcode(sig->getErrMsgs()); cout << "Incorrect Signature\n"; cout << err << endl; XSEC_RELEASE_XMLCH(err); } amt->setNodeValue(MAKE_UNICODE_STRING("$16.50")); cout << "Amount = " << amt << " -> "; if (sig->verify()) { cout << "Signature Valid\n"; } else { char * err = XMLString::transcode(sig->getErrMsgs()); cout << "Incorrect Signature\n"; cout << err << endl; XSEC_RELEASE_XMLCH(err); } } catch (XSECException &e) { cerr << "An error occured during a signature load\n Message: " << e.getMsg() << endl; exit(1); } catch (XSECCryptoException &e) { cerr << "An error occured in the XML-Security-C Crypto routines\n Message: " << e.getMsg() << endl; exit(1); } // Clean up delete memIS; delete parser; return 0; } xml-security-c-1.7.3/xsec/enc/NSS/000755 001751 001751 00000000000 12477614644 017766 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/enc/OpenSSL/000755 001751 001751 00000000000 12477614644 020606 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/enc/WinCAPI/000755 001751 001751 00000000000 12477614645 020516 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/enc/XSCrypt/000755 001751 001751 00000000000 12477614644 020677 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/enc/XSECCryptoKeyHMAC.hpp000644 001751 001751 00000005304 12003301053 023047 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyHMAC := HMAC Keys * * Author(s): Berin Lautenbach * * $Id: XSECCryptoKeyHMAC.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOKEYHMAC_INCLUDE #define XSECCRYPTOKEYHMAC_INCLUDE #include #include /** * \ingroup crypto */ /** * \brief Interface class for HMAC keys. * * The library uses classes derived from this to process HMAC keys. */ class DSIG_EXPORT XSECCryptoKeyHMAC : public XSECCryptoKey { public : /** @name Constructors and Destructors */ //@{ XSECCryptoKeyHMAC() {}; virtual ~XSECCryptoKeyHMAC() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For DSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_HMAC;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const = 0; //@} /** @name Optional Interface methods * * These functions do not necessarily have to be implmented. They * are used by XSECKeyInfoResolverDefault to try to create a key from * KeyInfo elements without knowing anything else. * * If an interface class does not implement these functions, a simple * stub that does nothing should be used. */ //@{ /** * \brief Set the key * * Set the key from the buffer * * @param inBuf Buffer containing the key * @param inLength Number of bytes of key in the buffer */ virtual void setKey(unsigned char * inBuf, unsigned int inLength) = 0; /** * \brief Get the key value * * Copy the key into the safeBuffer and return the number of bytes * copied. * * @param outBuf Buffer to copy key into * @returns number of bytes copied in */ virtual unsigned int getKey(safeBuffer &outBuf) const = 0; //@} }; #endif /* XSECCRYPTOKEYHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoX509.hpp000644 001751 001751 00000007126 12003301053 022337 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoX509:= A base class for handling X509 (V3) certificates * * Author(s): Berin Lautenbach * * $Id: XSECCryptoX509.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOX509_INCLUDE #define XSECCRYPTOX509_INCLUDE #include #include #include /** * \brief Interface class for X509 certificates. * @ingroup crypto * * The library uses classes derived from this to process X509 Certificates. * * Strictly speaking, this class is not required (and is completely * Optional. However it is used by * XSECKeyInfoResolverDefault to extract a key from a certificate in cases * where the caller is not worried about the trust level of the certificate. * */ class DSIG_EXPORT XSECCryptoX509 { public : /** @name Constructors and Destructors */ //@{ XSECCryptoX509() {}; virtual ~XSECCryptoX509() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of the key stored in the certificate. * * The implementation is expected to extract the key from the * certificate and determine the type. * */ virtual XSECCryptoKey::KeyType getPublicKeyType() const = 0; /** * \brief Get a copy of the public key. * * The implementation should extract the key from the certificate, * create an instance of the appropriate key type, and return it. * */ virtual XSECCryptoKey * clonePublicKey() const = 0; /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const = 0; //@} /** @name Load and Get the certificate */ //@{ /** * \brief Load a certificate into the object. * * Take a base64 DER encoded certificate and load. * * @param buf A buffer containing the Base64 encoded certificate * @param len The number of bytes of data in the certificate. */ virtual void loadX509Base64Bin(const char * buf, unsigned int len) = 0; /** * \brief Load a PEM encoded certificate into the object. * * Take a PEM encoded certificate and load. * * @param buf A buffer containing the PEM encoded certificate * @param len The number of bytes of data in the certificate. * (0 if the string is null terminated.) */ void loadX509PEM(const char * buf, unsigned int len = 0); /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual safeBuffer &getDEREncodingSB(void) = 0; // Get the DER string /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual const safeBuffer &getDEREncodingSB(void) const = 0; // Get the DER string //@} }; #endif /* XSECCRYPTOX509_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoKeyDSA.hpp000644 001751 001751 00000011215 12003301053 022744 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyDSA := DSA Keys * * Author(s): Berin Lautenbach * * $Id: XSECCryptoKeyDSA.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOKEYDSA_INCLUDE #define XSECCRYPTOKEYDSA_INCLUDE #include /** * \ingroup crypto */ /** * \brief Interface class for DSA keys. * * The library uses classes derived from this to process DSA keys. */ class DSIG_EXPORT XSECCryptoKeyDSA : public XSECCryptoKey { public : /** @name Constructors and Destructors */ //@{ XSECCryptoKeyDSA() {}; virtual ~XSECCryptoKeyDSA() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For DSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_NONE;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const = 0; //@} /** @name Mandatory DSA interface methods * * These methods are required by the library. */ //@{ /** * \brief Verify a signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) = 0; /** * \brief Create a signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature is required to * be Base64 encoded such that it can be placed directly into the * XML document * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) = 0; //@} /** @name Optional Interface methods * * These functions do not necessarily have to be implmented. They * are used by XSECKeyInfoResolverDefault to try to create a key from * KeyInfo elements without knowing anything else. * * If an interface class does not implement these functions, a simple * stub that does nothing should be used. */ //@{ /** * \brief Load P * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadPBase64BigNums(const char * b64, unsigned int len) = 0; /** * \brief Load Q * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadQBase64BigNums(const char * b64, unsigned int len) = 0; /** * \brief Load G * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadGBase64BigNums(const char * b64, unsigned int len) = 0; /** * \brief Load Y * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadYBase64BigNums(const char * b64, unsigned int len) = 0; /** * \brief Load J * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadJBase64BigNums(const char * b64, unsigned int len) = 0; //@} }; #endif /* XSECCRYPTOKEYDSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoKeyEC.hpp000644 001751 001751 00000010075 12003301053 022627 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyEC := EC Keys * * Author(s): Scott Cantor * * $Id:$ * */ #ifndef XSECCRYPTOKEYEC_INCLUDE #define XSECCRYPTOKEYEC_INCLUDE #include /** * \ingroup crypto */ /** * \brief Interface class for RSA keys. * * The library uses classes derived from this to process RSA keys. */ class DSIG_EXPORT XSECCryptoKeyEC : public XSECCryptoKey { public : /** @name Constructors and Destructors */ //@{ XSECCryptoKeyEC() {}; virtual ~XSECCryptoKeyEC() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For EC keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_NONE;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const = 0; //@} /** @name Mandatory EC interface methods * * These methods are required by the library. */ //@{ /** * \brief Verify an EC-DSA signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) = 0; /** * \brief Create an EC-DSA signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature is required to * be Base64 encoded such that it can be placed directly into the * XML document * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) = 0; //@} /** @name Optional Interface methods * * These functions do not necessarily have to be implmented. They * are used by XSECKeyInfoResolverDefault to try to create a key from * KeyInfo elements without knowing anything else. * * If an interface class does not implement these functions, a simple * stub that does nothing should be used. */ //@{ /** * \brief Load the key * * Load the key for a named curve from a Base64 encoded string * * param curveName a URI identifying the curve (typically an OID URN) * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicKeyBase64(const char* curveName, const char* b64, unsigned int len) = 0; //@} }; #endif /* XSECCRYPTOKEYEC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECKeyInfoResolver.hpp000644 001751 001751 00000005506 12003301053 023557 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECKeyInfoResolver := Virtual interface class for applications * to map KeyInfo to keys * * Author(s): Berin Lautenbach * * $Id: XSECKeyInfoResolver.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECKEYINFORESOLVER_INCLUDE #define XSECKEYINFORESOLVER_INCLUDE #include #include #include /** * @ingroup interfaces */ /*\@{*/ /** * @brief Interface class for providing keys to the library. * * The XSEC library does not perform actual mapping of KeyInfo * elements to encryption keys. (In some cases a KeyInfo might * not even be provided). * * This interface class allows the application to perform this * key mapping and provision function. Applications can perform * whatever steps are necessary to determine the appropriate key * and what trust level it might have. * */ class DSIG_EXPORT XSECKeyInfoResolver { public : /** @name Constructors and Destructors */ //@{ XSECKeyInfoResolver() {}; virtual ~XSECKeyInfoResolver() {}; //@} /** @name Mandatory Interface Functions */ //@{ /** * \brief Provide a key to the library * * The library will pass the KeyInfoList to the resolver * which then needs to provide a key back to the library. * The key may have absolutely no relationship to the KeyInfoList * (which is only supposed to provide a hint). * * If no KeyInfo elements were provided in the Signature, * NULL will be passed in. * * @param lst The list of KeyInfo elements from the signature * @returns Either the appropriate key or NULL if none can be found */ virtual XSECCryptoKey * resolveKey(DSIGKeyInfoList * lst) = 0; /** * \brief Clone the resolver to be installed in a new object. * * When KeyInfoResolvers are passed into signatures and other * objects, they are cloned and control of the original object * is left with the caller. * */ virtual XSECKeyInfoResolver * clone(void) const = 0; //@} /*\@}*/ }; #endif /* XSECKEYINFORESOLVER_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoHash.hpp000644 001751 001751 00000010010 12003301053 022537 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoProvider := Base virtual class to define a hash algorithm * * Author(s): Berin Lautenbach * * $Id: XSECCryptoHash.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOHASH_INCLUDE #define XSECCRYPTOHASH_INCLUDE #include #include #define XSEC_MAX_HASH_SIZE 256 /* Max size of any expected hash algorithms (oversized) */ #define XSEC_MAX_HASH_BLOCK_SIZE 64 /* Max size of blocks used - MD5 and SHA1 are both 64 bytes*/ /** * @ingroup crypto */ /** * \brief Interface definition for Hash functions. * * The XSECCryptoHash function is used by the library to manipulate * Hashing (Digest) functions. * * It is also used as the base class for HMAC functions, and thus has * a #setKey() method. * * @todo bring the interface here in-line with that provided for * XSECCryptoBase64 - really should have only one way of calling these * kinds of objects. * */ class DSIG_EXPORT XSECCryptoHash { public : /** * \brief Enumeration of Hash (Digest) types * * The hash types known to XSEC */ enum HashType { HASH_NONE = 0, HASH_SHA1 = 1, HASH_MD5 = 2, HASH_SHA224 = 3, HASH_SHA256 = 4, HASH_SHA384 = 5, HASH_SHA512 = 6 }; // Constructors/Destructors XSECCryptoHash() {}; virtual ~XSECCryptoHash() {}; /** @name Digest/Hash functions */ //@{ /** * \brief Rest the hash function * * XSEC will call the #reset() function prior to re-using a CryptoHash * object. */ virtual void reset(void) = 0; // Reset the hash /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length) = 0; /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes) * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength) = 0;// Finish and get hash //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const = 0; //@} /** @name HMAC Functions */ //@{ /** *\brief * * The HMAC classes are treated in the library as standard hash * objects that just happen to take a key. Thus all hash functions * implement this function (potentially just to throw an exception) * * Sets the key - which needs to have a base class of * XSECCryptoKeyHMAC. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key) = 0; //@} }; #endif /* XSECCRYPTOHASH_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoBase64.hpp000644 001751 001751 00000014244 12003301053 022715 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoBase64 := Base virtual class to define a base64 encoder/decoder * * Author(s): Berin Lautenbach * * $Id: XSECCryptoBase64.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOBASE64_INCLUDE #define XSECCRYPTOBASE64_INCLUDE #include /** * @ingroup crypto */ /*\@{*/ /** * \brief Base64 encode/decode handler interface class. * *

The XSEC library will use implementations of this interface * for translating bytes to/from base64 encoding.

* *

There are many places where XML DSIG uses Base64 encoding for * embedding data in the \ structure. In some cases this object * is used. In other cases, the library passes base64 code directly to * the cryptographic handler.

* * @note The library may re-use Base64 objects. However it will always * call the ??Init function prior to re-use. In addtion, the object does * not need to be able to handle concurrent encode/decode operations. */ class DSIG_EXPORT XSECCryptoBase64 { public : // Constructors/Destructors XSECCryptoBase64() {}; virtual ~XSECCryptoBase64() {}; /** @name Decoding Functions */ //@{ /** * \brief Initialise the base64 object. * * The XSEC library will always call this function prior * to decoding any data. This function will also be called when * one decode (or encode) has been completed and the library wishes * to re-use the object for another decode operation. * */ virtual void decodeInit(void) = 0; /** * \brief Decode some passed in data. * *

The XSEC library will pass a block of data into the decoder * and request that as much as possible be decoded into the outData * buffer.

* *

Due to the nature of base64, there may be data that cannot be * fully decoded (not enough encoding through yet). The implementation * is expected to keep this in memory until another call to #decode() * or a call to #decodeFinish().

* * @param inData Pointer to the buffer holding encoded data. * @param inLength Length of the encoded data in the buffer * @param outData Buffer to place decoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int decode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) = 0; /** * \brief Finish off a decode. * *

The library will call this when there is no more base64 data for * the current decode.

* * @param outData Buffer to place any remaining decoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int decodeFinish(unsigned char * outData, unsigned int outLength) = 0; //@} /** @name Encoding Functions */ //@{ /** * \brief Initialise the base64 object for encoding * * The XSEC library will always call this function prior * to encoding any data. This function will also be called when * one encode (or decode) has been completed and the library wishes * to re-use the object for another encode operation. * */ virtual void encodeInit(void) = 0; /** * \brief Encode some passed in data. * *

The XSEC library will pass a block of data into the Encoder * and request that as much as possible be encoded into the outData * buffer.

* *

Due to the nature of the implementation, there may be data * that cannot be * fully encoded (not enough data through yet). The implementation * is expected to keep this in memory until another call to #encode() * or a call to #encodeFinish().

* * @param inData Pointer to the buffer holding data to be encoded. * @param inLength Length of the data in the buffer * @param outData Buffer to place encoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int encode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) = 0; /** * \brief Finish off an encode. * *

The library will call this when there is no more data for * the current encode operation.

* * @param outData Buffer to place any remaining encoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int encodeFinish(unsigned char * outData, unsigned int outLength) = 0; //@} /** @name Utility functions */ //@{ /** * \brief Clean a buffer of base64 text * * Creates a new copy of the passed in buffer with new lines in * accord with the MIME standard. * * @param buffer The buffer of base64 text to clean * @param bufLen The number of characters to clean in the buffer (0 for strlen) * @param retBufLen The number of characters placed in the cleaned buffer * @returns A clean version of the buffer * @note This is NOT re-implemented in any of the crypto interfaces. It is * a Base64 utility function only. */ static char * cleanBuffer(const char * buffer, unsigned int bufLen, unsigned int &retBufLen); //@} }; /*\@}*/ #endif /* XSECCRYPTOBASE64_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoSymmetricKey.hpp000644 001751 001751 00000022222 12003301053 024311 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Berin Lautenbach * * $Id: XSECCryptoSymmetricKey.hpp 1352680 2012-06-21 20:58:07Z scantor $ * */ #ifndef XSECCRYPTOSYMMETRICKEY_INCLUDE #define XSECCRYPTOSYMMETRICKEY_INCLUDE #include #include #include /** * \ingroup crypto */ /** * \brief Base interface definition for symmetric key material. * * All symmetric algorithms are implemented via this interface. * Unlike the asymmetric key definitions, this is not further * extended for particular algorithms. Rather it defines * encrypt/decrypt functions that are implemented within particular * providers for a particular algorithm. */ class DSIG_EXPORT XSECCryptoSymmetricKey : public XSECCryptoKey { public : /** * \brief Symmetric Key types understood by the library * * This type defines the list of symmetric key types that the library * understands. */ enum SymmetricKeyType { KEY_NONE, KEY_3DES_192, /** 192 bit (3-Key) 3DES */ KEY_AES_128, /** 128 bit AES */ KEY_AES_192, /** 192 bit AES */ KEY_AES_256 /** 256 bit AES */ }; enum SymmetricKeyMode { MODE_NONE, /** An error condition */ MODE_ECB, /** Electronic Code Book */ MODE_CBC, /** Cipher Block Chaining */ MODE_GCM /** Galois-Counter Mode */ }; /** @name Constructors and Destructors */ //@{ /** * \brief Constructor **/ XSECCryptoSymmetricKey() {}; /** * \brief Destructor * * Implementations must ensure that the held key is properly destroyed * (overwritten) when key objects are deleted. */ virtual ~XSECCryptoSymmetricKey() {}; //@} /** @name Basic CryptoKey Interface methods */ //@{ /** * \brief Returns the type of this key. */ virtual KeyType getKeyType() const {return KEY_SYMMETRIC;} /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const = 0; /** * \brief Clone the key * * All keys need to be able to copy themselves and return * a pointer to the copy. This allows the library to * duplicate keys. */ virtual XSECCryptoKey * clone() const = 0; //@} /** @name Symmetric key interface methods */ //@{ /** * \brief What type of symmetric key is this? * * There are a number of different types of symmetric key. * This method allows callers to determine the type of this * particular key */ virtual SymmetricKeyType getSymmetricKeyType(void) const = 0; /** * \brief Set the key from the provided bytes * * Symmetric keys can all be loaded from a buffer containing a series * of bytes. * * @param key The buffer containing the key bytes * @param keyLen The number of key bytes in the buffer * */ virtual void setKey(const unsigned char * key, unsigned int keyLen) = 0; /** * \brief Initialise an decryption process * * Setup the key to get ready for a decryption session. * * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations should assume that the start of the * cipher text stream will in fact be the IV. * * Callers may need to pass a tag to fully initialise an * authenticated encryption algorithm. If a tag is not * supplied, the caller can obtain the length of the required * tag instead, and call this method again once the tag is * obtained. * * @param doPad By default, we perform padding for last block * @param mode mode selection, default is CBC * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV will be set from data stream * @param tag Authentication tag to be used for AEAD ciphers * @param taglen length of Authentication Tag * @returns true if the initialisation succeeded. */ virtual bool decryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char* iv = NULL, const unsigned char* tag = NULL, unsigned int taglen = NULL) = 0; /** * \brief Continue a decrypt operation using this key. * * Decryption must have been set up using a decryptInit * call. Takes the inBuf and continues a decryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be decrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * cipher-text to be handles during the next operation. * * @param inBuf Octets to be decrypted * @param plainBuf Buffer to place output in * @param inLength Number of bytes to decrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength) = 0; /** * \brief Finish a decryption operation * * Complete a decryption process. No cipher text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer. * * May throw an exception if there is some stored cipher text * that is not the length of the block size for block algorithms. * * @param plainBuf Buffer to place any remaining plain text in * @param maxOutLength Maximum number of bytes to pace in output * @returns Bytes placed in output buffer */ virtual unsigned int decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength) = 0; /** * \brief Initialise an encryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations are required to generate one. * * @param doPad By default, we perform padding for last block * @param mode What mode to handle blocks. default is CBC * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV is to be generated * @returns true if the initialisation succeeded. */ virtual bool encryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL) = 0; /** * \brief Continue an encryption operation using this key. * * Encryption must have been set up using an encryptInit * call. Takes the inBuf and continues a encryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be encrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * plain-text to be handled during the next operation. * * @param inBuf Octets to be encrypted * @param cipherBuf Buffer to place output in * @param inLength Number of bytes to encrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength) = 0; /** * \brief Finish an encryption operation * * Complete an encryption process. No plain text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer and creating a final padded block. * * Padding is performed by taking the remaining block, and * setting the last byte to equal the number of bytes of * padding. If the plain was an exact multiple of the block size, * then an extra block of padding will be used. For example, if * the block size is 8 bytes, and there were three remaining plain * text bytes (0x01, 0x02 and 0x03), the final block will be : * * 0x010203????????05 * * @param plainBuf Buffer to place final block of cipher text in * @param maxOutLength Maximum number of bytes to pace in output * @param taglen length of Authentication Tag * @returns Bytes placed in output buffer */ virtual unsigned int encryptFinish(unsigned char * plainBuf, unsigned int maxOutLength, unsigned int taglen = 0) = 0; //@} }; #endif /* XSECCRYPTOSYMMETRICKEY_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoKey.hpp000644 001751 001751 00000005501 12003301053 022415 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKey := Container class to hold cryptographic keys * Should be re-implemented by all providers as the base class * for all keys * * Author(s): Berin Lautenbach * * $Id: XSECCryptoKey.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOKEY_INCLUDE #define XSECCRYPTOKEY_INCLUDE #include #include /** * \ingroup crypto */ /** * \brief Base interface class for key material. * * All keys used for signing and encrypting are derived from this * base interface class. There are no methods for performing * cryptographic functions, as this is a base class used to allow * the library to pass key material to various objects without * knowing how to directly use it. */ class DSIG_EXPORT XSECCryptoKey { public : /** * \brief Key types understood by the library * * This type defines the list of key types that the library * understands. */ enum KeyType { KEY_NONE, KEY_DSA_PUBLIC, KEY_DSA_PRIVATE, KEY_DSA_PAIR, KEY_RSA_PUBLIC, KEY_RSA_PRIVATE, KEY_RSA_PAIR, KEY_HMAC, KEY_SYMMETRIC, KEY_EC_PUBLIC, KEY_EC_PRIVATE, KEY_EC_PAIR }; /** @name Constructors and Destructors */ //@{ /** * \brief Constructor **/ XSECCryptoKey() {}; /** * \brief Destructor * * Implementations must ensure that the held key is properly destroyed * (overwritten) when key objects are deleted. */ virtual ~XSECCryptoKey() {}; //@} /** @name Interface classes */ //@{ /** * \brief Returns the type of this key. */ virtual KeyType getKeyType() const {return KEY_NONE;} /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const = 0; /** * \brief Clone the key * * All keys need to be able to copy themselves and return * a pointer to the copy. This allows the library to * duplicate keys. */ virtual XSECCryptoKey * clone() const = 0; //@} }; #endif /* XSECCRYPTOKEY_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoProvider.hpp000644 001751 001751 00000026717 12003301053 023473 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoProvider := Base virtual class to define a crpyto module * * Author(s): Berin Lautenbach * * $Id: XSECCryptoProvider.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOPROVIDER_INCLUDE #define XSECCRYPTOPROVIDER_INCLUDE #include #include #include #include #include #include #include #include #include /** * @defgroup crypto Cryptographic Abstraction Layer *

The interface layer between the cryptographic modules and the XML * Security library. It has been created to allow users to easily * integrate other cryptographic libraries into the XML-Security * library.

* *

The XML-Security-C library itself makes calls to this interface * layer to perform all cryptographic procedures. In order to * instantiate the correct object (i.e. the object * that belongs to the correct crypto library), XSEC makes calls to * the virtual class XSECCryptoProvider, which returns pointers to * particular virtual class objects.

* *

The cryptographic interface has been kept as thin as possible. * The classes are not meant to provide a complete * wrapper for the cryptographic libraries involved. The application * program is expected to deal directly with the chosen library. This * ensures that the xml-security library can perform the functions it * needs to, but does not constrain the application in what it can do.

* *

Therefore, three type of methods are available on any cryptographic * class.

* *
    *
  • Required methods are those absolutely necessary for * the library to operate. For example, these include the methods * necessary for the library to decode a base64 encoded signature * and validate it against a defined key.
  • *
  • Optional methods are used by the ancillary classes * in the library. For example, the default KeyInfoResolver can * use an optional method to extract a public key from a certificate. * This is not strictly necessary, as the calling application could * provide a resolver that does this work directly rather than using * the XSECCryptoX509 class.
  • *
  • Library Specific methods are those methods that are * unique to a particular library. For example, the OpenSSLCryptoX509 * class has a Library Specific constructor that takes an OpenSSL * X509 structure as its argument.
  • *
* *

Unless marked otherwise, all methods defined in the XSECCrypto* * classes are Required.

* *

The particular instantiation of XSECCryptoProvider that is to * be used is set via the XSECPlatformUtils#Initialise() function * call. If no provider is passed in, the Initialise function * generates an OpenSSLCryptoProvider class for use. If OpenSSL * is not available under windows, the library will use the Windows * CAPI instead.

* *

The provider is kept in a global variable, and is used by * all signature objects created by a particular application. At * this time there is no way to have different signature * objects use different CryptoProviders

* * @todo Add an ability to better handle "optional" functions. The library * should make a call to the * provider to see whether an optional function (e.g. extract key from * X509) has been * provided. * * *\@{*/ // Some constants /** *\brief Maximum length (in bytes) of any expected Digest results. * * This constant defines the maximum length (in bytes) of HASH returns. * We have defined it far and above the size we would normally expect. * * @todo This should really come from each of the providers and should * be implemented as a function call to *CryptoProvider */ #define CRYPTO_MAX_HASH_SIZE 128 /** *\brief OID For DSA */ #define CRYPTO_OID_DSA "1.2.840.10040.4.1" /** *\brief The base class that all *CryptoProviders need to implement. * * The instatiations of this class are used by the core library to * create cryptographic objects necessary for the library to do its work * without actually knowing any details at all about the provider library * * @note Subject to change * @see OpenSSLCryptoProvider */ class DSIG_EXPORT XSECCryptoProvider { public : /** @name Constructors and Destructors */ //@{ XSECCryptoProvider() {}; virtual ~XSECCryptoProvider() {}; //@} /** @name Hashing (Digest) Functions */ //@{ /** * \brief Return a SHA1 implementation. * * Call used by the library to obtain a SHA1 object from the * provider. * * @returns A pointer to a Hash object that implements SHA1 * @see XSECCryptoHash * @deprecated Use hashSHA instead */ virtual XSECCryptoHash * hashSHA1() const = 0; /** * \brief Return a SHA implementation. * * Call used by the library to obtain a SHA object from the * provider. Size of hash determined by length argument (160 = SHA1) * * @returns A pointer to a Hash object that implements SHA1 * @param length - length of hash. E.g. 160 for SHA1 or 256 for SHA256 * @see XSECCryptoHash */ virtual XSECCryptoHash * hashSHA(int length = 160) const = 0; /** * \brief Return a HMAC SHA1 implementation. * * Call used by the library to obtain a HMAC SHA1 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @see XSECCryptoHash * @deprecated use hashHMACSHA instead */ virtual XSECCryptoHash * hashHMACSHA1() const = 0; /** * \brief Return a HMAC SHA(1-512) implementation. * * Call used by the library to obtain a HMAC SHA object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @param length Length of hash output (160 = SHA1, 256, 512 etc) * @see XSECCryptoHash */ virtual XSECCryptoHash * hashHMACSHA(int length = 160) const = 0; /** * \brief Return a MD5 implementation. * * Call used by the library to obtain a MD5 object from the * provider. * * @returns A pointer to a Hash object that implements MD5 * @see XSECCryptoHash */ virtual XSECCryptoHash * hashMD5() const = 0; /** * \brief Return a HMAC MD5 implementation. * * Call used by the library to obtain a HMAC MD5 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @note The use of MD5 is explicitly marked as not recommended * in the XML Digital Signature standard due to recent advances in * cryptography indicating there may be weaknesses in the * algorithm. * * @returns A pointer to a Hash object that implements HMAC-MD5 * @see XSECCryptoHash */ virtual XSECCryptoHash * hashHMACMD5() const = 0; /** * \brief Return a HMAC key * * Sometimes the library needs to create an HMAC key (notably within * the XKMS utilities. * * This function allows the library to obtain a key that can then have * a value set within it. */ virtual XSECCryptoKeyHMAC * keyHMAC() const = 0; //@} /** @name Encoding functions */ //@{ /** * \brief Return a Base64 encoder/decoder implementation. * * Call used by the library to obtain a Base64 encoder/decoder. * * @returns Pointer to the new Base64 encoder. * @see XSECCryptoBase64 */ virtual XSECCryptoBase64 * base64() const = 0; //@} /** @name Keys and Certificates */ //@{ /** * \brief Return a DSA key implementation object. * * Call used by the library to obtain a DSA key object. * * @returns Pointer to the new DSA key * @see XSECCryptoKeyDSA */ virtual XSECCryptoKeyDSA * keyDSA() const = 0; /** * \brief Return an RSA key implementation object. * * Call used by the library to obtain an RSA key object. * * @returns Pointer to the new RSA key * @see XSECCryptoKeyRSA */ virtual XSECCryptoKeyRSA * keyRSA() const = 0; /** * \brief Return an EC key implementation object. * * Call used by the library to obtain an EC key object. * * @returns Pointer to the new EC key * @see XSECCryptoKeyEC */ virtual XSECCryptoKeyEC * keyEC() const; /** * \brief Return a key implementation object based on DER-encoded input. * * Call used by the library to obtain a key object from a DER-encoded key. * * @param buf DER-encoded data * @param buflen length of data * @param base64 true iff data is base64-encoded * @returns Pointer to the new key * @see XSECCryptoKey */ virtual XSECCryptoKey * keyDER(const char* buf, unsigned long buflen, bool base64) const; /** * \brief Return an X509 implementation object. * * Call used by the library to obtain an object that can work * with X509 certificates. * * @returns Pointer to the new X509 object * @see XSECCryptoX509 */ virtual XSECCryptoX509 * X509() const = 0; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * symmetric algorithm is supported */ virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const = 0; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * digest algorithm is supported */ virtual bool algorithmSupported(XSECCryptoHash::HashType alg) const = 0; /** * \brief Return a Symmetric Key implementation object. * * Call used by the library to obtain a bulk encryption * object. * * @returns Pointer to the new SymmetricKey object * @see XSECCryptoSymmetricKey */ virtual XSECCryptoSymmetricKey * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const = 0; /** * \brief Obtain some random octets * * For generation of IVs and the like, the library needs to be able * to obtain "random" octets. The library uses this call to the * crypto provider to obtain what it needs. * * @param buffer The buffer to place the random data in * @param numOctets Number of bytes required * @returns Number of bytes obtained. */ virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets) const = 0; //@} /** @name Information Functions */ //@{ /** * \brief Returns a string that identifies the Crypto Provider */ virtual const XMLCh * getProviderName() const = 0; //@} /*\@}*/ }; #endif /* XSECCRYPTOPROVIDER_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECKeyInfoResolverDefault.hpp000644 001751 001751 00000005535 12003301053 025066 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECKeyInfoResolverDefault := Default (very basic) class for applications * to map KeyInfo to keys * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #ifndef XSECKEYINFORESOLVERDEFAULT_INCLUDE #define XSECKEYINFORESOLVERDEFAULT_INCLUDE #include /** * @ingroup interfaces */ /*\@{*/ /** * @brief A basic class for mapping KeyInfo elements to Keys. * * This class is provides a method for applications to extract * keys from KeyInfo elements that have a public key embedded. * * The class makes use of the makeKey() method available in all * keyInfo elements. (Which in turn relies on the clone*Key * methods available from the Encryption provider - these may * not be available, so this class may not work well in these * cases.) * * @note This class is very basic. It does not validate * the trustworthyness of the key in any way. It simply reads * the key from the first KeyInfo element that actually holds it * and returns the result (or NULL) if none is found. It is mainly * provided to allow for interoperability testing. * */ class DSIG_EXPORT XSECKeyInfoResolverDefault : public XSECKeyInfoResolver { public : /** @name Constructors and Destructors */ //@{ XSECKeyInfoResolverDefault(); virtual ~XSECKeyInfoResolverDefault(); //@} /** @name Interface Functions */ //@{ /** * \brief Provide a key to the library * * Reads through the KeyInfo elements until it finds an element * with an embedded Key. If none is found, returns NULL. * * @param lst The list of KeyInfo elements from the signature * @returns Either the appropriate key or NULL if none can be found * @see XSECKeyInfoResolver::resolveKey() */ virtual XSECCryptoKey * resolveKey(DSIGKeyInfoList * lst); /** * \brief Clone the resolver to be installed in a new object. * * @see XSECKeyInfoResolver::clone() */ virtual XSECKeyInfoResolver * clone(void) const; //@} private: XSECSafeBufferFormatter * mp_formatter; /*\@}*/ }; #endif /* XSECKEYINFORESOLVERDEFAULT_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoKeyRSA.hpp000644 001751 001751 00000017663 12003301053 022777 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyRSA := RSA Keys * * Author(s): Berin Lautenbach * * $Id: XSECCryptoKeyRSA.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef XSECCRYPTOKEYRSA_INCLUDE #define XSECCRYPTOKEYRSA_INCLUDE #include /** * \ingroup crypto */ /** * \brief Interface class for RSA keys. * * The library uses classes derived from this to process RSA keys. */ class DSIG_EXPORT XSECCryptoKeyRSA : public XSECCryptoKey { public : /** * \brief Padding type * * Type of padding to be used for RSA encrypt/decrypt operations */ enum PaddingType { PAD_NONE = 0, /** No padding (Illegal for all enc ops) */ PAD_PKCS_1_5 = 1, /** PKCS 1.5 padding */ PAD_OAEP_MGFP1 = 2 /** OAEP using MGFP1 as mask function */ }; /** @name Constructors and Destructors */ //@{ XSECCryptoKeyRSA() {}; virtual ~XSECCryptoKeyRSA() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For RSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_NONE;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const = 0; //@} /** @name Mandatory RSA interface methods * * These methods are required by the library. */ //@{ /** * \brief Set the OAEPparams string * * By default, the library expects crypto implementations to perform * OAEP padding with no params. This call allows the library (or user) * to set a params value prior to an encrypt/decrypt operation. * * @param params buffer containing the params data. Pass in NULL to clear any * old paramters. * @param paramsLen number of bytes in buffer to use. Pass in 0 to clear any * old parameters. */ virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen) = 0; /** * \brief Get OAEPparams Length * * @returns the number of bytes of the OAEPparams buffer (assuming it has been set) */ virtual unsigned int getOAEPparamsLen(void) const = 0; /** * \brief Get the OAEPparams * * @returns a pointer to the (crypto object owned) buffer holding the OAEPparams * or NULL if no params are held */ virtual const unsigned char * getOAEPparams(void) const = 0; /** * \brief Set the MGF * * By default, the library expects crypto implementations to perform * OAEP padding with MGF_SHA1. This call allows the library (or user) * to set a different choice. * * @param mgf the MGF constant identifying the function to use */ virtual void setMGF(maskGenerationFunc mgf) = 0; /** * \brief Get the MGF * * @returns the MGF constant in use */ virtual enum maskGenerationFunc getMGF(void) const = 0; /** * \brief Verify a SHA1 PKCS1 encoded signature * * The library will call this function to validate an RSA signature * The standard by default uses SHA1 in a PKCS1 encoding. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @param hm The type of hash that the signature is accross - must be a SHA variant * @returns true if the signature was valid, false otherwise */ virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm) = 0; /** * \brief Create a signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature is required to * be Base64 encoded such that it can be placed directly into the * XML document * * This call needs to do a PKCS1 encode for a SHA-1 signature. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer * @param hm Hash method used to calculate the Hash - needs to be passed * in order to calculate correct OID to be embedded in signature */ virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm) = 0; /** * \brief Decrypt using private key * * The library will call this function to decrypt a piece of cipher * text using the private component of this key. * * @param inBuf cipher text to decrypt * @param plainBuf output buffer for decrypted bytes * @param inLength bytes of cipher text to decrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) = 0; /** * \brief Encrypt using a public key * * The library will call this function to encrypt a plain text buffer * using the public component of this key. * * @param inBuf plain text to decrypt * @param cipherBuf output buffer for decrypted bytes * @param inLength bytes of plain text to encrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) = 0; /** * \brief Obtain the length of an RSA key * * @returns The length of the rsa key (in bytes) */ virtual unsigned int getLength(void) const = 0; //@} /** @name Optional Interface methods * * These functions do not necessarily have to be implmented. They * are used by XSECKeyInfoResolverDefault to try to create a key from * KeyInfo elements without knowing anything else. * * If an interface class does not implement these functions, a simple * stub that does nothing should be used. */ //@{ /** * \brief Load the modulus * * Load the modulus from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len) = 0; /** * \brief Load the exponent * * Load the exponent from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len) = 0; //@} }; #endif /* XSECCRYPTOKEYRSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoException.hpp000644 001751 001751 00000010205 12003301053 023620 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoException:= How we throw exceptions in XSEC * * Author(s): Berin Lautenbach * * $Id: XSECCryptoException.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOEXCEPTION_INCLUDE #define XSECCRYPTOEXCEPTION_INCLUDE #include #include /** * @ingroup crypto */ /** *\brief Exception strings * * Global array of strings that can be looked up using the #type element * of an XSECCryptoException to determine a default string for the erro */ extern const char * XSECCryptoExceptionStrings[]; /** * @ingroup crypto */ /** * \brief Exception class used by the cryptographic modules * * This exception class should be used by the Cryptographic providers * for reporting errors. It can be used directly or by classes which * inherit from it. * * It's a fairly standard exception class, with a type parameter * (and associated enumerated type) and a string that can be used to * provide more information to the caller. */ class DSIG_EXPORT XSECCryptoException { public: /** * \brief Defines the error type * * Enumerated type that can be looked up by the receiver of the * exception to determine what the error was. * * Can also be used as a lookup into the XSECCryptoExceptionStrings * global array for a default error description */ enum XSECCryptoExceptionType { None = 0, GeneralError = 1, MDError = 2, // Error in Message Digest Base64Error = 3, // Error in a Base64 operation MemoryError = 4, // Memory allocation error X509Error = 5, // X509 problem DSAError = 6, // DSA Error RSAError = 7, // RSA Error SymmetricError = 8, UnsupportedError = 9, // Called function is not supported UnsupportedAlgorithm = 10, ECError = 11, UnknownError = 12 // Must be last! }; public: /** @name Contructors and Destructors */ //@{ /** * \brief Common constructur * * Construct an exception with the given type and (possibly blank) * message. * * @param eNum The error type * @param inMsg The message to be passed to the caller. If NULL * this will be set to the associated value in * XSECCryptoExceptionStrings */ XSECCryptoException(XSECCryptoExceptionType eNum, const char * inMsg = NULL); /** * \brief safeBuffer constructor * * As for the common constructor, but passes in a safeBuffer message * * @param eNum The error type * @param inMsg The message string to be passed to the caller. */ XSECCryptoException(XSECCryptoExceptionType eNum, safeBuffer &inMsg); /** * \brief Copy Constructor. * * @param toCopy The exception to be copied into the new exception */ XSECCryptoException(const XSECCryptoException &toCopy); ~XSECCryptoException(); //@} /** @name Get Methods */ //@{ /** * \brief Get the message * * Allows the receiver of the exception to get the error message. * * @returns A pointer to the char buffer holding the error string */ const char * getMsg(void); /** * \brief Get the error type * * @returns The error type of the error that caused the exception */ //@} XSECCryptoExceptionType getType(void); private: char * msg; // Message to the caller XSECCryptoExceptionType type; // Type of exception XSECCryptoException(); }; #endif /* XSECCryptoEXCEPTION_HEADER */ xml-security-c-1.7.3/xsec/enc/XSECCryptoUtils.hpp000644 001751 001751 00000007164 12003301053 022774 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoUtils:= Helper crypo utilities that make life easier * * Author(s): Berin Lautenbach * * $Id: XSECCryptoUtils.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECCRYPTOUTILS_INCLUDE #define XSECCRYPTOUTILS_INCLUDE #include #include #include /** * \brief Helper utilities for crypto. * @ingroup crypto */ // -------------------------------------------------------------------------------- // XKMS Limited-Use Shared Secret handling // -------------------------------------------------------------------------------- #define XKMSAuthenticationValue 0x01 #define XKMSRevocationCodeIdenfitierEncoding1 0x02 #define XKMSRevocationCodeIdenfitierEncoding2 0x03 #define XKMSKeyEncryption 0x04 int DSIG_EXPORT CalculateXKMSAuthenticationKey(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen); int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding1(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen); /* Calculate encoding 2 - Input is original pass phrase */ int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding2(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen); /* Calculate encoding 2 - Input is encoding 1 */ int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding2From1(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen); int DSIG_EXPORT CalculateXKMSKEK(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen); // -------------------------------------------------------------------------------- // Some Base64 helpers // -------------------------------------------------------------------------------- XMLCh DSIG_EXPORT * EncodeToBase64XMLCh(unsigned char * input, int inputLen); unsigned int DSIG_EXPORT DecodeFromBase64XMLCh(const XMLCh * input, unsigned char * output, int maxOutputLen); unsigned int DSIG_EXPORT DecodeFromBase64(const char * input, unsigned char * output, int maxOutputLen); // -------------------------------------------------------------------------------- // Some stuff to help with wierd signatures // -------------------------------------------------------------------------------- // Convert an ASN.1 format DSA signature (!!!) to the two component integers // NOTE - both r and s must be at least 20 bytes long bool DSIG_EXPORT ASN2DSASig(const unsigned char * input, unsigned char * r, unsigned char * s); // -------------------------------------------------------------------------------- // Calculate correct OIDs for an RSA sig // -------------------------------------------------------------------------------- unsigned char * getRSASigOID(hashMethod hm, int &oidLen); #endif /* XSECCRYPTOUTILS_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSECCryptoX509.cpp000644 001751 001751 00000004136 12003301053 022330 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoX509:= A base class for handling X509 (V3) certificates * * $Id: XSECCryptoX509.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include void XSECCryptoX509::loadX509PEM(const char * buf, unsigned int len) { const char * b; char * b1 = NULL; if (len == 0) b = buf; else { XSECnew(b1, char[len+1]); memcpy(b1, buf, len); b1[len] = '\0'; b = b1; } const char *p = strstr(buf, "-----BEGIN CERTIFICATE-----"); if (p == NULL) { if (b1 != NULL) delete[] b1; throw XSECCryptoException(XSECCryptoException::X509Error, "X509::loadX509PEM - Cannot find start of PEM certificate"); } p += strlen("-----BEGIN CERTIFICATE-----"); while (*p == '\n' || *p == '\r' || *p == '-') p++; safeBuffer output; int i = 0; while (*p != '\0' && *p != '-') { output[i++] = *p; ++p; } if (strstr(p, "-----END CERTIFICATE-----") != p) { if (b1 != NULL) delete[] b1; throw XSECCryptoException(XSECCryptoException::X509Error, "X509::loadX509PEM - Cannot find end of PEM certificate"); } if (b1 != NULL) delete[] b1; output[i] = '\0'; this->loadX509Base64Bin(output.rawCharBuffer(), i); } xml-security-c-1.7.3/xsec/enc/XSECKeyInfoResolverDefault.cpp000644 001751 001751 00000013264 12003301053 025057 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECKeyInfoResolverDefault := Default (very basic) class for applications * to map KeyInfo to keys * * $Id: XSECKeyInfoResolverDefault.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include "../utils/XSECAutoPtr.hpp" #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XSECKeyInfoResolverDefault::XSECKeyInfoResolverDefault() { // Create a UTF-8 formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); } XSECKeyInfoResolverDefault::~XSECKeyInfoResolverDefault() { if (mp_formatter != NULL) delete mp_formatter; } // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- XSECCryptoKey * XSECKeyInfoResolverDefault::resolveKey(DSIGKeyInfoList * lst) { // Try to find a key from the KeyInfo list as best we can // NOTE: No validation is performed (i.e. no cert/CRL checks etc.) XSECCryptoKey * ret = NULL; DSIGKeyInfoList::size_type sz = lst->getSize(); for (DSIGKeyInfoList::size_type i = 0; i < sz; ++i) { switch (lst->item(i)->getKeyInfoType()) { case (DSIGKeyInfo::KEYINFO_X509) : { ret = NULL; const XMLCh * x509Str; XSECCryptoX509 * x509 = XSECPlatformUtils::g_cryptoProvider->X509(); Janitor j_x509(x509); x509Str = ((DSIGKeyInfoX509 *) lst->item(i))->getCertificateItem(0); if (x509Str != 0) { // The crypto interface classes work UTF-8 safeBuffer transX509; transX509 << (*mp_formatter << x509Str); x509->loadX509Base64Bin(transX509.rawCharBuffer(), (unsigned int) strlen(transX509.rawCharBuffer())); ret = x509->clonePublicKey(); } if (ret != NULL) return ret; } break; case (DSIGKeyInfo::KEYINFO_VALUE_DSA) : { XSECCryptoKeyDSA * dsa = XSECPlatformUtils::g_cryptoProvider->keyDSA(); Janitor j_dsa(dsa); safeBuffer value; value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getDSAP()); dsa->loadPBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getDSAQ()); dsa->loadQBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getDSAG()); dsa->loadGBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getDSAY()); dsa->loadYBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); j_dsa.release(); return dsa; } break; case (DSIGKeyInfo::KEYINFO_VALUE_RSA) : { XSECCryptoKeyRSA * rsa = XSECPlatformUtils::g_cryptoProvider->keyRSA(); Janitor j_rsa(rsa); safeBuffer value; value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getRSAModulus()); rsa->loadPublicModulusBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getRSAExponent()); rsa->loadPublicExponentBase64BigNums(value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); j_rsa.release(); return rsa; } break; case (DSIGKeyInfo::KEYINFO_VALUE_EC) : { XSECCryptoKeyEC* ec = XSECPlatformUtils::g_cryptoProvider->keyEC(); Janitor j_ec(ec); safeBuffer value; value << (*mp_formatter << ((DSIGKeyInfoValue *) lst->item(i))->getECPublicKey()); XSECAutoPtrChar curve(((DSIGKeyInfoValue *) lst->item(i))->getECNamedCurve()); if (curve.get()) { ec->loadPublicKeyBase64(curve.get(), value.rawCharBuffer(), (unsigned int) strlen(value.rawCharBuffer())); j_ec.release(); return ec; } } break; case (DSIGKeyInfo::KEYINFO_DERENCODED) : { safeBuffer value; value << (*mp_formatter << ((DSIGKeyInfoDEREncoded *) lst->item(i))->getData()); return XSECPlatformUtils::g_cryptoProvider->keyDER(value.rawCharBuffer(), (unsigned int)strlen(value.rawCharBuffer()), true); } break; default : break; } } return NULL; } XSECKeyInfoResolver * XSECKeyInfoResolverDefault::clone(void) const { return new XSECKeyInfoResolverDefault(); } xml-security-c-1.7.3/xsec/enc/XSECCryptoUtils.cpp000644 001751 001751 00000037333 12003301053 022770 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoUtils:= Helper crypo utilities that make life easier * * Author(s): Berin Lautenbach * * $Id: XSECCryptoUtils.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include "../utils/XSECAutoPtr.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // XKMS Limited-Use Shared Secret handling // -------------------------------------------------------------------------------- int CleanXKMSPassPhrase(unsigned char * input, int inputLen, safeBuffer &output) { // Now obsolete - use SASLCleanXKMSPassPhrase instead int j = 0; unsigned char c; for (int i = 0; i < inputLen; ++i) { c = input[i]; if (c >= 'A' && c <= 'Z') { output[j++] = c - 'A' + 'a'; } else if (c != '\n' && c != '\r' && c != '\t' && c != ' ') { output[j++] = c; } } return j; } int SASLCleanXKMSPassPhrase(unsigned char * input, int inputLen, safeBuffer &output) { // For now - this does *not* implement the full SASLPrep algorithm. // THe NFKC form is not trivial to implement - so this is kept very simple. // TODO - Fix this - it can be an interoperability issue as pass phrases from // different implementations could be treated differently. // Currently we only check for prohibited unput for chars < 0xFFFF and drop any // chars over 0xFFFF unsigned char * inp = new unsigned char[inputLen + 1]; ArrayJanitor j_inp(inp); memcpy(inp, input, inputLen); inp[inputLen] = '\0'; XSECAutoPtrXMLCh uinput((char *) inp); xsecsize_t l = XMLString::stringLen(uinput.get()); XMLCh* uoutput = new XMLCh[l + 1]; ArrayJanitor j_uoutput(uoutput); xsecsize_t i, j; j = 0; XMLCh ch1; for (i = 0; i < l; ++i) { ch1 = uinput.get()[i]; // Case one - char is < 0x10000 if (ch1 < 0xD800 || ch1 > 0xDFFF) { // OK - ch1 is "real" value - let's see if it is legal // The following switch tables are derived from // RFC 3454 - see http://www.ietf.org/rfc/rfc3454.txt // Non-ASCII Spaces - C.1.2 switch (ch1) { case 0x00A0: // NO-BREAK SPACE case 0x1680: // OGHAM SPACE MARK case 0x2000: // EN QUAD case 0x2001: // EM QUAD case 0x2002: // EN SPACE case 0x2003: // EM SPACE case 0x2004: // THREE-PER-EM SPACE case 0x2005: // FOUR-PER-EM SPACE case 0x2006: // SIX-PER-EM SPACE case 0x2007: // FIGURE SPACE case 0x2008: // PUNCTUATION SPACE case 0x2009: // THIN SPACE case 0x200A: // HAIR SPACE case 0x200B: // ZERO WIDTH SPACE case 0x202F: // NARROW NO-BREAK SPACE case 0x205F: // MEDIUM MATHEMATICAL SPACE case 0x3000: // IDEOGRAPHIC SPACE throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - Non ASCII space character in XKMS pass phrase"); default: break; } // ASCII Control characters // Note - us unsigned, so always >= 0) if ((ch1 <= 0x1F) || (ch1 == 0x7F)) { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - ASCII control character in XKMS pass phrase"); } // Non-ASCII Control Characters if ((ch1 >= 0x80 && ch1 <= 0x9F) || (ch1 >= 0x206A && ch1 <= 0x206F) || (ch1 >= 0xFFF9 && ch1 <= 0xFFFC)) { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - NON ASCII control character in XKMS pass phrase"); } switch (ch1) { case 0x06DD: // ARABIC END OF AYAH case 0x070F: // SYRIAC ABBREVIATION MARK case 0x180E: // MONGOLIAN VOWEL SEPARATOR case 0x200C: // ZERO WIDTH NON-JOINER case 0x200D: // ZERO WIDTH JOINER case 0x2028: // LINE SEPARATOR case 0x2029: // PARAGRAPH SEPARATOR case 0x2060: // WORD JOINER case 0x2061: // FUNCTION APPLICATION case 0x2062: // INVISIBLE TIMES case 0x2063: // INVISIBLE SEPARATOR case 0xFEFF: // ZERO WIDTH NO-BREAK SPACE throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - NON ASCII control character in XKMS pass phrase"); default: break; } // 1D173-1D17A; [MUSICAL CONTROL CHARACTERS] is not relevant as we are looking at // ch1 at the moment // Private Use characters if ((ch1 >= 0xE000 && ch1 <= 0xF8FF)) { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - Private Use character in XKMS pass phrase"); } // Non-character code points if ((ch1 >= 0xFDD0 && ch1 <= 0xFDEF) || (ch1 >= 0xFFFE)) { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - Non-character code points in XKMS pass phrase"); } // Inappropriate for plain text characters switch (ch1) { case 0xFFF9: // INTERLINEAR ANNOTATION ANCHOR case 0xFFFA: // INTERLINEAR ANNOTATION SEPARATOR case 0xFFFB: // INTERLINEAR ANNOTATION TERMINATOR case 0xFFFC: // OBJECT REPLACEMENT CHARACTER case 0xFFFD: // REPLACEMENT CHARACTER throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - Innappropriate for plain text chararcters in XKMS pass phrase"); default: break; } // Inappripriate for canonical representation characters if (ch1 >= 0x2FF0 && ch1 <= 0x2FFB) { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - Innappropriate for canonicalisation chararcters in XKMS pass phrase"); } // Change display properties or are deprecated switch (ch1) { case 0x0340: // COMBINING GRAVE TONE MARK case 0x0341: // COMBINING ACUTE TONE MARK case 0x200E: // LEFT-TO-RIGHT MARK case 0x200F: // RIGHT-TO-LEFT MARK case 0x202A: // LEFT-TO-RIGHT EMBEDDING case 0x202B: // RIGHT-TO-LEFT EMBEDDING case 0x202C: // POP DIRECTIONAL FORMATTING case 0x202D: // LEFT-TO-RIGHT OVERRIDE case 0x202E: // RIGHT-TO-LEFT OVERRIDE case 0x206A: // INHIBIT SYMMETRIC SWAPPING case 0x206B: // ACTIVATE SYMMETRIC SWAPPING case 0x206C: // INHIBIT ARABIC FORM SHAPING case 0x206D: // ACTIVATE ARABIC FORM SHAPING case 0x206E: // NATIONAL DIGIT SHAPES case 0x206F: // NOMINAL DIGIT SHAPES throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - change display or deprecated chararcters in XKMS pass phrase"); default: break; } // We got this far = just run with it for now uoutput[j++] = ch1; } else { throw XSECException(XSECException::XKMSError, "SASLCleanXKMSPassPhrase - don't support XKMS pass phrase chars > 0xFFFF"); } } /* for */ uoutput[j++] = chNull; // Now transcode char * utf8output= transcodeToUTF8(uoutput); output.sbStrcpyIn(utf8output); int ret = (int)strlen(utf8output); XSEC_RELEASE_XMLCH(utf8output); return ret; } int DSIG_EXPORT CalculateXKMSAuthenticationKey(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen) { unsigned char keyVal[] = {XKMSAuthenticationValue}; XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); Janitor j_k(k); k->setKey(keyVal, 1); XSECCryptoHash *h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA1(); Janitor j_h(h); h->setKey(k); // Clean the input safeBuffer sb; int l = SASLCleanXKMSPassPhrase(input, inputLen, sb); h->hash((unsigned char *) sb.rawBuffer(), l); return h->finish(output, maxOutputLen); } int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding1(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen) { unsigned char keyVal[] = {XKMSRevocationCodeIdenfitierEncoding1}; XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); Janitor j_k(k); k->setKey(keyVal, 1); XSECCryptoHash *h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA1(); Janitor j_h(h); h->setKey(k); // Clean the input safeBuffer sb; int l = CleanXKMSPassPhrase(input, inputLen, sb); h->hash((unsigned char *) sb.rawBuffer(), l); return h->finish(output, maxOutputLen); } int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding2(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen) { unsigned char tmpBuf[XSEC_MAX_HASH_SIZE]; int tmpLen = CalculateXKMSRevocationCodeIdentifierEncoding1(input, inputLen, tmpBuf, XSEC_MAX_HASH_SIZE); return CalculateXKMSRevocationCodeIdentifierEncoding2From1(tmpBuf, tmpLen, output, maxOutputLen); } int DSIG_EXPORT CalculateXKMSRevocationCodeIdentifierEncoding2From1(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen) { unsigned char keyVal[] = {XKMSRevocationCodeIdenfitierEncoding2}; XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); Janitor j_k(k); k->setKey(keyVal, 1); XSECCryptoHash *h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA1(); Janitor j_h(h); h->setKey(k); h->hash(input, inputLen); return h->finish(output, maxOutputLen); } int DSIG_EXPORT CalculateXKMSKEK(unsigned char * input, int inputLen, unsigned char * output, int maxOutputLen) { unsigned char keyVal[] = {XKMSKeyEncryption}; unsigned char shaOutput[22]; // SHA1 has 20 bytes of output // Clean the input safeBuffer sb; int l = SASLCleanXKMSPassPhrase(input, inputLen, sb); // Need to iterate through until we have enough data int bytesDone = 0, bytesToDo;; shaOutput[0] = keyVal[0]; int keyLen = 1; while (bytesDone < maxOutputLen) { XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(shaOutput, keyLen); XSECCryptoHash *h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA1(); Janitor j_h(h); h->setKey(k); delete(k); // Now hash next round of data h->hash((unsigned char *) sb.rawBuffer(), l); keyLen = h->finish(shaOutput, 22); // Copy into the output buffer bytesToDo = maxOutputLen - bytesDone; bytesToDo = bytesToDo > 20 ? 20 : bytesToDo; memcpy(&output[bytesDone], shaOutput, bytesToDo); bytesDone += bytesToDo; // Set up for next key shaOutput[0] ^= keyVal[0]; keyLen = 20; j_h.release(); delete h; } return bytesDone; } // -------------------------------------------------------------------------------- // Some Base64 helpers // -------------------------------------------------------------------------------- XMLCh DSIG_EXPORT * EncodeToBase64XMLCh(unsigned char * input, int inputLen) { XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); unsigned char * output; int outputLen = ((4 * inputLen) / 3) + 5; XSECnew(output, unsigned char[outputLen]); ArrayJanitor j_output(output); b64->encodeInit(); int j = b64->encode(input, inputLen, output, outputLen - 1); j += b64->encodeFinish(&output[j], outputLen - j - 1); // Strip any trailing \n\r while (j > 0 && (output[j-1] == '\n' || output[j-1] == '\r')) j--; // Now transcode and get out of here output[j] = '\0'; return XMLString::transcode((char *) output); } unsigned int DSIG_EXPORT DecodeFromBase64XMLCh(const XMLCh * input, unsigned char * output, int maxOutputLen) { XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); XSECAutoPtrChar tinput(input); b64->decodeInit(); unsigned int j = b64->decode((unsigned char *) tinput.get(), (unsigned int) strlen(tinput.get()), output, maxOutputLen - 1); j += b64->decodeFinish(&output[j], maxOutputLen - j - 1); return j; } unsigned int DSIG_EXPORT DecodeFromBase64(const char * input, unsigned char * output, int maxOutputLen) { XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); Janitor j_b64(b64); b64->decodeInit(); unsigned int j = b64->decode((unsigned char *) input, (unsigned int) strlen(input), output, maxOutputLen - 1); j += b64->decodeFinish(&output[j], maxOutputLen - j - 1); return j; } // -------------------------------------------------------------------------------- // Some stuff to help with wierd signatures // -------------------------------------------------------------------------------- const unsigned char ASNDSAProlog[] = {0x30, 0x2c, 0x02, 0x14}; const unsigned char ASNDSAMiddle[] = {0x02, 0x14}; bool ASN2DSASig(const unsigned char * input, unsigned char * r, unsigned char * s) { if (memcmp(ASNDSAProlog, input, 4) != 0 || memcmp(ASNDSAMiddle, &input[24], 2) != 0) return false; memcpy(r, &input[4], 20); memcpy(s, &input[26], 20); return true; } // -------------------------------------------------------------------------------- // Calculate correct OIDs for an RSA sig // -------------------------------------------------------------------------------- /* As per RSA's PKCS #1 v 2.1, Section 9.2 Note 1, the DER encodings for * the has types are as follows: * * MD2: (0x)30 20 30 0c 06 08 2a 86 48 86 f7 0d 02 02 05 00 04 10 || H. * MD5: (0x)30 20 30 0c 06 08 2a 86 48 86 f7 0d 02 05 05 00 04 10 || H. * SHA-1: (0x)30 21 30 09 06 05 2b 0e 03 02 1a 05 00 04 14 || H. * SHA-256: (0x)30 31 30 0d 06 09 60 86 48 01 65 03 04 02 01 05 00 04 20 || H. * SHA-384: (0x)30 41 30 0d 06 09 60 86 48 01 65 03 04 02 02 05 00 04 30 || H. * SHA-512: (0x)30 51 30 0d 06 09 60 86 48 01 65 03 04 02 03 05 00 04 40 || H. * * More recently the following has been provided for SHA-224 * * SHA-224: 30 2d 30 0d 06 09 60 86 48 01 65 03 04 02 04 05 00 04 1c * */ int MD5OIDLen = 18; unsigned char MD5OID[] = { 0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 }; int sha1OIDLen = 15; unsigned char sha1OID[] = { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14 }; int sha224OIDLen = 19; unsigned char sha224OID[] = { 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c }; int sha256OIDLen = 19; unsigned char sha256OID[] = { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }; int sha384OIDLen = 19; unsigned char sha384OID[] = { 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30 }; int sha512OIDLen = 19; unsigned char sha512OID[] = { 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }; unsigned char * getRSASigOID(hashMethod hm, int &oidLen) { switch (hm) { case (HASH_MD5): oidLen = MD5OIDLen; return MD5OID; case (HASH_SHA1): oidLen = sha1OIDLen; return sha1OID; case (HASH_SHA224): oidLen = sha224OIDLen; return sha224OID; case (HASH_SHA256): oidLen = sha256OIDLen; return sha256OID; case (HASH_SHA384): oidLen = sha384OIDLen; return sha384OID; case (HASH_SHA512): oidLen = sha512OIDLen; return sha512OID; default: oidLen = 0; return NULL; } } xml-security-c-1.7.3/xsec/enc/XSECCryptoBase64.cpp000644 001751 001751 00000003567 12003301053 022716 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoBase64 := Implementation of Base64 utility fns * * $Id: XSECCryptoBase64.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Clean a buffer of Base64 characters // -------------------------------------------------------------------------------- char * XSECCryptoBase64::cleanBuffer(const char * buffer, unsigned int bufLen, unsigned int &retBufLen) { if (bufLen == 0) bufLen = XMLString::stringLen(buffer); char * res; XSECnew(res, char[bufLen + (bufLen / 72) + 3]); unsigned int j = 0; unsigned int k = 0; for (unsigned int i = 0; i < bufLen; ++i) { res[j++] = buffer[i]; if (buffer[i] == '\n' || buffer[i] == '\r') k = 0; else { if (++k >= 72) { res[j++] = '\n'; k = 0; } } } res[j] = '\0'; retBufLen = j; return res; } xml-security-c-1.7.3/xsec/enc/XSECCryptoProvider.cpp000644 001751 001751 00000002674 12003301053 023462 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoProvider := Base virtual class to define a crpyto module * * Author(s): Scott Cantor * * $Id:$ * */ #include #include #include XSECCryptoKeyEC* XSECCryptoProvider::keyEC() const { throw XSECCryptoException(XSECCryptoException::UnsupportedError, "XSECCryptoProvider - EC keys not supported"); } XSECCryptoKey* XSECCryptoProvider::keyDER(const char* buf, unsigned long buflen, bool base64) const { throw XSECCryptoException(XSECCryptoException::UnsupportedError, "XSECCryptoProvider - DER-encoded keys not supported"); } xml-security-c-1.7.3/xsec/enc/XSECCryptoException.cpp000644 001751 001751 00000004746 12003301053 023630 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoException:= How we throw exceptions in XSEC * * Author(s): Berin Lautenbach * * $Id: XSECCryptoException.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include extern const char * XSECCryptoExceptionStrings[] = { "No Error", "General error occurred somewhere in cryptographic routines", "Error Creating SHA1 MD", "Error in Base64", "Memory allocation error", "X509 Error", "DSA Error", "RSA Error", "Symmetric Error", "EC Error", "Unsupported Algorithm" }; XSECCryptoException::XSECCryptoException(XSECCryptoExceptionType eNum, const char * inMsg) { if (eNum > UnknownError) type = UnknownError; else type = eNum; if (inMsg != NULL) { msg = new char[strlen(inMsg) + 1]; strcpy(msg, inMsg); } else { msg = new char[strlen(XSECCryptoExceptionStrings[type]) + 1]; strcpy(msg, XSECCryptoExceptionStrings[type]); } } XSECCryptoException::XSECCryptoException(XSECCryptoExceptionType eNum, safeBuffer &inMsg) { if (eNum > UnknownError) type = UnknownError; else type = eNum; msg = new char[strlen((char *) inMsg.rawBuffer()) + 1]; strcpy(msg, (char *) inMsg.rawBuffer()); } XSECCryptoException::XSECCryptoException(const XSECCryptoException &toCopy) { // Copy Constructor type = toCopy.type; if (toCopy.msg == NULL) msg = NULL; else { msg = new char[strlen(toCopy.msg) + 1]; strcpy(msg, toCopy.msg); } } XSECCryptoException::~XSECCryptoException() { if (msg != NULL) delete[] msg; } const char * XSECCryptoException::getMsg(void) { return msg; } XSECCryptoException::XSECCryptoExceptionType XSECCryptoException::getType(void) { return type; } xml-security-c-1.7.3/xsec/enc/XSCrypt/XSCryptCryptoBase64.hpp000644 001751 001751 00000011364 12003301053 025103 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSCryptCryptoBase64 := Internal implementation of a base64 encoder/decoder * * Author(s): Berin Lautenbach * * $Id: XSCryptCryptoBase64.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSCRYPTCRYPTOBASE64_INCLUDE #define XSCRYPTCRYPTOBASE64_INCLUDE #include #include #include /** * @defgroup xscryptcrypto Internal Crypto API Interface * @ingroup crypto * The XSCrypt Interface provides cryptographic functions that are missing * from other libraries. * * Currently this only provides Base64 functionality which is not * available in the Windows Crypto API. * */ class DSIG_EXPORT XSCryptCryptoBase64 : public XSECCryptoBase64 { public : // Constructors/Destructors XSCryptCryptoBase64() : m_state(B64_UNINITIALISED) {}; virtual ~XSCryptCryptoBase64() {}; /** @name Decoding Functions */ //@{ /** * \brief Initialise the base64 object. * * Initialises the OpenSSL decode context and gets ready for data * to be decoded. * */ virtual void decodeInit(void); // Setup /** * \brief Decode some passed in data. * * Decode the passed in data and place the data in the outData buffer * * @param inData Pointer to the buffer holding encoded data. * @param inLength Length of the encoded data in the buffer * @param outData Buffer to place decoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int decode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength); /** * \brief Finish off a decode. * * Clean out any extra data from previous decode operations and place * into the outData buffer. * * @param outData Buffer to place any remaining decoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int decodeFinish(unsigned char * outData, unsigned int outLength); //@} /** @name Encoding Functions */ //@{ /** * \brief Initialise the base64 object for encoding * * Get the context variable ready for a base64 decode * */ virtual void encodeInit(void); /** * \brief Encode some passed in data. * * @param inData Pointer to the buffer holding data to be encoded. * @param inLength Length of the data in the buffer * @param outData Buffer to place encoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int encode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength); /** * \brief Finish off an encode. * * Take any data from previous encode operations and create the * tail of the base64 encoding. * * @param outData Buffer to place any remaining encoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int encodeFinish(unsigned char * outData, unsigned int outLength); //@} private : enum b64state { B64_UNINITIALISED, B64_ENCODE, B64_DECODE }; safeBuffer m_inputBuffer; // Carry over buffer safeBuffer m_outputBuffer; // Carry over output unsigned int m_remainingInput; // Number of bytes in carry input buffer unsigned int m_remainingOutput; // Number of bytes in carry output buffer bool m_allDone; // End found (=) b64state m_state; // What are we currently doing? unsigned int m_charCount; // How many characters in current line? // Private functions void canonicaliseInput(const unsigned char *inData, unsigned int inLength); }; #endif /* XSCRYPTCRYPTOBASE64_INCLUDE */ xml-security-c-1.7.3/xsec/enc/XSCrypt/XSCryptCryptoBase64.cpp000644 001751 001751 00000024663 12003301053 025104 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSCryptCryptoBase64 := Internal implementation of a base64 * encoder/decoder * * Author(s): Berin Lautenbach * * $Id: XSCryptCryptoBase64.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include // -------------------------------------------------------------------------------- // Lookup tables and macros // -------------------------------------------------------------------------------- char Base64LookupTable[] = { 'A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z', 'a','b','c','d','e','f','g','h','i','j','k','l','m', 'n','o','p','q','r','s','t','u','v','w','x','y','z', '0','1','2','3','4','5','6','7','8','9','+','/', }; #define IS_UPPER(c) (c >= 'A' && c <= 'Z') #define IS_LOWER(c) (c >= 'a' && c <= 'z') #define IS_NUMBR(c) (c >= '0' && c <= '9') #define IS_OTHER(c) (c == '+' || c == '/') #define IS_B64CH(c) (IS_LOWER(c) || IS_UPPER(c) || IS_NUMBR(c) || IS_OTHER(c)) #define IS_B64OE(c) (IS_B64CH(c) || c == '=') // -------------------------------------------------------------------------------- // Decoding // -------------------------------------------------------------------------------- unsigned char decodeCh(unsigned char c) { if (IS_UPPER(c)) return c - 'A'; if (IS_LOWER(c)) return (c - 'a') + 26; if (IS_NUMBR(c)) return (c - '0') + 52; if (c == '+') return 62; if (c == '/') return 63; if (c == '=') return 64; return 65; // error; } void XSCryptCryptoBase64::canonicaliseInput(const unsigned char *inData, unsigned int inLength) { // Canonicalise the input buffer into m_inputBuffer unsigned char buf[400]; // Do 400 bytes at a time unsigned int i, j; j = 0; for (i = 0; i < inLength; ++i) { if (IS_B64OE(inData[i])) { // Have a base64 or '=' char buf[j++] = inData[i]; if (j == 400) { m_inputBuffer.sbMemcpyIn(m_remainingInput, buf, 400); m_remainingInput += 400; j = 0; } } } if (j > 0) { m_inputBuffer.sbMemcpyIn(m_remainingInput, buf, j); m_remainingInput += j; } } void XSCryptCryptoBase64::decodeInit(void) { m_remainingInput = m_remainingOutput = 0; m_allDone = false; m_state = B64_DECODE; } unsigned int XSCryptCryptoBase64::decode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) { // Ensure we are in an appropriate state if (m_state != B64_DECODE) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Attempt to decode when not in decode state"); } // Copy the data into our input buffer canonicaliseInput(inData, inLength); unsigned int i = 0; unsigned char t; while (m_allDone != true && m_remainingInput - i >= 4) { // BYTE 1 t = decodeCh(m_inputBuffer[i++]); if (t > 63) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Invalid character at start of base 64 block"); } m_outputBuffer[m_remainingOutput] = (t << 2); // BYTE 2 t = decodeCh(m_inputBuffer[i++]); if (t > 63) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Invalid character at start of base 64 block"); } // Take top two bits and place at end of current byte m_outputBuffer[m_remainingOutput] = m_outputBuffer[m_remainingOutput] | (t >> 4); m_remainingOutput++; // Have a new complete byte // Take remaining 4 bits and add to outputBuffer m_outputBuffer[m_remainingOutput] = ( t << 4); // BYTE 3 t = decodeCh(m_inputBuffer[i++]); if (t > 64) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Invalid character at start of base 64 block"); } if (t == 64) { // '=' character found m_allDone = true; break; } // Take 4 bits and append to current buffer m_outputBuffer[m_remainingOutput] = m_outputBuffer[m_remainingOutput] | (t >> 2); m_remainingOutput++; // Take last 2 bits and append to buffer m_outputBuffer[m_remainingOutput] = (t << 6); // BYTE 4 t = decodeCh(m_inputBuffer[i++]); if (t > 64) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Invalid character at start of base 64 block"); } if (t == 64) { m_allDone = true; break; } // Place all six bits and end of current byte m_outputBuffer[m_remainingOutput] = m_outputBuffer[m_remainingOutput] | t; m_remainingOutput++; } // Now whatever we've decoded can be placed in the output buffer unsigned int cpyOut = (m_remainingOutput < outLength ? m_remainingOutput : outLength); m_outputBuffer.sbMemcpyOut(outData, cpyOut); // Move the buffers down if (cpyOut != m_remainingOutput) { m_remainingOutput = m_remainingOutput - cpyOut; m_outputBuffer.sbMemshift(0, cpyOut, m_remainingOutput); } else m_remainingOutput = 0; if (i != m_remainingInput) { m_remainingInput -= i; m_inputBuffer.sbMemshift(0, i, m_remainingInput); } else m_remainingInput = 0; // Return however much we have decoded return cpyOut; } unsigned int XSCryptCryptoBase64::decodeFinish(unsigned char * outData, unsigned int outLength) { if (m_state != B64_DECODE) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Attempt to complete a decode when not in decode state"); } m_allDone = true; unsigned int cpyOut = (m_remainingOutput < outLength ? m_remainingOutput : outLength); m_outputBuffer.sbMemcpyOut(outData, cpyOut); // Move the buffers down if (cpyOut != m_remainingOutput) { m_remainingOutput = m_remainingOutput - cpyOut; m_outputBuffer.sbMemshift(0, cpyOut, m_remainingOutput); } else { m_remainingOutput = 0; } return cpyOut; } // -------------------------------------------------------------------------------- // Encoding // -------------------------------------------------------------------------------- void XSCryptCryptoBase64::encodeInit(void) { m_remainingInput = m_remainingOutput = 0; m_allDone = false; m_charCount = 0; m_state = B64_ENCODE; } unsigned int XSCryptCryptoBase64::encode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) { if (m_state != B64_ENCODE) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Attempt to encode when not in encoding state"); } // Copy input data into end of input buffer m_inputBuffer.sbMemcpyIn(m_remainingInput, inData, inLength); m_remainingInput += inLength; unsigned int i = 0; unsigned char t; while (m_allDone == false && m_remainingInput - i >= 3) { // Have a complete block of three bytes to encode // First 6 bits; t = (m_inputBuffer[i] >> 2); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; // 2 bits from byte one and 4 from byte 2 t = ((m_inputBuffer[i++] << 4) & 0x30); t |= (m_inputBuffer[i] >> 4); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; // 4 from byte 2 and 2 from byte 3 t = ((m_inputBuffer[i++] << 2) & 0x3C); t |= (m_inputBuffer[i] >> 6); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; // last 6 bits from byte 3 t = m_inputBuffer[i++] & 0x3F; m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; m_charCount += 4; if (m_charCount >= 76) { m_outputBuffer[m_remainingOutput++] = '\n'; m_charCount = 0; } } // Now copy data out to output buffer unsigned int cpyOut = (m_remainingOutput < outLength ? m_remainingOutput : outLength); m_outputBuffer.sbMemcpyOut(outData, cpyOut); // Move the buffers down if (cpyOut != m_remainingOutput) { m_remainingOutput = m_remainingOutput - cpyOut; m_outputBuffer.sbMemshift(0, cpyOut, m_remainingOutput); } else m_remainingOutput = 0; if (i != m_remainingInput) { m_remainingInput -= i; m_inputBuffer.sbMemshift(0, i, m_remainingInput); } else m_remainingInput = 0; // Return however much we have decoded return cpyOut; } unsigned int XSCryptCryptoBase64::encodeFinish(unsigned char * outData, unsigned int outLength) { if (m_state != B64_ENCODE) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Attempt to complete an encode when not in encoding state"); } if (m_allDone == false && m_remainingInput > 0) { // Will always be < 3 characters remaining in inputBuffer // If necessary - terminate the Base64 string if (m_remainingInput >= 3) { throw XSECCryptoException(XSECCryptoException::Base64Error, "XSCrypt:Base64 - Too much remaining input in input buffer"); } // First 6 bits; unsigned int t = (m_inputBuffer[0] >> 2); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; // 2 bits from byte one and 4 from byte 2 t = ((m_inputBuffer[0] << 4) & 0x30); if (m_remainingInput == 1) { m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; m_outputBuffer[m_remainingOutput++] = '='; m_outputBuffer[m_remainingOutput++] = '='; } else { t |= (m_inputBuffer[1] >> 4); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; // 4 from byte 2 t = ((m_inputBuffer[1] << 2) & 0x3C); m_outputBuffer[m_remainingOutput++] = Base64LookupTable[t]; m_outputBuffer[m_remainingOutput++] = '='; } } m_allDone = true; // Copy out unsigned int cpyOut = (m_remainingOutput < outLength ? m_remainingOutput : outLength); m_outputBuffer.sbMemcpyOut(outData, cpyOut); // Move the buffers down if (cpyOut != m_remainingOutput) { m_remainingOutput = m_remainingOutput - cpyOut; m_outputBuffer.sbMemshift(0, cpyOut, m_remainingOutput); } else { m_remainingOutput = 0; } return cpyOut; } xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoProvider.cpp000644 001751 001751 00000022630 12462320141 025306 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoProvider := Provider to support Windows Crypto API * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoProvider.cpp 1655511 2015-01-29 02:38:46Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include XSEC_USING_XERCES(ArrayJanitor); static char s_xsecKeyStoreName[] = "ApacheXML-SecurityKeyStore"; WinCAPICryptoProvider::WinCAPICryptoProvider( LPCSTR provDSSName, LPCSTR provRSAName, DWORD dwFlags) { if (!CryptAcquireContext(&m_provDSS, NULL, provDSSName, PROV_DSS, CRYPT_VERIFYCONTEXT)) { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error obtaining default PROV_DSS"); } if (!CryptAcquireContext(&m_provRSA, NULL, provRSAName, PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) { // Check if we maybe don't understand AES DWORD error = GetLastError(); if (error == NTE_PROV_TYPE_NOT_DEF || error == 0) { // This system does not have AES! m_haveAES = false; m_provRSAType = PROV_RSA_FULL; if (!CryptAcquireContext(&m_provRSA, NULL, provRSAName, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error obtaining default PROV_RSA_FULL"); } } else { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error obtaining default PROV_RSA_AES"); } } else { m_haveAES = true; m_provRSAType = PROV_RSA_AES; } // Now obtain our internal (library) key store if (!CryptAcquireContext(&m_provApacheKeyStore, s_xsecKeyStoreName, provRSAName, m_provRSAType, dwFlags)) { if (GetLastError() == NTE_BAD_KEYSET) { CryptAcquireContext(&m_provApacheKeyStore, s_xsecKeyStoreName, provRSAName, m_provRSAType, CRYPT_DELETEKEYSET); } // Try to create if (!CryptAcquireContext(&m_provApacheKeyStore, s_xsecKeyStoreName, provRSAName, m_provRSAType, dwFlags | CRYPT_NEWKEYSET)) { // Prevents failure on mandatory profiles, see SANTUARIO-378. if (GetLastError() != NTE_TEMPORARY_PROFILE) { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error obtaining generating internal key store for PROV_RSA_FULL"); } else { m_provApacheKeyStore = NULL; } } else { HCRYPTKEY k; if (!CryptGenKey(m_provApacheKeyStore, AT_KEYEXCHANGE, CRYPT_EXPORTABLE, &k)) { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error generating internal key set for PROV_RSA_FULL"); } CryptDestroyKey(k); } } // Copy parameters for later use if (provDSSName != NULL) m_provDSSName = strdup(provDSSName); else m_provDSSName = NULL; if (provRSAName != NULL) m_provRSAName = strdup(provRSAName); else m_provRSAName = NULL; } WinCAPICryptoProvider::~WinCAPICryptoProvider() { CryptReleaseContext(m_provRSA, 0); CryptReleaseContext(m_provDSS, 0); if (m_provApacheKeyStore) { CryptReleaseContext(m_provApacheKeyStore, 0); } } const XMLCh * WinCAPICryptoProvider::getProviderName() const { return DSIGConstants::s_unicodeStrPROVWinCAPI; } // Hashing classes XSECCryptoHash * WinCAPICryptoProvider::hashSHA1() const { WinCAPICryptoHash * ret; XSECnew(ret, WinCAPICryptoHash(m_provDSS, XSECCryptoHash::HASH_SHA1)); return ret; } XSECCryptoHash * WinCAPICryptoProvider::hashHMACSHA1() const { WinCAPICryptoHashHMAC * ret; XSECnew(ret, WinCAPICryptoHashHMAC(m_provDSS, XSECCryptoHash::HASH_SHA1)); return ret; } XSECCryptoHash * WinCAPICryptoProvider::hashSHA(int length) const { if (length == 160) return hashSHA1(); else return NULL; } XSECCryptoHash * WinCAPICryptoProvider::hashHMACSHA(int length) const { if (length == 160) return hashHMACSHA1(); else return NULL; } XSECCryptoHash * WinCAPICryptoProvider::hashMD5() const { WinCAPICryptoHash * ret; XSECnew(ret, WinCAPICryptoHash(m_provDSS, XSECCryptoHash::HASH_MD5)); return ret; } XSECCryptoHash * WinCAPICryptoProvider::hashHMACMD5() const { WinCAPICryptoHashHMAC * ret; XSECnew(ret, WinCAPICryptoHashHMAC(m_provDSS, XSECCryptoHash::HASH_MD5)); return ret; } XSECCryptoKeyHMAC * WinCAPICryptoProvider::keyHMAC(void) const { WinCAPICryptoKeyHMAC * ret; XSECnew(ret, WinCAPICryptoKeyHMAC(m_provDSS)); return ret; } XSECCryptoKeyDSA * WinCAPICryptoProvider::keyDSA() const { WinCAPICryptoKeyDSA * ret; XSECnew(ret, WinCAPICryptoKeyDSA(m_provDSS)); return ret; } XSECCryptoKeyRSA * WinCAPICryptoProvider::keyRSA() const { WinCAPICryptoKeyRSA * ret; XSECnew(ret, WinCAPICryptoKeyRSA(m_provRSA)); return ret; } XSECCryptoX509 * WinCAPICryptoProvider::X509() const { WinCAPICryptoX509 * ret; XSECnew(ret, WinCAPICryptoX509(m_provRSA, m_provDSS)); return ret; } XSECCryptoBase64 * WinCAPICryptoProvider::base64() const { // The Windows CAPI does not provide a Base64 decoder/encoder. // Use the internal implementation. XSCryptCryptoBase64 * ret; XSECnew(ret, XSCryptCryptoBase64()); return ret; } bool WinCAPICryptoProvider::algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const { switch (alg) { case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : return m_haveAES; case (XSECCryptoSymmetricKey::KEY_3DES_192) : return true; default: return false; } return false; } bool WinCAPICryptoProvider::algorithmSupported(XSECCryptoHash::HashType alg) const { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : case (XSECCryptoHash::HASH_MD5) : return true; case (XSECCryptoHash::HASH_SHA224) : case (XSECCryptoHash::HASH_SHA256) : case (XSECCryptoHash::HASH_SHA384) : case (XSECCryptoHash::HASH_SHA512) : return false; default: return false; } return false; } XSECCryptoSymmetricKey * WinCAPICryptoProvider::keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const { // Only temporary WinCAPICryptoSymmetricKey * ret; XSECnew(ret, WinCAPICryptoSymmetricKey(m_provApacheKeyStore, alg)); return ret; } unsigned int WinCAPICryptoProvider::getRandom(unsigned char * buffer, unsigned int numOctets) const { if (!CryptGenRandom(m_provApacheKeyStore, numOctets, buffer)) { throw XSECException(XSECException::InternalError, "WinCAPICryptoProvider() - Error generating Random data"); } return numOctets; } // -------------------------------------------------------------------------------- // Translate a Base64 number to a Windows (little endian) integer // -------------------------------------------------------------------------------- BYTE * WinCAPICryptoProvider::b642WinBN(const char * b64, unsigned int b64Len, unsigned int &retLen) { BYTE * os; XSECnew(os, BYTE[b64Len]); ArrayJanitor j_os(os); // Decode XSCryptCryptoBase64 b; b.decodeInit(); retLen = b.decode((unsigned char *) b64, b64Len, os, b64Len); retLen += b.decodeFinish(&os[retLen], b64Len - retLen); BYTE * ret; XSECnew(ret, BYTE[retLen]); BYTE * j = os; BYTE * k = ret + retLen - 1; for (unsigned int i = 0; i < retLen ; ++i) *k-- = *j++; return ret; } // -------------------------------------------------------------------------------- // Translate a Windows integer to a Base64 I2OSP number // -------------------------------------------------------------------------------- unsigned char * WinCAPICryptoProvider::WinBN2b64(BYTE * n, DWORD nLen, unsigned int &retLen) { // First reverse BYTE * rev;; XSECnew(rev, BYTE[nLen]); ArrayJanitor j_rev(rev); BYTE * j = n; BYTE * k = rev + nLen - 1; for (unsigned int i = 0; i < nLen ; ++i) *k-- = *j++; unsigned char * b64; // Naieve length calculation unsigned int bufLen = nLen * 2 + 4; XSECnew(b64, unsigned char[bufLen]); ArrayJanitor j_b64(b64); XSCryptCryptoBase64 b; b.encodeInit(); retLen = b.encode(rev, (unsigned int) nLen, b64, bufLen); retLen += b.encodeFinish(&b64[retLen], bufLen - retLen); j_b64.release(); return b64; } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyHMAC.hpp000644 001751 001751 00000011061 12003301053 024666 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyHMAC := HMAC Keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyHMAC.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOKEYHMAC_INCLUDE #define WINCAPICRYPTOKEYHMAC_INCLUDE #include #if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include /** * \ingroup wincapicrypto */ /** * \brief Windows Crypto API implementation for HMAC keys. * * Used to provide HMAC keys to WinCAPI CryptoHashHMAC * * Provides two types of key. * * A Windows Key (via setWinKey) is a direct key that can be used * by the Windows HMAC implementation. * * A byte key (via setKey) is a string of bytes that will be used * as a key. This requires an internal implementation of an HMAC using the * Windows Digest functions, as the Windows API does not allow direct * loading of these keys. */ class DSIG_EXPORT WinCAPICryptoKeyHMAC : public XSECCryptoKeyHMAC { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * @param prov The handle to the provider context that was used to * create any Windows keys (later set via setKey). If this is not * to be used for a windows key (i.e. will be used for a "normal" * buffer of bytes as a key, then this value can be set to 0 */ WinCAPICryptoKeyHMAC(HCRYPTPROV prov); virtual ~WinCAPICryptoKeyHMAC() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For DSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_HMAC;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const ; /** * \brief Return the WinCAPI string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVWinCAPI;} //@} /** @name Optional Interface methods */ //@{ /** * \brief Set the key * * Set the key from the buffer * * @param inBuf Buffer containing the direct bitwise representation of the key * @param inLength Number of bytes of key in the buffer * * @note isSensitive() should have been called on the inbound buffer * to ensure the contents is overwritten when the safeBuffer is deleted */ virtual void setKey(unsigned char * inBuf, unsigned int inLength); /** * \brief Get the key value * * Copy the key into the safeBuffer and return the number of bytes * copied. * * @param outBuf Buffer to copy key into * @returns number of bytes copied in */ virtual unsigned int getKey(safeBuffer &outBuf) const; //@} /** @name Windows specific keys */ //@{ /** * \brief Set a Windows key * * Set a Windows Crypto key that has been either derived via the * various Crypt functions or has been loaded from an encrypted BLOB * * @param k Windows CAPI key to load * Note that the library now owns this key (and will destroy it). */ void setWinKey(HCRYPTKEY k); /** * \brief Get a windows key * * Used by WinCAPICryptoHashHMAC to retrieve the key in order to * load it into the HMAC function. * * @returns The key to use or 0 if this object does not hold one */ HCRYPTKEY getWinKey(void) const; /** * \brief Get a windows key provider * * Used by WinCAPICryptoHashHMAC to retrieve the provider handle associated * with an HMAC key in order to load it into the HMAC function. * * @returns The key to use or 0 if this object does not hold one */ HCRYPTPROV getWinKeyProv(void) const; //@} private: safeBuffer m_keyBuf; unsigned int m_keyLen; HCRYPTKEY m_k; HCRYPTPROV m_p; }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOKEYHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoHash.cpp000644 001751 001751 00000006110 12003301053 024362 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoHash := Windows CAPI Implementation of Message digests * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoHash.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include // Constructors/Destructors WinCAPICryptoHash::WinCAPICryptoHash(HCRYPTPROV prov, HashType alg) { m_p = prov; m_hashType = alg; m_h = 0; reset(); } WinCAPICryptoHash::~WinCAPICryptoHash() { if (m_h != 0) CryptDestroyHash(m_h); } // Hashing Activities void WinCAPICryptoHash::reset(void) { if (m_h != 0) CryptDestroyHash(m_h); m_h = 0; BOOL fResult; ALG_ID alg_id; switch (m_hashType) { case (XSECCryptoHash::HASH_SHA1) : alg_id = CALG_SHA; break; case (XSECCryptoHash::HASH_MD5) : alg_id = CALG_MD5; break; default : alg_id = 0; } if(alg_id == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Unknown algorithm (NOTE SHA512 and SHA256 not supported"); } fResult = CryptCreateHash( m_p, alg_id, 0, 0, &m_h); if (fResult == 0 || m_h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Error creating hash object"); } } void WinCAPICryptoHash::hash(unsigned char * data, unsigned int length) { BOOL fResult = CryptHashData( m_h, data, length, 0); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Error Hashing Data"); } } unsigned int WinCAPICryptoHash::finish(unsigned char * hash, unsigned int maxLength) { DWORD retLen; BOOL fResult; retLen = WINCAPI_MAX_HASH_SIZE; fResult = CryptGetHashParam( m_h, HP_HASHVAL, m_mdValue, &retLen, 0); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Error getting hash value"); } m_mdLen = retLen; retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return (unsigned int) retLen; } // Get information XSECCryptoHash::HashType WinCAPICryptoHash::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyDSA.cpp000644 001751 001751 00000037337 12003301053 024576 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyDSA := DSA Keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyDSA.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include XSEC_USING_XERCES(ArrayJanitor); WinCAPICryptoKeyDSA::WinCAPICryptoKeyDSA(HCRYPTPROV prov) { // Create a new key to be loaded as we go m_key = 0; m_p = prov; m_keySpec = 0; mp_P = NULL; mp_Q = NULL; mp_G = NULL; mp_Y = NULL; }; // "Hidden" WinCAPI constructor WinCAPICryptoKeyDSA::WinCAPICryptoKeyDSA(HCRYPTPROV prov, HCRYPTKEY k) : m_p(prov) { m_key = k; // NOTE - We OWN this handle m_keySpec = 0; mp_P = mp_Q = mp_G = mp_Y = NULL; m_PLen = m_QLen = m_GLen = m_YLen = 0; } WinCAPICryptoKeyDSA::WinCAPICryptoKeyDSA(HCRYPTPROV prov, DWORD keySpec, bool isPrivate) : m_p(prov) { if (isPrivate == false) { throw XSECCryptoException(XSECCryptoException::DSAError, "Public keys defined via keySpec ctor not yet supported"); } m_key = 0; m_keySpec = keySpec; mp_P = mp_Q = mp_G = mp_Y = NULL; m_PLen = m_QLen = m_GLen = m_YLen = 0; } WinCAPICryptoKeyDSA::~WinCAPICryptoKeyDSA() { // If we have a DSA, delete it if (m_key != 0) CryptDestroyKey(m_key); if (mp_P != NULL) delete[] mp_P; if (mp_Q != NULL) delete[] mp_Q; if (mp_G != NULL) delete[] mp_G; if (mp_Y != NULL) delete[] mp_Y; }; // Generic key functions XSECCryptoKey::KeyType WinCAPICryptoKeyDSA::getKeyType() const { // Find out what we have if (m_key == NULL) { // For now we don't really understand Private Windows keys if (m_keySpec != 0) return KEY_DSA_PRIVATE; // Check if we have parameters loaded if (mp_P == NULL || mp_Q == NULL || mp_G == NULL || mp_Y == NULL) return KEY_NONE; else return KEY_DSA_PUBLIC; } if (m_keySpec != 0) return KEY_DSA_PAIR; // If we have m_key - it must be public return KEY_DSA_PUBLIC; } void WinCAPICryptoKeyDSA::loadPBase64BigNums(const char * b64, unsigned int len) { if (mp_P != NULL) { delete[] mp_P; mp_P = NULL; // In case we get an exception } mp_P = WinCAPICryptoProvider::b642WinBN(b64, len, m_PLen); } void WinCAPICryptoKeyDSA::loadQBase64BigNums(const char * b64, unsigned int len) { if (mp_Q != NULL) { delete[] mp_Q; mp_Q = NULL; // In case we get an exception } mp_Q = WinCAPICryptoProvider::b642WinBN(b64, len, m_QLen); } void WinCAPICryptoKeyDSA::loadGBase64BigNums(const char * b64, unsigned int len) { if (mp_G != NULL) { delete[] mp_G; mp_G = NULL; // In case we get an exception } mp_G = WinCAPICryptoProvider::b642WinBN(b64, len, m_GLen); } void WinCAPICryptoKeyDSA::loadYBase64BigNums(const char * b64, unsigned int len) { if (mp_Y != NULL) { delete[] mp_Y; mp_Y = NULL; // In case we get an exception } mp_Y = WinCAPICryptoProvider::b642WinBN(b64, len, m_YLen); } void WinCAPICryptoKeyDSA::loadJBase64BigNums(const char * b64, unsigned int len) { /* Do nothing */ } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- void WinCAPICryptoKeyDSA::importKey(void) { if (m_key != 0 || mp_P == NULL || mp_Q == NULL || mp_G == NULL || mp_Y == NULL) return; // Do some basic checks if ((m_QLen > 20) | (m_GLen > m_PLen) | (m_YLen > m_PLen)) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Parameter lengths inconsistent"); } // Create a DSS Public-Key blob // First build a buffer to hold everything BYTE * blobBuffer; unsigned int blobBufferLen = WINCAPI_BLOBHEADERLEN + WINCAPI_DSSPUBKEYLEN + (3 * m_PLen) + 0x14 + WINCAPI_DSSSEEDLEN; XSECnew(blobBuffer, BYTE[blobBufferLen]); ArrayJanitor j_blobBuffer(blobBuffer); // Blob header BLOBHEADER * header = (BLOBHEADER *) blobBuffer; header->bType = PUBLICKEYBLOB; header->bVersion = 0x02; // We are using a version 2 blob header->reserved = 0; header->aiKeyAlg = CALG_DSS_SIGN; // Now the public key header DSSPUBKEY * pubkey = (DSSPUBKEY *) (blobBuffer + WINCAPI_BLOBHEADERLEN); pubkey->magic = 0x31535344; // ASCII encoding of DSS1 pubkey->bitlen = m_PLen * 8; // Number of bits in prime modulus // Now copy in each of the keys BYTE * i = (BYTE *) (pubkey); i += WINCAPI_DSSPUBKEYLEN; memcpy(i, mp_P, m_PLen); i+= m_PLen; // Q memcpy(i, mp_Q, m_QLen); i += m_QLen; // Pad with 0s unsigned int j; for (j = m_QLen; j < 20 ; ++j) *i++ = 0; // Generator memcpy(i, mp_G, m_GLen); i += m_GLen; // Pad for (j = m_GLen; j < m_PLen ; ++j) *i++ = 0; // Public key memcpy(i, mp_Y, m_YLen); i += m_YLen; // Pad for (j = m_YLen; j < m_PLen ; ++j) *i++ = 0; // Set seed to 0 for (j = 0; j < WINCAPI_DSSSEEDLEN; ++j) *i++ = 0xFF; // SEED Counter set to 0xFFFFFFFF will cause seed to be ignored // Now that we have the blob, import BOOL fResult = CryptImportKey( m_p, blobBuffer, blobBufferLen, 0, // Not signed 0, // No flags &m_key); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA Error attempting to import key parameters"); } } bool WinCAPICryptoKeyDSA::verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) { // Use the currently loaded key to validate the Base64 encoded signature if (m_key == 0) { // Try to import from the parameters importKey(); if (m_key == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Attempt to validate signature with empty key"); } } // Decode the signature unsigned char * rawSig; DWORD rawSigLen; XSECnew(rawSig, BYTE [sigLen]); ArrayJanitor j_rawSig(rawSig); // Decode the signature XSCryptCryptoBase64 b64; b64.decodeInit(); rawSigLen = b64.decode((unsigned char *) base64Signature, sigLen, rawSig, sigLen); rawSigLen += b64.decodeFinish(&rawSig[rawSigLen], sigLen - rawSigLen); // Reverse the sig - Windows stores integers as octet streams in little endian // order. The I2OSP algorithm used by XMLDSig to store integers is big endian BYTE rawSigFinal[40]; BYTE * j, *k, *l, *m; unsigned char rb[20]; unsigned char sb[20]; if (rawSigLen == 40) { j = rawSig; k = rawSig + 20; } else if (rawSigLen == 46 && ASN2DSASig(rawSig, rb, sb) == true) { j = rb; k = sb; } else { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA::VerifyBase64Signature - Expect 40 bytes in a DSA signature"); } l = rawSigFinal + 19; m = rawSigFinal + 39; while (l >= rawSigFinal) { *l-- = *j++; *m-- = *k++; } // Have to create a Windows hash object and feed in the hash BOOL fResult; HCRYPTHASH h; fResult = CryptCreateHash(m_p, CALG_SHA1, 0, 0, &h); if (!fResult) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error creating Windows Hash Object"); } // Feed the hash value into the newly created hash object fResult = CryptSetHashParam( h, HP_HASHVAL, hashBuf, 0); if (!fResult) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error Setting Hash Value in Windows Hash object"); } // Now validate fResult = CryptVerifySignature( h, rawSigFinal, 40, m_key, NULL, 0); if (!fResult) { DWORD error = GetLastError(); /* For some reason, the default Microsoft DSS provider generally returns * NTE_FAIL (which denotes an internal failure in the provider) for a * failed signature rather than NTE_BAD_SIGNATURE */ if (error != NTE_BAD_SIGNATURE && error != NTE_FAIL) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error occurred in DSA validation"); } if (h) CryptDestroyHash(h); return false; } if (h) CryptDestroyHash(h); return true; } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int WinCAPICryptoKeyDSA::signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) { // Sign a pre-calculated hash using this key if (m_keySpec == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Attempt to sign data a public or non-existent key"); } // Have to create a Windows hash object and feed in the hash BOOL fResult; HCRYPTHASH h; fResult = CryptCreateHash(m_p, CALG_SHA1, 0, 0, &h); if (!fResult) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error creating Windows Hash Object"); } // Feed the hash value into the newly created hash object fResult = CryptSetHashParam( h, HP_HASHVAL, hashBuf, 0); if (!fResult) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error Setting Hash Value in Windows Hash object"); } // Now sign BYTE rawSig[50]; DWORD rawSigLen = 50; fResult = CryptSignHash( h, m_keySpec, NULL, 0, rawSig, &rawSigLen); if (!fResult || rawSigLen != 40) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error occurred in DSA signing"); } if (h) CryptDestroyHash(h); // Now encode into a signature block BYTE rawSigFinal[40]; BYTE * i, * j, * m, * n; i = rawSig; j = rawSig + 20; m = rawSigFinal + 19; n = rawSigFinal + 39; while (m >= rawSigFinal) { *m-- = *i++; *n-- = *j++; } // Now encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned int ret = b64.encode(rawSigFinal, 40, (unsigned char *) base64SignatureBuf, base64SignatureBufLen); ret += b64.encodeFinish((unsigned char *) &base64SignatureBuf[ret], base64SignatureBufLen - ret); return ret; } // -------------------------------------------------------------------------------- // Clone key // -------------------------------------------------------------------------------- XSECCryptoKey * WinCAPICryptoKeyDSA::clone() const { WinCAPICryptoKeyDSA * ret; XSECnew(ret, WinCAPICryptoKeyDSA(m_p)); if (m_key != 0) { // CryptDuplicateKey is not supported in Windows NT, so we need to export and then // reimport the key to get a copy BYTE keyBuf[2048]; DWORD keyBufLen = 2048; CryptExportKey(m_key, 0, PUBLICKEYBLOB, 0, keyBuf, &keyBufLen); // Now re-import CryptImportKey(m_p, keyBuf, keyBufLen, NULL, 0, &ret->m_key); } ret->m_PLen = m_PLen; if (mp_P != NULL) { XSECnew(ret->mp_P, BYTE[m_PLen]); memcpy(ret->mp_P, mp_P, m_PLen); } else ret->mp_P = NULL; ret->m_QLen = m_QLen; if (mp_Q != NULL) { XSECnew(ret->mp_Q, BYTE[m_QLen]); memcpy(ret->mp_Q, mp_Q, m_QLen); } else ret->mp_Q = NULL; ret->m_GLen = m_GLen; if (mp_G != NULL) { XSECnew(ret->mp_G, BYTE[m_GLen]); memcpy(ret->mp_G, mp_G, m_GLen); } else ret->mp_G = NULL; ret->m_YLen = m_YLen; if (mp_Y != NULL) { XSECnew(ret->mp_Y, BYTE[m_YLen]); memcpy(ret->mp_Y, mp_Y, m_YLen); } else ret->mp_Y = NULL; return ret; } // -------------------------------------------------------------------------------- // Some utility functions // -------------------------------------------------------------------------------- void WinCAPICryptoKeyDSA::loadParamsFromKey(void) { if (m_key == 0) { if (m_keySpec == 0) return; // See of we can get the user key if (!CryptGetUserKey(m_p, m_keySpec, &m_key)) return; } // Export key into a keyblob BOOL fResult; DWORD blobLen; fResult = CryptExportKey( m_key, 0, PUBLICKEYBLOB, 0, NULL, &blobLen); if (fResult == 0 || blobLen < 1) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error exporting public key"); } BYTE * blob; XSECnew(blob, BYTE[blobLen]); ArrayJanitor j_blob(blob); fResult = CryptExportKey( m_key, 0, PUBLICKEYBLOB, 0, blob, &blobLen); if (fResult == 0 || blobLen < 1) { throw XSECCryptoException(XSECCryptoException::DSAError, "WinCAPI:DSA - Error exporting public key"); } DSSPUBKEY * pk = (DSSPUBKEY *) ( blob + WINCAPI_BLOBHEADERLEN ); DWORD keyLen = pk->bitlen / 8; // Copy the keys BYTE * i = (BYTE *) ( pk ); i += WINCAPI_DSSPUBKEYLEN; if (mp_P != NULL) delete[] mp_P; XSECnew(mp_P, BYTE[keyLen]); memcpy(mp_P, i, keyLen); m_PLen = keyLen; i+=keyLen; if (mp_Q != NULL) delete[] mp_Q; m_QLen = 20; while (i[m_QLen - 1] == 0 && m_QLen > 0) m_QLen--; XSECnew(mp_Q, BYTE[m_QLen]); memcpy(mp_Q, i, m_QLen); i+=20; if (mp_G != NULL) delete[] mp_G; m_GLen = keyLen; while(i[m_GLen - 1] == 0 && m_GLen > 0) m_GLen--; XSECnew(mp_G, BYTE[m_GLen]); memcpy(mp_G, i, m_GLen); i+=keyLen; if (mp_Y != NULL) delete[] mp_Y; m_YLen = keyLen; while (i[m_YLen] == 0 && m_YLen > 0) m_YLen--; XSECnew(mp_Y, BYTE[m_YLen]); memcpy(mp_Y, i, m_YLen); } unsigned int WinCAPICryptoKeyDSA::getPBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_P == NULL) { return 0; // Nothing we can do } if (mp_P == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_P, m_PLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } unsigned int WinCAPICryptoKeyDSA::getQBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_Q == NULL) { return 0; // Nothing we can do } if (mp_Q == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_Q, m_QLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } unsigned int WinCAPICryptoKeyDSA::getGBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_G == NULL) { return 0; // Nothing we can do } if (mp_G == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_G, m_GLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } unsigned int WinCAPICryptoKeyDSA::getYBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_Y == NULL) { return 0; // Nothing we can do } if (mp_Y == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_Y, m_YLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoHashHMAC.hpp000644 001751 001751 00000011513 12003301053 025023 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoHashHMAC := Windows CAPI Implementation of HMAC * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoHashHMAC.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOHASHHMAC_INCLUDE #define WINCAPICRYPTOHASHHMAC_INCLUDE #include #include #if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include class WinCAPICryptoProvider; /** * @ingroup wincapicrypto */ /** * \brief Implementation of HMAC Hash functions in the Windows providers * * Uses the Windows Crypt* API functions to implement an HMAC. * * Unfortunately the Windows Crypto API does not allow callers to enter an * HMAC key directly. It relies on a seed being entered into a digest * function that is then used to derive a key that can be used in an * HMAC function. * * Two types of key can therefore be used - a direct Windows key, or * a "standard" string as the HMAC key. In the latter case, the HMAC * function is implemented internally around a standard Windows * hash function. In the former case, the Windows HMAC functions are * used. (The latter case is mainly for interoperability testing, where * the key is provided and needs to be entered "as is". * */ class DSIG_EXPORT WinCAPICryptoHashHMAC : public XSECCryptoHash { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Create the object, with the indicated algorithm * (Currently supports MD5 and SHA1) * * * @param prov handle to a provider that supports the required algorithm. * Both PROV_RSA_FULL and PROV_DSS support MD5 and SHA1 * @param alg Digest algorithm to use */ WinCAPICryptoHashHMAC(HCRYPTPROV prov, XSECCryptoHash::HashType alg); virtual ~WinCAPICryptoHashHMAC(); //@} /** @name HMAC Functions */ //@{ /** *\brief Set the HMAC key * * Sets the key - which needs to have a base class of * WinCAPICryptoKeyHMAC. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key); //@} /** @name Hash functions */ //@{ /** * \brief Reset the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes). This is effectively the * signature for the data that has been run through the HMAC function. * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength); //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; //@} private: // Not implemented constructors WinCAPICryptoHashHMAC(); unsigned char m_mdValue[XSEC_MAX_HASH_SIZE]; // Final output unsigned int m_mdLen; ALG_ID m_algId; XSECCryptoHash::HashType m_hashType; HCRYPTPROV m_p; HCRYPTHASH m_h; unsigned char m_ipadKeyed[XSEC_MAX_HASH_SIZE]; unsigned char m_opadKeyed[XSEC_MAX_HASH_SIZE]; unsigned int m_blockSize; // Block size (bytes) for used alg. // Internal functions void eraseKeys(); }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOHASHHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyDSA.hpp000644 001751 001751 00000017075 12003301053 024600 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyDSA := DSA Keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyDSA.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOKEYDSA_INCLUDE #define WINCAPICRYPTOKEYDSA_INCLUDE #include #if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include class WinCAPICryptoProvider; /** * \ingroup wincapicrypto */ /** * \brief WinCAPI implementation class for DSA keys. * * The library uses classes derived from this to process DSA keys. */ class DSIG_EXPORT WinCAPICryptoKeyDSA : public XSECCryptoKeyDSA { public : /** @name Constructors and Destructors */ //@{ /** * \brief Ctor for DSA keys * * This constructor should be used for public keys that are going to be * loaded later via P, Q etc. * * @param prov A handle to the provider (and key store) that will be * used to hold the key being built (Obviously a provider type that supports * DSS, such as DSS_PROV) */ WinCAPICryptoKeyDSA(HCRYPTPROV prov); virtual ~WinCAPICryptoKeyDSA(); /** * \brief WinCAPI Specific constructor for public keys * * Create a DSA key for use in XSEC from an existing public HCRYPTKEY * * @param prov A handle to the CSP to be used for operations under this key. * @param k The key to use * @note k is owned by the library. When the wrapper * WinCAPICryptoKeyDSA is deleted, k will be destroyed using * CryptDestroyKey(). Note also that prov will not be released. */ WinCAPICryptoKeyDSA(HCRYPTPROV prov, HCRYPTKEY k); /** * \brief WinCAPI Specific constructor for private keys * * Create a DSA key for use in XSEC from a passed in handle to a provider * and associated key store * * @param prov A handle to the CSP to be used and read for the key. * @param keySpec The Key to use (AT_SIGNATURE or AT_KEYEXCHANGE) * @param isPrivate Should be true. In future, may be able to define public * keys this way as well. * @note The prov will not be released on close. */ WinCAPICryptoKeyDSA(HCRYPTPROV prov, DWORD keySpec, bool isPrivate); //@} /** @name Required Key Interface methods */ //@{ /** * \brief Return the type of this key. * * Allows the caller (and library) to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** *\brief Return the WiNCAPI string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVWinCAPI;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Required DSA methods */ //@{ /** * \brief Create a signature * * Sign the buffer using the internal private key. Will throw a DSAError * if the key is not set, or is not a private key. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen); /** * \brief Verify a signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen); //@} /** @name Optional Interface methods * * Have been fully implemented in the WinCAPI interface to allow interop * testing to occur. * */ //@{ /** * \brief Load P * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadPBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Q * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadQBase64BigNums(const char * b64, unsigned int len); /** * \brief Load G * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadGBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Y * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadYBase64BigNums(const char * b64, unsigned int len); /** * \brief Load J * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadJBase64BigNums(const char * b64, unsigned int len); //@} /** @name WinCAPI Specific functions */ //@{ /** * \brief Retrieve P * * @param b64 Buffer to place ds:CryptoBinary encoded P parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getPBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve Q * * @param b64 Buffer to place ds:CryptoBinary encoded Q parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getQBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve G * * @param b64 Buffer to place ds:CryptoBinary encoded G parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getGBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve Y * * @param b64 Buffer to place ds:CryptoBinary encoded Y parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getYBase64BigNums(char * b64, unsigned int len); //@} private: HCRYPTPROV m_p; HCRYPTKEY m_key; // For a public key DWORD m_keySpec; // For a private key BYTE * mp_P; BYTE * mp_Q; BYTE * mp_G; BYTE * mp_Y; unsigned int m_PLen; unsigned int m_QLen; unsigned int m_GLen; unsigned int m_YLen; // Instruct to import from parameters void importKey(void); void loadParamsFromKey(void); // No default constructor WinCAPICryptoKeyDSA(); }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOKEYDSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoSymmetricKey.hpp000644 001751 001751 00000025214 12003301053 026137 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoSymmetricKey.hpp 1352680 2012-06-21 20:58:07Z scantor $ * */ #ifndef WINCAPICRYPTOSYMMETRICKEY_INCLUDE #define WINCAPICRYPTOSYMMETRICKEY_INCLUDE #include #include #if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include #define WINCAPI_MAX_BLOCK_SIZE 32 /** * \ingroup wincapicrypto */ /** * \brief Base interface definition for symmetric key material. * * This is the implementation for a wrapper of Windows CryptoAPI symmetric * crypto functions. */ class DSIG_EXPORT WinCAPICryptoSymmetricKey : public XSECCryptoSymmetricKey { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Can only construct a Symmetric key if we know what type it is * * @param prov The appropriate provider that supports the required algorithm. * Can be 0 if the app is going to pass in an octet via setKey, as the library * will use its own internal key store and handle to CSP. * @param type The type of key (i.e. algorithm) to create **/ WinCAPICryptoSymmetricKey(HCRYPTPROV prov, XSECCryptoSymmetricKey::SymmetricKeyType type); /** * \brief Destructor * * Implementations must ensure that the held key is properly destroyed * (overwritten) when key objects are deleted. */ virtual ~WinCAPICryptoSymmetricKey(); //@} /** @name Basic CryptoKey Interface methods */ //@{ /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVWinCAPI;} /** * \brief Clone the key * * All keys need to be able to copy themselves and return * a pointer to the copy. This allows the library to * duplicate keys. */ virtual XSECCryptoKey * clone() const; //@} /** @name Symmetric key interface methods */ //@{ /** * \brief What type of symmetric key is this? * * There are a number of different types of symmetric key. * This method allows callers to determine the type of this * particular key */ SymmetricKeyType getSymmetricKeyType(void) const {return m_keyType;} /** * \brief Set the key from the provided bytes * * Symmetric keys can all be loaded from a buffer containing a series * of bytes. * * @param key The buffer containing the key bytes * @param keyLen The number of key bytes in the buffer * */ void setKey(const unsigned char * key, unsigned int keyLen); /** * \brief Initialise an decryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations should assume that the start of the * cipher text stream will in fact be the IV. * * @param doPad By default, we perform padding for last block * @param mode mode selection (Currently ECB or CBC mode only) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV will be set from data stream * @param tag Authentication tag to be used for AEAD ciphers * @param taglen length of Authentication Tag * @returns true if the initialisation succeeded. */ virtual bool decryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL, const unsigned char* tag = NULL, unsigned int taglen = NULL); /** * \brief Continue an decrypt operation using this key. * * Decryption must have been set up using an encryptInit * call. Takes the inBuf and continues a decryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be decrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * cipher-text to be handles during the next operation. * * @note While maxOutLength is defined, the WinCAPI library will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param inBuf Octets to be decrypted * @param plainBuf Buffer to place output in * @param inLength Number of bytes to decrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a decryption operation * * Complete a decryption process. No cipher text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer. * * May throw an exception if there is some stored cipher text * that is not the length of the block size for block algorithms. * * @note While maxOutLength is defined, the WinCAPI library will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param plainBuf Buffer to place any remaining plain text in * @param maxOutLength Maximum number of bytes to pace in output * @returns Bytes placed in output buffer */ virtual unsigned int decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength); /** * \brief Initialise an encryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations are required to generate one. * * @param doPad By default, we perform padding for last block * @param mode What mode to handle blocks (Currently CBC or ECB) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV is to be generated * @returns true if the initialisation succeeded. */ virtual bool encryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL); /** * \brief Continue an encryption operation using this key. * * Encryption must have been set up using an encryptInit * call. Takes the inBuf and continues a encryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be encrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * plain-text to be handled during the next operation. * * @param inBuf Octets to be encrypted * @param cipherBuf Buffer to place output in * @param inLength Number of bytes to encrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a encryption operation * * Complete a encryption process. No plain text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer and creating a final padded block. * * Padding is performed by taking the remaining block, and * setting the last byte to equal the number of bytes of * padding. If the plain was an exact multiple of the block size, * then an extra block of padding will be used. For example, if * the block size is 8 bytes, and there were three remaining plain * text bytes (0x01, 0x02 and 0x03), the final block will be : * * 0x010203????????05 * * @param plainBuf Buffer to place final block of cipher text in * @param maxOutLength Maximum number of bytes to pace in output * @param taglen length of Authentication Tag * @returns Bytes placed in output buffer */ virtual unsigned int encryptFinish(unsigned char * plainBuf, unsigned int maxOutLength, unsigned int taglen = 0); //@} /** @name Windows utility functions */ //@{ /** * \brief Create a symmetric key from a octet string * * Uses the ApacheKeyStore to wrap an octet string in a public key * and then load it into the Apache Key Container within the defined * CSP * * @param key The buffer of bytes to load from * @param keyLen The number of bytes to load * @param type The key type to create from the bytes * @param prov If NULL, ignored. If non-null, but *prov == 0, the * function will use an internal handle to a CSP and return the value * in *prov. If *prov != 0, use contents of *prov as the provider to * load the key into. NOTE - The provider must have a * AT_KEYEXCHANGE key pair available. * @returns a pointer to the key or 0 on failure */ static HCRYPTKEY createWindowsKey(const unsigned char * key, unsigned int keyLen, XSECCryptoSymmetricKey::SymmetricKeyType type, HCRYPTPROV * prov); private: // Unimplemented constructors WinCAPICryptoSymmetricKey(); WinCAPICryptoSymmetricKey(const WinCAPICryptoSymmetricKey &); WinCAPICryptoSymmetricKey & operator= (const WinCAPICryptoSymmetricKey &); int decryptCtxInit(const unsigned char * iv); void encryptCtxInit(const unsigned char * iv); // Private variables SymmetricKeyType m_keyType; SymmetricKeyMode m_keyMode; // ECB or CBC safeBuffer m_keyBuf; // Holder of the key unsigned int m_keyLen; bool m_initialised; bool m_doPad; unsigned char m_lastBlock[WINCAPI_MAX_BLOCK_SIZE]; unsigned int m_bytesInLastBlock; unsigned int m_blockSize; unsigned int m_ivSize; HCRYPTPROV m_p; HCRYPTKEY m_k; }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOSYMMETRICKEY_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoX509.hpp000644 001751 001751 00000010305 12003301053 024152 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoX509:= Windows CAPI based class for handling X509 (V3) certificates * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoX509.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOX509_INCLUDE #define WINCAPICRYPTOX509_INCLUDE #include #include #if defined (XSEC_HAVE_WINCAPI) #define _WIN32_WINNT 0x0400 #include class WinCAPICryptoProvider; /** * \brief WinCAPI implementation class for interface for X509 certificates. * @ingroup wincapicrypto * * The library uses classes derived from this to process X509 Certificates. * */ class DSIG_EXPORT WinCAPICryptoX509 : public XSECCryptoX509 { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor for X509 objects * * The windows constructor requires RSA or DSS crypto providers, * depending on the key type within the cert. * * @param provRSA A handle to the PROV_RSA_FULL type provider that the * interface should use when importing keys and manipulating certs * @param provDSS A handle to the PROV_DSS type provider that the * interface should use when importing keys and manipulating certs */ WinCAPICryptoX509(HCRYPTPROV provRSA, HCRYPTPROV provDSS); /** * \brief Constructor for X509 objects * * @param pCertContext A certificate handle * @param provRSA A handle to the PROV_RSA_FULL type provider that the * interface should use when importing keys and manipulating certs * @param provDSS A handle to the PROV_DSS type provider that the * interface should use when importing keys and manipulating certs */ WinCAPICryptoX509(PCCERT_CONTEXT pCertContext, HCRYPTPROV provRSA, HCRYPTPROV provDSS); virtual ~WinCAPICryptoX509(); //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of the key stored in the certificate. * * Will extract the key from the certificate to return the appropriate * type * */ virtual XSECCryptoKey::KeyType getPublicKeyType() const; /** * \brief Get a copy of the public key. * * Extracts the public key from the certificate and returns the appropriate * WinCAPICryrptoKey (DSA or RSA) object * */ virtual XSECCryptoKey * clonePublicKey() const; /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVWinCAPI;} //@} /** @name Load and Get the certificate */ //@{ /** * \brief Load a certificate into the object. * * Take a base64 DER encoded certificate and load. * * @param buf A buffer containing the Base64 encoded certificate * @param len The number of bytes of data in the certificate. */ virtual void loadX509Base64Bin(const char * buf, unsigned int len); /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual safeBuffer &getDEREncodingSB(void) {return m_DERX509;} /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual const safeBuffer &getDEREncodingSB(void) const {return m_DERX509;} //@} private: safeBuffer m_DERX509; PCCERT_CONTEXT mp_certContext; HCRYPTPROV m_pRSA; HCRYPTPROV m_pDSS; }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOX509_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp000644 001751 001751 00000024732 12003301053 024614 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyRSA := Windows implementation of RSA Keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyRSA.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef WINCAPICRYPTOKEYRSA_INCLUDE #define WINCAPICRYPTOKEYRSA_INCLUDE #include #if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include class WinCAPICryptoProvider; /** * \ingroup wincapicrypto */ /** * \brief WinCAPI implementation of the interface class for RSA keys. * * The library uses classes derived from this to process RSA keys. */ class DSIG_EXPORT WinCAPICryptoKeyRSA : public XSECCryptoKeyRSA { public : /** @name Constructors and Destructors */ //@{ /** * \brief Create an RSA key * * Constructor used to create an "empty" RSA key, that the * library will later set parameters for the public key within. * * @param prov A handle to a PROV_RSA_FULL provider that the * library will eventually import the key into */ WinCAPICryptoKeyRSA(HCRYPTPROV prov); /** * \brief Dedicated WinCAPI constructor for a public RSA key * * Create a public RSA key for use in XSEC from an existing HCRYPTKEY * * @param prov The handle to the provider that was used to create the key * @param k The key to use * @note k is owned by the library. When the wrapper * WinCAPICryptoKeyRSA is deleted, k will be destroyed using * CryptDestroyKey() */ WinCAPICryptoKeyRSA(HCRYPTPROV prov, HCRYPTKEY k); /** * \brief Dedicated WinCAPI constructor for a private RSA key * * Create a public RSA key for use in XSEC from an keySpec * * @param prov The handle to the provider that was used to create the key * @param keySpec The key to use (AT_SIGNATURE or AT_KEYEXCHANGE * @param isPrivate Should be true. May be used later for public * keys created this way */ WinCAPICryptoKeyRSA(HCRYPTPROV prov, DWORD keySpec, bool isPrivate); virtual ~WinCAPICryptoKeyRSA(); //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For RSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** * \brief Return the WinCAPI identifier string */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVWinCAPI;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Mandatory RSA interface methods * * These classes are required by the library. */ //@{ /** * \brief Set the OAEPparams string * * By default, the library expects crypto implementations to perform * OAEP padding with no params. This call allows the library (or user) * to set a params value prior to an encrypt/decrypt operation. * * @param params buffer containing the params data. Pass in NULL to clear any * old paramters. * @param paramsLen number of bytes in buffer to use. Pass in 0 to clear any * old parameters. * @note The Microsoft Crypto RSA_AES and RSA_FULL providers do not support * the ability to set OAEP parameters, so this will throw an * XSECCryptoException::UnsupportedError, unless the passed in paramters * are NULL and 0 (to clear). */ virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen); /** * \brief Get OAEPparams Length * * @returns the number of bytes of the OAEPparams buffer (assuming it has been set) * @note The Microsoft Crypto RSA_AES and RSA_FULL providers do not support * the ability to set OAEP parameters, so this will always return 0 */ virtual unsigned int getOAEPparamsLen(void) const; /** * \brief Get the OAEPparams * * @returns a pointer to the (crypto object owned) buffer holding the OAEPparams * or NULL if no params are held * @note The Microsoft Crypto RSA_AES and RSA_FULL providers do not support * the ability to set OAEP parameters, so this will always return NULL */ virtual const unsigned char * getOAEPparams(void) const; /** * \brief Set the MGF * * By default, the library expects crypto implementations to perform * OAEP padding with MGF_SHA1. This call allows the library (or user) * to set a different choice. * * @param mgf the MGF constant identifying the function to use */ virtual void setMGF(maskGenerationFunc mgf); /** * \brief Get the MGF * * @returns the MGF constant in use */ virtual enum maskGenerationFunc getMGF(void) const; /** * \brief Verify a SHA1 PKCS1 encoded signature * * The library will call this function to validate an RSA signature * The standard by default uses SHA1 in a PKCS1 encoding. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @param hm The hash method that was used to create the hash that is being * passed in * @returns true if the signature was valid, false otherwise */ virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm); /** * \brief Create a signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature will * be Base64 encoded such that it can be placed directly into the * XML document * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer * @param hm The hash method that was used to create the hash that is being * passed in */ virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm); /** * \brief Decrypt using private key * * The library will call this function to decrypt a piece of cipher * text using the private component of this key. * * @param inBuf cipher text to decrypt * @param plainBuf output buffer for decrypted bytes * @param inLength bytes of cipher text to decrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Encrypt using a public key * * The library will call this function to encrypt a plain text buffer * using the public component of this key. * * @param inBuf plain text to decrypt * @param cipherBuf output buffer for decrypted bytes * @param inLength bytes of plain text to encrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Obtain the length of an RSA key * * @returns The length of the rsa key (in bytes) */ virtual unsigned int getLength(void) const; //@} /** @name Optional Interface methods * * Have been implemented to allow interoperability testing */ //@{ /** * \brief Load the modulus * * Load the modulus from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len); /** * \brief Load the exponent * * Load the exponent from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len); //@} /** @name WinCAPI Specific Functions */ //@{ /** * \brief Retrieve the exponent * * Retrieves the exponent in ds:CryptoBinary encoded format * * @param b64 Buffer to place encoded exponent into * @param len Maximum number of bytes to place in buffer * @returns The number of bytes placed in the buffer */ unsigned int getExponentBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve the modulus * * Retrieves the modulus in ds:CryptoBinary encoded format * * @param b64 Buffer to place the encoded modulus into * @param len Maximum number of bytes to place in buffer * @returns The number of bytes placed in the buffer */ unsigned int getModulusBase64BigNums(char * b64, unsigned int len); /** * \brief Import key and return it * * Retrieves the RSA key as HCRYPTKEY * * @returns The key */ HCRYPTKEY importKey(void); //@} private: HCRYPTPROV m_p; HCRYPTKEY m_key; // For a public key DWORD m_keySpec; // For a private key BYTE * mp_modulus; BYTE * mp_exponent; unsigned int m_modulusLen; unsigned int m_exponentLen; // Instruct to import from parameters void loadParamsFromKey(void); }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOKEYRSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoX509.cpp000644 001751 001751 00000013064 12003301053 024152 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoX509:= Windows CAPI based class for handling X509 (V3) certificates * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoX509.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include XSEC_USING_XERCES(ArrayJanitor); WinCAPICryptoX509::WinCAPICryptoX509(HCRYPTPROV provRSA, HCRYPTPROV provDSS) : m_DERX509(""), mp_certContext(NULL), m_pRSA(provRSA), m_pDSS(provDSS) { } WinCAPICryptoX509::WinCAPICryptoX509(PCCERT_CONTEXT pCertContext, HCRYPTPROV provRSA, HCRYPTPROV provDSS) : m_pRSA(provRSA), m_pDSS(provDSS) { // Build this from an existing PCCERT_CONTEXT structure mp_certContext = pCertContext; unsigned char * encCert; unsigned long len = mp_certContext->cbCertEncoded * 2; XSECnew(encCert, unsigned char [len]); ArrayJanitor j_encCert(encCert); // Base64 Encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned long encCertLen = b64.encode(mp_certContext->pbCertEncoded, mp_certContext->cbCertEncoded, encCert, len); encCertLen += b64.encodeFinish(&encCert[encCertLen], len - encCertLen); // Check the result if (encCert == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPIX509:WinCAPIX509 - Error encoding certificate"); } m_DERX509.sbMemcpyIn(encCert, encCertLen); m_DERX509[encCertLen] = '\0'; } WinCAPICryptoX509::~WinCAPICryptoX509() { if (mp_certContext != NULL) CertFreeCertificateContext(mp_certContext); } // load functions void WinCAPICryptoX509::loadX509Base64Bin(const char * buf, unsigned int len) { unsigned char * rawCert; XSECnew(rawCert, unsigned char [len]); ArrayJanitor j_rawCert(rawCert); // Base64 Decode XSCryptCryptoBase64 b64; b64.decodeInit(); unsigned int rawCertLen = b64.decode((unsigned char *) buf, len, rawCert, len); rawCertLen += b64.decodeFinish(&rawCert[rawCertLen], len - rawCertLen); // Now load certificate into Win32 CSP mp_certContext = CertCreateCertificateContext( X509_ASN_ENCODING, rawCert, rawCertLen); if (mp_certContext == 0) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPIX509:loadX509Base64Bin - Error decoding certificate"); } m_DERX509.sbMemcpyIn(buf, len); m_DERX509[len] = '\0'; } // Info functions XSECCryptoKey::KeyType WinCAPICryptoX509::getPublicKeyType() const { if (mp_certContext == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPI:X509 - getPublicKeyType called before X509 loaded"); } if (lstrcmp(mp_certContext->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, CRYPTO_OID_DSA) == 0) return XSECCryptoKey::KEY_DSA_PUBLIC; if (lstrcmp(mp_certContext->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_RSA_RSA) == 0) return XSECCryptoKey::KEY_RSA_PUBLIC; return XSECCryptoKey::KEY_NONE; } // Get functions XSECCryptoKey * WinCAPICryptoX509::clonePublicKey() const { if (mp_certContext == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPI:X509 - clonePublicKey called before X509 loaded"); } // Import the key into the provider to get a pointer to the key HCRYPTKEY key; BOOL fResult; if (getPublicKeyType() == XSECCryptoKey::KEY_DSA_PUBLIC) { fResult= CryptImportPublicKeyInfo( m_pDSS, X509_ASN_ENCODING, &(mp_certContext->pCertInfo->SubjectPublicKeyInfo), &key); if (fResult == FALSE) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPI:X509 - Error loading public key info from certificate"); } // Now that we have a handle for the DSA key, create a DSA Key object to // wrap it in WinCAPICryptoKeyDSA * ret; XSECnew(ret, WinCAPICryptoKeyDSA(m_pDSS, key)); return ret; } if (getPublicKeyType() == XSECCryptoKey::KEY_RSA_PUBLIC) { fResult= CryptImportPublicKeyInfo( m_pRSA, X509_ASN_ENCODING, &(mp_certContext->pCertInfo->SubjectPublicKeyInfo), &key); if (fResult == FALSE) { throw XSECCryptoException(XSECCryptoException::X509Error, "WinCAPI:X509 - Error loading public key info from certificate"); } // Now that we have a handle for the DSA key, create a DSA Key object to // wrap it in WinCAPICryptoKeyRSA * ret; XSECnew(ret, WinCAPICryptoKeyRSA(m_pRSA, key)); return ret; } return NULL; // Unknown key type, but not necessarily an error } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoHashHMAC.cpp000644 001751 001751 00000022567 12003301053 025031 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoHashHMAC := Windows CAPI Implementation of Message digests * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoHashHMAC.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include // -------------------------------------------------------------------------------- // IPAD/OPAD definitions // -------------------------------------------------------------------------------- static unsigned char ipad[] = { 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, }; static unsigned char opad[] = { 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, }; // -------------------------------------------------------------------------------- // Constructors/Destructors // -------------------------------------------------------------------------------- WinCAPICryptoHashHMAC::WinCAPICryptoHashHMAC(HCRYPTPROV prov, HashType alg) { m_p = prov; m_h = 0; m_blockSize = 64; // We only know SHA-1 and MD5 at this time - both are 64 bytes switch (alg) { case (XSECCryptoHash::HASH_SHA1) : m_algId = CALG_SHA; break; case (XSECCryptoHash::HASH_MD5) : m_algId = CALG_MD5; break; default : m_algId = 0; } if(m_algId == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Unknown algorithm"); } m_hashType = alg; } void WinCAPICryptoHashHMAC::reset() { if (m_h != 0) CryptDestroyHash(m_h); } WinCAPICryptoHashHMAC::~WinCAPICryptoHashHMAC() { if (m_h != 0) CryptDestroyHash(m_h); } // -------------------------------------------------------------------------------- // Key manipulation // -------------------------------------------------------------------------------- void WinCAPICryptoHashHMAC::eraseKeys(void) { // Overwrite the ipad/opad calculated key values unsigned char * i = m_ipadKeyed; unsigned char * j = m_opadKeyed; for (unsigned int k = 0; k < XSEC_MAX_HASH_BLOCK_SIZE; ++k) { *i++ = 0; *j++ = 0; } } void WinCAPICryptoHashHMAC::setKey(XSECCryptoKey *key) { BOOL fResult; // Use this to initialise the ipadKeyed/opadKeyed values if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:HashHMAC - Non HMAC Key passed to HashHMAC"); } if (m_blockSize > XSEC_MAX_HASH_BLOCK_SIZE) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:HashHMAC - Internal error - have got a blocksize bigger than I can handle"); } // Check to see if this is an internal Windows Key if (strEquals(key->getProviderName(), DSIGConstants::s_unicodeStrPROVWinCAPI) && ((WinCAPICryptoKeyHMAC *) key)->getWinKey() != 0) { // Over-ride the local provider for this HCRYPTPROV p = ((WinCAPICryptoKeyHMAC *) key)->getWinKeyProv(); HCRYPTKEY k = ((WinCAPICryptoKeyHMAC *) key)->getWinKey(); fResult = CryptCreateHash( p, CALG_HMAC, k, 0, &m_h); if (fResult == 0 || m_h == 0) { DWORD error = GetLastError(); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::setKey - Error creating internally keyed hash object"); } // Set the HMAC algorithm HMAC_INFO hi; hi.HashAlgid = m_algId; hi.pbInnerString = NULL; // Use default inner and outer strings hi.cbInnerString = 0; hi.pbOuterString = NULL; hi.cbOuterString = 0; fResult = CryptSetHashParam( m_h, HP_HMAC_INFO, (BYTE *) &hi, 0); if (fResult == 0 || m_h == 0) { DWORD error = GetLastError(); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::setKey - Error setting HASH_INFO object"); } return; } // Need to load from raw bit string safeBuffer keyBuf; unsigned int keyLen = ((XSECCryptoKeyHMAC *) key)->getKey(keyBuf); if (keyLen > m_blockSize) { HCRYPTHASH h; fResult = CryptCreateHash( m_p, m_algId, 0, 0, &h); if (fResult == 0 || h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::setKey - Error creating hash object"); } fResult = CryptHashData( h, keyBuf.rawBuffer(), keyLen, 0); if (fResult == 0 || h == 0) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::setKey - Error hashing key data"); } BYTE outData[XSEC_MAX_HASH_SIZE]; DWORD outDataLen = XSEC_MAX_HASH_SIZE; CryptGetHashParam( h, HP_HASHVAL, outData, &outDataLen, 0); if (fResult == 0 || h == 0) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::setKey - Error getting hash result"); } keyBuf.sbMemcpyIn(outData, outDataLen); keyLen = outDataLen; if (h) CryptDestroyHash(h); } // Now create the ipad and opad keyed values memcpy(m_ipadKeyed, ipad, m_blockSize); memcpy(m_opadKeyed, opad, m_blockSize); // XOR with the key for (unsigned int i = 0; i < keyLen; ++i) { m_ipadKeyed[i] = keyBuf[i] ^ m_ipadKeyed[i]; m_opadKeyed[i] = keyBuf[i] ^ m_opadKeyed[i]; } // Now create the hash object, and start with the ipad operation fResult = CryptCreateHash( m_p, m_algId, 0, 0, &m_h); if (fResult == 0 || m_h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:HashHMAC - Error creating hash object"); } fResult = CryptHashData( m_h, m_ipadKeyed, m_blockSize, 0); if (fResult == 0 || m_h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:HashHMAC - Error performing initial ipad digest"); } } // -------------------------------------------------------------------------------- // Hash operations // -------------------------------------------------------------------------------- void WinCAPICryptoHashHMAC::hash(unsigned char * data, unsigned int length) { if (m_h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:HashHMAC::hash() - Called prior to setting key"); } BOOL fResult = CryptHashData( m_h, data, length, 0); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Error Hashing Data"); } } unsigned int WinCAPICryptoHashHMAC::finish(unsigned char * hash, unsigned int maxLength) { DWORD retLen; BOOL fResult; retLen = XSEC_MAX_HASH_SIZE; fResult = CryptGetHashParam( m_h, HP_HASHVAL, m_mdValue, &retLen, 0); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash - Error getting hash value"); } // Perform the opad operation HCRYPTHASH h; fResult = CryptCreateHash( m_p, m_algId, 0, 0, &h); if (fResult == 0 || h == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::finish - Error creating hash object for opad operation"); } fResult = CryptHashData( h, m_opadKeyed, m_blockSize, 0); if (fResult == 0 || h == 0) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::finish - Error hashing opad data"); } fResult = CryptHashData( h, m_mdValue, retLen, 0); if (fResult == 0 || h == 0) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:Hash::finish - Error hashing ipad hash to opad"); } // Read out the final hash retLen = XSEC_MAX_HASH_SIZE; fResult = CryptGetHashParam( h, HP_HASHVAL, m_mdValue, &retLen, 0); CryptDestroyHash(h); m_mdLen = retLen; retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return (unsigned int) retLen; } // Get information XSECCryptoHash::HashType WinCAPICryptoHashHMAC::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoHash.hpp000644 001751 001751 00000007663 12003301053 024405 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoHash := Windows CAPI Implementation of Message digests * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoHash.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOHASH_INCLUDE #define WINCAPICRYPTOHASH_INCLUDE #include #include # if defined (XSEC_HAVE_WINCAPI) #if !defined(_WIN32_WINNT) # define _WIN32_WINNT 0x0400 #endif #include #define WINCAPI_MAX_HASH_SIZE 256 class WinCAPICryptoProvider; /** * @ingroup wincapicrypto */ /** * \brief Windows Crypto API Implementation of Hash functions. * * Uses the Windows Crypt functions to perform digest functions. * */ class DSIG_EXPORT WinCAPICryptoHash : public XSECCryptoHash { public : /** @name Constructors/Destructors */ //@{ /** * \brief Construct a Hash object * * Creates a Windows Crypto API based hash object of the required * type. * * @param prov handle to a provider that supports the required algorithm. * Both PROV_RSA_FULL and PROV_DSS support MD5 and SHA1 * @param alg The algorithm to use for digest operations */ WinCAPICryptoHash(HCRYPTPROV prov, XSECCryptoHash::HashType alg); virtual ~WinCAPICryptoHash(); //@} /** @name HMAC Functions */ //@{ /** *\brief * * Does nothing. If the required function is an HMAC function, * then WinCAPICryptoHashHMAC should be used. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key) {} //@} /** @name Digest/Hash functions */ //@{ /** * \brief Rest the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes) * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength);// Finish and get hash //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; //@} private: // Not implemented constructors WinCAPICryptoHash(); unsigned char m_mdValue[WINCAPI_MAX_HASH_SIZE]; // Final output unsigned int m_mdLen; XSECCryptoHash::HashType m_hashType; HCRYPTPROV m_p; HCRYPTHASH m_h; }; #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOHASHSHA1_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp000644 001751 001751 00000047053 12003301053 024610 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyRSA := RSA Keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyRSA.cpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #include #include #include #include #include #if defined (XSEC_HAVE_WINCAPI) #include XSEC_USING_XERCES(ArrayJanitor); #if !defined (CRYPT_OAEP) # define CRYPT_OAEP 0x00000040 # define KP_OAEP_PARAMS 36 #endif #if !defined (CRYPT_DECRYPT_RSA_NO_PADDING_CHECK) # define CRYPT_DECRYPT_RSA_NO_PADDING_CHECK 0x00000020 #endif WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA(HCRYPTPROV prov) { // Create a new key to be loaded as we go m_key = 0; m_p = prov; m_keySpec = 0; mp_exponent = NULL; m_exponentLen = 0; mp_modulus = NULL; m_modulusLen = 0; }; WinCAPICryptoKeyRSA::~WinCAPICryptoKeyRSA() { // If we have a RSA, delete it if (m_key != 0) CryptDestroyKey(m_key); if (mp_exponent) delete[] mp_exponent; if (mp_modulus) delete[] mp_modulus; }; WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA(HCRYPTPROV prov, HCRYPTKEY k) : m_p(prov) { m_key = k; // NOTE - We OWN this handle m_keySpec = 0; mp_exponent = mp_modulus = NULL; m_exponentLen = m_modulusLen = 0; } WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA(HCRYPTPROV prov, DWORD keySpec, bool isPrivate) : m_p(prov) { if (isPrivate == false) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPICryptoKeyRSA - Public keys defined via keySpec ctor not yet supported"); } if (!CryptGetUserKey(prov, keySpec, &m_key)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA Unable to retrieve user key"); } //m_key = 0; m_keySpec = keySpec; mp_exponent = mp_modulus = NULL; m_exponentLen = m_modulusLen = 0; } // Generic key functions XSECCryptoKey::KeyType WinCAPICryptoKeyRSA::getKeyType() const { // Find out what we have if (m_key == 0) { if (m_keySpec != 0) return KEY_RSA_PRIVATE; if (mp_exponent == NULL || mp_modulus == NULL) return KEY_NONE; else return KEY_RSA_PUBLIC; } if (m_keySpec != 0) return KEY_RSA_PAIR; return KEY_RSA_PUBLIC; } // -------------------------------------------------------------------------------- // OAEP parameters handling // -------------------------------------------------------------------------------- void WinCAPICryptoKeyRSA::setOAEPparams(unsigned char * params, unsigned int paramsLen) { if (params != NULL && paramsLen != 0) throw XSECCryptoException(XSECCryptoException::UnsupportedError, "WinCAPI::setOAEPParams - OAEP parameters are not supported by Windows Crypto API"); } void WinCAPICryptoKeyRSA::setMGF(maskGenerationFunc mgf) { if (mgf != MGF1_SHA1) throw XSECCryptoException(XSECCryptoException::UnsupportedError, "WinCAPI::setMGF - Windows Crypto API does not support pluggable MGF for OAEP"); } unsigned int WinCAPICryptoKeyRSA::getOAEPparamsLen(void) const { return 0; } const unsigned char * WinCAPICryptoKeyRSA::getOAEPparams(void) const { return NULL; } maskGenerationFunc WinCAPICryptoKeyRSA::getMGF() const { return MGF1_SHA1; } // -------------------------------------------------------------------------------- // Load key from parameters // -------------------------------------------------------------------------------- void WinCAPICryptoKeyRSA::loadPublicModulusBase64BigNums(const char * b64, unsigned int len) { if (mp_modulus != NULL) { delete[] mp_modulus; mp_modulus = NULL; // In case we get an exception } mp_modulus = WinCAPICryptoProvider::b642WinBN(b64, len, m_modulusLen); } void WinCAPICryptoKeyRSA::loadPublicExponentBase64BigNums(const char * b64, unsigned int len) { if (mp_exponent != NULL) { delete[] mp_exponent; mp_exponent = NULL; // In case we get an exception } mp_exponent = WinCAPICryptoProvider::b642WinBN(b64, len, m_exponentLen); } HCRYPTKEY WinCAPICryptoKeyRSA::importKey(void) { if (m_key != 0 || mp_exponent == NULL || mp_modulus == NULL) return m_key; // Create a RSA Public-Key blob // First build a buffer to hold everything BYTE * blobBuffer; unsigned int blobBufferLen = WINCAPI_BLOBHEADERLEN + WINCAPI_RSAPUBKEYLEN + m_modulusLen; XSECnew(blobBuffer, BYTE[blobBufferLen]); ArrayJanitor j_blobBuffer(blobBuffer); // Blob header BLOBHEADER * header = (BLOBHEADER *) blobBuffer; header->bType = PUBLICKEYBLOB; header->bVersion = 0x02; // We are using a version 2 blob header->reserved = 0; header->aiKeyAlg = CALG_RSA_SIGN; // Now the public key header RSAPUBKEY * pubkey = (RSAPUBKEY *) (blobBuffer + WINCAPI_BLOBHEADERLEN); pubkey->magic = 0x31415352; // ASCII encoding of RSA1 pubkey->bitlen = m_modulusLen * 8; // Number of bits in prime modulus pubkey->pubexp = 0; BYTE * i = ((BYTE *) &(pubkey->pubexp)); for (unsigned int j = 0; j < m_exponentLen; ++j) *i++ = mp_exponent[j]; // Now copy in the modulus i = (BYTE *) (pubkey); i += WINCAPI_RSAPUBKEYLEN; memcpy(i, mp_modulus, m_modulusLen); // Now that we have the blob, import BOOL fResult = CryptImportKey( m_p, blobBuffer, blobBufferLen, 0, // Not signed 0, // No flags &m_key); if (fResult == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA Error attempting to import key parameters"); } return m_key; } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool WinCAPICryptoKeyRSA::verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm) { // Use the currently loaded key to validate the Base64 encoded signature if (m_key == 0) { // Try to import from the parameters importKey(); if (m_key == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Attempt to validate signature with empty key"); } } /* Is this a hash we support? */ ALG_ID alg; switch (hm) { case (HASH_MD5): alg = CALG_MD5; break; case (HASH_SHA1): alg=CALG_SHA1; break; default: throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA Unsupported hash algorithm for RSA sign - only MD5 or SHA1 supported"); } // Decode the signature unsigned char * rawSig; DWORD rawSigLen; XSECnew(rawSig, BYTE [sigLen]); ArrayJanitor j_rawSig(rawSig); // Decode the signature XSCryptCryptoBase64 b64; b64.decodeInit(); rawSigLen = b64.decode((unsigned char *) base64Signature, sigLen, rawSig, sigLen); rawSigLen += b64.decodeFinish(&rawSig[rawSigLen], sigLen - rawSigLen); BYTE * rawSigFinal; XSECnew(rawSigFinal, BYTE[rawSigLen]); ArrayJanitor j_rawSigFinal(rawSigFinal); BYTE * j, *l; j = rawSig; l = rawSigFinal + rawSigLen - 1; while (l >= rawSigFinal) { *l-- = *j++; } // Have to create a Windows hash object and feed in the hash BOOL fResult; HCRYPTHASH h; fResult = CryptCreateHash(m_p, alg, 0, 0, &h); if (!fResult) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error creating Windows Hash Object"); } // Feed the hash value into the newly created hash object fResult = CryptSetHashParam( h, HP_HASHVAL, (unsigned char *) hashBuf, 0); if (!fResult) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error Setting Hash Value in Windows Hash object"); } // Now validate fResult = CryptVerifySignature( h, rawSigFinal, rawSigLen, m_key, NULL, 0); if (!fResult) { DWORD error = GetLastError(); if (error != NTE_BAD_SIGNATURE) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error occurred in RSA validation"); } if (h) CryptDestroyHash(h); return false; } if (h) CryptDestroyHash(h); return true; } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int WinCAPICryptoKeyRSA::signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm) { // Sign a pre-calculated hash using this key if (m_keySpec == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Attempt to sign data using a public or un-loaded key"); } /* Is this a hash we support? */ ALG_ID alg; switch (hm) { case (HASH_MD5): alg = CALG_MD5; break; case (HASH_SHA1): alg=CALG_SHA1; break; default: throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA Unsupported hash algorithm for RSA sign - only MD5 or SHA1 supported"); } // Have to create a Windows hash object and feed in the hash BOOL fResult; HCRYPTHASH h; fResult = CryptCreateHash(m_p, alg, 0, 0, &h); if (!fResult) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error creating Windows Hash Object"); } // Feed the hash value into the newly created hash object fResult = CryptSetHashParam( h, HP_HASHVAL, hashBuf, 0); if (!fResult) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error Setting Hash Value in Windows Hash object"); } // Now sign DWORD rawSigLen; fResult = CryptSignHash( h, m_keySpec, NULL, 0, NULL, &rawSigLen); if (!fResult || rawSigLen < 1) { if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error occurred obtaining RSA sig length"); } BYTE * rawSig; XSECnew(rawSig, BYTE[rawSigLen]); ArrayJanitor j_rawSig(rawSig); fResult = CryptSignHash( h, m_keySpec, NULL, 0, rawSig, &rawSigLen); if (!fResult || rawSigLen < 1) { // Free the hash if (h) CryptDestroyHash(h); throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error occurred signing hash"); } // Free the hash if (h) CryptDestroyHash(h); // Now encode into a signature block BYTE *rawSigFinal; XSECnew(rawSigFinal, BYTE[rawSigLen]); ArrayJanitor j_rawSigFinal(rawSigFinal); BYTE * i, * j; i = rawSig; j = rawSigFinal + rawSigLen - 1; while (j >= rawSigFinal) { *j-- = *i++; } // Now encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned int ret = b64.encode(rawSigFinal, rawSigLen, (unsigned char *) base64SignatureBuf, base64SignatureBufLen); ret += b64.encodeFinish((unsigned char *) &base64SignatureBuf[ret], base64SignatureBufLen - ret); return ret; } XSECCryptoKey * WinCAPICryptoKeyRSA::clone() const { WinCAPICryptoKeyRSA * ret; XSECnew(ret, WinCAPICryptoKeyRSA(m_p)); if (m_key != 0) { // CryptDuplicateKey is not supported in Windows NT, so we need to export and then // reimport the key to get a copy BYTE keyBuf[2048]; DWORD keyBufLen = 2048; CryptExportKey(m_key, 0, PUBLICKEYBLOB, 0, keyBuf, &keyBufLen); // Now re-import CryptImportKey(m_p, keyBuf, keyBufLen, NULL, 0, &ret->m_key); } ret->m_keySpec = m_keySpec; ret->m_exponentLen = m_exponentLen; if (mp_exponent != NULL) { XSECnew(ret->mp_exponent, BYTE[m_exponentLen]); memcpy(ret->mp_exponent, mp_exponent, m_exponentLen); } else ret->mp_exponent = NULL; ret->m_modulusLen = m_modulusLen; if (mp_modulus != NULL) { XSECnew(ret->mp_modulus, BYTE[m_modulusLen]); memcpy(ret->mp_modulus, mp_modulus, m_modulusLen); } else ret->mp_modulus = NULL; return ret; } // -------------------------------------------------------------------------------- // decrypt a buffer // -------------------------------------------------------------------------------- unsigned int WinCAPICryptoKeyRSA::privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform a decrypt if (m_key == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Attempt to decrypt data with empty key"); } // Have to reverse ordering of input : DWORD decryptSize = inLength; // memcpy(plainBuf, inBuf, inLength); for (unsigned int i = 0; i < inLength; ++i) plainBuf[i] = inBuf[inLength - 1 - i]; switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : if (!CryptDecrypt(m_key, 0, TRUE, 0, plainBuf, &decryptSize)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA privateKeyDecrypt - Error Decrypting PKCS1_5 padded RSA encrypt"); } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : if (!CryptDecrypt(m_key, 0, TRUE, (hm == HASH_SHA1) ? CRYPT_OAEP : CRYPT_DECRYPT_RSA_NO_PADDING_CHECK, plainBuf, &decryptSize)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA privateKeyDecrypt - Error Decrypting PKCS1v2 OAEP padded RSA encrypt"); } break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "WiNCAPI:RSA - Unknown padding method"); } return decryptSize; } // -------------------------------------------------------------------------------- // encrypt a buffer // -------------------------------------------------------------------------------- unsigned int WinCAPICryptoKeyRSA::publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform an encrypt if (m_key == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Attempt to encrypt data with empty key"); } DWORD encryptSize = inLength; memcpy(cipherBuf, inBuf, inLength); switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : if (!CryptEncrypt(m_key, 0, /* No Hash */ TRUE, /* Is Final */ 0, /* No flags */ cipherBuf, &encryptSize, maxOutLength)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA publicKeyEncrypt - Error performing encrypt"); } if (encryptSize <= 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA publicKeyEncrypt - Error performing PKCS1_5 padded RSA encrypt"); } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : if (hm != HASH_SHA1) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - OAEP padding method requires SHA-1 digest method"); } if (!CryptEncrypt(m_key, 0, /* No Hash */ TRUE, /* Is Final */ CRYPT_OAEP, cipherBuf, &encryptSize, maxOutLength)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA publicKeyEncrypt - Error performing encrypt"); } if (encryptSize <= 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA publicKeyEncrypt - Error performing OAEP RSA encrypt"); } break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Unknown padding method"); } // Reverse the output unsigned char *tbuf; XSECnew(tbuf, unsigned char[encryptSize]); ArrayJanitor j_tbuf(tbuf); memcpy(tbuf, cipherBuf, encryptSize); for (unsigned int i = 0; i < encryptSize; ++i) cipherBuf[i] = tbuf[encryptSize - 1 - i]; return encryptSize; } // -------------------------------------------------------------------------------- // Size in bytes // -------------------------------------------------------------------------------- unsigned int WinCAPICryptoKeyRSA::getLength(void) const { DWORD len; DWORD pLen = 4; if (!CryptGetKeyParam(m_key, KP_BLOCKLEN, (BYTE *) &len, &pLen, 0)) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error determining key size"); } return len / 8; } // -------------------------------------------------------------------------------- // Some utility functions // -------------------------------------------------------------------------------- void WinCAPICryptoKeyRSA::loadParamsFromKey(void) { if (m_key == 0) { if (m_keySpec == 0) return; // See of we can get the user key if (!CryptGetUserKey(m_p, m_keySpec, &m_key)) return; } // Export key into a keyblob BOOL fResult; DWORD blobLen; fResult = CryptExportKey( m_key, 0, PUBLICKEYBLOB, 0, NULL, &blobLen); if (fResult == 0 || blobLen < 1) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error exporting public key"); } BYTE * blob; XSECnew(blob, BYTE[blobLen]); ArrayJanitor j_blob(blob); fResult = CryptExportKey( m_key, 0, PUBLICKEYBLOB, 0, blob, &blobLen); if (fResult == 0 || blobLen < 1) { throw XSECCryptoException(XSECCryptoException::RSAError, "WinCAPI:RSA - Error exporting public key"); } RSAPUBKEY * pk = (RSAPUBKEY *) ( blob + WINCAPI_BLOBHEADERLEN ); DWORD keyLen = pk->bitlen / 8; // Copy the keys BYTE * i = (BYTE *) ( pk ); i += WINCAPI_RSAPUBKEYLEN; if (mp_modulus != NULL) delete[] mp_modulus; m_modulusLen = keyLen; XSECnew(mp_modulus, BYTE[m_modulusLen]); memcpy(mp_modulus, i, m_modulusLen); // Take the simple way out XSECnew(mp_exponent, BYTE[4]); *((DWORD *) mp_exponent) = pk->pubexp; // Now cut any leading 0s (Windows is LE, so start least significant end) m_exponentLen = 3; while (m_exponentLen > 0 && mp_exponent[m_exponentLen] == 0) m_exponentLen--; m_exponentLen++; // Make it a length as apposed to an offset } unsigned int WinCAPICryptoKeyRSA::getExponentBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_exponent == NULL) { return 0; // Nothing we can do } if (mp_exponent == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_exponent, m_exponentLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } unsigned int WinCAPICryptoKeyRSA::getModulusBase64BigNums(char * b64, unsigned int len) { if (m_key == 0 && m_keySpec == 0 && mp_modulus == NULL) { return 0; // Nothing we can do } if (mp_modulus == NULL) { loadParamsFromKey(); } unsigned int bLen; unsigned char * b = WinCAPICryptoProvider::WinBN2b64(mp_modulus, m_modulusLen, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } #endif /* WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoProvider.hpp000644 001751 001751 00000025337 12003301053 025312 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoProvider := Base class to handle Windows Crypto API * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoProvider.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef WINCAPICRYPTOPROVIDER_INCLUDE #define WINCAPICRYPTOPROVIDER_INCLUDE #include #include #if defined (XSEC_HAVE_WINCAPI) #if defined (_WIN32_WINNT) # undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0400 #include // For older versions of wincrypt.h #if !defined (PROV_RSA_AES) # define PROV_RSA_AES 24 # define ALG_SID_AES_128 14 # define ALG_SID_AES_192 15 # define ALG_SID_AES_256 16 # define ALG_SID_AES 17 # define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128) # define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_192) # define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_256) #endif #define WINCAPI_BLOBHEADERLEN 0x08 #define WINCAPI_DSSPUBKEYLEN 0x08 #define WINCAPI_DSSSEEDLEN 0x18 #define WINCAPI_RSAPUBKEYLEN 0x0C /** * @defgroup wincapicrypto Windows Crypto API Interface * @ingroup crypto * The WinCAPI crypto provides an experimental inerface to * the Windows Cryptographic API. * * All initialisation of the Windows providers needs to be done * by the calling application. The interface will call the provided * DSS (PROV_DSS) provider and RSA (PROV_RSA_FULL) provider to perform * cryptographic functions. * * The tools use the default providers, but the calling application * can use any providers that implement PROV_DSS and PROV_FULL_RSA. * * Note that, unlike the OpenSSL classes, the various implementation * classes all require their owner provider class to be passed into * the constructor. This allows them to access the RSA and DSS CAPI * providers being used for the implementation. * * @todo Need to allow the various classes to over-ride the PROV * objects to allow specific private key instances rather than one * instance across the library instance. */ /*\@{*/ class DSIG_EXPORT WinCAPICryptoProvider : public XSECCryptoProvider { public : /** @name Constructors and Destructors */ //@{ /** * \brief Create a Windows CAPI interface layer * * Windows CSPs work under a provider model. The user should specify * which CSP to use. * * @param provDSSName Name of DSS provider - must be of type PROV_DSS. * Will use the default Windows DSS provider if nothing passed in. * @param provRSAName RSA provider - must be of type PROV_RSA_FULL. * Will use the default RSA_FULL provider if nothing passed in * @param dwFlags If you are running XSEC as service you should specify * CRYPT_MACHINE_KEYSET here */ WinCAPICryptoProvider(LPCSTR provDSSName = NULL, LPCSTR provRSAName = NULL, DWORD dwFlags = 0); virtual ~WinCAPICryptoProvider(); //@} /** @name Hashing (Digest) Functions */ //@{ /** * \brief Return a SHA1 implementation. * * Call used by the library to obtain a SHA1 object from the * provider. * * @returns A pointer to an WinCAPI Hash object that implements SHA1 * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashSHA1() const; /** * \brief Return a SHA implementation. * * Call used by the library to obtain a SHA object from the * provider. Size of hash determined by length argument (160 = SHA1) * * @returns A pointer to a Hash object that implements SHA1 * @param length - length of hash. E.g. 160 for SHA1 or 256 for SHA256 * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashSHA(int length = 160) const; /** * \brief Return a HMAC SHA1 implementation. * * Call used by the library to obtain a HMAC SHA1 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using WinCAPICryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashHMACSHA1() const; /** * \brief Return a HMAC SHA(1-512) implementation. * * Call used by the library to obtain a HMAC SHA object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @param length Length of hash output (160 = SHA1, 256, 512 etc) * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashHMACSHA(int length = 160) const; /** * \brief Return a MD5 implementation. * * Call used by the library to obtain a MD5 object from the * WiNCAPI provider. * * @returns A pointer to a Hash object that implements MD5 * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashMD5() const; /** * \brief Return a HMAC MD5 implementation. * * Call used by the library to obtain a HMAC MD5 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @note The use of MD5 is explicitly marked as not recommended * in the XML Digital Signature standard due to recent advances in * cryptography indicating there may be weaknesses in the * algorithm. * * @returns A pointer to a Hash object that implements HMAC-MD5 * @see WinCAPICryptoHash */ virtual XSECCryptoHash * hashHMACMD5() const; /** * \brief Return a HMAC key * * Sometimes the library needs to create an HMAC key (notably within * the XKMS utilities. * * This function allows the library to obtain a key that can then have * a value set within it. */ virtual XSECCryptoKeyHMAC * keyHMAC(void) const; //@} /** @name Encoding functions */ //@{ /** * \brief Return a Base64 encoder/decoder implementation. * * Call used by the library to obtain a Base64 * encoder/decoder. * * @note Windows providers do not implement Base64, so the internal * implementation (XSCrypt) is used instead. * * * @returns Pointer to the new Base64 encoder. * @see XSCryptCryptoBase64 */ virtual XSECCryptoBase64 * base64() const; //@} /** @name Keys and Certificates */ //@{ /** * \brief Return a DSA key implementation object. * * Call used by the library to obtain a DSA key object. * * @returns Pointer to the new DSA key * @see WinCAPICryptoKeyDSA */ virtual XSECCryptoKeyDSA * keyDSA() const; /** * \brief Return an RSA key implementation object. * * Call used by the library to obtain an WinCAPI RSA key object. * * @returns Pointer to the new RSA key * @see WinCAPICryptoKeyRSA */ virtual XSECCryptoKeyRSA * keyRSA() const; /** * \brief Return an X509 implementation object. * * Call used by the library to obtain an object that can work * with X509 certificates. * * @returns Pointer to the new X509 object * @see WinCAPICryptoX509 */ virtual XSECCryptoX509 * X509() const; //@} /** @name Windows CAPI Specific methods */ //@{ /** * \brief Returns the Crypto Provider being used for DSS */ HCRYPTPROV getProviderDSS(void) {return m_provDSS;} /** * \brief Returns the Provider being used for RSA functions */ HCRYPTPROV getProviderRSA(void) {return m_provRSA;} /** * \brief Return the internal key store provider */ HCRYPTPROV getApacheKeyStore(void) {return m_provApacheKeyStore;} /** * \brief Translate B64 I2OS integer to a WinCAPI int. * * Decodes a Base64 (ds:CryptoBinary) integer and reverses the order to * allow loading into a Windows CAPI function. (CAPI uses Little Endian * storage of integers). * * @param b64 Base 64 string * @param b64Len Length of base64 string * @param retLen Parameter to hold length of return integer */ static BYTE * b642WinBN(const char * b64, unsigned int b64Len, unsigned int &retLen); /** * \brief Translate a WinCAPI int to a B64 I2OS integer . * * Encodes a Windows integer in I2OSP base64 encoded format. * * @param n Buffer holding the Windows Integer * @param nLen Length of data in buffer * @param retLen Parameter to hold length of return integer * @returns A pointer to a buffer holding the encoded data * (transfers ownership) */ static unsigned char * WinBN2b64(BYTE * n, DWORD nLen, unsigned int &retLen); /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * symmetric algorithm is supported */ virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * digest algorithm is supported */ virtual bool algorithmSupported(XSECCryptoHash::HashType alg) const; /** * \brief Return a Symmetric Key implementation object. * * Call used by the library to obtain a bulk encryption * object. * * @returns Pointer to the new SymmetricKey object * @see XSECCryptoSymmetricKey */ virtual XSECCryptoSymmetricKey * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Obtain some random octets * * For generation of IVs and the like, the library needs to be able * to obtain "random" octets. The library uses this call to the * crypto provider to obtain what it needs. * * @param buffer The buffer to place the random data in * @param numOctets Number of bytes required * @returns Number of bytes obtained. */ virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets) const; //@} /** @name Information Functions */ //@{ /** * \brief Returns a string that identifies the Crypto Provider */ virtual const XMLCh * getProviderName() const; //@} private: HCRYPTPROV m_provDSS; HCRYPTPROV m_provRSA; HCRYPTPROV m_provApacheKeyStore; LPCSTR m_provDSSName; LPCSTR m_provRSAName; bool m_haveAES; DWORD m_provRSAType; }; /*\@}*/ #endif /* XSEC_HAVE_WINCAPI */ #endif /* WINCAPICRYPTOPROVIDER_INCLUDE */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoSymmetricKey.cpp000644 001751 001751 00000045712 12462320141 026147 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * $Id: WinCAPICryptoSymmetricKey.cpp 1655508 2015-01-29 02:05:56Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #if defined (XSEC_HAVE_WINCAPI) // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- WinCAPICryptoSymmetricKey::WinCAPICryptoSymmetricKey( HCRYPTPROV prov, XSECCryptoSymmetricKey::SymmetricKeyType type) : m_keyType(type), m_keyMode(MODE_NONE), m_initialised(false), m_doPad(true), m_p(prov), m_k(0) { } WinCAPICryptoSymmetricKey::~WinCAPICryptoSymmetricKey() { if (m_k != 0) CryptDestroyKey(m_k); } // -------------------------------------------------------------------------------- // Basic Key interface methods // -------------------------------------------------------------------------------- XSECCryptoKey * WinCAPICryptoSymmetricKey::clone() const { WinCAPICryptoSymmetricKey * ret; XSECnew(ret, WinCAPICryptoSymmetricKey(m_p, m_keyType)); ret->m_keyLen = m_keyLen; ret->m_keyBuf = m_keyBuf; if (m_k != 0) { #if (_WIN32_WINNT > 0x0400) // Only supported in Win2K and above if (CryptDuplicateKey(m_k, 0, 0, &(ret->m_k)) == 0 ) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey Error attempting to clone key parameters"); } #else ret->setKey(m_keyBuf.rawBuffer(), m_keyLen); #endif } else ret->m_k = 0; return ret; } // -------------------------------------------------------------------------------- // Store the key value // -------------------------------------------------------------------------------- void WinCAPICryptoSymmetricKey::setKey(const unsigned char * key, unsigned int keyLen) { m_keyBuf.sbMemcpyIn(key, keyLen); m_keyLen = keyLen; if (m_k != 0) CryptDestroyKey(m_k); m_p = 0; m_k = createWindowsKey(key, keyLen, m_keyType, &m_p); } // -------------------------------------------------------------------------------- // Decrypt // -------------------------------------------------------------------------------- int WinCAPICryptoSymmetricKey::decryptCtxInit(const unsigned char * iv) { // Returns amount of IV data used (in bytes) // Sets m_initialised iff the key is OK and the IV is OK. if (m_initialised) return 0; if (m_k == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Cannot initialise without mode"); } DWORD cryptMode; if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } cryptMode = CRYPT_MODE_CBC; if (!CryptSetKeyParam(m_k, KP_MODE, (BYTE *) (&cryptMode), 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting cipher mode"); } if (!CryptSetKeyParam(m_k, KP_IV, (unsigned char *) iv, 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting IV"); } } else if (m_keyMode == MODE_ECB) { cryptMode = CRYPT_MODE_ECB; if (!CryptSetKeyParam(m_k, KP_MODE, (BYTE *) (&cryptMode), 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting cipher mode"); } } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unknown cipher mode"); } // Set up the context according to the required cipher type switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : // A 3DES CBC key m_blockSize = 8; m_bytesInLastBlock = 0; m_initialised = true; break; case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : // An AES key m_blockSize = 16; m_bytesInLastBlock = 0; m_initialised = true; break; default : // Cannot do this without an IV throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unknown key type"); } // Setup ivSize switch (m_keyMode) { case MODE_CBC: m_ivSize = m_blockSize; break; case MODE_GCM: m_ivSize = 12; break; default: m_ivSize = 0; } return m_ivSize; } bool WinCAPICryptoSymmetricKey::decryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char* iv, const unsigned char* tag, unsigned int taglen) { m_initialised = false; m_doPad = doPad; m_keyMode = mode; decryptCtxInit(iv); return true; } unsigned int WinCAPICryptoSymmetricKey::decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength) { // NOTE: This won't actually stop WinCAPI blowing the buffer, so the onus is // on the caller. unsigned int offset = 0; if (!m_initialised) { offset = decryptCtxInit(inBuf); if (offset > inLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Not enough data passed in to get IV"); } } /* As per bug #38365 - we need to ensure there are enough characters to decrypt. Otherwise we get some nasty errors due to rounding calculations when inputs are too small */ else if (m_bytesInLastBlock + inLength < m_blockSize) { // Not enough input data memcpy(&m_lastBlock[m_bytesInLastBlock], inBuf, inLength); m_bytesInLastBlock += inLength; return 0; } DWORD outl = inLength - offset; // Copy in last block if (m_bytesInLastBlock > 0) memcpy(plainBuf, m_lastBlock, m_bytesInLastBlock); // Copy out the tail, as we _MUST_ know when we come to the end for decryptFinal unsigned int rounding = (outl % m_blockSize) + m_blockSize; memcpy(&plainBuf[m_bytesInLastBlock], &inBuf[offset], outl - rounding); // Copy the tail to m_lastBlock memcpy(m_lastBlock, &inBuf[offset + outl - rounding], rounding); outl = outl - rounding + m_bytesInLastBlock; m_bytesInLastBlock = rounding; if (!CryptDecrypt(m_k, 0, FALSE, 0, plainBuf, &outl)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error during WinCAPI decrypt"); } return outl; } unsigned int WinCAPICryptoSymmetricKey::decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength) { DWORD outl = m_bytesInLastBlock; memcpy(plainBuf, m_lastBlock, outl); if (!CryptDecrypt(m_k, 0, FALSE, 0, plainBuf, &outl)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error during WinCAPI decrypt finalisation"); } if (m_doPad) { // Need to do this ourselves, as WinCAPI appears broken if (plainBuf[outl - 1] > m_blockSize) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Bad padding"); } outl -= plainBuf[outl - 1]; } // This is just to reset the key, and does nothing else useful. DWORD tmpout = maxOutLength - outl; CryptDecrypt(m_k, 0, TRUE, 0, &plainBuf[outl], &tmpout); return outl; } // -------------------------------------------------------------------------------- // Encrypt // -------------------------------------------------------------------------------- void WinCAPICryptoSymmetricKey::encryptCtxInit(const unsigned char * iv) { if (m_initialised == true) return; if (m_keyLen == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Cannot initialise without mode"); } m_initialised = true; // Set up the context according to the required cipher type const unsigned char * usedIV = NULL; unsigned char genIV[256]; DWORD cryptMode; // Tell the library that the IV still has to be sent if (m_keyMode == MODE_CBC) { if (iv == NULL) { BOOL res = CryptGenRandom(m_p, 256, genIV); if (res == FALSE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error generating random IV"); } usedIV = genIV; //return 0; // Cannot initialise without an IV } else usedIV = iv; cryptMode = CRYPT_MODE_CBC; if (!CryptSetKeyParam(m_k, KP_MODE, (BYTE *) (&cryptMode), 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting cipher mode"); } // Set the IV parameter if (!CryptSetKeyParam(m_k, KP_IV, (unsigned char *) usedIV, 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting IV"); } } else if (m_keyMode == MODE_ECB) { cryptMode = CRYPT_MODE_ECB; if (!CryptSetKeyParam(m_k, KP_MODE, (BYTE *) (&cryptMode), 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting cipher mode"); } } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported cipher mode"); } switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : // A 3DES key m_blockSize = 8; if (m_keyMode == MODE_CBC) m_ivSize = 8; else m_ivSize = 0; m_bytesInLastBlock = 0; break; case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : // An AES key m_blockSize = 16; if (m_keyMode == MODE_CBC) m_ivSize = 16; else if (m_keyMode == MODE_GCM) m_ivSize = 12; else m_ivSize = 0; m_bytesInLastBlock = 0; break; default : // Cannot do this without an IV throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unknown key type"); } if (usedIV != NULL && m_ivSize > 0) memcpy(m_lastBlock, usedIV, m_ivSize); } bool WinCAPICryptoSymmetricKey::encryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char * iv) { m_doPad = doPad; m_keyMode = mode; m_initialised = false; encryptCtxInit(iv); return true; } unsigned int WinCAPICryptoSymmetricKey::encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength) { if (m_initialised == false) { encryptInit(); } // NOTE: This won't actually stop WinCAPI blowing the buffer, so the onus is // on the caller. unsigned int offset = 0; unsigned char * bufPtr; unsigned char * encPtr; // Ptr to start of block to encrypt DWORD outl = 0; if (m_ivSize > 0) { DWORD len = m_ivSize; if (!CryptGetKeyParam(m_k, KP_IV, (unsigned char *) m_lastBlock, &len, 0)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error setting IV"); } memcpy(cipherBuf, m_lastBlock, m_ivSize); offset = m_ivSize; outl += m_ivSize; m_ivSize = 0; } /* As per bug #38365 - we need to ensure there are enough characters to encrypt. Otherwise we get some nasty errors due to rounding calculations when inputs are too small */ if (inLength < m_blockSize) { // Not enough input data memcpy(&m_lastBlock[m_bytesInLastBlock], inBuf, inLength); m_bytesInLastBlock += inLength; // Just in case we have returned an IV return outl; } bufPtr = &cipherBuf[offset]; encPtr = bufPtr; if (m_bytesInLastBlock > 0) { memcpy(bufPtr, m_lastBlock, m_bytesInLastBlock); bufPtr = &bufPtr[m_bytesInLastBlock]; outl += m_bytesInLastBlock; } unsigned int rounding = (m_bytesInLastBlock + inLength) % m_blockSize; rounding += m_blockSize; outl += inLength - rounding; if (outl > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Not enough space in output buffer for encrypt"); } outl -= offset; // Now copy back one block + rounding memcpy(m_lastBlock, &inBuf[inLength - rounding], rounding); m_bytesInLastBlock = rounding; // Finally, copy in last of buffer to encrypt memcpy(bufPtr, inBuf, inLength - rounding); // Do the enrypt if (!CryptEncrypt(m_k, 0, FALSE, 0, encPtr, &outl, maxOutLength)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error during WinCAPI encrypt"); } return outl + offset; } unsigned int WinCAPICryptoSymmetricKey::encryptFinish(unsigned char * cipherBuf, unsigned int maxOutLength, unsigned int taglen) { DWORD outl = m_bytesInLastBlock + m_blockSize; if (outl > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Not enough space in output buffer for encrypt - NOTE WinCAPI requires an extra block to complete encryption"); } outl = 0; if (m_bytesInLastBlock != 0) { memcpy(cipherBuf, m_lastBlock, m_bytesInLastBlock); outl = m_bytesInLastBlock; } if (!CryptEncrypt(m_k, 0, TRUE, 0, cipherBuf, &outl, maxOutLength)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Error during WinCAPI encrypt"); } if (!m_doPad) { // It is the responsibility of the caller to ensure they have // passed in block size num bytes if (outl >= m_blockSize) outl -= m_blockSize; } return outl; } // -------------------------------------------------------------------------------- // Create a windows key // -------------------------------------------------------------------------------- HCRYPTKEY WinCAPICryptoSymmetricKey::createWindowsKey( const unsigned char * key, unsigned int keyLen, XSECCryptoSymmetricKey::SymmetricKeyType type, HCRYPTPROV * prov) { // First get the correct Provider handle to load the key into HCRYPTPROV p; if (prov == NULL || *prov == 0) { if (!strEquals(XSECPlatformUtils::g_cryptoProvider->getProviderName(), DSIGConstants::s_unicodeStrPROVWinCAPI)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Main provider is not Windows provider"); } WinCAPICryptoProvider * cp = (WinCAPICryptoProvider*) XSECPlatformUtils::g_cryptoProvider; p = cp->getApacheKeyStore(); if (p == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unable to retrieve internal key store"); } if (prov != NULL) *prov = p; } else if (prov != NULL) p = *prov; // Get the key wrapping key HCRYPTKEY k; if (!CryptGetUserKey(p, AT_KEYEXCHANGE, &k)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unable to retrieve internal key pair"); } // Find out how long the output will be DWORD outl = 0; if (!CryptEncrypt(k, 0, TRUE, 0, 0, &outl, keyLen)) { DWORD error = GetLastError(); if (error == NTE_BAD_KEY) { // We throw either way, but this is *likely* to be an unsupported OS issue throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey::createWindowsKey - Error encrypting a key - is this >= Windows 2000?"); } throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unable to determine space required to encrypt key"); } // Create the necessary buffer unsigned char * encryptBuf; unsigned int encryptBufSize = outl; XSECnew(encryptBuf, unsigned char[outl]); ArrayJanitor j_encryptBuf(encryptBuf); memcpy(encryptBuf, key, keyLen); outl = keyLen; // Do the encrypt if (!CryptEncrypt(k, 0, TRUE, 0, encryptBuf, &outl, encryptBufSize)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unable to encrypt key"); } // Now we have the encrypted buffer, create a SIMPLEBLOB structure unsigned char * simpleBlob; XSECnew(simpleBlob, unsigned char [sizeof (BLOBHEADER) + sizeof (DWORD) + outl]); ArrayJanitor j_simpleBlob(simpleBlob); BLOBHEADER * blobHeader = (BLOBHEADER *) simpleBlob; blobHeader->bType = SIMPLEBLOB; blobHeader->bVersion = CUR_BLOB_VERSION; blobHeader->reserved = 0; unsigned int expectedLength; switch (type) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : blobHeader->aiKeyAlg = CALG_3DES; expectedLength = 24; break; case (XSECCryptoSymmetricKey::KEY_AES_128) : blobHeader->aiKeyAlg = CALG_AES_128; expectedLength = 16; break; case (XSECCryptoSymmetricKey::KEY_AES_192) : blobHeader->aiKeyAlg = CALG_AES_192; expectedLength = 24; break; case (XSECCryptoSymmetricKey::KEY_AES_256) : blobHeader->aiKeyAlg = CALG_AES_256; expectedLength = 32; break; default : throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey::createWindowsKey - Unknown Symmetric key type"); } // Check key length - otherwise the user could get some very cryptic error messages if (keyLen != expectedLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey::createWindowsKey - Key length incorrect for algorithm"); } DWORD * algId = (DWORD *) (simpleBlob + sizeof(BLOBHEADER)); *algId = CALG_RSA_KEYX; // Copy in the encrypted data memcpy(&simpleBlob[sizeof(BLOBHEADER) + sizeof(DWORD)], encryptBuf, outl); // Now do the import HCRYPTKEY k2; if (!CryptImportKey(p, simpleBlob, sizeof(BLOBHEADER) + sizeof(DWORD) + outl, k, CRYPT_EXPORTABLE, &k2)) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "WinCAPI:SymmetricKey - Unable to import key"); } return k2; } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/WinCAPI/WinCAPICryptoKeyHMAC.cpp000644 001751 001751 00000005160 12003301053 024664 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * WinCAPICryptoKeyHMAC := Windows HMAC keys * * Author(s): Berin Lautenbach * * $Id: WinCAPICryptoKeyHMAC.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #if defined (XSEC_HAVE_WINCAPI) WinCAPICryptoKeyHMAC::WinCAPICryptoKeyHMAC(HCRYPTPROV prov) :m_keyBuf("") { m_keyBuf.isSensitive(); m_keyLen = 0; m_k = 0; m_p = prov; }; void WinCAPICryptoKeyHMAC::setKey(unsigned char * inBuf, unsigned int inLength) { m_keyBuf.sbMemcpyIn(inBuf, inLength); m_keyLen = inLength; } unsigned int WinCAPICryptoKeyHMAC::getKey(safeBuffer &outBuf) const { outBuf = m_keyBuf; return m_keyLen; } XSECCryptoKey * WinCAPICryptoKeyHMAC::clone() const { WinCAPICryptoKeyHMAC * ret; XSECnew(ret, WinCAPICryptoKeyHMAC(m_p)); ret->m_keyBuf = m_keyBuf; ret->m_keyLen = m_keyLen; if (m_k != 0) { #if (_WIN32_WINNT > 0x0400) if (CryptDuplicateKey(m_k, 0, 0, &(ret->m_k)) == 0 ) { throw XSECCryptoException(XSECCryptoException::MDError, "WinCAPI:KeyHMAC Error attempting to clone key parameters"); } #else throw XSECCryptoException(XSECCryptoException::MDError, "Unable to clone keys in Windows NT 4.0 and below"); #endif } else ret->m_k = 0; return ret; } // -------------------------------------------------------------------------------- // Windows Specific Keys // -------------------------------------------------------------------------------- void WinCAPICryptoKeyHMAC::setWinKey(HCRYPTKEY k) { if (m_k != 0) { CryptDestroyKey(m_k); } m_k = k; } HCRYPTKEY WinCAPICryptoKeyHMAC::getWinKey(void) const { return m_k; } HCRYPTPROV WinCAPICryptoKeyHMAC::getWinKeyProv(void) const { return m_p; } #endif /* XSEC_HAVE_WINCAPI */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoBase64.hpp000644 001751 001751 00000012565 12003301053 024725 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoBase64 := Base virtual class to define a base64 encoder/decoder * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoBase64.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOBASE64_INCLUDE #define OPENSSLCRYPTOBASE64_INCLUDE #include #include // OpenSSL #if defined (XSEC_HAVE_OPENSSL) # include /** * @ingroup opensslcrypto */ /*\@{*/ /** * \brief Base64 encode/decode handler interface class. * * The XSEC library will use implementations of this interface * for translating bytes to/from base64 encoding. * * Uses the EVP decode/encode routines in OpenSSL to perform the * work. * * * * @note Requires implementation of OpenSSL > 0.9.6e as there was a bug * in the Base64 decoding routines in this version and prior. * */ class DSIG_EXPORT OpenSSLCryptoBase64 : public XSECCryptoBase64 { public : OpenSSLCryptoBase64() {}; virtual ~OpenSSLCryptoBase64() {}; /** @name Decoding Functions */ //@{ /** * \brief Initialise the base64 object. * * Initialises the OpenSSL decode context and gets ready for data * to be decoded. * */ virtual void decodeInit(void); /** * \brief Decode some passed in data. * * Pass the encoded data through the OpenSSL base64 decode function * and place the data in the outData buffer. * * @note The OpenSSL library is very unkind if the output buffer is * not large enough. It is the responsibility of the caller to ensure * the buffer will take the data. * * @param inData Pointer to the buffer holding encoded data. * @param inLength Length of the encoded data in the buffer * @param outData Buffer to place decoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int decode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength); /** * \brief Finish off a decode. * * Clean out any extra data in the OpenSSL decode context * variable into the outData buffer. * * @param outData Buffer to place any remaining decoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int decodeFinish(unsigned char * outData, unsigned int outLength); //@} /** @name Encoding Functions */ //@{ /** * \brief Initialise the base64 object for encoding * * Get the context variable ready for a base64 decode * */ virtual void encodeInit(void); /** * \brief Encode some passed in data. * * Pass the data through the OpenSSL Base64 encoder and place * the output in the outData buffer. Will keep any "overhang" * data in the context buffer ready for the next pass of input * data. * * @param inData Pointer to the buffer holding data to be encoded. * @param inLength Length of the data in the buffer * @param outData Buffer to place encoded data into * @param outLength Maximum amount of data that can be placed in * the buffer. * @returns The number of bytes placed in the outData buffer. */ virtual unsigned int encode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength); /** * \brief Finish off an encode. * * Take any data left in the context variable, and create the * tail of the base64 encoding. * * @param outData Buffer to place any remaining encoded data * @param outLength Max amount of data to be placed in the buffer. * @returns Amount of data placed in the outData buffer */ virtual unsigned int encodeFinish(unsigned char * outData, unsigned int outLength); // Finish //@} /** @name Library Specific Functions */ //@{ /** * \brief Translate a base64 encoded BN to a bignum * * Take a ds:CryptoBinary number and translate to an OpenSSL * representation of a "big number" BIGNUM. * */ static BIGNUM * b642BN(char * b64in, unsigned int len); /** * \brief Get OpenSSL encode context structure */ EVP_ENCODE_CTX * getOpenSSLEncodeEVP_ENCODE_CTX(void) {return &m_ectx;} /** * \brief Get OpenSSL encode context structure */ EVP_ENCODE_CTX * getOpenSSLDecodeEVP_ENCODE_CTX(void) {return &m_dctx;} //@} private : EVP_ENCODE_CTX m_ectx; // Encode context EVP_ENCODE_CTX m_dctx; // Decode context }; /*\@}*/ #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOBASE64_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.hpp000644 001751 001751 00000023457 12003301053 026330 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoSymmetricKey.hpp 1352680 2012-06-21 20:58:07Z scantor $ * */ #ifndef OPENSSLCRYPTOSYMMETRICKEY_INCLUDE #define OPENSSLCRYPTOSYMMETRICKEY_INCLUDE #include #include #if defined (XSEC_HAVE_OPENSSL) // OpenSSL Includes #include #define MAX_BLOCK_SIZE 32 /** * \ingroup opensslcrypto */ /** * \brief Base interface definition for symmetric key material. * * This is the implementation for a wrapper of OpenSSL symmetric * crypto functions. */ class DSIG_EXPORT OpenSSLCryptoSymmetricKey : public XSECCryptoSymmetricKey { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Can only construct a Symmetric key if we know what type it is **/ OpenSSLCryptoSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType type); /** * \brief Destructor * * Implementations must ensure that the held key is properly destroyed * (overwritten) when key objects are deleted. */ virtual ~OpenSSLCryptoSymmetricKey(); //@} /** @name Basic CryptoKey Interface methods */ //@{ /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const; /** * \brief Clone the key * * All keys need to be able to copy themselves and return * a pointer to the copy. This allows the library to * duplicate keys. */ virtual XSECCryptoKey * clone() const; //@} /** @name Symmetric key interface methods */ //@{ /** * \brief What type of symmetric key is this? * * There are a number of different types of symmetric key. * This method allows callers to determine the type of this * particular key */ SymmetricKeyType getSymmetricKeyType(void) const; /** * \brief Set the key from the provided bytes * * Symmetric keys can all be loaded from a buffer containing a series * of bytes. * * @param key The buffer containing the key bytes * @param keyLen The number of key bytes in the buffer * */ void setKey(const unsigned char * key, unsigned int keyLen); /** * \brief Initialise an decryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations should assume that the start of the * cipher text stream will in fact be the IV. * * @param doPad By default, we perform padding for last block * @param mode mode selection (Currently ECB or CBC mode only) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV will be set from data stream * @param tag Authentication tag to be used for AEAD ciphers * @param taglen length of Authentication Tag * @returns true if the initialisation succeeded. */ virtual bool decryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL, const unsigned char* tag = NULL, unsigned int taglen = NULL); /** * \brief Continue an decrypt operation using this key. * * Decryption must have been set up using an encryptInit * call. Takes the inBuf and continues a decryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be decrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * cipher-text to be handles during the next operation. * * @note While maxOutLength is defined, the OpenSSL libraries will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param inBuf Octets to be decrypted * @param plainBuf Buffer to place output in * @param inLength Number of bytes to decrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a decryption operation * * Complete a decryption process. No cipher text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer. * * May throw an exception if there is some stored cipher text * that is not the length of the block size for block algorithms. * * @note While maxOutLength is defined, the OpenSSL libraries will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param plainBuf Buffer to place any remaining plain text in * @param maxOutLength Maximum number of bytes to pace in output * @returns Bytes placed in output buffer */ virtual unsigned int decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength); /** * \brief Initialise an encryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations are required to generate one. * * @param doPad By default, we perform padding for last block * @param mode What mode to handle blocks (Currently CBC or ECB) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV is to be generated * @returns true if the initialisation succeeded. */ virtual bool encryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL); /** * \brief Continue an encryption operation using this key. * * Encryption must have been set up using an encryptInit * call. Takes the inBuf and continues a encryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be encrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * plain-text to be handled during the next operation. * * @param inBuf Octets to be encrypted * @param cipherBuf Buffer to place output in * @param inLength Number of bytes to encrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a encryption operation * * Complete a encryption process. No plain text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer and creating a final padded block. * * Padding is performed by taking the remaining block, and * setting the last byte to equal the number of bytes of * padding. If the plain was an exact multiple of the block size, * then an extra block of padding will be used. For example, if * the block size is 8 bytes, and there were three remaining plain * text bytes (0x01, 0x02 and 0x03), the final block will be : * * 0x010203????????05 * * @param plainBuf Buffer to place final block of cipher text in * @param maxOutLength Maximum number of bytes to pace in output * @param taglen length of Authentication Tag * @returns Bytes placed in output buffer */ virtual unsigned int encryptFinish(unsigned char * plainBuf, unsigned int maxOutLength, unsigned int taglen = 0); //@} /** @name OpenSSL Library Specific functions */ //@{ /** * \brief Get OpenSSL cipher context structure */ EVP_CIPHER_CTX * getOpenSSLEVP_CIPHER_CTX(void) {return &m_ctx;} /** * \brief Get OpenSSL cipher context structure */ const EVP_CIPHER_CTX * getOpenSSLEVP_CIPHER_CTX(void) const {return &m_ctx;} //@} private: // Unimplemented constructors OpenSSLCryptoSymmetricKey(); OpenSSLCryptoSymmetricKey(const OpenSSLCryptoSymmetricKey &); OpenSSLCryptoSymmetricKey & operator= (const OpenSSLCryptoSymmetricKey &); // Private functions int decryptCtxInit(const unsigned char* iv, const unsigned char* tag, unsigned int taglen); // Private variables SymmetricKeyType m_keyType; SymmetricKeyMode m_keyMode; EVP_CIPHER_CTX m_ctx; // OpenSSL Cipher Context structure safeBuffer m_keyBuf; // Holder of the key safeBuffer m_tagBuf; // Holder of authentication tag unsigned int m_keyLen; bool m_initialised; // Is the context ready to work? unsigned char m_lastBlock[MAX_BLOCK_SIZE]; int m_blockSize; int m_ivSize; int m_bytesInLastBlock; bool m_ivSent; // Has the IV been put in the stream bool m_doPad; // Do we pad last block? }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOSYMMETRICKEY_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoProvider.hpp000644 001751 001751 00000020556 12003301053 025472 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoProvider := Base class to define an OpenSSL module * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoProvider.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOPROVIDER_INCLUDE #define OPENSSLCRYPTOPROVIDER_INCLUDE #include #include #include #include #if defined (XSEC_HAVE_OPENSSL) /** * @defgroup opensslcrypto OpenSSL Interface * @ingroup crypto * The OpenSSL/OpenSSL* classes provide an implementation of the * XSECCrypto interface layer for OpenSSL. The layer is very thin - * it only provides the functionality necessary to provide cryptographic * services to the library. * * Calling applications need to do the work to initialise OpenSSL, load * keys from disk etc. * */ /*\@{*/ class DSIG_EXPORT OpenSSLCryptoProvider : public XSECCryptoProvider { #ifdef XSEC_OPENSSL_HAVE_EC std::map m_namedCurveMap; #endif public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoProvider(); virtual ~OpenSSLCryptoProvider(); //@} /** @name Hashing (Digest) Functions */ //@{ /** * \brief Return a SHA1 implementation. * * Call used by the library to obtain a SHA1 object from the * provider. * * @returns A pointer to an OpenSSL Hash object that implements SHA1 * @see XSECCryptoHash */ virtual XSECCryptoHash * hashSHA1() const; /** * \brief Return a SHA implementation. * * Call used by the library to obtain a SHA object from the * provider. Size of hash determined by length argument (160 = SHA1) * * @returns A pointer to a Hash object that implements SHA1 * @param length - length of hash. E.g. 160 for SHA1 or 256 for SHA256 * @see OpenSSLCryptoHash */ virtual XSECCryptoHash * hashSHA(int length = 160) const; /** * \brief Return a HMAC SHA1 implementation. * * Call used by the library to obtain a HMAC SHA1 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using OpenSSLCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @see OpenSSLCryptoHash */ virtual XSECCryptoHash * hashHMACSHA1() const; /** * \brief Return a HMAC SHA(1-512) implementation. * * Call used by the library to obtain a HMAC SHA object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @param length Length of hash output (160 = SHA1, 256, 512 etc) * @see OpenSSLCryptoHash */ virtual XSECCryptoHash * hashHMACSHA(int length = 160) const; /** * \brief Return a MD5 implementation. * * Call used by the library to obtain a MD5 object from the * OpenSSL provider. * * @returns A pointer to a Hash object that implements MD5 * @see OpenSSLCryptoHash */ virtual XSECCryptoHash * hashMD5() const; /** * \brief Return a HMAC MD5 implementation. * * Call used by the library to obtain a HMAC MD5 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @note The use of MD5 is explicitly marked as not recommended * in the XML Digital Signature standard due to recent advances in * cryptography indicating there may be weaknesses in the * algorithm. * * @returns A pointer to a Hash object that implements HMAC-MD5 * @see OpenSSLCryptoHash */ virtual XSECCryptoHash * hashHMACMD5() const; /** * \brief Return a HMAC key * * Sometimes the library needs to create an HMAC key (notably within * the XKMS utilities. * * This function allows the library to obtain a key that can then have * a value set within it. */ virtual XSECCryptoKeyHMAC * keyHMAC(void) const; //@} /** @name Encoding functions */ //@{ /** * \brief Return a Base64 encoder/decoder implementation. * * Call used by the library to obtain an OpenSSL Base64 * encoder/decoder. * * @returns Pointer to the new Base64 encoder. * @see OpenSSLCryptoBase64 */ virtual XSECCryptoBase64 * base64() const; //@} /** @name Keys and Certificates */ //@{ /** * \brief Return a DSA key implementation object. * * Call used by the library to obtain a DSA key object. * * @returns Pointer to the new DSA key * @see OpenSSLCryptoKeyDSA */ virtual XSECCryptoKeyDSA * keyDSA() const; /** * \brief Return an RSA key implementation object. * * Call used by the library to obtain an OpenSSL RSA key object. * * @returns Pointer to the new RSA key * @see OpenSSLCryptoKeyRSA */ virtual XSECCryptoKeyRSA * keyRSA() const; /** * \brief Return an EC key implementation object. * * Call used by the library to obtain an OpenSSL EC key object. * * @returns Pointer to the new EC key * @see OpenSSLCryptoKeyEC */ virtual XSECCryptoKeyEC * keyEC() const; /** * \brief Return a key implementation object based on DER-encoded input. * * Call used by the library to obtain a key object from a DER-encoded key. * * @param buf DER-encoded data * @param buflen length of data * @param base64 true iff data is base64-encoded * @returns Pointer to the new key * @see XSECCryptoKey */ virtual XSECCryptoKey * keyDER(const char* buf, unsigned long buflen, bool base64) const; /** * \brief Return an X509 implementation object. * * Call used by the library to obtain an object that can work * with X509 certificates. * * @returns Pointer to the new X509 object * @see OpenSSLCryptoX509 */ virtual XSECCryptoX509 * X509() const; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * symmetric algorithm is supported */ virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * digest algorithm is supported */ virtual bool algorithmSupported(XSECCryptoHash::HashType alg) const; /** * \brief Return a Symmetric Key implementation object. * * Call used by the library to obtain a bulk encryption * object. * * @returns Pointer to the new SymmetricKey object * @see XSECCryptoSymmetricKey */ virtual XSECCryptoSymmetricKey * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Obtain some random octets * * For generation of IVs and the like, the library needs to be able * to obtain "random" octets. The library uses this call to the * crypto provider to obtain what it needs. * * @param buffer The buffer to place the random data in * @param numOctets Number of bytes required * @returns Number of bytes obtained. */ virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets) const; #ifdef XSEC_OPENSSL_HAVE_EC /** * \brief Map a curve name (in URI form) to a curve NID. * * Maps a URI identifying a named curve to a library identifier. * * @param curveName the URI identifying the curve * @returns the corresponding NID */ int curveNameToNID(const char* curveName) const; #endif //@} /** @name Information Functions */ //@{ /** * \brief Returns a string that identifies the Crypto Provider */ virtual const XMLCh * getProviderName() const; //@} /*\@}*/ }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOPROVIDER_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp000644 001751 001751 00000020145 12003301053 024770 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyRSA := RSA Keys * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyRSA.hpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #ifndef OPENSSLCRYPTOKEYRSA_INCLUDE #define OPENSSLCRYPTOKEYRSA_INCLUDE #include #if defined (XSEC_HAVE_OPENSSL) #include /** * \ingroup opensslcrypto */ /** * \brief Implementation of the interface class for RSA keys. * * The library uses classes derived from this to process RSA keys. */ class DSIG_EXPORT OpenSSLCryptoKeyRSA : public XSECCryptoKeyRSA { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoKeyRSA(); virtual ~OpenSSLCryptoKeyRSA(); //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For RSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** * \brief Return the OpenSSL identifier string */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVOpenSSL;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Mandatory RSA interface methods * * These methods are required by the library. */ //@{ /** * \brief Set the OAEPparams string * * By default, the library expects crypto implementations to perform * OAEP padding with no params. This call allows the library (or user) * to set a params value prior to an encrypt/decrypt operation. * * @param params buffer containing the params data. Pass in NULL to clear any * old paramters. * @param paramsLen number of bytes in buffer to use. Pass in 0 to clear any * old parameters. */ virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen); /** * \brief Get OAEPparams Length * * @returns the number of bytes of the OAEPparams buffer (assuming it has been set) */ virtual unsigned int getOAEPparamsLen(void) const; /** * \brief Get the OAEPparams * * @returns a pointer to the (crypto object owned) buffer holding the OAEPparams * or NULL if no params are held */ virtual const unsigned char * getOAEPparams(void) const; /** * \brief Set the MGF * * By default, the library expects crypto implementations to perform * OAEP padding with MGF_SHA1. This call allows the library (or user) * to set a different choice. * * @param mgf the MGF constant identifying the function to use */ virtual void setMGF(maskGenerationFunc mgf); /** * \brief Get the MGF * * @returns the MGF constant in use */ virtual enum maskGenerationFunc getMGF(void) const; /** * \brief Verify a SHA1 PKCS1 encoded signature * * The library will call this function to validate an RSA signature * The standard by default uses SHA1 in a PKCS1 encoding. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @param hm The hash method that was used to create the hash that is being * passed in * @returns true if the signature was valid, false otherwise */ virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm); /** * \brief Create a signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature will * be Base64 encoded such that it can be placed directly into the * XML document * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer * @param hm Hash Method used in order to embed correct OID for sig */ virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm); /** * \brief Decrypt using private key * * The library will call this function to decrypt a piece of cipher * text using the private component of this key. * * @param inBuf cipher text to decrypt * @param plainBuf output buffer for decrypted bytes * @param inLength bytes of cipher text to decrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Encrypt using a public key * * The library will call this function to encrypt a plain text buffer * using the public component of this key. * * @param inBuf plain text to decrypt * @param cipherBuf output buffer for decrypted bytes * @param inLength bytes of plain text to encrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Obtain the length of an RSA key * * @returns The length of the rsa key (in bytes) */ virtual unsigned int getLength(void) const; //@} /** @name Optional Interface methods * * Have been implemented to allow interoperability testing */ //@{ /** * \brief Load the modulus * * Load the modulus from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len); /** * \brief Load the exponent * * Load the exponent from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len); //@} /** @name OpenSSL specific methods */ //@{ /** * \brief Constructor to create the object around an existing OpenSSL RSA * key * * @param k The key to copy * @note The object takes a copy of the original key, and will not delete k on * completion. This must be done by the caller. */ OpenSSLCryptoKeyRSA(EVP_PKEY *k); /** * \brief Get OpenSSL RSA Object */ RSA * getOpenSSLRSA(void) {return mp_rsaKey;} /** * \brief Get OpenSSL RSA Object */ const RSA * getOpenSSLRSA(void) const {return mp_rsaKey;} //@} private: RSA * mp_rsaKey; unsigned char * mp_oaepParams; unsigned int m_oaepParamsLen; maskGenerationFunc m_mgf; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOKEYRSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoX509.hpp000644 001751 001751 00000007076 12003301053 024347 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoX509:= OpenSSL based class for handling X509 (V3) certificates * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoX509.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOX509_INCLUDE #define OPENSSLCRYPTOX509_INCLUDE #include #include #if defined (XSEC_HAVE_OPENSSL) #include #include /** * \brief Implementation class for interface for X509 certificates. * @ingroup opensslcrypto * * The library uses classes derived from this to process X509 Certificates. * */ class DSIG_EXPORT OpenSSLCryptoX509 : public XSECCryptoX509 { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoX509(); virtual ~OpenSSLCryptoX509(); //@} //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of the key stored in the certificate. * * Will extract the key from the certificate to return the appropriate * type * */ virtual XSECCryptoKey::KeyType getPublicKeyType() const; /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const; /** * \brief Get a copy of the public key. * * Extracts the public key from the certificate and returns the appropriate * OpenSSLCryrptoKey (DSA or RSA) object * */ virtual XSECCryptoKey * clonePublicKey() const; //@} /** @name Load and Get the certificate */ //@{ /** * \brief Load a certificate into the object. * * Take a base64 DER encoded certificate and load. * * @param buf A buffer containing the Base64 encoded certificate * @param len The number of bytes of data in the certificate. */ virtual void loadX509Base64Bin(const char * buf, unsigned int len); /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual safeBuffer &getDEREncodingSB(void) {return m_DERX509;} /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual const safeBuffer &getDEREncodingSB(void) const {return m_DERX509;} //@} /** @name OpenSSL Library Specific functions */ //@{ /** * \brief OpenSSL specific constructor * * Construct the object around an existing X509 certificate */ OpenSSLCryptoX509(X509 * x); /** * \brief Get OpenSSL certificate structure */ X509 * getOpenSSLX509(void) {return mp_X509;} /** * \brief Get OpenSSL certificate structure */ const X509 * getOpenSSLX509(void) const {return mp_X509;} //@} private: X509 * mp_X509; // The X509 structure safeBuffer m_DERX509; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOX509_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoHashHMAC.hpp000644 001751 001751 00000010700 12003301053 025202 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoHashHMAC := OpenSSL Implementation of HMAC * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoHashHMAC.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOHASHHMAC_INCLUDE #define OPENSSLCRYPTOHASHHMAC_INCLUDE #include #include #include // OpenSSL Includes #if defined (XSEC_HAVE_OPENSSL) #include #include /** * @ingroup opensslcrypto */ /** * \brief Implementation of HMAC Hash functions in OpenSSL * * Uses the OpenSSL EVP_digest functions to implement the various * HMAC hash functions required by the library. * */ class DSIG_EXPORT OpenSSLCryptoHashHMAC : public XSECCryptoHash { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Create the object, with the indicated algorithm * (Currently supports MD5 and SHA1) * * @param alg Digest algorithm to use */ OpenSSLCryptoHashHMAC(XSECCryptoHash::HashType alg); /** * \brief Destructor * * Destroy the object. Will ensure any key material is also destroyed */ virtual ~OpenSSLCryptoHashHMAC(); //@} /** @name HMAC Functions */ //@{ /** *\brief Set the HMAC key * * Sets the key - which needs to have a base class of * OpenSSLCryptoKeyHMAC. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key); /** * \brief Return the string identifier for the OpenSSL interface */ virtual const XMLCh * getProviderName() {return DSIGConstants::s_unicodeStrPROVOpenSSL;} //@} /** @name Hash Functions */ //{@ /** * \brief Reset the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes). This is effectively the * signature for the data that has been run through the HMAC function. * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength);// Finish and get hash //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; /** * \brief Get OpenSSL Hash Context */ HMAC_CTX * getOpenSSLHMAC_CTX(void) {return &m_hctx;} //@} private: // Not implemented constructors OpenSSLCryptoHashHMAC(); const EVP_MD * mp_md; // Digest instance unsigned char m_mdValue[EVP_MAX_MD_SIZE]; // Final output unsigned int m_mdLen; // Length of digest HashType m_hashType; // What type of hash is this? HMAC_CTX m_hctx; // Context for HMAC safeBuffer m_keyBuf; // The loaded key unsigned int m_keyLen; // The loaded key length bool m_initialised; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOHASHHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp000644 001751 001751 00000012255 12003301053 024755 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoKeyDSA := DSA Keys * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyDSA.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOKEYDSA_INCLUDE #define OPENSSLCRYPTOKEYDSA_INCLUDE #include #if defined (XSEC_HAVE_OPENSSL) #include /** * \ingroup opensslcrypto */ /** * \brief OpenSSL implementation class for DSA keys. * * The library uses classes derived from this to process DSA keys. */ class DSIG_EXPORT OpenSSLCryptoKeyDSA : public XSECCryptoKeyDSA { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoKeyDSA(); /** * \brief Destructor * * Will call the OpenSSL function to destroy the DSA key - which will * also overwrite any Private keys */ virtual ~OpenSSLCryptoKeyDSA(); //@} /** @name Required Key Interface methods */ //@{ /** * \brief Return the type of this key. * * Allows the caller (and library) to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** *\brief Return the OpenSSL string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVOpenSSL;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Required DSA methods */ //@{ /** * \brief Create a signature * * Sign the buffer using the internal private key. Will throw a DSAError * if the key is not set, or is not a private key. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen); /** * \brief Verify a signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen); //@} /** @name Optional Interface methods * * Have been fully implemented in the OpenSSL interface to allow interop * testing to occur. * */ //@{ /** * \brief Load P * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadPBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Q * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadQBase64BigNums(const char * b64, unsigned int len); /** * \brief Load G * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadGBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Y * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadYBase64BigNums(const char * b64, unsigned int len); /** * \brief Load J * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadJBase64BigNums(const char * b64, unsigned int len); //@} /** @name OpenSSL Specific functions */ //@{ /** * \brief Library specific constructor * * Used to create a new key around an OpenSSL EVP_PKEY object * holding a DSA key */ OpenSSLCryptoKeyDSA(EVP_PKEY *k); /** * \brief Get OpenSSL DSA structure */ DSA * getOpenSSLDSA(void) {return mp_dsaKey;} /** * \brief Get OpenSSL DSA structure */ const DSA * getOpenSSLDSA(void) const {return mp_dsaKey;} //@} //@} private: XSECCryptoKey::KeyType m_keyType; DSA * mp_dsaKey; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* XSECCRYPTOKEYDSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.hpp000644 001751 001751 00000010655 12003301053 024637 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoKeyEC := EC Keys * * Author(s): Scott Cantor * * $Id:$ * */ #ifndef OPENSSLCRYPTOKEYEC_INCLUDE #define OPENSSLCRYPTOKEYEC_INCLUDE #include #if defined (XSEC_HAVE_OPENSSL) && defined(XSEC_OPENSSL_HAVE_EC) #include #include /** * \ingroup opensslcrypto */ /** * \brief OpenSSL implementation class for EC keys. * * The library uses classes derived from this to process EC keys. */ class DSIG_EXPORT OpenSSLCryptoKeyEC : public XSECCryptoKeyEC { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoKeyEC(); /** * \brief Destructor * * Will call the OpenSSL function to destroy the EC key - which will * also overwrite any Private keys */ virtual ~OpenSSLCryptoKeyEC(); //@} /** @name Required Key Interface methods */ //@{ /** * \brief Return the type of this key. * * Allows the caller (and library) to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** *\brief Return the OpenSSL string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVOpenSSL;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Required EC methods */ //@{ /** * \brief Create an EC-DSA signature * * Sign the buffer using the internal private key. Will throw an ECError * if the key is not set, or is not a private key. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen); /** * \brief Verify an EC-DSA signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen); //@} /** @name Optional Interface methods * * Have been fully implemented in the OpenSSL interface to allow interop * testing to occur. * */ //@{ virtual void loadPublicKeyBase64(const char* curveName, const char* b64, unsigned int len); //@} /** @name OpenSSL Specific functions */ //@{ /** * \brief Library specific constructor * * Used to create a new key around an OpenSSL EVP_PKEY object * holding an EC key */ OpenSSLCryptoKeyEC(EVP_PKEY *k); /** * \brief Get OpenSSL EC_KEY structure */ EC_KEY * getOpenSSLEC(void) {return mp_ecKey;} /** * \brief Get OpenSSL EC_KEY structure */ const EC_KEY * getOpenSSLEC(void) const {return mp_ecKey;} //@} //@} private: XSECCryptoKey::KeyType m_keyType; EC_KEY * mp_ecKey; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* XSECCRYPTOKEYEC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyHMAC.hpp000644 001751 001751 00000006122 12003301053 025052 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyHMAC := HMAC Keys * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyHMAC.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOKEYHMAC_INCLUDE #define OPENSSLCRYPTOKEYHMAC_INCLUDE #include #if defined (XSEC_HAVE_OPENSSL) /** * \ingroup opensslcrypto */ /** * \brief OpenSSL implementation for HMAC keys. * * Used to provide HMAC keys to OpenSSLCryptoHashHMAC */ class DSIG_EXPORT OpenSSLCryptoKeyHMAC : public XSECCryptoKeyHMAC { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoKeyHMAC(); virtual ~OpenSSLCryptoKeyHMAC() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For DSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_HMAC;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; /** * \brief Return the OpenSSL string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVOpenSSL;} //@} /** @name Optional Interface methods * * These functions do not necessarily have to be implmented. They * are used by XSECKeyInfoResolverDefault to try to create a key from * KeyInfo elements without knowing anything else. * * If an interface class does not implement these functions, a simple * stub that does nothing should be used. */ //@{ /** * \brief Set the key * * Set the key from the buffer * * @param inBuf Buffer containing the key * @param inLength Number of bytes of key in the buffer * * @note isSensitive() should have been called on the inbound buffer * to ensure the contents is overwritten when the safeBuffer is deleted */ virtual void setKey(unsigned char * inBuf, unsigned int inLength); /** * \brief Get the key value * * Copy the key into the safeBuffer and return the number of bytes * copied. * * @param outBuf Buffer to copy key into * @returns number of bytes copied in */ virtual unsigned int getKey(safeBuffer &outBuf) const; //@} private: safeBuffer m_keyBuf; unsigned int m_keyLen; }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOKEYHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoHash.hpp000644 001751 001751 00000007354 12003301053 024564 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoHash := OpenSSL Implementation of SHA1 * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoHash.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef OPENSSLCRYPTOHASHSHA1_INCLUDE #define OPENSSLCRYPTOHASHSHA1_INCLUDE #include #include // OpenSSL Includes #if defined (XSEC_HAVE_OPENSSL) # include /** * @ingroup opensslcrypto */ /** * \brief Interface definition for Hash functions. * * Uses the OpenSSL EVP_digest functions to implement the various * hash functions required by the OpenSSL library. * */ class DSIG_EXPORT OpenSSLCryptoHash : public XSECCryptoHash { public : /** @name Constructors and Destructors */ //@{ OpenSSLCryptoHash(XSECCryptoHash::HashType alg); virtual ~OpenSSLCryptoHash(); //@} /** @name HMAC Functions */ //@{ /** *\brief * * Does nothing. If the required function is an HMAC function, * then OpenSSLCryptoHashHMAC should be used. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key) {} //@} /** @name Digest/Hash functions */ //@{ /** * \brief Rest the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes) * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength);// Finish and get hash //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; /** * \brief Get OpenSSL hash context structure */ EVP_MD_CTX * getOpenSSLEVP_MD_CTX(void) {return &m_mdctx;} //@} private: // Not implemented constructors OpenSSLCryptoHash(); EVP_MD_CTX m_mdctx; // Context for digest const EVP_MD * mp_md; // Digest instance unsigned char m_mdValue[EVP_MAX_MD_SIZE]; // Final output unsigned int m_mdLen; // Length of digest HashType m_hashType; // What type of hash is this? }; #endif /* XSEC_HAVE_OPENSSL */ #endif /* OPENSSLCRYPTOHASHSHA1_INCLUDE */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp000644 001751 001751 00000010336 12003301053 025202 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoHashHMAC := OpenSSL Implementation of HMAC * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoHashHMAC.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include // Constructors/Destructors OpenSSLCryptoHashHMAC::OpenSSLCryptoHashHMAC(HashType alg) { // Initialise the digest switch (alg) { case (XSECCryptoHash::HASH_SHA1) : mp_md = EVP_get_digestbyname("SHA1"); break; case (XSECCryptoHash::HASH_MD5) : mp_md = EVP_get_digestbyname("MD5"); break; case (XSECCryptoHash::HASH_SHA224) : mp_md = EVP_get_digestbyname("SHA224"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA224 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA256) : mp_md = EVP_get_digestbyname("SHA256"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA256 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA384) : mp_md = EVP_get_digestbyname("SHA384"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA384 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA512) : mp_md = EVP_get_digestbyname("SHA512"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA512 not supported by this version of OpenSSL"); } break; default : mp_md = NULL; } if(!mp_md) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:HashHMAC - Error loading Message Digest"); } m_initialised = false; m_hashType = alg; } void OpenSSLCryptoHashHMAC::setKey(XSECCryptoKey *key) { // Use this to initialise the HMAC Context if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:HashHMAC - Non HMAC Key passed to OpenSSLHashHMAC"); } m_keyLen = ((XSECCryptoKeyHMAC *) key)->getKey(m_keyBuf); HMAC_Init(&m_hctx, m_keyBuf.rawBuffer(), m_keyLen, mp_md); m_initialised = true; } OpenSSLCryptoHashHMAC::~OpenSSLCryptoHashHMAC() { if (m_initialised) HMAC_CTX_cleanup(&m_hctx); } // Hashing Activities void OpenSSLCryptoHashHMAC::reset(void) { if (m_initialised) { HMAC_CTX_cleanup(&m_hctx); HMAC_Init(&m_hctx, m_keyBuf.rawBuffer(), m_keyLen, mp_md); } } void OpenSSLCryptoHashHMAC::hash(unsigned char * data, unsigned int length) { if (!m_initialised) throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:HashHMAC - hash called prior to setKey"); HMAC_Update(&m_hctx, data, (int) length); } unsigned int OpenSSLCryptoHashHMAC::finish(unsigned char * hash, unsigned int maxLength) { unsigned int retLen; // Finish up and copy out hash, returning the length HMAC_Final(&m_hctx, m_mdValue, &m_mdLen); // Copy to output buffer retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return retLen; } // Get information XSECCryptoHash::HashType OpenSSLCryptoHashHMAC::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp000644 001751 001751 00000063436 12003301053 024775 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoKeyRSA := RSA Keys * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyRSA.cpp 1350045 2012-06-13 22:33:10Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include #include #include #include #include #include #include XSEC_USING_XERCES(ArrayJanitor); #include namespace { // This code is modified from OpenSSL to implement SHA-2 hashing with OAEP. // The MGF code is limited to SHA-1 in accordance with the XML Encryption spec. // 0.9.8+ has a public MGF routine to call, this is a copy of it for older versions. #ifndef XSEC_OPENSSL_HAVE_MGF1 int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed, long seedlen, const EVP_MD *dgst) { long i, outlen = 0; unsigned char cnt[4]; EVP_MD_CTX c; unsigned char md[EVP_MAX_MD_SIZE]; int mdlen; int rv = -1; EVP_MD_CTX_init(&c); mdlen = EVP_MD_size(dgst); if (mdlen < 0) goto err; for (i = 0; outlen < len; i++) { cnt[0] = (unsigned char)((i >> 24) & 255); cnt[1] = (unsigned char)((i >> 16) & 255); cnt[2] = (unsigned char)((i >> 8)) & 255; cnt[3] = (unsigned char)(i & 255); if (!EVP_DigestInit_ex(&c,dgst, NULL) || !EVP_DigestUpdate(&c, seed, seedlen) || !EVP_DigestUpdate(&c, cnt, 4)) goto err; if (outlen + mdlen <= len) { if (!EVP_DigestFinal_ex(&c, mask + outlen, NULL)) goto err; outlen += mdlen; } else { if (!EVP_DigestFinal_ex(&c, md, NULL)) goto err; memcpy(mask + outlen, md, len - outlen); outlen = len; } } rv = 0; err: EVP_MD_CTX_cleanup(&c); return rv; } #endif static int MGF1(unsigned char *mask, long len, const unsigned char *seed, long seedlen, const EVP_MD* digest) { return PKCS1_MGF1(mask, len, seed, seedlen, digest); } int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, const unsigned char *from, int flen, const unsigned char *param, int plen, const EVP_MD* digest, const EVP_MD* mgf_digest) { int i, digestlen = EVP_MD_size(digest), emlen = tlen - 1; unsigned char *db, *seed; unsigned char *dbmask, seedmask[EVP_MAX_MD_SIZE]; // accomodate largest hash size if (flen > emlen - 2 * digestlen - 1) { RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } if (emlen < 2 * digestlen + 1) { RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, RSA_R_KEY_SIZE_TOO_SMALL); return 0; } to[0] = 0; seed = to + 1; db = to + digestlen + 1; if (!EVP_Digest((void *)param, plen, db, NULL, digest, NULL)) return 0; memset(db + digestlen, 0, emlen - flen - 2 * digestlen - 1); db[emlen - flen - digestlen - 1] = 0x01; memcpy(db + emlen - flen - digestlen, from, (unsigned int) flen); if (RAND_bytes(seed, digestlen) <= 0) return 0; dbmask = (unsigned char*) OPENSSL_malloc(emlen - digestlen); if (dbmask == NULL) { RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE); return 0; } if (MGF1(dbmask, emlen - digestlen, seed, digestlen, mgf_digest) < 0) return 0; for (i = 0; i < emlen - digestlen; i++) db[i] ^= dbmask[i]; if (MGF1(seedmask, digestlen, db, emlen - digestlen, mgf_digest) < 0) return 0; for (i = 0; i < digestlen; i++) seed[i] ^= seedmask[i]; OPENSSL_free(dbmask); return 1; } int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, const unsigned char *from, int flen, int num, const unsigned char *param, int plen, const EVP_MD* digest, const EVP_MD* mgf_digest) { int i, digestlen = EVP_MD_size(digest), dblen, mlen = -1; const unsigned char *maskeddb; int lzero; unsigned char *db = NULL, seed[EVP_MAX_MD_SIZE], phash[EVP_MAX_MD_SIZE]; unsigned char *padded_from; int bad = 0; if (--num < 2 * digestlen + 1) /* 'num' is the length of the modulus, i.e. does not depend on the * particular ciphertext. */ goto decoding_err; lzero = num - flen; if (lzero < 0) { /* signalling this error immediately after detection might allow * for side-channel attacks (e.g. timing if 'plen' is huge * -- cf. James H. Manger, "A Chosen Ciphertext Attack on RSA Optimal * Asymmetric Encryption Padding (OAEP) [...]", CRYPTO 2001), * so we use a 'bad' flag */ bad = 1; lzero = 0; flen = num; /* don't overflow the memcpy to padded_from */ } dblen = num - digestlen; db = (unsigned char*) OPENSSL_malloc(dblen + num); if (db == NULL) { RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, ERR_R_MALLOC_FAILURE); return -1; } /* Always do this zero-padding copy (even when lzero == 0) * to avoid leaking timing info about the value of lzero. */ padded_from = db + dblen; memset(padded_from, 0, lzero); memcpy(padded_from + lzero, from, flen); maskeddb = padded_from + digestlen; if (MGF1(seed, digestlen, maskeddb, dblen, mgf_digest)) return -1; for (i = 0; i < digestlen; i++) seed[i] ^= padded_from[i]; if (MGF1(db, dblen, seed, digestlen, mgf_digest)) return -1; for (i = 0; i < dblen; i++) db[i] ^= maskeddb[i]; if (!EVP_Digest((void *)param, plen, phash, NULL, digest, NULL)) return -1; if (memcmp(db, phash, digestlen) != 0 || bad) goto decoding_err; else { for (i = digestlen; i < dblen; i++) if (db[i] != 0x00) break; if (i == dblen || db[i] != 0x01) goto decoding_err; else { /* everything looks OK */ mlen = dblen - ++i; if (tlen < mlen) { RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_DATA_TOO_LARGE); mlen = -1; } else memcpy(to, db + i, mlen); } } OPENSSL_free(db); return mlen; decoding_err: /* to avoid chosen ciphertext attacks, the error message should not reveal * which kind of decoding error happened */ RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR); if (db != NULL) OPENSSL_free(db); return -1; } }; OpenSSLCryptoKeyRSA::OpenSSLCryptoKeyRSA() : mp_rsaKey(NULL), mp_oaepParams(NULL), m_oaepParamsLen(0), m_mgf(MGF1_SHA1) { }; OpenSSLCryptoKeyRSA::~OpenSSLCryptoKeyRSA() { // If we have a RSA, delete it (OpenSSL will clear the memory) if (mp_rsaKey) RSA_free(mp_rsaKey); if (mp_oaepParams != NULL) delete[] mp_oaepParams; }; void OpenSSLCryptoKeyRSA::setOAEPparams(unsigned char * params, unsigned int paramsLen) { if (mp_oaepParams != NULL) { delete[] mp_oaepParams; } m_oaepParamsLen = paramsLen; if (params != NULL) { XSECnew(mp_oaepParams, unsigned char[paramsLen]); memcpy(mp_oaepParams, params, paramsLen); } else mp_oaepParams = NULL; } void OpenSSLCryptoKeyRSA::setMGF(maskGenerationFunc mgf) { m_mgf = mgf; } unsigned int OpenSSLCryptoKeyRSA::getOAEPparamsLen(void) const { return m_oaepParamsLen; } const unsigned char * OpenSSLCryptoKeyRSA::getOAEPparams(void) const { return mp_oaepParams; } maskGenerationFunc OpenSSLCryptoKeyRSA::getMGF() const { return m_mgf; } // Generic key functions XSECCryptoKey::KeyType OpenSSLCryptoKeyRSA::getKeyType() const { // Find out what we have if (mp_rsaKey == NULL) return KEY_NONE; if (mp_rsaKey->n != NULL && mp_rsaKey->d != NULL) return KEY_RSA_PAIR; if (mp_rsaKey->d != NULL) return KEY_RSA_PRIVATE; if (mp_rsaKey->n != NULL) return KEY_RSA_PUBLIC; return KEY_NONE; } void OpenSSLCryptoKeyRSA::loadPublicModulusBase64BigNums(const char * b64, unsigned int len) { if (mp_rsaKey == NULL) mp_rsaKey = RSA_new(); mp_rsaKey->n = OpenSSLCryptoBase64::b642BN((char *) b64, len); } void OpenSSLCryptoKeyRSA::loadPublicExponentBase64BigNums(const char * b64, unsigned int len) { if (mp_rsaKey == NULL) mp_rsaKey = RSA_new(); mp_rsaKey->e = OpenSSLCryptoBase64::b642BN((char *) b64, len); } // "Hidden" OpenSSL functions OpenSSLCryptoKeyRSA::OpenSSLCryptoKeyRSA(EVP_PKEY *k) { // Create a new key to be loaded as we go mp_oaepParams = NULL; m_oaepParamsLen = 0; m_mgf = MGF1_SHA1; mp_rsaKey = RSA_new(); if (k == NULL || k->type != EVP_PKEY_RSA) return; // Nothing to do with us if (k->pkey.rsa->n) mp_rsaKey->n = BN_dup(k->pkey.rsa->n); if (k->pkey.rsa->e) mp_rsaKey->e = BN_dup(k->pkey.rsa->e); if (k->pkey.rsa->d) mp_rsaKey->d = BN_dup(k->pkey.rsa->d); if (k->pkey.rsa->p) mp_rsaKey->p = BN_dup(k->pkey.rsa->p); if (k->pkey.rsa->q) mp_rsaKey->q = BN_dup(k->pkey.rsa->q); if (k->pkey.rsa->dmp1) mp_rsaKey->dmp1 = BN_dup(k->pkey.rsa->dmp1); if (k->pkey.rsa->dmq1) mp_rsaKey->dmq1 = BN_dup(k->pkey.rsa->dmq1); if (k->pkey.rsa->iqmp) mp_rsaKey->iqmp = BN_dup(k->pkey.rsa->iqmp); } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool OpenSSLCryptoKeyRSA::verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm = HASH_SHA1) { // Use the currently loaded key to validate the Base64 encoded signature if (mp_rsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Attempt to validate signature with empty key"); } char* cleanedBase64Signature; unsigned int cleanedBase64SignatureLen = 0; cleanedBase64Signature = XSECCryptoBase64::cleanBuffer(base64Signature, sigLen, cleanedBase64SignatureLen); ArrayJanitor j_cleanedBase64Signature(cleanedBase64Signature); int sigValLen; unsigned char* sigVal = new unsigned char[sigLen + 1]; ArrayJanitor j_sigVal(sigVal); EVP_ENCODE_CTX m_dctx; EVP_DecodeInit(&m_dctx); int rc = EVP_DecodeUpdate(&m_dctx, sigVal, &sigValLen, (unsigned char *) cleanedBase64Signature, cleanedBase64SignatureLen); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Error during Base64 Decode"); } int t = 0; EVP_DecodeFinal(&m_dctx, &sigVal[sigValLen], &t); sigValLen += t; // Now decrypt unsigned char * decryptBuf; // Decrypt will always be longer than (RSA_len(key) - 11) decryptBuf = new unsigned char [RSA_size(mp_rsaKey)]; ArrayJanitor j_decryptBuf(decryptBuf); // Note at this time only supports PKCS1 padding // As that is what is defined in the standard. // If this ever changes we will need to pass some paramaters // into this function to allow it to determine what the // padding should be and what the message digest OID should // be. int decryptSize = RSA_public_decrypt(sigValLen, sigVal, decryptBuf, mp_rsaKey, RSA_PKCS1_PADDING); if (decryptSize < 0) { /* throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA::verify() - Error decrypting signature"); */ // Really - this is a failed signature check, not an exception! return false; } /* Check the OID */ int oidLen = 0; unsigned char * oid = getRSASigOID(hm, oidLen); if (oid == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA::verify() - Unsupported HASH algorithm for RSA"); } if (decryptSize != (int) (oidLen + hashLen) || hashLen != oid[oidLen-1]) { return false; } for (t = 0; t < oidLen; ++t) { if (oid[t] != decryptBuf[t]) { return false; } } for (;t < decryptSize; ++t) { if (hashBuf[t-oidLen] != decryptBuf[t]) { return false; } } // All OK return true; } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyRSA::signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm) { // Sign a pre-calculated hash using this key if (mp_rsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Attempt to sign data with empty key"); } // Build the buffer to be encrypted by prepending the SHA1 OID to the hash unsigned char * encryptBuf; unsigned char * preEncryptBuf; unsigned char * oid; int oidLen; int encryptLen; int preEncryptLen; oid = getRSASigOID(hm, oidLen); if (oid == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA::sign() - Unsupported HASH algorithm for RSA"); } if (hashLen != oid[oidLen-1]) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA::sign() - hashLen incorrect for hash type"); } preEncryptLen = hashLen + oidLen; preEncryptBuf = new unsigned char[preEncryptLen]; encryptBuf = new unsigned char[RSA_size(mp_rsaKey)]; memcpy(preEncryptBuf, oid, oidLen); memcpy(&preEncryptBuf[oidLen], hashBuf, hashLen); // Now encrypt encryptLen = RSA_private_encrypt(preEncryptLen, preEncryptBuf, encryptBuf, mp_rsaKey, RSA_PKCS1_PADDING); delete[] preEncryptBuf; if (encryptLen < 0) { delete[] encryptBuf; throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA::sign() - Error encrypting hash"); } // Now convert to Base 64 BIO * b64 = BIO_new(BIO_f_base64()); BIO * bmem = BIO_new(BIO_s_mem()); BIO_set_mem_eof_return(bmem, 0); b64 = BIO_push(b64, bmem); // Translate signature to Base64 BIO_write(b64, encryptBuf, encryptLen); BIO_flush(b64); unsigned int sigValLen = BIO_read(bmem, base64SignatureBuf, base64SignatureBufLen); BIO_free_all(b64); delete[] encryptBuf; if (sigValLen <= 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:RSA - Error base64 encoding signature"); } return sigValLen; } // -------------------------------------------------------------------------------- // decrypt a buffer // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyRSA::privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform a decrypt if (mp_rsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Attempt to decrypt data with empty key"); } #if 0 /* normally commented out code to determine endian problems */ unsigned int i; unsigned char e[2048]; unsigned char * inBuf1 = (unsigned char *) inBuf; if (inLength < 2048) { memcpy(e, inBuf, inLength); for (i = 0; i < inLength;++i) { inBuf1[i] = e[inLength - 1 - i]; } } #endif int decryptSize; switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : decryptSize = RSA_private_decrypt(inLength, #if defined(XSEC_OPENSSL_CONST_BUFFERS) inBuf, #else (unsigned char *) inBuf, #endif plainBuf, mp_rsaKey, RSA_PKCS1_PADDING); if (decryptSize < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA privateKeyDecrypt - Error Decrypting PKCS1_5 padded RSA encrypt"); } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : { unsigned char * tBuf; int num = RSA_size(mp_rsaKey); XSECnew(tBuf, unsigned char[num]); ArrayJanitor j_tBuf(tBuf); const EVP_MD* evp_md = NULL; const EVP_MD* mgf_md = NULL; switch (hm) { case HASH_SHA1: evp_md = EVP_get_digestbyname("SHA1"); break; case HASH_SHA224: evp_md = EVP_get_digestbyname("SHA224"); break; case HASH_SHA256: evp_md = EVP_get_digestbyname("SHA256"); break; case HASH_SHA384: evp_md = EVP_get_digestbyname("SHA384"); break; case HASH_SHA512: evp_md = EVP_get_digestbyname("SHA512"); break; } if (evp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:RSA - OAEP digest algorithm not supported by this version of OpenSSL"); } switch (m_mgf) { case MGF1_SHA1: mgf_md = EVP_get_digestbyname("SHA1"); break; case MGF1_SHA224: mgf_md = EVP_get_digestbyname("SHA224"); break; case MGF1_SHA256: mgf_md = EVP_get_digestbyname("SHA256"); break; case MGF1_SHA384: mgf_md = EVP_get_digestbyname("SHA384"); break; case MGF1_SHA512: mgf_md = EVP_get_digestbyname("SHA512"); break; } if (mgf_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:RSA - MGF not supported by this version of OpenSSL"); } decryptSize = RSA_private_decrypt(inLength, #if defined(XSEC_OPENSSL_CONST_BUFFERS) inBuf, #else (unsigned char *) inBuf, #endif tBuf, mp_rsaKey, RSA_NO_PADDING); if (decryptSize < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA privateKeyDecrypt - Error doing raw decrypt of RSA encrypted data"); } // Clear out the "0"s at the front int i; for (i = 0; i < num && tBuf[i] == 0; ++i) --decryptSize; decryptSize = RSA_padding_check_PKCS1_OAEP(plainBuf, maxOutLength, &tBuf[i], decryptSize, num, mp_oaepParams, m_oaepParamsLen, evp_md, mgf_md); if (decryptSize < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA privateKeyDecrypt - Error removing OAEPadding"); } } break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Unknown padding method"); } #if 0 /* normally commented out code to determine endian problems */ int i; unsigned char t[512]; if (decryptSize < 512) { memcpy(t, plainBuf, decryptSize); for (i = 0; i < decryptSize;++i) { plainBuf[i] = t[decryptSize - 1 - i]; } } #endif return decryptSize; } // -------------------------------------------------------------------------------- // encrypt a buffer // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyRSA::publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform an encrypt if (mp_rsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Attempt to encrypt data with empty key"); } int encryptSize; switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : encryptSize = RSA_public_encrypt(inLength, #if defined(XSEC_OPENSSL_CONST_BUFFERS) inBuf, #else (unsigned char *) inBuf, #endif cipherBuf, mp_rsaKey, RSA_PKCS1_PADDING); if (encryptSize < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA publicKeyEncrypt - Error performing PKCS1_5 padded RSA encrypt"); } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : { unsigned char * tBuf; unsigned int num = RSA_size(mp_rsaKey); if (maxOutLength < num) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA publicKeyEncrypt - Not enough space in cipherBuf"); } const EVP_MD* evp_md = NULL; const EVP_MD* mgf_md = NULL; switch (hm) { case HASH_SHA1: evp_md = EVP_get_digestbyname("SHA1"); break; case HASH_SHA224: evp_md = EVP_get_digestbyname("SHA224"); break; case HASH_SHA256: evp_md = EVP_get_digestbyname("SHA256"); break; case HASH_SHA384: evp_md = EVP_get_digestbyname("SHA384"); break; case HASH_SHA512: evp_md = EVP_get_digestbyname("SHA512"); break; } if (evp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:RSA - OAEP digest algorithm not supported by this version of OpenSSL"); } switch (m_mgf) { case MGF1_SHA1: mgf_md = EVP_get_digestbyname("SHA1"); break; case MGF1_SHA224: mgf_md = EVP_get_digestbyname("SHA224"); break; case MGF1_SHA256: mgf_md = EVP_get_digestbyname("SHA256"); break; case MGF1_SHA384: mgf_md = EVP_get_digestbyname("SHA384"); break; case MGF1_SHA512: mgf_md = EVP_get_digestbyname("SHA512"); break; } if (mgf_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:RSA - MGF not supported by this version of OpenSSL"); } XSECnew(tBuf, unsigned char[num]); ArrayJanitor j_tBuf(tBuf); // First add the padding encryptSize = RSA_padding_add_PKCS1_OAEP(tBuf, num, //#if defined(XSEC_OPENSSL_CONST_BUFFERS) inBuf, //#else // (unsigned char *) inBuf, //#endif inLength, mp_oaepParams, m_oaepParamsLen, evp_md, mgf_md); if (encryptSize <= 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA publicKeyEncrypt - Error adding OAEPadding"); } encryptSize = RSA_public_encrypt(num, tBuf, cipherBuf, mp_rsaKey, RSA_NO_PADDING); if (encryptSize < 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA publicKeyEncrypt - Error encrypting padded data"); } } break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "OpenSSL:RSA - Unknown padding method"); } return encryptSize; } // -------------------------------------------------------------------------------- // Size in bytes // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyRSA::getLength(void) const { if (mp_rsaKey != NULL) return RSA_size(mp_rsaKey); return 0; } // -------------------------------------------------------------------------------- // Clone this key // -------------------------------------------------------------------------------- XSECCryptoKey * OpenSSLCryptoKeyRSA::clone() const { OpenSSLCryptoKeyRSA * ret; XSECnew(ret, OpenSSLCryptoKeyRSA); ret->mp_rsaKey = RSA_new(); if (mp_oaepParams != NULL) { XSECnew(ret->mp_oaepParams, unsigned char[m_oaepParamsLen]); memcpy(ret->mp_oaepParams, mp_oaepParams, m_oaepParamsLen); ret->m_oaepParamsLen = m_oaepParamsLen; } else { ret->mp_oaepParams = NULL; ret->m_oaepParamsLen = 0; } // Duplicate parameters if (mp_rsaKey->n) ret->mp_rsaKey->n = BN_dup(mp_rsaKey->n); if (mp_rsaKey->e) ret->mp_rsaKey->e = BN_dup(mp_rsaKey->e); if (mp_rsaKey->d) ret->mp_rsaKey->d = BN_dup(mp_rsaKey->d); if (mp_rsaKey->p) ret->mp_rsaKey->p = BN_dup(mp_rsaKey->p); if (mp_rsaKey->q) ret->mp_rsaKey->q = BN_dup(mp_rsaKey->q); if (mp_rsaKey->dmp1) ret->mp_rsaKey->dmp1 = BN_dup(mp_rsaKey->dmp1); if (mp_rsaKey->dmq1) ret->mp_rsaKey->dmq1 = BN_dup(mp_rsaKey->dmq1); if (mp_rsaKey->iqmp) ret->mp_rsaKey->iqmp = BN_dup(mp_rsaKey->iqmp); return ret; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoHash.cpp000644 001751 001751 00000006753 12003301053 024561 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoHashSHA1 := OpenSSL Implementation of SHA1 * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoHash.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include // Constructors/Destructors OpenSSLCryptoHash::OpenSSLCryptoHash(HashType alg) { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : mp_md = EVP_get_digestbyname("SHA1"); break; case (XSECCryptoHash::HASH_MD5) : mp_md = EVP_get_digestbyname("MD5"); break; case (XSECCryptoHash::HASH_SHA224) : mp_md = EVP_get_digestbyname("SHA224"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA224 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA256) : mp_md = EVP_get_digestbyname("SHA256"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA256 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA384) : mp_md = EVP_get_digestbyname("SHA384"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA384 not supported by this version of OpenSSL"); } break; case (XSECCryptoHash::HASH_SHA512) : mp_md = EVP_get_digestbyname("SHA512"); if (mp_md == NULL) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - SHA512 not supported by this version of OpenSSL"); } break; default : mp_md = NULL; } if(!mp_md) { throw XSECCryptoException(XSECCryptoException::MDError, "OpenSSL:Hash - Error loading Message Digest"); } EVP_DigestInit(&m_mdctx, mp_md); m_hashType = alg; } OpenSSLCryptoHash::~OpenSSLCryptoHash() { EVP_MD_CTX_cleanup(&m_mdctx); } // Hashing Activities void OpenSSLCryptoHash::reset(void) { EVP_MD_CTX_cleanup(&m_mdctx); EVP_DigestInit(&m_mdctx, mp_md); } void OpenSSLCryptoHash::hash(unsigned char * data, unsigned int length) { EVP_DigestUpdate(&m_mdctx, data, length); } unsigned int OpenSSLCryptoHash::finish(unsigned char * hash, unsigned int maxLength) { unsigned int retLen; // Finish up and copy out hash, returning the length EVP_DigestFinal(&m_mdctx, m_mdValue, &m_mdLen); // Copy to output buffer retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return retLen; } // Get information XSECCryptoHash::HashType OpenSSLCryptoHash::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoProvider.cpp000644 001751 001751 00000033675 12003301053 025473 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoProvider := Base class to define an OpenSSL module * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoProvider.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include #include #include #include #include #include #include #include #include #include #include XSEC_USING_XERCES(ArrayJanitor); XSEC_USING_XERCES(Janitor); #include #include #include OpenSSLCryptoProvider::OpenSSLCryptoProvider() { OpenSSL_add_all_algorithms(); // Initialise Openssl ERR_load_crypto_strings(); //SSLeay_add_all_algorithms(); #ifdef XSEC_OPENSSL_HAVE_EC // Populate curve names. m_namedCurveMap["urn:oid:1.3.132.0.6"] = NID_secp112r1; m_namedCurveMap["urn:oid:1.3.132.0.7"] = NID_secp112r2; m_namedCurveMap["urn:oid:1.3.132.0.28"] = NID_secp128r1; m_namedCurveMap["urn:oid:1.3.132.0.29"] = NID_secp128r2; m_namedCurveMap["urn:oid:1.3.132.0.9"] = NID_secp160k1; m_namedCurveMap["urn:oid:1.3.132.0.8"] = NID_secp160r1; m_namedCurveMap["urn:oid:1.3.132.0.30"] = NID_secp160r2; m_namedCurveMap["urn:oid:1.3.132.0.31"] = NID_secp192k1; m_namedCurveMap["urn:oid:1.3.132.0.32"] = NID_secp224k1; m_namedCurveMap["urn:oid:1.3.132.0.33"] = NID_secp224r1; m_namedCurveMap["urn:oid:1.3.132.0.10"] = NID_secp256k1; m_namedCurveMap["urn:oid:1.3.132.0.34"] = NID_secp384r1; m_namedCurveMap["urn:oid:1.3.132.0.35"] = NID_secp521r1; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.1"] = NID_X9_62_prime192v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.2"] = NID_X9_62_prime192v2; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.3"] = NID_X9_62_prime192v3; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.4"] = NID_X9_62_prime239v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.5"] = NID_X9_62_prime239v2; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.6"] = NID_X9_62_prime239v3; m_namedCurveMap["urn:oid:1.2.840.10045.3.1.7"] = NID_X9_62_prime256v1; m_namedCurveMap["urn:oid:1.3.132.0.4"] = NID_sect113r1; m_namedCurveMap["urn:oid:1.3.132.0.5"] = NID_sect113r2; m_namedCurveMap["urn:oid:1.3.132.0.22"] = NID_sect131r1; m_namedCurveMap["urn:oid:1.3.132.0.23"] = NID_sect131r2; m_namedCurveMap["urn:oid:1.3.132.0.1"] = NID_sect163k1; m_namedCurveMap["urn:oid:1.3.132.0.2"] = NID_sect163r1; m_namedCurveMap["urn:oid:1.3.132.0.15"] = NID_sect163r2; m_namedCurveMap["urn:oid:1.3.132.0.24"] = NID_sect193r1; m_namedCurveMap["urn:oid:1.3.132.0.25"] = NID_sect193r2; m_namedCurveMap["urn:oid:1.3.132.0.26"] = NID_sect233k1; m_namedCurveMap["urn:oid:1.3.132.0.27"] = NID_sect233r1; m_namedCurveMap["urn:oid:1.3.132.0.3"] = NID_sect239k1; m_namedCurveMap["urn:oid:1.3.132.0.16"] = NID_sect283k1; m_namedCurveMap["urn:oid:1.3.132.0.17"] = NID_sect283r1; m_namedCurveMap["urn:oid:1.3.132.0.36"] = NID_sect409k1; m_namedCurveMap["urn:oid:1.3.132.0.37"] = NID_sect409r1; m_namedCurveMap["urn:oid:1.3.132.0.38"] = NID_sect571k1; m_namedCurveMap["urn:oid:1.3.132.0.39"] = NID_sect571r1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.1"] = NID_X9_62_c2pnb163v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.2"] = NID_X9_62_c2pnb163v2; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.3"] = NID_X9_62_c2pnb163v3; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.4"] = NID_X9_62_c2pnb176v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.5"] = NID_X9_62_c2tnb191v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.6"] = NID_X9_62_c2tnb191v2; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.7"] = NID_X9_62_c2tnb191v3; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.8"] = NID_X9_62_c2onb191v4; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.9"] = NID_X9_62_c2onb191v5; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.10"] = NID_X9_62_c2pnb208w1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.11"] = NID_X9_62_c2tnb239v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.12"] = NID_X9_62_c2tnb239v2; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.13"] = NID_X9_62_c2tnb239v3; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.14"] = NID_X9_62_c2onb239v4; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.15"] = NID_X9_62_c2onb239v5; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.16"] = NID_X9_62_c2pnb272w1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.17"] = NID_X9_62_c2pnb304w1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.18"] = NID_X9_62_c2tnb359v1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.19"] = NID_X9_62_c2pnb368w1; m_namedCurveMap["urn:oid:1.2.840.10045.3.0.20"] = NID_X9_62_c2tnb431r1; m_namedCurveMap["urn:oid:2.23.43.1.4.1"] = NID_wap_wsg_idm_ecid_wtls1; m_namedCurveMap["urn:oid:2.23.43.1.4.3"] = NID_wap_wsg_idm_ecid_wtls3; m_namedCurveMap["urn:oid:2.23.43.1.4.4"] = NID_wap_wsg_idm_ecid_wtls4; m_namedCurveMap["urn:oid:2.23.43.1.4.5"] = NID_wap_wsg_idm_ecid_wtls5; m_namedCurveMap["urn:oid:2.23.43.1.4.6"] = NID_wap_wsg_idm_ecid_wtls6; m_namedCurveMap["urn:oid:2.23.43.1.4.7"] = NID_wap_wsg_idm_ecid_wtls7; m_namedCurveMap["urn:oid:2.23.43.1.4.8"] = NID_wap_wsg_idm_ecid_wtls8; m_namedCurveMap["urn:oid:2.23.43.1.4.9"] = NID_wap_wsg_idm_ecid_wtls9; m_namedCurveMap["urn:oid:2.23.43.1.4.10"] = NID_wap_wsg_idm_ecid_wtls10; m_namedCurveMap["urn:oid:2.23.43.1.4.11"] = NID_wap_wsg_idm_ecid_wtls11; m_namedCurveMap["urn:oid:2.23.43.1.4.12"] = NID_wap_wsg_idm_ecid_wtls12; #endif } OpenSSLCryptoProvider::~OpenSSLCryptoProvider() { EVP_cleanup(); ERR_free_strings(); /* As suggested by Jesse Pelton */ #if defined(XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA) CRYPTO_cleanup_all_ex_data(); #endif RAND_cleanup(); X509_TRUST_cleanup(); ERR_remove_state(0); } #ifdef XSEC_OPENSSL_HAVE_EC int OpenSSLCryptoProvider::curveNameToNID(const char* curveName) const { std::map::const_iterator i = m_namedCurveMap.find(curveName); if (i == m_namedCurveMap.end()) throw XSECCryptoException(XSECCryptoException::UnsupportedError, "OpenSSLCryptoProvider::curveNameToNID - curve name not recognized"); return i->second; } #endif const XMLCh * OpenSSLCryptoProvider::getProviderName() const { return DSIGConstants::s_unicodeStrPROVOpenSSL; } // Hashing classes XSECCryptoHash * OpenSSLCryptoProvider::hashSHA1() const { OpenSSLCryptoHash * ret; XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA1)); return ret; } XSECCryptoHash * OpenSSLCryptoProvider::hashHMACSHA1() const { OpenSSLCryptoHashHMAC * ret; XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA1)); return ret; } XSECCryptoHash * OpenSSLCryptoProvider::hashSHA(int length) const { OpenSSLCryptoHash * ret; switch (length) { case 160: XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA1)); break; case 224: XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA224)); break; case 256: XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA256)); break; case 384: XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA384)); break; case 512: XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_SHA512)); break; default: ret = NULL; } return ret; } XSECCryptoHash * OpenSSLCryptoProvider::hashHMACSHA(int length) const { OpenSSLCryptoHashHMAC * ret; switch (length) { case 160: XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA1)); break; case 224: XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA224)); break; case 256: XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA256)); break; case 384: XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA384)); break; case 512: XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_SHA512)); break; default: ret = NULL; } return ret; } XSECCryptoHash * OpenSSLCryptoProvider::hashMD5() const { OpenSSLCryptoHash * ret; XSECnew(ret, OpenSSLCryptoHash(XSECCryptoHash::HASH_MD5)); return ret; } XSECCryptoHash * OpenSSLCryptoProvider::hashHMACMD5() const { OpenSSLCryptoHashHMAC * ret; XSECnew(ret, OpenSSLCryptoHashHMAC(XSECCryptoHash::HASH_MD5)); return ret; } XSECCryptoKeyHMAC * OpenSSLCryptoProvider::keyHMAC(void) const { OpenSSLCryptoKeyHMAC * ret; XSECnew(ret, OpenSSLCryptoKeyHMAC); return ret; } XSECCryptoKeyDSA * OpenSSLCryptoProvider::keyDSA() const { OpenSSLCryptoKeyDSA * ret; XSECnew(ret, OpenSSLCryptoKeyDSA()); return ret; } XSECCryptoKeyEC * OpenSSLCryptoProvider::keyEC() const { #ifdef XSEC_OPENSSL_HAVE_EC OpenSSLCryptoKeyEC * ret; XSECnew(ret, OpenSSLCryptoKeyEC()); return ret; #else throw XSECCryptoException(XSECCryptoException::UnsupportedError, "OpenSSLCryptoProvider::keyEC - EC support not available"); #endif } XSECCryptoKeyRSA * OpenSSLCryptoProvider::keyRSA() const { OpenSSLCryptoKeyRSA * ret; XSECnew(ret, OpenSSLCryptoKeyRSA()); return ret; } XSECCryptoKey* OpenSSLCryptoProvider::keyDER(const char* buf, unsigned long len, bool base64) const { EVP_PKEY* pkey = NULL; if (base64) { int bufLen = len; unsigned char * outBuf; XSECnew(outBuf, unsigned char[len + 1]); ArrayJanitor j_outBuf(outBuf); /* Had to move to our own Base64 decoder because it handles non-wrapped b64 better. Grrr. */ XSCryptCryptoBase64 *b64; XSECnew(b64, XSCryptCryptoBase64); Janitor j_b64(b64); b64->decodeInit(); bufLen = b64->decode((unsigned char *) buf, len, outBuf, len); bufLen += b64->decodeFinish(&outBuf[bufLen], len-bufLen); BIO* b = BIO_new_mem_buf((void*)outBuf, bufLen); pkey = d2i_PUBKEY_bio(b, NULL); BIO_free(b); } else { BIO* b = BIO_new_mem_buf((void*)buf, len); pkey = d2i_PUBKEY_bio(b, NULL); BIO_free(b); } if (pkey) { XSECCryptoKey* ret = NULL; try { switch (pkey->type) { case EVP_PKEY_RSA: ret = new OpenSSLCryptoKeyRSA(pkey); break; case EVP_PKEY_DSA: ret = new OpenSSLCryptoKeyDSA(pkey); break; #if defined(XSEC_OPENSSL_HAVE_EC) case EVP_PKEY_EC: ret = new OpenSSLCryptoKeyEC(pkey); break; #endif } } catch (XSECCryptoException&) { EVP_PKEY_free(pkey); throw; } EVP_PKEY_free(pkey); return ret; } throw XSECCryptoException(XSECCryptoException::UnsupportedError, "OpenSSLCryptoProvider::keyDER - Error decoding public key"); } XSECCryptoX509 * OpenSSLCryptoProvider::X509() const { OpenSSLCryptoX509 * ret; XSECnew(ret, OpenSSLCryptoX509()); return ret; } XSECCryptoBase64 * OpenSSLCryptoProvider::base64() const { #if 0 OpenSSLCryptoBase64 * ret; XSECnew(ret, OpenSSLCryptoBase64()); #else XSCryptCryptoBase64 *ret; XSECnew(ret, XSCryptCryptoBase64); #endif return ret; } bool OpenSSLCryptoProvider::algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const { switch (alg) { case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : #if !defined (XSEC_OPENSSL_HAVE_AES) return false; #endif case (XSECCryptoSymmetricKey::KEY_3DES_192) : return true; default: return false; } return false; } bool OpenSSLCryptoProvider::algorithmSupported(XSECCryptoHash::HashType alg) const { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : case (XSECCryptoHash::HASH_MD5) : return true; case (XSECCryptoHash::HASH_SHA224) : case (XSECCryptoHash::HASH_SHA256) : #if defined(XSEC_OPENSSL_HAVE_SHA2) && !defined(OPENSSL_NO_SHA256) return true; #else return false; #endif case (XSECCryptoHash::HASH_SHA384) : case (XSECCryptoHash::HASH_SHA512) : #if defined(XSEC_OPENSSL_HAVE_SHA2) && !defined(OPENSSL_NO_SHA512) return true; #else return false; #endif default: return false; } return false; } XSECCryptoSymmetricKey * OpenSSLCryptoProvider::keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const { OpenSSLCryptoSymmetricKey * ret; XSECnew(ret, OpenSSLCryptoSymmetricKey(alg)); return ret; } unsigned int OpenSSLCryptoProvider::getRandom(unsigned char * buffer, unsigned int numOctets) const { if (RAND_status() != 1) { throw XSECCryptoException(XSECCryptoException::GeneralError, "OpenSSLCryptoProvider::getRandom - OpenSSL random not properly initialised"); } int res = RAND_bytes(buffer, numOctets); if (res == 0) { throw XSECCryptoException(XSECCryptoException::GeneralError, "OpenSSLCryptoProvider::getRandom - Error obtaining random octets"); } return numOctets; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoX509.cpp000644 001751 001751 00000013171 12003301053 024333 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoX509:= OpenSSL based class for handling X509 (V3) certificates * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoX509.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include #include #include #include #include #include XSEC_USING_XERCES(ArrayJanitor); XSEC_USING_XERCES(Janitor); #include OpenSSLCryptoX509::OpenSSLCryptoX509() : m_DERX509("") { mp_X509 = NULL; } OpenSSLCryptoX509::~OpenSSLCryptoX509() { if (mp_X509 != NULL) X509_free(mp_X509); } OpenSSLCryptoX509::OpenSSLCryptoX509(X509 * x) { // Build this from an existing X509 structure mp_X509 = X509_dup(x); // Now need to create the DER encoding BIO * b64 = BIO_new(BIO_f_base64()); BIO * bmem = BIO_new(BIO_s_mem()); BIO_set_mem_eof_return(bmem, 0); b64 = BIO_push(b64, bmem); // Translate X509 to Base64 i2d_X509_bio(b64, x); BIO_flush(b64); char buf[1024]; unsigned int l; m_DERX509.sbStrcpyIn(""); while ((l = BIO_read(bmem, buf, 1023)) > 0) { buf[l] = '\0'; m_DERX509.sbStrcatIn(buf); } BIO_free_all(b64); } // load functions void OpenSSLCryptoX509::loadX509Base64Bin(const char * buf, unsigned int len) { // Free anything currently held. if (mp_X509 != NULL) X509_free(mp_X509); // Have to implement using EVP_Decode routines due to a bug in older // versions of OpenSSL BIO_f_base64 int bufLen = len; unsigned char * outBuf; XSECnew(outBuf, unsigned char[len + 1]); ArrayJanitor j_outBuf(outBuf); /* Had to move to our own Base64 decoder because it handles non-wrapped b64 better. Grrr. */ XSCryptCryptoBase64 *b64; XSECnew(b64, XSCryptCryptoBase64); Janitor j_b64(b64); b64->decodeInit(); bufLen = b64->decode((unsigned char *) buf, len, outBuf, len); bufLen += b64->decodeFinish(&outBuf[bufLen], len-bufLen); /* EVP_ENCODE_CTX m_dctx; EVP_DecodeInit(&m_dctx); int rc = EVP_DecodeUpdate(&m_dctx, outBuf, &bufLen, (unsigned char *) buf, len); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::Base64Error, "OpenSSL:Base64 - Error during Base64 Decode of X509 Certificate"); } int finalLen; EVP_DecodeFinal(&m_dctx, &outBuf[bufLen], &finalLen); bufLen += finalLen; */ if (bufLen > 0) { #if defined(XSEC_OPENSSL_D2IX509_CONST_BUFFER) mp_X509= d2i_X509(NULL, (const unsigned char **) (&outBuf), bufLen); #else mp_X509= d2i_X509(NULL, &outBuf, bufLen); #endif } // Check to see if we have a certificate.... if (mp_X509 == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509 - Error translating Base64 DER encoding into OpenSSL X509 structure"); } m_DERX509.sbStrcpyIn(buf); } // Info functions const XMLCh * OpenSSLCryptoX509::getProviderName() const { return DSIGConstants::s_unicodeStrPROVOpenSSL; } XSECCryptoKey::KeyType OpenSSLCryptoX509::getPublicKeyType() const { if (mp_X509 == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509 - getPublicKeyType called before X509 loaded"); } EVP_PKEY *pkey; pkey = X509_get_pubkey(mp_X509); if (pkey == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509 - cannot retrieve public key from cert"); } XSECCryptoKey::KeyType ret; switch (pkey->type) { case EVP_PKEY_DSA : ret = XSECCryptoKey::KEY_DSA_PUBLIC; break; case EVP_PKEY_RSA : ret = XSECCryptoKey::KEY_RSA_PUBLIC; break; #if defined(XSEC_OPENSSL_HAVE_EC) case EVP_PKEY_EC : ret = XSECCryptoKey::KEY_EC_PUBLIC; break; #endif default : ret = XSECCryptoKey::KEY_NONE; } EVP_PKEY_free (pkey); return ret; } // Get functions XSECCryptoKey * OpenSSLCryptoX509::clonePublicKey() const { if (mp_X509 == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509 - clonePublicKey called before X509 loaded"); } EVP_PKEY *pkey; XSECCryptoKey * ret; pkey = X509_get_pubkey(mp_X509); if (pkey == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "OpenSSL:X509 - cannot retrieve public key from cert"); } switch (pkey->type) { case EVP_PKEY_DSA : ret = new OpenSSLCryptoKeyDSA(pkey); break; case EVP_PKEY_RSA : ret = new OpenSSLCryptoKeyRSA(pkey); break; #if defined(XSEC_OPENSSL_HAVE_EC) case EVP_PKEY_EC : ret = new OpenSSLCryptoKeyEC(pkey); break; #endif default : ret = NULL; } EVP_PKEY_free (pkey); return ret; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoBase64.cpp000644 001751 001751 00000011444 12003301053 024713 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoBase64 := Base virtual class to define a base64 encoder/decoder * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Decoding // -------------------------------------------------------------------------------- void OpenSSLCryptoBase64::decodeInit(void) { EVP_DecodeInit(&m_dctx); } unsigned int OpenSSLCryptoBase64::decode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) { int rc; int outLen; if (outLength < inLength) { throw XSECCryptoException(XSECCryptoException::MemoryError, "OpenSSL:Base64 - Output buffer not big enough for Base64 decode"); } rc = EVP_DecodeUpdate(&m_dctx, outData, &outLen, (unsigned char *) inData, inLength); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::Base64Error, "OpenSSL:Base64 - Error during Base64 Decode"); } if (outLen > (int) outLength) { throw XSECCryptoException(XSECCryptoException::MemoryError, "OpenSSL:Base64 - Output buffer not big enough for Base64 decode and overflowed"); } return outLen; } unsigned int OpenSSLCryptoBase64::decodeFinish(unsigned char * outData, unsigned int outLength) { int outLen; outLen = outLength; EVP_DecodeFinal(&m_dctx, outData, &outLen); return outLen; } // -------------------------------------------------------------------------------- // Encoding // -------------------------------------------------------------------------------- void OpenSSLCryptoBase64::encodeInit(void) { EVP_EncodeInit(&m_ectx); } unsigned int OpenSSLCryptoBase64::encode(const unsigned char * inData, unsigned int inLength, unsigned char * outData, unsigned int outLength) { int outLen; if (outLength + 24 < inLength) { throw XSECCryptoException(XSECCryptoException::MemoryError, "OpenSSL:Base64 - Output buffer not big enough for Base64 encode"); } EVP_EncodeUpdate(&m_ectx, outData, &outLen, (unsigned char *) inData, inLength); if (outLen > (int) outLength) { throw XSECCryptoException(XSECCryptoException::MemoryError, "OpenSSL:Base64 - Output buffer not big enough for Base64 encode and overflowed"); } return outLen; } unsigned int OpenSSLCryptoBase64::encodeFinish(unsigned char * outData, unsigned int outLength) { int outLen; outLen = outLength; EVP_EncodeFinal(&m_ectx, outData, &outLen); return outLen; } // -------------------------------------------------------------------------------- // Utility functions // -------------------------------------------------------------------------------- BIGNUM * OpenSSLCryptoBase64::b642BN(char * b64in, unsigned int len) { if (len > 1024) return NULL; int bufLen; unsigned char buf[1024]; /* EVP_ENCODE_CTX m_dctx; EVP_DecodeInit(&m_dctx); int rc = EVP_DecodeUpdate(&m_dctx, buf, &bufLen, (unsigned char *) b64in, len); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::Base64Error, "OpenSSL:Base64 - Error during Base64 Decode of BIGNUMS"); } int finalLen; EVP_DecodeFinal(&m_dctx, &buf[bufLen], &finalLen); bufLen += finalLen; */ XSCryptCryptoBase64 *b64; XSECnew(b64, XSCryptCryptoBase64); Janitor j_b64(b64); b64->decodeInit(); bufLen = b64->decode((unsigned char *) b64in, len, buf, len); bufLen += b64->decodeFinish(&buf[bufLen], len-bufLen); // Now translate to a bignum return BN_bin2bn(buf, bufLen, NULL); } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp000644 001751 001751 00000020504 12462320141 024754 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoKeyDSA := DSA Keys * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyDSA.cpp 1655515 2015-01-29 03:11:28Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include #include #include #include #include XSEC_USING_XERCES(ArrayJanitor); #include OpenSSLCryptoKeyDSA::OpenSSLCryptoKeyDSA() : mp_dsaKey(NULL) { }; OpenSSLCryptoKeyDSA::~OpenSSLCryptoKeyDSA() { // If we have a DSA, delete it // OpenSSL will ensure the memory holding any private key is freed. if (mp_dsaKey) DSA_free(mp_dsaKey); }; // Generic key functions XSECCryptoKey::KeyType OpenSSLCryptoKeyDSA::getKeyType() const { // Find out what we have if (mp_dsaKey == NULL) return KEY_NONE; if (mp_dsaKey->priv_key != NULL && mp_dsaKey->pub_key != NULL) return KEY_DSA_PAIR; if (mp_dsaKey->priv_key != NULL) return KEY_DSA_PRIVATE; if (mp_dsaKey->pub_key != NULL) return KEY_DSA_PUBLIC; return KEY_NONE; } void OpenSSLCryptoKeyDSA::loadPBase64BigNums(const char * b64, unsigned int len) { if (mp_dsaKey == NULL) mp_dsaKey = DSA_new(); mp_dsaKey->p = OpenSSLCryptoBase64::b642BN((char *) b64, len); } void OpenSSLCryptoKeyDSA::loadQBase64BigNums(const char * b64, unsigned int len) { if (mp_dsaKey == NULL) mp_dsaKey = DSA_new(); mp_dsaKey->q = OpenSSLCryptoBase64::b642BN((char *) b64, len); } void OpenSSLCryptoKeyDSA::loadGBase64BigNums(const char * b64, unsigned int len) { if (mp_dsaKey == NULL) mp_dsaKey = DSA_new(); mp_dsaKey->g = OpenSSLCryptoBase64::b642BN((char *) b64, len); } void OpenSSLCryptoKeyDSA::loadYBase64BigNums(const char * b64, unsigned int len) { if (mp_dsaKey == NULL) mp_dsaKey = DSA_new(); mp_dsaKey->pub_key = OpenSSLCryptoBase64::b642BN((char *) b64, len); } void OpenSSLCryptoKeyDSA::loadJBase64BigNums(const char * b64, unsigned int len) { if (mp_dsaKey == NULL) mp_dsaKey = DSA_new(); // Do nothing } // "Hidden" OpenSSL functions OpenSSLCryptoKeyDSA::OpenSSLCryptoKeyDSA(EVP_PKEY *k) { // Create a new key to be loaded as we go mp_dsaKey = DSA_new(); if (k == NULL || k->type != EVP_PKEY_DSA) return; // Nothing to do with us if (k->pkey.dsa->p) mp_dsaKey->p = BN_dup(k->pkey.dsa->p); if (k->pkey.dsa->q) mp_dsaKey->q = BN_dup(k->pkey.dsa->q); if (k->pkey.dsa->g) mp_dsaKey->g = BN_dup(k->pkey.dsa->g); if (k->pkey.dsa->pub_key) mp_dsaKey->pub_key = BN_dup(k->pkey.dsa->pub_key); if (k->pkey.dsa->priv_key) mp_dsaKey->priv_key = BN_dup(k->pkey.dsa->priv_key); } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool OpenSSLCryptoKeyDSA::verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) { // Use the currently loaded key to validate the Base64 encoded signature if (mp_dsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Attempt to validate signature with empty key"); } char* cleanedBase64Signature; unsigned int cleanedBase64SignatureLen = 0; cleanedBase64Signature = XSECCryptoBase64::cleanBuffer(base64Signature, sigLen, cleanedBase64SignatureLen); ArrayJanitor j_cleanedBase64Signature(cleanedBase64Signature); int sigValLen; unsigned char* sigVal = new unsigned char[sigLen + 1]; ArrayJanitor j_sigVal(sigVal); EVP_ENCODE_CTX m_dctx; EVP_DecodeInit(&m_dctx); int rc = EVP_DecodeUpdate(&m_dctx, sigVal, &sigValLen, (unsigned char *) cleanedBase64Signature, cleanedBase64SignatureLen); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error during Base64 Decode"); } int t = 0; EVP_DecodeFinal(&m_dctx, &sigVal[sigValLen], &t); sigValLen += t; // Translate to BNs and thence to DSA_SIG BIGNUM * R; BIGNUM * S; if (sigValLen == 40) { R = BN_bin2bn(sigVal, 20, NULL); S = BN_bin2bn(&sigVal[20], 20, NULL); } else { unsigned char rb[20]; unsigned char sb[20]; if (sigValLen == 46 && ASN2DSASig(sigVal, rb, sb) == true) { R = BN_bin2bn(rb, 20, NULL); S = BN_bin2bn(sb, 20, NULL); } else { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Signature Length incorrect"); } } DSA_SIG * dsa_sig = DSA_SIG_new(); dsa_sig->r = BN_dup(R); dsa_sig->s = BN_dup(S); BN_free(R); BN_free(S); // Now we have a signature and a key - lets check int err = DSA_do_verify(hashBuf, hashLen, dsa_sig, mp_dsaKey); DSA_SIG_free(dsa_sig); if (err < 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error validating signature"); } return (err == 1); } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyDSA::signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) { // Sign a pre-calculated hash using this key if (mp_dsaKey == NULL) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Attempt to sign data with empty key"); } DSA_SIG * dsa_sig; dsa_sig = DSA_do_sign(hashBuf, hashLen, mp_dsaKey); if (dsa_sig == NULL) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error signing data"); } // Now turn the signature into a base64 string unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s) + 7) / 8]; ArrayJanitor j_sigbuf(rawSigBuf); unsigned int rawLen = BN_bn2bin(dsa_sig->r, rawSigBuf); if (rawLen <= 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error converting signature to raw buffer"); } unsigned int rawLenS = BN_bn2bin(dsa_sig->s, (unsigned char *) &rawSigBuf[rawLen]); if (rawLenS <= 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error converting signature to raw buffer"); } rawLen += rawLenS; // Now convert to Base 64 BIO * b64 = BIO_new(BIO_f_base64()); BIO * bmem = BIO_new(BIO_s_mem()); BIO_set_mem_eof_return(bmem, 0); b64 = BIO_push(b64, bmem); // Translate signature from Base64 BIO_write(b64, rawSigBuf, rawLen); BIO_flush(b64); unsigned int sigValLen = BIO_read(bmem, base64SignatureBuf, base64SignatureBufLen); BIO_free_all(b64); if (sigValLen <= 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "OpenSSL:DSA - Error base64 encoding signature"); } return sigValLen; } XSECCryptoKey * OpenSSLCryptoKeyDSA::clone() const { OpenSSLCryptoKeyDSA * ret; XSECnew(ret, OpenSSLCryptoKeyDSA); ret->m_keyType = m_keyType; ret->mp_dsaKey = DSA_new(); // Duplicate parameters if (mp_dsaKey->p) ret->mp_dsaKey->p = BN_dup(mp_dsaKey->p); if (mp_dsaKey->q) ret->mp_dsaKey->q = BN_dup(mp_dsaKey->q); if (mp_dsaKey->g) ret->mp_dsaKey->g = BN_dup(mp_dsaKey->g); if (mp_dsaKey->pub_key) ret->mp_dsaKey->pub_key = BN_dup(mp_dsaKey->pub_key); if (mp_dsaKey->priv_key) ret->mp_dsaKey->priv_key = BN_dup(mp_dsaKey->priv_key); return ret; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp000644 001751 001751 00000021125 12464016414 024643 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * OpenSSLCryptoKeyEC := EC Keys * * Author(s): Scott Cantor * * $Id:$ * */ #include #if defined (XSEC_HAVE_OPENSSL) && defined (XSEC_OPENSSL_HAVE_EC) #include #include #include #include #include #include #include #include #include XSEC_USING_XERCES(Janitor); XSEC_USING_XERCES(ArrayJanitor); #include OpenSSLCryptoKeyEC::OpenSSLCryptoKeyEC() : mp_ecKey(NULL) { }; OpenSSLCryptoKeyEC::~OpenSSLCryptoKeyEC() { // If we have a EC_KEY, delete it // OpenSSL will ensure the memory holding any private key is freed. if (mp_ecKey) EC_KEY_free(mp_ecKey); }; // Generic key functions XSECCryptoKey::KeyType OpenSSLCryptoKeyEC::getKeyType() const { // Find out what we have if (mp_ecKey == NULL) return KEY_NONE; if (EC_KEY_get0_private_key(mp_ecKey) && EC_KEY_get0_public_key(mp_ecKey)) return KEY_EC_PAIR; if (EC_KEY_get0_private_key(mp_ecKey)) return KEY_EC_PRIVATE; if (EC_KEY_get0_public_key(mp_ecKey)) return KEY_EC_PUBLIC; return KEY_NONE; } void OpenSSLCryptoKeyEC::loadPublicKeyBase64(const char* curveName, const char * buf, unsigned int len) { if (mp_ecKey) { EC_KEY_free(mp_ecKey); mp_ecKey = NULL; } EC_KEY* key = EC_KEY_new_by_curve_name(static_cast(XSECPlatformUtils::g_cryptoProvider)->curveNameToNID(curveName)); int bufLen = len; unsigned char * outBuf; XSECnew(outBuf, unsigned char[len + 1]); ArrayJanitor j_outBuf(outBuf); XSCryptCryptoBase64 *b64; XSECnew(b64, XSCryptCryptoBase64); Janitor j_b64(b64); b64->decodeInit(); bufLen = b64->decode((unsigned char *) buf, len, outBuf, len); bufLen += b64->decodeFinish(&outBuf[bufLen], len-bufLen); if (bufLen > 0) { if (o2i_ECPublicKey(&key, (const unsigned char **) &outBuf, bufLen) == NULL) { EC_KEY_free(key); key = NULL; } } if (key == NULL) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error translating Base64 octets into OpenSSL EC_KEY structure"); } mp_ecKey = key; } // "Hidden" OpenSSL functions OpenSSLCryptoKeyEC::OpenSSLCryptoKeyEC(EVP_PKEY *k) { // Create a new key to be loaded as we go if (k == NULL || k->type != EVP_PKEY_EC) return; // Nothing to do with us mp_ecKey = EC_KEY_dup(k->pkey.ec); } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool OpenSSLCryptoKeyEC::verifyBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) { // Use the currently loaded key to validate the Base64 encoded signature if (mp_ecKey == NULL) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Attempt to validate signature with empty key"); } char * cleanedBase64Signature; unsigned int cleanedBase64SignatureLen = 0; cleanedBase64Signature = XSECCryptoBase64::cleanBuffer(base64Signature, sigLen, cleanedBase64SignatureLen); ArrayJanitor j_cleanedBase64Signature(cleanedBase64Signature); int sigValLen; unsigned char* sigVal = new unsigned char[sigLen + 1]; ArrayJanitor j_sigVal(sigVal); EVP_ENCODE_CTX m_dctx; EVP_DecodeInit(&m_dctx); int rc = EVP_DecodeUpdate(&m_dctx, sigVal, &sigValLen, (unsigned char *) cleanedBase64Signature, cleanedBase64SignatureLen); if (rc < 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error during Base64 Decode"); } int t = 0; EVP_DecodeFinal(&m_dctx, &sigVal[sigValLen], &t); sigValLen += t; if (sigValLen <= 0 || sigValLen % 2 != 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Signature length was odd"); } // Translate to BNs by splitting in half, and thence to ECDSA_SIG ECDSA_SIG * dsa_sig = ECDSA_SIG_new(); dsa_sig->r = BN_bin2bn(sigVal, sigValLen / 2, NULL); dsa_sig->s = BN_bin2bn(&sigVal[sigValLen / 2], sigValLen / 2, NULL); // Now we have a signature and a key - lets check int err = ECDSA_do_verify(hashBuf, hashLen, dsa_sig, mp_ecKey); ECDSA_SIG_free(dsa_sig); if (err < 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error validating signature"); } return (err == 1); } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int OpenSSLCryptoKeyEC::signBase64SignatureDSA(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) { // Sign a pre-calculated hash using this key if (mp_ecKey == NULL) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Attempt to sign data with empty key"); } ECDSA_SIG * dsa_sig; dsa_sig = ECDSA_do_sign(hashBuf, hashLen, mp_ecKey); if (dsa_sig == NULL) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error signing data"); } // To encode the signature properly, we need to know the "size of the // base point order of the curve in bytes", which seems to correspond to the // number of bits in the EC Group "order", using the OpenSSL API. // This is the size of the r and s values in the signature when converting them // to octet strings. The code below is cribbed from ECDSA_size. unsigned int keyLen = 0; const EC_GROUP* group = EC_KEY_get0_group(mp_ecKey); if (group) { BIGNUM* order = BN_new(); if (order) { if (EC_GROUP_get_order(group, order, NULL)) { keyLen = (BN_num_bits(order) + 7) / 8; // round up to byte size } BN_clear_free(order); } } if (keyLen == 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error caclulating signature size"); } // Now turn the signature into a raw octet string, half r and half s. unsigned char* rawSigBuf = new unsigned char[keyLen * 2]; memset(rawSigBuf, 0, keyLen * 2); ArrayJanitor j_sigbuf(rawSigBuf); unsigned int rawLen = (BN_num_bits(dsa_sig->r) + 7) / 8; if (BN_bn2bin(dsa_sig->r, rawSigBuf + keyLen - rawLen) <= 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error copying signature 'r' value to buffer"); } rawLen = (BN_num_bits(dsa_sig->s) + 7) / 8; if (BN_bn2bin(dsa_sig->s, rawSigBuf + keyLen + keyLen - rawLen) <= 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error copying signature 's' value to buffer"); } // Now convert to Base 64 BIO * b64 = BIO_new(BIO_f_base64()); BIO * bmem = BIO_new(BIO_s_mem()); BIO_set_mem_eof_return(bmem, 0); b64 = BIO_push(b64, bmem); BIO_write(b64, rawSigBuf, keyLen * 2); BIO_flush(b64); unsigned int sigValLen = BIO_read(bmem, base64SignatureBuf, base64SignatureBufLen); BIO_free_all(b64); if (sigValLen <= 0) { throw XSECCryptoException(XSECCryptoException::ECError, "OpenSSL:EC - Error base64 encoding signature"); } return sigValLen; } XSECCryptoKey * OpenSSLCryptoKeyEC::clone() const { OpenSSLCryptoKeyEC * ret; XSECnew(ret, OpenSSLCryptoKeyEC); ret->m_keyType = m_keyType; if (mp_ecKey) ret->mp_ecKey = EC_KEY_dup(mp_ecKey); return ret; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp000644 001751 001751 00000063141 12462320141 026325 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoSymmetricKey.cpp 1655510 2015-01-29 02:20:39Z scantor $ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE; #if defined (XSEC_HAVE_OPENSSL) #include #include // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- OpenSSLCryptoSymmetricKey::OpenSSLCryptoSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType type) : m_keyType(type), m_keyMode(MODE_NONE), m_keyBuf(""), m_tagBuf(""), m_keyLen(0), m_initialised(false) { EVP_CIPHER_CTX_init(&m_ctx); m_keyBuf.isSensitive(); } OpenSSLCryptoSymmetricKey::~OpenSSLCryptoSymmetricKey() { // Clean up the context EVP_CIPHER_CTX_cleanup(&m_ctx); } // -------------------------------------------------------------------------------- // Basic Key interface methods // -------------------------------------------------------------------------------- XSECCryptoSymmetricKey::SymmetricKeyType OpenSSLCryptoSymmetricKey::getSymmetricKeyType() const { return m_keyType; } const XMLCh * OpenSSLCryptoSymmetricKey::getProviderName() const { return DSIGConstants::s_unicodeStrPROVOpenSSL; } XSECCryptoKey * OpenSSLCryptoSymmetricKey::clone() const { OpenSSLCryptoSymmetricKey * ret; XSECnew(ret, OpenSSLCryptoSymmetricKey(m_keyType)); ret->m_keyMode = m_keyMode; ret->m_keyLen = m_keyLen; ret->m_keyBuf = m_keyBuf; return ret; } // -------------------------------------------------------------------------------- // Store the key value // -------------------------------------------------------------------------------- void OpenSSLCryptoSymmetricKey::setKey(const unsigned char * key, unsigned int keyLen) { m_keyBuf.sbMemcpyIn(key, keyLen); m_keyLen = keyLen; } // -------------------------------------------------------------------------------- // Decrypt // -------------------------------------------------------------------------------- int OpenSSLCryptoSymmetricKey::decryptCtxInit(const unsigned char* iv, const unsigned char* tag, unsigned taglen) { // Returns amount of IV data used (in bytes) // Sets m_initialised iff the key is OK and the IV is OK. // GCM modes will leave this unset until the second call with the iv if (m_initialised) return 0; if (m_keyLen == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Cannot initialise without mode"); } // Set up the context according to the required cipher type switch (m_keyType) { case (KEY_3DES_192) : // A 3DES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } /* Do not use "_ex" calls yet - as want backwards compatibility with 0.9.6 */ #if defined(XSEC_OPENSSL_CONST_BUFFERS) EVP_DecryptInit(&m_ctx, EVP_des_ede3_cbc(),m_keyBuf.rawBuffer(), iv); #else EVP_DecryptInit(&m_ctx, EVP_des_ede3_cbc(),(unsigned char *) m_keyBuf.rawBuffer(), (unsigned char *) iv); #endif m_ivSize = 8; } else if (m_keyMode == MODE_ECB) { #if defined(XSEC_OPENSSL_CONST_BUFFERS) EVP_DecryptInit(&m_ctx, EVP_des_ecb(), m_keyBuf.rawBuffer(), NULL); #else EVP_DecryptInit(&m_ctx, EVP_des_ecb(), (unsigned char *) m_keyBuf.rawBuffer(), NULL); #endif m_ivSize = 0; } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported DES3 cipher mode"); } m_blockSize = 8; break; #if defined (XSEC_OPENSSL_HAVE_AES) case (KEY_AES_128) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } EVP_DecryptInit_ex(&m_ctx, EVP_aes_128_cbc(), NULL, m_keyBuf.rawBuffer(), iv); } #if defined (XSEC_OPENSSL_HAVE_GCM) else if (m_keyMode == MODE_GCM) { if (tag != NULL && taglen != 16) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Invalid authentication tag"); } if (iv == NULL) { // Just save off tag for later. m_tagBuf.sbMemcpyIn(tag, taglen); return 0; } if (m_tagBuf.sbRawBufferSize() == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Authentication tag not set"); } // We have everything, so we can fully init. EVP_CipherInit(&m_ctx, EVP_aes_128_gcm(), NULL, NULL, 0); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer()); EVP_CipherInit(&m_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0); } #endif else if (m_keyMode == MODE_ECB) { EVP_DecryptInit_ex(&m_ctx, EVP_aes_128_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; case (KEY_AES_192) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } EVP_DecryptInit_ex(&m_ctx, EVP_aes_192_cbc(), NULL, m_keyBuf.rawBuffer(), iv); } #if defined (XSEC_OPENSSL_HAVE_GCM) else if (m_keyMode == MODE_GCM) { if (tag != NULL && taglen != 16) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Invalid authentication tag"); } if (iv == NULL) { // Just save off tag for later. m_tagBuf.sbMemcpyIn(tag, taglen); return 0; } if (m_tagBuf.sbRawBufferSize() == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Authentication tag not set"); } // We have everything, so we can fully init. EVP_CipherInit(&m_ctx, EVP_aes_192_gcm(), NULL, NULL, 0); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer()); EVP_CipherInit(&m_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0); } #endif else if (m_keyMode == MODE_ECB) { EVP_DecryptInit_ex(&m_ctx, EVP_aes_192_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; case (KEY_AES_256) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } EVP_DecryptInit_ex(&m_ctx, EVP_aes_256_cbc(), NULL, m_keyBuf.rawBuffer(), iv); } #if defined (XSEC_OPENSSL_HAVE_GCM) else if (m_keyMode == MODE_GCM) { if (tag != NULL && taglen != 16) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Invalid authentication tag"); } if (iv == NULL) { // Just save off tag for later. m_tagBuf.sbMemcpyIn(tag, taglen); return 0; } if (m_tagBuf.sbRawBufferSize() == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Authentication tag not set"); } // We have everything, so we can fully init. EVP_CipherInit(&m_ctx, EVP_aes_256_gcm(), NULL, NULL, 0); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL); EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer()); EVP_CipherInit(&m_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0); } #endif else if (m_keyMode == MODE_ECB) { EVP_DecryptInit_ex(&m_ctx, EVP_aes_256_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; #else case (KEY_AES_128) : case (KEY_AES_192) : case (KEY_AES_256) : throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm, "OpenSSL:SymmetricKey - AES not supported in this version of OpenSSL"); #endif /* XSEC_OPENSSL_HAVE_AES */ default : throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unknown key type"); } // Setup ivSize switch (m_keyMode) { case MODE_CBC: m_ivSize = m_blockSize; break; case MODE_GCM: m_ivSize = 12; break; default: m_ivSize = 0; } // Reset some parameters m_initialised = true; m_bytesInLastBlock = 0; // Disable OpenSSL padding - The interop samples have broken PKCS padding - AARGHH #if defined (XSEC_OPENSSL_CANSET_PADDING) EVP_CIPHER_CTX_set_padding(&m_ctx, 0); #endif // Return number of bytes chewed up by IV return m_ivSize; } bool OpenSSLCryptoSymmetricKey::decryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char* iv, const unsigned char* tag, unsigned int taglen) { m_doPad = doPad; m_keyMode = mode; m_initialised = false; decryptCtxInit(iv, tag, taglen); return true; } unsigned int OpenSSLCryptoSymmetricKey::decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength) { // NOTE: This won't actually stop OpenSSL blowing the buffer, so the onus is // on the caller. #if 0 /* normally commented out code to determine endian problems */ unsigned int i; unsigned char e[2048]; unsigned char * inBuf1 = (unsigned char *) inBuf; if (inLength < 2048) { memcpy(e, inBuf, inLength); for (i = 0; i < inLength;++i) { inBuf1[i] = e[inLength - 1 - i]; } } #endif // If cipher isn't initialized yet, we call back in with the ciphertext to supply the IV // For GCM, the tag has to have been supplied already or this will fail. unsigned int offset = 0; if (!m_initialised) { offset = decryptCtxInit(inBuf, NULL, 0); if (offset > inLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Not enough data passed in to get IV"); } } int outl = maxOutLength; if (inLength - offset + m_bytesInLastBlock > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::decrypt - Not enough space in output buffer"); } #if defined (XSEC_OPENSSL_CONST_BUFFERS) if (EVP_DecryptUpdate(&m_ctx, &plainBuf[m_bytesInLastBlock], &outl, &inBuf[offset], inLength - offset) == 0) { #else if (EVP_DecryptUpdate(&m_ctx, &plainBuf[m_bytesInLastBlock], &outl, (unsigned char *) &inBuf[offset], inLength - offset) == 0) { #endif throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error during OpenSSL decrypt"); } // Store the last block if we are padding if (m_doPad && m_blockSize > 0 && outl >= m_blockSize) { // Output will always be *at least* the blocksize // Copy the previous last block into the start of the output buffer memcpy(plainBuf, m_lastBlock, m_bytesInLastBlock); // Copy the tail into the buffer memcpy(m_lastBlock, &plainBuf[outl + m_bytesInLastBlock - m_blockSize], m_blockSize); outl = outl + m_bytesInLastBlock - m_blockSize; m_bytesInLastBlock = m_blockSize; } return outl; } unsigned int OpenSSLCryptoSymmetricKey::decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength) { int outl = maxOutLength; m_initialised = false; #if defined (XSEC_OPENSSL_CANSET_PADDING) if (EVP_DecryptFinal(&m_ctx, plainBuf, &outl) == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error during OpenSSL decrypt finalisation"); } if (outl > 0) { // Should never see any bytes output, as we are not padding throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unexpectedly received bytes from EVP_DecryptFinal_ex"); } // Calculate any padding issues if (m_doPad && m_bytesInLastBlock == m_blockSize) { outl = m_blockSize - m_lastBlock[m_blockSize - 1]; if (outl > m_blockSize || outl < 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey::decryptFinish - Out of range padding value in final block"); } memcpy(plainBuf, m_lastBlock, outl); } if ((unsigned int) outl > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::decryptFinish - **WARNING** - Plaintext output > maxOutLength!"); } return outl; #else /* Working with a version of OpenSSL that *always* performs padding so we need to work around it */ unsigned char *scrPlainBuf; unsigned char *cipherBuf; scrPlainBuf = new unsigned char[3 * m_blockSize]; ArrayJanitor j_scrPlainBuf(scrPlainBuf); cipherBuf = new unsigned char[m_blockSize]; ArrayJanitor j_cipherBuf(cipherBuf); /* Zeroise the cipher buffer */ memset(cipherBuf, 0, m_blockSize); unsigned int offset = 0; /* Get any previous bytes from the m_lastBlock */ if (m_bytesInLastBlock > 0 && m_bytesInLastBlock <= m_blockSize) { memcpy(scrPlainBuf, m_lastBlock, m_bytesInLastBlock); offset = m_bytesInLastBlock; } outl = m_blockSize; /* This is really ugly - but we have to trick OpenSSL into thinking there is more, so that it sends us the lasts block with the padding in it. We can then clean that up ourselves */ if (EVP_DecryptUpdate(&m_ctx, &scrPlainBuf[offset], &outl, cipherBuf, m_blockSize) == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error cecrypting final block during OpenSSL"); } outl += offset; if (m_doPad && outl > 0) { /* Strip any padding */ outl -= scrPlainBuf[outl - 1]; if (outl > (2 * m_blockSize) || outl < 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey::decryptFinish - Out of range padding value in final block"); } } if (outl > (int) maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::decryptFinish - **WARNING** - Plaintext output > maxOutLength!"); } if (outl > 0) { memcpy(plainBuf, scrPlainBuf, outl); } return outl; #endif } // -------------------------------------------------------------------------------- // Encrypt // -------------------------------------------------------------------------------- bool OpenSSLCryptoSymmetricKey::encryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char * iv) { if (m_initialised == true) return true; m_doPad = doPad; m_keyMode = mode; if (m_keyLen == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Cannot initialise without mode"); } // Do some parameter initialisation m_initialised = true; m_bytesInLastBlock = 0; // Set up the context according to the required cipher type const unsigned char * usedIV = NULL; unsigned char genIV[256]; // Tell the library that the IV still has to be sent m_ivSent = false; switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : // A 3DES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 8) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else { usedIV = iv; } #if defined (XSEC_OPENSSL_CONST_BUFFERS) EVP_EncryptInit(&m_ctx, EVP_des_ede3_cbc(), m_keyBuf.rawBuffer(), usedIV); #else EVP_EncryptInit(&m_ctx, EVP_des_ede3_cbc(), (unsigned char *) m_keyBuf.rawBuffer(), (unsigned char *) usedIV); #endif } else if (m_keyMode == MODE_ECB) { #if defined (XSEC_OPENSSL_CONST_BUFFERS) EVP_EncryptInit(&m_ctx, EVP_des_ede3_ecb(), m_keyBuf.rawBuffer(), NULL); #else EVP_EncryptInit(&m_ctx, EVP_des_ede3(), (unsigned char *) m_keyBuf.rawBuffer(), NULL); #endif } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported DES3 cipher mode"); } m_blockSize = 8; break; #if defined (XSEC_OPENSSL_HAVE_AES) case (XSECCryptoSymmetricKey::KEY_AES_128) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 16) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_128_cbc(), NULL, m_keyBuf.rawBuffer(), usedIV); } else if (m_keyMode == MODE_ECB) { EVP_EncryptInit_ex(&m_ctx, EVP_aes_128_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } #ifdef XSEC_OPENSSL_HAVE_GCM else if (m_keyMode == MODE_GCM) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 12) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_128_gcm(), NULL, m_keyBuf.rawBuffer(), usedIV); } #endif else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; case (XSECCryptoSymmetricKey::KEY_AES_192) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 16) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_192_cbc(), NULL, m_keyBuf.rawBuffer(), usedIV); } #ifdef XSEC_OPENSSL_HAVE_GCM else if (m_keyMode == MODE_GCM) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 12) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_192_gcm(), NULL, m_keyBuf.rawBuffer(), usedIV); } #endif else if (m_keyMode == MODE_ECB) { EVP_EncryptInit_ex(&m_ctx, EVP_aes_192_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; case (XSECCryptoSymmetricKey::KEY_AES_256) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 16) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_256_cbc(), NULL, m_keyBuf.rawBuffer(), usedIV); } #ifdef XSEC_OPENSSL_HAVE_GCM else if (m_keyMode == MODE_GCM) { if (iv == NULL) { bool res = ((RAND_status() == 1) && (RAND_bytes(genIV, 12) == 1)); if (res == false) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; EVP_EncryptInit_ex(&m_ctx, EVP_aes_256_gcm(), NULL, m_keyBuf.rawBuffer(), usedIV); } #endif else if (m_keyMode == MODE_ECB) { EVP_EncryptInit_ex(&m_ctx, EVP_aes_256_ecb(), NULL, m_keyBuf.rawBuffer(), NULL); } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unsupported AES cipher mode"); } m_blockSize = 16; break; #else case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm, "OpenSSL:SymmetricKey - AES not supported in this version of OpenSSL"); #endif /* XSEC_OPENSSL_HAVE_AES */ default : throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Unknown key type"); } // Clear up any read padding if (m_keyMode == MODE_CBC) { m_ivSize = m_blockSize; memcpy(m_lastBlock, usedIV, m_ivSize); } else if (m_keyMode == MODE_GCM) { m_ivSize = 12; memcpy(m_lastBlock, usedIV, m_ivSize); } else { m_ivSize = 0; } #if defined (XSEC_OPENSSL_CANSET_PADDING) // Setup padding if (m_doPad) { EVP_CIPHER_CTX_set_padding(&m_ctx, 1); } else { EVP_CIPHER_CTX_set_padding(&m_ctx, 0); } #endif return true; } unsigned int OpenSSLCryptoSymmetricKey::encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength) { if (m_initialised == false) { encryptInit(); } // NOTE: This won't actually stop OpenSSL blowing the buffer, so the onus is // on the caller. unsigned int offset = 0; if (m_ivSent == false && m_ivSize > 0) { memcpy(cipherBuf, m_lastBlock, m_ivSize); m_ivSent = true; offset = m_ivSize; } int outl = maxOutLength - offset; if (inLength + offset > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Not enough space in output buffer for encrypt"); } #if defined (XSEC_OPENSSL_CONST_BUFFERS) if (EVP_EncryptUpdate(&m_ctx, &cipherBuf[offset], &outl, inBuf, inLength) == 0) { #else if (EVP_EncryptUpdate(&m_ctx, &cipherBuf[offset], &outl, (unsigned char *) inBuf, inLength) == 0) { #endif throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSL:SymmetricKey - Error during OpenSSL encrypt"); } return outl + offset; } unsigned int OpenSSLCryptoSymmetricKey::encryptFinish(unsigned char * cipherBuf, unsigned int maxOutLength, unsigned int taglen) { int outl = maxOutLength; m_initialised = false; if (EVP_EncryptFinal(&m_ctx, cipherBuf, &outl) == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - Error during OpenSSL decrypt finalisation"); } if ((unsigned int) outl > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - **WARNING** - Cipheroutput > maxOutLength!"); } #if !defined (XSEC_OPENSSL_CANSET_PADDING) if (!m_doPad) { if (outl < m_blockSize) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - cannot remove padding!"); } outl -= m_blockSize; } #endif if (taglen > 0) { // Extract authentication tag and add to ciphertext. if (maxOutLength - outl < taglen) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - **WARNING** - no room in ciphertext buffer for authentication tag"); } if (m_keyMode == MODE_GCM) { #ifdef XSEC_OPENSSL_HAVE_GCM EVP_CIPHER_CTX_ctrl(&m_ctx, EVP_CTRL_GCM_GET_TAG, taglen, cipherBuf + outl); outl += taglen; #else throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - AES-GCM not supported in this version of OpenSSL"); #endif } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "OpenSSLSymmetricKey::encryptFinish - cipher mode does not support authentication tag"); } } return outl; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp000644 001751 001751 00000003343 12003301053 025047 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoKeyHMAC := Raw HMAC buffers * * Author(s): Berin Lautenbach * * $Id: OpenSSLCryptoKeyHMAC.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #if defined (XSEC_HAVE_OPENSSL) #include #include OpenSSLCryptoKeyHMAC::OpenSSLCryptoKeyHMAC() :m_keyBuf("") { m_keyBuf.isSensitive(); m_keyLen = 0; }; void OpenSSLCryptoKeyHMAC::setKey(unsigned char * inBuf, unsigned int inLength) { m_keyBuf.sbMemcpyIn(inBuf, inLength); m_keyBuf.isSensitive(); m_keyLen = inLength; } unsigned int OpenSSLCryptoKeyHMAC::getKey(safeBuffer &outBuf) const { outBuf = m_keyBuf; return m_keyLen; } XSECCryptoKey * OpenSSLCryptoKeyHMAC::clone() const { OpenSSLCryptoKeyHMAC * ret; XSECnew(ret, OpenSSLCryptoKeyHMAC()); ret->m_keyBuf = m_keyBuf; ret->m_keyLen = m_keyLen; return ret; } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoX509.hpp000644 001751 001751 00000006500 12003301053 022676 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoX509:= NSS based class for handling X509 (V3) certificates * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOX509_INCLUDE #define NSSCRYPTOX509_INCLUDE #include #include #if defined (XSEC_HAVE_NSS) #include class NSSCryptoProvider; /** * \brief NSS implementation class for interface for X509 certificates. * @ingroup nsscrypto * * The library uses classes derived from this to process X509 Certificates. * */ class DSIG_EXPORT NSSCryptoX509 : public XSECCryptoX509 { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor for X509 objects * * Empty ctor, used when loading X509 from KeyInfo * */ NSSCryptoX509(); /** * \brief Constructor for X509 objects * * This ctor is used when we wish to get cert as Base64 * * @param pCert pointer to NSS certificate structure * */ NSSCryptoX509(CERTCertificate * pCert); virtual ~NSSCryptoX509(); //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of the key stored in the certificate. * * Will extract the key from the certificate to return the appropriate * type * */ virtual XSECCryptoKey::KeyType getPublicKeyType() const; /** * \brief Get a copy of the public key. * * Extracts the public key from the certificate and returns the appropriate * NSSCryrptoKey (DSA or RSA) object * */ virtual XSECCryptoKey * clonePublicKey() const; /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const; //@} /** @name Load and Get the certificate */ //@{ /** * \brief Load a certificate into the object. * * Take a base64 DER encoded certificate and load. * * @param buf A buffer containing the Base64 encoded certificate * @param len The number of bytes of data in the certificate. */ virtual void loadX509Base64Bin(const char * buf, unsigned int len); /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual safeBuffer &getDEREncodingSB(void) {return m_DERX509;} /** * \brief Get a Base64 DER encoded copy of the certificate * * @returns A safeBuffer containing the DER encoded certificate */ virtual const safeBuffer &getDEREncodingSB(void) const {return m_DERX509;} //@} private: safeBuffer m_DERX509; CERTCertificate * mp_cert; }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOX509_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoHashHMAC.hpp000644 001751 001751 00000007540 12003301053 023552 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoHashHMAC := NSS Implementation of HMAC * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOHASHHMAC_INCLUDE #define NSSCRYPTOHASHHMAC_INCLUDE #include #include #if defined (XSEC_HAVE_NSS) #include #include /** * @ingroup nsscrypto * @{ */ /** * \brief Implementation of HMAC Hash functions in the NSS provider * * Uses the NSS functions to implement an HMAC. * */ class DSIG_EXPORT NSSCryptoHashHMAC : public XSECCryptoHash { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Create the object, with the indicated algorithm * (Currently supports MD5 and SHA1) * * @param alg Digest algorithm to use */ NSSCryptoHashHMAC(XSECCryptoHash::HashType alg); virtual ~NSSCryptoHashHMAC(); //@} /** @name HMAC Functions */ //@{ /** *\brief Set the HMAC key * * Sets the key - which needs to have a base class of * NSSCryptoKeyHMAC. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key); //@} /** @name Hash functions */ //@{ /** * \brief Reset the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes). This is effectively the * signature for the data that has been run through the HMAC function. * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength); //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; //@} private: // Not implemented constructors NSSCryptoHashHMAC(); unsigned char m_mdValue[XSEC_MAX_HASH_SIZE]; // Final output unsigned int m_mdLen; HashType m_hashType; PK11Context * mp_md; unsigned char m_ipadKeyed[XSEC_MAX_HASH_SIZE]; unsigned char m_opadKeyed[XSEC_MAX_HASH_SIZE]; unsigned int m_blockSize; // Block size (bytes) for used alg. safeBuffer m_keyBuf; // The loaded key unsigned int m_keyLen; // The loaded key length }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOHASHHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyDSA.hpp000644 001751 001751 00000014211 12003301053 023307 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyDSA := DSA Keys * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOKEYDSA_INCLUDE #define NSSCRYPTOKEYDSA_INCLUDE #include #if defined (XSEC_HAVE_NSS) #include #include #include class NSSCryptoProvider; /** * \ingroup nsscrypto * @{ */ /** * \brief NSS implementation class for DSA keys. * * The library uses classes derived from this to process DSA keys. */ class DSIG_EXPORT NSSCryptoKeyDSA : public XSECCryptoKeyDSA { public : /** @name Constructors and Destructors */ //@{ /** * \brief Ctor for DSA keys * * You can set either public, private or both keys * * @param pubkey A handle to the public key (optional) * @param privkey A handle to the private key (optional) */ NSSCryptoKeyDSA(SECKEYPublicKey * pubkey = NULL, SECKEYPrivateKey * privkey = NULL); virtual ~NSSCryptoKeyDSA(); //@} /** @name Required Key Interface methods */ //@{ /** * \brief Return the type of this key. * * Allows the caller (and library) to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** *\brief Return the NSS string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVNSS;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Required DSA methods */ //@{ /** * \brief Create a signature * * Sign the buffer using the internal private key. Will throw a DSAError * if the key is not set, or is not a private key. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer */ virtual unsigned int signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen); /** * \brief Verify a signature * * The library will call this function to validate a signature * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @returns true if the signature was valid, false otherwise */ virtual bool verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen); //@} /** @name Optional Interface methods * * Have been fully implemented in the NSS interface to allow interop * testing to occur. * */ //@{ /** * \brief Load P * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadPBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Q * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadQBase64BigNums(const char * b64, unsigned int len); /** * \brief Load G * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadGBase64BigNums(const char * b64, unsigned int len); /** * \brief Load Y * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadYBase64BigNums(const char * b64, unsigned int len); /** * \brief Load J * * @param b64 Base64 encoded parameter - read from XML document * @param len Length of the encoded string */ virtual void loadJBase64BigNums(const char * b64, unsigned int len); //@} /** @name NSS Specific functions */ //@{ /** * \brief Retrieve P * * @param b64 Buffer to place ds:CryptoBinary encoded P parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getPBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve Q * * @param b64 Buffer to place ds:CryptoBinary encoded Q parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getQBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve G * * @param b64 Buffer to place ds:CryptoBinary encoded G parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getGBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve Y * * @param b64 Buffer to place ds:CryptoBinary encoded Y parameter in * @param len Max amount of data to be placed in buffer * @returns The number of bytes placed in the buffer */ unsigned int getYBase64BigNums(char * b64, unsigned int len); //@} private: SECKEYPublicKey * mp_pubkey; SECKEYPrivateKey * mp_privkey; SECItem * mp_P; SECItem * mp_Q; SECItem * mp_G; SECItem * mp_Y; // Instruct to import from parameters void importKey(void); void loadParamsFromKey(void); }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOKEYDSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyHMAC.hpp000644 001751 001751 00000005331 12003301053 023413 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyHMAC := HMAC Keys * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOKEYHMAC_INCLUDE #define NSSCRYPTOKEYHMAC_INCLUDE #include #if defined (XSEC_HAVE_NSS) #include #include /** * \ingroup nsscrypto * @{ */ /** * \brief NSS implementation for HMAC keys. * */ class DSIG_EXPORT NSSCryptoKeyHMAC : public XSECCryptoKeyHMAC { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * */ NSSCryptoKeyHMAC(); virtual ~NSSCryptoKeyHMAC() {}; //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For DSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const {return KEY_HMAC;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; /** * \brief Return the NSS string identifier */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVNSS;} //@} /** @name Optional Interface methods */ //@{ /** * \brief Set the key * * Set the key from the buffer * * @param inBuf Buffer containing the direct bitwise representation of the key * @param inLength Number of bytes of key in the buffer * * @note isSensitive() should have been called on the inbound buffer * to ensure the contents is overwritten when the safeBuffer is deleted */ virtual void setKey(unsigned char * inBuf, unsigned int inLength); /** * \brief Get the key value * * Copy the key into the safeBuffer and return the number of bytes * copied. * * @param outBuf Buffer to copy key into * @returns number of bytes copied in */ virtual unsigned int getKey(safeBuffer &outBuf) const; //@} private: safeBuffer m_keyBuf; unsigned int m_keyLen; }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOKEYHMAC_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoHash.hpp000644 001751 001751 00000006751 12003301053 023124 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoHash := NSS Implementation of Message digests * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOHASH_INCLUDE #define NSSCRYPTOHASH_INCLUDE #include #include #if defined (XSEC_HAVE_NSS) #include #include /** * @ingroup nsscrypto * @{ */ /** * \brief NSS Implementation of Hash functions. * * Uses the NSS functions to perform digest functions. * */ class DSIG_EXPORT NSSCryptoHash : public XSECCryptoHash { public : /** @name Constructors/Destructors */ //@{ /** * \brief Construct a Hash object * * Creates a NSS based hash object of the required type. * * @param alg The algorithm to use for digest operations */ NSSCryptoHash(XSECCryptoHash::HashType alg); virtual ~NSSCryptoHash(); //@} /** @name HMAC Functions */ //@{ /** *\brief * * Does nothing. If the required function is an HMAC function, * then NSSCryptoHashHMAC should be used. * * @param key The key the HMAC function should use. */ virtual void setKey(XSECCryptoKey * key) {} //@} /** @name Digest/Hash functions */ //@{ /** * \brief Reset the hash function * * Re-initialises the digest structure. */ virtual void reset(void); /** * \brief Hash some data. * * Take length bytes of data from the data buffer and update the hash * that already exists. This function may (and normally will) be called * many times for large blocks of data. * * @param data The buffer containing the data to be hashed. * @param length The number of bytes to be read from data */ virtual void hash(unsigned char * data, unsigned int length); /** * \brief Finish up a Digest operation and read the result. * * This call tells the CryptoHash object that the input is complete and * to finalise the Digest. The output of the digest is read into the * hash buffer (at most maxLength bytes) * * @param hash The buffer the hash should be read into. * @param maxLength The maximum number of bytes to be read into hash * @returns The number of bytes copied into the hash buffer */ virtual unsigned int finish(unsigned char * hash, unsigned int maxLength);// Finish and get hash //@} /** @name Information functions */ //@{ /** *\brief * * Determine the hash type of this object * * @returns The hash type */ virtual HashType getHashType(void) const; //@} private: // Not implemented constructors NSSCryptoHash(); unsigned char m_mdValue[XSEC_MAX_HASH_SIZE]; // Final output unsigned int m_mdLen; HashType m_hashType; PK11Context * mp_md; }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOHASHSHA1_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoSymmetricKey.hpp000644 001751 001751 00000022230 12003301053 024654 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOSYMMETRICKEY_INCLUDE #define NSSCRYPTOSYMMETRICKEY_INCLUDE #include #include #if defined (XSEC_HAVE_NSS) #include #include #define NSS_MAX_BLOCK_SIZE 32 /** * \ingroup nsscrypto * @{ */ /** * \brief Base interface definition for symmetric key material. * * This is the implementation for a wrapper of NSS symmetric * crypto functions. */ class DSIG_EXPORT NSSCryptoSymmetricKey : public XSECCryptoSymmetricKey { public : /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * Can only construct a Symmetric key if we know what type it is * * @param type The type of key (i.e. algorithm) to create **/ NSSCryptoSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType type); /** * \brief Destructor * * Implementations must ensure that the held key is properly destroyed * (overwritten) when key objects are deleted. */ virtual ~NSSCryptoSymmetricKey(); //@} /** @name Basic CryptoKey Interface methods */ //@{ /** * \brief Returns a string that identifies the crypto owner of this library. */ virtual const XMLCh * getProviderName() const; /** * \brief Clone the key * * All keys need to be able to copy themselves and return * a pointer to the copy. This allows the library to * duplicate keys. */ virtual XSECCryptoKey * clone() const; //@} /** @name Symmetric key interface methods */ //@{ /** * \brief What type of symmetric key is this? * * There are a number of different types of symmetric key. * This method allows callers to determine the type of this * particular key */ SymmetricKeyType getSymmetricKeyType(void) const; /** * \brief Set the key from the provided bytes * * Symmetric keys can all be loaded from a buffer containing a series * of bytes. * * @param key The buffer containing the key bytes * @param keyLen The number of key bytes in the buffer * */ void setKey(const unsigned char * key, unsigned int keyLen); /** * \brief Initialise an decryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations should assume that the start of the * cipher text stream will in fact be the IV. * * @param doPad By default, we perform padding for last block * @param mode mode selection (Currently ECB or CBC mode only) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV will be set from data stream * @param tag Authentication tag to be used for AEAD ciphers * @param taglen length of Authentication Tag * @returns true if the initialisation succeeded. */ virtual bool decryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL, const unsigned char* tag = NULL, unsigned int taglen = NULL); /** * \brief Continue an decrypt operation using this key. * * Decryption must have been set up using an encryptInit * call. Takes the inBuf and continues a decryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be decrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * cipher-text to be handles during the next operation. * * @note While maxOutLength is defined, the NSS libraries will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param inBuf Octets to be decrypted * @param plainBuf Buffer to place output in * @param inLength Number of bytes to decrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a decryption operation * * Complete a decryption process. No cipher text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer. * * May throw an exception if there is some stored cipher text * that is not the length of the block size for block algorithms. * * @note While maxOutLength is defined, the NSS libraries will * not read the value, so the onus is on the caller to ensure the * buffer is long enough to hold the output! * * @param plainBuf Buffer to place any remaining plain text in * @param maxOutLength Maximum number of bytes to pace in output * @returns Bytes placed in output buffer */ virtual unsigned int decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength); /** * \brief Initialise an encryption process * * Setup the key to get ready for a decryption session. * Callers can pass in an IV. If one is not provided, * but the algorithm requires one (e.g. 3DES_CBC), then * implementations are required to generate one. * * @param doPad By default, we perform padding for last block * @param mode What mode to handle blocks (Currently CBC or ECB) * @param iv Initialisation Vector to be used. NULL if one is * not required, or if IV is to be generated * @returns true if the initialisation succeeded. */ virtual bool encryptInit(bool doPad = true, SymmetricKeyMode mode = MODE_CBC, const unsigned char * iv = NULL); /** * \brief Continue an encryption operation using this key. * * Encryption must have been set up using an encryptInit * call. Takes the inBuf and continues a encryption operation, * writing the output to outBuf. * * This function does not have to guarantee that all input * will be encrypted. In cases where the input is not a length * of the block size, the implementation will need to hold back * plain-text to be handled during the next operation. * * @param inBuf Octets to be encrypted * @param cipherBuf Buffer to place output in * @param inLength Number of bytes to encrypt * @param maxOutLength Maximum number of bytes to place in output * buffer * @returns Bytes placed in output Buffer */ virtual unsigned int encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength); /** * \brief Finish a encryption operation * * Complete a encryption process. No plain text is passed in, * as this should simply be removing any remaining text from * the plain storage buffer and creating a final padded block. * * Padding is performed by taking the remaining block, and * setting the last byte to equal the number of bytes of * padding. If the plain was an exact multiple of the block size, * then an extra block of padding will be used. For example, if * the block size is 8 bytes, and there were three remaining plain * text bytes (0x01, 0x02 and 0x03), the final block will be : * * 0x010203????????05 * * @param cipherBuf Buffer to place final block of cipher text in * @param maxOutLength Maximum number of bytes to pace in output * @param taglen length of Authentication Tag * @returns Bytes placed in output buffer */ virtual unsigned int encryptFinish(unsigned char * plainBuf, unsigned int maxOutLength, unsigned int taglen = 0); //@} private: // Unimplemented constructors NSSCryptoSymmetricKey(); NSSCryptoSymmetricKey(const NSSCryptoSymmetricKey &); NSSCryptoSymmetricKey & operator= (const NSSCryptoSymmetricKey &); int decryptCtxInit(const unsigned char * iv); SymmetricKeyType m_keyType; SymmetricKeyMode m_keyMode; // ECB or CBC bool m_initialised; bool m_doPad; //Does we need it? Yes we do - key wraps are unpadded for 3DES unsigned char m_lastBlock[NSS_MAX_BLOCK_SIZE]; unsigned int m_blockSize; bool m_ivSent; // Has the IV been put in the stream unsigned int m_ivSize; PK11Context * mp_ctx; PK11SymKey * mp_k; }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOSYMMETRICKEY_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoProvider.hpp000644 001751 001751 00000017734 12003301053 024036 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoProvider := Base class to handle NSS * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOPROVIDER_INCLUDE #define NSSCRYPTOPROVIDER_INCLUDE #include #include #if defined (XSEC_HAVE_NSS) #include #include /** * @defgroup nsscrypto NSS Interface * @ingroup nsscrypto * The NSS crypto provides an experimental inerface to the NSS API. */ /*\@{*/ class DSIG_EXPORT NSSCryptoProvider : public XSECCryptoProvider { public : /** @name Constructors and Destructors */ //@{ /** * \brief Create a NSS interface layer * * @param dbDir Directory where NSS key database is stored. * Will initialise NSS without DB support if nothing passed in. * If you are writing Mozilla/Firefox plugin, you shouldn't * use this ctor, because Mozilla/Firefox init NSS. Use empty * ctor instead. */ NSSCryptoProvider(const char * dbDir); /** * \brief Create a NSS interface layer * * Will not initialise NSS library, user should do that */ NSSCryptoProvider(); virtual ~NSSCryptoProvider(); //@} /** @name Hashing (Digest) Functions */ //@{ /** * \brief Return a SHA1 implementation. * * Call used by the library to obtain a SHA1 object from the * provider. * * @returns A pointer to an NSS Hash object that implements SHA1 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashSHA1() const; /** * \brief Return a SHA1 implementation. * * Call used by the library to obtain a SHA1 object from the * provider. * * @returns A pointer to an NSS Hash object that implements SHA1 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashSHA(int length = 160) const; /** * \brief Return a HMAC SHA1 implementation. * * Call used by the library to obtain a HMAC SHA1 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using NSSCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashHMACSHA1() const; /** * \brief Return a HMAC SHA1 implementation. * * Call used by the library to obtain a HMAC SHA1 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using NSSCryptoHash::setKey() * * @returns A pointer to a Hash object that implements HMAC-SHA1 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashHMACSHA(int length = 160) const; /** * \brief Return a MD5 implementation. * * Call used by the library to obtain a MD5 object from the * NSS provider. * * @returns A pointer to a Hash object that implements MD5 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashMD5() const; /** * \brief Return a HMAC MD5 implementation. * * Call used by the library to obtain a HMAC MD5 object from the * provider. The caller will need to set the key in the hash * object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey() * * @note The use of MD5 is explicitly marked as not recommended * in the XML Digital Signature standard due to recent advances in * cryptography indicating there may be weaknesses in the * algorithm. * * @returns A pointer to a Hash object that implements HMAC-MD5 * @see NSSCryptoHash */ virtual XSECCryptoHash * hashHMACMD5() const; /** * \brief Return a HMAC key * * Sometimes the library needs to create an HMAC key (notably within * the XKMS utilities). * * This function allows the library to obtain a key that can then have * a value set within it. */ virtual XSECCryptoKeyHMAC * keyHMAC(void) const; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * digest algorithm is supported */ virtual bool algorithmSupported(XSECCryptoHash::HashType alg) const; //@} /** @name Encoding functions */ //@{ /** * \brief Return a Base64 encoder/decoder implementation. * * Call used by the library to obtain a Base64 * encoder/decoder. * * @note NSS do implement Base64, but internal * implementation (XSCrypt) is used instead. * * @returns Pointer to the new Base64 encoder. * @see XSCryptCryptoBase64 */ virtual XSECCryptoBase64 * base64() const; //@} /** @name Keys and Certificates */ //@{ /** * \brief Return a DSA key implementation object. * * Call used by the library to obtain a DSA key object. * * @returns Pointer to the new DSA key * @see NSSCryptoKeyDSA */ virtual XSECCryptoKeyDSA * keyDSA() const; /** * \brief Return an RSA key implementation object. * * Call used by the library to obtain an NSS RSA key object. * * @returns Pointer to the new RSA key * @see NSSCryptoKeyRSA */ virtual XSECCryptoKeyRSA * keyRSA() const; /** * \brief Return an X509 implementation object. * * Call used by the library to obtain an object that can work * with X509 certificates. * * @returns Pointer to the new X509 object * @see NSSCryptoX509 */ virtual XSECCryptoX509 * X509() const; /** * \brief Determine whether a given algorithm is supported * * A call that can be used to determine whether a given * symmetric algorithm is supported */ virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Return a Symmetric Key implementation object. * * Call used by the library to obtain a bulk encryption * object. * * @returns Pointer to the new SymmetricKey object * @see XSECCryptoSymmetricKey */ virtual XSECCryptoSymmetricKey * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) const; /** * \brief Obtain some random octets * * For generation of IVs and the like, the library needs to be able * to obtain "random" octets. The library uses this call to the * crypto provider to obtain what it needs. * * @param buffer The buffer to place the random data in * @param numOctets Number of bytes required * @returns Number of bytes obtained. */ virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets) const; /** * \brief Translate B64 I2OS integer to a NSS SECItem. * * Decodes a Base64 (ds:CryptoBinary) integer into SECItem. * * @param b64 Base 64 string * @param b64Len Length of base64 string * @param retLen Parameter to hold length of return integer */ static SECItem * b642SI(const char * b64, unsigned int b64Len); /** * \brief Translate a SECItem to a B64 I2OS integer . * * Encodes a SECItem in I2OSP base64 encoded format. * * @param n Buffer holding the SECItem * @param nLen Length of data in buffer * @param retLen Parameter to hold length of return integer * @returns A pointer to a buffer holding the encoded data * (transfers ownership) */ static unsigned char * SI2b64(SECItem * n, unsigned int &retLen); //@} /** @name Information Functions */ //@{ /** * \brief Returns a string that identifies the Crypto Provider */ virtual const XMLCh * getProviderName() const; //@} private: void Init(const char * dbDir); static int m_initialised; }; /*\@}*/ #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOPROVIDER_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyRSA.hpp000644 001751 001751 00000021727 12003301053 023337 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyRSA := NSS implementation of RSA Keys * * Author(s): Milan Tomic * */ #ifndef NSSCRYPTOKEYRSA_INCLUDE #define NSSCRYPTOKEYRSA_INCLUDE #include #if defined (XSEC_HAVE_NSS) #include #include #include class NSSCryptoProvider; /** * \ingroup nsscrypto * @{ */ /** * \brief NSS implementation of the interface class for RSA keys. * * The library uses classes derived from this to process RSA keys. */ class DSIG_EXPORT NSSCryptoKeyRSA : public XSECCryptoKeyRSA { public : /** @name Constructors and Destructors */ //@{ /** * \brief Create an RSA key * * @param pubkey A handle to the public key (optional) * @param privkey A handle to the private key (optional) */ NSSCryptoKeyRSA(SECKEYPublicKey * pubkey = NULL, SECKEYPrivateKey * privkey = NULL); virtual ~NSSCryptoKeyRSA(); //@} /** @name Key Interface methods */ //@{ /** * \brief Return the type of this key. * * For RSA keys, this allows people to determine whether this is a * public key, private key or a key pair */ virtual XSECCryptoKey::KeyType getKeyType() const; /** * \brief Return the NSS identifier string */ virtual const XMLCh * getProviderName() const {return DSIGConstants::s_unicodeStrPROVNSS;} /** * \brief Replicate key */ virtual XSECCryptoKey * clone() const; //@} /** @name Mandatory RSA interface methods * * These classes are required by the library. */ //@{ /** * \brief Set the OAEPparams string * * By default, the library expects crypto implementations to perform * OAEP padding with no params. This call allows the library (or user) * to set a params value prior to an encrypt/decrypt operation. * * @param params buffer containing the params data. Pass in NULL to clear any * old paramters. * @param paramsLen number of bytes in buffer to use. Pass in 0 to clear any * old parameters. * @note NSS do not support the ability to set OAEP parameters, so this will * throw an XSECCryptoException::UnsupportedError, unless the passed in * paramters are NULL and 0 (to clear). */ virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen); /** * \brief Get OAEPparams Length * * @returns the number of bytes of the OAEPparams buffer (assuming it has been set) * @note NSS do not support the ability to set OAEP parameters, so this will always * return 0 */ virtual unsigned int getOAEPparamsLen(void) const; /** * \brief Get the OAEPparams * * @returns a pointer to the (crypto object owned) buffer holding the OAEPparams * or NULL if no params are held * @note NSS do not support the ability to set OAEP parameters, so this will always * return NULL */ virtual const unsigned char * getOAEPparams(void) const; /** * \brief Set the MGF * * By default, the library expects crypto implementations to perform * OAEP padding with MGF_SHA1. This call allows the library (or user) * to set a different choice. * * @param mgf the MGF constant identifying the function to use */ virtual void setMGF(maskGenerationFunc mgf); /** * \brief Get the MGF * * @returns the MGF constant in use */ virtual enum maskGenerationFunc getMGF(void) const; /** * \brief Verify a SHA1 PKCS1 encoded signature * * The library will call this function to validate an RSA signature * The standard by default uses SHA1 in a PKCS1 encoding. * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Length of the data in the digest buffer * @param base64Signature Buffer containing the Base64 encoded signature * @param sigLen Length of the data in the signature buffer * @param hm The hash method that was used to create the hash that is being * passed in * @returns true if the signature was valid, false otherwise */ virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm); /** * \brief Create a signature * * The library will call this function to create a signature from * a pre-calculated digest. The output signature will * be Base64 encoded such that it can be placed directly into the * XML document * * @param hashBuf Buffer containing the pre-calculated (binary) digest * @param hashLen Number of bytes of hash in the hashBuf * @param base64SignatureBuf Buffer to place the base64 encoded result * in. * @param base64SignatureBufLen Implementations need to ensure they do * not write more bytes than this into the buffer * @param hm Hash Method used in order to embed correct OID for sig */ virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm); /** * \brief Decrypt using private key * * The library will call this function to decrypt a piece of cipher * text using the private component of this key. * * @param inBuf cipher text to decrypt * @param plainBuf output buffer for decrypted bytes * @param inLength bytes of cipher text to decrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Encrypt using a public key * * The library will call this function to encrypt a plain text buffer * using the public component of this key. * * @param inBuf plain text to decrypt * @param cipherBuf output buffer for decrypted bytes * @param inLength bytes of plain text to encrypt * @param maxOutLength size of outputBuffer * @param padding Type of padding (PKCS 1.5 or OAEP) * @param hm Hash Method for OAEP encryption (OAEPParams should be * set using setOAEPparams() */ virtual unsigned int publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm); /** * \brief Obtain the length of an RSA key * * @returns The length of the rsa key (in bytes) */ virtual unsigned int getLength(void) const; //@} /** @name Optional Interface methods * * Have been implemented to allow interoperability testing */ //@{ /** * \brief Load the modulus * * Load the modulus from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len); /** * \brief Load the exponent * * Load the exponent from a Base64 encoded string * * param b64 A buffer containing the encoded string * param len The length of the data in the buffer */ virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len); //@} /** @name NSS Specific Functions */ //@{ /** * \brief Retrieve the exponent * * Retrieves the exponent in ds:CryptoBinary encoded format * * @param b64 Buffer to place encoded exponent into * @param len Maximum number of bytes to place in buffer * @returns The number of bytes placed in the buffer */ unsigned int getExponentBase64BigNums(char * b64, unsigned int len); /** * \brief Retrieve the modulus * * Retrieves the modulus in ds:CryptoBinary encoded format * * @param b64 Buffer to place the encoded modulus into * @param len Maximum number of bytes to place in buffer * @returns The number of bytes placed in the buffer */ unsigned int getModulusBase64BigNums(char * b64, unsigned int len); //@} private: SECKEYPublicKey * mp_pubkey; SECKEYPrivateKey * mp_privkey; SECItem * mp_modulus; SECItem * mp_exponent; // Instruct to import from parameters void importKey(void); void loadParamsFromKey(void); }; #endif /* XSEC_HAVE_NSS */ #endif /* NSSCRYPTOKEYRSA_INCLUDE */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoX509.cpp000644 001751 001751 00000015732 12003301053 022700 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoX509:= NSS based class for handling X509 (V3) certificates * * Author(s): Milan Tomic * */ #include #include #include #include #include #include #include #include #if defined (XSEC_HAVE_NSS) extern "C" { extern CERTCertificate * __CERT_DecodeDERCertificate (SECItem *derSignedCert, PRBool copyDER, char *nickname); } #include XSEC_USING_XERCES(ArrayJanitor); // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoX509::NSSCryptoX509() : m_DERX509(""), mp_cert(NULL) { } // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoX509::NSSCryptoX509(CERTCertificate * pCert) { // Build this from an existing CERTCertificate structure mp_cert = pCert; unsigned char * encCert; unsigned long len = mp_cert->derCert.len * 2; XSECnew(encCert, unsigned char [len]); ArrayJanitor j_encCert(encCert); // Base64 Encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned long encCertLen = b64.encode(mp_cert->derCert.data, mp_cert->derCert.len, encCert, len); encCertLen += b64.encodeFinish(&encCert[encCertLen], len - encCertLen); // Check the result if (encCert == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSSX509:NSSX509 - Error encoding certificate"); } m_DERX509.sbMemcpyIn(encCert, encCertLen); m_DERX509[encCertLen] = '\0'; } // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoX509::~NSSCryptoX509() { if (mp_cert != 0) CERT_DestroyCertificate(mp_cert); } // -------------------------------------------------------------------------------- // Load X509 // -------------------------------------------------------------------------------- void NSSCryptoX509::loadX509Base64Bin(const char * buf, unsigned int len) { unsigned char * rawCert; XSECnew(rawCert, unsigned char [len]); ArrayJanitor j_rawCert(rawCert); // Base64 Decode XSCryptCryptoBase64 b64; b64.decodeInit(); unsigned int rawCertLen = b64.decode((unsigned char *) buf, len, rawCert, len); rawCertLen += b64.decodeFinish(&rawCert[rawCertLen], len - rawCertLen); // Now load certificate SECItem i; i.type = siBuffer; i.data = rawCert; i.len = rawCertLen; SECItem *certs[1]; certs[0] = &i; // For returning CERTCertificate **certArray = NULL; /* mp_cert = __CERT_DecodeDERCertificate(&i, PR_TRUE, NULL); */ CERT_ImportCerts(CERT_GetDefaultCertDB(), certUsageUserCertImport, 1, certs, &certArray, PR_FALSE, PR_FALSE, NULL); // 1. If you got an compiler error here add into "nss/cert.h" delacarion for // CERT_DecodeDERCertificate() (the same parameters as for __CERT_DecodeDERCertificate()) // 2. Since __CERT_DecodeDERCertificate is a private function we might consider using // __CERT_NewTempCertificate() or CERT_ImportCerts() instead. // Now map to our cert if (certArray == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSSX509:loadX509Base64Bin - Error decoding certificate"); } mp_cert = certArray[0]; if (mp_cert == 0) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSSX509:loadX509Base64Bin - Error decoding certificate"); } m_DERX509.sbMemcpyIn(buf, len); m_DERX509[len] = '\0'; } // -------------------------------------------------------------------------------- // Get NSS provider name // -------------------------------------------------------------------------------- const XMLCh * NSSCryptoX509::getProviderName() const { return DSIGConstants::s_unicodeStrPROVNSS; } // -------------------------------------------------------------------------------- // Get publickey type: RSA or DSA // -------------------------------------------------------------------------------- XSECCryptoKey::KeyType NSSCryptoX509::getPublicKeyType() const { if (mp_cert == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSS:X509 - getPublicKeyType called before X509 loaded"); } XSECCryptoKey::KeyType kt = XSECCryptoKey::KEY_NONE; SECKEYPublicKey * pubkey = CERT_ExtractPublicKey(mp_cert); if (pubkey == 0) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSS:X509 - Error extracting public key from X509 certificate"); } if (pubkey->keyType == dsaKey) kt = XSECCryptoKey::KEY_DSA_PUBLIC; if (pubkey->keyType == rsaKey) kt = XSECCryptoKey::KEY_RSA_PUBLIC; SECKEY_DestroyPublicKey(pubkey); return kt; } // -------------------------------------------------------------------------------- // Replicate public key // -------------------------------------------------------------------------------- XSECCryptoKey * NSSCryptoX509::clonePublicKey() const { if (mp_cert == NULL) { throw XSECCryptoException(XSECCryptoException::X509Error, "NSS:X509 - clonePublicKey called before X509 loaded"); } // Import the key into the provider to get a pointer to the key if (getPublicKeyType() == XSECCryptoKey::KEY_DSA_PUBLIC) { SECKEYPublicKey * pubkey = CERT_ExtractPublicKey(mp_cert); // Now that we have a handle for the DSA key, create a DSA Key object to // wrap it in NSSCryptoKeyDSA * ret; XSECnew(ret, NSSCryptoKeyDSA(pubkey)); return ret; } if (getPublicKeyType() == XSECCryptoKey::KEY_RSA_PUBLIC) { SECKEYPublicKey * pubkey = CERT_ExtractPublicKey(mp_cert); // Now that we have a handle for the DSA key, create a DSA Key object to // wrap it in NSSCryptoKeyRSA * ret; XSECnew(ret, NSSCryptoKeyRSA(pubkey)); return ret; } return NULL; // Unknown key type, but not necessarily an error } #endif /* XSEC_HAVE_NSS */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoHashHMAC.cpp000644 001751 001751 00000014630 12003301053 023543 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoHashHMAC := NSS Implementation of HMAC * * Author(s): Milan Tomic * */ #include #include #include #include #if defined (XSEC_HAVE_NSS) #include // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoHashHMAC::NSSCryptoHashHMAC(HashType alg) { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA1); break; case (XSECCryptoHash::HASH_SHA256) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA256); break; case (XSECCryptoHash::HASH_SHA384) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA384); break; case (XSECCryptoHash::HASH_SHA512) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA512); break; case (XSECCryptoHash::HASH_MD5) : mp_md = PK11_CreateDigestContext(SEC_OID_MD5); break; default : throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Unknown algorithm"); } m_hashType = alg; m_blockSize = XSEC_MAX_HASH_BLOCK_SIZE; SECStatus s = PK11_DigestBegin(mp_md); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error initializing Message Digest"); } } // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoHashHMAC::~NSSCryptoHashHMAC() { if (mp_md != 0) PK11_DestroyContext(mp_md, PR_TRUE); } // -------------------------------------------------------------------------------- // Reset // -------------------------------------------------------------------------------- void NSSCryptoHashHMAC::reset() { SECStatus s = PK11_DigestBegin(mp_md); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error initializing Message Digest"); } } // -------------------------------------------------------------------------------- // Key manipulation // -------------------------------------------------------------------------------- void NSSCryptoHashHMAC::setKey(XSECCryptoKey *key) { if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:HashHMAC - Non HMAC Key passed to HashHMAC"); } m_keyLen = ((XSECCryptoKeyHMAC *) key)->getKey(m_keyBuf); PK11SlotInfo * slot = PK11_GetInternalKeySlot(); if (slot == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:HashHMAC - Failed to get internal key slot"); } SECItem keyItem; keyItem.data = (unsigned char *) m_keyBuf.rawBuffer(); keyItem.len = m_keyLen; CK_MECHANISM_TYPE hmacType; switch (m_hashType) { case (XSECCryptoHash::HASH_SHA1) : hmacType = CKM_SHA_1_HMAC; break; case (XSECCryptoHash::HASH_MD5) : hmacType = CKM_MD5_HMAC; break; default : hmacType = 0; } if(hmacType == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Unknown algorithm"); } PK11SymKey * symKey = PK11_ImportSymKey(slot, hmacType, PK11_OriginUnwrap, CKA_SIGN, &keyItem, NULL); SECItem noParams; noParams.data = 0; noParams.len = 0; mp_md = PK11_CreateContextBySymKey(hmacType, CKA_SIGN, symKey, &noParams); if(mp_md == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Unknown algorithm"); } if (symKey) PK11_FreeSymKey(symKey); if (slot) PK11_FreeSlot(slot); } // -------------------------------------------------------------------------------- // Perform hash operation // -------------------------------------------------------------------------------- void NSSCryptoHashHMAC::hash(unsigned char * data, unsigned int length) { if (mp_md == 0) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:HashHMAC - hash called prior to setKey"); } SECStatus s = PK11_DigestOp(mp_md, data, length); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error Hashing Data"); } } // -------------------------------------------------------------------------------- // Finish // -------------------------------------------------------------------------------- unsigned int NSSCryptoHashHMAC::finish(unsigned char * hash, unsigned int maxLength) { unsigned int retLen = XSEC_MAX_HASH_SIZE; SECStatus s = PK11_DigestFinal(mp_md, m_mdValue, &retLen, XSEC_MAX_HASH_SIZE); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error getting hash value"); } m_mdLen = retLen; retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return (unsigned int) retLen; } // -------------------------------------------------------------------------------- // Get information // -------------------------------------------------------------------------------- XSECCryptoHash::HashType NSSCryptoHashHMAC::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_NSS */xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoHash.cpp000644 001751 001751 00000010342 12003301053 023106 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoHash := NSS Implementation of Message digests * * Author(s): Milan Tomic * */ #include #include #if defined (XSEC_HAVE_NSS) // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoHash::NSSCryptoHash(HashType alg) { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA1); break; case (XSECCryptoHash::HASH_SHA256) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA256); break; case (XSECCryptoHash::HASH_SHA384) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA384); break; case (XSECCryptoHash::HASH_SHA512) : mp_md = PK11_CreateDigestContext(SEC_OID_SHA512); break; case (XSECCryptoHash::HASH_MD5) : mp_md = PK11_CreateDigestContext(SEC_OID_MD5); break; default : throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Unknown algorithm"); } m_hashType = alg; SECStatus s = PK11_DigestBegin(mp_md); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error initializing Message Digest"); } } // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoHash::~NSSCryptoHash() { if (mp_md != 0) PK11_DestroyContext(mp_md, PR_TRUE); } // -------------------------------------------------------------------------------- // Reset // -------------------------------------------------------------------------------- void NSSCryptoHash::reset(void) { SECStatus s = PK11_DigestBegin(mp_md); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error initializing Message Digest"); } } // -------------------------------------------------------------------------------- // Hash // -------------------------------------------------------------------------------- void NSSCryptoHash::hash(unsigned char * data, unsigned int length) { SECStatus s = PK11_DigestOp(mp_md, data, length); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error Hashing Data"); } } // -------------------------------------------------------------------------------- // Finish // -------------------------------------------------------------------------------- unsigned int NSSCryptoHash::finish(unsigned char * hash, unsigned int maxLength) { unsigned int retLen = XSEC_MAX_HASH_SIZE; SECStatus s = PK11_DigestFinal(mp_md, m_mdValue, &retLen, XSEC_MAX_HASH_SIZE); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MDError, "NSS:Hash - Error getting hash value"); } m_mdLen = retLen; retLen = (maxLength > m_mdLen ? m_mdLen : maxLength); memcpy(hash, m_mdValue, retLen); return (unsigned int) retLen; } // -------------------------------------------------------------------------------- // Get information // -------------------------------------------------------------------------------- XSECCryptoHash::HashType NSSCryptoHash::getHashType(void) const { return m_hashType; // This could be any kind of hash } #endif /* XSEC_HAVE_NSS */xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyDSA.cpp000644 001751 001751 00000035706 12003301053 023316 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyDSA := DSA Keys * * Author(s): Milan Tomic * */ #include #include #include #include #include #include #if defined (XSEC_HAVE_NSS) XSEC_USING_XERCES(ArrayJanitor); // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoKeyDSA::NSSCryptoKeyDSA(SECKEYPublicKey * pubkey, SECKEYPrivateKey * privkey) { // NOTE - We OWN those handles mp_pubkey = pubkey; mp_privkey = privkey; mp_P = NULL; mp_Q = NULL; mp_G = NULL; mp_Y = NULL; }; // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoKeyDSA::~NSSCryptoKeyDSA() { // Clean up if (mp_pubkey != 0) SECKEY_DestroyPublicKey(mp_pubkey); if (mp_privkey != 0) SECKEY_DestroyPrivateKey(mp_privkey); if (mp_P != NULL) SECITEM_FreeItem(mp_P, PR_TRUE); if (mp_Q != NULL) SECITEM_FreeItem(mp_Q, PR_TRUE); if (mp_G != NULL) SECITEM_FreeItem(mp_G, PR_TRUE); if (mp_Y != NULL) SECITEM_FreeItem(mp_Y, PR_TRUE); }; // -------------------------------------------------------------------------------- // Get key type // -------------------------------------------------------------------------------- XSECCryptoKey::KeyType NSSCryptoKeyDSA::getKeyType() const { // Find out what we have if (mp_pubkey == NULL) { if (mp_privkey != 0) return KEY_DSA_PRIVATE; // Check if we have parameters loaded if (mp_P == NULL || mp_Q == NULL || mp_G == NULL || mp_Y == NULL) return KEY_NONE; else return KEY_DSA_PUBLIC; } if (mp_privkey != 0) return KEY_DSA_PAIR; // If we have m_key - it must be public return KEY_DSA_PUBLIC; } // -------------------------------------------------------------------------------- // Load P parameter // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadPBase64BigNums(const char * b64, unsigned int len) { if (mp_P != NULL) { SECITEM_FreeItem(mp_P, PR_TRUE); mp_P = NULL; // In case we get an exception } mp_P = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Load Q parameter // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadQBase64BigNums(const char * b64, unsigned int len) { if (mp_Q != NULL) { SECITEM_FreeItem(mp_Q, PR_TRUE); mp_Q = NULL; // In case we get an exception } mp_Q = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Load G parameter // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadGBase64BigNums(const char * b64, unsigned int len) { if (mp_G != NULL) { SECITEM_FreeItem(mp_G, PR_TRUE); mp_G = NULL; // In case we get an exception } mp_G = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Load Y parameter // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadYBase64BigNums(const char * b64, unsigned int len) { if (mp_Y != NULL) { SECITEM_FreeItem(mp_Y, PR_TRUE); mp_Y = NULL; // In case we get an exception } mp_Y = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Load Y parameter // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadJBase64BigNums(const char * b64, unsigned int len) { //Do nothing } // -------------------------------------------------------------------------------- // Import key // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::importKey(void) { if (mp_pubkey != 0 || mp_P == NULL || mp_Q == NULL || mp_G == NULL || mp_Y == NULL) return; PRArenaPool * arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if(arena == NULL) { throw XSECCryptoException(XSECCryptoException::GeneralError, "NSS:DSA Error attempting create new arena"); } mp_pubkey = (SECKEYPublicKey*)PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey)); if(mp_pubkey == NULL ) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting create new arena"); } mp_pubkey->arena = arena; mp_pubkey->u.dsa.params.arena = arena; mp_pubkey->keyType = dsaKey; SECStatus s = SECITEM_CopyItem(arena, &(mp_pubkey->u.dsa.params.prime), mp_P); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to import P key parameter"); } s = SECITEM_CopyItem(arena, &(mp_pubkey->u.dsa.params.subPrime), mp_Q); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to import Q key parameter"); } s = SECITEM_CopyItem(arena, &(mp_pubkey->u.dsa.params.base), mp_G); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to import G key parameter"); } s = SECITEM_CopyItem(arena, &(mp_pubkey->u.dsa.publicValue), mp_Y); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to import Y key parameter"); } } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool NSSCryptoKeyDSA::verifyBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64Signature, unsigned int sigLen) { // Use the currently loaded key to validate the Base64 encoded signature if (mp_pubkey == 0) { // Try to import from the parameters importKey(); if (mp_pubkey == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Attempt to validate signature with empty key"); } } // Decode the signature unsigned char * rawSig; unsigned int rawSigLen; XSECnew(rawSig, unsigned char[sigLen]); ArrayJanitor j_rawSig(rawSig); // Decode the signature XSCryptCryptoBase64 b64; b64.decodeInit(); rawSigLen = b64.decode((unsigned char *) base64Signature, sigLen, rawSig, sigLen); rawSigLen += b64.decodeFinish(&rawSig[rawSigLen], sigLen - rawSigLen); SECItem signature; signature.type = siBuffer; signature.data = rawSig; signature.len = rawSigLen; SECItem data; data.type = siBuffer; data.data = (unsigned char *)hashBuf; data.len = hashLen; // Verify signature SECStatus s = PK11_Verify(mp_pubkey, &signature, &data, NULL); return s == SECSuccess; } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyDSA::signBase64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen) { // Sign a pre-calculated hash using this key if (mp_privkey == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Attempt to sign data using a public or un-loaded key"); } unsigned int signatureLen = PK11_SignatureLen(mp_privkey); unsigned char * rawSig; XSECnew(rawSig, unsigned char[signatureLen]); ArrayJanitor j_rawSig(rawSig); SECItem signature; signature.type = siBuffer; signature.data = rawSig; signature.len = signatureLen; SECItem data; data.type = siBuffer; data.data = hashBuf; data.len = hashLen; SECStatus s = PK11_Sign(mp_privkey, &signature, &data); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Error during signing operation"); } // Now encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned int ret = b64.encode(signature.data, signature.len, (unsigned char *) base64SignatureBuf, base64SignatureBufLen); ret += b64.encodeFinish((unsigned char *) &base64SignatureBuf[ret], base64SignatureBufLen - ret); return ret; } // -------------------------------------------------------------------------------- // Clone key // -------------------------------------------------------------------------------- XSECCryptoKey * NSSCryptoKeyDSA::clone() const { NSSCryptoKeyDSA * ret = NULL; XSECnew(ret, NSSCryptoKeyDSA(mp_pubkey, mp_privkey)); // Clone public key if (mp_pubkey != 0) { ret->mp_pubkey = SECKEY_CopyPublicKey(mp_pubkey); if (ret->mp_pubkey == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) public key"); } } // Clone private key if (mp_privkey != 0) { ret->mp_privkey = SECKEY_CopyPrivateKey(mp_privkey); if (ret->mp_privkey == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) private key"); } } // Clone parameter P if (mp_P != 0) { ret->mp_P = SECITEM_DupItem(mp_P); if (ret->mp_P == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) P key parameter"); } } // Clone parameter Q if (mp_Q != 0) { ret->mp_Q = SECITEM_DupItem(mp_Q); if (ret->mp_Q == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) Q key parameter"); } } // Clone parameter G if (mp_G != 0) { ret->mp_G = SECITEM_DupItem(mp_G); if (ret->mp_G == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) G key parameter"); } } // Clone parameter Y if (mp_Y != 0) { ret->mp_Y = SECITEM_DupItem(mp_Y); if (ret->mp_Y == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:DSA Error attempting to clone (copy) Y key parameter"); } } return ret; } // -------------------------------------------------------------------------------- // Some utility functions // -------------------------------------------------------------------------------- void NSSCryptoKeyDSA::loadParamsFromKey(void) { if (mp_pubkey == 0) return; mp_P = SECITEM_DupItem(&(mp_pubkey->u.dsa.params.prime)); if (mp_P == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Error during extracting P from public key"); } mp_Q = SECITEM_DupItem(&(mp_pubkey->u.dsa.params.subPrime)); if (mp_Q == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Error during extracting Q from public key"); } mp_G = SECITEM_DupItem(&(mp_pubkey->u.dsa.params.base)); if (mp_G == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Error during extracting G from public key"); } mp_Y = SECITEM_DupItem(&(mp_pubkey->u.dsa.publicValue)); if (mp_Y == 0) { throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:DSA - Error during extracting Y from public key"); } } // -------------------------------------------------------------------------------- // Get P parameter // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyDSA::getPBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_P == NULL) { return 0; // Nothing we can do } if (mp_P == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_P, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } // -------------------------------------------------------------------------------- // Get Q parameter // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyDSA::getQBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_Q == NULL) { return 0; // Nothing we can do } if (mp_Q == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_Q, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } // -------------------------------------------------------------------------------- // Get G parameter // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyDSA::getGBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_G == NULL) { return 0; // Nothing we can do } if (mp_G == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_G, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } // -------------------------------------------------------------------------------- // Get Y parameter // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyDSA::getYBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_Y == NULL) { return 0; // Nothing we can do } if (mp_Y == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_Y, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } #endif /* XSEC_HAVE_NSS */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoProvider.cpp000644 001751 001751 00000026543 12003301053 024027 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoProvider := Provider to support NSS * * Author(s): Milan Tomic * */ #include #include #include #include #include #include #include #include #include #include #include #if defined (XSEC_HAVE_NSS) #include XSEC_USING_XERCES(ArrayJanitor); int NSSCryptoProvider::m_initialised = 0; // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- void NSSCryptoProvider::Init(const char * dbDir) { ++m_initialised; if (m_initialised > 1) return; SECStatus s; if (dbDir != NULL) s = NSS_Init(dbDir); else s = NSS_NoDB_Init(NULL); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSSCryptoProvider:NSSCryptoProvider - Error initializing NSS"); } } NSSCryptoProvider::NSSCryptoProvider(const char * dbDir) { Init(dbDir); } // -------------------------------------------------------------------------------- // Empty constructor // -------------------------------------------------------------------------------- NSSCryptoProvider::NSSCryptoProvider() { Init(NULL); } // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoProvider::~NSSCryptoProvider() { if (m_initialised == 1) { PK11_LogoutAll(); SECStatus s = NSS_Shutdown(); // Note that NSS will fail to shut down if any memory leaks are detected (NSS // objects were not released). This is security measure to prevent abuse of your // private keys. if (s != SECSuccess) { //throw XSECCryptoException(XSECCryptoException::GeneralError, // "NSSCryptoProvider:NSSCryptoProvider - Error shuting down NSS"); } } m_initialised--; } // -------------------------------------------------------------------------------- // Get NSS string // -------------------------------------------------------------------------------- const XMLCh * NSSCryptoProvider::getProviderName() const { return DSIGConstants::s_unicodeStrPROVNSS; } // -------------------------------------------------------------------------------- // Hash SHA1 // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashSHA1() const { NSSCryptoHash * ret; XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_SHA1)); return ret; } // -------------------------------------------------------------------------------- // Hash SHA // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashSHA(int length) const { NSSCryptoHash * ret; switch (length) { case 160: XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_SHA1)); break; case 256: XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_SHA256)); break; case 384: XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_SHA384)); break; case 512: XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_SHA512)); break; default: ret = NULL; } return ret; } // -------------------------------------------------------------------------------- // Hash HMAC SHA1 // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashHMACSHA1() const { NSSCryptoHashHMAC * ret; XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_SHA1)); return ret; } // -------------------------------------------------------------------------------- // Hash HMAC SHA // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashHMACSHA(int length) const { NSSCryptoHashHMAC * ret; switch (length) { case 160: XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_SHA1)); break; case 256: XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_SHA256)); break; case 384: XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_SHA384)); break; case 512: XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_SHA512)); break; default: ret = NULL; } return ret; } // -------------------------------------------------------------------------------- // Hash MD5 // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashMD5() const { NSSCryptoHash * ret; XSECnew(ret, NSSCryptoHash(XSECCryptoHash::HASH_MD5)); return ret; } // -------------------------------------------------------------------------------- // Hash HMAC MD5 // -------------------------------------------------------------------------------- XSECCryptoHash * NSSCryptoProvider::hashHMACMD5()const { NSSCryptoHashHMAC * ret; XSECnew(ret, NSSCryptoHashHMAC(XSECCryptoHash::HASH_MD5)); return ret; } // -------------------------------------------------------------------------------- // Get HMAC key // -------------------------------------------------------------------------------- XSECCryptoKeyHMAC * NSSCryptoProvider::keyHMAC(void) const { NSSCryptoKeyHMAC * ret; XSECnew(ret, NSSCryptoKeyHMAC()); return ret; } // -------------------------------------------------------------------------------- // Get DSA key // -------------------------------------------------------------------------------- XSECCryptoKeyDSA * NSSCryptoProvider::keyDSA() const { NSSCryptoKeyDSA * ret; XSECnew(ret, NSSCryptoKeyDSA()); return ret; } // -------------------------------------------------------------------------------- // Get RSA key // -------------------------------------------------------------------------------- XSECCryptoKeyRSA * NSSCryptoProvider::keyRSA() const { NSSCryptoKeyRSA * ret; XSECnew(ret, NSSCryptoKeyRSA()); return ret; } // -------------------------------------------------------------------------------- // Get symmetric key // -------------------------------------------------------------------------------- XSECCryptoSymmetricKey * NSSCryptoProvider::keySymmetric( XSECCryptoSymmetricKey::SymmetricKeyType alg) const { // Only temporary NSSCryptoSymmetricKey * ret; XSECnew(ret, NSSCryptoSymmetricKey(alg)); return ret; } // -------------------------------------------------------------------------------- // Get X509 class // -------------------------------------------------------------------------------- XSECCryptoX509 * NSSCryptoProvider::X509() const { NSSCryptoX509 * ret; XSECnew(ret, NSSCryptoX509()); return ret; } // -------------------------------------------------------------------------------- // Get Base64 // -------------------------------------------------------------------------------- XSECCryptoBase64 * NSSCryptoProvider::base64() const { // NSS does provide a Base64 decoder/encoder, // but rather use the internal implementation. XSCryptCryptoBase64 * ret; XSECnew(ret, XSCryptCryptoBase64()); return ret; } // -------------------------------------------------------------------------------- // Translate a Base64 number to a SECItem // -------------------------------------------------------------------------------- SECItem * NSSCryptoProvider::b642SI(const char * b64, unsigned int b64Len) { SECItem * rv; unsigned char * os; XSECnew(os, unsigned char[b64Len]); ArrayJanitor j_os(os); // Decode XSCryptCryptoBase64 b; b.decodeInit(); unsigned int retLen = b.decode((unsigned char *) b64, b64Len, os, b64Len); retLen += b.decodeFinish(&os[retLen], b64Len - retLen); rv = SECITEM_AllocItem(NULL, NULL, retLen); rv->len = retLen; memcpy(rv->data, os, retLen); return rv; } // -------------------------------------------------------------------------------- // Translate a SECItem to a Base64 I2OSP number // -------------------------------------------------------------------------------- unsigned char * NSSCryptoProvider::SI2b64(SECItem * n, unsigned int &retLen) { unsigned char * b64; // Naieve length calculation unsigned int bufLen = n->len * 2 + 4; XSECnew(b64, unsigned char[bufLen]); ArrayJanitor j_b64(b64); // Encode XSCryptCryptoBase64 b; b.encodeInit(); retLen = b.encode(n->data, (unsigned int) n->len, b64, bufLen); retLen += b.encodeFinish(&b64[retLen], bufLen - retLen); j_b64.release(); return b64; } // -------------------------------------------------------------------------------- // Check if hash algorithm is supported // -------------------------------------------------------------------------------- bool NSSCryptoProvider::algorithmSupported(XSECCryptoHash::HashType alg) const { switch (alg) { case (XSECCryptoHash::HASH_SHA1) : case (XSECCryptoHash::HASH_MD5) : return true; case (XSECCryptoHash::HASH_SHA256) : case (XSECCryptoHash::HASH_SHA384) : case (XSECCryptoHash::HASH_SHA512) : case (XSECCryptoHash::HASH_SHA224) : return false; default: return false; } return false; } // -------------------------------------------------------------------------------- // Check if cypher algorithm is supported // -------------------------------------------------------------------------------- bool NSSCryptoProvider::algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) const { switch (alg) { case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : //return m_haveAES; return true; case (XSECCryptoSymmetricKey::KEY_3DES_192) : return true; default: return false; } return false; } // -------------------------------------------------------------------------------- // Generate random data // -------------------------------------------------------------------------------- unsigned int NSSCryptoProvider::getRandom(unsigned char * buffer, unsigned int numOctets) const { SECStatus s = PK11_GenerateRandom(buffer, numOctets); if (s != SECSuccess) { throw XSECException(XSECException::InternalError, "NSSCryptoProvider() - Error generating Random data"); } return numOctets; } #endif /* XSEC_HAVE_NSS */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoSymmetricKey.cpp000644 001751 001751 00000037444 12003301053 024664 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCryptoSymmetricKey := Bulk encryption algorithms should all be * implemented via this interface * * Author(s): Milan Tomic * */ #include #include #include #include #include #include #include #if defined (XSEC_HAVE_NSS) #include "prerror.h" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoSymmetricKey::NSSCryptoSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType type) : m_keyType(type), m_keyMode(MODE_NONE), m_initialised(false), mp_k(NULL) { } // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoSymmetricKey::~NSSCryptoSymmetricKey() { if (mp_k != 0) PK11_FreeSymKey(mp_k); } // -------------------------------------------------------------------------------- // Get key type // -------------------------------------------------------------------------------- XSECCryptoSymmetricKey::SymmetricKeyType NSSCryptoSymmetricKey::getSymmetricKeyType() const { return m_keyType; } // -------------------------------------------------------------------------------- // Get provider name // -------------------------------------------------------------------------------- const XMLCh * NSSCryptoSymmetricKey::getProviderName() const { return DSIGConstants::s_unicodeStrPROVNSS; } // -------------------------------------------------------------------------------- // Replicate key // -------------------------------------------------------------------------------- XSECCryptoKey * NSSCryptoSymmetricKey::clone() const { NSSCryptoSymmetricKey * ret; XSECnew(ret, NSSCryptoSymmetricKey(m_keyType)); if (mp_k != 0) { ret->mp_k = PK11_ReferenceSymKey(mp_k); } ret->m_keyType = m_keyType; return ret; } // -------------------------------------------------------------------------------- // Store the key value // -------------------------------------------------------------------------------- void NSSCryptoSymmetricKey::setKey(const unsigned char * key, unsigned int keyLen) { if (mp_k != 0) { PK11_FreeSymKey(mp_k); mp_k = 0; } CK_MECHANISM_TYPE cipherMech; switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : cipherMech = CKM_DES3_CBC_PAD; break; case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : cipherMech = CKM_AES_CBC_PAD; break; default: throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unknown key type"); } // Turn the raw key into a SECItem SECItem keyItem; keyItem.data = (unsigned char*)key; keyItem.len = keyLen; PK11SlotInfo * slot = PK11_GetBestSlot(cipherMech, NULL); // Turn the SECItem into a key object mp_k = PK11_ImportSymKey(slot, cipherMech, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, NULL); if (slot) PK11_FreeSlot(slot); } // -------------------------------------------------------------------------------- // Decrypt context initialisation // -------------------------------------------------------------------------------- int NSSCryptoSymmetricKey::decryptCtxInit(const unsigned char * iv) { // Returns amount of IV data used (in bytes) // Sets m_initialised if the key is OK and the IV is OK. if (m_initialised) return 0; if (mp_k == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Cannot initialise without mode"); } // Set up the context according to the required cipher type switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : // A 3DES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } SECItem ivItem; ivItem.data = (unsigned char*)iv; ivItem.len = 8; int encryptAlg = (m_doPad == true ? CKM_DES3_CBC_PAD : CKM_DES3_CBC); SECItem * secParam = PK11_ParamFromIV(encryptAlg, &ivItem); mp_ctx = PK11_CreateContextBySymKey(encryptAlg, CKA_DECRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 8; } else if (m_keyMode == MODE_ECB) { SECItem * secParam = PK11_ParamFromIV(CKM_DES3_ECB, NULL); mp_ctx = PK11_CreateContextBySymKey(CKM_DES3_ECB, CKA_DECRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 0; } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unrecognized cipher mode"); } break; case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { return 0; // Cannot initialise without an IV } SECItem ivItem; ivItem.data = (unsigned char*)iv; ivItem.len = 16; SECItem * secParam = PK11_ParamFromIV(CKM_AES_CBC_PAD, &ivItem); mp_ctx = PK11_CreateContextBySymKey(CKM_AES_CBC_PAD, CKA_DECRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 16; } else if (m_keyMode == MODE_ECB { SECItem * secParam = PK11_ParamFromIV(CKM_AES_ECB, NULL); mp_ctx = PK11_CreateContextBySymKey(CKM_AES_ECB, CKA_DECRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 0; } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unrecognized cipher mode"); } break; default : // Cannot do this without an IV throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unknown key type"); } // Reset some parameters m_initialised = true; // Return number of bytes chewed up by IV return m_ivSize; } // -------------------------------------------------------------------------------- // Decrypt initialisation // -------------------------------------------------------------------------------- bool NSSCryptoSymmetricKey::decryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char * iv, const unsigned char* tag, unsigned int taglen) { m_initialised = false; m_ivSent = iv == NULL; m_doPad = doPad; m_keyMode = mode; decryptCtxInit(iv); return true; } // -------------------------------------------------------------------------------- // Decrypt // -------------------------------------------------------------------------------- unsigned int NSSCryptoSymmetricKey::decrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength) { // NOTE: This won't actually stop NSS blowing the buffer, so the onus is // on the caller. unsigned int offset = 0; if (!m_initialised) { offset = decryptCtxInit(inBuf); if (offset > inLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Not enough data passed in to get IV"); } } int outl = inLength - offset; SECStatus s = PK11_CipherOp(mp_ctx, plainBuf, &outl, maxOutLength, (unsigned char*)inBuf, inLength); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error during NSS decrypt"); } // remove IV if (m_ivSent) { memmove(plainBuf, &plainBuf[m_ivSize], outl); outl -= m_ivSize; m_ivSent = false; } return outl; } // -------------------------------------------------------------------------------- // Decrypt finalisation // -------------------------------------------------------------------------------- unsigned int NSSCryptoSymmetricKey::decryptFinish(unsigned char * plainBuf, unsigned int maxOutLength) { unsigned int outl = 0; SECStatus s = PK11_DigestFinal(mp_ctx, plainBuf, &outl, maxOutLength); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error during NSS decrypt finalisation"); } PK11_DestroyContext(mp_ctx, PR_TRUE); mp_ctx = NULL; m_initialised = false; return outl; } // -------------------------------------------------------------------------------- // Encrypt initialisation // -------------------------------------------------------------------------------- bool NSSCryptoSymmetricKey::encryptInit(bool doPad, SymmetricKeyMode mode, const unsigned char * iv) { if (m_initialised == true) return true; m_doPad = doPad; m_keyMode = mode; if (mp_k == 0) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Cannot initialise without key"); } else if (m_keyMode == MODE_NONE) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Cannot initialise without mode"); } // Do some parameter initialisation m_initialised = true; // Set up the context according to the required cipher type const unsigned char * usedIV = NULL; unsigned char genIV[256]; // Tell the library that the IV still has to be sent m_ivSent = false; switch (m_keyType) { case (XSECCryptoSymmetricKey::KEY_3DES_192) : // A 3DES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { SECStatus s = PK11_GenerateRandom(genIV, 8); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; SECItem ivItem; ivItem.data = (unsigned char*)usedIV; ivItem.len = 8; int encryptAlg = (m_doPad == true ? CKM_DES3_CBC_PAD : CKM_DES3_CBC); SECItem * secParam = PK11_ParamFromIV(encryptAlg, &ivItem); mp_ctx = PK11_CreateContextBySymKey(encryptAlg, CKA_ENCRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 8; } else if (m_keyMode == MODE_ECB) { mp_ctx = PK11_CreateContextBySymKey(CKM_DES3_ECB, CKA_ENCRYPT, mp_k, NULL); m_ivSize = 0; } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unsupported DES3 cipher mode"); } break; case (XSECCryptoSymmetricKey::KEY_AES_128) : case (XSECCryptoSymmetricKey::KEY_AES_192) : case (XSECCryptoSymmetricKey::KEY_AES_256) : // An AES key if (m_keyMode == MODE_CBC) { if (iv == NULL) { SECStatus s = PK11_GenerateRandom(genIV, 16); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error generating random IV"); } usedIV = genIV; } else usedIV = iv; SECItem ivItem; ivItem.data = (unsigned char*)usedIV; ivItem.len = 16; SECItem * secParam = PK11_ParamFromIV(CKM_AES_CBC_PAD, &ivItem); mp_ctx = PK11_CreateContextBySymKey(CKM_AES_CBC_PAD, CKA_ENCRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 16; } else if (m_keyMode == MODE_ECB) { SECItem * secParam = PK11_ParamFromIV(CKM_AES_ECB, NULL); mp_ctx = PK11_CreateContextBySymKey(CKM_AES_ECB, CKA_ENCRYPT, mp_k, secParam); if (secParam) SECITEM_FreeItem(secParam, PR_TRUE); m_ivSize = 0; } else { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unsupported AES cipher mode"); } break; default : throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Unknown key type"); } // Add IV if (m_keyMode == MODE_CBC || m_keyMode == MODE_GCM) { memcpy(m_lastBlock, usedIV, m_ivSize); } return true; } // -------------------------------------------------------------------------------- // Encrypt // -------------------------------------------------------------------------------- unsigned int NSSCryptoSymmetricKey::encrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength) { if (m_initialised == false) { encryptInit(); } // NOTE: This won't actually stop NSS blowing the buffer, so the onus is // on the caller. unsigned int offset = 0; if (m_ivSent == false && m_ivSize > 0) { memcpy(cipherBuf, m_lastBlock, m_ivSize); m_ivSent = true; offset = m_ivSize; } int outl = 0; if (inLength + offset > maxOutLength) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Not enough space in output buffer for encrypt"); } SECStatus s = PK11_CipherOp(mp_ctx, &cipherBuf[offset], &outl, maxOutLength - offset, (unsigned char*)inBuf, inLength); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error during NSS encrypt"); } return outl + offset; } // -------------------------------------------------------------------------------- // Encrypt finalisation // -------------------------------------------------------------------------------- unsigned int NSSCryptoSymmetricKey::encryptFinish(unsigned char * cipherBuf, unsigned int maxOutLength, unsigned int taglen) { unsigned int outl = 0; SECStatus s = PK11_DigestFinal(mp_ctx, cipherBuf, &outl, maxOutLength); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::SymmetricError, "NSS:SymmetricKey - Error during NSS encrypt"); } PK11_DestroyContext(mp_ctx, PR_TRUE); mp_ctx = NULL; // Setup so can be re-used m_initialised = false; return outl; } #endif /* XSEC_HAVE_NSS */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyRSA.cpp000644 001751 001751 00000047607 12003301053 023337 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyRSA := RSA Keys * * Author(s): Milan Tomic * */ #include #include #include #include #include #include #if defined (XSEC_HAVE_NSS) #include #include XSEC_USING_XERCES(ArrayJanitor); // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoKeyRSA::NSSCryptoKeyRSA(SECKEYPublicKey * pubkey, SECKEYPrivateKey * privkey) { // NOTE - We OWN those handles mp_pubkey = pubkey; mp_privkey = privkey; mp_modulus = NULL; mp_exponent = NULL; }; // -------------------------------------------------------------------------------- // Destructor // -------------------------------------------------------------------------------- NSSCryptoKeyRSA::~NSSCryptoKeyRSA() { // Clean up if (mp_pubkey != 0) SECKEY_DestroyPublicKey(mp_pubkey); if (mp_privkey != 0) SECKEY_DestroyPrivateKey(mp_privkey); if (mp_modulus != NULL) SECITEM_FreeItem(mp_modulus, PR_TRUE); if (mp_exponent != NULL) SECITEM_FreeItem(mp_exponent, PR_TRUE); }; // -------------------------------------------------------------------------------- // Get key type // -------------------------------------------------------------------------------- XSECCryptoKey::KeyType NSSCryptoKeyRSA::getKeyType() const { // Find out what we have if (mp_pubkey == 0) { if (mp_privkey != 0) return KEY_RSA_PRIVATE; if (mp_exponent == NULL || mp_modulus == NULL) return KEY_NONE; else return KEY_RSA_PUBLIC; } if (mp_privkey != 0) return KEY_RSA_PAIR; return KEY_RSA_PUBLIC; } // -------------------------------------------------------------------------------- // Set OAEP parameters // -------------------------------------------------------------------------------- void NSSCryptoKeyRSA::setOAEPparams(unsigned char * params, unsigned int paramsLen) { if (params != NULL && paramsLen != 0) { throw XSECCryptoException(XSECCryptoException::UnsupportedError, "NSS::setOAEPParams - OAEP parameters are not supported by NSS"); } } void NSSCryptoKeyRSA::setMGF(maskGenerationFunc mgf) { if (mgf != MGF1_SHA1) throw XSECCryptoException(XSECCryptoException::UnsupportedError, "NSS::setMGF - NSS does not support pluggable MGF for OAEP"); } // -------------------------------------------------------------------------------- // Get OAEP parameters length // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::getOAEPparamsLen(void) const { return 0; } // -------------------------------------------------------------------------------- // Get OAEP parameters // -------------------------------------------------------------------------------- const unsigned char * NSSCryptoKeyRSA::getOAEPparams(void) const { return NULL; } maskGenerationFunc NSSCryptoKeyRSA::getMGF() const { return MGF1_SHA1; } // -------------------------------------------------------------------------------- // Load modulus // -------------------------------------------------------------------------------- void NSSCryptoKeyRSA::loadPublicModulusBase64BigNums(const char * b64, unsigned int len) { if (mp_modulus != NULL) { SECITEM_FreeItem(mp_modulus, PR_TRUE); mp_modulus = NULL; // In case we get an exception } mp_modulus = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Load exponent // -------------------------------------------------------------------------------- void NSSCryptoKeyRSA::loadPublicExponentBase64BigNums(const char * b64, unsigned int len) { if (mp_exponent != NULL) { SECITEM_FreeItem(mp_exponent, PR_TRUE); mp_exponent = NULL; // In case we get an exception } mp_exponent = NSSCryptoProvider::b642SI(b64, len); } // -------------------------------------------------------------------------------- // Import key // -------------------------------------------------------------------------------- void NSSCryptoKeyRSA::importKey(void) { if (mp_pubkey != 0 || mp_exponent == NULL || mp_modulus == NULL) return; PRArenaPool * arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if(arena == NULL) { throw XSECCryptoException(XSECCryptoException::GeneralError, "NSS:RSA Error attempting create new arena"); } mp_pubkey = (SECKEYPublicKey*)PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey)); if(mp_pubkey == NULL ) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::GeneralError, "NSS:RSA Error attempting create new arena"); } mp_pubkey->arena = arena; mp_pubkey->keyType = rsaKey; SECStatus s = SECITEM_CopyItem(arena, &(mp_pubkey->u.rsa.modulus), mp_modulus); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:RSA Error attempting to import modulus"); } s = SECITEM_CopyItem(arena, &(mp_pubkey->u.rsa.publicExponent), mp_exponent); if (s != SECSuccess) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::DSAError, "NSS:RSA Error attempting to import exponent"); } } // -------------------------------------------------------------------------------- // Verify a signature encoded as a Base64 string // -------------------------------------------------------------------------------- bool NSSCryptoKeyRSA::verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, unsigned int hashLen, const char * base64Signature, unsigned int sigLen, hashMethod hm) { // Use the currently loaded key to validate the Base64 encoded signature if (mp_pubkey == 0) { // Try to import from the parameters importKey(); if (mp_pubkey == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Attempt to validate signature with empty key"); } } // Decode the signature unsigned char * rawSig; unsigned int rawSigLen; XSECnew(rawSig, unsigned char[sigLen]); ArrayJanitor j_rawSig(rawSig); // Decode the signature XSCryptCryptoBase64 b64; b64.decodeInit(); rawSigLen = b64.decode((unsigned char *) base64Signature, sigLen, rawSig, sigLen); rawSigLen += b64.decodeFinish(&rawSig[rawSigLen], sigLen - rawSigLen); SECItem signature; signature.type = siBuffer; signature.data = rawSig; signature.len = rawSigLen; SECItem data; data.data = 0; data.len = 0; SECOidTag hashalg; PRArenaPool * arena = 0; SGNDigestInfo *di = 0; SECItem * res; switch (hm) { case (HASH_MD5): hashalg = SEC_OID_MD5; break; case (HASH_SHA1): hashalg = SEC_OID_SHA1; break; case (HASH_SHA256): hashalg = SEC_OID_SHA256; break; case (HASH_SHA384): hashalg = SEC_OID_SHA384; break; case (HASH_SHA512): hashalg = SEC_OID_SHA512; break; default: throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Unsupported hash algorithm in RSA sign"); } arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!arena) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error creating arena"); } di = SGN_CreateDigestInfo(hashalg, (unsigned char * )hashBuf, hashLen); if (di == NULL) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error creating digest info"); } res = SEC_ASN1EncodeItem(arena, &data, di, NSS_Get_sgn_DigestInfoTemplate(NULL, 0)); if (!res) { SGN_DestroyDigestInfo(di); PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error encoding digest info for RSA sign"); } // Verify signature SECStatus s = PK11_Verify(mp_pubkey, &signature, &data, NULL); return s == SECSuccess; } // -------------------------------------------------------------------------------- // Sign and encode result as a Base64 string // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::signSHA1PKCS1Base64Signature(unsigned char * hashBuf, unsigned int hashLen, char * base64SignatureBuf, unsigned int base64SignatureBufLen, hashMethod hm) { // Sign a pre-calculated hash using this key if (mp_privkey == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Attempt to sign data using a public or un-loaded key"); } unsigned char * rawSig; XSECnew(rawSig, unsigned char[base64SignatureBufLen]); ArrayJanitor j_rawSig(rawSig); SECItem signature; signature.type = siBuffer; signature.data = rawSig; signature.len = base64SignatureBufLen; SECItem data; data.data = 0; SECOidTag hashalg; PRArenaPool * arena = 0; SGNDigestInfo *di = 0; SECItem * res; switch (hm) { case (HASH_MD5): hashalg = SEC_OID_MD5; break; case (HASH_SHA1): hashalg = SEC_OID_SHA1; break; case (HASH_SHA256): hashalg = SEC_OID_SHA256; break; case (HASH_SHA384): hashalg = SEC_OID_SHA384; break; case (HASH_SHA512): hashalg = SEC_OID_SHA512; break; default: throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Unsupported hash algorithm in RSA sign"); } arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!arena) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error creating arena"); } di = SGN_CreateDigestInfo(hashalg, hashBuf, hashLen); if (di == NULL) { PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error creating digest info"); } res = SEC_ASN1EncodeItem(arena, &data, di, NSS_Get_sgn_DigestInfoTemplate(NULL, 0)); if (!res) { SGN_DestroyDigestInfo(di); PORT_FreeArena(arena, PR_FALSE); throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error encoding digest info for RSA sign"); } /* data.type = siBuffer; data.data = hashBuf; data.len = hashLen;*/ /* As of V1.3.1 - create a DigestInfo block */ SECStatus s = PK11_Sign(mp_privkey, &signature, &data); SGN_DestroyDigestInfo(di); PORT_FreeArena(arena, PR_FALSE); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error during signing operation"); } // Now encode XSCryptCryptoBase64 b64; b64.encodeInit(); unsigned int ret = b64.encode(signature.data, signature.len, (unsigned char *) base64SignatureBuf, base64SignatureBufLen); ret += b64.encodeFinish((unsigned char *) &base64SignatureBuf[ret], base64SignatureBufLen - ret); return ret; } // -------------------------------------------------------------------------------- // Clone key // -------------------------------------------------------------------------------- XSECCryptoKey * NSSCryptoKeyRSA::clone() const { NSSCryptoKeyRSA * ret; XSECnew(ret, NSSCryptoKeyRSA(mp_pubkey, mp_privkey)); if (mp_pubkey != 0) { ret->mp_pubkey = SECKEY_CopyPublicKey(mp_pubkey); if (ret->mp_pubkey == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:RSA Error attempting to clone (copy) public key"); } } if (mp_privkey != 0) { ret->mp_privkey = SECKEY_CopyPrivateKey(mp_privkey); if (ret->mp_privkey == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:RSA Error attempting to clone (copy) private key"); } } // Clone modulus if (mp_modulus != 0) { ret->mp_modulus = SECITEM_DupItem(mp_modulus); if (ret->mp_modulus == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:RSA Error attempting to clone (copy) modulus"); } } // Clone exponent if (mp_exponent != 0) { ret->mp_exponent = SECITEM_DupItem(mp_exponent); if (ret->mp_exponent == 0) { throw XSECCryptoException(XSECCryptoException::MemoryError, "NSS:RSA Error attempting to clone (copy) exponent"); } } return ret; } // -------------------------------------------------------------------------------- // decrypt a buffer // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::privateDecrypt(const unsigned char * inBuf, unsigned char * plainBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform a decrypt if (mp_privkey == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Attempt to decrypt data with empty key"); } unsigned int decryptSize = inLength; SECStatus s; unsigned char *ptr = NULL; switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : s = PK11_PubDecryptRaw(mp_privkey, plainBuf, (unsigned int*)&decryptSize, maxOutLength, (unsigned char*)inBuf, inLength); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA privateKeyDecrypt - Error Decrypting PKCS1_5 padded RSA encrypt"); } //do the padding (http://www.w3.org/TR/xmlenc-core/#rsa-1_5) ptr = (unsigned char*) memchr(plainBuf, 0x02, decryptSize); if( ptr ) { unsigned int bytesToRemove = ((ptr-plainBuf)+1); memmove(plainBuf, ptr+1, decryptSize-bytesToRemove); decryptSize -= bytesToRemove; } ptr = (unsigned char*) memchr(plainBuf, 0x00, decryptSize); if( ptr ) { unsigned int bytesToRemove = ((ptr-plainBuf)+1); memmove(plainBuf, ptr+1, decryptSize-bytesToRemove); decryptSize -= bytesToRemove; } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - OAEP padding method not supported in NSS yet"); break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Unknown padding method"); } return decryptSize; } // -------------------------------------------------------------------------------- // Encrypt a buffer // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::publicEncrypt(const unsigned char * inBuf, unsigned char * cipherBuf, unsigned int inLength, unsigned int maxOutLength, PaddingType padding, hashMethod hm) { // Perform an encrypt if (mp_pubkey == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Attempt to encrypt data with empty key"); } unsigned int encryptSize = SECKEY_PublicKeyStrength(mp_pubkey); if (maxOutLength < encryptSize) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Too small buffer for encrypted buffer output"); } SECStatus s; unsigned char * buf; XSECnew(buf, unsigned char[encryptSize]); ArrayJanitor j_buf(buf); switch (padding) { case XSECCryptoKeyRSA::PAD_PKCS_1_5 : // do the padding (http://www.w3.org/TR/xmlenc-core/#rsa-1_5) { // generate random data for padding SECStatus s = PK11_GenerateRandom(buf, encryptSize); if (s != SECSuccess) { throw XSECException(XSECException::InternalError, "NSSCryptoKeyRSA() - Error generating Random data"); } // first byte have to be 0x02 buf[0] = 0x00; buf[1] = 0x02; // check that there are no 0x00 bytes among random data for (unsigned int i = 2; i < encryptSize - inLength - 1; i++) { while (buf[i] == 0x00) { // replace all 0x00 occurences in random data with random value PK11_GenerateRandom(&buf[i], 1); } } // before key add 0x00 byte buf[encryptSize - inLength - 1] = 0x00; // at the end of input buffer (to be encrypted) add key memcpy(&buf[encryptSize - inLength], inBuf, inLength); } // encrypt s = PK11_PubEncryptRaw(mp_pubkey, cipherBuf, (unsigned char*)buf, encryptSize, NULL); if (s != SECSuccess) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA publicKeyEncrypt - Error performing encrypt"); } break; case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 : throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - OAEP padding method not supported in NSS yet"); break; default : throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Unknown padding method"); } return encryptSize; } // -------------------------------------------------------------------------------- // Get key size in bytes // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::getLength(void) const { unsigned int ret = 0; if (mp_pubkey != 0) { ret = SECKEY_PublicKeyStrength(mp_pubkey); } else if (mp_privkey != 0) { ret = PK11_GetPrivateModulusLen(mp_privkey); } return ret; } // -------------------------------------------------------------------------------- // Load parameters from key (utility function) // -------------------------------------------------------------------------------- void NSSCryptoKeyRSA::loadParamsFromKey(void) { if (mp_pubkey == 0) return; mp_modulus = SECITEM_DupItem(&(mp_pubkey->u.rsa.modulus)); if (mp_modulus == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error during extracting modulus from public key"); } mp_exponent = SECITEM_DupItem(&(mp_pubkey->u.rsa.publicExponent)); if (mp_exponent == 0) { throw XSECCryptoException(XSECCryptoException::RSAError, "NSS:RSA - Error during extracting exponent from public key"); } } // -------------------------------------------------------------------------------- // Get exponent // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::getExponentBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_exponent == 0) { return 0; // Nothing we can do } if (mp_exponent == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_exponent, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } // -------------------------------------------------------------------------------- // Get modulus // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyRSA::getModulusBase64BigNums(char * b64, unsigned int len) { if (mp_pubkey == 0 && mp_modulus == 0) { return 0; // Nothing we can do } if (mp_modulus == NULL) { loadParamsFromKey(); } unsigned int bLen = 0; unsigned char * b = NSSCryptoProvider::SI2b64(mp_modulus, bLen); if (bLen > len) bLen = len; memcpy(b64, b, bLen); delete[] b; return bLen; } #endif /* XSEC_HAVE_NSS */ xml-security-c-1.7.3/xsec/enc/NSS/NSSCryptoKeyHMAC.cpp000644 001751 001751 00000004514 12003301053 023410 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * NSSCryptoKeyHMAC := HMAC Keys * * Author(s): Milan Tomic * */ #include #include #include #if defined (XSEC_HAVE_NSS) // -------------------------------------------------------------------------------- // Constructor // -------------------------------------------------------------------------------- NSSCryptoKeyHMAC::NSSCryptoKeyHMAC() :m_keyBuf("") { m_keyBuf.isSensitive(); m_keyLen = 0; }; // -------------------------------------------------------------------------------- // Set key // -------------------------------------------------------------------------------- void NSSCryptoKeyHMAC::setKey(unsigned char * inBuf, unsigned int inLength) { m_keyBuf.sbMemcpyIn(inBuf, inLength); m_keyLen = inLength; } // -------------------------------------------------------------------------------- // Get key // -------------------------------------------------------------------------------- unsigned int NSSCryptoKeyHMAC::getKey(safeBuffer &outBuf) const { outBuf = m_keyBuf; return m_keyLen; } // -------------------------------------------------------------------------------- // Replicate key // -------------------------------------------------------------------------------- XSECCryptoKey * NSSCryptoKeyHMAC::clone() const { NSSCryptoKeyHMAC * ret; XSECnew(ret, NSSCryptoKeyHMAC()); ret->m_keyBuf = m_keyBuf; ret->m_keyLen = m_keyLen; return ret; } #endif /* XSEC_HAVE_NSS */xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoSPKIData.hpp000644 001751 001751 00000010436 12003301053 023461 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoSPKIData := SPKI Information * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoSPKIData.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOSPKIDATA_INCLUDE #define DSIGKEYINFOSPKIDATA_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); #include /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding information on a SPKIData node as well as setting * such a node in a signature. * */ class DSIG_EXPORT DSIGKeyInfoSPKIData : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by interface objects to load * an existing DOM structure into the Name element. * * @param env Environment KeyInfo is operating in * @param nameNode DOMNode to load information from */ DSIGKeyInfoSPKIData(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *nameNode); /** * \brief Constructor used when XML needs to be created. * * This constructor is used by interface objects to * create a DSIGKeyInfoSPKIData object that can then be used * to create the required XML. * * @param env Operating environment */ DSIGKeyInfoSPKIData(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoSPKIData(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ void load(void); /** * \brief Get the number of S-expressions * * Returns the number of S-expressions held for this SPKIData element * * @returns The number of S-expressions */ unsigned int getSexpSize(void) const; /** * \brief returns the indicated SExpression * * Returns a pointer to a XMLCh buffer holding the required SExpression. * * @param index The number of the SExpression to return * @returns A pointer to the char buffer containing the base64 encoded * S-expression */ virtual const XMLCh * getSexp(unsigned int index) const; /** * \brief Get key name - unimplemented for SPKI packets */ virtual const XMLCh * getKeyName(void) const {return NULL;} //@} /**@name Create and set functions */ //@{ /** * \brief Create a new SPKIData element in the document. * * Creates a new SPKIData element and sets the first S-expression * with the string passed in. * * @param Sexp Value (base64 encoded string) to set the first S-expression * @returns The newly created DOMElement with the structure underneath. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankSPKIData(const XMLCh * Sexp); /** * \brief Append a new SPKISexp element to the SPKIData nodes * * Append a new SPKISexp element to the list of S-expressions that * already exists. * * @param Sexp Value (base64 encoded string) to set the new S-expression */ void appendSexp(const XMLCh * Sexp); //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_SPKIDATA;} //@} private: DSIGKeyInfoSPKIData(); // Non-implemented constructor struct SexpNode { const XMLCh * mp_expr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_exprTextNode; }; typedef std::vector sexpVectorType; sexpVectorType m_sexpList; }; #endif /* #define DSIGKEYSPKIDATA_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGXPathHere.hpp000644 001751 001751 00000006343 12003301053 022466 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGXPathHere := Implementation of the "here()" XPath function. * * $Id: DSIGXPathHere.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGXPATHHERE_INCLUDE #define DSIGXPATHHERE_INCLUDE #include #include #ifndef XSEC_NO_XALAN #if defined(_MSC_VER) # pragma warning(disable: 4267) #endif #include #include #include #include #include #include #include #include #include #include #if defined(_MSC_VER) # pragma warning(default: 4267) #endif // Namespace usage XALAN_USING_XALAN(Function); XALAN_USING_XALAN(XalanNode); XALAN_USING_XALAN(XPathExecutionContext); XALAN_USING_XALAN(XalanDOMString); XALAN_USING_XALAN(XObjectPtr); //XALAN_USING_XALAN(StaticStringToDOMString); #if defined XSEC_XALAN_REQS_MEMORYMANAGER // Xalan 1.9 and above XALAN_USING_XALAN(MemoryManagerType); #endif XSEC_USING_XERCES(Locator); #endif #ifndef XSEC_NO_XPATH // If there is no XPath then let's not even bother with this class. class DSIGXPathHere : public Function { private: XalanNode * XalanHereNode; public: typedef Function ParentType; DSIGXPathHere(); DSIGXPathHere(XalanNode *here); virtual ~DSIGXPathHere(); // These methods are inherited from Function ... virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, //const XObjectPtr arg1, const LocatorType* locator) const; #if !defined(XALAN_NO_USING_DECLARATION) using ParentType::execute; #endif #if defined(XSEC_NO_COVARIANT_RETURN_TYPE) virtual Function* #else virtual DSIGXPathHere* #endif #if defined (XSEC_XALAN_REQS_MEMORYMANAGER) clone(MemoryManagerType& theManager) const; #else clone() const; #endif protected: const XalanDOMString #if defined (XSEC_XALAN_REQS_MEMORYMANAGER) // We cheat - the memory manager happened at the same time as the string &getError(XalanDOMString& theBuffer) const; #else getError() const; #endif private: // Not implemented... DSIGXPathHere& operator=(const DSIGXPathHere&); bool operator==(const DSIGXPathHere&) const; }; #endif #endif xml-security-c-1.7.3/xsec/dsig/DSIGAlgorithmHandlerDefault.hpp000644 001751 001751 00000005425 12003301053 025367 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGAlgorithmHandlerDefault := Interface class to define handling of * default signature algorithms * * $Id: DSIGAlgorithmHandlerDefault.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGALGHANDLERDEFAULT_INCLUDE #define DSIGALGHANDLERDEFAULT_INCLUDE // XSEC Includes #include #include class TXFMChain; class XENCEncryptionMethod; class XSECCryptoKey; // Xerces class DSIGAlgorithmHandlerDefault : public XSECAlgorithmHandler { public: virtual ~DSIGAlgorithmHandlerDefault() {}; virtual XSECAlgorithmHandler * clone(void) const; // Signature ops virtual bool appendSignatureHashTxfm( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key ); virtual unsigned int signToSafeBuffer( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key, unsigned int outputLength, safeBuffer & result ); virtual bool verifyBase64Signature( TXFMChain * inputBytes, const XMLCh * URI, const char * sig, unsigned int outputLength, XSECCryptoKey * key ); virtual bool appendHashTxfm( TXFMChain * inputBytes, const XMLCh * URI ); // Unsupported Encryption Operations virtual unsigned int decryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ); virtual bool appendDecryptCipherTXFM( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc ); virtual bool encryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ); virtual XSECCryptoKey * createKeyForURI( const XMLCh * uri, const unsigned char * keyBuffer, unsigned int keyLen ); private: }; /*\@}*/ #endif /* DSIGALGHANDLERDEFAULT_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGXPathFilterExpr.hpp000644 001751 001751 00000011141 12003301053 023657 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGXPathFilterExpr := Class that holds an XPath Filter expression * * $Id: DSIGXPathFilterExpr.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGXPATHFILTEREXPR_INCLUDE #define DSIGXPATHFILTEREXPR_INCLUDE #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMNamedNodeMap); XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMElement); class XSECEnv; /** * @ingroup pubsig */ /** * @brief Class used to hold (and manipulate) individual expressions * in an XPathFilter transform * * @see TXFMXPathFilter * @see DSIGTransformXpathFilter * */ class DSIG_EXPORT DSIGXPathFilterExpr { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used for existing XML signatures * * Node already exists and is part of an existing XPathFilter tree * * @param env The operating environment * @param node The node that will be used to read the expression in */ DSIGXPathFilterExpr(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Builder constructor * * Used to create the DOM structure and DSIGSignature elements * * @param env The operating Environment */ DSIGXPathFilterExpr(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ ~DSIGXPathFilterExpr(); //@} /** @name Set and get Information */ //@{ /** * \brief Read in existing structure * * Reads DOM structure of the XPath expression */ void load(void); /** * \brief Get the filter type * * Returns the type of this particular XPath filter * * @returns The filter type of this expression */ xpathFilterType getFilterType(void); /** * \brief create from blank * * Given the filter type and XPath expression, setup the * DOMNodes and variables to allow signing and validation * * @param filterType Type of this filter to add * @param filterExpr The XPath expression */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * setFilter(xpathFilterType filterType, const XMLCh * filterExpr); /** * \brief Get the filter expression * * Returns an XMLCh string containing the filter expression * * @returns The filter expression */ const XMLCh * getFilter(void) {return m_expr.rawXMLChBuffer();} /** * \brief Add a new namespace to the list to be used * * Add a new namespace to the XPath Element. * * @param prefix NCName of the Namespace to set * @param value The string with the URI to set */ void setNamespace(const XMLCh * prefix, const XMLCh * value); /** * \brief Get the list of namespaces. * * Returns the DOMNamedNodeMap of the attributes of the XPath transform * node. * * @note This will also contain the Filter attribute * * @returns A pointer to the NamedNodeMap */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap * getNamespaces(void) { return mp_NSMap; } /** * \brief Delete a namespace to the list to be used * * Delete a namespace from the XPath Element. * * @param prefix NCName of the Namespace to delete * @throws XSECException if the NCName does not exist * */ void deleteNamespace(const XMLCh * prefix); //@} private: // Just let the TXFM read directly friend class TXFMXPathFilter; DSIGXPathFilterExpr(); DSIGXPathFilterExpr(const DSIGXPathFilterExpr& theOther); const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_xpathFilterNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_exprTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap * mp_NSMap; safeBuffer m_expr; xpathFilterType m_filterType; bool m_loaded; }; #endif /* DSIGXPATHFILTEREXPR_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoX509.hpp000644 001751 001751 00000027125 12003301053 022571 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoX509 := A "Super" key that defines a certificate with a sub-key that defines * the signing key * * $Id: DSIGKeyInfoX509.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOX509_INCLUDE #define DSIGKEYINFOX509_INCLUDE #include #include #include #include XSEC_USING_XERCES(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding information on a X509Data node as well as setting * such a node in a signature. * */ class DSIG_EXPORT DSIGKeyInfoX509 : public DSIGKeyInfo { public: struct X509Holder { const XMLCh * mp_encodedX509; // Base64 encoding XSECCryptoX509 * mp_cryptoX509; // The certificate }; #if defined(XSEC_NO_NAMESPACES) typedef vector X509ListType; typedef vector X509CRLListType; #else typedef std::vector X509ListType; typedef std::vector X509CRLListType; #endif #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML structures exist. * * Constructor called by interface class when loading an * X509Data element from DOM nodes. * * @param env Operating environment * @param X509Data DOMNode at start of data */ DSIGKeyInfoX509(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *X509Data); /** * \brief Constructor called when building XML structures * * Constructor called by interface class when an XML * structure is being built by a user calling the API * * @param env Operating environment */ DSIGKeyInfoX509(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoX509(); //@} /** @name Load function and get methods */ //@{ /** * \brief Function called to load an XML structure * * Function called by intercace class to load an X509Data structure * from DOMNodes. */ virtual void load(); /** * \brief Get the name of the certificate * * Get the name stored in the X509SubjectName element (if it * exists). * * @returns A pointer to a buffer containing the name * (NULL if not set.) */ const XMLCh * getX509SubjectName(void) const; /** * \brief Get the name of the certificate (interface function) * * Get the name stored in the X509SubjectName element (if it * exists). * * @returns A pointer to the buffer containing the name (or NULL if not set). * The decoded string is returned. * @see setX509SubjectName(void) */ const XMLCh * getKeyName(void) const; /** * \brief Get the X509Digest Algorithm * * Get the Algorithm for the X509Digest. * * @returns A pointer to the buffer containing the algorithm * (0 if not set.) */ const XMLCh* getX509DigestAlgorithm(void) const; /** * \brief Get the X509Digest value * * Get the value for the X509Digest. * * @returns A pointer to the buffer containing the digest * (0 if not set.) */ const XMLCh* getX509DigestValue(void) const; /** * \brief Get the IssuerSerialName * * Get the name of the Issuer (stored in the X509IssuerSerial element). * * @returns A pointer to the buffer containing the issuer name. * (0 if not set.) */ const XMLCh * getX509IssuerName(void) const; /** * \brief Get the IsserSerialNumber * * Get the serial number of the certificate of the issuer of the * signing certificate. * * @returns A pointer to the string containing the IssuerSerialNumber. * (0 if not set.) This is the decoded string. * @see setX509IssuerSerial */ const XMLCh * getX509IssuerSerialNumber(void) const; /** * \brief Get the first associated CRL * * Return the string containing the base64 encoded CRL that was held in * the first X509CRL node * * @returns A pointer to the string containing the CRL * (0 if not set) */ const XMLCh * getX509CRL(void) const; /** * \brief Find the number of CRLs held * * Find the number of CRLs held in the X509Data structures. * * @returns The number of CRLs */ int getX509CRLListSize(void) const; /** * \brief Get the DER encoded CRL pointed to in the list. * * Use the index to find the required CRL and return a pointer * to the buffer containing the encoded CRL. * * @returns A pointer to the buffer containing the CRL or 0 if * no CRL exists at that point in the list. */ const XMLCh * getX509CRLItem(int item) const; /** * \brief Get the SKI value (if set) * * The SKI (Subject Key Identifier) can be used to reference a * required certificate. If this was set in the KeyInfo element, * this function will return the value * * @returns the base64 encoded (plan - not DER) encoded SKI value */ const XMLCh * getX509SKI(void) const; /** * \brief Return the raw Retrieval method to find this certificate * * In some cases, the KeyInfo RetrievalMethod references a raw certificate * In such cases, the library simply creates a KeyInfoX509 object and sets * this string to allow others to find the certificate */ const XMLCh * getRawRetrievalURI(void) const; /** * \brief Find the number of certificates held * * Find the number of certificates held in the X509Data structures. * * @returns The number of certificates */ int getCertificateListSize(void) const; /** * \brief Get the DER encoded certificate pointed to in the list. * * Use the index to find the required certificate and return a pointer * to the buffer containing the encoded certificate. * * @returns A pointer to the buffer containing the certificate or 0 if * no certificate exists at that point in the list. */ const XMLCh * getCertificateItem(int item) const; /** * \brief Get the Crypto Interface X509 structure version of the certificate * * Use the index to find the required certificate and return a pointer * to the XSECCryptoX509 cert * * @returns A pointer to the XSECCryptoX509 cert structure */ XSECCryptoX509 * getCertificateCryptoItem(int item); /** * \brief Get the Crypto Interface X509 structure version of the certificate * * Use the index to find the required certificate and return a pointer * to the XSECCryptoX509 cert * * @returns A pointer to the XSECCryptoX509 cert structure */ const XSECCryptoX509 * getCertificateCryptoItem(int item) const; /** * \brief Interface function to find the type of this KeyInfo */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_X509;} //@} /** @name Create and Set functions */ //@{ /** * \brief Create a new X509 data element. * * Create a blank (empty) X509Data element that can then be used * by the application to add X509Data elements. * * @returns A pointer to the new X509Data element. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankX509Data(void); /** * \brief Set the X509SubjectName element in the KeyInfo element. * * If a X509SubjectName element exists, replace the text with the * provided text. Otherwise create the element and set the text. * * @note XMLDSIG requires Distinguished Names be encoded in a defined * manner (escaping '<' characters etc.). This method will perform * this encoding prior to creating the DOM nodes. * * @param name The name to set. */ void setX509SubjectName(const XMLCh * name); /** * \brief Set the IssuerSerial element * * If an X509IssuerSerial exists, replace the values with those provided, * otherwise create a new element and set the values appropriately. * * @note XMLDSIG requires Distinguished Names be encoded in a defined * manner (escaping '<' characters etc.). This method will perform * this encoding prior to creating the DOM nodes. * * @param name The name of the issuer. * @param serial The serial number of the issuer's certificate */ void setX509IssuerSerial(const XMLCh * name, const XMLCh * serial); /** * \brief Set the dsig11:X509Digest element * * If a dsig11:X509Digest exists, replace the values with those provided, * otherwise create a new element and set the values appropriately. * * @param algorithm The algorithm type * @param value The digest value */ void setX509Digest(const XMLCh * algorithm, const XMLCh * value); /** * \brief Add a CRL. * * Append an X509CRL element to the list of CRLs * stored at the end of this KeyInfo element. * * @param crl A pointer to the base64 encoded CRL, * exactly as it will appear in the XML structure. */ void setX509CRL(const XMLCh * crl); /** * \brief Add a CRL. * * Append an X509CRL element to the list of CRLs * stored at the end of this KeyInfo element. * * @param crl A pointer to the base64 encoded CRL, * exactly as it will appear in the XML structure. */ void appendX509CRL(const XMLCh * crl); /** * \brief Set the SKI element * * The SKI node provides a reference to the Subject Key Identifier of * a certificate. * * This function takes a base64 encoded ski and sets it into the * appropriate node * * @param ski The base64 plain (non-DER) encoded SKI value */ void setX509SKI(const XMLCh * ski); /** * \brief set the retrieval URI * * Generally to be used by internal library processes only. * This sets the retrieval URI - but does _not_ manipulate the DOM * in any way. * * @param uri The URI string to use */ void setRawRetrievalURI(const XMLCh * uri); /** * \brief Add a certificate. * * Append an X509Certificate element to the list of certificates * stored at the end of this KeyInfo element. * * @param base64Certificate A pointer to the base64 encoded certificate, * exactly as it will appear in the XML structure. */ void appendX509Certificate(const XMLCh * base64Certificate); //@} private: DSIGKeyInfoX509(); X509ListType m_X509List; // The X509 structures X509CRLListType m_X509CRLList; // The X509CRL list XMLCh * mp_X509IssuerName; // Parameters from KeyInfo (not cert) const XMLCh * mp_X509SerialNumber; XMLCh * mp_X509SubjectName; const XMLCh * mp_X509SKI; XMLCh * mp_rawRetrievalURI; // Text nodes holding information XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_X509SubjectNameTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_X509IssuerNameTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_X509SerialNumberTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_X509SKITextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_X509DigestTextNode; }; #endif /* #define DSIGKEYX509_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoList.hpp000644 001751 001751 00000021756 12003301053 023043 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoList := Class for Loading and storing a list of KeyInfo elements * * $Id: DSIGKeyInfoList.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOLIST_INCLUDE #define DSIGKEYINFOLIST_INCLUDE // XSEC Includes #include #include #include #include // Xerces #include // General includes #include // Forward definitions class DSIGKeyInfoValue; class DSIGKeyInfoDEREncoded; class DSIGKeyInfoX509; class DSIGKeyInfoName; class DSIGKeyInfoPGPData; class DSIGKeyInfoSPKIData; class DSIGKeyInfoMgmtData; class DSIGSignature; /** * @ingroup pubsig */ /** * \brief Container class for KeyInfo elements. * * The library stores KeyInfo lists using this class. */ class DSIG_EXPORT DSIGKeyInfoList { public: #if defined(XSEC_NO_NAMESPACES) typedef vector KeyInfoListVectorType; #else typedef std::vector KeyInfoListVectorType; #endif #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif /** @name Constructors and Destructors */ //@{ /** * \brief Main constructor * * Main constructor called by DSIGSignature * * @note Should only ever be created by a Signature or Cipher class. * * @param env The environment the KeyInfo is operating within */ DSIGKeyInfoList(const XSECEnv * env); /** * \brief Destructor */ ~DSIGKeyInfoList(); //@} /** @name Public (API) functions */ //@{ /** * \brief Get size of list * * @returns the number of elements in the list */ size_t getSize() const; /* * \brief Get an item * * Returns the item at index point in the list * * @note This is an internal function and should not be called directly * * @param index Pointer into the list * @returns The indicated element or 0 if it does not exist. */ DSIGKeyInfo * item(size_type index); /* * \brief Get an item * * Returns the item at index point in the list * * @note This is an internal function and should not be called directly * * @param index Pointer into the list * @returns The indicated element or 0 if it does not exist. */ const DSIGKeyInfo * item(size_type index) const; //@} /** @name Manipulate the List */ //@{ /** * \brief Add an already created KeyInfo * * Adds a KeyInfo element that has already been built * into the list. * * @note This method does not insert the KeyInfo into the DOM * structure - it assumes it is already there and just adds to the list. * @param ref The KeyInfo to add */ void addKeyInfo(DSIGKeyInfo * ref); /** * \brief Add an already created KeyInfo * * Adds a KeyInfo element that has already been built * into the list. * * @note This method finds the DOM node of the KeyInfo and inserts it * into the list in the DOM. * @param ref The KeyInfo to add */ void addAndInsertKeyInfo(DSIGKeyInfo * ref); /** * \brief Read from DOM and create. * * Uses a DOMNode pointing to the start of the KeyInfo element * to build a new KeyInfo and then add it to the list * * @note This is an internal function and should not be called directly * * @param ki Head of DOM structure with the KeyInfo * @returns true if successfully loaded */ bool addXMLKeyInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *ki); /** * \brief Read full list from DOM * * Will take the starting node of a KeyInfo list and read into the * list structure. This is a bit different from other "load" * functions, in that it takes a node as a parameter. * * @note This is an internal functions and should not be called directly * * @param node The \ element node to read from */ bool loadListFromXML(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /* * \brief Remove a KeyInfo from the list * * Removes the KeyInfo element at the indicated index point in the list * * @param index Pointer in the list to remove element from * @returns The removed KeyInfo element */ DSIGKeyInfo * removeKeyInfo(size_type index); /** * \brief Set the overarching environment * * Sets the environment this list is operating within * * @param env Operating environment */ void setEnvironment(const XSECEnv * env) {mp_env = env;} /** * \brief Clear out the list * * Removes all elements from the list * * @note Deletes the items themselves as well as clearing the list. */ void empty(); /** * \brief Is the list empty? * * @returns true Iff there are no elements in the list */ bool isEmpty() const; //@} /** @name Create new KeyInfo elements */ //@{ /** * \brief Create basic KeyInfo element. * * Creates the basic KeyInfo node that can then be used to * embed specific KeyInfo types */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createKeyInfo(void); /** * \brief Append a DSA KeyValue element * * Add a new KeyInfo element for a DSA Value * * @param P Base64 encoded value of P * @param Q Base64 encoded value of Q * @param G Base64 encoded value of G * @param Y Base64 encoded value of Y * @returns A pointer to the created object. */ DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y); /** * \brief Append a RSA KeyValue element * * Add a new KeyInfo element for a RSA Value * * @param modulus Base64 encoded value of the modulus * @param exponent Base64 encoded value of exponent * @returns A pointer to the created object. */ DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent); /** * \brief Append an EC KeyValue element * * Add a new KeyInfo element for an EC Value * * @param curveName URI (generally urn:oid:...) that identifies the curve * @param keyValue Base64 encoded public key * @returns A pointer to the created object. */ DSIGKeyInfoValue * appendECKeyValue(const XMLCh * curveName, const XMLCh * keyValue); /** * \brief Append a X509Data element. * * Add a new KeyInfo element for X509 data. * * @note The added element is empty. The caller must make use of the * returned object to set the required values. * * @returns A pointer to the created object. */ DSIGKeyInfoX509 * appendX509Data(void); /** * \brief Append a KeyName element. * * Add a new KeyInfo element for a key name. * * @param name The name of the key to set in the XML * @param isDName Treat the name as a Distinguished name and encode accordingly * @returns A pointer to the created object */ DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false); /** * \brief Append a PGPData element. * * Add a new KeyInfo element for a PGP key. * * @param id The ID of the key to set in the XML (base64 encoded - NULL if none) * @param packet The Packet information to set in the XML (base64 encoded - * NULL if none) * @returns A pointer to the created object */ DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet); /** * \brief Append a SPKIData element * * Add a new KeyInfo element for a set of SPKI S-expressions * * @param sexp The initial S-expression to set in the SPKIData element * @returns A pointer to the created object */ DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp); /** * \brief Append a MgmtData element * * Add a new KeyInfo element for Management Data * * @param data The string to set in the MgmtData element * @returns A pointer to the created object */ DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data); /** * \brief Append a DEREncodedKeyValue element * * Add a new KeyInfo element for a DEREncodedKeyValue * * @param data The data to set in the DEREncodedKeyValue element * @returns A pointer to the created object */ DSIGKeyInfoDEREncoded * appendDEREncoded(const XMLCh * data); //@} private: DSIGKeyInfoList(); KeyInfoListVectorType m_keyInfoList; const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyInfoNode; // KeyInfoListVectorType::iterator m_iterator; }; #endif /* DSIGKEYINFOLIST_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoValue.hpp000644 001751 001751 00000020036 12003301053 023172 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoValue := A value setting * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoValue.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOVALUE_INCLUDE #define DSIGKEYINFOVALUE_INCLUDE #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding information on a KeyValue node as well as setting * such a node in a signature. * * Two types of Value are understood - RSA and DSA. * * RSA values are fully implemented as per XML-DSig. They have two parameters * *
    *
  • Modulus - holds the modulus of this public key; and
  • *
  • Exponent - holds the exponent.
  • *
* * DSA values have all mandatory parts implemented - P, Q, G and Y. * * J, Seed and PgenCounter are not currently implemented. */ class DSIG_EXPORT DSIGKeyInfoValue : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor for an existing KeyInfo * * * Constructor used when loading a KeyValue node that already exists * in an XML document. * * @param env Operating environment * @param valueNode DOMNode at head of XML structure */ DSIGKeyInfoValue( const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *valueNode ); /** * \brief Constructor for creating from scratch * * Constructor used when creating a new KeyValue node to append * to a signature structure. * * @param env Operating environment */ DSIGKeyInfoValue(const XSECEnv * env); virtual ~DSIGKeyInfoValue(); //@} /** @name Loading and Get functions */ //@{ /** * \brief Load an existing XML structure * * Called by the Signature class when it is reading in * a DOM structure */ virtual void load(void); /** * \brief Get P value * * @returns a pointer to the DSA P string value. */ const XMLCh * getDSAP(void) const {return mp_PTextNode->getNodeValue();} /** * \brief Get Q value * * @returns a pointer to the DSA Q string value. */ const XMLCh * getDSAQ(void) const {return mp_QTextNode->getNodeValue();} /** * \brief Get G value * * @returns a pointer to the DSA G string value. */ const XMLCh * getDSAG(void) const {return mp_GTextNode->getNodeValue();} /** * \brief Get Y value * * @returns a pointer to the DSA Y string value. */ const XMLCh * getDSAY(void) const {return mp_YTextNode->getNodeValue();} /** * \brief Get Modulus * * @returns A pointer to the RSA Modulus */ const XMLCh * getRSAModulus(void) const; /** * \brief Get Exponent * * @returns A pointer to the buffer containing the RSA Modulus string */ const XMLCh * getRSAExponent(void) const; /** * \brief Get NamedCurve URI * * @returns A pointer to the EC NamedCurve URI */ const XMLCh * getECNamedCurve(void) const; /** * \brief Get EC Public Key * * @returns A pointer to the buffer containing the EC public key */ const XMLCh * getECPublicKey(void) const; //@} /** @name DSA Create and set functions */ //@{ /** * \brief Create a blank KeyValue (and DOM structure) * * Create a blank KeyValue structure with the passed parameters * and create the required DOM structure as well. * * @param P The P value (base64 encoded in unicode format) * @param Q The Q value (base64 encoded in unicode format) * @param G The G value (base64 encoded in unicode format) * @param Y The Y value (base64 encoded in unicode format) * @returns the DOMElement at the head of the DOM structure */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y ); /** * \brief Set P value. * * Take the provided string and use it to set the P parameter * in the KeyValue */ void setDSAP(const XMLCh * P); /** * \brief Set Q value. * * Take the provided string and use it to set the Q parameter * in the KeyValue */ void setDSAQ(const XMLCh * Q); /** * \brief Set G value. * * Take the provided string and use it to set the G parameter * in the KeyValue */ void setDSAG(const XMLCh * G); /** * \brief Set Y value. * * Take the provided string and use it to set the Y parameter * in the KeyValue */ void setDSAY(const XMLCh * Y); //@} /** @name RSA Create and Set functions */ //@{ /** * \brief Create a blank RSA KeyValue * * Create a new RSAKeyValue object and associated DOM structures. * * @param modulus Base64 encoded value of Modulus to set * @param exponent Base64 encoded value of the Exponent to set * @returns The DOM structure of the RSAKeyValue that has been created */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent); /** * \brief Set the Modulus * * Set the base64 encoded string of the Modulus value within the element. * * @param modulus Base64 encoded value to set */ void setRSAModulus(const XMLCh * modulus); /** * \brief Set the exponent * * Set the base64 encoded string of the exponent value within the element * * @param exponent Base64 encoded value to set */ void setRSAExponent(const XMLCh * exponent); //@} /** @name EC Create and Set functions */ //@{ /** * \brief Create a blank EC KeyValue * * Create a new ECKeyValue object and associated DOM structures. * * @param curveName URI of NamedCurve to set * @param publicKey Base64 encoded key value to set * @returns The DOM structure of the ECKeyValue that has been created */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankECKeyValue(const XMLCh * curveName, const XMLCh * publicKey); /** * \brief Set the NamedCurve URI * * Set the URI of the NamedCurve within the element. * * @param curveName URI of NamedCurve to set */ void setECNamedCurve(const XMLCh * curveName); /** * \brief Set the public key * * Set the base64 encoded public key * * @param publicKey Base64 encoded public key to set */ void setECPublicKey(const XMLCh * publicKey); //@} /** @name Information Functions */ //@{ /** * \brief Interface call to return type * * @returns the type of this keyInfo node */ virtual keyInfoType getKeyInfoType(void) const; /** * \brief Get the name of this key (irrelevant for a KeyValue) * * @returns NULL */ virtual const XMLCh * getKeyName(void) const; //@} private: // Structures to hold ALL the required information // Not the most efficient of methods, but simple. // DSA XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_PTextNode; // Nodes where strings are stored XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_QTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_GTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_YTextNode; // RSA XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_modulusTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_exponentTextNode; // EC XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_namedCurveElementNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_ecPublicKeyTextNode; // General keyInfoType m_keyInfoType; }; #endif /* #define DSIGKEYVALUE_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoDEREncoded.hpp000644 001751 001751 00000007772 12003301053 024026 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoDEREncoded := DEREncodedKeyValue - used for conveying DER-encoded keys * * Author(s): Scott Cantor * * $Id:$ * */ #ifndef DSIGKEYINFODERENCODED_INCLUDE #define DSIGKEYINFODERENCODED_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding DER-encoded key information. * */ class DSIG_EXPORT DSIGKeyInfoDEREncoded : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by other user interface classes to load * an existing DOM structure into the Name element. * * @param env Environment operating within. * @param nameNode DOMNode to load information from */ DSIGKeyInfoDEREncoded(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *nameNode); /** * \brief Constructor used when XML needs to be created. * * This constructor is used by interface objects to * create a DSIGKeyInfoName object that can then be used * to create the required XML. * * @param env Operating environment */ DSIGKeyInfoDEREncoded(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoDEREncoded(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ virtual void load(void); /** * \brief Get key name - unimplemented for DEREncodedKeyValue */ virtual const XMLCh * getKeyName(void) const {return NULL;} /** * \brief Get the key data * * Returns a pointer to the buffer containing the data string. * * @returns A pointer to the XMLCh buffer containing the data */ virtual const XMLCh * getData(void) const {return mp_data;}; //@} /**@name Create and set functions */ //@{ /** * \brief Create a new DEREncodedKeyValue element in the current document. * * Creates a new DEREncodedKeyValue element and sets the data with the string * passed in. * * @param data Value to set the DEREncodedKeyValue to * @returns The newly created DOMElement with the structure underneath. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankDEREncoded(const XMLCh * data); /** * \brief Set the value of the DEREncodedKeyValue to a new string. * * Uses the passed in string to set a new value in the DOM structure. * * @param data Value to set in DEREncodedKeyValue */ void setData(const XMLCh * data); //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_DERENCODED;} //@} private: DSIGKeyInfoDEREncoded(); // Non-implemented constructor const XMLCh * mp_data; // The Data stored in the XML file XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_dataTextNode; // Text node containing the name }; #endif /* #define DSIGKEYINFODERENCODED_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransformC14n.hpp000644 001751 001751 00000013465 12003301053 023242 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformC14n := Class that holds information about C14n transforms * * $Id: DSIGTransformC14n.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include /** * @ingroup pubsig */ /** * @brief Transform holder for C14n based transforms. * * The DSIGTransformC14n class is used to hold C14n \ elements * within a document. This includes Exclusive and Comment options * * * @see TXFMC14n * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformC14n : public DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformC14n(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformC14n(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformC14n(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the Canonicalising transformer element. * * Implemented by each Transform class and used by the DSIGSignature * when consructing a TXFM List that includes canonicalisation (nearly always) */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank Canonicalisation Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure * * @note By default creates a non-comment non-exclusive C14n transform. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * (Re)read the DOM structure into the Signature structures * */ virtual void load(void); //@} /** @name C14n Specific Methods */ //@{ /** * \brief Change canonicalisation method. * * Set the canonicalisation method to the type indicated. If this changes * the transform from Exclusive to Standard C14n, any associated * InclusiveNamespaces children will be removed. * * If this is moving from one form of Exclusive to another, any InclusiveNamespace * children will remain. * * @param method Type of canicaliser required. * * @see canonicalizationMethod */ void setCanonicalizationMethod(canonicalizationMethod method); /** * \brief Get canonicalisation type. * * Return the type of canonicalisation to the caller. * * @returns Canonicalisation type. * @see canonicalizationMethod */ canonicalizationMethod getCanonicalizationMethod(void); /** * \brief Add a namespace prefix to the InclusiveNamespaces list * * Exclusive canonicalisation includes the ability to define a PrefixList of * namespace prefixes that will not be treated exclusively, rather they will * be handled as per normal C14n. * * This function allows a caller to add a prefix to this list * @param ns The prefix to add. */ void addInclusiveNamespace(const char * ns); /** * \brief Set the namespace list * * Deletes current PrefixList (if any) and sets the list to the space * separated list of namespace prefixes provided in ns. * * @note No checking is done on the string passed in. * * @param ns The (space separated) list of prefixes to set. */ void setInclusiveNamespaces(const XMLCh * ns); /** * \brief Get the string containing the inclusive namespaces. * * Get the string containing a list of (space separated) prefixes that will * be handled non-exclusively in an exclusive C14n transform. * * @returns A pointer to the string held in the node (NULL if no namespaces defined). * @note The pointer returned is owned by the Transform structure - do not delete. */ const XMLCh * getPrefixList(void); /** * \brief Delete all inclusive namespaces. * * Deletes the structures (including the DOM nodes) that hold the inclusive * namespaces list. */ void clearInclusiveNamespaces(void); //@} private: DSIGTransformC14n(); DSIGTransformC14n(const DSIGTransformC14n & theOther); void createInclusiveNamespaceNode(void); canonicalizationMethod m_cMethod; // The method XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * mp_inclNSNode; // Node holding the inclusive Namespaces const XMLCh * mp_inclNSStr; // String holding the namespaces }; xml-security-c-1.7.3/xsec/dsig/DSIGTransformXSL.hpp000644 001751 001751 00000007573 12003301053 023206 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXSL := Class that performs XML Stylesheet Language transforms * * $Id: DSIGTransformXSL.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include // Xerces #include /** * @ingroup pubsig */ /** * @brief Transform holder for XSLT Transforms. * * The DSIGTransformXSL class is used to hold XSLT \ elements * within a document. * * * @see TXFMXSL * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformXSL : public DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformXSL(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformXSL(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformXSL(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the XSLT transformer element. * */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank XSLT Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * Find the start of the XSLT transform and load. * */ virtual void load(void); //@} /** @name XSLT Specific Methods */ //@{ /** * \brief Set the DOM tree nodes beneath for the actual Transform * * The caller needs to have already created the DOM tree with the * XSLT embedded. * * @returns The old transform Element node if it existed. * @param stylesheet The new stylesheet to insert into the document * @note Does not delete the old stylesheet if one existed. This is returned * to the caller who is expected to delete it. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * setStylesheet( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * stylesheet ); /** * \brief Get the stylesheet node. * * Obtain the DOMNode at the top of the stylesheet that will be used in this * transform. * * @returns The top stylesheet node */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getStylesheet(void); //@} private: DSIGTransformXSL(); DSIGTransformXSL(const DSIGTransformXSL & theOther); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_stylesheetNode; }; xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfo.hpp000644 001751 001751 00000007752 12003301053 022207 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfo := Base (virtual) class that defines an XSEC KeyInfo node * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfo.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFO_INCLUDE #define DSIGKEYINFO_INCLUDE // XSEC Includes #include #include #include #include class DSIGSignature; class XSECEnv; /** * @ingroup pubsig */ /** * @brief Base class for nodes in a KeyInfo list. * * Digital signatures can have a number of KeyInfo elements that are * used to communicate information about what key to use between the * signer and the validator. * * In the XML-Security-C libary, KeyInfo elements are only used for * holding information about keys. They do not in themselves perform * any cryptographic function. * */ class DSIG_EXPORT DSIGKeyInfo { public: /** * \brief List of potential KeyInfo types * * The keyIntoType enumerated type defines the KeyInfo types known by * the XML-Security-C library. * */ enum keyInfoType { KEYINFO_EXTENSION = 0, // Extension type unknown to library KEYINFO_NOTSET = 1, // Empty key type KEYINFO_X509 = 2, // X.509 Certificate-Related Data KEYINFO_VALUE_DSA = 3, // DSA Key KEYINFO_VALUE_RSA = 4, // RSA Key KEYINFO_NAME = 5, // Name of a key (application dependant) KEYINFO_PGPDATA = 6, // PGP Key KEYINFO_SPKIDATA = 7, // SPKI Key KEYINFO_MGMTDATA = 8, // Management data KEYINFO_ENCRYPTEDKEY = 9, // XML Encryption - Encrypted Key KEYINFO_VALUE_EC = 10, // ECC Key KEYINFO_DERENCODED = 11 // DER-Encoded Key }; public: /** @name Constructors and Destructors */ //@{ /** * \brief Construct from an owning signature * * All KeyInfo types take a constructor that provides the controlling environment. * * @param env The environment that the KeyInfo is operating within */ DSIGKeyInfo(const XSECEnv * env) {mp_keyInfoDOMNode = NULL; mp_env = env;} /** * \brief The Destructor */ virtual ~DSIGKeyInfo() {}; //@} /** @name Get functions */ //@{ /** * \brief Return type * * Can be used to find what type of KeyInfo this is */ virtual keyInfoType getKeyInfoType(void) const = 0; /** * \brief Return the DOMNode that heads up this KeyInfo child */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getKeyInfoDOMNode() {return mp_keyInfoDOMNode;} /** * \brief Return the name of this key * * For those KeyInfo types that have a keyname, this function should return * it. For certificates, this may be the DN. * * @returns A pointer to a buffer containing the name */ virtual const XMLCh * getKeyName(void) const = 0; //@} /** @name Load and Set */ //@{ /** * \brief Load the DOM structures. * * Used by the library to instruct the object to load information from * the DOM nodes */ virtual void load() = 0; //@} protected: XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyInfoDOMNode; const XSECEnv * mp_env; private: DSIGKeyInfo(); }; #endif /* #define XSECKEYINFO_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoPGPData.hpp000644 001751 001751 00000011372 12003301053 023341 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoPGPData := Contains a key pointer to a PGP key * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoPGPData.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOPGPDATA_INCLUDE #define DSIGKEYINFOPGPDATA_INCLUDE #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding information on a PGP Data node as well as setting * such a node in a signature. * */ class DSIG_EXPORT DSIGKeyInfoPGPData : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by interface objects to load * an existing DOM structure into the PGPData element. * * @param env Environment the KeyInfo is operating within * @param pgpDataNode DOMNode to load information from */ DSIGKeyInfoPGPData(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pgpDataNode); /** * \brief Constructor used when XML needs to be created. * * This constructor is used by interface objects to * create a DSIGKeyInfoPGPData object that can then be used * to create the required XML. * * @param env Operating environment */ DSIGKeyInfoPGPData(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoPGPData(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ virtual void load(void); /** * \brief Get the PGP Key ID held in the structure * * Returns a pointer to the buffer containing the ID of the PGP key. * * @returns A pointer to the char buffer containing the (base 64 encoded) * PGP Key ID */ virtual const XMLCh * getKeyID(void) const {return mp_keyID;} /** * \brief Get the PGP Key Packet * * Returns a pointer to the buffer containing the PGP Key packet. * * @returns A pointer to the XMLCh buffer containing the Key Packet in * base64 encoded format */ virtual const XMLCh * getKeyPacket(void) const {return mp_keyPacket;} /** * \brief Get key name - unimplemented for PGP packets */ virtual const XMLCh * getKeyName(void) const {return NULL;} //@} /**@name Create and set functions */ //@{ /** * \brief Create a new PGPData element in the current document. * * Creates a new PGPData element and sets the KeyPacket and KeyID * with the strings passed in. * * @param id Value to set the KeyID as (NULL if not to be set) * @param packet Value to set the key packet to (NULL if not to be set) * @returns The newly created DOMElement with the structure underneath. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankPGPData(const XMLCh * id, const XMLCh * packet); /** * \brief Set the value of the KeyID to a new string. * * Uses the passed in string to set a new value in the DOM structure. * * @param id The value to set the KeyID to */ void setKeyID(const XMLCh * id); /** * \brief Set the value of the KeyPacket to a new string. * * Uses the passed in string to set a new value in the DOM structure. * * @param packet The value to set the KeyPacket to */ void setKeyPacket(const XMLCh * packet); //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_PGPDATA;} //@} private: DSIGKeyInfoPGPData(); // Non-implemented constructor const XMLCh * mp_keyID; // Key ID (from DOM) const XMLCh * mp_keyPacket; // key Packet (from DOM) XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyIDTextNode; // Text node containing the ID XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyPacketTextNode; // Text node contianing key packet }; #endif /* #define DSIGKEYINFOPGPDATA_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoExt.hpp000644 001751 001751 00000004611 12003301053 022657 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoExt := An extension type for anything unknown to the library * * $Id:$ * */ #ifndef DSIGKEYINFOEXT_INCLUDE #define DSIGKEYINFOEXT_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for extension nodes in a KeyInfo list. * * Class for holding information on an extension node. * */ class DSIG_EXPORT DSIGKeyInfoExt : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by interface classes * an existing DOM structure into the extension element. * * @param env Environment the KeyInfo is operating within * @param extNode DOMNode to load information from */ DSIGKeyInfoExt(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *extNode); /** * \brief Destructor */ virtual ~DSIGKeyInfoExt(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ virtual void load(void); //@} //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_EXTENSION;} //@} virtual const XMLCh * getKeyName(void) const {return NULL;} private: DSIGKeyInfoExt(); // Non-implemented constructor }; #endif /* #define DSIGKEYNAME_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGObject.hpp000644 001751 001751 00000010532 12003301053 022037 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGObject := Defines the container class used by dsig to hold objects * inside a signture * * $Id: DSIGObject.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGOBJECT_INCLUDE #define DSIGOBJECT_INCLUDE // XSEC Includes #include XSEC_DECLARE_XERCES_CLASS(DOMNode); class XSECEnv; /** * @ingroup pubsig */ /** * @brief Base class for \ nodes in a \ element. * * The DSIG spec allows for enveloping signatures, in which the signature holds * the information it is signing. For these types of signatures, the data being * signed can be held in an \ container. * * This class allows callers to and manipulate Object containers. * */ class DSIG_EXPORT DSIGObject { public: /** @name Constructors and Destructors */ //@{ /** * \brief Construct from an owning signature * * Called by the library when an Object needs to be created from an Object * in a DOM tree. * * @param env The environment that the Object is operating within * @param dom The DOM node that will be loaded */ DSIGObject(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *dom); /** * \brief Construct a new object * * Called by the library to create an Object from scratch * * @param env The environment the Object is operating within */ DSIGObject(const XSECEnv * env); /** * \brief Destructor */ ~DSIGObject(); //@} /** @name Library functions */ //@{ /** * \brief Load the object from DOM * * Called by the library to load a constructed object */ void load(void); /** * \brief Create a new Object * * Create a new Object from scratch (will generate the DOM) */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankObject(void); //@} /** @name Get functions */ //@{ /** * \brief Get the Id for this object * * @returns the URI attribute string for this object */ const XMLCh * getId(void); /** * \brief Returns the MimeType string of this object * * @returns a pointer to the buffer containing the Mime Type string */ const XMLCh * getMimeType(void); /** * \brief Returns the Encoding string of this object * * @returns a pointer to the buffer containing the Encoding string */ const XMLCh * getEncoding(void); /** * \brief Returns the Element node for this object * * @returns the Element node at the head of this object */ const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void); //@} /** @name Setter functions */ //@{ /** * \brief Set the Id attribute for this Object * * @param id String to use for the Id attribute */ void setId(const XMLCh * id); /** * \brief Set the Id attribute for this Object * * @param type String to use for the MimeType attribute */ void setMimeType(const XMLCh * type); /** * \brief Set the Encoding attribute for this Object * * @param encoding String to use for the Encoding attribute */ void setEncoding(const XMLCh * encoding); /** * \brief Add a child node to the Object * * This is a "ease of use" function to allow users to add a DOM structure * that has been built previously into the Object element */ void appendChild(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * child); //@} private: const XSECEnv * mp_env; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_objectNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_idAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_mimeTypeAttr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_encodingAttr; }; #endif /* DSIGOBJECT_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransformList.hpp000644 001751 001751 00000006200 12003301053 023435 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformList := List that holds all the transforms in the Signature. * * Author(s): Berin Lautenbach * * $Id: DSIGTransformList.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGTRANSFORMLIST_INCLUDE #define DSIGTRANSFORMLIST_INCLUDE // XSEC Includes #include // General includes #include class DSIGTransform; /** * @ingroup internal */ /** * @brief The class used for holding Transform Elements within a signature. * * This class is the container for the \ list in a Reference or * KeyInfo list. It holds a list of Transform elements that can be * manipulated by the caller, or asked to provide the appropriate * TXFM* class to actually perform a transform. * */ class DSIG_EXPORT DSIGTransformList { public: #if defined(XSEC_NO_NAMESPACES) typedef vector TransformListVectorType; #else typedef std::vector TransformListVectorType; #endif #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif /** @name Constructors and Destructors */ //@{ /** * \brief Construct the list * */ DSIGTransformList(); /** * \brief Destroy all Transform resources * * Destroys the list - including the contained DSIGTransform* elements. * Does not destroy the underlying DOM structure. * */ ~DSIGTransformList(); //@} /** @name Manipulate existing structures */ //@{ /** * \brief Add a transform to the list * * Should never be called directly - will add a pre-built * transform to the list. * * @note Will not add any DOM structures * @param ref The transform structure to add */ void addTransform(DSIGTransform * ref); /** * \brief Remove a transform from the list. * * Should never be called directly - will simply remove the element * without deleting */ void removeTransform(size_type index); /** * \brief Delete the transform at the indicated position. * * @param index The position to delete from. */ DSIGTransform * item(size_type index); /** * \brief Get the number of items. * */ size_type getSize(); /** * \brief Remove all elements - but delete none. */ bool empty(); // Get information private: TransformListVectorType m_transformList; }; #endif /* DSIGTRANSFORMLIST_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransform.hpp000644 001751 001751 00000010412 12003301053 022601 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransform := Base (virtual) class that defines a DSIG Transform * * Author(s): Berin Lautenbach * * $Id: DSIGTransform.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGTRANSFORM_INCLUDE #define DSIGTRANSFORM_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMElement); XSEC_DECLARE_XERCES_CLASS(DOMDocument); #include class XSECEnv; class TXFMChain; /** * @ingroup pubsig */ /** * @brief The base class for transforms. * * The DSIGTransform class is the base class used to hold \ elements * within a document. * * It does not in actually perform any transformations - only hold the information * about a transform in a \ structure. * * @see TXFMBase * */ class DSIG_EXPORT DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so this type of Transform constructor * will generally read the nodes in. * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The environment in which this transform operates * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransform(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node) : mp_txfmNode(node), mp_env(env) {}; /** * \brief Contructor used for new signatures. * * The Node structure will have to be created by the implementation class * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The environment descriptor for the object * */ DSIGTransform(const XSECEnv * env) : mp_txfmNode(NULL), mp_env(env) {}; /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransform() {}; //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType() = 0; /** * \brief Create the transformer element and append to an existing Chain. * * Implemented by each Transform class and used by the DSIGSignature * to construct a complete Transform chain (TXFMChain). */ virtual void appendTransformer(TXFMChain * input) = 0; /** * \brief Construct a new transform. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc) = 0; /** * \brief Load a DOM structure * * Take the original node and load any sub nodes in the transform * (if necessary) */ virtual void load(void) = 0; //@} protected: /** @name Utility Functions */ //@{ /** * \brief Create the basic node structure of a transform * */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createTransformNode(); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_txfmNode; // The node that we read from const XSECEnv * mp_env; // Owning signature private: DSIGTransform(); DSIGTransform(const DSIGTransform &theOther); }; #endif /* #define DSIGTRANSFORM_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransformBase64.hpp000644 001751 001751 00000006414 12003301053 023555 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformBase64 := Class that holds Base 64 Transform information * * $Id: DSIGTransformBase64.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include /** * @ingroup pubsig */ /** * @brief Transform holder for Base 64. * * The DSIGTransformbase64 class is used to hold base64 \ elements * within a document. * * This is a very simple transform with no real options. * * @see TXFMBase * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformBase64 : public DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformBase64(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformBase64(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformBase64(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the Base 64transformer element. * * Implemented by each Transform class and used by the DSIGSignature * to construct a complete Transform list. */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank Base64 Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * For a Base64 transform this does almost nothing. * */ virtual void load(void); //@} private: DSIGTransformBase64(); DSIGTransformBase64(const DSIGTransformBase64 & theOther); }; xml-security-c-1.7.3/xsec/dsig/DSIGTransformXPath.hpp000644 001751 001751 00000012242 12003301053 023551 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXPath := Class that performs XPath transforms * * $Id: DSIGTransformXPath.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGTRANSFORMXPATH_INCLUDE #define DSIGTRANSFORMXPATH_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMNamedNodeMap); XSEC_DECLARE_XERCES_CLASS(DOMNode); /** * @ingroup pubsig */ /** * @brief Transform holder for XPath transforms. * * The DSIGTransformXPath class is used to hold XPath \ elements * within a document. * * @see TXFMXPath * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformXPath : public DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformXPath(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformXPath(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformXPath(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the XPath Transformer class. * * Create the transformer associated with this XPath transform. * Will set the expression and Namespaces as appropriate * * @returns The TXFMXPath transformer associated with this Transform */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank XPath Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * Load the expression and Namespaces. * */ virtual void load(void); //@} /** @name XPath specific methods */ //@{ /** * * \brief Set the XPath expression. * * Takes the provided string and uses it to set the expression in the * Signature and DOM structures. * * If an expression already exists, it is overwritten. * * @param expr The expression to set */ void setExpression(const char * expr); /** * \brief Get the XPath expression * * Returns a character buffer with the expression inside it. * * @note Do not delete the returned pointer - it is owned by the object. * * @returns The expression */ const char * getExpression(void); /** * \brief Add a new namespace to the list to be used * * Add a new namespace to the XPath Element. * * @param prefix NCName of the Namespace to set * @param value The string with the URI to set */ void setNamespace(const char * prefix, const char * value); /** * \brief Get the list of namespaces. * * Returns the DOMNamedNodeMap of the attributes of the XPath transform * node. This should only contain namespaces. * * @returns A pointer to the NamedNodeMap */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap * getNamespaces(void) { return mp_NSMap; } /** * \brief Delete a namespace to the list to be used * * Delete a namespace from the XPath Element. * * @param prefix NCName of the Namespace to delete * @throws XSECException if the NCName does not exist * */ void deleteNamespace(const char * prefix); //@} private: DSIGTransformXPath(); DSIGTransformXPath(const DSIGTransformXPath & theOther); safeBuffer m_expr; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_exprTextNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_xpathNode; XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap * mp_NSMap; }; #endif /* DSIGTRANSFORMXPATH_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoMgmtData.hpp000644 001751 001751 00000007611 12003301053 023620 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoMgmtData := MgmtData - used for conveying in-band key data * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoMgmtData.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFOMGMTDATA_INCLUDE #define DSIGKEYINFOMGMTDATA_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding in band key information. * @note Use of this class is NOT RECOMMEDED within * the DSIG standard. * */ class DSIG_EXPORT DSIGKeyInfoMgmtData : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by other user interface classes to load * an existing DOM structure into the Name element. * * @param env Environment operating within. * @param nameNode DOMNode to load information from */ DSIGKeyInfoMgmtData(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *nameNode); /** * \brief Constructor used when XML needs to be created. * * This constructor is used by interface objects to * create a DSIGKeyInfoName object that can then be used * to create the required XML. * * @param env Operating environment */ DSIGKeyInfoMgmtData(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoMgmtData(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ virtual void load(void); /** * \brief Get key name - unimplemented for MgmtData */ virtual const XMLCh * getKeyName(void) const {return NULL;} /** * \brief Get the MgmtData string * * Returns a pointer to the buffer containing the data string. * * @returns A pointer to the XMLCh buffer containing the data */ virtual const XMLCh * getData(void) const {return mp_data;}; //@} /**@name Create and set functions */ //@{ /** * \brief Create a new MgmtData element in the current document. * * Creates a new MgmtData element and sets the data with the string * passed in. * * @param data Value to set the MgmtData to * @returns The newly created DOMElement with the structure underneath. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankMgmtData(const XMLCh * data); /** * \brief Set the value of the MgmtData to a new string. * * Uses the passed in string to set a new value in the DOM structure. * * @param data Value to set in MgmtData */ void setData(const XMLCh * data); //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_MGMTDATA;} //@} private: DSIGKeyInfoMgmtData(); // Non-implemented constructor const XMLCh * mp_data; // The Data stored in the XML file XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_dataTextNode; // Text node containing the name }; #endif /* #define DSIGKEYINFOMGMTDATA_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGSignedInfo.hpp000644 001751 001751 00000020152 12003301053 022655 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGSignature := Class for checking and setting up signature nodes in a DSIG signature * * Author(s): Berin Lautenbach * * $Id: DSIGSignedInfo.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGSIGNEDINFO_INCLUDE #define DSIGSIGNEDINFO_INCLUDE // XSEC Includes #include #include #include #include // Xerces Includes XSEC_DECLARE_XERCES_CLASS(DOMDocument); XSEC_DECLARE_XERCES_CLASS(DOMNode); XSEC_DECLARE_XERCES_CLASS(DOMElement); // General includes #include class XSECEnv; /** * @ingroup pubsig */ /** * @brief Constructs and holds a SignedInfo. * * The \ node is the container for all the information * that is signed. It contains the ReferenceList and information * on the signature and canonicalisation method for the signature. * * Generally this class should not be manipulated directly. * */ class DSIG_EXPORT DSIGSignedInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor for existing nodes * * Called by the library to construct a SignedInfo in cases * where the DOM Nodes exist and need to be loaded * * @param doc The document containing the structure to be loaded * @param pFormatter A safeBuffer formatter that will translate to UTF-8 * @param signedInfoNode The node at the top of the SignedInfo tree fragment * @param env Operating environment */ DSIGSignedInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECSafeBufferFormatter * pFormatter, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *signedInfoNode, const XSECEnv * env); /** * \brief Constructor for building from scratch * * Will set up the class in preparation for building the * DOM structure * * @param doc The document to use to construct * @param pFormatter Formatter to use to translate to UTF-8 * @param env Operating environment */ DSIGSignedInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECSafeBufferFormatter * pFormatter, const XSECEnv * env); /** * \brief Destructor * * Delete - but does not destroy the DOM Nodes * */ ~DSIGSignedInfo(); //@} /** @name Create and Set */ //@{ /** * \brief Load from DOM * * Load the SignedInfo from the DOM Document * * Does not do any verification of signatures or references - * simply loads the values */ void load(void); /** * \brief Verify the SignedInfo * * Validates each reference contained in the SignedInfo. Does not * validate the signature itself - this is done by DSIGSignature * * @param errStr The safeBuffer that error messages should be written to. */ bool verify(safeBuffer &errStr); /** * \brief Hash the reference list * * Goes through each reference in the SignedInfo (including referenced * manifests), performs the digest operation and adds the digest * to the reference element * * @param interlockingReferences Set to true if any references depend on other * references */ void hash(bool interlockingReferences); /** * \brief Create an empty SignedInfo * * Creates the DOM structure for a SignedInfo * * Builds the DOM structures and sets the control * structures of the SignedInfo * * @param canonicalizationAlgorithmURI The canonicalisation method to set the SignedInfo as * @param signatureAlgorithmURI Signature Method to use * @param hm Hash method to use (for the SignedInfo, not the references) */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankSignedInfo( const XMLCh * canonicalizationAlgorithmURI, const XMLCh * signatureAlgorithmURI ); /** * \brief Create an empty SignedInfo * * Creates the DOM structure for a SignedInfo * * Builds the DOM structures and sets the control * structures of the SignedInfo * * @param cm The canonicalisation method to set the SignedInfo as * @param sm Signature Method to use * @param hm Hash method to use (for the SignedInfo, not the references) * @deprecated Use URI based creation method instead */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankSignedInfo(canonicalizationMethod cm, signatureMethod sm, hashMethod hm ); /** * \brief Create a reference to add to the SignedInfo * * Called by DSIGSignature to create and enter a new reference element * * @param URI What the reference references * @param hm Digest method to use for the reference * @param type Reference type * @deprecated Use the algorithmURI based call instead */ DSIGReference * createReference(const XMLCh * URI, hashMethod hm, char * type); /** * \brief Create a reference to add to the SignedInfo * * Called by DSIGSignature to create and enter a new reference element * * @param URI What the reference references * @param hashAlgorithmURI Digest method to use for the reference * @param type Reference type */ DSIGReference * createReference( const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type ); /** * \brief Remove a reference from the list * * Removes the reference at the index point and returns a pointer * to the reference removed. * * @note This also releases ownership. It is the responsibility of * the caller to ensure the reference is deleted. * * @note This removes the reference from the Signature * * @param index Point in the list to remove */ DSIGReference * removeReference(DSIGReferenceList::size_type index); //@} /** @name Getter functions */ //@{ /** * \brief Get the node pointing to the top of the DOM fragment * * @returns the SignedInfo node */ XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getDOMNode(void); /** * \brief Get the Algorithm URI * * @returns the URI associated with the Algorithm used to generate * the signature */ const XMLCh * getAlgorithmURI() {return mp_algorithmURI;} /** * \brief Get the canonicalisation method * * @returns Canonicalisation method */ canonicalizationMethod getCanonicalizationMethod(void); /** * \brief Get the hash method * * @returns the Hash (digest) Method */ hashMethod getHashMethod(void); /** * \brief Get the signature method * * @returns the Signature method */ signatureMethod getSignatureMethod(void); /** * \brief Get HMAC length * * HMAC signatures can be truncated to a nominated length. * This returns the length used. */ int getHMACOutputLength(void); /** * \brief Return the list of references * * Returns a pointer to the object holding the references * contained in the SignedInfo */ DSIGReferenceList *getReferenceList (void) {return mp_referenceList;} //@} private: XSECSafeBufferFormatter * mp_formatter; bool m_loaded; // Have we already loaded? XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_signedInfoNode; canonicalizationMethod m_canonicalizationMethod; signatureMethod m_signatureMethod; hashMethod m_hashMethod; DSIGReferenceList * mp_referenceList; int m_HMACOutputLength; const XMLCh * mp_algorithmURI; const XSECEnv * mp_env; // Not implemented constructors DSIGSignedInfo(); // DSIGSignedInfo & operator= (const DSIGSignedInfo &); }; #endif /* DSIGSIGNEDINFO_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransformXPathFilter.hpp000644 001751 001751 00000011423 12003301053 024717 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXPathFilter := Class that performs XPath Filter * transforms * * $Id: DSIGTransformXPathFilter.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGTRANSFORMXPATHFILTER_INCLUDE #define DSIGTRANSFORMXPATHFILTER_INCLUDE #include #include XSEC_DECLARE_XERCES_CLASS(DOMNamedNodeMap); XSEC_DECLARE_XERCES_CLASS(DOMNode); #include class DSIGXPathFilterExpr; /** * @ingroup pubsig */ /** * @brief Transform holder for XPath Filter transforms. * * The DSIGTransformXPath class is used to hold XPath \ elements * within a document. * * @see TXFMXPath * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformXPathFilter : public DSIGTransform { public: /** * \brief Vector used to pass the actual expressions into the transformer */ typedef std::vector exprVectorType; /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformXPathFilter(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @note DSIGTransform structures should only ever be created via calls to a * DSIGTransformList object. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformXPathFilter(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformXPathFilter(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the XPath Filter Transformer class. * * Create the transformer associated with this XPath transform. * Will set the expression and Namespaces as appropriate * * @returns The TXFMXPath transformer associated with this Transform */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank XPath Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * Load the expression and Namespaces. * */ virtual void load(void); //@} /** @name XPathFilter specific methods */ //@{ /** * \brief Append a new filter to the transform * * Appends the indicated filter (of given type) to the list of * filters in the transform. * * @param filterType The type of this filter * @param filterExpr The XPath expression to use * @returns The filter expression */ DSIGXPathFilterExpr * appendFilter(xpathFilterType filterType, const XMLCh * filterExpr); /** * \brief Retrieve number of expressions * * Allows callers to determine how many expressions there are in * this filter * * @returns The number of expressions */ unsigned int getExprNum(void); /** * \brief Get expression. * * Allows the caller to retrieve the specified expression from the * XPath Filter object * * @param n The index of the expression to retrieve * @returns The indicated expression */ DSIGXPathFilterExpr * expr(unsigned int n); //@} private: DSIGTransformXPathFilter(); DSIGTransformXPathFilter(const DSIGTransformXPathFilter & theOther); bool m_loaded; // The expressions exprVectorType m_exprs; }; #endif /* DSIGTRANSFORMXPATHFILTER_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGReferenceList.hpp000644 001751 001751 00000007036 12003301053 023370 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGReferenceList := Class for Loading and storing a list of references * * $Id: DSIGReferenceList.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGREFERENCELIST_INCLUDE #define DSIGREFERENCELIST_INCLUDE // XSEC Includes #include //#include // General includes #include class DSIGReference; /** * @ingroup pubsig */ /** * @brief Holds a list of reference elements. * * The library holds a Signature's list of references using this class. * Manifest lists are similarly held. Developers can obtain the * list from the Signature library using DSIGSignature::getReferenceList * and then iterate through each reference. * * The library also uses the List as the owner of the memory associated * with References. So when a list is deleted, the references are deleted * at the same time. * */ class DSIG_EXPORT DSIGReferenceList { public: #if defined(XSEC_NO_NAMESPACES) typedef vector ReferenceListVectorType; #else typedef std::vector ReferenceListVectorType; #endif #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif /** @name Constructors and Destructors */ //@{ /** * \brief Construct a list */ DSIGReferenceList(); /** * \brief Destroy a list. * * Standard destructor to close down the list. * * @note Destroys the references as well as the list */ ~DSIGReferenceList(); //@} /** @name List manipulation */ //@{ /** * \brief Add a reference to the list * * Appends the reference to the end of the list and takes ownership * of associated memory. */ void addReference(DSIGReference * ref); /** * \brief Remove a reference from the list * * Removes the reference at the index point and returns a pointer * to the reference removed. * * @note This also releases ownership. It is the responsibility of * the caller to ensure the reference is deleted. * * @note This does not currently delete the reference from the Signature * * @param index Point in the list to remove */ DSIGReference * removeReference(size_type index); /** * \brief Return a reference from the list * * Gets the reference at point index in the list * * @param index The pointer into the list */ DSIGReference * item(size_type index); /** * \brief Find the number of elements in the list * * @returns The number of elements in the list */ size_type getSize(); /** * \brief Clear out the list * * Simply clears the list. Does not delete the reference elements themselves. */ bool empty(); //@} private: ReferenceListVectorType m_referenceList; }; #endif /* DSIGREFERENCELIST_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGReference.hpp000644 001751 001751 00000041677 12003301053 022545 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIG_Reference := Class for checking and setting up reference nodes in a DSIG signature * * $Id: DSIGReference.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // High level include #include // Xerces INcludes #include #include // XSEC Includes #include #include #include #include class DSIGTransformList; class DSIGTransformBase64; class DSIGTransformC14n; class DSIGTransformEnvelope; class DSIGTransformXPath; class DSIGTransformXPathFilter; class DSIGTransformXSL; class DSIGSignature; class DSIGSignedInfo; class TXFMBase; class TXFMChain; class XSECBinTXFMInputStream; class XSECURIResolver; class XSECEnv; /** * @ingroup pubsig */ /** * @brief The class used for manipulating Reference Elements within a signature. * *

The DSIGReference class creates and manipulates (including hashing and validating) * \ elements.

* */ class DSIG_EXPORT DSIGReference { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor for use with existing XML signatures or templates. * *

Create a DSIGReference object based on an already existing * DSIG Reference XML node. It is assumed that the underlying * DOM structure is in place and works correctly.

* * @note DSIGReference structures should only ever be created via calls to a * DSIGSignature object. * * @param env The operating environment in which the Reference is operating * @param dom The DOM node (within doc) that is to be used as the base of the reference. * @see #load * @see DSIGSignature#createReference */ DSIGReference(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *dom); /** * \brief Contructor for use when creating new Reference structures. * *

Create a DSIGReference object that can later be used to create * a new Reference structure in the DOM document.

* * @note DSIGReference structures should only ever be created via calls to a * DSIGSignature object. * * @param env The environment object for this reference. * @see #load * @see DSIGSignature#createReference */ DSIGReference(const XSECEnv * env); /** * \brief Destructor. * * @note Does not impact any created DOM structures when destroyed. * * @note DSIGReferences should never be destroyed/deleted by * applications. They are owned and managed by DSIGSignature structures. */ ~DSIGReference(); //@} /** @name Reference Construction and Manipulation */ //@{ /** * \brief Load a DSIGReference from an existing DOM structure. * *

This function will load a Reference structure from the owner * document.

* */ void load(); /** * \brief Create a Reference structure in the document. * *

This function will create a Reference structure in the owner * document. In some cases, a call to this function will be sufficient * to put the required Reference in place. In other cases, calls will * also need to be made to the various append*Transform methods.

* * @note The XSEC Library currently makes very little use of type * attributes in \ Elements. However this may of use to calling * applications. * * @param URI The URI (data source) for this reference. Set to NULL for * an anonymous reference. * @param hm The type of Digest to be used (generally SHA-1) * @param type A type string (as defined by XML Signature). * @returns The root Reference element of the newly created DOM structure. * @deprecated Use the URI based creation method instead */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankReference(const XMLCh * URI, hashMethod hm, char * type); /** * \brief Create a Reference structure in the document. * *

This function will create a Reference structure in the owner * document. In some cases, a call to this function will be sufficient * to put the required Reference in place. In other cases, calls will * also need to be made to the various append*Transform methods.

* * @note The XSEC Library currently makes very little use of type * attributes in \ Elements. However this may of use to calling * applications. * * @param URI The URI (data source) for this reference. Set to NULL for * an anonymous reference. * @param hashAlgorithmURI The type of Digest to be used (generally SHA-1) * @param type A type string (as defined by XML Signature). * @returns The root Reference element of the newly created DOM structure. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankReference(const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type); /** * \brief Append an Enveloped Signature Transform to the Reference. * * Appends a simple enveloped-signature transform to the list of transforms * in this element. * * @returns The newly created envelope transform. * */ DSIGTransformEnvelope * appendEnvelopedSignatureTransform(); /** * \brief Append a Base64 Transform to the Reference. * * @returns The newly created Base64 transform. */ DSIGTransformBase64 * appendBase64Transform(); /** * \brief Append an XPath Transform to the Reference. * *

Append an XPath transform. Namespaces can be added to the * transform directly using the returned DSIGTransformXPath * structure

* * @param expr The XPath expression to be placed in the transform. * @returns The newly created XPath transform */ DSIGTransformXPath * appendXPathTransform(const char * expr); /** * \brief Append an XPath-Filter2 Transform to the Reference. * * The returned DSIGTransformXPathFilter will have no actual filter * expressions loaded, but calls can be made to * DSIGTransformXPathFilter::appendTransform to add them. * * @returns The newly created XPath Filter transform */ DSIGTransformXPathFilter * appendXPathFilterTransform(void); /** * \brief Append an XSLT Transform to the Reference. * *

The caller must have already create the stylesheet and turned it into * a DOM structure that is passed in as the stylesheet parameter.

* * @param stylesheet The stylesheet DOM structure to be placed in the reference. * @returns The newly create XSLT transform */ DSIGTransformXSL * appendXSLTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *stylesheet); /** * \brief Append a Canonicalization Transform to the Reference. * * @param canonicalizationAlgorithmURI The type of canonicalisation to be added. * @returns The newly create canonicalisation transform */ DSIGTransformC14n * appendCanonicalizationTransform( const XMLCh * canonicalizationAlgorithmURI ); /** * \brief Append a Canonicalization Transform to the Reference. * * @param cm The type of canonicalisation to be added. * @returns The newly create canonicalisation transform * @deprecated Use the AlgorithmURI based method instead */ DSIGTransformC14n * appendCanonicalizationTransform(canonicalizationMethod cm); /** * \brief Append a "debug" transformer. * * This method allows applications to provide a TXFM that will be appended * to the transform chain just prior to the application of the hash * algorithm. * * @note This is primarily for debugging. It should not be used to modify the * contents of the byte stream. * * @param t The TXFM element to insert. */ void setPreHashTXFM(TXFMBase * t); /** * \brief Set the Id attribute of the DSIGReference * * This method allows applications to set the Id attribute of the DSIGReference * as described in http://www.w3.org/TR/xmldsig-core/#sec-Reference. * * * @param id The value for this reference. */ void setId(const XMLCh *id); /** * \brief Set the Type attribute of the DSIGReference * * This method allows applications to set the Type attribute of the DSIGReference * as described in http://www.w3.org/TR/xmldsig-core/#sec-Reference. * * * @param type The value for this reference. */ void setType(const XMLCh *type); //@} /** @name Getting Information */ //@{ /** * \brief Create an input stream based on the digested byte stream. * * This method allows applications to read the fully canonicalised * byte stream that is hashed for a reference. * * All transforms are performed up to the point where they would * normally be fed into the Digest function. * * @returns A BinInputSource of the canonicalised SignedInfo */ XSECBinTXFMInputStream * makeBinInputStream(void) const; /** * \brief Return the URI string of the Reference. * * @returns A pointer to the buffer (owned by the Reference) containing * the value of the URI stored inthe reference */ const XMLCh * getURI(); /** * \brief Get the Digest method * * Obtain the digest method used to find a hash for this reference * * @returns the hashMethod */ hashMethod getHashMethod(void) { return me_hashMethod; } /** * \brief Get the Digest Algorithm URI * * @returns the URI associated with the Algorithm used to generate * the digest */ const XMLCh * getAlgorithmURI() const { return mp_algorithmURI; } /** * \brief Obtain the transforms for this reference * * Get the DSIGTransformList object for this reference. Can be used to * obtain information about the transforms and also change the the transforms */ DSIGTransformList * getTransforms(void) { return mp_transformList; } /** * \brief Determine whether the reference is a manifest * * @returns true iff the Reference element is a Manifest reference */ bool isManifest(); /** * \brief Get the Manifest * * @returns The ReferenceList containing the references in the Manifest * list of this reference element. */ DSIGReferenceList * getManifestReferenceList(); // Return list of references for a manifest object //@} /** @name Message Digest/Hash manipulation */ //@{ /** * \brief Calculate the Hash value of a reference * * Takes the Reference URI, performs all the transforms and finally * calculates the Hash value of the data using the Digest algorithm * indicated in the reference * * @param toFill A Buffer that the raw hash will be copied into. * @param maxToFill Maximum number of bytes to place in the buffer * @returns The number of bytes copied into the buffer */ unsigned int calculateHash(XMLByte * toFill, unsigned int maxToFill); /** * \brief Read the hash from the Reference element. * * Reads the Base64 encoded element from the Reference element. * The hash is then translated from Base64 back into raw form and * written into the indicated buffer. * * @param toFill Pointer to the buffer where the raw hash will be written * @param maxToFill Maximum bytes to write to the buffer * @returns Number of bytes written */ unsigned int readHash(XMLByte *toFill, unsigned int maxToFill); /** * \brief Validate the Reference element * * Performs a #calculateHash() and a #readHash() and then compares the * results. * * @returns true iff the hash of the data matches the hash stored * in the reference. */ bool checkHash(); /** * \brief Set the value of the hash in the Reference * * Hashes the data referenced by the element and then writes * the Base64 encoded hash value into the Reference. * */ void setHash(); //@} /** @name Helper (static) Functions */ //@{ /** * \brief Create a Transformer chain * * Given a TransformList create the corresponding TXFM chain to allow * the caller to read the reference byte stream * * @note This method is primarily for use within the XSEC library. * Users wishing to get the byte stream should use the #makeBinInputStream * method instead. * * @param input The input transformer to which the TXFMs will be applied to * This is generally created from the URI attribute of the reference. * @param lst The list of Transform elements from which to build the * transformer list. * @returns The end of the newly build TXFM chain. This can be * read from using TXFMBase::readBytes() to give the end result of the * transforms. */ static TXFMChain * createTXFMChainFromList(TXFMBase * input, DSIGTransformList * lst); /** * \brief Load a Transforms list from the \ DOMNode. * * Reads the data from the XML data stored in the DOM and create * the associated DSIGTrasnformList. * * @param transformsNode Starting node in the DOM * @param formatter The formatter to be used to move from XMLCh to strings * @param env Environment in which to operate * @returns A pointer to the created list. */ static DSIGTransformList * loadTransforms( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *transformsNode, XSECSafeBufferFormatter * formatter, const XSECEnv * env); /** * \brief Create a starting point for a TXFM Chain. * * Uses the provided URI to find the base data that the Transformer chain * will be built upon. * * @param doc The document that the signature is based on (used for local URIs) * @param URI The URI to build the base from * @param env The environment the signature is operating in * @returns A base TXFM element. */ static TXFMBase * getURIBaseTXFM(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * URI, const XSECEnv * env); /** * \brief Load a series of references. * * Takes a series of \ elements in a DOM structure * and creates the corresponding ReferenceList object. * * @note Internal function - meant for use by the library * * @param env The environment in which this reference resides * @param firstReference First reference in DOM structure * @returns the created list. */ static DSIGReferenceList *loadReferenceListFromXML(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *firstReference); /** * \brief Validate a list of references. * * Runs through a reference list, calling verify() on each and * setting the ErrroStrings for any errors found * * @param lst The list to verify * @param errorStr The string to append any errors found to * @returns true iff all the references validate successfully. */ static bool verifyReferenceList(DSIGReferenceList * lst, safeBuffer &errorStr); /** * \brief Hash a reference list * * Run through a list of references and calculate the hash value of each * element. Finally set the Base64 encoded string according to the newly * calcuated hash. * * @note This is an internal library function and should not be called directly. * * @param list The list of references * @param interlocking If set to false, the library will assume there * are no inter-related references. The algorithm for determining this * internally is very primitive and CPU intensive, so this is a method to * bypass the checks. */ static void hashReferenceList(DSIGReferenceList * list, bool interlocking = true); //@} private: // Internal functions void createTransformList(void); void addTransform( DSIGTransform * txfm, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * txfmElt ); XSECSafeBufferFormatter * mp_formatter; bool formatterLocal; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_referenceNode; // Points to start of document where reference node is TXFMBase * mp_preHash; // To be used pre-hash DSIGReferenceList * mp_manifestList; // The list of references in a manifest const XMLCh * mp_URI; // The URI String bool m_isManifest; // Does this reference a manifest? XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_transformsNode; hashMethod me_hashMethod; // What form of digest? XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_hashValueNode; // Node where the Hash value is stored const XSECEnv * mp_env; DSIGTransformList * mp_transformList; // List of transforms const XMLCh * mp_algorithmURI; // Hash algorithm for this reference bool m_loaded; DSIGReference(); /*\@}*/ friend class DSIGSignedInfo; }; xml-security-c-1.7.3/xsec/dsig/DSIGSignature.hpp000644 001751 001751 00000075157 12003301053 022610 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGSignature := Class for checking and setting up signature nodes in a DSIG signature * * Author(s): Berin Lautenbach * * $Id: DSIGSignature.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGSIGNATURE_INCLUDE #define DSIGSIGNATURE_INCLUDE // XSEC Includes #include #include #include #include #include // Xerces Includes #include class XSECEnv; class XSECBinTXFMInputStream; class XSECURIResolver; class XSECKeyInfoResolver; class DSIGKeyInfoValue; class DSIGKeyInfoX509; class DSIGKeyInfoName; class DSIGKeyInfoPGPData; class DSIGKeyInfoSPKIData; class DSIGKeyInfoMgmtData; class DSIGObject; /** * @ingroup pubsig */ /*\@{*/ /** * @brief The main class used for manipulating XML Digital Signatures. * *

The DSIGSignature class is used to manipulate and verify * \ blocks. It should only ever be created via the * XSECProvider class.

* */ class DSIG_EXPORT DSIGSignature { protected: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor for use with existing XML signatures or templates. * *

Create a DSIGSignature object based on an already existing * DSIG Signature XML node. It is assumed that the underlying * DOM structure is in place and works correctly.

* *

It is required that the caller pass in the signature DOM Node * as there may be more than one signature in a document. The caller * needs to specify which signature tree is to be used.

* * @param doc The DOM document node in which the signature is embedded. * @param sigNode The DOM node (within doc) that is to be used as the base of the signature. * @see #load */ DSIGSignature(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *sigNode); ~DSIGSignature(); //@} public: /** @name Load and Setup Functions */ //@{ /** * \brief Load the signature information from the DOM source. * * Used to tell the DSIGSignature object to read from the DOM tree * into local structures. Will throw various exceptions if it finds that * the DOM structure is not in line with the XML Signature standard. * */ void load(void); /** * \brief Externally set the signing/verification key * * Used prior to a verify or sign operation to set the signature key (public or * private respectively) to be used for the operation. * * @note Once passed in via this call, the key is owned by the Signature. It will * deleted when a new key is loaded or the signature is released. * * @see #verify * @see #sign */ void setSigningKey(XSECCryptoKey *k); //@} /** @name Signature Operations */ //@{ /** * \brief Verify that a signature is valid. * *

The verify function will validate the signature of an XML document * previously loaded into the DSIGSignature structure via a load.

* *

It performs the following operations :

*
    *
  • Iterate through each reference and validate the hash; *
  • Iterate through references contained in \ elements; *
  • Calculate the hash of the \ element; and *
  • Validate the signature of the hash previously calculated. *
* * @returns true/false *
    *
  • true = Signature (and all references) validated correctly. *
  • false = Signature validation failed. An error list can be found via a * call to #getErrMsgs. *
* @see #load * @see #getErrMsgs */ bool verify(void); /** * \brief Verify a signature is valid (skip references). * *

This function is almost the same as #verify except it will skip the * reference checks. * * @see #load * @see #verify */ bool verifySignatureOnly(void); /** * \brief Sign a DSIGSignature DOM structure. * *

The #sign function will create the reference hash values and signature * value in a DOM structure previously created via a #load or #createBlankSignature * call

* *

It performs the following operations :

*
    *
  • Iterate through each reference, calculate and set the hash value; *
  • Iterate through references contained in \ elements and set their values; *
  • Calculate the hash of the \ element; and *
  • Calculate (and set) the signature value given the hash previously calculated. *
* * @note The key to use for signing must have been set prior to call to sign using #setSigningKey * * @throws XSECException (for errors during the XML formatting and loading) * @throws XSECCryptoException (for errors during the cryptographic operations) * * @see #setSigningKey * @see #load * @see #getErrMsgs */ void sign(void); //@} /** @name Functions to create and manipulate signature elements. */ //@{ /** * \brief Set the prefix be used for the DSIG namespace. * *

When the XSEC library creates XML Element nodes, it uses the prefix here * for all nodes created. By default, the library assumes that the default * namespace is used.

* *

The #createBlankSignature function will use this prefix to setup the * dsig namespace. E.g. (assuming a call has been made to set the prefix to "ds") * the \ element will have a namespace attribute added of

* *

xmlns:ds="http://www.w3.org/2000/09/xmldsig#"

* *

If no prefix has been set, this attribute will be set as the default namespace

* * @see #createBlankSignature * @param prefix The UTF-16 encoided NS prefix to use for the XML * Digital Signature nodes */ void setDSIGNSPrefix(const XMLCh * prefix); /** * \brief Set the prefix be used for the Exclusive Canonicalisation namespace. * * The Exclusive Canonicalisation specification defines a new namespace for the * InclusiveNamespaces node. This function can be used to set the prefix * that the library will use when creating nodes within this namespace. * *

xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#"

* * If no prefix is set, the default namespace will be used * * @see #createBlankSignature * @param prefix The UTF-16 encoided NS prefix to use for the XML * Exclusive Canonicalisation nodes */ void setECNSPrefix(const XMLCh * prefix); /** * \brief Set the prefix be used for the XPath-Filter2 namespace. * * The XPathFilter definition uses its own namespace. This * method can be used to set the prefix that the library will use * when creating elements in this namespace * *

xmlns:ds="http://www.w3.org/2002/06/xmldsig-filter2"

* * If no prefix is set, the default namespace will be used * * @see #createBlankSignature * @param prefix The UTF-16 encoided NS prefix to use for the XPath * filter nodes */ void setXPFNSPrefix(const XMLCh * prefix); /** * \brief Set Pretty Print * * The pretty print functions controls whether the library will output * CR/LF after the elements it adds to a document * * By default the library will do pretty printing (flag is true) * * @param flag Value to set for Pretty Printing (true = do pretty printing) */ void setPrettyPrint(bool flag); /** * \brief Tell caller whether PrettyPrinting is active * * @returns True if Pretty Printing is active, false if not */ bool getPrettyPrint(void) const; /** * \brief Create a \ DOM structure. * *

The DOM structure created is still divorced from the document. The callee * needs to take the returned \ Element node and insert it at the * appropriate place in their document.

* *

The signature is a skeleton only. There are no references or KeyInfo * elements inserted. However the DSIGSignature structures are set up with the * new information, so once an element has been created and a signing key has been * set, a call to #sign will sign appropriately. * * @note The digest method (hash method) set here is for the signing function only. * Different hash methods can be used for reference elements. * * @param doc The document the Signature DOM structure will be inserted into. * @param canonicalizationAlgorithmURI The canonicalisation method to use. * @param signatureAlgorithmURI The Signature algorithm (defined by URI) to use * @returns The newly created \ element that the caller should insert in * the document. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *createBlankSignature( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, const XMLCh * canonicalizationAlgorithmURI, const XMLCh * signatureAlgorithmURI ); /** * \brief Create a \ DOM structure. * *

The DOM structure created is still divorced from the document. The callee * needs to take the returned \ Element node and insert it at the * appropriate place in their document.

* *

The signature is a skeleton only. There are no references or KeyInfo * elements inserted. However the DSIGSignature structures are set up with the * new information, so once an element has been created and a signing key has been * set, a call to #sign will sign appropriately. * * @note The digest method (hash method) set here is for the signing function only. * Different hash methods can be used for reference elements. * * @param doc The document the Signature DOM structure will be inserted into. * @param cm The canonicalisation method to use. * @param sm The signature algorithm to be used. * @param hm The Digest function to be used for the actual signatures. * @returns The newly created \ element that the caller should insert in * the document. * @deprecated Use the URI based creation method instead, as this supports * signature algorithms that are not known to the library directly. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *createBlankSignature( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1 ); /** * \brief Add a new reference to the end of the list of \ nodes. * *

Creates a new DSIGReference, adds it to the list of references handled * by the owning DSIGSignature and also creates the skeleton DOM structure into * the document.

* * @note The XSEC Library currently makes very little use of type * attributes in \ Elements. However this may of use to calling * applications. * * @see DSIGReference * @param URI The Data that this Reference node refers to. * @param hm The hashing (digest) method to be used for this reference * @param type A "type" string (as defined in XML Signature). * @returns The newly created DSIGReference element. * @deprecated Use the URI based creation method instead * */ DSIGReference * createReference( const XMLCh * URI, hashMethod hm = HASH_SHA1, char * type = NULL ); /** * \brief Add a new reference to the end of the list of \ nodes. * *

Creates a new DSIGReference, adds it to the list of references handled * by the owning DSIGSignature and also creates the skeleton DOM structure into * the document.

* * @note The XSEC Library currently makes very little use of type * attributes in \ Elements. However this may of use to calling * applications. * * @see DSIGReference * @param URI The Data that this Reference node refers to. * @param hm The hashing (digest) method to be used for this reference * @param type A "type" string (as defined in XML Signature). * @returns The newly created DSIGReference element. * @deprecated Use the URI based creation method instead * */ DSIGReference * createReference( const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type = NULL ); /** * \brief Remove a reference from the signature * * Removes the reference at the index point and returns a pointer * to the reference removed. * * @note This also releases ownership. It is the responsibility of * the caller to ensure the reference is deleted. * * @note This removes the reference from the Signature * * @param index Point in the list to remove */ DSIGReference * removeReference(DSIGReferenceList::size_type index); //@} /** @name General and Information functions. */ //@{ /** * \brief Get the hash of the Signed Value * * Function to calculate and return the hash of the \ * structures (after the canonicalization defined by * \ and the reference hashes have been performed). * * @param hashBuf Buffer to place the raw hash in. * @param hashBufLen The length of the buffer * @returns The length of the hash that was placed in hashBuf * */ unsigned int calculateSignedInfoAndReferenceHash(unsigned char * hashBuf, unsigned int hashBufLen); /** * \brief Get the hash of the Signed Value * * Function to calculate and return the hash of the \ * structures (after the canonicalization defined by * \ has been performed). * * @param hashBuf Buffer to place the raw hash in. * @param hashBufLen The length of the buffer * @returns The length of the hash that was placed in hashBuf * */ unsigned int calculateSignedInfoHash(unsigned char * hashBuf, unsigned int hashBufLen); /** * \brief Return the reference list for outside use. * * Returns a pointer to the list of references which can * then be read by the caller. * * @returns The referenceList */ DSIGReferenceList * getReferenceList(void); /** * \brief Return the reference list for outside use. * * Returns a pointer to the list of references which can * then be read by the caller. * * @returns The referenceList */ const DSIGReferenceList * getReferenceList(void) const; /** * \brief Create an input stream from SignedInfo. * * This method allows applications to read the fully canonicalised * byte stream that is hashed and signed. * * All transforms are performed up to the point where they would * normally be fed into the Digest function. * * @returns A BinInputSource of the canonicalised SignedInfo */ XSECBinTXFMInputStream * makeBinInputStream(void) const; /** * \brief Get the Error messages from the last #verify. * * Returns a list of text error messages from the last Signature * operation. Each error that occurred is in the buffer, separated * by new-lines. * * @note The buffer is owned by the DSIGSignature object - do not delete it * * @returns A pointer to the buffer containing the error strings. * */ const XMLCh * getErrMsgs(void) const; /** * \brief Get the NS Prefix being used for DSIG elements. * * @returns A pointer to the buffer holding the prefix * @see #setDSIGNSPrefix * */ const XMLCh * getDSIGNSPrefix() const; /** * \brief Get the NS being used for EC nodes * * @returns A pointer to the buffer holding the prefix * @see #setECNSPrefix */ const XMLCh * getECNSPrefix() const; /** * \brief Get the NS being used for XPath Filter2 nodes * * @returns A pointer to the buffer holding the prefix * @see #setXPFNSPrefix */ const XMLCh * getXPFNSPrefix() const; /** * \brief * * Get the DOM_Document that this Signature is operating within. * * Mainly used by the library itself. * * @returns The DOM_Document node. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * getParentDocument() const {return mp_doc;} /** * \brief Get canonicalisation algorithm * * Returns the canonicalisation algorithm that will be/is used * to canonicalise the \ element prior to hash/sign * * @returns The canonicalisation method */ canonicalizationMethod getCanonicalizationMethod(void) const {return (mp_signedInfo != NULL ? mp_signedInfo->getCanonicalizationMethod() : CANON_NONE);} /** * \brief Get the Algorithm URI * * @returns the URI associated with the Algorithm used to generate * the signature */ const XMLCh * getAlgorithmURI() const; /** * \brief Get the hash method * * Obtain the hash (digest) algorithm that is used to generate a hash * of the canonicalised \ element. * * @returns the Hash (digest) Method */ hashMethod getHashMethod(void) const {return (mp_signedInfo != NULL ? mp_signedInfo->getHashMethod() : HASH_NONE);} /** * \brief Get the signature method * * Obtain the algorithm that will be used to generate/check the signature * of the canonicalised and hashed \ element. * * @returns the Signature method */ signatureMethod getSignatureMethod(void) const {return (mp_signedInfo != NULL ? mp_signedInfo->getSignatureMethod() : SIGNATURE_NONE);} /** * \brief Get the Signature Value * * Returns the base64 string holding the signature value for this signature * * @returns the signature value string */ const XMLCh * getSignatureValue(void) const; /** * \brief Helper function for sub Classes. * * Returns the pointer to the formatter being used within the Signature * */ XSECSafeBufferFormatter * getSBFormatter(void) {return mp_formatter;} /** * \brief Set the interlocking references flag * * This flag controls whether the library will cater for "interlocking" * Reference nodes - where the hash of one reference depends on the * hash of another. * * As of Version 1.3, this is, by default, set to false, as it is * fairly unusual to find a Reference node that has as an input the * digest value of another reference node. By setting this value to * true, the library will first calculate all hash values, and then * verify the hash values. If any are incorrect (caused by one * the value of one reference being changed *after* it was used as * the input to another), then the hash values are recalculated. This * is repeated until the reference list "settles". * * @param flag true for interlocking references, false for standalone */ void setInterlockingReferences(bool flag) {m_interlockingReferences = flag;} /** * \brief Get the interlocking references flag * * This flag controls whether the library will cater for "interlocking" * Reference nodes - where the hash of one reference depends on the * hash of another. * * As of Version 1.3, this is, by default, set to false, as it is * fairly unusual to find a Reference node that has as an input the * digest value of another reference node. By setting this value to * true, the library will first calculate all hash values, and then * verify the hash values. If any are incorrect (caused by one * the value of one reference being changed *after* it was used as * the input to another), then the hash values are recalculated. This * is repeated until the reference list "settles". * * @return Value of flag - true for interlocking references, false for standalone */ bool getInterlockingReferences(void) const {return m_interlockingReferences;} //@} /** @name Resolver manipulation */ //@{ /** * \brief Register a URIResolver * * Registers a URIResolver to be used by the Signature when dereferencing * a URI in a Reference element * */ void setURIResolver(XSECURIResolver * resolver); /** * \brief Return a pointer to the resolver being used * * @returns A pointer to the URIResolver registered in this signature */ XSECURIResolver * getURIResolver(void) const; /** * \brief Register a KeyInfoResolver * * Registers a KeyInfoResolver to be used by the Signature when * it needs to find a key to be used to validate a signature * */ void setKeyInfoResolver(XSECKeyInfoResolver * resolver); /** * \brief Return a pointer to the resolver being used * * @returns A pointer to the KeyInfoResolver registered in this signature */ XSECKeyInfoResolver * getKeyInfoResolver(void) const; //@} /** @name KeyInfo Element Manipulation */ //@{ /** * \brief Get the list of \ elements. * *

This function recovers list that contains the KeyInfo elements * read in from the DOM document.

* *

This list should be used by calling applications to determine what key * is appropriate for validating (or even signing) the Signature.

* * @todo The KeyInfo process is very primitive. An interface needs to be * created to allow application developers to install an object into the Signature * that the Signature can call on to translate KeyInfo lists into a Key. * @returns A pointer to the DSIGKeyInfoList object held by the DSIGSignature */ DSIGKeyInfoList * getKeyInfoList() {return &m_keyInfoList;} /** * \brief Get the list of \ elements. * *

This function recovers list that contains the KeyInfo elements * read in from the DOM document.

* *

This list should be used by calling applications to determine what key * is appropriate for validating (or even signing) the Signature.

* * @todo The KeyInfo process is very primitive. An interface needs to be * created to allow application developers to install an object into the Signature * that the Signature can call on to translate KeyInfo lists into a Key. * @returns A pointer to the DSIGKeyInfoList object held by the DSIGSignature */ const DSIGKeyInfoList * getKeyInfoList() const {return &m_keyInfoList;} /** * \brief Clear out all KeyInfo elements in the signature. * * This function will delete all KeyInfo elements from both the DSIGSignature * object and the associated DOM. * */ void clearKeyInfo(void); /** * \brief Append a DSA KeyValue element * * Add a new KeyInfo element for a DSA Value * * @param P Base64 encoded value of P * @param Q Base64 encoded value of Q * @param G Base64 encoded value of G * @param Y Base64 encoded value of Y * @returns A pointer to the created object. */ DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y); /** * \brief Append a RSA KeyValue element * * Add a new KeyInfo element for a RSA Value * * @param modulus Base64 encoded value of the modulus * @param exponent Base64 encoded value of exponent * @returns A pointer to the created object. */ DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent); /** * \brief Append a X509Data element. * * Add a new KeyInfo element for X509 data. * * @note The added element is empty. The caller must make use of the * returned object to set the required values. * * @returns A pointer to the created object. */ DSIGKeyInfoX509 * appendX509Data(void); /** * \brief Append a KeyName element. * * Add a new KeyInfo element for a key name. * * @param name The name of the key to set in the XML * @param isDName Treat the name as a Distinguished name and encode accordingly * @returns A pointer to the created object */ DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false); /** * \brief Append a PGPData element. * * Add a new KeyInfo element for a PGP key. * * @param id The ID of the key to set in the XML (base64 encoded - NULL if none) * @param packet The Packet information to set in the XML (base64 encoded - * NULL if none) * @returns A pointer to the created object */ DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet); /** * \brief Append a SPKIData element * * Add a new KeyInfo element for a set of SPKI S-expressions * * @param sexp The initial S-expression to set in the SPKIData element * @returns A pointer to the created object */ DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp); /** * \brief Append a MgmtData element * * Add a new KeyInfo element for Management Data * * @param data The string to set in the MgmtData element * @returns A pointer to the created object */ DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data); //@} /** @name Object handling */ //@{ /** * \brief Append an object container * * Create a new Object (i.e. a Signature \ which is a container * element used to hold information that needs to be signed within the * signature - i.e. in enveloping mode * * @returns the newly created DSIGObject */ DSIGObject * appendObject(void); /** * \brief Find the number of ds:Object nodes within the Signature * * @returns the number of ds:Object nodes held in the Signature, 0 if none */ int getObjectLength(void) const; /** * \brief Get a particular ds:Object from within the Signature * * @returns the ith Object from the list of ds:Object nodes in the signature. * Items are ordered in tree order. */ DSIGObject * getObjectItem(int i); /** * \brief Get a particular ds:Object from within the Signature * * @returns the ith Object from the list of ds:Object nodes in the signature. * Items are ordered in tree order. */ const DSIGObject * getObjectItem(int i) const; //@} /** @name ID handling */ //@{ /** * \brief Set Id finding behaviour * * The library de-references "#obj" URI references to ID attributes within * a DOM document. Currently, the library first uses DOM calls to find if * the Id has been properly set within the document via the parser or one * of the DOM Level 3 calls to set an Id. * * If no Id is found of the correct name, the library then starts searching * for attributes of a given name with the required value. This list defaults * to "id" and "Id", but can be modified via a call to addIdAttributeName() * * The setIdByAttributeName call enables or disables the second part of the Id * search. I.e. when the Id doesn't exist as an attribute of Type=ID, whether or * not to search for an attribute of a name in the list of names. By default * this behaviour is enabled. * * @warning This is currently enabled by default for backwards compatibility * reasons only. Future version may reverse this and ship disabled by default, as * this behaviour is a potential security risk. * * @param flag Enable (true) or Disable (false) searching for Id attributes by name */ void setIdByAttributeName(bool flag); /** * \brief Determine Id finding behaviour * * Allows a caller to determine whether the library is currently searching for * Id attributes by name * * @returns The value of the IdByAttributeName flag */ bool getIdByAttributeName(void) const; /** * \brief Add an attribute name to be searched for when looking for Id attributes * * This allows a user to add an attribute name to be used to identify Id attributes * when they are not set to be of Type=ID in the DOM * * @note Two names are registered by default - "Id" and "id". These can be * removed by calling deregisterIdAttributeName * * @param name Name to append to the list of those used to find Id attributes */ void registerIdAttributeName(const XMLCh * name); /** * \brief Remove an attribute name to be searched for when looking for Id attributes * * This allows a user to de-register a particular name to be used to identify Id * attributes. * * @param name Name to remove from the list of those used to find Id attributes * @returns true if found and removed, false if was not in the list */ bool deregisterIdAttributeName(const XMLCh * name); /** * \brief Add an attribute name within a particular Namespace * to be searched for when looking for Id attributes * * This allows a user to add an attribute name to be used to identify Id attributes * when they are not set to be of Type=ID in the DOM * * @note Two names are registered by default - "Id" and "id". These can be * removed by calling deregisterIdAttributeName * * @param ns Namespace in which attribute will reside * @param name Name to append to the list of those used to find Id attributes */ void registerIdAttributeNameNS(const XMLCh * ns, const XMLCh * name); /** * \brief Remove an attribute name and ns to be searched for when looking for Id attributes * * This allows a user to de-register a particular name to be used to identify Id * attributes. * * @param ns Namespace in which attribute will reside * @param name Name to remove from the list of those used to find Id attributes * @returns true if found and removed, false if was not in the list */ bool deregisterIdAttributeNameNS(const XMLCh * ns, const XMLCh * name); //@} friend class XSECProvider; private: // For holding DSIGObject nodes #if defined(XSEC_NO_NAMESPACES) typedef vector ObjectVectorType; #else typedef std::vector ObjectVectorType; #endif // Internal functions void createKeyInfoElement(void); bool verifySignatureOnlyInternal(void); TXFMChain * getSignedInfoInput(void); // Initialisation static void Initialise(void); XSECSafeBufferFormatter * mp_formatter; bool m_loaded; // Have we already loaded? XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_sigNode; DSIGSignedInfo * mp_signedInfo; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_signatureValueNode; safeBuffer m_signatureValueSB; DSIGKeyInfoList m_keyInfoList; XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_KeyInfoNode; safeBuffer m_errStr; // Environment XSECEnv * mp_env; // The signing/verifying key mutable XSECCryptoKey * mp_signingKey; // Resolvers XSECKeyInfoResolver * mp_KeyInfoResolver; // Objects ObjectVectorType m_objects; // Interlocking references bool m_interlockingReferences; // Not implemented constructors DSIGSignature(); friend class XSECPlatformUtils; /*\@}*/ }; #endif /* DSIGSIGNATURE_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoName.hpp000644 001751 001751 00000010465 12003301053 023003 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoName := References a key by name. * * $Id: DSIGKeyInfoName.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef DSIGKEYINFONAME_INCLUDE #define DSIGKEYINFONAME_INCLUDE #include #include #include XSEC_DECLARE_XERCES_CLASS(DOMElement); /** * @ingroup pubsig */ /** * @brief The class for \ nodes in a KeyInfo list. * * Class for holding information on a KeyName node as well as setting * such a node in a signature. * */ class DSIG_EXPORT DSIGKeyInfoName : public DSIGKeyInfo { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor used when XML exists. * * This constructor is used by interface classes * an existing DOM structure into the Name element. * * @param env Environment the KeyInfo is operating within * @param nameNode DOMNode to load information from */ DSIGKeyInfoName(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *nameNode); /** * \brief Constructor used when XML needs to be created. * * This constructor is used by interface objects to * create a DSIGKeyInfoName object that can then be used * to create the required XML. * * @param env Operating environment */ DSIGKeyInfoName(const XSECEnv * env); /** * \brief Destructor */ virtual ~DSIGKeyInfoName(); //@} /** @name Load and Get functions */ //@{ /** * \brief Load an existing XML structure into this object. */ virtual void load(void); /** * \brief Get the name held in the structure * * Returns a pointer to the buffer containing the name of the key. * * @returns A pointer to the char buffer containing the key name */ virtual const XMLCh * getKeyName(void) const {return mp_name;}; /** * \brief Get the decoded key name (for distinguished names) * * Returns a pointer to the buffer containing the decoded Distinguished * Name. * * @returns A pointer to the char buffer containing the key name */ virtual const XMLCh * getDecodedKeyName(void); //@} /**@name Create and set functions */ //@{ /** * \brief Create a new KeyName element in the current document. * * Creates a new KeyName element and sets the name with the string * passed in. * * @param name Value to set the KeyName as * @param isDName If set to true, the name will be encoded as a DName * prior to be being placed in the DOM document * @returns The newly created DOMElement with the structure underneath. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankKeyName(const XMLCh * name, bool isDName = false); /** * \brief Set the value of the KeyName to a new string. * * Uses the passed in string to set a new value in the DOM structure. * * @param name Value to set in KeyName * @param isDName If set to true, the name will be encoded as a DName * prior to be being placed in the DOM document */ void setKeyName(const XMLCh * name, bool isDName = false); //@} /** @name Information Functions */ //@{ /** * \brief Return type of this KeyInfo element */ virtual keyInfoType getKeyInfoType(void) const {return DSIGKeyInfo::KEYINFO_NAME;} //@} private: DSIGKeyInfoName(); // Non-implemented constructor const XMLCh * mp_name; // The Data stored in the XML file XMLCh * mp_decodedDName; // When this is a DName that needs decoding XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyNameTextNode; // Text node containing the name }; #endif /* #define DSIGKEYNAME_INCLUDE */ xml-security-c-1.7.3/xsec/dsig/DSIGTransformEnvelope.hpp000644 001751 001751 00000006235 12003301053 024307 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformEnvelope := Class that holds an Envelope transform * * $Id: DSIGTransformEnvelope.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include /** * @ingroup pubsig */ /** * @brief Transform holder for Base 64. * * The DSIGTransformEnvelope class is used to hold base64 \ elements * within a document. * * This is a very simple transform with no real options. * * @see TXFMBase * @see DSIGTransform * */ class DSIG_EXPORT DSIGTransformEnvelope : public DSIGTransform { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor used for existing XML signatures. * * The Node structure already exists, so read the nodes in. * * @param env The operating environment * @param node The DOM node (within doc) that is to be used as the base of the Transform. * @see #load */ DSIGTransformEnvelope(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node); /** * \brief Contructor used for new signatures. * * The Node structure will have to be created. * * @param env The operating environment * @see createBlankTransform */ DSIGTransformEnvelope(const XSECEnv * env); /** * \brief Destructor. * * Destroy the DSIGSignature elements. * * Does not destroy any associated DOM Nodes */ virtual ~DSIGTransformEnvelope(); //@} /** @name Interface Methods */ //@{ /** * \brief Determine the transform type. * * Used to determine what the type of the transform is. * */ virtual transformType getTransformType(); /** * \brief Create the Enevelope transformer element. * * Implemented by each Transform class and used by the DSIGSignature * to construct a complete Transform list. */ virtual void appendTransformer(TXFMChain * input); /** * \brief Construct blank Envelope Transform element. * * Instruct the implementation to create the required * transform and return the newly constructed DOMNode structure */ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc); /** * \brief Load a DOM structure * * For a Envelope transform this does almost nothing. * */ virtual void load(void); //@} private: DSIGTransformEnvelope(); DSIGTransformEnvelope(const DSIGTransformEnvelope & theOther); }; xml-security-c-1.7.3/xsec/dsig/DSIGConstants.hpp000644 001751 001751 00000046623 12003301053 022617 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGConstants := Definitions of varius DSIG constants (mainly strings) * * Author(s): Berin Lautenbach * * $Id: DSIGConstants.hpp 1363191 2012-07-19 00:33:46Z scantor $ * */ #ifndef DSIGCONSTANTS_HEADER #define DSIGCONSTANTS_HEADER #include // Xerces #include XSEC_USING_XERCES(XMLString); // Name Spaces #define URI_ID_DSIG "http://www.w3.org/2000/09/xmldsig#" #define URI_ID_DSIG11 "http://www.w3.org/2009/xmldsig11#" #define URI_ID_EC "http://www.w3.org/2001/10/xml-exc-c14n#" // Also used as algorithm ID for XPATH_FILTER #define URI_ID_XPF "http://www.w3.org/2002/06/xmldsig-filter2" #define URI_ID_XENC "http://www.w3.org/2001/04/xmlenc#" #define URI_ID_XENC11 "http://www.w3.org/2009/xmlenc11#" // Hashing Algorithms #define URI_ID_SHA1 "http://www.w3.org/2000/09/xmldsig#sha1" #define URI_ID_MD5 "http://www.w3.org/2001/04/xmldsig-more#md5" #define URI_ID_SHA224 "http://www.w3.org/2001/04/xmldsig-more#sha224" #define URI_ID_SHA256 "http://www.w3.org/2001/04/xmlenc#sha256" #define URI_ID_SHA384 "http://www.w3.org/2001/04/xmldsig-more#sha384" #define URI_ID_SHA512 "http://www.w3.org/2001/04/xmlenc#sha512" // Encryption Algorithms #define URI_ID_3DES_CBC "http://www.w3.org/2001/04/xmlenc#tripledes-cbc" #define URI_ID_AES128_CBC "http://www.w3.org/2001/04/xmlenc#aes128-cbc" #define URI_ID_AES192_CBC "http://www.w3.org/2001/04/xmlenc#aes192-cbc" #define URI_ID_AES256_CBC "http://www.w3.org/2001/04/xmlenc#aes256-cbc" #define URI_ID_AES128_GCM "http://www.w3.org/2009/xmlenc11#aes128-gcm" #define URI_ID_AES192_GCM "http://www.w3.org/2009/xmlenc11#aes192-gcm" #define URI_ID_AES256_GCM "http://www.w3.org/2009/xmlenc11#aes256-gcm" // Key Wrap Algorithm #define URI_ID_KW_3DES "http://www.w3.org/2001/04/xmlenc#kw-tripledes" #define URI_ID_KW_AES128 "http://www.w3.org/2001/04/xmlenc#kw-aes128" #define URI_ID_KW_AES192 "http://www.w3.org/2001/04/xmlenc#kw-aes192" #define URI_ID_KW_AES256 "http://www.w3.org/2001/04/xmlenc#kw-aes256" #define URI_ID_KW_AES128_PAD "http://www.w3.org/2009/xmlenc11#kw-aes-128-pad" #define URI_ID_KW_AES192_PAD "http://www.w3.org/2009/xmlenc11#kw-aes-192-pad" #define URI_ID_KW_AES256_PAD "http://www.w3.org/2009/xmlenc11#kw-aes-256-pad" // Key Transport algorithms #define URI_ID_RSA_1_5 "http://www.w3.org/2001/04/xmlenc#rsa-1_5" #define URI_ID_RSA_OAEP_MGFP1 "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" #define URI_ID_RSA_OAEP "http://www.w3.org/2009/xmlenc11#rsa-oaep" // OAEP MGFs #define URI_ID_MGF1_BASE "http://www.w3.org/2009/xmlenc11#mgf1" #define URI_ID_MGF1_SHA1 "http://www.w3.org/2009/xmlenc11#mgf1sha1" #define URI_ID_MGF1_SHA224 "http://www.w3.org/2009/xmlenc11#mgf1sha224" #define URI_ID_MGF1_SHA256 "http://www.w3.org/2009/xmlenc11#mgf1sha256" #define URI_ID_MGF1_SHA384 "http://www.w3.org/2009/xmlenc11#mgf1sha384" #define URI_ID_MGF1_SHA512 "http://www.w3.org/2009/xmlenc11#mgf1sha512" // Transforms #define URI_ID_BASE64 "http://www.w3.org/2000/09/xmldsig#base64" #define URI_ID_XPATH "http://www.w3.org/TR/1999/REC-xpath-19991116" #define URI_ID_XSLT "http://www.w3.org/TR/1999/REC-xslt-19991116" #define URI_ID_ENVELOPE "http://www.w3.org/2000/09/xmldsig#enveloped-signature" #define URI_ID_C14N_NOC "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" #define URI_ID_C14N_COM "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" #define URI_ID_C14N11_NOC "http://www.w3.org/2006/12/xml-c14n11" #define URI_ID_C14N11_COM "http://www.w3.org/2006/12/xml-c14n11#WithComments" #define URI_ID_EXC_C14N_NOC "http://www.w3.org/2001/10/xml-exc-c14n#" #define URI_ID_EXC_C14N_COM "http://www.w3.org/2001/10/xml-exc-c14n#WithComments" #define XPATH_EXPR_ENVELOPE "count(ancestor-or-self::dsig:Signature | \ here()/ancestor::dsig:Signature[1]) > \ count(ancestor-or-self::dsig:Signature)" // Signature Algorithms #define URI_ID_SIG_BASE "http://www.w3.org/2000/09/xmldsig#" #define URI_ID_SIG_BASEMORE "http://www.w3.org/2001/04/xmldsig-more#" #define URI_ID_SIG_BASE11 "http://www.w3.org/2009/xmldsig11#" #define URI_ID_SIG_DSA "dsa" #define URI_ID_SIG_ECDSA "ecdsa" #define URI_ID_SIG_HMAC "hmac" #define URI_ID_SIG_SHA1 "sha1" #define URI_ID_SIG_SHA224 "sha224" #define URI_ID_SIG_SHA256 "sha256" #define URI_ID_SIG_SHA384 "sha384" #define URI_ID_SIG_SHA512 "sha512" #define URI_ID_SIG_RSA "rsa" #define URI_ID_SIG_MD5 "md5" #define URI_ID_DSA_SHA1 "http://www.w3.org/2000/09/xmldsig#dsa-sha1" #define URI_ID_DSA_SHA256 "http://www.w3.org/2009/xmldsig11#dsa-sha256" #define URI_ID_HMAC_SHA1 "http://www.w3.org/2000/09/xmldsig#hmac-sha1" #define URI_ID_HMAC_SHA224 "http://www.w3.org/2001/04/xmldsig-more#hmac-sha224" #define URI_ID_HMAC_SHA256 "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256" #define URI_ID_HMAC_SHA384 "http://www.w3.org/2001/04/xmldsig-more#hmac-sha384" #define URI_ID_HMAC_SHA512 "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512" #define URI_ID_RSA_SHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1" #define URI_ID_RSA_SHA224 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha224" #define URI_ID_RSA_SHA256 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" #define URI_ID_RSA_SHA384 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384" #define URI_ID_RSA_SHA512 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512" #define URI_ID_RSA_MD5 "http://www.w3.org/2001/04/xmldsig-more#rsa-md5" #define URI_ID_ECDSA_SHA1 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1" #define URI_ID_ECDSA_SHA224 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224" #define URI_ID_ECDSA_SHA256 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256" #define URI_ID_ECDSA_SHA384 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384" #define URI_ID_ECDSA_SHA512 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512" // Encryption defines #define URI_ID_XENC_ELEMENT "http://www.w3.org/2001/04/xmlenc#Element" #define URI_ID_XENC_CONTENT "http://www.w3.org/2001/04/xmlenc#Content" // General #define URI_ID_XMLNS "http://www.w3.org/2000/xmlns/" #define URI_ID_MANIFEST "http://www.w3.org/2000/09/xmldsig#Manifest" #define URI_ID_RAWX509 "http://www.w3.org/2000/09/xmldsig#rawX509Certificate" // Internal Crypto Providers #define PROV_OPENSSL "OpenSSL Provider" #define PROV_WINCAPI "WinCAPI Provider" #define PROV_NSS "NSS Provider" // Enumerated Types enum canonicalizationMethod { CANON_NONE = 0, // No method defined CANON_C14N_NOC = 1, // C14n without comments CANON_C14N_COM = 2, // C14n with comments CANON_C14NE_NOC = 3, // C14n Exclusive (without comments) CANON_C14NE_COM = 4, // C14n Exlusive (with Comments CANON_C14N11_NOC = 5, // C14n 1.1 without comments CANON_C14N11_COM = 6 // C14n 1.1 with comments }; enum signatureMethod { SIGNATURE_NONE = 0, // No method defined SIGNATURE_DSA = 1, // DSA SIGNATURE_HMAC = 2, // Hash MAC SIGNATURE_RSA = 3, // RSA SIGNATURE_ECDSA = 4 // ECDSA }; enum hashMethod { HASH_NONE = 0, // No method defined HASH_SHA1 = 1, // SHA1 HASH_MD5 = 2, HASH_SHA224 = 3, HASH_SHA256 = 4, HASH_SHA384 = 5, HASH_SHA512 = 6 }; enum transformType { TRANSFORM_BASE64, TRANSFORM_C14N, TRANSFORM_C14N11, TRANSFORM_EXC_C14N, TRANSFORM_ENVELOPED_SIGNATURE, TRANSFORM_XPATH, TRANSFORM_XSLT, TRANSFORM_XPATH_FILTER }; enum xpathFilterType { FILTER_UNION = 0, /** Results should be added to previous nodeset */ FILTER_INTERSECT = 1, /** Results should be included if in prev nodeset */ FILTER_SUBTRACT = 2 /** Results should be subtracted from prev nodeset */ }; enum encryptionMethod { ENCRYPT_NONE = 0, // No method defined ENCRYPT_3DES_CBC = 1, // Use 3DES ENCRYPT_AES128_CBC = 2, // 128 bit AES in CBC mode ENCRYPT_AES192_CBC = 3, // 192 bit AES in CBC mode ENCRYPT_AES256_CBC = 4, // 256 bit AES in CBC mode ENCRYPT_KW_AES128 = 5, // KeyWrap - AES128 ENCRYPT_KW_AES192 = 6, // KeyWrap - AES192 ENCRYPT_KW_AES256 = 7, // KeyWrap - AES256 ENCRYPT_KW_3DES = 8, ENCRYPT_RSA_15 = 9, // RSA with PKCS 1.5 padding ENCRYPT_RSA_OAEP_MGFP1 = 10, // RSA with OAEP and MGFP1 ENCRYPT_RSA_OAEP = 11, // RSA with OAEP ENCRYPT_AES128_GCM = 12, // 128 bit AES in GCM ENCRYPT_AES192_GCM = 13, // 192 bit AES in GCM ENCRYPT_AES256_GCM = 14, // 256 bit AES in GCM ENCRYPT_KW_AES128_PAD = 15, // KeyWrap - AES128 with padding ENCRYPT_KW_AES192_PAD = 16, // KeyWrap - AES192 with padding ENCRYPT_KW_AES256_PAD = 17 // KeyWrap - AES256 with padding }; enum maskGenerationFunc { MGF_NONE = 0, // No MGF defined MGF1_SHA1 = 1, // MGF1-SHA1 MGF1_SHA224 = 2, // MGF1-SHA224 MGF1_SHA256 = 3, // MGF1-SHA256 MGF1_SHA384 = 4, // MGF1-SHA384 MGF1_SHA512 = 5 // MGF1-SHA512 }; // -------------------------------------------------------------------------------- // Some utility functions // -------------------------------------------------------------------------------- inline bool canonicalizationMethod2URI(safeBuffer &uri, canonicalizationMethod cm) { switch (cm) { case (CANON_C14N_NOC) : uri = URI_ID_C14N_NOC; break; case (CANON_C14N_COM) : uri = URI_ID_C14N_COM; break; case (CANON_C14NE_NOC) : uri = URI_ID_EXC_C14N_NOC; break; case (CANON_C14NE_COM) : uri = URI_ID_EXC_C14N_COM; break; case (CANON_C14N11_NOC) : uri = URI_ID_C14N11_NOC; break; case (CANON_C14N11_COM) : uri = URI_ID_C14N11_COM; break; default : return false; // Unknown type } return true; } inline bool signatureHashMethod2URI(safeBuffer &uri, signatureMethod sm, hashMethod hm) { if (hm < HASH_MD5 && sm != SIGNATURE_ECDSA) uri = URI_ID_SIG_BASE; else if (hm == HASH_SHA256 && sm == SIGNATURE_DSA) uri = URI_ID_SIG_BASE11; else uri = URI_ID_SIG_BASEMORE; switch (sm) { case (SIGNATURE_DSA) : uri.sbStrcatIn(URI_ID_SIG_DSA); break; case (SIGNATURE_HMAC) : uri.sbStrcatIn(URI_ID_SIG_HMAC); break; case (SIGNATURE_RSA) : uri.sbStrcatIn(URI_ID_SIG_RSA); break; case (SIGNATURE_ECDSA) : uri.sbStrcatIn(URI_ID_SIG_ECDSA); break; default : return false; } uri.sbStrcatIn("-"); switch (hm) { case (HASH_SHA1) : uri.sbStrcatIn(URI_ID_SIG_SHA1); break; case (HASH_MD5) : uri.sbStrcatIn(URI_ID_SIG_MD5); break; case (HASH_SHA224) : uri.sbStrcatIn(URI_ID_SIG_SHA224); break; case (HASH_SHA256) : uri.sbStrcatIn(URI_ID_SIG_SHA256); break; case (HASH_SHA384) : uri.sbStrcatIn(URI_ID_SIG_SHA384); break; case (HASH_SHA512) : uri.sbStrcatIn(URI_ID_SIG_SHA512); break; default: return false; } return true; } inline bool hashMethod2URI(safeBuffer &uri, hashMethod hm) { switch (hm) { case (HASH_SHA1) : uri = URI_ID_SHA1; break; case (HASH_MD5) : uri = URI_ID_MD5; break; case (HASH_SHA224) : uri = URI_ID_SHA224; break; case (HASH_SHA256) : uri = URI_ID_SHA256; break; case (HASH_SHA384) : uri = URI_ID_SHA384; break; case (HASH_SHA512) : uri = URI_ID_SHA512; break; default: return false; } return true; } inline bool encryptionMethod2URI(safeBuffer &uri, encryptionMethod em) { switch (em) { case (ENCRYPT_3DES_CBC) : uri = URI_ID_3DES_CBC; break; case (ENCRYPT_AES128_CBC) : uri = URI_ID_AES128_CBC; break; case (ENCRYPT_AES192_CBC) : uri = URI_ID_AES192_CBC; break; case (ENCRYPT_AES256_CBC) : uri = URI_ID_AES256_CBC; break; case (ENCRYPT_KW_AES128) : uri = URI_ID_KW_AES128; break; case (ENCRYPT_KW_AES192) : uri = URI_ID_KW_AES192; break; case (ENCRYPT_KW_AES256) : uri = URI_ID_KW_AES256; break; case (ENCRYPT_KW_3DES) : uri = URI_ID_KW_3DES; break; case (ENCRYPT_RSA_15) : uri = URI_ID_RSA_1_5; break; case (ENCRYPT_RSA_OAEP_MGFP1) : uri = URI_ID_RSA_OAEP_MGFP1; break; case (ENCRYPT_RSA_OAEP) : uri = URI_ID_RSA_OAEP; break; case (ENCRYPT_AES128_GCM) : uri = URI_ID_AES128_GCM; break; case (ENCRYPT_AES192_GCM) : uri = URI_ID_AES192_GCM; break; case (ENCRYPT_AES256_GCM) : uri = URI_ID_AES256_GCM; break; case (ENCRYPT_KW_AES128_PAD) : uri = URI_ID_KW_AES128_PAD; break; case (ENCRYPT_KW_AES192_PAD) : uri = URI_ID_KW_AES192_PAD; break; case (ENCRYPT_KW_AES256_PAD) : uri = URI_ID_KW_AES256_PAD; break; default: return false; } return true; } inline bool maskGenerationFunc2URI(safeBuffer &uri, maskGenerationFunc mgf) { switch (mgf) { case (MGF1_SHA1) : uri = URI_ID_MGF1_SHA1; break; case (MGF1_SHA224) : uri = URI_ID_MGF1_SHA224; break; case (MGF1_SHA256) : uri = URI_ID_MGF1_SHA256; break; case (MGF1_SHA384) : uri = URI_ID_MGF1_SHA384; break; case (MGF1_SHA512) : uri = URI_ID_MGF1_SHA512; break; default: return false; } return true; } // -------------------------------------------------------------------------------- // Constant Strings Class // -------------------------------------------------------------------------------- class DSIG_EXPORT DSIGConstants { public: // General strings static const XMLCh * s_unicodeStrEmpty; // "" static const XMLCh * s_unicodeStrNL; // "\n" static const XMLCh * s_unicodeStrXmlns; // "xmlns" static const XMLCh * s_unicodeStrURI; // "URI" // DSIG Element Strings static const XMLCh * s_unicodeStrAlgorithm; // URI_IDs static const XMLCh * s_unicodeStrURIDSIG; static const XMLCh * s_unicodeStrURIDSIG11; static const XMLCh * s_unicodeStrURIEC; static const XMLCh * s_unicodeStrURIXPF; static const XMLCh * s_unicodeStrURIXENC; static const XMLCh * s_unicodeStrURIXENC11; static const XMLCh * s_unicodeStrURISIGBASE; static const XMLCh * s_unicodeStrURISIGBASEMORE; static const XMLCh * s_unicodeStrURISIGBASE11; static const XMLCh * s_unicodeStrURIRawX509; static const XMLCh * s_unicodeStrURISHA1; static const XMLCh * s_unicodeStrURISHA224; static const XMLCh * s_unicodeStrURISHA256; static const XMLCh * s_unicodeStrURISHA384; static const XMLCh * s_unicodeStrURISHA512; static const XMLCh * s_unicodeStrURIMD5; // Not recommended static const XMLCh * s_unicodeStrURIBASE64; static const XMLCh * s_unicodeStrURIXPATH; static const XMLCh * s_unicodeStrURIXSLT; static const XMLCh * s_unicodeStrURIENVELOPE; static const XMLCh * s_unicodeStrURIC14N_NOC; static const XMLCh * s_unicodeStrURIC14N_COM; static const XMLCh * s_unicodeStrURIC14N11_NOC; static const XMLCh * s_unicodeStrURIC14N11_COM; static const XMLCh * s_unicodeStrURIEXC_C14N_NOC; static const XMLCh * s_unicodeStrURIEXC_C14N_COM; static const XMLCh * s_unicodeStrURIDSA_SHA1; static const XMLCh * s_unicodeStrURIDSA_SHA256; static const XMLCh * s_unicodeStrURIRSA_MD5; static const XMLCh * s_unicodeStrURIRSA_SHA1; static const XMLCh * s_unicodeStrURIRSA_SHA224; static const XMLCh * s_unicodeStrURIRSA_SHA256; static const XMLCh * s_unicodeStrURIRSA_SHA384; static const XMLCh * s_unicodeStrURIRSA_SHA512; static const XMLCh * s_unicodeStrURIECDSA_SHA1; static const XMLCh * s_unicodeStrURIECDSA_SHA224; static const XMLCh * s_unicodeStrURIECDSA_SHA256; static const XMLCh * s_unicodeStrURIECDSA_SHA384; static const XMLCh * s_unicodeStrURIECDSA_SHA512; static const XMLCh * s_unicodeStrURIHMAC_SHA1; static const XMLCh * s_unicodeStrURIHMAC_SHA224; static const XMLCh * s_unicodeStrURIHMAC_SHA256; static const XMLCh * s_unicodeStrURIHMAC_SHA384; static const XMLCh * s_unicodeStrURIHMAC_SHA512; static const XMLCh * s_unicodeStrURIXMLNS; static const XMLCh * s_unicodeStrURIMANIFEST; // URIs for Encryption static const XMLCh * s_unicodeStrURI3DES_CBC; static const XMLCh * s_unicodeStrURIAES128_CBC; static const XMLCh * s_unicodeStrURIAES192_CBC; static const XMLCh * s_unicodeStrURIAES256_CBC; static const XMLCh * s_unicodeStrURIAES128_GCM; static const XMLCh * s_unicodeStrURIAES192_GCM; static const XMLCh * s_unicodeStrURIAES256_GCM; static const XMLCh * s_unicodeStrURIKW_3DES; static const XMLCh * s_unicodeStrURIKW_AES128; static const XMLCh * s_unicodeStrURIKW_AES192; static const XMLCh * s_unicodeStrURIKW_AES256; static const XMLCh * s_unicodeStrURIKW_AES128_PAD; static const XMLCh * s_unicodeStrURIKW_AES192_PAD; static const XMLCh * s_unicodeStrURIKW_AES256_PAD; static const XMLCh * s_unicodeStrURIRSA_1_5; static const XMLCh * s_unicodeStrURIRSA_OAEP_MGFP1; static const XMLCh * s_unicodeStrURIRSA_OAEP; static const XMLCh * s_unicodeStrURIMGF1_BASE; static const XMLCh * s_unicodeStrURIMGF1_SHA1; static const XMLCh * s_unicodeStrURIMGF1_SHA224; static const XMLCh * s_unicodeStrURIMGF1_SHA256; static const XMLCh * s_unicodeStrURIMGF1_SHA384; static const XMLCh * s_unicodeStrURIMGF1_SHA512; static const XMLCh * s_unicodeStrURIXENC_ELEMENT; static const XMLCh * s_unicodeStrURIXENC_CONTENT; // Internal Crypto Providers static const XMLCh * s_unicodeStrPROVOpenSSL; static const XMLCh * s_unicodeStrPROVWinCAPI; static const XMLCh * s_unicodeStrPROVNSS; DSIGConstants(); static void create(); static void destroy(); }; inline const XMLCh * canonicalizationMethod2UNICODEURI(canonicalizationMethod cm) { switch (cm) { case (CANON_C14N_NOC) : return DSIGConstants::s_unicodeStrURIC14N_NOC; case (CANON_C14N_COM) : return DSIGConstants::s_unicodeStrURIC14N_COM; case (CANON_C14NE_NOC) : return DSIGConstants::s_unicodeStrURIEXC_C14N_NOC; case (CANON_C14NE_COM) : return DSIGConstants::s_unicodeStrURIEXC_C14N_COM; default : break; } return DSIGConstants::s_unicodeStrEmpty; } // -------------------------------------------------------------------------------- // URI Inverse Mappings // -------------------------------------------------------------------------------- /* Map URIs to internal enums, if the URIs are known to the library. If they aren't, all these calls will set the Method variables to *_NONE, signifying we don't know them. Note this is not necessarily an error - the calling application may have installed handlers to handle these URIs, it's just we don't have an internal enum mapping */ bool DSIG_EXPORT XSECmapURIToSignatureMethods(const XMLCh * URI, signatureMethod & sm, hashMethod & hm); bool DSIG_EXPORT XSECmapURIToHashMethod(const XMLCh * URI, hashMethod & hm); bool DSIG_EXPORT XSECmapURIToCanonicalizationMethod(const XMLCh * URI, canonicalizationMethod & cm); bool DSIG_EXPORT XSECmapURIToMaskGenerationFunc(const XMLCh * URI, maskGenerationFunc & mgf); #endif /* DSIGCONSTANTS_HEADER */ xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoPGPData.cpp000644 001751 001751 00000016351 12003301053 023336 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyName := Simply a string that names a key for an application to read * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoPGPData.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoPGPData::DSIGKeyInfoPGPData(const XSECEnv * env, DOMNode *pgpDataNode) : DSIGKeyInfo(env), mp_keyID(NULL), mp_keyPacket(NULL), mp_keyIDTextNode(NULL), mp_keyPacketTextNode(NULL) { mp_keyInfoDOMNode = pgpDataNode; } DSIGKeyInfoPGPData::DSIGKeyInfoPGPData(const XSECEnv * env) : DSIGKeyInfo(env), mp_keyID(NULL), mp_keyPacket(NULL), mp_keyIDTextNode(NULL), mp_keyPacketTextNode(NULL) { mp_keyInfoDOMNode = 0; } DSIGKeyInfoPGPData::~DSIGKeyInfoPGPData() { }; // -------------------------------------------------------------------------------- // Load and Get functions // -------------------------------------------------------------------------------- void DSIGKeyInfoPGPData::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptyInfoName); } if (!strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "PGPData")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a PGPData node"); } // Now find the first element node containing either KeyID or KeyPacket DOMNode * tmpElt = findFirstChildOfType(mp_keyInfoDOMNode, DOMNode::ELEMENT_NODE); if (tmpElt == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected or children of PGPData node"); } if (strEquals(getDSIGLocalName(tmpElt), "PGPKeyID")) { // Find the text node mp_keyIDTextNode = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (mp_keyIDTextNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a text node beneath PGPKeyID"); } mp_keyID = mp_keyIDTextNode->getNodeValue(); do { tmpElt = tmpElt->getNextSibling(); } while (tmpElt != NULL && tmpElt->getNodeType() != DOMNode::ELEMENT_NODE); } if (tmpElt != NULL && strEquals(getDSIGLocalName(tmpElt), "PGPKeyPacket")) { // Find the text node mp_keyPacketTextNode = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (mp_keyPacketTextNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a text node beneath PGPKeyPacket"); } mp_keyPacket = mp_keyPacketTextNode->getNodeValue(); } if (mp_keyPacketTextNode == NULL && mp_keyIDTextNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected or children of PGPData node"); } } // -------------------------------------------------------------------------------- // Create and Set functions // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoPGPData::createBlankPGPData(const XMLCh * id, const XMLCh * packet) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "PGPData"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; mp_env->doPrettyPrint(ret); if (id != NULL) { makeQName(str, prefix, "PGPKeyID"); DOMElement * t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->appendChild(t); mp_env->doPrettyPrint(ret); mp_keyIDTextNode = doc->createTextNode(id); t->appendChild(mp_keyIDTextNode); mp_keyID = mp_keyIDTextNode->getNodeValue(); } if (packet != NULL) { makeQName(str, prefix, "PGPKeyPacket"); DOMElement * t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->appendChild(t); mp_env->doPrettyPrint(ret); mp_keyPacketTextNode = doc->createTextNode(packet); t->appendChild(mp_keyPacketTextNode); mp_keyPacket = mp_keyPacketTextNode->getNodeValue(); } return ret; } void DSIGKeyInfoPGPData::setKeyID(const XMLCh * id) { if (mp_keyInfoDOMNode == NULL) { throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoPGPData::setKeyID() called prior to load or createBlank"); } if (mp_keyIDTextNode == 0) { // Need to create safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "PGPKeyID"); DOMElement * t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); DOMNode * pkt = findFirstChildOfType(mp_keyInfoDOMNode, DOMNode::ELEMENT_NODE); if (pkt != NULL) { mp_keyInfoDOMNode->insertBefore(t, pkt); if (mp_env->getPrettyPrintFlag() == true) mp_keyInfoDOMNode->insertBefore(doc->createTextNode(DSIGConstants::s_unicodeStrNL), pkt); } else { mp_keyInfoDOMNode->appendChild(t); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } mp_keyIDTextNode = doc->createTextNode(id); t->appendChild(mp_keyIDTextNode); } else mp_keyIDTextNode->setNodeValue(id); mp_keyID = mp_keyIDTextNode->getNodeValue(); } void DSIGKeyInfoPGPData::setKeyPacket(const XMLCh * packet) { if (mp_keyInfoDOMNode == NULL) { throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoPGPData::setKeyID() called prior to load or createBlank"); } if (mp_keyPacketTextNode == 0) { // Need to create safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "PGPKeyPacket"); DOMElement * t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode->appendChild(t); mp_env->doPrettyPrint(mp_keyInfoDOMNode); mp_keyPacketTextNode = doc->createTextNode(packet); t->appendChild(mp_keyPacketTextNode); } else mp_keyPacketTextNode->setNodeValue(packet); mp_keyPacket = mp_keyPacketTextNode->getNodeValue(); } xml-security-c-1.7.3/xsec/dsig/DSIGReferenceList.cpp000644 001751 001751 00000004400 12003301053 023353 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGReferenceList := Class for Loading and storing a list of references * * $Id: DSIGReferenceList.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include XERCES_CPP_NAMESPACE_USE DSIGReferenceList::DSIGReferenceList() {} DSIGReferenceList::~DSIGReferenceList() { // Delete all the references contained in the list ReferenceListVectorType::iterator iterator = m_referenceList.begin(); while (iterator != m_referenceList.end()) { delete *iterator; iterator++; } } void DSIGReferenceList::addReference(DSIGReference * ref) { m_referenceList.push_back(ref); } DSIGReferenceList::size_type DSIGReferenceList::getSize() { return m_referenceList.size(); } DSIGReference * DSIGReferenceList::removeReference(size_type index) { DSIGReference * ret = NULL; if (index < m_referenceList.size()) { ret = m_referenceList[index]; m_referenceList.erase(m_referenceList.begin() + index); } return ret; } DSIGReference * DSIGReferenceList::item(ReferenceListVectorType::size_type index) { if (index < m_referenceList.size()) return m_referenceList[index]; return NULL; } bool DSIGReferenceList::empty() { // Clear out the list - note we do NOT delete the reference elements ReferenceListVectorType::iterator retTest; retTest = m_referenceList.erase(m_referenceList.begin(), m_referenceList.end()); return (retTest == m_referenceList.end()); } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoValue.cpp000644 001751 001751 00000035454 12003301053 023177 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoValue := A value setting * * $Id: DSIGKeyInfoValue.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE DSIGKeyInfoValue::DSIGKeyInfoValue(const XSECEnv * env, DOMNode *valueNode) : DSIGKeyInfo(env), mp_PTextNode(0), mp_QTextNode(0), mp_GTextNode(0), mp_YTextNode(0), mp_modulusTextNode(0), mp_exponentTextNode(0), mp_namedCurveElementNode(0), mp_ecPublicKeyTextNode(0), m_keyInfoType(KEYINFO_NOTSET) { mp_keyInfoDOMNode = valueNode; } DSIGKeyInfoValue::DSIGKeyInfoValue(const XSECEnv * env) : DSIGKeyInfo(env), mp_PTextNode(0), mp_QTextNode(0), mp_GTextNode(0), mp_YTextNode(0), mp_modulusTextNode(0), mp_exponentTextNode(0), mp_namedCurveElementNode(0), mp_ecPublicKeyTextNode(0), m_keyInfoType(KEYINFO_NOTSET) { mp_keyInfoDOMNode = NULL; } DSIGKeyInfoValue::~DSIGKeyInfoValue() { } // -------------------------------------------------------------------------------- // Load from XML // -------------------------------------------------------------------------------- void DSIGKeyInfoValue::load(void) { if (mp_keyInfoDOMNode == NULL || !strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "KeyValue")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Empty or incorrect node passed to DSIGKeyInfoValue"); } DOMNode *child, *p, *val; child = mp_keyInfoDOMNode->getFirstChild(); while (child != NULL && child->getNodeType() != DOMNode::ELEMENT_NODE) child = child->getNextSibling(); //child = findFirstChildOfType(mp_valueNode, DOMNode::ELEMENT_NODE); if (child == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Empty Expected value node beneath "); } if (strEquals(getDSIGLocalName(child), "DSAKeyValue")) { m_keyInfoType = KEYINFO_VALUE_DSA; p = findFirstChildOfType(child, DOMNode::ELEMENT_NODE); while (p != NULL) { if (strEquals(getDSIGLocalName(p), "P")) { val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val != NULL) { mp_PTextNode = val; } } if (strEquals(getDSIGLocalName(p), "Q")) { val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val != NULL) { mp_QTextNode = val; } } if (strEquals(getDSIGLocalName(p), "G")) { val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val != NULL) { mp_GTextNode = val; } } if (strEquals(getDSIGLocalName(p), "Y")) { val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val != NULL) { mp_YTextNode = val; } } p = p->getNextSibling(); } } else if (strEquals(getDSIGLocalName(child), "RSAKeyValue")) { m_keyInfoType = KEYINFO_VALUE_RSA; p = findFirstChildOfType(child, DOMNode::ELEMENT_NODE); if (p == 0 || !strEquals(getDSIGLocalName(p), "Modulus")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected node beneath "); } val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a text node beneath "); } mp_modulusTextNode = val; // Find the Exponent p = p->getNextSibling(); while (p != 0 && p->getNodeType() != DOMNode::ELEMENT_NODE) p = p->getNextSibling(); if (p == 0 || !strEquals(getDSIGLocalName(p), "Exponent")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected node beneath "); } val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a text node beneath "); } mp_exponentTextNode = val; } else if (strEquals(getDSIG11LocalName(child), "ECKeyValue")) { m_keyInfoType = KEYINFO_VALUE_EC; p = findFirstChildOfType(child, DOMNode::ELEMENT_NODE); if (p == 0 || !strEquals(getDSIG11LocalName(p), "NamedCurve")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected node beneath ( not supported)"); } mp_namedCurveElementNode = p; p = p->getNextSibling(); while (p != 0 && p->getNodeType() != DOMNode::ELEMENT_NODE) p = p->getNextSibling(); if (p == 0 || !strEquals(getDSIG11LocalName(p), "PublicKey")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected node beneath "); } val = findFirstChildOfType(p, DOMNode::TEXT_NODE); if (val == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected a text node beneath "); } mp_ecPublicKeyTextNode = val; } else { throw XSECException(XSECException::UnknownKeyValue); } } // -------------------------------------------------------------------------------- // Get RSA Values // -------------------------------------------------------------------------------- const XMLCh* DSIGKeyInfoValue::getRSAModulus(void) const { if (m_keyInfoType != KEYINFO_VALUE_RSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to Get an RSA Modulus from a non-RSAValue KeyValue node"); } if (mp_modulusTextNode != NULL) return mp_modulusTextNode->getNodeValue(); return NULL; } const XMLCh * DSIGKeyInfoValue::getRSAExponent(void) const { if (m_keyInfoType != KEYINFO_VALUE_RSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to Get an RSA Exponent from a non-RSAValue KeyValue node"); } if (mp_exponentTextNode != NULL) return mp_exponentTextNode->getNodeValue(); return NULL; } // -------------------------------------------------------------------------------- // Get EC Values // -------------------------------------------------------------------------------- const XMLCh* DSIGKeyInfoValue::getECNamedCurve(void) const { if (m_keyInfoType != KEYINFO_VALUE_EC) { throw XSECException(XSECException::KeyInfoError, "Attempt to Get an EC NamedCurve from a non-ECValue KeyValue node"); } if (mp_namedCurveElementNode != NULL) return static_cast(mp_namedCurveElementNode)->getAttributeNS(NULL, DSIGConstants::s_unicodeStrURI); return NULL; } const XMLCh * DSIGKeyInfoValue::getECPublicKey(void) const { if (m_keyInfoType != KEYINFO_VALUE_EC) { throw XSECException(XSECException::KeyInfoError, "Attempt to Get an EC PublicKey from a non-ECValue KeyValue node"); } if (mp_ecPublicKeyTextNode != NULL) return mp_ecPublicKeyTextNode->getNodeValue(); return NULL; } // -------------------------------------------------------------------------------- // Create and manipulate DSA Values // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoValue::createBlankDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) { // Set our type m_keyInfoType = KEYINFO_VALUE_DSA; // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "KeyValue"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; makeQName(str, prefix, "DSAKeyValue"); DOMElement * dsa = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_env->doPrettyPrint(ret); ret->appendChild(dsa); mp_env->doPrettyPrint(dsa); mp_env->doPrettyPrint(ret); // Now create the value children makeQName(str, prefix, "P"); DOMElement * v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_PTextNode = doc->createTextNode(P); dsa->appendChild(v); mp_env->doPrettyPrint(dsa); v->appendChild(mp_PTextNode); makeQName(str, prefix, "Q"); v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_PTextNode = doc->createTextNode(Q); dsa->appendChild(v); mp_env->doPrettyPrint(dsa); v->appendChild(mp_PTextNode); makeQName(str, prefix, "G"); v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_PTextNode = doc->createTextNode(G); dsa->appendChild(v); mp_env->doPrettyPrint(dsa); v->appendChild(mp_PTextNode); makeQName(str, prefix, "Y"); v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_PTextNode = doc->createTextNode(Y); dsa->appendChild(v); mp_env->doPrettyPrint(dsa); v->appendChild(mp_PTextNode); return ret; } void DSIGKeyInfoValue::setDSAP(const XMLCh * P) { if (m_keyInfoType != KEYINFO_VALUE_DSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set a DSA value in a non-DSA KeyValue node"); } mp_PTextNode->setNodeValue(P); } void DSIGKeyInfoValue::setDSAQ(const XMLCh * Q) { if (m_keyInfoType != KEYINFO_VALUE_DSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set a DSA value in a non-DSA KeyValue node"); } mp_QTextNode->setNodeValue(Q); } void DSIGKeyInfoValue::setDSAG(const XMLCh * G) { if (m_keyInfoType != KEYINFO_VALUE_DSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set a DSA value in a non-DSA KeyValue node"); } mp_GTextNode->setNodeValue(G); } void DSIGKeyInfoValue::setDSAY(const XMLCh * Y) { if (m_keyInfoType != KEYINFO_VALUE_DSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set a DSA value in a non-DSA KeyValue node"); } mp_YTextNode->setNodeValue(Y); } // -------------------------------------------------------------------------------- // Create and manipulate RSA Values // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoValue::createBlankRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) { // Set our type m_keyInfoType = KEYINFO_VALUE_RSA; // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "KeyValue"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; makeQName(str, prefix, "RSAKeyValue"); DOMElement * rsa = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_env->doPrettyPrint(ret); ret->appendChild(rsa); mp_env->doPrettyPrint(rsa); mp_env->doPrettyPrint(ret); // Now create the value children makeQName(str, prefix, "Modulus"); DOMElement * v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_modulusTextNode = doc->createTextNode(modulus); rsa->appendChild(v); mp_env->doPrettyPrint(rsa); v->appendChild(mp_modulusTextNode); makeQName(str, prefix, "Exponent"); v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_exponentTextNode = doc->createTextNode(exponent); rsa->appendChild(v); mp_env->doPrettyPrint(rsa); v->appendChild(mp_exponentTextNode); return ret; } void DSIGKeyInfoValue::setRSAModulus(const XMLCh * modulus) { if (m_keyInfoType != KEYINFO_VALUE_RSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set an RSA Modulus from a non-RSA KeyValue node"); } mp_modulusTextNode->setNodeValue(modulus); } void DSIGKeyInfoValue::setRSAExponent(const XMLCh * exponent) { if (m_keyInfoType != KEYINFO_VALUE_RSA) { throw XSECException(XSECException::KeyInfoError, "Attempt to set an RSA Exponent from a non-RSA KeyValue node"); } mp_exponentTextNode->setNodeValue(exponent); } DOMElement* DSIGKeyInfoValue::createBlankECKeyValue(const XMLCh * curveName, const XMLCh * publicKey) { // Set our type m_keyInfoType = KEYINFO_VALUE_EC; // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); const XMLCh * prefix11 = mp_env->getDSIG11NSPrefix(); makeQName(str, prefix, "KeyValue"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; makeQName(str, prefix11, "ECKeyValue"); DOMElement * ec = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG11, str.rawXMLChBuffer()); mp_env->doPrettyPrint(ret); ret->appendChild(ec); mp_env->doPrettyPrint(ec); mp_env->doPrettyPrint(ret); // Now create the value children makeQName(str, prefix11, "NamedCurve"); DOMElement * v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG11, str.rawXMLChBuffer()); mp_namedCurveElementNode = v; ec->appendChild(v); mp_env->doPrettyPrint(ec); v->setAttributeNS(NULL, DSIGConstants::s_unicodeStrURI, curveName); makeQName(str, prefix11, "PublicKey"); v = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG11, str.rawXMLChBuffer()); mp_ecPublicKeyTextNode = doc->createTextNode(publicKey); ec->appendChild(v); mp_env->doPrettyPrint(ec); v->appendChild(mp_ecPublicKeyTextNode); return ret; } void DSIGKeyInfoValue::setECNamedCurve(const XMLCh* curveName) { if (m_keyInfoType != KEYINFO_VALUE_EC) { throw XSECException(XSECException::KeyInfoError, "Attempt to set an EC NamedCurve from a non-EC KeyValue node"); } static_cast(mp_namedCurveElementNode)->setAttributeNS(NULL, DSIGConstants::s_unicodeStrURI, curveName); } void DSIGKeyInfoValue::setECPublicKey(const XMLCh* publicKey) { if (m_keyInfoType != KEYINFO_VALUE_EC) { throw XSECException(XSECException::KeyInfoError, "Attempt to set an EC PublicKey from a non-EC KeyValue node"); } mp_ecPublicKeyTextNode->setNodeValue(publicKey); } // -------------------------------------------------------------------------------- // Other interface functions // -------------------------------------------------------------------------------- DSIGKeyInfo::keyInfoType DSIGKeyInfoValue::getKeyInfoType(void) const { return m_keyInfoType; } const XMLCh * DSIGKeyInfoValue::getKeyName(void) const { return DSIGConstants::s_unicodeStrEmpty; } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoDEREncoded.cpp000644 001751 001751 00000010017 12003301053 024003 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoDEREncoded := DER-encoded key information * * Author(s): Scott Cantor * * $Id:$ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoDEREncoded::DSIGKeyInfoDEREncoded(const XSECEnv * env, DOMNode *nameNode) : DSIGKeyInfo(env), mp_data(NULL), mp_dataTextNode(0) { mp_keyInfoDOMNode = nameNode; } DSIGKeyInfoDEREncoded::DSIGKeyInfoDEREncoded(const XSECEnv * env) : DSIGKeyInfo(env), mp_data(NULL), mp_dataTextNode(0) { mp_keyInfoDOMNode = 0; } DSIGKeyInfoDEREncoded::~DSIGKeyInfoDEREncoded() { }; // -------------------------------------------------------------------------------- // Load and Get functions // -------------------------------------------------------------------------------- void DSIGKeyInfoDEREncoded::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty element throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoDEREncoded::load - called on empty DOM"); } if (!strEquals(getDSIG11LocalName(mp_keyInfoDOMNode), "DEREncodedKeyValue")) { throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoDEREncoded::load - called on non node"); } // Now find the text node containing the name DOMNode *tmpElt = findFirstChildOfType(mp_keyInfoDOMNode, DOMNode::TEXT_NODE); if (tmpElt != 0) { mp_dataTextNode = tmpElt; mp_data = tmpElt->getNodeValue(); } else { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGKeyInfoDEREncoded::load - Expected TEXT node as child to element"); } } // -------------------------------------------------------------------------------- // Create and Set functions // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoDEREncoded::createBlankDEREncoded(const XMLCh * data) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIG11NSPrefix(); makeQName(str, prefix, "DEREncodedKeyValue"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG11, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; // Check whether to encode prior to adding mp_dataTextNode = doc->createTextNode(data); ret->appendChild(mp_dataTextNode); mp_data = mp_dataTextNode->getNodeValue(); return ret; } void DSIGKeyInfoDEREncoded::setData(const XMLCh * data) { if (mp_dataTextNode == 0) { // Attempt to set an empty element throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoDEREncoded::setData() called prior to load() or createBlank()"); } mp_dataTextNode->setNodeValue(data); mp_data = mp_dataTextNode->getNodeValue(); } xml-security-c-1.7.3/xsec/dsig/DSIGXPathHere.cpp000644 001751 001751 00000005516 12003301053 022462 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGXPathHere := Implementation of the "here()" XPath function. * * $Id: DSIGXPathHere.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #ifndef XSEC_NO_XPATH #if defined XSEC_XALAN_REQS_MEMORYMANAGER // Xalan 1.9 and above XALAN_USING_XALAN(XalanCopyConstruct); #endif DSIGXPathHere::DSIGXPathHere() { XalanHereNode = NULL; } DSIGXPathHere::DSIGXPathHere(XalanNode * here) { XalanHereNode = here; } DSIGXPathHere::~DSIGXPathHere() {} // These methods are inherited from Function ... XObjectPtr DSIGXPathHere::execute( XPathExecutionContext& executionContext, XalanNode* context, // const XObjectPtr arg1, const Locator* locator) const { // Simple function - simply return the Xalan Node we already have typedef XPathExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList; // This list will hold the nodes we find. BorrowReturnMutableNodeRefList nl(executionContext); nl->addNodeInDocOrder(XalanHereNode, executionContext); return executionContext.getXObjectFactory().createNodeSet(nl); } #if defined(XSEC_NO_COVARIANT_RETURN_TYPE) Function* #else DSIGXPathHere* #endif #if defined (XSEC_XALAN_REQS_MEMORYMANAGER) DSIGXPathHere::clone(MemoryManagerType& theManager) #else DSIGXPathHere::clone() #endif const { #if defined (XSEC_XALAN_REQS_MEMORYMANAGER) return XalanCopyConstruct(theManager, *this); #else DSIGXPathHere *ret; ret = new DSIGXPathHere(*this); ret->XalanHereNode = XalanHereNode; return ret; #endif } const XalanDOMString #if defined XSEC_XALAN_REQS_MEMORYMANAGER // We cheat - the memory manager happened at the same time as the string &DSIGXPathHere::getError(XalanDOMString& theBuffer) #else DSIGXPathHere::getError() #endif const { #if defined XSEC_XALAN_REQS_MEMORYMANAGER theBuffer = "The here() function takes no arguments!"; return theBuffer; #else return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("The here() function takes no arguments!")); #endif } #endif /* NO_XPATH */ xml-security-c-1.7.3/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp000644 001751 001751 00000046626 12157706520 025414 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmHandlerDefault := Interface class to define handling of * default encryption algorithms * * $Id: DSIGAlgorithmHandlerDefault.cpp 1493960 2013-06-17 22:27:28Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #define MAXB64BUFSIZE 2048 // -------------------------------------------------------------------------------- // Some useful utility functions // -------------------------------------------------------------------------------- bool compareBase64StringToRaw(const char * b64Str, unsigned char * raw, unsigned int rawLen, unsigned int maxCompare = 0) { // Decode a base64 buffer and then compare the result to a raw buffer // Compare at most maxCompare bits (if maxCompare > 0) // Note - whilst the other parameters are bytes, maxCompare is bits // The div function below takes signed int, so make sure the value // is safe to cast. if ((int) maxCompare < 0) { throw XSECException(XSECException::CryptoProviderError, "Comparison length was unsafe"); } unsigned char outputStr[MAXB64BUFSIZE]; unsigned int outputLen = 0; XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!b64) { throw XSECException(XSECException::CryptoProviderError, "Error requesting Base64 object from Crypto Provider"); } Janitor j_b64(b64); b64->decodeInit(); outputLen = b64->decode((unsigned char *) b64Str, (unsigned int) strlen((char *) b64Str), outputStr, MAXB64BUFSIZE); outputLen += b64->decodeFinish(&outputStr[outputLen], MAXB64BUFSIZE - outputLen); // Compare div_t d; d.rem = 0; d.quot = 0; unsigned int maxCompareBytes, maxCompareBits; maxCompareBits = 0; unsigned int size; if (maxCompare > 0) { d = div(maxCompare, 8); maxCompareBytes = d.quot; if (d.rem != 0) maxCompareBytes++; if (rawLen < maxCompareBytes && outputLen < maxCompareBytes) { if (rawLen != outputLen) return false; size = rawLen; } else if (rawLen < maxCompareBytes || outputLen < maxCompareBytes) { return false; } else size = maxCompareBytes; } else { if (rawLen != outputLen) return false; size = rawLen; } // Compare bytes unsigned int i, j; for (i = 0; i < size; ++ i) { if (raw[i] != outputStr[i]) return false; } // Compare bits char mask = 0x01; if (maxCompare != 0) { for (j = 0 ; j < (unsigned int) d.rem; ++j) { if ((raw[i] & mask) != (outputStr[i] & mask)) return false; mask = mask << 1; } } return true; } void convertRawToBase64String(safeBuffer &b64SB, unsigned char * raw, unsigned int rawLen, unsigned int maxBits = 0) { // Translate the rawbuffer (at most maxBits or rawLen - whichever is smaller) // to a base64 string unsigned char b64Str[MAXB64BUFSIZE]; unsigned int outputLen = 0; XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!b64) { throw XSECException(XSECException::CryptoProviderError, "Error requesting Base64 object from Crypto Provider"); } Janitor j_b64(b64); // Determine length to translate unsigned int size; if (maxBits > 0) { div_t d = div(maxBits, 8); size = d.quot; if (d.rem != 0) ++size; if (size > rawLen) size = rawLen; } else size = rawLen; b64->encodeInit(); outputLen = b64->encode((unsigned char *) raw, rawLen, b64Str, MAXB64BUFSIZE - 1); outputLen += b64->encodeFinish(&b64Str[outputLen], MAXB64BUFSIZE - outputLen - 1); b64Str[outputLen] = '\0'; // Copy out b64SB.sbStrcpyIn((char *) b64Str); } // -------------------------------------------------------------------------------- // Clone // -------------------------------------------------------------------------------- XSECAlgorithmHandler * DSIGAlgorithmHandlerDefault::clone(void) const { DSIGAlgorithmHandlerDefault * ret; XSECnew(ret, DSIGAlgorithmHandlerDefault); return ret; } // -------------------------------------------------------------------------------- // Add a hash txfm // -------------------------------------------------------------------------------- TXFMBase * addHashTxfm(signatureMethod sm, hashMethod hm, XSECCryptoKey * key, DOMDocument * doc) { // Given a hash method and signature method, create an appropriate TXFM TXFMBase * txfm; switch (hm) { case HASH_MD5 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMMD5(doc, key)); } else { XSECnew(txfm, TXFMMD5(doc)); } break; case HASH_SHA1 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMSHA1(doc, HASH_SHA1, key)); } else { XSECnew(txfm, TXFMSHA1(doc)); } break; case HASH_SHA224 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMSHA1(doc, HASH_SHA224, key)); } else { XSECnew(txfm, TXFMSHA1(doc, HASH_SHA224)); } break; case HASH_SHA256 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMSHA1(doc, HASH_SHA256, key)); } else { XSECnew(txfm, TXFMSHA1(doc, HASH_SHA256)); } break; case HASH_SHA384 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMSHA1(doc, HASH_SHA384, key)); } else { XSECnew(txfm, TXFMSHA1(doc, HASH_SHA384)); } break; case HASH_SHA512 : if (sm == SIGNATURE_HMAC){ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature"); } XSECnew(txfm, TXFMSHA1(doc, HASH_SHA512, key)); } else { XSECnew(txfm, TXFMSHA1(doc, HASH_SHA512)); } break; default : throw XSECException(XSECException::AlgorithmMapperError, "Hash method unknown in DSIGAlgorithmHandlerDefault::addHashTxfm"); } return txfm; } // -------------------------------------------------------------------------------- // Map a Signature hash // -------------------------------------------------------------------------------- bool DSIGAlgorithmHandlerDefault::appendSignatureHashTxfm(TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key) { signatureMethod sm; hashMethod hm; // Map to internal constants if (!XSECmapURIToSignatureMethods(URI, sm, hm)) { safeBuffer sb; sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : "); sb.sbXMLChCat(URI); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } // Now append the appropriate hash transform onto the end of the chain // If this is an HMAC of some kind - this function will add the appropriate key TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument()); inputBytes->appendTxfm(htxfm); return true; } // -------------------------------------------------------------------------------- // Sign // -------------------------------------------------------------------------------- unsigned int DSIGAlgorithmHandlerDefault::signToSafeBuffer( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key, unsigned int outputLength, safeBuffer & result) { signatureMethod sm; hashMethod hm; // Map to internal constants if (!XSECmapURIToSignatureMethods(URI, sm, hm)) { safeBuffer sb; sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : "); sb.sbXMLChCat(URI); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } // Now append the appropriate hash transform onto the end of the chain // If this is an HMAC of some kind - this function will add the appropriate key TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument()); inputBytes->appendTxfm(htxfm); unsigned char hash[4096]; int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096); // Now check the calculated hash // For now, use a fixed length buffer, but expand it, // and detect if the signature size exceeds what we can // handle. char b64Buf[MAXB64BUFSIZE]; unsigned int b64Len; safeBuffer b64SB; switch (key->getKeyType()) { case (XSECCryptoKey::KEY_DSA_PRIVATE) : case (XSECCryptoKey::KEY_DSA_PAIR) : if (sm != SIGNATURE_DSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } b64Len = ((XSECCryptoKeyDSA *) key)->signBase64Signature( hash, hashLen, (char *) b64Buf, MAXB64BUFSIZE); if (b64Len <= 0) { throw XSECException(XSECException::AlgorithmMapperError, "Unknown error occured during a DSA Signing operation"); } else if (b64Len >= MAXB64BUFSIZE) { throw XSECException(XSECException::AlgorithmMapperError, "DSA Signing operation exceeded size of buffer"); } if (b64Buf[b64Len-1] == '\n') b64Buf[b64Len-1] = '\0'; else b64Buf[b64Len] = '\0'; break; case (XSECCryptoKey::KEY_RSA_PRIVATE) : case (XSECCryptoKey::KEY_RSA_PAIR) : if (sm != SIGNATURE_RSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } b64Len = ((XSECCryptoKeyRSA *) key)->signSHA1PKCS1Base64Signature( hash, hashLen, (char *) b64Buf, MAXB64BUFSIZE, hm); if (b64Len <= 0) { throw XSECException(XSECException::AlgorithmMapperError, "Unknown error occured during a RSA Signing operation"); } else if (b64Len >= MAXB64BUFSIZE) { throw XSECException(XSECException::AlgorithmMapperError, "RSA Signing operation exceeded size of buffer"); } // Clean up some "funnies" and make sure the string is NULL terminated if (b64Buf[b64Len-1] == '\n') b64Buf[b64Len-1] = '\0'; else b64Buf[b64Len] = '\0'; break; case (XSECCryptoKey::KEY_EC_PRIVATE) : case (XSECCryptoKey::KEY_EC_PAIR) : if (sm != SIGNATURE_ECDSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } b64Len = ((XSECCryptoKeyEC *) key)->signBase64SignatureDSA( hash, hashLen, (char *) b64Buf, MAXB64BUFSIZE); if (b64Len <= 0) { throw XSECException(XSECException::AlgorithmMapperError, "Unknown error occured during an ECDSA Signing operation"); } else if (b64Len >= MAXB64BUFSIZE) { throw XSECException(XSECException::AlgorithmMapperError, "ECDSA Signing operation exceeded size of buffer"); } if (b64Buf[b64Len-1] == '\n') b64Buf[b64Len-1] = '\0'; else b64Buf[b64Len] = '\0'; break; case (XSECCryptoKey::KEY_HMAC) : if (sm != SIGNATURE_HMAC) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } // Signature already created, so just translate to base 64 and enter string // FIX: CVE-2009-0217 if (outputLength > 0 && (outputLength > hashLen || outputLength < 80 || outputLength < hashLen / 2)) { throw XSECException(XSECException::AlgorithmMapperError, "HMACOutputLength set to unsafe value."); } convertRawToBase64String(b64SB, hash, hashLen, outputLength); strncpy(b64Buf, (char *) b64SB.rawBuffer(), MAXB64BUFSIZE); break; default : throw XSECException(XSECException::AlgorithmMapperError, "Key found, but don't know how to sign the document using it"); } result = b64Buf; return (unsigned int) strlen(b64Buf); } // -------------------------------------------------------------------------------- // Verify // -------------------------------------------------------------------------------- bool DSIGAlgorithmHandlerDefault::verifyBase64Signature( TXFMChain * inputBytes, const XMLCh * URI, const char * sig, unsigned int outputLength, XSECCryptoKey * key) { signatureMethod sm; hashMethod hm; // Map to internal constants if (!XSECmapURIToSignatureMethods(URI, sm, hm)) { safeBuffer sb; sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : "); sb.sbXMLChCat(URI); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } // Now append the appropriate hash transform onto the end of the chain // If this is an HMAC of some kind - this function will add the appropriate key TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument()); inputBytes->appendTxfm(htxfm); unsigned char hash[4096]; int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096); // Now check the calculated hash bool sigVfyRet = false; switch (key->getKeyType()) { case (XSECCryptoKey::KEY_DSA_PUBLIC) : case (XSECCryptoKey::KEY_DSA_PAIR) : if (sm != SIGNATURE_DSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } sigVfyRet = ((XSECCryptoKeyDSA *) key)->verifyBase64Signature( hash, hashLen, (char *) sig, (unsigned int) strlen(sig)); break; case (XSECCryptoKey::KEY_RSA_PUBLIC) : case (XSECCryptoKey::KEY_RSA_PAIR) : if (sm != SIGNATURE_RSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } sigVfyRet = ((XSECCryptoKeyRSA *) key)->verifySHA1PKCS1Base64Signature( hash, hashLen, sig, (unsigned int) strlen(sig), hm); break; case (XSECCryptoKey::KEY_EC_PUBLIC) : case (XSECCryptoKey::KEY_EC_PAIR) : if (sm != SIGNATURE_ECDSA) { throw XSECException(XSECException::AlgorithmMapperError, "Key type does not match signature type"); } sigVfyRet = ((XSECCryptoKeyEC *) key)->verifyBase64SignatureDSA( hash, hashLen, (char *) sig, (unsigned int) strlen(sig)); break; case (XSECCryptoKey::KEY_HMAC) : // Already done - just compare calculated value with read value // FIX: CVE-2009-0217 if (outputLength > 0 && (outputLength > hashLen || outputLength < 80 || outputLength < hashLen / 2)) { throw XSECException(XSECException::AlgorithmMapperError, "HMACOutputLength set to unsafe value."); } sigVfyRet = compareBase64StringToRaw(sig, hash, hashLen, outputLength); break; default : throw XSECException(XSECException::AlgorithmMapperError, "Key found, but don't know how to check the signature using it"); } return sigVfyRet; } // -------------------------------------------------------------------------------- // Hash TXFM appenders // -------------------------------------------------------------------------------- bool DSIGAlgorithmHandlerDefault::appendHashTxfm( TXFMChain * inputBytes, const XMLCh * URI) { hashMethod hm; // Is this a URI we recognise? if (!XSECmapURIToHashMethod(URI, hm)) { safeBuffer sb; sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown Hash URI : "); sb.sbXMLChCat(URI); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } TXFMBase * txfm; DOMDocument *d = inputBytes->getLastTxfm()->getDocument(); switch (hm) { case HASH_SHA1 : case HASH_SHA224 : case HASH_SHA256 : case HASH_SHA384 : case HASH_SHA512 : XSECnew(txfm, TXFMSHA1(d, hm)); break; case HASH_MD5 : XSECnew(txfm, TXFMMD5(d)); break; default : safeBuffer sb; sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Internal error unknown Hash, but URI known. URI : "); sb.sbXMLChCat(URI); throw XSECException(XSECException::AlgorithmMapperError, sb.rawXMLChBuffer()); } inputBytes->appendTxfm(txfm); return true; } // -------------------------------------------------------------------------------- // SafeBuffer decryption // -------------------------------------------------------------------------------- unsigned int DSIGAlgorithmHandlerDefault::decryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, DOMDocument * doc, safeBuffer & result ) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault - Encryption operations not supported"); } bool DSIGAlgorithmHandlerDefault::appendDecryptCipherTXFM( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc ) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault - Encryption operations not supported"); } // -------------------------------------------------------------------------------- // SafeBuffer encryption // -------------------------------------------------------------------------------- bool DSIGAlgorithmHandlerDefault::encryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault - Encryption operations not supported"); } // -------------------------------------------------------------------------------- // Key Creation // -------------------------------------------------------------------------------- XSECCryptoKey * DSIGAlgorithmHandlerDefault::createKeyForURI( const XMLCh * uri, const unsigned char * keyBuffer, unsigned int keyLen ) { throw XSECException(XSECException::AlgorithmMapperError, "DSIGAlgorithmHandlerDefault - Key creation operations not supported"); } xml-security-c-1.7.3/xsec/dsig/DSIGXPathFilterExpr.cpp000644 001751 001751 00000017771 12003301053 023671 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGXPathFilterExpr := Class that holds an XPath Filter expression * * Author(s): Berin Lautenbach * * $Id: DSIGXPathFilterExpr.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE XMLCh filterStr[] = { chLatin_F, chLatin_i, chLatin_l, chLatin_t, chLatin_e, chLatin_r, chNull }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGXPathFilterExpr::DSIGXPathFilterExpr(const XSECEnv * env, DOMNode * node) : mp_env(env), mp_xpathFilterNode(node), mp_NSMap(NULL), m_loaded(false) { } DSIGXPathFilterExpr::DSIGXPathFilterExpr(const XSECEnv * env) : mp_env(env), mp_xpathFilterNode(NULL), mp_NSMap(NULL), m_loaded(false) { } DSIGXPathFilterExpr::~DSIGXPathFilterExpr() { // Nothing to do at the moment } // -------------------------------------------------------------------------------- // Load existing DOM structure // -------------------------------------------------------------------------------- void DSIGXPathFilterExpr::load(void) { // Find the XPath expression if (mp_xpathFilterNode == NULL || !strEquals(getXPFLocalName(mp_xpathFilterNode), "XPath")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as first node in DSIGXPathFilterExpr::load"); } // Check for attributes - in particular any namespaces mp_NSMap = mp_xpathFilterNode->getAttributes(); // Find the filter type DOMNode * a; if (mp_NSMap == NULL || ((a = mp_NSMap->getNamedItem(filterStr)) == NULL)) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Filter attribute of node in in DSIGXPathFilterExpr::load"); } const XMLCh * f = a->getNodeValue(); if (strEquals(f, "intersect")) { m_filterType = FILTER_INTERSECT; } else if (strEquals(f, "union")) { m_filterType = FILTER_UNION; } else if (strEquals(f, "subtract")) { m_filterType = FILTER_SUBTRACT; } else { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGXPathFilterExpr::load Expected on of intersect, union or subtract as filter type"); } // Find the text node mp_exprTextNode = findFirstChildOfType(mp_xpathFilterNode, DOMNode::TEXT_NODE); if (mp_exprTextNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Text Node in beneath in DSIGXPathFilterExpr::load"); } // Gather the text - hold it in UTF16 format gatherChildrenText(mp_xpathFilterNode, m_expr); m_loaded = true; } // -------------------------------------------------------------------------------- // Create a new filter // -------------------------------------------------------------------------------- DOMElement * DSIGXPathFilterExpr::setFilter(xpathFilterType filterType, const XMLCh * filterExpr) { if (m_loaded == true) { throw XSECException(XSECException::XPathFilterError, "DSIGXPathFilterExpr::setFilter - called when already loaded"); } safeBuffer str; const XMLCh * prefix; DOMDocument *doc = mp_env->getParentDocument(); DOMElement * xe; // Create the XPath element prefix = mp_env->getXPFNSPrefix(); makeQName(str, prefix, "XPath"); xe = doc->createElementNS(DSIGConstants::s_unicodeStrURIXPF, str.rawXMLChBuffer()); mp_xpathFilterNode = xe; // Put in correct namespace prefix = mp_env->getXPFNSPrefix(); // Set the namespace attribute if (prefix[0] == '\0') { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } xe->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIXPF); // Set the filter type m_filterType = filterType; switch (filterType) { case FILTER_INTERSECT : xe->setAttributeNS(NULL,MAKE_UNICODE_STRING("Filter"), MAKE_UNICODE_STRING("intersect")); break; case FILTER_SUBTRACT : xe->setAttributeNS(NULL,MAKE_UNICODE_STRING("Filter"), MAKE_UNICODE_STRING("subtract")); break; case FILTER_UNION : xe->setAttributeNS(NULL,MAKE_UNICODE_STRING("Filter"), MAKE_UNICODE_STRING("union")); break; default : mp_xpathFilterNode->release(); throw XSECException(XSECException::XPathFilterError, "DSIGXPathFilterExpr::appendFilter - Unexpected Filter Type"); } // Now add the actual filter mp_exprTextNode = doc->createTextNode(filterExpr); mp_xpathFilterNode->appendChild(mp_exprTextNode); mp_NSMap = mp_xpathFilterNode->getAttributes(); m_expr.sbXMLChIn(filterExpr); m_loaded = true; return xe; } // -------------------------------------------------------------------------------- // Find the type // -------------------------------------------------------------------------------- xpathFilterType DSIGXPathFilterExpr::getFilterType(void) { if (m_loaded == false) { throw XSECException(XSECException::LoadEmptyXPathFilter, "DSIGXPathFilterExpr::Element node loaded"); } return m_filterType; } // -------------------------------------------------------------------------------- // Set and clear namespaces // -------------------------------------------------------------------------------- void DSIGXPathFilterExpr::setNamespace(const XMLCh * prefix, const XMLCh * value) { if (mp_xpathFilterNode == NULL) { throw XSECException(XSECException::XPathFilterError, "DSIGXPathFilterExpr::setNamespace - load not called"); } safeBuffer str; str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); DOMElement *x; x = static_cast (mp_xpathFilterNode); x->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), value); mp_NSMap = mp_xpathFilterNode->getAttributes(); } void DSIGXPathFilterExpr::deleteNamespace(const XMLCh * prefix) { if (mp_xpathFilterNode == NULL) { throw XSECException(XSECException::XPathFilterError, "DSIGXPathFilterExpr::deleteNamespace - load not called"); } DOMElement *x; x = static_cast (mp_xpathFilterNode); x->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, prefix); } /** * \brief Add a new namespace to the list to be used * * Add a new namespace to the XPath Element. * * @param prefix NCName of the Namespace to set * @param value The string with the URI to set */ // void setNamespace(const char * prefix, const char * value); /** * \brief Get the list of namespaces. * * Returns the DOMNamedNodeMap of the attributes of the XPath transform * node. This should only contain namespaces. * * @returns A pointer to the NamedNodeMap */ // DOMNamedNodeMap * getNamespaces(void) { // return mp_NSMap; // } /** * \brief Delete a namespace to the list to be used * * Delete a namespace from the XPath Element. * * @param prefix NCName of the Namespace to delete * @throws XSECException if the NCName does not exist * */ // void deleteNamespace(const char * prefix); //@} xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoMgmtData.cpp000644 001751 001751 00000007770 12003301053 023621 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoMgmtData := Inband key information * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoMgmtData.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoMgmtData::DSIGKeyInfoMgmtData(const XSECEnv * env, DOMNode *nameNode) : DSIGKeyInfo(env), mp_data(NULL), mp_dataTextNode(0) { mp_keyInfoDOMNode = nameNode; } DSIGKeyInfoMgmtData::DSIGKeyInfoMgmtData(const XSECEnv * env) : DSIGKeyInfo(env), mp_data(NULL), mp_dataTextNode(0) { mp_keyInfoDOMNode = 0; } DSIGKeyInfoMgmtData::~DSIGKeyInfoMgmtData() { }; // -------------------------------------------------------------------------------- // Load and Get functions // -------------------------------------------------------------------------------- void DSIGKeyInfoMgmtData::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoMgmtData::load - called on empty DOM"); } if (!strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "MgmtData")) { throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoMgmtData::load - called on non node"); } // Now find the text node containing the name DOMNode *tmpElt = findFirstChildOfType(mp_keyInfoDOMNode, DOMNode::TEXT_NODE); if (tmpElt != 0) { mp_dataTextNode = tmpElt; mp_data = tmpElt->getNodeValue(); } else { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGKeyInfoMgmtData::load - Expected TEXT node as child to element"); } } // -------------------------------------------------------------------------------- // Create and Set functions // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoMgmtData::createBlankMgmtData(const XMLCh * data) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "MgmtData"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; // Check whether to encode prior to adding mp_dataTextNode = doc->createTextNode(data); ret->appendChild(mp_dataTextNode); mp_data = mp_dataTextNode->getNodeValue(); return ret; } void DSIGKeyInfoMgmtData::setData(const XMLCh * data) { if (mp_dataTextNode == 0) { // Attempt to set an empty element throw XSECException(XSECException::KeyInfoError, "KeyInfoMgmtData::setData() called prior to load() or createBlank()"); } mp_dataTextNode->setNodeValue(data); mp_data = mp_dataTextNode->getNodeValue(); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformXPathFilter.cpp000644 001751 001751 00000012375 12003301053 024721 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXPathFilter := Class that performs XPath Filter * transforms * * Author(s): Berin Lautenbach * * $Id: DSIGTransformXPathFilter.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- DSIGTransformXPathFilter::DSIGTransformXPathFilter(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node), m_loaded(false) { } DSIGTransformXPathFilter::DSIGTransformXPathFilter(const XSECEnv * env) : DSIGTransform(env), m_loaded(false) { } DSIGTransformXPathFilter::~DSIGTransformXPathFilter() { exprVectorType::iterator i; for (i = m_exprs.begin(); i != m_exprs.end(); ++i) { delete (*i); } } transformType DSIGTransformXPathFilter::getTransformType() { return TRANSFORM_XPATH_FILTER; } void DSIGTransformXPathFilter::appendTransformer(TXFMChain * input) { if (m_loaded == false) { throw XSECException(XSECException::XPathFilterError, "DSIGTransformXPathFilter::appendTransform - load not yet called"); } #ifdef XSEC_NO_XPATH throw XSECException(XSECException::UnsupportedFunction, "XPath transforms are not supported in this compilation of the XSEC library"); #else TXFMXPathFilter *xpf; // XPath transform XSECnew(xpf, TXFMXPathFilter(mp_txfmNode->getOwnerDocument())); input->appendTxfm(xpf); // These can throw, but the TXFMXPathFilter is now owned by the chain, so will // be cleaned up down the calling stack. xpf->evaluateExprs(&m_exprs); #endif /* NO_XPATH */ } // -------------------------------------------------------------------------------- // Create a blank transform // -------------------------------------------------------------------------------- DOMElement * DSIGTransformXPathFilter::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIXPF); mp_txfmNode = ret; m_loaded = true; return ret; } DSIGXPathFilterExpr * DSIGTransformXPathFilter::appendFilter(xpathFilterType filterType, const XMLCh * filterExpr) { DSIGXPathFilterExpr * e; XSECnew(e, DSIGXPathFilterExpr(mp_env)); DOMNode * elt = e->setFilter(filterType, filterExpr); m_exprs.push_back(e); mp_txfmNode->appendChild(elt); mp_env->doPrettyPrint(mp_txfmNode); return e; } // -------------------------------------------------------------------------------- // Load from XML // -------------------------------------------------------------------------------- void DSIGTransformXPathFilter::load(void) { if (mp_txfmNode == NULL) { throw XSECException(XSECException::XPathFilterError, "DSIGTransformXPathFilter::load called on NULL node"); } // Very simple - go through each child. If it's an XPath child // Create the DSIGXPathFilterExpr object DOMNode * n = mp_txfmNode->getFirstChild(); while (n != NULL) { if (n->getNodeType() == DOMNode::ELEMENT_NODE && strEquals(getXPFLocalName(n), "XPath")) { DSIGXPathFilterExpr * xpf; XSECnew(xpf, DSIGXPathFilterExpr(mp_env, n)); // Add it to the vector prior to load to ensure deleted if // anything throws an exception m_exprs.push_back(xpf); xpf->load(); } n = n->getNextSibling(); } m_loaded = true; } // -------------------------------------------------------------------------------- // Retrieve expression information // -------------------------------------------------------------------------------- unsigned int DSIGTransformXPathFilter::getExprNum(void) { return (unsigned int) m_exprs.size(); } DSIGXPathFilterExpr * DSIGTransformXPathFilter::expr(unsigned int n) { if (n < m_exprs.size()) return m_exprs[n]; return NULL; } xml-security-c-1.7.3/xsec/dsig/DSIGSignedInfo.cpp000644 001751 001751 00000030512 12157706440 022674 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGSignedInfo := Class for checking and setting up signed Info nodes in a DSIG signature * * $Id: DSIGSignedInfo.cpp 1493959 2013-06-17 22:26:41Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // Constructors and Destructors DSIGSignedInfo::DSIGSignedInfo(DOMDocument *doc, XSECSafeBufferFormatter * pFormatter, DOMNode *signedInfoNode, const XSECEnv * env) { mp_doc = doc; m_HMACOutputLength = 0; mp_formatter = pFormatter; mp_signedInfoNode = signedInfoNode; m_signatureMethod = SIGNATURE_NONE; mp_env = env; mp_referenceList = NULL; m_loaded = false; } DSIGSignedInfo::DSIGSignedInfo(DOMDocument *doc, XSECSafeBufferFormatter * pFormatter, const XSECEnv * env) { mp_doc = doc; m_HMACOutputLength = 0; mp_formatter = pFormatter; mp_signedInfoNode = NULL; m_signatureMethod = SIGNATURE_NONE; mp_env = env; mp_referenceList = NULL; m_loaded = false; } DSIGSignedInfo::~DSIGSignedInfo() { mp_formatter = NULL; mp_env = NULL; if (mp_referenceList != NULL) { delete mp_referenceList; mp_referenceList = NULL; } } signatureMethod DSIGSignedInfo::getSignatureMethod(void) { return m_signatureMethod; } DOMNode * DSIGSignedInfo::getDOMNode() { return mp_signedInfoNode; } canonicalizationMethod DSIGSignedInfo::getCanonicalizationMethod(void) { return m_canonicalizationMethod; } hashMethod DSIGSignedInfo::getHashMethod() { return m_hashMethod; } int DSIGSignedInfo::getHMACOutputLength() { return m_HMACOutputLength; } // -------------------------------------------------------------------------------- // Verify each reference element // -------------------------------------------------------------------------------- bool DSIGSignedInfo::verify(safeBuffer &errStr) { return DSIGReference::verifyReferenceList(mp_referenceList, errStr); } // -------------------------------------------------------------------------------- // Calculate and set hash values for each reference element // -------------------------------------------------------------------------------- void DSIGSignedInfo::hash(bool interlockingReferences) { DSIGReference::hashReferenceList(mp_referenceList, interlockingReferences); } // -------------------------------------------------------------------------------- // Create an empty reference in the signed info // -------------------------------------------------------------------------------- DSIGReference * DSIGSignedInfo::createReference(const XMLCh * URI, hashMethod hm, char * type) { safeBuffer hURI; if (hashMethod2URI(hURI, hm) == false) { throw XSECException(XSECException::UnknownSignatureAlgorithm, "DSIGSignedInfo::createReference - Hash method unknown"); } return createReference(URI, hURI.sbStrToXMLCh(), MAKE_UNICODE_STRING(type));; } DSIGReference * DSIGSignedInfo::createReference( const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type) { DSIGReference * ref; XSECnew(ref, DSIGReference(mp_env)); Janitor j_ref(ref); DOMNode *refNode = ref->createBlankReference(URI, hashAlgorithmURI, type); // Add the node to the end of the childeren mp_signedInfoNode->appendChild(refNode); mp_env->doPrettyPrint(mp_signedInfoNode); // Add to the reference List j_ref.release(); mp_referenceList->addReference(ref); return ref; } DSIGReference * DSIGSignedInfo::removeReference(DSIGReferenceList::size_type index) { DSIGReference* ret = mp_referenceList ? mp_referenceList->removeReference(index): NULL; if (ret && mp_signedInfoNode) { mp_signedInfoNode->removeChild(ret->mp_referenceNode); mp_env->doPrettyPrint(mp_signedInfoNode); } return ret; } // -------------------------------------------------------------------------------- // Create an empty SignedInfo // -------------------------------------------------------------------------------- // deprecated DOMElement *DSIGSignedInfo::createBlankSignedInfo(canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { // This is now deprecated. Because this is so, we go the long way - translate // to URI and then call the "standard" method, which will translate back to // internal enums if possible const XMLCh * cURI; safeBuffer sURI; if ((cURI = canonicalizationMethod2UNICODEURI(cm)) == NULL) { throw XSECException(XSECException::UnknownCanonicalization, "DSIGSignature::createBlankSignature - Canonicalisation method unknown"); } if (signatureHashMethod2URI(sURI, sm, hm) == false) { throw XSECException(XSECException::UnknownSignatureAlgorithm, "DSIGSignature::createBlankSignature - Signature/Hash method unknown"); } return createBlankSignedInfo(cURI, sURI.sbStrToXMLCh()); } DOMElement * DSIGSignedInfo::createBlankSignedInfo( const XMLCh * canonicalizationAlgorithmURI, const XMLCh * signatureAlgorithmURI) { safeBuffer str; const XMLCh * prefixNS = mp_env->getDSIGNSPrefix(); makeQName(str, prefixNS, "SignedInfo"); DOMElement *ret = mp_doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_signedInfoNode = ret; // Now create the algorithm parts XSECmapURIToCanonicalizationMethod(canonicalizationAlgorithmURI, m_canonicalizationMethod); XSECmapURIToSignatureMethods(signatureAlgorithmURI, m_signatureMethod, m_hashMethod); // Canonicalisation DOMElement *canMeth = mp_doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, makeQName(str, prefixNS, "CanonicalizationMethod").rawXMLChBuffer()); mp_env->doPrettyPrint(mp_signedInfoNode); mp_signedInfoNode->appendChild(canMeth); mp_env->doPrettyPrint(mp_signedInfoNode); canMeth->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, canonicalizationAlgorithmURI); // Now the SignatureMethod DOMElement *sigMeth = mp_doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, makeQName(str, prefixNS, "SignatureMethod").rawXMLChBuffer()); mp_signedInfoNode->appendChild(sigMeth); mp_env->doPrettyPrint(mp_signedInfoNode); sigMeth->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, signatureAlgorithmURI); // Store the algorithm URI internally mp_algorithmURI = sigMeth->getAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); // Create an empty reference list XSECnew(mp_referenceList, DSIGReferenceList()); return ret; } // -------------------------------------------------------------------------------- // Load the SignedInfo // -------------------------------------------------------------------------------- void DSIGSignedInfo::load(void) { if (mp_signedInfoNode == 0) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptySignedInfo); } if (!strEquals(getDSIGLocalName(mp_signedInfoNode), "SignedInfo")) { throw XSECException(XSECException::LoadNonSignedInfo); } DOMNode * tmpSI = mp_signedInfoNode->getFirstChild(); // Check for CanonicalizationMethod while (tmpSI != 0 && (tmpSI->getNodeType() != DOMNode::ELEMENT_NODE)) { if (tmpSI->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } // Skip text and comments tmpSI = tmpSI->getNextSibling(); } if (tmpSI == 0 || !strEquals(getDSIGLocalName(tmpSI), "CanonicalizationMethod")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as first child of "); } // Determine what the canonicalization method is DOMNamedNodeMap *tmpAtts = tmpSI->getAttributes(); DOMNode *algorithm = tmpAtts->getNamedItem(DSIGConstants::s_unicodeStrAlgorithm); if (algorithm == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Algorithm attribute in "); } safeBuffer tmpSB; tmpSB << (*mp_formatter << algorithm->getNodeValue()); if (tmpSB.sbStrcmp(URI_ID_C14N_NOC) == 0) { m_canonicalizationMethod = CANON_C14N_NOC; } else if (tmpSB.sbStrcmp(URI_ID_C14N_COM) == 0) { m_canonicalizationMethod = CANON_C14N_COM; } else if (tmpSB.sbStrcmp(URI_ID_C14N11_NOC) == 0) { m_canonicalizationMethod = CANON_C14N11_NOC; } else if (tmpSB.sbStrcmp(URI_ID_C14N11_COM) == 0) { m_canonicalizationMethod = CANON_C14N11_COM; } else if (tmpSB.sbStrcmp(URI_ID_EXC_C14N_COM) == 0) { m_canonicalizationMethod = CANON_C14NE_COM; } else if (tmpSB.sbStrcmp(URI_ID_EXC_C14N_NOC) == 0) { m_canonicalizationMethod = CANON_C14NE_NOC; } else { throw XSECException(XSECException::UnknownCanonicalization); } // Now load the SignatureMethod tmpSI = tmpSI->getNextSibling(); while (tmpSI != 0 && (tmpSI->getNodeType() != DOMNode::ELEMENT_NODE)) { if (tmpSI->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } // Skip text and comments tmpSI = tmpSI->getNextSibling(); } if (tmpSI == 0 || !strEquals(getDSIGLocalName(tmpSI), "SignatureMethod")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as child of "); } // Determine the algorithms used to sign this document tmpAtts = tmpSI->getAttributes(); algorithm = tmpAtts->getNamedItem(DSIGConstants::s_unicodeStrAlgorithm); if (algorithm == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Algorithm attribute in "); } mp_algorithmURI = algorithm->getNodeValue(); /* NOTE - as of version 1.3.1 all code relating to parsing the algorithm * has been removed. This should all be handled inside the algorithm mappers. * Having code here restricts available algorithms, as this code is not extended for * new algorthms. */ /* Look for maximum output value. Really only applies to HMACs, but as we no * longer know at this point if this is an HMAC, we need to check. */ DOMNode *tmpSOV = tmpSI->getFirstChild(); while (tmpSOV != NULL && (tmpSOV->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(tmpSOV), "HMACOutputLength"))) { if (tmpSOV->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } tmpSOV = tmpSOV->getNextSibling(); } if (tmpSOV != NULL) { // Have a max output value! tmpSOV = tmpSOV->getFirstChild(); while (tmpSOV != NULL && tmpSOV->getNodeType() != DOMNode::TEXT_NODE) tmpSOV = tmpSOV->getNextSibling(); if (tmpSOV != NULL) { safeBuffer val; val << (*mp_formatter << tmpSOV->getNodeValue()); m_HMACOutputLength = atoi((char *) val.rawBuffer()); } } // Now look at references.... tmpSI = tmpSI->getNextSibling(); // Run through the rest of the elements until done while (tmpSI != 0 && (tmpSI->getNodeType() != DOMNode::ELEMENT_NODE)) { if (tmpSI->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } // Skip text and comments tmpSI = tmpSI->getNextSibling(); } if (tmpSI != NULL) { // Have an element node - should be a reference, so let's load the list mp_referenceList = DSIGReference::loadReferenceListFromXML(mp_env, tmpSI); } } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoList.cpp000644 001751 001751 00000033577 12003301053 023042 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoList := Class for Loading and storing a list of KeyInfo elements * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoList.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../xenc/impl/XENCEncryptedKeyImpl.hpp" #include XERCES_CPP_NAMESPACE_USE DSIGKeyInfoList::DSIGKeyInfoList(const XSECEnv * env) : mp_env(env), mp_keyInfoNode(NULL) {} DSIGKeyInfoList::~DSIGKeyInfoList() { empty(); } // Actions void DSIGKeyInfoList::addKeyInfo(DSIGKeyInfo * ref) { m_keyInfoList.push_back(ref); } DSIGKeyInfo * DSIGKeyInfoList::removeKeyInfo(size_type index) { if (index < m_keyInfoList.size()) return m_keyInfoList[index]; return NULL; } size_t DSIGKeyInfoList::getSize() const { return m_keyInfoList.size(); } DSIGKeyInfo * DSIGKeyInfoList::item(size_type index) { if (index < m_keyInfoList.size()) return m_keyInfoList[index]; return NULL; } const DSIGKeyInfo * DSIGKeyInfoList::item(size_type index) const { if (index < m_keyInfoList.size()) return m_keyInfoList[index]; return NULL; } void DSIGKeyInfoList::empty() { size_type i, s; s = getSize(); for (i = 0; i < s; ++i) delete m_keyInfoList[i]; m_keyInfoList.clear(); } bool DSIGKeyInfoList::isEmpty() const { return (m_keyInfoList.size() == 0); } // -------------------------------------------------------------------------------- // Add a KeyInfo based on XML DomNode source // -------------------------------------------------------------------------------- bool DSIGKeyInfoList::addXMLKeyInfo(DOMNode *ki) { // return true if successful - does not throw if the node type is unknown if (ki == 0) return false; DSIGKeyInfo * k; if (strEquals(getDSIGLocalName(ki), "X509Data")) { // Have a certificate! XSECnew(k, DSIGKeyInfoX509(mp_env, ki)); } else if (strEquals(getDSIGLocalName(ki), "KeyName")) { XSECnew(k, DSIGKeyInfoName(mp_env, ki)); } else if (strEquals(getDSIGLocalName(ki), "KeyValue")) { XSECnew(k, DSIGKeyInfoValue(mp_env, ki)); } else if (strEquals(getDSIGLocalName(ki), "PGPData")) { XSECnew(k, DSIGKeyInfoPGPData(mp_env, ki)); } else if (strEquals(getDSIGLocalName(ki), "SPKIData")) { XSECnew(k, DSIGKeyInfoSPKIData(mp_env, ki)); } else if (strEquals(getDSIGLocalName(ki), "MgmtData")) { XSECnew(k, DSIGKeyInfoMgmtData(mp_env, ki)); } else if (strEquals(getDSIG11LocalName(ki), "DEREncodedKeyValue")) { XSECnew(k, DSIGKeyInfoDEREncoded(mp_env, ki)); } else if (strEquals(getXENCLocalName(ki), "EncryptedKey")) { XSECnew(k, XENCEncryptedKeyImpl(mp_env, (DOMElement *) ki)); } else { XSECnew(k, DSIGKeyInfoExt(mp_env, ki)); } // Now we know what the element type is - do the load and save try { k->load(); } catch (...) { delete k; throw; } // Add this->addKeyInfo(k); return true; } // -------------------------------------------------------------------------------- // Retrieve a complete KeyInfo list // -------------------------------------------------------------------------------- bool DSIGKeyInfoList::loadListFromXML(DOMNode * node) { if (node == NULL || !strEquals(getDSIGLocalName(node), "KeyInfo")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGKeyInfoList::loadListFromXML - expected KeyInfo node"); } DOMNode *tmpKI = findFirstChildOfType(node, DOMNode::ELEMENT_NODE); while (tmpKI != 0) { // Find out what kind of KeyInfo child it is if (tmpKI != 0 && strEquals(getDSIGLocalName(tmpKI), "RetrievalMethod")) { // A reference to key information held elsewhere const XMLCh * URI = NULL; TXFMBase * currentTxfm; bool isRawX509 = false; DOMNamedNodeMap *atts = tmpKI->getAttributes(); const XMLCh * name; XMLSize_t size; if (atts == 0 || (size = atts->getLength()) == 0) return true; for (XMLSize_t i = 0; i < size; ++i) { name = atts->item(i)->getNodeName(); if (strEquals(name, "URI")) { URI = atts->item(i)->getNodeValue(); } else if (strEquals(name, "Type")) { // Check if this is a raw X509 cert if (strEquals(atts->item(i)->getNodeValue(), DSIGConstants::s_unicodeStrURIRawX509)) { isRawX509 = true; } } else if (strEquals(name, "Id")) { // For now ignore } else { safeBuffer tmp, error; error << (*mp_env->getSBFormatter() << name); tmp.sbStrcpyIn("Unknown attribute in Element : "); tmp.sbStrcatIn(error); throw XSECException(XSECException::UnknownDSIGAttribute, tmp.rawCharBuffer()); } } if (isRawX509 == true) { if (URI == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected to find a URI attribute in a rawX509RetrievalMethod KeyInfo"); } DSIGKeyInfoX509 * x509; XSECnew(x509, DSIGKeyInfoX509(mp_env)); x509->setRawRetrievalURI(URI); addKeyInfo(x509); } else { // Find base transform using the base URI currentTxfm = DSIGReference::getURIBaseTXFM(mp_env->getParentDocument(), URI, mp_env); TXFMChain * chain; XSECnew(chain, TXFMChain(currentTxfm)); Janitor j_chain(chain); // Now check for transforms DOMNode * tmpTran = tmpKI->getFirstChild(); while (tmpTran != 0 && (tmpTran->getNodeType() != DOMNode::ELEMENT_NODE)) // Skip text and comments tmpTran = tmpTran->getNextSibling(); if (tmpTran != 0 && strEquals(getDSIGLocalName(tmpTran), "Transforms")) { // Process the transforms using the static function. // For the moment we don't really support remote KeyInfos, so // Just built the transform list, process it and then destroy it. DSIGTransformList * l = DSIGReference::loadTransforms( tmpTran, mp_env->getSBFormatter(), mp_env); DSIGTransformList::TransformListVectorType::size_type size, i; size = l->getSize(); for (i = 0; i < size; ++ i) { try { l->item(i)->appendTransformer(chain); } catch (...) { delete l; throw; } } delete l; } // Find out the type of the final transform and process accordingly TXFMBase::nodeType type = chain->getLastTxfm()->getNodeType(); XSECXPathNodeList lst; const DOMNode * element; switch (type) { case TXFMBase::DOM_NODE_DOCUMENT : break; case TXFMBase::DOM_NODE_DOCUMENT_FRAGMENT : element = chain->getLastTxfm()->getFragmentNode(); if (element != NULL) addXMLKeyInfo((DOMNode *) element); break; case TXFMBase::DOM_NODE_XPATH_NODESET : lst = chain->getLastTxfm()->getXPathNodeList(); element = lst.getFirstNode(); while (element != NULL) { // Try to add each element - just call KeyInfoList add as it will // do the check to see if it is a valid KeyInfo addXMLKeyInfo((DOMNode *) element); element = lst.getNextNode(); } break; default : throw XSECException(XSECException::XPathError); } // Delete the transform chain chain->getLastTxfm()->deleteExpandedNameSpaces(); // Janitor will clean up chain } } /* if getNodeName == Retrieval Method */ // Now just run through each node type in turn to process "local" KeyInfos else { // This used to check the return value, and throw if the child was unknown. // Now, should handle all cases. addXMLKeyInfo(tmpKI); } if (tmpKI != NULL) tmpKI = tmpKI->getNextSibling(); while (tmpKI != NULL && (tmpKI->getNodeType() != DOMNode::ELEMENT_NODE)) tmpKI = tmpKI->getNextSibling(); } return true; } // -------------------------------------------------------------------------------- // Create new KeyInfo elements // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoList::createKeyInfo(void) { // Assume that someone else has looked after the DOM empty(); safeBuffer str; DOMDocument * doc = mp_env->getParentDocument(); makeQName(str, mp_env->getDSIGNSPrefix(), "KeyInfo"); DOMElement * ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoNode = ret; mp_env->doPrettyPrint(mp_keyInfoNode); return ret; } DSIGKeyInfoValue * DSIGKeyInfoList::appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create DSAKeyValue before creating KeyInfo"); } // Create the new element DSIGKeyInfoValue * v; XSECnew(v, DSIGKeyInfoValue(mp_env)); mp_keyInfoNode->appendChild(v->createBlankDSAKeyValue(P, Q, G, Y)); mp_env->doPrettyPrint(mp_keyInfoNode); // Add to the list addKeyInfo(v); return v; } DSIGKeyInfoValue * DSIGKeyInfoList::appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create RSAKeyValue before creating KeyInfo"); } // Create the new element DSIGKeyInfoValue * v; XSECnew(v, DSIGKeyInfoValue(mp_env)); mp_keyInfoNode->appendChild(v->createBlankRSAKeyValue(modulus, exponent)); mp_env->doPrettyPrint(mp_keyInfoNode); // Add to the list addKeyInfo(v); return v; } DSIGKeyInfoX509 * DSIGKeyInfoList::appendX509Data(void) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create X509Data before creating KeyInfo"); } DSIGKeyInfoX509 * x; XSECnew(x, DSIGKeyInfoX509(mp_env)); mp_keyInfoNode->appendChild(x->createBlankX509Data()); mp_env->doPrettyPrint(mp_keyInfoNode); // Add to the list addKeyInfo(x); return x; } DSIGKeyInfoName * DSIGKeyInfoList::appendKeyName(const XMLCh * name, bool isDName) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create KeyName before creating KeyInfo"); } DSIGKeyInfoName * n; XSECnew(n, DSIGKeyInfoName(mp_env)); mp_keyInfoNode->appendChild(n->createBlankKeyName(name, isDName)); mp_env->doPrettyPrint(mp_keyInfoNode); // Add to the list addKeyInfo(n); return n; } DSIGKeyInfoPGPData * DSIGKeyInfoList::appendPGPData(const XMLCh * id, const XMLCh * packet) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create PGPData before creating KeyInfo"); } DSIGKeyInfoPGPData * p; XSECnew(p, DSIGKeyInfoPGPData(mp_env)); mp_keyInfoNode->appendChild(p->createBlankPGPData(id, packet)); mp_env->doPrettyPrint(mp_keyInfoNode); addKeyInfo(p); return p; } DSIGKeyInfoSPKIData * DSIGKeyInfoList::appendSPKIData(const XMLCh * sexp) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create SPKIData before creating KeyInfo"); } DSIGKeyInfoSPKIData * s; XSECnew(s, DSIGKeyInfoSPKIData(mp_env)); mp_keyInfoNode->appendChild(s->createBlankSPKIData(sexp)); mp_env->doPrettyPrint(mp_keyInfoNode); addKeyInfo(s); return s; } DSIGKeyInfoMgmtData * DSIGKeyInfoList::appendMgmtData(const XMLCh * data) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create MgmtData before creating KeyInfo"); } DSIGKeyInfoMgmtData * m; XSECnew(m, DSIGKeyInfoMgmtData(mp_env)); mp_keyInfoNode->appendChild(m->createBlankMgmtData(data)); mp_env->doPrettyPrint(mp_keyInfoNode); addKeyInfo(m); return m; } DSIGKeyInfoDEREncoded * DSIGKeyInfoList::appendDEREncoded(const XMLCh * data) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create DEREncodedKeyValue before creating KeyInfo"); } DSIGKeyInfoDEREncoded * d; XSECnew(d, DSIGKeyInfoDEREncoded(mp_env)); mp_keyInfoNode->appendChild(d->createBlankDEREncoded(data)); mp_env->doPrettyPrint(mp_keyInfoNode); addKeyInfo(d); return d; } // -------------------------------------------------------------------------------- // Some helper functions // -------------------------------------------------------------------------------- void DSIGKeyInfoList::addAndInsertKeyInfo(DSIGKeyInfo * ref) { if (mp_keyInfoNode == NULL) { throw XSECException(XSECException::KeyInfoError, "KeyInfoList - Attempt to create child before creating KeyInfo"); } mp_keyInfoNode->appendChild(ref->getKeyInfoDOMNode()); mp_env->doPrettyPrint(mp_keyInfoNode); addKeyInfo(ref); } xml-security-c-1.7.3/xsec/dsig/DSIGConstants.cpp000644 001751 001751 00000052500 12003301053 022601 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGConstants := Definitions of varius DSIG constants (mainly strings) * * Author(s): Berin Lautenbach * * $Id: DSIGConstants.cpp 1363191 2012-07-19 00:33:46Z scantor $ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // We need a special version of XSEC_RELEASE_XMLCH #undef XSEC_RELEASE_XMLCH #if defined (XSEC_XERCES_XMLSTRING_HAS_RELEASE) # define XSEC_RELEASE_XMLCH(x) XMLString::release((XMLCh **) &x) #else # define XSEC_RELEASE_XMLCH(x) delete[] x; #endif // -------------------------------------------------------------------------------- // Some useful defines // -------------------------------------------------------------------------------- static XMLCh s_dsa[] = { chLatin_d, chLatin_s, chLatin_a, chNull }; static XMLCh s_rsa[] = { chLatin_r, chLatin_s, chLatin_a, chNull }; static XMLCh s_ecdsa[] = { chLatin_e, chLatin_c, chLatin_d, chLatin_s, chLatin_a, chNull }; static XMLCh s_hmac[] = { chLatin_h, chLatin_m, chLatin_a, chLatin_c, chNull }; static XMLCh s_sha1[] = { chLatin_s, chLatin_h, chLatin_a, chDigit_1, chNull }; static XMLCh s_sha224[] = { chLatin_s, chLatin_h, chLatin_a, chDigit_2, chDigit_2, chDigit_4, chNull }; static XMLCh s_sha256[] = { chLatin_s, chLatin_h, chLatin_a, chDigit_2, chDigit_5, chDigit_6, chNull }; static XMLCh s_sha384[] = { chLatin_s, chLatin_h, chLatin_a, chDigit_3, chDigit_8, chDigit_4, chNull }; static XMLCh s_sha512[] = { chLatin_s, chLatin_h, chLatin_a, chDigit_5, chDigit_1, chDigit_2, chNull }; static XMLCh s_md5[] = { chLatin_m, chLatin_d, chDigit_5, chNull }; // -------------------------------------------------------------------------------- // Constant Strings Storage // -------------------------------------------------------------------------------- const XMLCh * DSIGConstants::s_unicodeStrEmpty; // "" const XMLCh * DSIGConstants::s_unicodeStrNL; // "\n" const XMLCh * DSIGConstants::s_unicodeStrXmlns; // "xmlns" const XMLCh * DSIGConstants::s_unicodeStrURI; const XMLCh * DSIGConstants::s_unicodeStrAlgorithm; const XMLCh * DSIGConstants::s_unicodeStrURIDSIG; const XMLCh * DSIGConstants::s_unicodeStrURIDSIG11; const XMLCh * DSIGConstants::s_unicodeStrURIEC; const XMLCh * DSIGConstants::s_unicodeStrURIXPF; const XMLCh * DSIGConstants::s_unicodeStrURIXENC; const XMLCh * DSIGConstants::s_unicodeStrURIXENC11; const XMLCh * DSIGConstants::s_unicodeStrURISIGBASE; const XMLCh * DSIGConstants::s_unicodeStrURISIGBASEMORE; const XMLCh * DSIGConstants::s_unicodeStrURISIGBASE11; const XMLCh * DSIGConstants::s_unicodeStrURIRawX509; const XMLCh * DSIGConstants::s_unicodeStrURISHA1; const XMLCh * DSIGConstants::s_unicodeStrURISHA224; const XMLCh * DSIGConstants::s_unicodeStrURISHA256; const XMLCh * DSIGConstants::s_unicodeStrURISHA384; const XMLCh * DSIGConstants::s_unicodeStrURISHA512; const XMLCh * DSIGConstants::s_unicodeStrURIMD5; // Not recommended const XMLCh * DSIGConstants::s_unicodeStrURIBASE64; const XMLCh * DSIGConstants::s_unicodeStrURIXPATH; const XMLCh * DSIGConstants::s_unicodeStrURIXSLT; const XMLCh * DSIGConstants::s_unicodeStrURIENVELOPE; const XMLCh * DSIGConstants::s_unicodeStrURIC14N_NOC; const XMLCh * DSIGConstants::s_unicodeStrURIC14N_COM; const XMLCh * DSIGConstants::s_unicodeStrURIC14N11_NOC; const XMLCh * DSIGConstants::s_unicodeStrURIC14N11_COM; const XMLCh * DSIGConstants::s_unicodeStrURIEXC_C14N_NOC; const XMLCh * DSIGConstants::s_unicodeStrURIEXC_C14N_COM; const XMLCh * DSIGConstants::s_unicodeStrURIDSA_SHA1; const XMLCh * DSIGConstants::s_unicodeStrURIDSA_SHA256; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_MD5; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_SHA1; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_SHA224; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_SHA256; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_SHA384; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_SHA512; const XMLCh * DSIGConstants::s_unicodeStrURIECDSA_SHA1; const XMLCh * DSIGConstants::s_unicodeStrURIECDSA_SHA224; const XMLCh * DSIGConstants::s_unicodeStrURIECDSA_SHA256; const XMLCh * DSIGConstants::s_unicodeStrURIECDSA_SHA384; const XMLCh * DSIGConstants::s_unicodeStrURIECDSA_SHA512; const XMLCh * DSIGConstants::s_unicodeStrURIHMAC_SHA1; const XMLCh * DSIGConstants::s_unicodeStrURIHMAC_SHA224; const XMLCh * DSIGConstants::s_unicodeStrURIHMAC_SHA256; const XMLCh * DSIGConstants::s_unicodeStrURIHMAC_SHA384; const XMLCh * DSIGConstants::s_unicodeStrURIHMAC_SHA512; const XMLCh * DSIGConstants::s_unicodeStrURIXMLNS; const XMLCh * DSIGConstants::s_unicodeStrURIMANIFEST; const XMLCh * DSIGConstants::s_unicodeStrURI3DES_CBC; const XMLCh * DSIGConstants::s_unicodeStrURIAES128_CBC; const XMLCh * DSIGConstants::s_unicodeStrURIAES192_CBC; const XMLCh * DSIGConstants::s_unicodeStrURIAES256_CBC; const XMLCh * DSIGConstants::s_unicodeStrURIAES128_GCM; const XMLCh * DSIGConstants::s_unicodeStrURIAES192_GCM; const XMLCh * DSIGConstants::s_unicodeStrURIAES256_GCM; const XMLCh * DSIGConstants::s_unicodeStrURIKW_3DES; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES128; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES192; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES256; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES128_PAD; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES192_PAD; const XMLCh * DSIGConstants::s_unicodeStrURIKW_AES256_PAD; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_1_5; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_OAEP_MGFP1; const XMLCh * DSIGConstants::s_unicodeStrURIRSA_OAEP; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_BASE; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_SHA1; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_SHA224; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_SHA256; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_SHA384; const XMLCh * DSIGConstants::s_unicodeStrURIMGF1_SHA512; const XMLCh * DSIGConstants::s_unicodeStrURIXENC_ELEMENT; const XMLCh * DSIGConstants::s_unicodeStrURIXENC_CONTENT; const XMLCh * DSIGConstants::s_unicodeStrPROVOpenSSL; const XMLCh * DSIGConstants::s_unicodeStrPROVWinCAPI; const XMLCh * DSIGConstants::s_unicodeStrPROVNSS; // -------------------------------------------------------------------------------- // Constant Strings Creation and Deletion // -------------------------------------------------------------------------------- void DSIGConstants::create() { // Set up the static strings s_unicodeStrEmpty = XMLString::transcode(""); s_unicodeStrNL = XMLString::transcode("\n"); s_unicodeStrXmlns = XMLString::transcode("xmlns"); s_unicodeStrURI = XMLString::transcode("URI"); s_unicodeStrAlgorithm = XMLString::transcode("Algorithm"); s_unicodeStrURIRawX509 = XMLString::transcode(URI_ID_RAWX509); s_unicodeStrURIDSIG = XMLString::transcode(URI_ID_DSIG); s_unicodeStrURIDSIG11 = XMLString::transcode(URI_ID_DSIG11); s_unicodeStrURIEC = XMLString::transcode(URI_ID_EC); s_unicodeStrURIXPF = XMLString::transcode(URI_ID_XPF); s_unicodeStrURIXENC = XMLString::transcode(URI_ID_XENC); s_unicodeStrURIXENC11 = XMLString::transcode(URI_ID_XENC11); s_unicodeStrURISIGBASE = XMLString::transcode(URI_ID_SIG_BASE); s_unicodeStrURISIGBASEMORE = XMLString::transcode(URI_ID_SIG_BASEMORE); s_unicodeStrURISIGBASE11 = XMLString::transcode(URI_ID_SIG_BASE11); s_unicodeStrURISHA1 = XMLString::transcode(URI_ID_SHA1); s_unicodeStrURISHA224 = XMLString::transcode(URI_ID_SHA224); s_unicodeStrURISHA256 = XMLString::transcode(URI_ID_SHA256); s_unicodeStrURISHA384 = XMLString::transcode(URI_ID_SHA384); s_unicodeStrURISHA512 = XMLString::transcode(URI_ID_SHA512); s_unicodeStrURIMD5 = XMLString::transcode(URI_ID_MD5); s_unicodeStrURIBASE64 = XMLString::transcode(URI_ID_BASE64); s_unicodeStrURIXPATH = XMLString::transcode(URI_ID_XPATH); s_unicodeStrURIXSLT = XMLString::transcode(URI_ID_XSLT); s_unicodeStrURIENVELOPE = XMLString::transcode(URI_ID_ENVELOPE); s_unicodeStrURIC14N_NOC = XMLString::transcode(URI_ID_C14N_NOC); s_unicodeStrURIC14N_COM = XMLString::transcode(URI_ID_C14N_COM); s_unicodeStrURIC14N11_NOC = XMLString::transcode(URI_ID_C14N11_NOC); s_unicodeStrURIC14N11_COM = XMLString::transcode(URI_ID_C14N11_COM); s_unicodeStrURIEXC_C14N_NOC = XMLString::transcode(URI_ID_EXC_C14N_NOC); s_unicodeStrURIEXC_C14N_COM = XMLString::transcode(URI_ID_EXC_C14N_COM); s_unicodeStrURIDSA_SHA1 = XMLString::transcode(URI_ID_DSA_SHA1); s_unicodeStrURIDSA_SHA256 = XMLString::transcode(URI_ID_DSA_SHA256); s_unicodeStrURIRSA_MD5 = XMLString::transcode(URI_ID_RSA_MD5); s_unicodeStrURIRSA_SHA1 = XMLString::transcode(URI_ID_RSA_SHA1); s_unicodeStrURIRSA_SHA224 = XMLString::transcode(URI_ID_RSA_SHA224); s_unicodeStrURIRSA_SHA256 = XMLString::transcode(URI_ID_RSA_SHA256); s_unicodeStrURIRSA_SHA384 = XMLString::transcode(URI_ID_RSA_SHA384); s_unicodeStrURIRSA_SHA512 = XMLString::transcode(URI_ID_RSA_SHA512); s_unicodeStrURIECDSA_SHA1 = XMLString::transcode(URI_ID_ECDSA_SHA1); s_unicodeStrURIECDSA_SHA224 = XMLString::transcode(URI_ID_ECDSA_SHA224); s_unicodeStrURIECDSA_SHA256 = XMLString::transcode(URI_ID_ECDSA_SHA256); s_unicodeStrURIECDSA_SHA384 = XMLString::transcode(URI_ID_ECDSA_SHA384); s_unicodeStrURIECDSA_SHA512 = XMLString::transcode(URI_ID_ECDSA_SHA512); s_unicodeStrURIHMAC_SHA1 = XMLString::transcode(URI_ID_HMAC_SHA1); s_unicodeStrURIHMAC_SHA224 = XMLString::transcode(URI_ID_HMAC_SHA224); s_unicodeStrURIHMAC_SHA256 = XMLString::transcode(URI_ID_HMAC_SHA256); s_unicodeStrURIHMAC_SHA384 = XMLString::transcode(URI_ID_HMAC_SHA384); s_unicodeStrURIHMAC_SHA512 = XMLString::transcode(URI_ID_HMAC_SHA512); s_unicodeStrURIXMLNS = XMLString::transcode(URI_ID_XMLNS); s_unicodeStrURIMANIFEST = XMLString::transcode(URI_ID_MANIFEST); s_unicodeStrURI3DES_CBC = XMLString::transcode(URI_ID_3DES_CBC); s_unicodeStrURIAES128_CBC = XMLString::transcode(URI_ID_AES128_CBC); s_unicodeStrURIAES192_CBC = XMLString::transcode(URI_ID_AES192_CBC); s_unicodeStrURIAES256_CBC = XMLString::transcode(URI_ID_AES256_CBC); s_unicodeStrURIAES128_GCM = XMLString::transcode(URI_ID_AES128_GCM); s_unicodeStrURIAES192_GCM = XMLString::transcode(URI_ID_AES192_GCM); s_unicodeStrURIAES256_GCM = XMLString::transcode(URI_ID_AES256_GCM); s_unicodeStrURIKW_3DES = XMLString::transcode(URI_ID_KW_3DES); s_unicodeStrURIKW_AES128 = XMLString::transcode(URI_ID_KW_AES128); s_unicodeStrURIKW_AES192 = XMLString::transcode(URI_ID_KW_AES192); s_unicodeStrURIKW_AES256 = XMLString::transcode(URI_ID_KW_AES256); s_unicodeStrURIKW_AES128_PAD = XMLString::transcode(URI_ID_KW_AES128_PAD); s_unicodeStrURIKW_AES192_PAD = XMLString::transcode(URI_ID_KW_AES192_PAD); s_unicodeStrURIKW_AES256_PAD = XMLString::transcode(URI_ID_KW_AES256_PAD); s_unicodeStrURIRSA_1_5 = XMLString::transcode(URI_ID_RSA_1_5); s_unicodeStrURIRSA_OAEP_MGFP1 = XMLString::transcode(URI_ID_RSA_OAEP_MGFP1); s_unicodeStrURIRSA_OAEP = XMLString::transcode(URI_ID_RSA_OAEP); s_unicodeStrURIMGF1_BASE = XMLString::transcode(URI_ID_MGF1_BASE); s_unicodeStrURIMGF1_SHA1 = XMLString::transcode(URI_ID_MGF1_SHA1); s_unicodeStrURIMGF1_SHA224 = XMLString::transcode(URI_ID_MGF1_SHA224); s_unicodeStrURIMGF1_SHA256 = XMLString::transcode(URI_ID_MGF1_SHA256); s_unicodeStrURIMGF1_SHA384 = XMLString::transcode(URI_ID_MGF1_SHA384); s_unicodeStrURIMGF1_SHA512 = XMLString::transcode(URI_ID_MGF1_SHA512); s_unicodeStrURIXENC_ELEMENT = XMLString::transcode(URI_ID_XENC_ELEMENT); s_unicodeStrURIXENC_CONTENT = XMLString::transcode(URI_ID_XENC_CONTENT); s_unicodeStrPROVOpenSSL = XMLString::transcode(PROV_OPENSSL); s_unicodeStrPROVWinCAPI = XMLString::transcode(PROV_WINCAPI); s_unicodeStrPROVNSS = XMLString::transcode(PROV_NSS); } void DSIGConstants::destroy() { // Delete the static strings XSEC_RELEASE_XMLCH(s_unicodeStrEmpty); XSEC_RELEASE_XMLCH(s_unicodeStrNL); XSEC_RELEASE_XMLCH(s_unicodeStrXmlns); XSEC_RELEASE_XMLCH(s_unicodeStrURI); XSEC_RELEASE_XMLCH(s_unicodeStrAlgorithm); XSEC_RELEASE_XMLCH(s_unicodeStrURIRawX509); XSEC_RELEASE_XMLCH(s_unicodeStrURIDSIG); XSEC_RELEASE_XMLCH(s_unicodeStrURIDSIG11); XSEC_RELEASE_XMLCH(s_unicodeStrURIEC); XSEC_RELEASE_XMLCH(s_unicodeStrURIXPF); XSEC_RELEASE_XMLCH(s_unicodeStrURIXENC); XSEC_RELEASE_XMLCH(s_unicodeStrURIXENC11); XSEC_RELEASE_XMLCH(s_unicodeStrURISIGBASE); XSEC_RELEASE_XMLCH(s_unicodeStrURISIGBASEMORE); XSEC_RELEASE_XMLCH(s_unicodeStrURISIGBASE11); XSEC_RELEASE_XMLCH(s_unicodeStrURISHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURISHA224); XSEC_RELEASE_XMLCH(s_unicodeStrURISHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURISHA384); XSEC_RELEASE_XMLCH(s_unicodeStrURISHA512); XSEC_RELEASE_XMLCH(s_unicodeStrURIMD5); XSEC_RELEASE_XMLCH(s_unicodeStrURIBASE64); XSEC_RELEASE_XMLCH(s_unicodeStrURIXPATH); XSEC_RELEASE_XMLCH(s_unicodeStrURIXSLT); XSEC_RELEASE_XMLCH(s_unicodeStrURIENVELOPE); XSEC_RELEASE_XMLCH(s_unicodeStrURIC14N_NOC); XSEC_RELEASE_XMLCH(s_unicodeStrURIC14N_COM); XSEC_RELEASE_XMLCH(s_unicodeStrURIC14N11_NOC); XSEC_RELEASE_XMLCH(s_unicodeStrURIC14N11_COM); XSEC_RELEASE_XMLCH(s_unicodeStrURIEXC_C14N_NOC); XSEC_RELEASE_XMLCH(s_unicodeStrURIEXC_C14N_COM); XSEC_RELEASE_XMLCH(s_unicodeStrURIDSA_SHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURIDSA_SHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_MD5); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_SHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_SHA224); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_SHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_SHA384); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_SHA512); XSEC_RELEASE_XMLCH(s_unicodeStrURIECDSA_SHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURIECDSA_SHA224); XSEC_RELEASE_XMLCH(s_unicodeStrURIECDSA_SHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURIECDSA_SHA384); XSEC_RELEASE_XMLCH(s_unicodeStrURIECDSA_SHA512); XSEC_RELEASE_XMLCH(s_unicodeStrURIHMAC_SHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURIHMAC_SHA224); XSEC_RELEASE_XMLCH(s_unicodeStrURIHMAC_SHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURIHMAC_SHA384); XSEC_RELEASE_XMLCH(s_unicodeStrURIHMAC_SHA512); XSEC_RELEASE_XMLCH(s_unicodeStrURIXMLNS); XSEC_RELEASE_XMLCH(s_unicodeStrURIMANIFEST); XSEC_RELEASE_XMLCH(s_unicodeStrURI3DES_CBC); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES128_CBC); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES192_CBC); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES256_CBC); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES128_GCM); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES192_GCM); XSEC_RELEASE_XMLCH(s_unicodeStrURIAES256_GCM); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_3DES); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES128); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES192); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES256); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES128_PAD); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES192_PAD); XSEC_RELEASE_XMLCH(s_unicodeStrURIKW_AES256_PAD); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_1_5); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_OAEP_MGFP1); XSEC_RELEASE_XMLCH(s_unicodeStrURIRSA_OAEP); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_BASE); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_SHA1); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_SHA224); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_SHA256); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_SHA384); XSEC_RELEASE_XMLCH(s_unicodeStrURIMGF1_SHA512); XSEC_RELEASE_XMLCH(s_unicodeStrURIXENC_ELEMENT); XSEC_RELEASE_XMLCH(s_unicodeStrURIXENC_CONTENT); XSEC_RELEASE_XMLCH(s_unicodeStrPROVOpenSSL); XSEC_RELEASE_XMLCH(s_unicodeStrPROVWinCAPI); XSEC_RELEASE_XMLCH(s_unicodeStrPROVNSS); } // -------------------------------------------------------------------------------- // URI Mappings // -------------------------------------------------------------------------------- bool getHashMethod(const XMLCh * URI, hashMethod & hm) { if (strEquals(URI, s_md5)) { hm = HASH_MD5; return true; } if (strEquals(URI, s_sha1)) { hm = HASH_SHA1; return true; } if (strEquals(URI, s_sha224)) { hm = HASH_SHA224; return true; } if (strEquals(URI, s_sha256)) { hm = HASH_SHA256; return true; } if (strEquals(URI, s_sha384)) { hm = HASH_SHA384; return true; } if (strEquals(URI, s_sha512)) { hm = HASH_SHA512; return true; } hm = HASH_NONE; return false; } bool XSECmapURIToSignatureMethods(const XMLCh * URI, signatureMethod & sm, hashMethod & hm) { // The easy ones! if (strEquals(URI, DSIGConstants::s_unicodeStrURIDSA_SHA1)) { sm = SIGNATURE_DSA; hm = HASH_SHA1; return true; } if (strEquals(URI, DSIGConstants::s_unicodeStrURIRSA_SHA1)) { sm = SIGNATURE_RSA; hm = HASH_SHA1; return true; } if (strEquals(URI, DSIGConstants::s_unicodeStrURIHMAC_SHA1)) { sm = SIGNATURE_HMAC; hm = HASH_SHA1; return true; } /* Check to see if we are one of the more exotic RSA signatures */ xsecsize_t cnt = XMLString::stringLen(DSIGConstants::s_unicodeStrURISIGBASEMORE); if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURISIGBASEMORE, cnt) == 0) { // Have a "new" algorithm if (XMLString::compareNString(&URI[cnt], s_hmac, 4) == 0) { // Some kind of HMAC sm = SIGNATURE_HMAC; // Determine a trailing hash method if (URI[cnt+4] != chDash) return false; return getHashMethod(&(URI[cnt+5]), hm); } else if (XMLString::compareNString(&URI[cnt], s_rsa, 3) == 0) { sm = SIGNATURE_RSA; if (URI[cnt+3] != chDash) return false; return getHashMethod(&(URI[cnt+4]), hm); } else if (XMLString::compareNString(&URI[cnt], s_ecdsa, 5) == 0) { sm = SIGNATURE_ECDSA; if (URI[cnt+5] != chDash) return false; return getHashMethod(&(URI[cnt+6]), hm); } } cnt = XMLString::stringLen(DSIGConstants::s_unicodeStrURISIGBASE11); if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURISIGBASE11, cnt) == 0) { if (XMLString::compareNString(&URI[cnt], s_dsa, 3) == 0) { sm = SIGNATURE_DSA; if (URI[cnt+3] != chDash) return false; return getHashMethod(&(URI[cnt+4]), hm); } } sm = SIGNATURE_NONE; hm = HASH_NONE; return false; } bool XSECmapURIToHashMethod(const XMLCh * URI, hashMethod & hm) { // Check this is a known prefix on the URI. xsecsize_t blen = XMLString::stringLen(DSIGConstants::s_unicodeStrURISIGBASE); xsecsize_t bmlen = XMLString::stringLen(DSIGConstants::s_unicodeStrURISIGBASEMORE); xsecsize_t belen = XMLString::stringLen(DSIGConstants::s_unicodeStrURIXENC); if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURISIGBASE, blen) == 0) { // This is actually cheating - this will return SHA256 (as an example), even if // the base URI is the original DSIG uri (ie not base-more) return getHashMethod(&URI[blen], hm); } if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURISIGBASEMORE, bmlen) == 0) { return getHashMethod(&URI[bmlen], hm); } if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURIXENC, belen) == 0) { return getHashMethod(&URI[belen], hm); } hm = HASH_NONE; return false; } bool XSECmapURIToCanonicalizationMethod(const XMLCh * URI, canonicalizationMethod & cm) { // Quick and dirty but inefficient if (strEquals(URI, DSIGConstants::s_unicodeStrURIC14N_NOC)) { cm = CANON_C14N_NOC; } else if (strEquals(URI, DSIGConstants::s_unicodeStrURIC14N_COM)) { cm = CANON_C14N_COM; } else if (strEquals(URI, DSIGConstants::s_unicodeStrURIEXC_C14N_COM)) { cm = CANON_C14NE_COM; } else if (strEquals(URI, DSIGConstants::s_unicodeStrURIEXC_C14N_NOC)) { cm = CANON_C14NE_NOC; } else if (strEquals(URI, DSIGConstants::s_unicodeStrURIC14N11_NOC)) { cm = CANON_C14N11_NOC; } else if (strEquals(URI, DSIGConstants::s_unicodeStrURIC14N11_COM)) { cm = CANON_C14N11_COM; } else { // Unknown cm = CANON_NONE; return false; } return true; } bool XSECmapURIToMaskGenerationFunc(const XMLCh * URI, maskGenerationFunc & mgf) { // Check this is a known prefix on the URI. xsecsize_t len = XMLString::stringLen(DSIGConstants::s_unicodeStrURIMGF1_BASE); if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURIMGF1_BASE, len) == 0) { hashMethod hm; if (getHashMethod(&URI[len], hm)) { switch (hm) { case HASH_SHA1: mgf = MGF1_SHA1; return true; case HASH_SHA224: mgf = MGF1_SHA224; return true; case HASH_SHA256: mgf = MGF1_SHA256; return true; case HASH_SHA384: mgf = MGF1_SHA384; return true; case HASH_SHA512: mgf = MGF1_SHA512; return true; default: ; } } } mgf = MGF_NONE; return false; }xml-security-c-1.7.3/xsec/dsig/DSIGSignature.cpp000644 001751 001751 00000074511 12147777032 022623 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGSignature := Class for checking and setting up signature nodes in a DSIG signature * * Author(s): Berin Lautenbach * * $Id: DSIGSignature.cpp 1478626 2013-05-03 01:34:21Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Xerces includes #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Init // -------------------------------------------------------------------------------- void DSIGSignature::Initialise(void) { DSIGAlgorithmHandlerDefault def; // Register default signature algorithm handlers XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_SHA1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_MD5, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_SHA224, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_SHA256, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_SHA384, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIRSA_SHA512, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIDSA_SHA1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIDSA_SHA256, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIECDSA_SHA1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIECDSA_SHA224, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIECDSA_SHA256, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIECDSA_SHA384, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIECDSA_SHA512, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIHMAC_SHA1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIHMAC_SHA224, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIHMAC_SHA256, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIHMAC_SHA384, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIHMAC_SHA512, def); // Register default hashing algorithm handlers XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURISHA1, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURISHA224, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURISHA256, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURISHA384, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURISHA512, def); XSECPlatformUtils::registerAlgorithmHandler(DSIGConstants::s_unicodeStrURIMD5, def); } // -------------------------------------------------------------------------------- // Get the Canonicalised BYTE_STREAM of the SignedInfo // -------------------------------------------------------------------------------- XSECBinTXFMInputStream * DSIGSignature::makeBinInputStream(void) const { TXFMBase * txfm; // Create the starting point for the transform list XSECnew(txfm, TXFMDocObject(mp_doc)); TXFMChain * chain; XSECnew(chain, TXFMChain(txfm)); Janitor j_chain(chain); ((TXFMDocObject *) txfm)->setInput(mp_doc, mp_signedInfo->getDOMNode()); // canonicalise the SignedInfo content switch (mp_signedInfo->getCanonicalizationMethod()) { case CANON_C14N_NOC : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); txfm->stripComments(); break; case CANON_C14N_COM : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); txfm->activateComments(); break; case CANON_C14NE_NOC : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); ((TXFMC14n *) txfm)->setExclusive(); txfm->stripComments(); break; case CANON_C14NE_COM : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); ((TXFMC14n *) txfm)->setExclusive(); txfm->activateComments(); break; default : throw XSECException(XSECException::SigVfyError, "Canonicalisation method unknown in DSIGSignature::makeBinInputStream()"); } // Now create the InputStream XSECBinTXFMInputStream * ret; ret = new XSECBinTXFMInputStream(chain); j_chain.release(); return ret; } // -------------------------------------------------------------------------------- // Get the list of references // -------------------------------------------------------------------------------- DSIGReferenceList * DSIGSignature::getReferenceList(void) { return mp_signedInfo ? mp_signedInfo->getReferenceList() : NULL; } const DSIGReferenceList * DSIGSignature::getReferenceList(void) const { return mp_signedInfo ? mp_signedInfo->getReferenceList() : NULL; } const XMLCh * DSIGSignature::getAlgorithmURI() const { return mp_signedInfo ? mp_signedInfo->getAlgorithmURI() : NULL; } // -------------------------------------------------------------------------------- // Set and Get Resolvers // -------------------------------------------------------------------------------- void DSIGSignature::setURIResolver(XSECURIResolver * resolver) { mp_env->setURIResolver(resolver); } XSECURIResolver * DSIGSignature::getURIResolver(void) const { return mp_env->getURIResolver(); } void DSIGSignature::setKeyInfoResolver(XSECKeyInfoResolver * resolver) { if (mp_KeyInfoResolver != 0) delete mp_KeyInfoResolver; mp_KeyInfoResolver = resolver->clone(); } XSECKeyInfoResolver * DSIGSignature::getKeyInfoResolver(void) const { return mp_KeyInfoResolver; } // -------------------------------------------------------------------------------- // Object Handling // -------------------------------------------------------------------------------- DSIGObject * DSIGSignature::appendObject(void) { DSIGObject * ret; XSECnew(ret, DSIGObject(mp_env)); DOMElement * elt = ret->createBlankObject(); mp_sigNode->appendChild(elt); mp_env->doPrettyPrint(mp_sigNode); m_objects.push_back(ret); return ret; } int DSIGSignature::getObjectLength(void) const { return (unsigned int) m_objects.size(); } DSIGObject * DSIGSignature::getObjectItem(int i) { if ( i < 0 || i >= ((int) m_objects.size())) { throw XSECException(XSECException::ObjectError, "DSIGSignature::getObjectItem - index out of range"); } return m_objects[i]; } const DSIGObject * DSIGSignature::getObjectItem(int i) const { if ( i < 0 || i >= ((int) m_objects.size())) { throw XSECException(XSECException::ObjectError, "DSIGSignature::getObjectItem - index out of range"); } return m_objects[i]; } // -------------------------------------------------------------------------------- // Signature // -------------------------------------------------------------------------------- // Constructors and Destructors DSIGSignature::DSIGSignature(DOMDocument *doc, DOMNode *sigNode) : m_keyInfoList(0), m_errStr("") { mp_doc = doc; mp_sigNode = sigNode; mp_signingKey = NULL; mp_signedInfo = NULL; mp_KeyInfoResolver = NULL; mp_KeyInfoNode = NULL; m_loaded = false; m_interlockingReferences = false; // Set up our formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); // Set up the environment XSECnew(mp_env, XSECEnv(doc)); m_keyInfoList.setEnvironment(mp_env); } DSIGSignature::DSIGSignature(void) : m_keyInfoList(0), m_errStr("") { mp_doc = NULL; mp_sigNode = NULL; mp_signingKey = NULL; mp_signedInfo = NULL; mp_KeyInfoResolver = NULL; mp_KeyInfoNode = NULL; m_loaded = false; m_interlockingReferences = false; // Set up our formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); XSECnew(mp_env, XSECEnv(NULL)); m_keyInfoList.setEnvironment(mp_env); } DSIGSignature::~DSIGSignature() { if (mp_env != NULL) delete mp_env; if (mp_signingKey != NULL) { delete mp_signingKey; mp_signingKey = NULL; } if (mp_signedInfo != NULL) { delete mp_signedInfo; mp_signedInfo = NULL; } if (mp_formatter != NULL) { delete mp_formatter; mp_formatter = NULL; } if (mp_KeyInfoResolver != NULL) { delete mp_KeyInfoResolver; mp_KeyInfoResolver = NULL; } // Delete any object items for (int i = 0; i < ((int) m_objects.size()); ++i) { delete (m_objects[i]); } } // Actions const XMLCh * DSIGSignature::getErrMsgs() const { return m_errStr.rawXMLChBuffer(); } // -------------------------------------------------------------------------------- // Pretty Printing // -------------------------------------------------------------------------------- void DSIGSignature::setPrettyPrint(bool flag) { mp_env->setPrettyPrintFlag(flag); } bool DSIGSignature::getPrettyPrint(void) const { return mp_env->getPrettyPrintFlag(); } // -------------------------------------------------------------------------------- // Creating signatures from blank // -------------------------------------------------------------------------------- void DSIGSignature::setDSIGNSPrefix(const XMLCh * prefix) { mp_env->setDSIGNSPrefix(prefix); } void DSIGSignature::setECNSPrefix(const XMLCh * prefix) { mp_env->setECNSPrefix(prefix); } void DSIGSignature::setXPFNSPrefix(const XMLCh * prefix) { mp_env->setXPFNSPrefix(prefix); } // get const XMLCh * DSIGSignature::getDSIGNSPrefix() const { return mp_env->getDSIGNSPrefix(); } const XMLCh * DSIGSignature::getECNSPrefix() const { return mp_env->getECNSPrefix(); } const XMLCh * DSIGSignature::getXPFNSPrefix() const { return mp_env->getXPFNSPrefix(); } // -------------------------------------------------------------------------------- // Creating Blank Signature // -------------------------------------------------------------------------------- DOMElement *DSIGSignature::createBlankSignature(DOMDocument *doc, canonicalizationMethod cm, signatureMethod sm, hashMethod hm) { // This is now deprecated. Because this is so, we go the long way - translate // to URI and then call the "standard" method, which will translate back to // internal enums if possible const XMLCh * cURI; safeBuffer sURI; if ((cURI = canonicalizationMethod2UNICODEURI(cm)) == NULL) { throw XSECException(XSECException::UnknownCanonicalization, "DSIGSignature::createBlankSignature - Canonicalisation method unknown"); } if (signatureHashMethod2URI(sURI, sm, hm) == false) { throw XSECException(XSECException::UnknownSignatureAlgorithm, "DSIGSignature::createBlankSignature - Signature/Hash method unknown"); } return createBlankSignature(doc, cURI, sURI.sbStrToXMLCh()); } DOMElement *DSIGSignature::createBlankSignature( DOMDocument *doc, const XMLCh * canonicalizationAlgorithmURI, const XMLCh * signatureAlgorithmURI) { // "New" method to create a blank signature, based on URIs. mp_doc = doc; mp_env->setParentDocument(doc); const XMLCh * prefixNS = mp_env->getDSIGNSPrefix(); safeBuffer str; makeQName(str, prefixNS, "Signature"); DOMElement *sigNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); if (prefixNS[0] == '\0') { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefixNS); } sigNode->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIDSIG); mp_sigNode = sigNode; mp_env->doPrettyPrint(mp_sigNode); // Create the skeleton SignedInfo XSECnew(mp_signedInfo, DSIGSignedInfo(mp_doc, mp_formatter, mp_env)); mp_sigNode->appendChild(mp_signedInfo->createBlankSignedInfo( canonicalizationAlgorithmURI, signatureAlgorithmURI)); mp_env->doPrettyPrint(mp_sigNode); // Create a dummy signature value (dummy until signed) makeQName(str, mp_env->getDSIGNSPrefix(), "SignatureValue"); DOMElement *sigValNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_signatureValueNode = sigValNode; mp_sigNode->appendChild(sigValNode); mp_env->doPrettyPrint(mp_sigNode); // Some text to mark this as a template only sigValNode->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("Not yet signed"))); m_loaded = true; return sigNode; } // -------------------------------------------------------------------------------- // Creating References // -------------------------------------------------------------------------------- DSIGReference * DSIGSignature::createReference(const XMLCh * URI, hashMethod hm, char * type) { return mp_signedInfo->createReference(URI, hm, type); } DSIGReference * DSIGSignature::createReference( const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type) { return mp_signedInfo->createReference(URI, hashAlgorithmURI, type); } DSIGReference * DSIGSignature::removeReference(DSIGReferenceList::size_type index) { return mp_signedInfo ? mp_signedInfo->removeReference(index) : NULL; } // -------------------------------------------------------------------------------- // Manipulation of KeyInfo elements // -------------------------------------------------------------------------------- void DSIGSignature::clearKeyInfo(void) { if (mp_KeyInfoNode == 0) return; if (mp_sigNode->removeChild(mp_KeyInfoNode) != mp_KeyInfoNode) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Attempted to remove KeyInfo node but it is no longer a child of "); } mp_KeyInfoNode->release(); // No longer required mp_KeyInfoNode = NULL; // Clear out the list m_keyInfoList.empty(); } void DSIGSignature::createKeyInfoElement(void) { if (mp_KeyInfoNode != NULL) return; safeBuffer str; makeQName(str, mp_env->getDSIGNSPrefix(), "KeyInfo"); mp_KeyInfoNode = m_keyInfoList.createKeyInfo(); // Append the node to the end of the signature DOMNode * afterSignatureValue = mp_signatureValueNode->getNextSibling(); while (afterSignatureValue != 0 && afterSignatureValue->getNodeType() != DOMNode::ELEMENT_NODE) afterSignatureValue = afterSignatureValue->getNextSibling(); if (afterSignatureValue == 0) { mp_sigNode->appendChild(mp_KeyInfoNode); mp_env->doPrettyPrint(mp_sigNode); } else { mp_sigNode->insertBefore(mp_KeyInfoNode, afterSignatureValue); if (mp_env->getPrettyPrintFlag() == true) mp_sigNode->insertBefore(mp_doc->createTextNode(DSIGConstants::s_unicodeStrNL), afterSignatureValue); } } DSIGKeyInfoValue * DSIGSignature::appendDSAKeyValue(const XMLCh * P, const XMLCh * Q, const XMLCh * G, const XMLCh * Y) { createKeyInfoElement(); return m_keyInfoList.appendDSAKeyValue(P, Q, G, Y); } DSIGKeyInfoValue * DSIGSignature::appendRSAKeyValue(const XMLCh * modulus, const XMLCh * exponent) { createKeyInfoElement(); return m_keyInfoList.appendRSAKeyValue(modulus, exponent); } DSIGKeyInfoX509 * DSIGSignature::appendX509Data(void) { createKeyInfoElement(); return m_keyInfoList.appendX509Data(); } DSIGKeyInfoName * DSIGSignature::appendKeyName(const XMLCh * name, bool isDName) { createKeyInfoElement(); return m_keyInfoList.appendKeyName(name, isDName); } DSIGKeyInfoPGPData * DSIGSignature::appendPGPData(const XMLCh * id, const XMLCh * packet) { createKeyInfoElement(); return m_keyInfoList.appendPGPData(id, packet); } DSIGKeyInfoSPKIData * DSIGSignature::appendSPKIData(const XMLCh * sexp) { createKeyInfoElement(); return m_keyInfoList.appendSPKIData(sexp); } DSIGKeyInfoMgmtData * DSIGSignature::appendMgmtData(const XMLCh * data) { createKeyInfoElement(); return m_keyInfoList.appendMgmtData(data); } // -------------------------------------------------------------------------------- // Working on Existing templates // -------------------------------------------------------------------------------- void DSIGSignature::load(void) { // Load all the information from the source document into local variables for easier // manipulation by the other functions in the class if (mp_sigNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptySignature); } if (!strEquals(getDSIGLocalName(mp_sigNode), "Signature")) { throw XSECException(XSECException::LoadNonSignature); } m_loaded = true; // Find the prefix being used so that we can later use it to manipulate the signature mp_env->setDSIGNSPrefix(mp_sigNode->getPrefix()); // Now check for SignedInfo DOMNode *tmpElt = mp_sigNode->getFirstChild(); while (tmpElt != 0 && (tmpElt->getNodeType() != DOMNode::ELEMENT_NODE)) // Skip text and comments tmpElt = tmpElt->getNextSibling(); if (tmpElt == 0 || !strEquals(getDSIGLocalName(tmpElt), "SignedInfo")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as first child of "); } // Have a signed info XSECnew(mp_signedInfo, DSIGSignedInfo(mp_doc, mp_formatter, tmpElt, mp_env)); mp_signedInfo->load(); // Look at Signature Value tmpElt = tmpElt->getNextSibling(); while (tmpElt != 0 && tmpElt->getNodeType() != DOMNode::ELEMENT_NODE) tmpElt = tmpElt->getNextSibling(); if (tmpElt == 0 || !strEquals(getDSIGLocalName(tmpElt), "SignatureValue")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected node"); } DOMNode *tmpSV = tmpElt->getFirstChild(); while (tmpSV != 0 && tmpSV->getNodeType() != DOMNode::TEXT_NODE) tmpSV = tmpSV->getNextSibling(); if (tmpSV == 0) throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT child of "); mp_signatureValueNode = tmpElt; // The signature value is transcoded to local code page, as it is easier // to work with, and should be low ASCII in any case (Base64) m_signatureValueSB.sbTranscodeIn(tmpSV->getNodeValue()); // Now look at KeyInfo tmpElt = tmpElt->getNextSibling(); while (tmpElt != 0 && !((tmpElt->getNodeType() == DOMNode::ELEMENT_NODE) && strEquals(getDSIGLocalName(tmpElt), "KeyInfo"))) tmpElt = tmpElt->getNextSibling(); if (tmpElt != 0 && strEquals(getDSIGLocalName(tmpElt), "KeyInfo")) { // Have a keyInfo mp_KeyInfoNode = tmpElt; // In case we later want to manipulate it m_keyInfoList.loadListFromXML(tmpElt); tmpElt = findNextElementChild(tmpElt); } while (tmpElt != 0 && strEquals(getDSIGLocalName(tmpElt), "Object")) { DSIGObject * obj; XSECnew(obj, DSIGObject(mp_env, tmpElt)); obj->load(); m_objects.push_back(obj); tmpElt = findNextElementChild(tmpElt); } /* * Strictly speaking, this should remain, but it causes too many problems with non * conforming signatures if (tmpElt != 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGSignature::load - Unexpected (non Object) Element found at end of signature"); } */ } TXFMChain * DSIGSignature::getSignedInfoInput(void) { TXFMBase * txfm; TXFMChain * chain; // First we calculate the hash. Start off by creating a starting point XSECnew(txfm, TXFMDocObject(mp_doc)); XSECnew(chain, TXFMChain(txfm)); Janitor j_chain(chain); ((TXFMDocObject *) txfm)->setInput(mp_doc, mp_signedInfo->getDOMNode()); // canonicalise the SignedInfo content switch (mp_signedInfo->getCanonicalizationMethod()) { case CANON_C14N_NOC : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); txfm->stripComments(); break; case CANON_C14N_COM : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); txfm->activateComments(); break; case CANON_C14NE_NOC : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); ((TXFMC14n *) txfm)->setExclusive(); txfm->stripComments(); break; case CANON_C14NE_COM : XSECnew(txfm, TXFMC14n(mp_doc)); chain->appendTxfm(txfm); ((TXFMC14n *) txfm)->setExclusive(); txfm->activateComments(); break; default : throw XSECException(XSECException::SigVfyError, "Canonicalisation method unknown in DSIGSignature::calculateSignedInfoHash()"); } j_chain.release(); return chain; } unsigned int DSIGSignature::calculateSignedInfoHash(unsigned char * hashBuf, unsigned int hashBufLen) { // Get the SignedInfo input bytes TXFMChain * chain = getSignedInfoInput(); Janitor j_chain(chain); // Check for debugging sink for the data TXFMBase* sink = XSECPlatformUtils::GetReferenceLoggingSink(mp_doc); if (sink) chain->appendTxfm(sink); // Setup Hash // First find the appropriate handler for the URI XSECAlgorithmHandler * handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( mp_signedInfo->getAlgorithmURI()); if (handler == NULL) { throw XSECException(XSECException::SigVfyError, "Hash method unknown in DSIGSignature::calculateSignedInfoHash()"); } if (!handler->appendSignatureHashTxfm(chain, mp_signedInfo->getAlgorithmURI(), mp_signingKey)) { throw XSECException(XSECException::SigVfyError, "Unexpected error in handler whilst appending Signature Hash transform"); } // Write hash to the buffer return chain->getLastTxfm()->readBytes((XMLByte *) hashBuf, hashBufLen); } unsigned int DSIGSignature::calculateSignedInfoAndReferenceHash(unsigned char * hashBuf, unsigned int hashBufLen) { // Set up the reference list hashes - including any manifests mp_signedInfo->hash(m_interlockingReferences); // calculaet signed InfoHash return calculateSignedInfoHash(hashBuf,hashBufLen); } // -------------------------------------------------------------------------------- // Verify a signature // -------------------------------------------------------------------------------- bool DSIGSignature::verifySignatureOnlyInternal(void) { unsigned char hash[4096]; int hashLen; if (!m_loaded) { // Need to call "load" prior to checking a signature throw XSECException(XSECException::SigVfyError, "DSIGSignature::verify() called prior to DSIGSignature::load()"); } // FIX: CVE-2009-0217 if (mp_signedInfo->getHMACOutputLength() > 0 && mp_signedInfo->getHMACOutputLength() < 80) { throw XSECException(XSECException::SigVfyError, "DSIGSignature::verify() - HMACOutputLength is unsafe"); } // Try to find a key if (mp_signingKey == NULL) { // // Try to load a key from the KeyInfo list // if ((mp_signingKey = m_keyInfoList.findKey()) == NULL) { // throw XSECException(XSECException::SigVfyError, // "DSIGSignature::verify() - no verification key loaded and cannot determine from KeyInfo list"); // } if (mp_KeyInfoResolver == NULL) { throw XSECException(XSECException::SigVfyError, "DSIGSignature::verify() - no verification key loaded and no KeyInfoResolver loaded"); } if ((mp_signingKey = mp_KeyInfoResolver->resolveKey(&m_keyInfoList)) == NULL) { throw XSECException(XSECException::SigVfyError, "DSIGSignature::verify() - no verification key loaded and cannot determine from KeyInfoResolver"); } } // Get the SignedInfo input bytes TXFMChain * chain = getSignedInfoInput(); Janitor j_chain(chain); hashLen = calculateSignedInfoHash(hash, 4096); // Now set up to verify // First find the appropriate handler for the URI XSECAlgorithmHandler * handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( mp_signedInfo->getAlgorithmURI()); if (handler == NULL) { throw XSECException(XSECException::SigVfyError, "Hash method unknown in DSIGSignature::verifySignatureOnlyInternal()"); } bool sigVfyRet = handler->verifyBase64Signature(chain, mp_signedInfo->getAlgorithmURI(), m_signatureValueSB.rawCharBuffer(), mp_signedInfo->getHMACOutputLength(), mp_signingKey); if (!sigVfyRet) m_errStr.sbXMLChCat("Validation of failed"); return sigVfyRet; } bool DSIGSignature::verifySignatureOnly(void) { m_errStr.sbTranscodeIn(""); return verifySignatureOnlyInternal(); } bool DSIGSignature::verify(void) { // We have a (hopefully) fully loaded signature. Need to // verify bool referenceCheckResult; if (!m_loaded) { // Need to call "load" prior to checking a signature throw XSECException(XSECException::SigVfyError, "DSIGSignature::verify() called prior to DSIGSignature::load()"); } // Reset m_errStr.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); // First thing to do is check the references referenceCheckResult = mp_signedInfo->verify(m_errStr); // Check the signature bool sigVfyResult = verifySignatureOnlyInternal(); return sigVfyResult & referenceCheckResult; } // -------------------------------------------------------------------------------- // Sign the XML document that has been previously loaded // -------------------------------------------------------------------------------- void DSIGSignature::sign(void) { // We have a (hopefully) fully loaded signature. Need to // sign if (!m_loaded) { // Need to call "load" prior to checking a signature throw XSECException(XSECException::SigVfyError, "DSIGSignature::sign() called prior to DSIGSignature::load()"); } // Check we have a key if (mp_signingKey == NULL) { throw XSECException(XSECException::SigVfyError, "DSIGSignature::sign() - no signing key loaded"); } // Reset error string in case we have any reference problems. m_errStr.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); // Set up the reference list hashes - including any manifests mp_signedInfo->hash(m_interlockingReferences); // Get the SignedInfo input bytes TXFMChain * chain = getSignedInfoInput(); Janitor j_chain(chain); // Calculate the hash to be signed safeBuffer b64Buf; XSECAlgorithmHandler * handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler( mp_signedInfo->getAlgorithmURI()); if (handler == NULL) { throw XSECException(XSECException::SigVfyError, "Hash method unknown in DSIGSignature::sign()"); } if (!handler->signToSafeBuffer(chain, mp_signedInfo->getAlgorithmURI(), mp_signingKey, mp_signedInfo->getHMACOutputLength(), b64Buf)) { throw XSECException(XSECException::SigVfyError, "Unexpected error in handler whilst appending Signature Hash transform"); } // Now we have the signature - place it in the DOM structures DOMNode *tmpElt = mp_signatureValueNode->getFirstChild(); while (tmpElt != NULL && tmpElt->getNodeType() != DOMNode::TEXT_NODE) tmpElt = tmpElt->getNextSibling(); if (tmpElt == NULL) { // Need to create the underlying TEXT_NODE DOMDocument * doc = mp_signatureValueNode->getOwnerDocument(); tmpElt = doc->createTextNode(b64Buf.sbStrToXMLCh()); mp_signatureValueNode->appendChild(tmpElt); } else { tmpElt->setNodeValue(b64Buf.sbStrToXMLCh()); } // And copy to the local buffer m_signatureValueSB = b64Buf; } // -------------------------------------------------------------------------------- // Key Management // -------------------------------------------------------------------------------- void DSIGSignature::setSigningKey(XSECCryptoKey *k) { if (mp_signingKey != NULL) delete mp_signingKey; mp_signingKey = k; } // -------------------------------------------------------------------------------- // ID Handling // -------------------------------------------------------------------------------- /* * ID handling is really all done within the environment object - just pass the * calls straight through */ void DSIGSignature::setIdByAttributeName(bool flag) { mp_env->setIdByAttributeName(flag); } bool DSIGSignature::getIdByAttributeName(void) const { return mp_env->getIdByAttributeName(); } void DSIGSignature::registerIdAttributeName(const XMLCh * name) { mp_env->registerIdAttributeName(name); } bool DSIGSignature::deregisterIdAttributeName(const XMLCh * name) { return mp_env->deregisterIdAttributeName(name); } void DSIGSignature::registerIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) { mp_env->registerIdAttributeNameNS(ns, name); } bool DSIGSignature::deregisterIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) { return mp_env->deregisterIdAttributeNameNS(ns, name); } // -------------------------------------------------------------------------------- // Other functions // -------------------------------------------------------------------------------- const XMLCh * DSIGSignature::getSignatureValue(void) const { if (mp_signatureValueNode == NULL) return NULL; return findFirstChildOfType(mp_signatureValueNode, DOMNode::TEXT_NODE)->getNodeValue(); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformXSL.cpp000644 001751 001751 00000014345 12003301053 023174 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXSL := Class that Handles DSIG XSLT Transforms * * $Id: DSIGTransformXSL.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE class XSECDomToSafeBuffer { public: XSECDomToSafeBuffer(DOMNode *node); virtual ~XSECDomToSafeBuffer() {} operator const safeBuffer&() const { return m_buffer; } private: safeBuffer m_buffer; }; XSECDomToSafeBuffer::XSECDomToSafeBuffer(DOMNode* node) { static const XMLCh _LS[] = {chLatin_L, chLatin_S, chNull}; DOMImplementationLS* impl = DOMImplementationRegistry::getDOMImplementation(_LS); MemBufFormatTarget* target = new MemBufFormatTarget; Janitor j_target(target); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer* theSerializer = impl->createLSSerializer(); Janitor j_theSerializer(theSerializer); DOMLSOutput *theOutput = impl->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setByteStream(target); #else DOMWriter* theSerializer = impl->createDOMWriter(); Janitor j_theSerializer(theSerializer); #endif try { #if defined (XSEC_XERCES_DOMLSSERIALIZER) theSerializer->write(node, theOutput); #else theSerializer->writeNode(target, *node); #endif m_buffer.sbMemcpyIn(0, target->getRawBuffer(), target->getLen()); } catch(const XMLException&) { throw XSECException(XSECException::UnknownError); } catch(const DOMException&) { throw XSECException(XSECException::UnknownError); } } // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGTransformXSL::DSIGTransformXSL(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node), mp_stylesheetNode(NULL) {}; DSIGTransformXSL::DSIGTransformXSL(const XSECEnv * env) : DSIGTransform(env), mp_stylesheetNode(NULL) {}; DSIGTransformXSL::~DSIGTransformXSL() {}; // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- transformType DSIGTransformXSL::getTransformType() { return TRANSFORM_XSLT; } void DSIGTransformXSL::appendTransformer(TXFMChain * input) { #ifdef XSEC_NO_XSLT throw XSECException(XSECException::UnsupportedFunction, "XSLT Transforms not supported in this compilation of the library"); #else if (mp_stylesheetNode == 0) throw XSECException(XSECException::XSLError, "Style Sheet not found for XSL Transform"); TXFMBase * nextInput; // XSLT Transform - requires a byte stream input if (input->getLastTxfm()->getOutputType() == TXFMBase::DOM_NODES) { // Use c14n to translate to BYTES XSECnew(nextInput, TXFMC14n(mp_txfmNode->getOwnerDocument())); input->appendTxfm(nextInput); } TXFMXSL * x; // Create the XSLT transform XSECnew(x, TXFMXSL(mp_txfmNode->getOwnerDocument())); input->appendTxfm(x); // Patch to avoid c14n of stylesheet XSECDomToSafeBuffer sbStyleSheet(mp_stylesheetNode); x->evaluateStyleSheet(sbStyleSheet); #endif /* NO_XSLT */ } DOMElement * DSIGTransformXSL::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIXSLT); mp_txfmNode = ret; mp_stylesheetNode = NULL; return ret; } void DSIGTransformXSL::load(void) { // find the style sheet mp_stylesheetNode = mp_txfmNode->getFirstChild(); while (mp_stylesheetNode != 0 && mp_stylesheetNode->getNodeType() != DOMNode::ELEMENT_NODE && !strEquals(mp_stylesheetNode->getNodeName(), "xsl:stylesheet")) mp_stylesheetNode = mp_stylesheetNode->getNextSibling(); if (mp_stylesheetNode == 0) throw XSECException(XSECException::XSLError, "Style Sheet not found for XSL Transform"); } // -------------------------------------------------------------------------------- // XSLT Specific Methods // -------------------------------------------------------------------------------- DOMNode * DSIGTransformXSL::setStylesheet(DOMNode * stylesheet) { DOMNode * ret = mp_stylesheetNode; if (mp_stylesheetNode) { if (stylesheet) mp_txfmNode->insertBefore(stylesheet, mp_stylesheetNode); mp_txfmNode->removeChild(mp_stylesheetNode); } else if (stylesheet) { mp_txfmNode->appendChild(stylesheet); } mp_stylesheetNode = stylesheet; return ret; } DOMNode * DSIGTransformXSL::getStylesheet(void) { return mp_stylesheetNode; } xml-security-c-1.7.3/xsec/dsig/DSIGObject.cpp000644 001751 001751 00000014263 12003301053 022037 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGObject := Defines the container class used by dsig to hold objects * inside a signture * * $Id: DSIGObject.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // String Constants // -------------------------------------------------------------------------------- static XMLCh s_Object[] = { chLatin_O, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t, chNull }; static XMLCh s_Id[] = { chLatin_I, chLatin_d, chNull }; static XMLCh s_MimeType[] = { chLatin_M, chLatin_i, chLatin_m, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; static XMLCh s_Encoding[] = { chLatin_E, chLatin_n, chLatin_c, chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; // -------------------------------------------------------------------------------- // Constructors/Destructor // -------------------------------------------------------------------------------- DSIGObject::DSIGObject(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *dom) { mp_env = env; mp_objectNode = dom; mp_idAttr = NULL; mp_mimeTypeAttr = NULL; mp_encodingAttr = NULL; } DSIGObject::DSIGObject(const XSECEnv * env) { mp_env = env; mp_objectNode = NULL; mp_idAttr = NULL; mp_mimeTypeAttr = NULL; mp_encodingAttr = NULL; } DSIGObject::~DSIGObject() {} // -------------------------------------------------------------------------------- // Library only // -------------------------------------------------------------------------------- void DSIGObject::load(void) { if (mp_objectNode == NULL || mp_objectNode->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(mp_objectNode), s_Object)) { throw XSECException(XSECException::ObjectError, "Expected Node in DSIGObject::load"); } mp_idAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Id); if (mp_idAttr) { #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id); #elif defined (XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE) ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id, true); #endif } mp_mimeTypeAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_MimeType); mp_encodingAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Encoding); } DOMElement * DSIGObject::createBlankObject(void) { safeBuffer str; const XMLCh * prefix; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, s_Object); mp_objectNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_idAttr = NULL; mp_mimeTypeAttr = NULL; mp_encodingAttr = NULL; return (DOMElement *) mp_objectNode; } // -------------------------------------------------------------------------------- // Get functions // -------------------------------------------------------------------------------- const XMLCh * DSIGObject::getId(void) { if (mp_idAttr != NULL) return mp_idAttr->getNodeValue(); return NULL; } const XMLCh * DSIGObject::getMimeType(void) { if (mp_mimeTypeAttr != NULL) return mp_mimeTypeAttr->getNodeValue(); return NULL; } const XMLCh * DSIGObject::getEncoding(void) { if (mp_encodingAttr != NULL) return mp_encodingAttr->getNodeValue(); return NULL; } const DOMElement * DSIGObject::getElement(void) { return (DOMElement *) mp_objectNode; } // -------------------------------------------------------------------------------- // Set Functions // -------------------------------------------------------------------------------- void DSIGObject::setId(const XMLCh * id) { if (mp_idAttr != NULL) { mp_idAttr->setNodeValue(id); } else { ((DOMElement *) mp_objectNode)->setAttributeNS(NULL, s_Id, id); // Mark as an ID #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id); #elif defined (XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE) ((DOMElement *) mp_objectNode)->setIdAttributeNS(NULL, s_Id, true); #endif mp_idAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Id); } } void DSIGObject::setMimeType(const XMLCh * type) { if (mp_mimeTypeAttr != NULL) { mp_mimeTypeAttr->setNodeValue(type); } else { ((DOMElement *) mp_objectNode)->setAttributeNS(NULL, s_MimeType, type); mp_mimeTypeAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_MimeType); } } void DSIGObject::setEncoding(const XMLCh * encoding) { if (mp_encodingAttr != NULL) { mp_encodingAttr->setNodeValue(encoding); } else { ((DOMElement *) mp_objectNode)->setAttributeNS(NULL, s_Encoding, encoding); mp_encodingAttr = ((DOMElement *) mp_objectNode)->getAttributeNodeNS(NULL, s_Encoding); } } void DSIGObject::appendChild(DOMNode * child) { if (mp_objectNode == NULL) { throw XSECException(XSECException::ObjectError, "DSIGObject::appendChild - Object node has not been created"); } mp_objectNode->appendChild(child); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformXPath.cpp000644 001751 001751 00000014015 12003301053 023544 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformXPath := Class that holds XPath transforms * * $Id: DSIGTransformXPath.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGTransformXPath::DSIGTransformXPath(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node) { mp_exprTextNode = NULL; mp_xpathNode = NULL; mp_NSMap = NULL; m_expr = ""; } DSIGTransformXPath::DSIGTransformXPath(const XSECEnv * env) : DSIGTransform(env) { mp_exprTextNode = NULL; mp_xpathNode = NULL; mp_NSMap = NULL; m_expr = ""; } DSIGTransformXPath::~DSIGTransformXPath() {}; // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- transformType DSIGTransformXPath::getTransformType() { return TRANSFORM_XPATH; } void DSIGTransformXPath::appendTransformer(TXFMChain * input) { #ifdef XSEC_NO_XPATH throw XSECException(XSECException::UnsupportedFunction, "XPath transforms are not supported in this compilation of the XSEC library"); #else TXFMXPath *x; // XPath transform XSECnew(x, TXFMXPath(mp_txfmNode->getOwnerDocument())); input->appendTxfm(x); // These can throw, but the TXFMXPath is now owned by the chain, so will // be cleaned up down the calling stack. x->setNameSpace(mp_NSMap); x->evaluateExpr(mp_txfmNode, m_expr); #endif /* NO_XPATH */ } DOMElement * DSIGTransformXPath::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIXPATH); // Create the XPath element makeQName(str, prefix, "XPath"); mp_xpathNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_exprTextNode = doc->createTextNode(MAKE_UNICODE_STRING("")); ret->appendChild(mp_xpathNode); mp_xpathNode->appendChild(mp_exprTextNode); mp_txfmNode = ret; return ret; } void DSIGTransformXPath::load(void) { // Find the XPath expression mp_xpathNode = mp_txfmNode->getFirstChild(); while (mp_xpathNode != 0 && mp_xpathNode->getNodeType() != DOMNode::ELEMENT_NODE && !strEquals(mp_xpathNode->getNodeName(), "XPath")) mp_xpathNode = mp_xpathNode->getNextSibling(); if (mp_xpathNode == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Node in DSIGTransformXPath::load"); } else { // Check for attributes - in particular any namespaces mp_NSMap = mp_xpathNode->getAttributes(); // Find the text node mp_exprTextNode = findFirstChildOfType(mp_xpathNode, DOMNode::TEXT_NODE); if (mp_exprTextNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Text Node in beneath in DSIGTransformXPath::load"); } // Gather the text safeBuffer exprSB; gatherChildrenText(mp_xpathNode, exprSB); m_expr << (*(mp_env->getSBFormatter()) << exprSB.rawXMLChBuffer()); //m_expr << (*(mp_env->getSBFormatter()) << mp_exprTextNode->getNodeValue()); } } // -------------------------------------------------------------------------------- // XPath Transform Specific Methods // -------------------------------------------------------------------------------- void DSIGTransformXPath::setExpression(const char * expr) { mp_exprTextNode->setNodeValue(MAKE_UNICODE_STRING(expr)); m_expr.sbStrcpyIn((char *) expr); } const char * DSIGTransformXPath::getExpression(void) { return m_expr.rawCharBuffer(); } void DSIGTransformXPath::setNamespace(const char * prefix, const char * value) { safeBuffer str; str.sbStrcpyIn("xmlns:"); str.sbStrcatIn((char *) prefix); DOMElement *x; x = static_cast (mp_xpathNode); // if (x == NULL) { // // throw XSECException(XSECException::TransformError, // "Found a non ELEMENT node as the XPath node in DSIGTransformXPath"); // } x->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.sbStrToXMLCh(), MAKE_UNICODE_STRING(value)); mp_NSMap = mp_xpathNode->getAttributes(); } void DSIGTransformXPath::deleteNamespace(const char * prefix) { DOMElement *x; x = static_cast (mp_xpathNode); // if (x == NULL) { // // throw XSECException(XSECException::TransformError, // "Found a non ELEMENT node as the XPath node in DSIGTransformXPath"); // } x->removeAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING(prefix)); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformEnvelope.cpp000644 001751 001751 00000006427 12003301053 024305 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformEnvelope := Class that calculates an Envelope with an XPath evaluator * * $Id: DSIGTransformEnvelope.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGTransformEnvelope::DSIGTransformEnvelope(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node) {}; DSIGTransformEnvelope::DSIGTransformEnvelope(const XSECEnv * env) : DSIGTransform(env) {}; DSIGTransformEnvelope::~DSIGTransformEnvelope() {}; // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- transformType DSIGTransformEnvelope::getTransformType() { return TRANSFORM_ENVELOPED_SIGNATURE; } void DSIGTransformEnvelope::appendTransformer(TXFMChain * input) { #ifdef XSEC_USE_XPATH_ENVELOPE TXFMXPath *x; // Special XPath transform XSECnew(x, TXFMXPath(mp_txfmNode->getOwnerDocument())); input->appendTxfm(x); // Execute the envelope expression x->evaluateEnvelope(mp_txfmNode); #else TXFMEnvelope *x; // Use the Envelope transform XSECnew(x, TXFMEnvelope(mp_txfmNode->getOwnerDocument())); input->appendTxfm(x); // Execute envelope x->evaluateEnvelope(mp_txfmNode); #endif } DOMElement * DSIGTransformEnvelope::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIENVELOPE); mp_txfmNode = ret; return ret; } void DSIGTransformEnvelope::load(void) { // Do nothing for an Envelope transform } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoName.cpp000644 001751 001751 00000011715 12003301053 022775 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyName := Simply a string that names a key for an application to read * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoName.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoName::DSIGKeyInfoName(const XSECEnv * env, DOMNode *nameNode) : DSIGKeyInfo(env), mp_name(NULL), mp_decodedDName(NULL), mp_keyNameTextNode(0) { mp_keyInfoDOMNode = nameNode; } DSIGKeyInfoName::DSIGKeyInfoName(const XSECEnv * env) : DSIGKeyInfo(env), mp_name(NULL), mp_decodedDName(NULL), mp_keyNameTextNode(0) { mp_keyInfoDOMNode = 0; } DSIGKeyInfoName::~DSIGKeyInfoName() { if (mp_decodedDName != NULL) XSEC_RELEASE_XMLCH(mp_decodedDName); }; // -------------------------------------------------------------------------------- // Load and Get functions // -------------------------------------------------------------------------------- void DSIGKeyInfoName::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptyInfoName); } if (!strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "KeyName")) { throw XSECException(XSECException::LoadNonInfoName); } // Now find the text node containing the name DOMNode *tmpElt = mp_keyInfoDOMNode->getFirstChild(); while (tmpElt != 0 && tmpElt->getNodeType() != DOMNode::TEXT_NODE) tmpElt = tmpElt->getNextSibling(); if (tmpElt != 0) { mp_keyNameTextNode = tmpElt; mp_name = tmpElt->getNodeValue(); } else { throw XSECException(XSECException::ExpectedDSIGChildNotFound, MAKE_UNICODE_STRING("Expected TEXT node as child to element")); } } const XMLCh * DSIGKeyInfoName::getDecodedKeyName(void) { if (mp_decodedDName == NULL) { mp_decodedDName = decodeDName(mp_name); } return mp_decodedDName; } // -------------------------------------------------------------------------------- // Create and Set functions // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoName::createBlankKeyName(const XMLCh * name, bool isDName) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "KeyName"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; // Check whether to encode prior to adding if (isDName == true) { // Treat as a distinguished name mp_decodedDName = XMLString::replicate(name); XMLCh * encodedName = encodeDName(name); mp_keyNameTextNode = doc->createTextNode(encodedName); XSEC_RELEASE_XMLCH(encodedName); } else mp_keyNameTextNode = doc->createTextNode(name); ret->appendChild(mp_keyNameTextNode); mp_name = mp_keyNameTextNode->getNodeValue(); return ret; } void DSIGKeyInfoName::setKeyName(const XMLCh * name, bool isDName) { if (mp_keyNameTextNode == 0) { // Attempt to load an empty element throw XSECException(XSECException::LoadEmptySignature, MAKE_UNICODE_STRING("KeyInfoName::set() called prior to load() or createBlank()")); } if (mp_decodedDName != NULL) { XSEC_RELEASE_XMLCH(mp_decodedDName); mp_decodedDName = NULL; } if (isDName == true) { // This name should be treated as a Distinguished Name - so do the // required encoding mp_decodedDName = XMLString::replicate(name); XMLCh * encodedName = encodeDName(name); mp_keyNameTextNode->setNodeValue(encodedName); XSEC_RELEASE_XMLCH(encodedName); } else { mp_keyNameTextNode->setNodeValue(name); } mp_name = mp_keyNameTextNode->getNodeValue(); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformBase64.cpp000644 001751 001751 00000007301 12003301053 023544 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformBase64 := Class that holds a Base64 transform structure * * $Id: DSIGTransformBase64.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGTransformBase64::DSIGTransformBase64(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node) {}; DSIGTransformBase64::DSIGTransformBase64(const XSECEnv * env) : DSIGTransform(env) {}; DSIGTransformBase64::~DSIGTransformBase64() {}; // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- transformType DSIGTransformBase64::getTransformType() { return TRANSFORM_BASE64; } void DSIGTransformBase64::appendTransformer(TXFMChain * input) { // If the input is a Nodeset then we need to find the text from the input if (input->getLastTxfm()->getOutputType() == TXFMBase::DOM_NODES) { if (input->getLastTxfm()->getNodeType() != TXFMBase::DOM_NODE_XPATH_NODESET) { #ifdef XSEC_NO_XPATH throw XSECException(XSECException::UnsupportedFunction, "Unable to extract Base64 text from Nodes without XPath support"); } #else // Use an XPath transform to get "Self::text()" from the nodeset TXFMXPath *x; XSECnew(x, TXFMXPath(mp_txfmNode->getOwnerDocument())); input->appendTxfm(x); ((TXFMXPath *) x)->evaluateExpr(mp_txfmNode, "self::text()"); } TXFMC14n *c; // Now use c14n to translate to BYTES XSECnew(c, TXFMC14n(mp_txfmNode->getOwnerDocument())); input->appendTxfm(c); #endif } // Now the actual Base64 TXFMBase64 *b; XSECnew(b, TXFMBase64(mp_txfmNode->getOwnerDocument())); input->appendTxfm(b); } DOMElement * DSIGTransformBase64::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIBASE64); mp_txfmNode = ret; return ret; } void DSIGTransformBase64::load(void) { // Do nothing for a Base64 transform } xml-security-c-1.7.3/xsec/dsig/DSIGReference.cpp000644 001751 001751 00000113101 12162436547 022545 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIG_Reference := Class for handling a DSIG reference element * * $Id: DSIGReference.cpp 1496703 2013-06-26 00:58:41Z scantor $ * */ // XSEC includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Xerces #include #include #include XERCES_CPP_NAMESPACE_USE #include // -------------------------------------------------------------------------------- // Some useful strings // -------------------------------------------------------------------------------- static const XMLCh s_unicodeStrURI[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_U, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_R, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_I, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; static const XMLCh s_unicodeStrxpointer[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_x, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_p, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_o, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_i, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_n, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_t, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_e, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_r, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; static const XMLCh s_unicodeStrRootNode[] = { XERCES_CPP_NAMESPACE_QUALIFIER chOpenParen, XERCES_CPP_NAMESPACE_QUALIFIER chForwardSlash, XERCES_CPP_NAMESPACE_QUALIFIER chCloseParen, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGReference::DSIGReference(const XSECEnv * env, DOMNode *dom) { mp_referenceNode = dom; mp_env = env; // Should throw an exception if the node is not a REFERENCE element XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); mp_preHash = NULL; mp_manifestList = NULL; me_hashMethod = HASH_NONE; mp_transformsNode = NULL; mp_transformList = NULL; mp_URI = NULL; m_isManifest = false; mp_algorithmURI = NULL; m_loaded = false; } DSIGReference::DSIGReference(const XSECEnv * env) { mp_env = env; mp_referenceNode = NULL; mp_transformsNode = NULL; mp_transformList = NULL; XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); mp_preHash = NULL; // By default no "special" transform mp_manifestList = NULL; me_hashMethod = HASH_NONE; mp_URI = NULL; m_isManifest = false; mp_algorithmURI = NULL; m_loaded = false; }; DSIGReference::~DSIGReference() { // Destroy any associated transforms if (mp_transformList != NULL) { delete mp_transformList; mp_transformList = NULL; } if (mp_formatter != NULL) delete mp_formatter; if (mp_manifestList != NULL) delete mp_manifestList; }; // -------------------------------------------------------------------------------- // Creation of Transforms // -------------------------------------------------------------------------------- void DSIGReference::createTransformList(void) { // Creates the transforms list safeBuffer str; const XMLCh * prefix; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); if (mp_transformsNode == NULL) { // Need to create a transforms node makeQName(str, prefix, "Transforms"); mp_transformsNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_referenceNode->insertBefore(mp_transformsNode, mp_referenceNode->getFirstChild()); if (mp_env->getPrettyPrintFlag() == true) mp_referenceNode->insertBefore(doc->createTextNode(DSIGConstants::s_unicodeStrNL), mp_transformsNode); mp_env->doPrettyPrint(mp_transformsNode); // Create the list XSECnew(mp_transformList, DSIGTransformList()); } } void DSIGReference::addTransform(DSIGTransform * txfm, DOMElement * txfmElt) { if (mp_transformList == NULL) createTransformList(); mp_transformsNode->appendChild(txfmElt); mp_env->doPrettyPrint(mp_transformsNode); mp_transformList->addTransform(txfm); } DSIGTransformEnvelope * DSIGReference::appendEnvelopedSignatureTransform() { DOMElement *txfmElt; DSIGTransformEnvelope * txfm; XSECnew(txfm, DSIGTransformEnvelope(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); addTransform(txfm, txfmElt); return txfm; } DSIGTransformBase64 * DSIGReference::appendBase64Transform() { DOMElement *txfmElt; DSIGTransformBase64 * txfm; XSECnew(txfm, DSIGTransformBase64(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); addTransform(txfm, txfmElt); return txfm; } DSIGTransformXSL * DSIGReference::appendXSLTransform(DOMNode * stylesheet) { DOMElement *txfmElt; DSIGTransformXSL * txfm; XSECnew(txfm, DSIGTransformXSL(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setStylesheet(stylesheet); addTransform(txfm, txfmElt); return txfm; } DSIGTransformC14n * DSIGReference::appendCanonicalizationTransform(canonicalizationMethod cm) { DOMElement *txfmElt; DSIGTransformC14n * txfm; XSECnew(txfm, DSIGTransformC14n(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setCanonicalizationMethod(cm); addTransform(txfm, txfmElt); return txfm; } DSIGTransformC14n * DSIGReference::appendCanonicalizationTransform( const XMLCh * canonicalizationAlgorithmURI) { canonicalizationMethod cm; XSECmapURIToCanonicalizationMethod(canonicalizationAlgorithmURI, cm); return appendCanonicalizationTransform(cm); } DSIGTransformXPath * DSIGReference::appendXPathTransform(const char * expr) { DOMElement *txfmElt; DSIGTransformXPath * txfm; XSECnew(txfm, DSIGTransformXPath(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); txfm->setExpression(expr); addTransform(txfm, txfmElt); return txfm; } DSIGTransformXPathFilter * DSIGReference::appendXPathFilterTransform(void) { DOMElement *txfmElt; DSIGTransformXPathFilter * txfm; XSECnew(txfm, DSIGTransformXPathFilter(mp_env)); txfmElt = txfm->createBlankTransform(mp_env->getParentDocument()); addTransform(txfm, txfmElt); mp_env->doPrettyPrint(txfmElt); return txfm; } // -------------------------------------------------------------------------------- // Creation of blanks // -------------------------------------------------------------------------------- DOMElement *DSIGReference::createBlankReference(const XMLCh * URI, hashMethod hm, char * type) { // Deprecated - use the algorithm URI based method instead safeBuffer hURI; if (hashMethod2URI(hURI, hm) == false) { throw XSECException(XSECException::UnknownSignatureAlgorithm, "DSIGReference::createBlankReference - Hash method unknown"); } return createBlankReference(URI, hURI.sbStrToXMLCh(), MAKE_UNICODE_STRING(type)); } DOMElement *DSIGReference::createBlankReference(const XMLCh * URI, const XMLCh * hashAlgorithmURI, const XMLCh * type) { // Reset this Reference just in case m_isManifest = false; mp_preHash = NULL; mp_manifestList = NULL; mp_transformsNode = NULL; mp_transformList = NULL; XSECmapURIToHashMethod(hashAlgorithmURI, me_hashMethod); safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "Reference"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_referenceNode = ret; // Set type if (type != NULL) ret->setAttributeNS(NULL, MAKE_UNICODE_STRING("Type"), type); // Set URI if (URI != NULL) { ret->setAttributeNS(NULL, s_unicodeStrURI, URI); mp_URI = ret->getAttributeNS(NULL, s_unicodeStrURI); // Used later on as a pointer } else { // Anonymous reference mp_URI = NULL; } // Create hash and hashValue nodes makeQName(str, prefix, "DigestMethod"); DOMElement *digestMethod = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_env->doPrettyPrint(ret); ret->appendChild(digestMethod); mp_env->doPrettyPrint(ret); digestMethod->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, hashAlgorithmURI); // Retrieve the attribute value for later use mp_algorithmURI = digestMethod->getAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm); // DigestValue makeQName(str, prefix, "DigestValue"); mp_hashValueNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->appendChild(mp_hashValueNode); mp_env->doPrettyPrint(ret); mp_hashValueNode->appendChild(doc->createTextNode(MAKE_UNICODE_STRING("Not yet calculated"))); m_loaded = true; return ret; } // -------------------------------------------------------------------------------- // setPreHashTransform - to set a transform to be used pre-hash // -------------------------------------------------------------------------------- void DSIGReference::setPreHashTXFM(TXFMBase * t) { mp_preHash = t; } // setId // -------------------------------------------------------------------------------- void DSIGReference::setId(const XMLCh *id) { if (mp_referenceNode) ((DOMElement*)mp_referenceNode)->setAttributeNS(NULL, MAKE_UNICODE_STRING("Id"), id); } // -------------------------------------------------------------------------------- // setType // -------------------------------------------------------------------------------- void DSIGReference::setType(const XMLCh *type) { if (mp_referenceNode) ((DOMElement*)mp_referenceNode)->setAttributeNS(NULL, MAKE_UNICODE_STRING("Type"), type); } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // isManifest // -------------------------------------------------------------------------------- bool DSIGReference::isManifest() { return m_isManifest; } // -------------------------------------------------------------------------------- // getURI // -------------------------------------------------------------------------------- const XMLCh * DSIGReference::getURI() { return mp_URI; } // -------------------------------------------------------------------------------- // getManifestReferenceList // -------------------------------------------------------------------------------- DSIGReferenceList * DSIGReference::getManifestReferenceList() { return mp_manifestList; } // -------------------------------------------------------------------------------- // getURIBaseTransform // -------------------------------------------------------------------------------- TXFMBase * DSIGReference::getURIBaseTXFM(DOMDocument * doc, const XMLCh * URI, const XSECEnv * env) { // Determine if this is a full URL or a pointer to a URL if (URI == NULL || (URI[0] != 0 && URI[0] != XERCES_CPP_NAMESPACE_QUALIFIER chPound)) { TXFMURL * retTransform; // Have a URL! XSECnew(retTransform, TXFMURL(doc, env->getURIResolver())); try { ((TXFMURL *) retTransform)->setInput(URI); } catch (...) { delete retTransform; throw; } return retTransform; } // Have a fragment URI from the local document TXFMDocObject * to; XSECnew(to, TXFMDocObject(doc)); Janitor j_to(to); to->setEnv(env); // Find out what sort of object pointer this is. if (URI[0] == 0) { // empty pointer - use the document itself to->setInput(doc); to->stripComments(); } else if (XMLString::compareNString(&URI[1], s_unicodeStrxpointer, 8) == 0) { // Have an xpointer if (strEquals(s_unicodeStrRootNode, &URI[9]) == true) { // Root node to->setInput(doc); } else if (URI[9] == XERCES_CPP_NAMESPACE_QUALIFIER chOpenParen && URI[10] == XERCES_CPP_NAMESPACE_QUALIFIER chLatin_i && URI[11] == XERCES_CPP_NAMESPACE_QUALIFIER chLatin_d && URI[12] == XERCES_CPP_NAMESPACE_QUALIFIER chOpenParen && URI[13] == XERCES_CPP_NAMESPACE_QUALIFIER chSingleQuote) { xsecsize_t len = XMLString::stringLen(&URI[14]); XMLCh* tmp = new XMLCh[len + 1]; ArrayJanitor j_tmp(tmp); xsecsize_t j = 14, i = 0; // Have an ID while (i < len && URI[j] != '\'') { tmp[i++] = URI[j++]; } tmp[i] = XERCES_CPP_NAMESPACE_QUALIFIER chNull; if (URI[j] != '\'') { throw XSECException(XSECException::UnsupportedXpointerExpr); } to->setInput(doc, tmp); } else { throw XSECException(XSECException::UnsupportedXpointerExpr); } // Keep comments in these situations to->activateComments(); } else { to->setInput(doc, &URI[1]); // Remove comments to->stripComments(); } j_to.release(); return to; } // -------------------------------------------------------------------------------- // load // -------------------------------------------------------------------------------- void DSIGReference::load(void) { // Load reference info from XML DOMNamedNodeMap *atts = mp_referenceNode->getAttributes(); DOMNode *tmpElt; const XMLCh * name; safeBuffer sbName; if (atts != 0) { XMLSize_t size = atts->getLength(); for (XMLSize_t i = 0; i < size; ++i) { name = atts->item(i)->getNodeName(); sbName << (*mp_formatter << atts->item(i)->getNodeName()); if (strEquals(name, s_unicodeStrURI)) { mp_URI = atts->item(i)->getNodeValue(); } else if (strEquals(name, "Type")) { // Check if a manifest, otherwise ignore for now if (strEquals(atts->item(i)->getNodeValue(), DSIGConstants::s_unicodeStrURIMANIFEST)) m_isManifest = true; } else if (strEquals(name, "Id")) { // For now ignore } else if (sbName.sbStrncmp("xmlns", 5) == 0) { // Ignore name spaces } else { //safeBuffer tmp, error; //error << (*mp_formatter << name); //tmp.sbStrcpyIn("Unknown attribute in Element : "); //tmp.sbStrcatIn(error); throw XSECException(XSECException::UnknownDSIGAttribute, "Unknown attribute in Element"); } } } // Now check for Transforms tmpElt = mp_referenceNode->getFirstChild(); while (tmpElt != 0 && (tmpElt->getNodeType() != DOMNode::ELEMENT_NODE)) { if (tmpElt->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } // Skip text and comments tmpElt = tmpElt->getNextSibling(); } if (tmpElt == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected or within "); } if (strEquals(getDSIGLocalName(tmpElt), "Transforms")) { // Store node for later use mp_transformsNode = tmpElt; // Load the transforms mp_transformList = loadTransforms(tmpElt, mp_formatter, mp_env); // Find next node tmpElt = tmpElt->getNextSibling(); while (tmpElt != 0 && (tmpElt->getNodeType() != DOMNode::ELEMENT_NODE)) { if (tmpElt->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } tmpElt = tmpElt->getNextSibling(); } } /* if tmpElt node type = transforms */ else { mp_transformList = NULL; } if (tmpElt == NULL || !strEquals(getDSIGLocalName(tmpElt), "DigestMethod")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected element"); } // Determine what the digest method actually is atts = tmpElt->getAttributes(); unsigned int i; for (i = 0; i < atts->getLength() && !strEquals(atts->item(i)->getNodeName(), DSIGConstants::s_unicodeStrAlgorithm); ++i); if (i == atts->getLength()) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected 'Algorithm' attribute in "); } mp_algorithmURI = atts->item(i)->getNodeValue(); // Determine hashing algorithm XSECmapURIToHashMethod(mp_algorithmURI, me_hashMethod); // Find the hash value node tmpElt = tmpElt->getNextSibling(); while (tmpElt != 0 && (tmpElt->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(tmpElt), "DigestValue"))) { if (tmpElt->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } tmpElt = tmpElt->getNextSibling(); } if (tmpElt == 0) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected within "); } mp_hashValueNode = tmpElt; // If we are a manifest, then we need to load the manifest references if (m_isManifest) { // Find the manifest node - we cheat and use a transform TXFMBase * docObject; DOMNode * manifestNode, * referenceNode; docObject = getURIBaseTXFM(mp_referenceNode->getOwnerDocument(), mp_URI, mp_env); manifestNode = docObject->getFragmentNode(); delete docObject; // Now search downwards to find a if (manifestNode == 0 || manifestNode->getNodeType() != DOMNode::ELEMENT_NODE || (!strEquals(getDSIGLocalName(manifestNode), "Object") && !strEquals(getDSIGLocalName(manifestNode), "Manifest"))) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected or URI for Manifest Type "); } if (strEquals(getDSIGLocalName(manifestNode), "Object")) { // Find Manifest child manifestNode = manifestNode->getFirstChild(); while (manifestNode != 0 && manifestNode->getNodeType() != DOMNode::ELEMENT_NODE) { if (manifestNode->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } manifestNode = manifestNode->getNextSibling(); } if (manifestNode == 0 || !strEquals(getDSIGLocalName(manifestNode), "Manifest")) throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as child of for Manifest Type "); } // Now have the manifest node, find the first reference and load! referenceNode = manifestNode->getFirstChild(); while (referenceNode != 0 && (referenceNode->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(referenceNode), "Reference"))) { if (referenceNode->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } referenceNode = referenceNode->getNextSibling(); } if (referenceNode == 0) throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as child of "); // Have reference node, so lets create a list! mp_manifestList = DSIGReference::loadReferenceListFromXML(mp_env, referenceNode); } /* m_isManifest */ m_loaded = true; } // -------------------------------------------------------------------------------- // createReferenceListFromXML // -------------------------------------------------------------------------------- DSIGReferenceList *DSIGReference::loadReferenceListFromXML(const XSECEnv * env, DOMNode *firstReference) { // Have the first reference element in the document, // so want to find and load them all DOMNode *tmpRef = firstReference; DSIGReferenceList * refList; DSIGReference * r; XSECnew(refList, DSIGReferenceList()); Janitor j_refList(refList); while (tmpRef != 0) { // Must be an element node if (tmpRef->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(tmpRef), "Reference")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected as child of "); } XSECnew(r, DSIGReference(env, tmpRef)); refList->addReference(r); // Load the reference before moving on r->load(); // Find next element Node tmpRef = tmpRef->getNextSibling(); while (tmpRef != 0 && tmpRef->getNodeType() != DOMNode::ELEMENT_NODE) { if (tmpRef->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "EntityReference nodes in are unsupported."); } tmpRef = tmpRef->getNextSibling(); } } j_refList.release(); return refList; } // -------------------------------------------------------------------------------- // Get the Canonicalised BYTE_STREAM of the reference data (and TXFMS) // -------------------------------------------------------------------------------- XSECBinTXFMInputStream * DSIGReference::makeBinInputStream(void) const { // First set up for input TXFMChain * txfmChain; TXFMBase * currentTxfm; if (m_loaded == false) { throw XSECException(XSECException::NotLoaded, "calculateHash() called in DSIGReference before load()"); } // Find base transform currentTxfm = getURIBaseTXFM(mp_referenceNode->getOwnerDocument(), mp_URI, mp_env); // Set up the transform chain txfmChain = createTXFMChainFromList(currentTxfm, mp_transformList); Janitor j_txfmChain(txfmChain); DOMDocument *d = mp_referenceNode->getOwnerDocument(); // All transforms done. If necessary, change the type from nodes to bytes if (txfmChain->getLastTxfm()->getOutputType() == TXFMBase::DOM_NODES) { TXFMC14n * c14n; XSECnew(c14n, TXFMC14n(d)); txfmChain->appendTxfm(c14n); } // Now create the InputStream XSECBinTXFMInputStream * ret; ret = new XSECBinTXFMInputStream(txfmChain); // Probs with MSVC++ mean no XSECnew j_txfmChain.release(); // Now owned by "ret" return ret; } // -------------------------------------------------------------------------------- // Hash a reference list // -------------------------------------------------------------------------------- void DSIGReference::hashReferenceList(DSIGReferenceList *lst, bool interlocking) { // Run through a list of hashes and checkHash for each one DSIGReference * r; int i = (int) lst->getSize(); safeBuffer errStr; errStr.sbXMLChIn(DSIGConstants::s_unicodeStrEmpty); // Run a VERY naieve process at the moment that assumes the list will "settle" // after N iterations through the list. This will settle any inter-locking references // Where a hash in a later calculated reference could impact an already calculated hash // in a previous references // // If interlocking is set to false, assume there are no interacting nodes do { for (int j = 0; j < i; ++j) { r = lst->item(j); // If this is a manifest we need to set all the references in the manifest as well if (r->isManifest()) hashReferenceList(r->getManifestReferenceList()); // Re-ordered as per suggestion by Peter Gubis to make it more likely // that hashes are correct on first pass when manifests are involved r->setHash(); } } while (interlocking && !DSIGReference::verifyReferenceList(lst, errStr) && i-- >= 0); } // -------------------------------------------------------------------------------- // Verify reference list // -------------------------------------------------------------------------------- bool DSIGReference::verifyReferenceList(DSIGReferenceList * lst, safeBuffer &errStr) { // Run through a list of hashes and checkHash for each one XSEC_USING_XERCES(NetAccessorException); DSIGReference * r; bool res = true; int size = (lst ? (int) lst->getSize() : 0); for (int i = 0; i < size; ++i) { r = lst->item(i); try { if (!r->checkHash()) { // Failed errStr.sbXMLChCat("Reference URI=\""); errStr.sbXMLChCat(r->getURI()); errStr.sbXMLChCat("\" failed to verify\n"); res = false; } } catch (NetAccessorException e) { res = false; errStr.sbXMLChCat("Error accessing network URI=\""); errStr.sbXMLChCat(r->getURI()); errStr.sbXMLChCat("\". Reference failed to verify\n"); } catch (XSECException e) { if (e.getType() != XSECException::HTTPURIInputStreamError) throw; res = false; errStr.sbXMLChCat("Error accessing network URI=\""); errStr.sbXMLChCat(r->getURI()); errStr.sbXMLChCat("\". Reference failed to verify\n"); } // if a manifest, check the manifest list if (r->isManifest()) res = res & verifyReferenceList(r->getManifestReferenceList(), errStr); } return res; } // -------------------------------------------------------------------------------- // processTransforms // -------------------------------------------------------------------------------- TXFMChain * DSIGReference::createTXFMChainFromList(TXFMBase * input, DSIGTransformList * lst) { TXFMChain * ret; XSECnew(ret, TXFMChain(input)); if (lst == NULL) return ret; Janitor j_ret(ret); DSIGTransformList::TransformListVectorType::size_type size, i; size = lst->getSize(); if (size > 0) { // Iterate through the list for (i = 0; i < size; ++i) { lst->item(i)->appendTransformer(ret); } } j_ret.release(); return ret; } // -------------------------------------------------------------------------------- // loadTransforms // -------------------------------------------------------------------------------- DSIGTransformList * DSIGReference::loadTransforms( DOMNode *transformsNode, XSECSafeBufferFormatter * formatter, const XSECEnv * env) { // This is defined as a static function, not because it makes use of any static variables // in the DSIGReference class, but to neatly link it to the other users if (transformsNode == 0 || (!strEquals(getDSIGLocalName(transformsNode), "Transforms") && !strEquals(getXENCLocalName(transformsNode), "Transforms"))) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected in function DSIGReference::processTransforms"); } // Create the list DSIGTransformList * lst; XSECnew(lst, DSIGTransformList()); Janitor j_lst(lst); // Find First transform DOMNode * transforms = transformsNode->getFirstChild(); while (transforms != NULL && transforms->getNodeType() != DOMNode::ELEMENT_NODE) transforms = transforms->getNextSibling(); while (transforms != NULL) { // Process each transform in turn if (!strEquals(getDSIGLocalName(transforms), "Transform")) { // Not what we expected to see! safeBuffer tmp, error; error << (*formatter << getDSIGLocalName(transforms)); tmp.sbStrcpyIn("Unknown attribute in - Expected found "); tmp.sbStrcatIn(error); tmp.sbStrcatIn(">."); throw XSECException(XSECException::ExpectedDSIGChildNotFound, error.rawCharBuffer()); } DOMNamedNodeMap * transformAtts = transforms->getAttributes(); unsigned int i; for (i = 0; i < transformAtts->getLength() && !strEquals(transformAtts->item(i)->getNodeName(), DSIGConstants::s_unicodeStrAlgorithm); ++i); if (i == transformAtts->getLength()) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Algorithm attribute not found in element"); } safeBuffer algorithm; algorithm << (*formatter << transformAtts->item(i)->getNodeValue()); // Determine what the transform is if (algorithm.sbStrcmp(URI_ID_BASE64) == 0) { DSIGTransformBase64 * b; XSECnew(b, DSIGTransformBase64(env, transforms)); lst->addTransform(b); b->load(); } else if (algorithm.sbStrcmp(URI_ID_XPATH) == 0) { DSIGTransformXPath * x; XSECnew(x, DSIGTransformXPath(env, transforms)); lst->addTransform(x); x->load(); } else if (algorithm.sbStrcmp(URI_ID_XPF) == 0) { DSIGTransformXPathFilter * xpf; XSECnew(xpf, DSIGTransformXPathFilter(env, transforms)); lst->addTransform(xpf); xpf->load(); } else if (algorithm.sbStrcmp(URI_ID_ENVELOPE) == 0) { DSIGTransformEnvelope * e; XSECnew(e, DSIGTransformEnvelope(env, transforms)); lst->addTransform(e); e->load(); } else if (algorithm.sbStrcmp(URI_ID_XSLT) == 0) { DSIGTransformXSL * x; XSECnew(x, DSIGTransformXSL(env, transforms)); lst->addTransform(x); x->load(); } else if (algorithm.sbStrcmp(URI_ID_C14N_COM) == 0 || algorithm.sbStrcmp(URI_ID_C14N_NOC) == 0 || algorithm.sbStrcmp(URI_ID_C14N11_COM) == 0 || algorithm.sbStrcmp(URI_ID_C14N11_NOC) == 0 || algorithm.sbStrcmp(URI_ID_EXC_C14N_COM) == 0 || algorithm.sbStrcmp(URI_ID_EXC_C14N_NOC) == 0) { DSIGTransformC14n * c; XSECnew(c, DSIGTransformC14n(env, transforms)); lst->addTransform(c); c->load(); } else { // Not what we expected to see! safeBuffer tmp; tmp.sbStrcpyIn("Unknown transform : "); tmp.sbStrcatIn(algorithm); tmp.sbStrcatIn(" found."); throw XSECException(XSECException::UnknownTransform, tmp.rawCharBuffer()); } // Now find next element transforms = transforms->getNextSibling(); while (transforms != NULL && transforms->getNodeType() != DOMNode::ELEMENT_NODE) transforms = transforms->getNextSibling(); } /* while (transforms != NULL) */ j_lst.release(); return lst; } // -------------------------------------------------------------------------------- // Set hash // -------------------------------------------------------------------------------- void DSIGReference::setHash(void) { // First determine the hash value XMLByte calculatedHashVal[CRYPTO_MAX_HASH_SIZE]; // The hash that we determined unsigned int calculatedHashLen; XMLByte base64Hash [CRYPTO_MAX_HASH_SIZE * 2]; unsigned int base64HashLen; calculatedHashLen = calculateHash(calculatedHashVal, CRYPTO_MAX_HASH_SIZE); // Calculate the base64 value XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64(); if (!b64) { throw XSECException(XSECException::CryptoProviderError, "Error requesting Base64 object from Crypto Provider"); } Janitor j_b64(b64); b64->encodeInit(); base64HashLen = b64->encode(calculatedHashVal, calculatedHashLen, base64Hash, CRYPTO_MAX_HASH_SIZE * 2); base64HashLen += b64->encodeFinish(&base64Hash[base64HashLen], (CRYPTO_MAX_HASH_SIZE * 2) - base64HashLen); // Ensure the string is terminated if (base64Hash[base64HashLen-1] == '\n') base64Hash[base64HashLen-1] = '\0'; else base64Hash[base64HashLen] = '\0'; // Now find the correct text node to re-set DOMNode *tmpElt = mp_hashValueNode; if (mp_hashValueNode == 0) { throw XSECException(XSECException::NotLoaded, "setHash() called in DSIGReference before load()"); } tmpElt = mp_hashValueNode->getFirstChild(); while (tmpElt != NULL && tmpElt->getNodeType() != DOMNode::TEXT_NODE) tmpElt = tmpElt->getNextSibling(); if (tmpElt == NULL) { // Need to create the underlying TEXT_NODE DOMDocument *doc = mp_referenceNode->getOwnerDocument(); tmpElt = doc->createTextNode(MAKE_UNICODE_STRING((char *) base64Hash)); mp_hashValueNode->appendChild(tmpElt); } else { tmpElt->setNodeValue(MAKE_UNICODE_STRING((char *) base64Hash)); } } // -------------------------------------------------------------------------------- // Create hash // -------------------------------------------------------------------------------- unsigned int DSIGReference::calculateHash(XMLByte *toFill, unsigned int maxToFill) { // Determine the hash value of the element // First set up for input TXFMBase * currentTxfm; TXFMChain * chain; unsigned int size; if (m_loaded == false) { throw XSECException(XSECException::NotLoaded, "calculateHash() called in DSIGReference before load()"); } // Find base transform currentTxfm = getURIBaseTXFM(mp_referenceNode->getOwnerDocument(), mp_URI, mp_env); // Now build the transforms list // Note this passes ownership of currentTxfm to the function, so it is the // responsibility of createTXFMChain to ensure it gets deleted if this throws. chain = createTXFMChainFromList(currentTxfm, mp_transformList); Janitor j_chain(chain); DOMDocument *d = mp_referenceNode->getOwnerDocument(); // All transforms done. If necessary, change the type from nodes to bytes if (chain->getLastTxfm()->getOutputType() == TXFMBase::DOM_NODES) { TXFMC14n * c14n; XSECnew(c14n, TXFMC14n(d)); chain->appendTxfm(c14n); } // Check to see if there is a final "application" transform prior to the hash if (mp_preHash != NULL) { chain->appendTxfm(mp_preHash); mp_preHash = NULL; // Can't be re-used } // Check for debugging sink for the data TXFMBase* sink = XSECPlatformUtils::GetReferenceLoggingSink(d); if (sink) chain->appendTxfm(sink); // Get the mapping for the hash transform XSECAlgorithmHandler * handler = XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(mp_algorithmURI); if (handler == NULL) { throw XSECException(XSECException::SigVfyError, "Hash method unknown in DSIGReference::calculateHash()"); } if (!handler->appendHashTxfm(chain, mp_algorithmURI)) { throw XSECException(XSECException::SigVfyError, "Unexpected error in handler whilst appending Hash transform"); } // Now we have the hashing transform, run it. size = chain->getLastTxfm()->readBytes(toFill, maxToFill); // Clean out document if necessary chain->getLastTxfm()->deleteExpandedNameSpaces(); return size; } // -------------------------------------------------------------------------------- // Read hash // -------------------------------------------------------------------------------- unsigned int DSIGReference::readHash(XMLByte *toFill, unsigned int maxToFill) { // Determine the hash value stored in the reference // First set up for input unsigned int size; DOMNode *tmpElt; //const XMLCh * stringHash; TXFMBase * nextInput; DOMDocument *d = mp_referenceNode->getOwnerDocument(); safeBuffer b64HashVal; // Find the hash value tmpElt = mp_referenceNode->getFirstChild(); while (tmpElt != 0 && !strEquals(getDSIGLocalName(tmpElt), "DigestValue")) tmpElt = tmpElt->getNextSibling(); if (tmpElt == NULL) // ERROR return 0; // Now read the DOMString of the hash tmpElt = tmpElt->getFirstChild(); while (tmpElt != NULL && tmpElt->getNodeType() != DOMNode::TEXT_NODE) tmpElt = tmpElt->getNextSibling(); if (tmpElt == NULL) // Something wrong with the underlying XML if no text was found throw XSECException(XSECException::NoHashFoundInDigestValue); b64HashVal << (*mp_formatter << tmpElt->getNodeValue()); // Now have the value of the string - create a transform around it XSECnew(nextInput, TXFMSB(d)); ((TXFMSB *) nextInput)->setInput(b64HashVal); // Create a transform chain (really as a janitor for the entire list) TXFMChain * chain; XSECnew(chain, TXFMChain(nextInput)); Janitor j_chain(chain); // Now create the base64 transform XSECnew(nextInput, TXFMBase64(d)); chain->appendTxfm(nextInput); // Now get the value size = chain->getLastTxfm()->readBytes(toFill, maxToFill); // Clear any documentat modifications chain->getLastTxfm()->deleteExpandedNameSpaces(); return size; } // -------------------------------------------------------------------------------- // Check a reference // -------------------------------------------------------------------------------- bool DSIGReference::checkHash() { // Determine the hash value of the element and check if matches that stored in the // DigestValue part of the element // First set up for input XMLByte calculatedHashVal[CRYPTO_MAX_HASH_SIZE]; // The hash that we determined XMLByte readHashVal[CRYPTO_MAX_HASH_SIZE]; // The hash in the element unsigned int calculatedHashSize, i; if ((calculatedHashSize = calculateHash(calculatedHashVal, CRYPTO_MAX_HASH_SIZE)) == 0) return false; if (readHash(readHashVal, CRYPTO_MAX_HASH_SIZE) != calculatedHashSize) return false; for (i = 0; i < calculatedHashSize; ++i) { if (calculatedHashVal[i] != readHashVal[i]) return false; } // Got through with flying colours! return true; } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoSPKIData.cpp000644 001751 001751 00000011671 12003301053 023456 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyInfoSPKIData := SPKI Information * * Author(s): Berin Lautenbach * * $Id: DSIGKeyInfoSPKIData.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoSPKIData::DSIGKeyInfoSPKIData(const XSECEnv * env, DOMNode *nameNode) : DSIGKeyInfo(env) { mp_keyInfoDOMNode = nameNode; } DSIGKeyInfoSPKIData::DSIGKeyInfoSPKIData(const XSECEnv * env) : DSIGKeyInfo(env) { mp_keyInfoDOMNode = NULL; } DSIGKeyInfoSPKIData::~DSIGKeyInfoSPKIData() { sexpVectorType::iterator i; for (i = m_sexpList.begin(); i != m_sexpList.end(); ++i) { delete *i; } } // -------------------------------------------------------------------------------- // Load and get // -------------------------------------------------------------------------------- void DSIGKeyInfoSPKIData::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::ExpectedDSIGChildNotFound, "DSIGKeyInfoSPKIData::load called without node being set"); } if (!strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "SPKIData")) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected an node"); } // Now find the SPKISexp nodes DOMNode * tmpElt = findFirstChildOfType(mp_keyInfoDOMNode, DOMNode::ELEMENT_NODE); while (tmpElt != NULL && strEquals(getDSIGLocalName(tmpElt), "SPKISexp")) { DOMNode * txt = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (txt == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected text node child of "); } SexpNode * s; XSECnew(s, SexpNode); m_sexpList.push_back(s); s->mp_expr = txt->getNodeValue(); s->mp_exprTextNode = txt; // Find next SPKISexp do { tmpElt = tmpElt->getNextSibling(); } while (tmpElt != NULL && tmpElt->getNodeType() != DOMNode::ELEMENT_NODE); } /* * Note that it is not necessarily an error if non SPKISexp nodes are found * after the SPKISexp nodes. */ } unsigned int DSIGKeyInfoSPKIData::getSexpSize(void) const { return (unsigned int) m_sexpList.size(); } const XMLCh * DSIGKeyInfoSPKIData::getSexp(unsigned int index) const { if (index >= m_sexpList.size()) { throw XSECException(XSECException::KeyInfoError, "DSIGKeyInfoSPKIData::getSexp - index out of range"); } return m_sexpList[index]->mp_expr; } // -------------------------------------------------------------------------------- // Create and set // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoSPKIData::createBlankSPKIData(const XMLCh * Sexp) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "SPKIData"); DOMElement * ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; mp_env->doPrettyPrint(ret); appendSexp(Sexp); return ret; } void DSIGKeyInfoSPKIData::appendSexp(const XMLCh * Sexp) { // First create the new element in the list SexpNode *s; XSECnew(s, SexpNode); m_sexpList.push_back(s); safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "SPKISexp"); DOMNode *tmpElt = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); s->mp_exprTextNode = doc->createTextNode(Sexp); s->mp_expr = s->mp_exprTextNode->getNodeValue(); tmpElt->appendChild(s->mp_exprTextNode); mp_keyInfoDOMNode->appendChild(tmpElt); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } xml-security-c-1.7.3/xsec/dsig/DSIGTransformList.cpp000644 001751 001751 00000004216 12003301053 023435 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformList := Class for Loading and storing a list of references * * $Id: DSIGTransformList.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include DSIGTransformList::DSIGTransformList(void){ } DSIGTransformList::~DSIGTransformList() { // Delete all the transforms contained in the list DSIGTransformList::TransformListVectorType::iterator it = m_transformList.begin(); while (it != m_transformList.end()) { delete *it; it++; } } void DSIGTransformList::addTransform(DSIGTransform * ref) { m_transformList.push_back(ref); } DSIGTransformList::size_type DSIGTransformList::getSize(void) { return m_transformList.size(); } void DSIGTransformList::removeTransform(size_type index) { if (index < m_transformList.size()) { TransformListVectorType::iterator i = m_transformList.begin(); for (size_type j = 0; j < index; ++j) i++; if (i != m_transformList.end()) { delete *i; m_transformList.erase(i); } } } DSIGTransform * DSIGTransformList::item(DSIGTransformList::size_type index) { if (index < m_transformList.size()) return m_transformList[index]; return NULL; } bool DSIGTransformList::empty() { // Clear out the list - note we do NOT delete the transform elements return m_transformList.empty(); } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoX509.cpp000644 001751 001751 00000040731 12003301053 022562 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyX509 := A "Super" key that defines a certificate with a sub-key that defines * the signing key * * $Id: DSIGKeyInfoX509.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include "../utils/XSECAutoPtr.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoX509::DSIGKeyInfoX509(const XSECEnv * env, DOMNode *X509Data) : DSIGKeyInfo(env), mp_X509IssuerName(NULL), mp_X509SerialNumber(NULL), mp_X509SubjectName(NULL), mp_X509SKI(NULL), mp_rawRetrievalURI(NULL), mp_X509SubjectNameTextNode(0), mp_X509IssuerNameTextNode(0), mp_X509SerialNumberTextNode(0), mp_X509SKITextNode(0), mp_X509DigestTextNode(0) { mp_keyInfoDOMNode = X509Data; m_X509List.clear(); m_X509CRLList.clear(); } DSIGKeyInfoX509::DSIGKeyInfoX509(const XSECEnv * env) : DSIGKeyInfo(env), mp_X509IssuerName(NULL), mp_X509SerialNumber(NULL), mp_X509SubjectName(NULL), mp_X509SKI(NULL), mp_rawRetrievalURI(NULL), mp_X509SubjectNameTextNode(0), mp_X509IssuerNameTextNode(0), mp_X509SerialNumberTextNode(0), mp_X509SKITextNode(0), mp_X509DigestTextNode(0){ mp_keyInfoDOMNode = 0; m_X509List.clear(); m_X509CRLList.clear(); } DSIGKeyInfoX509::~DSIGKeyInfoX509() { // SubjectName and IssuerName are local (decoded) copies of the // encoded DName held in the DOM if (mp_X509IssuerName != NULL) XSEC_RELEASE_XMLCH(mp_X509IssuerName); if (mp_X509SubjectName != NULL) XSEC_RELEASE_XMLCH(mp_X509SubjectName); X509ListType::iterator i; for (i = m_X509List.begin(); i != m_X509List.end(); ++i) { if ((*i)->mp_cryptoX509 != NULL) delete ((*i)->mp_cryptoX509); delete (*i); } m_X509List.clear(); m_X509CRLList.clear(); if (mp_rawRetrievalURI != NULL) XSEC_RELEASE_XMLCH(mp_rawRetrievalURI); }; // -------------------------------------------------------------------------------- // Load and Get // -------------------------------------------------------------------------------- // Methods unique to DSIGKeyInfoX509 void DSIGKeyInfoX509::load(void) { // Assuming we have a valid DOM_Node to start with, load the signing key so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptyX509); } if (!strEquals(getDSIGLocalName(mp_keyInfoDOMNode), "X509Data")) { throw XSECException(XSECException::LoadNonX509); } // Now check for an X509 Data Element we understand DOMNode *tmpElt = mp_keyInfoDOMNode->getFirstChild(); DOMNode *child; // Worker while (tmpElt != 0) { if (tmpElt->getNodeType() == DOMNode::ELEMENT_NODE) { // See if it's a known element type if (strEquals(getDSIGLocalName(tmpElt), "X509Certificate")) { // Loop over Text nodes until we successfully load a certificate. // If we run out, throw out the last exception raised. X509Holder * h; XSECCryptoX509* cryptoX509 = XSECPlatformUtils::g_cryptoProvider->X509(); DOMNode *certElt = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); while (certElt) { XSECAutoPtrChar charX509(certElt->getNodeValue()); try { cryptoX509->loadX509Base64Bin(charX509.get(), (int) strlen(charX509.get())); // Add to the list XSECnew(h, X509Holder); m_X509List.push_back(h); h->mp_encodedX509 = certElt->getNodeValue(); h->mp_cryptoX509 = cryptoX509; break; } catch (XSECCryptoException&) { certElt = findNextChildOfType(certElt, DOMNode::TEXT_NODE); if (!certElt) { delete cryptoX509; throw; } } } } else if (strEquals(getDSIGLocalName(tmpElt), "X509SubjectName")) { child = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT_NODE child of "); } mp_X509SubjectName = decodeDName(child->getNodeValue()); } else if (strEquals(getDSIGLocalName(tmpElt), "X509IssuerSerial")) { child = tmpElt->getFirstChild(); while (child != 0 && child->getNodeType() != DOMNode::ELEMENT_NODE && !strEquals(getDSIGLocalName(child), "X509IssuerName")) child = child->getNextSibling(); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected child of "); } child = child->getFirstChild(); while (child != 0 && child->getNodeType() != DOMNode::TEXT_NODE) child = child->getNextSibling(); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT_NODE child of "); } mp_X509IssuerName = decodeDName(child->getNodeValue()); // Now find the serial number child = tmpElt->getFirstChild(); while (child != 0 && (child->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getDSIGLocalName(child), "X509SerialNumber"))) child = child->getNextSibling(); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected child of "); } child = child->getFirstChild(); while (child != 0 && child->getNodeType() != DOMNode::TEXT_NODE) child = child->getNextSibling(); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT_NODE child of "); } mp_X509SerialNumber = child->getNodeValue(); } else if (strEquals(getDSIGLocalName(tmpElt), "X509CRL")) { DOMNode *crlElt = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (crlElt != 0) { // Add to the list m_X509CRLList.push_back(crlElt->getNodeValue()); } } else if (strEquals(getDSIGLocalName(tmpElt), "X509SKI")) { child = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT_NODE child of "); } mp_X509SKITextNode = child; mp_X509SKI = child->getNodeValue(); } else if (strEquals(getDSIG11LocalName(tmpElt), "X509Digest")) { child = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE); if (child == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected TEXT_NODE child of "); } mp_X509DigestTextNode = child; } } // Go to next data element to load if we understand tmpElt = tmpElt->getNextSibling(); } } const XMLCh * DSIGKeyInfoX509::getKeyName(void) const { return mp_X509SubjectName; // Should return DN } const XMLCh * DSIGKeyInfoX509::getX509SubjectName(void) const { return mp_X509SubjectName; } const XMLCh * DSIGKeyInfoX509::getX509DigestAlgorithm(void) const { return mp_X509DigestTextNode ? static_cast(mp_X509DigestTextNode->getParentNode())->getAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm) : NULL; } const XMLCh * DSIGKeyInfoX509::getX509DigestValue(void) const { return mp_X509DigestTextNode ? mp_X509DigestTextNode->getNodeValue() : NULL; } const XMLCh * DSIGKeyInfoX509::getX509IssuerName(void) const { return mp_X509IssuerName; } const XMLCh * DSIGKeyInfoX509::getX509IssuerSerialNumber(void) const { return mp_X509SerialNumber; } const XMLCh * DSIGKeyInfoX509::getX509CRL(void) const { return m_X509CRLList.empty() ? NULL : m_X509CRLList.front(); } int DSIGKeyInfoX509::getX509CRLListSize(void) const { return (int) m_X509CRLList.size(); } const XMLCh * DSIGKeyInfoX509::getX509CRLItem(int item) const { if (item >=0 && (unsigned int) item < m_X509CRLList.size()) return m_X509CRLList[item]; return 0; } const XMLCh * DSIGKeyInfoX509::getX509SKI(void) const { return mp_X509SKI; } int DSIGKeyInfoX509::getCertificateListSize(void) const { return (int) m_X509List.size(); } const XMLCh * DSIGKeyInfoX509::getCertificateItem(int item) const { if (item >=0 && (unsigned int) item < m_X509List.size()) return m_X509List[item]->mp_encodedX509; return 0; } XSECCryptoX509 * DSIGKeyInfoX509::getCertificateCryptoItem(int item) { if (item >=0 && (unsigned int) item < m_X509List.size()) return m_X509List[item]->mp_cryptoX509; return 0; } const XSECCryptoX509 * DSIGKeyInfoX509::getCertificateCryptoItem(int item) const { if (item >=0 && (unsigned int) item < m_X509List.size()) return m_X509List[item]->mp_cryptoX509; return 0; } const XMLCh * DSIGKeyInfoX509::getRawRetrievalURI(void) const { return mp_rawRetrievalURI; } // -------------------------------------------------------------------------------- // Create and Set // -------------------------------------------------------------------------------- DOMElement * DSIGKeyInfoX509::createBlankX509Data(void) { // Create the DOM Structure safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509Data"); DOMElement *ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_keyInfoDOMNode = ret; mp_env->doPrettyPrint(ret); return ret; } void DSIGKeyInfoX509::setX509CRL(const XMLCh * crl) { appendX509CRL(crl); } void DSIGKeyInfoX509::appendX509CRL(const XMLCh * crl) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509CRL"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); DOMNode * b64Txt = doc->createTextNode(crl); s->appendChild(b64Txt); mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); // Add to the list m_X509CRLList.push_back(b64Txt->getNodeValue()); } void DSIGKeyInfoX509::setX509SKI(const XMLCh * ski) { if (mp_X509SKITextNode == 0) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509SKI"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_X509SKITextNode = doc->createTextNode(ski); s->appendChild(mp_X509SKITextNode); // Add to the over-arching node mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } else { mp_X509SKITextNode->setNodeValue(ski); } mp_X509SKI = mp_X509SKITextNode->getNodeValue(); } void DSIGKeyInfoX509::setX509SubjectName(const XMLCh * name) { if (mp_X509SubjectName != NULL) XSEC_RELEASE_XMLCH(mp_X509SubjectName); mp_X509SubjectName = XMLString::replicate(name); XMLCh * encodedName = encodeDName(name); if (mp_X509SubjectNameTextNode == 0) { // Does not yet exist in the DOM safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509SubjectName"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_X509SubjectNameTextNode = doc->createTextNode(encodedName); s->appendChild(mp_X509SubjectNameTextNode); // Add to the over-arching node mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } else { mp_X509SubjectNameTextNode->setNodeValue(encodedName); } XSEC_RELEASE_XMLCH(encodedName); } void DSIGKeyInfoX509::setX509IssuerSerial(const XMLCh * name, const XMLCh * serial) { if (mp_X509IssuerName != NULL) XSEC_RELEASE_XMLCH(mp_X509IssuerName); mp_X509IssuerName = XMLString::replicate(name); XMLCh * encodedName = encodeDName(name); if (mp_X509IssuerNameTextNode == 0) { // Does not yet exist in the DOM safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509IssuerSerial"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); mp_env->doPrettyPrint(s); // Create the text nodes with the contents mp_X509IssuerNameTextNode = doc->createTextNode(encodedName); mp_X509SerialNumberTextNode = doc->createTextNode(serial); // Create the sub elements makeQName(str, prefix, "X509IssuerName"); DOMElement * t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); t->appendChild(mp_X509IssuerNameTextNode); s->appendChild(t); mp_env->doPrettyPrint(s); makeQName(str, prefix, "X509SerialNumber"); t = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); t->appendChild(mp_X509SerialNumberTextNode); s->appendChild(t); mp_env->doPrettyPrint(s); // Add to the over-arching X509Data mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } else { mp_X509IssuerNameTextNode->setNodeValue(encodedName); mp_X509SerialNumberTextNode->setNodeValue(serial); } XSEC_RELEASE_XMLCH(encodedName); } void DSIGKeyInfoX509::setX509Digest(const XMLCh * algorithm, const XMLCh * value) { if (mp_X509DigestTextNode == 0) { // Does not yet exist in the DOM safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIG11NSPrefix(); makeQName(str, prefix, "X509Digest"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG11, str.rawXMLChBuffer()); s->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, algorithm); // Create the text node with the contents mp_X509DigestTextNode = doc->createTextNode(value); s->appendChild(mp_X509DigestTextNode); mp_env->doPrettyPrint(s); // Add to the over-arching X509Data mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); } else { mp_X509DigestTextNode->setNodeValue(value); static_cast(mp_X509DigestTextNode->getParentNode())->setAttributeNS(NULL, DSIGConstants::s_unicodeStrAlgorithm, algorithm); } } void DSIGKeyInfoX509::setRawRetrievalURI(const XMLCh * uri) { if (mp_rawRetrievalURI != NULL) XSEC_RELEASE_XMLCH(mp_rawRetrievalURI); mp_rawRetrievalURI = XMLString::replicate(uri); } void DSIGKeyInfoX509::appendX509Certificate(const XMLCh * base64Certificate) { safeBuffer str; DOMDocument *doc = mp_env->getParentDocument(); const XMLCh * prefix = mp_env->getDSIGNSPrefix(); makeQName(str, prefix, "X509Certificate"); DOMElement * s = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); DOMNode * b64Txt = doc->createTextNode(base64Certificate); s->appendChild(b64Txt); mp_keyInfoDOMNode->appendChild(s); mp_env->doPrettyPrint(mp_keyInfoDOMNode); // Add to the list X509Holder * h; XSECnew(h, X509Holder); m_X509List.push_back(h); h->mp_encodedX509 = b64Txt->getNodeValue(); h->mp_cryptoX509 = XSECPlatformUtils::g_cryptoProvider->X509(); XSECAutoPtrChar charX509(h->mp_encodedX509); h->mp_cryptoX509->loadX509Base64Bin(charX509.get(), (unsigned int) strlen(charX509.get())); } xml-security-c-1.7.3/xsec/dsig/DSIGKeyInfoExt.cpp000644 001751 001751 00000003770 12003301053 022657 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGKeyExt := An extension type for anything unknown to the library * * Author(s): Scott Cantor * * $Id:$ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGKeyInfoExt::DSIGKeyInfoExt(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *extNode) : DSIGKeyInfo(env) { mp_keyInfoDOMNode = extNode; } DSIGKeyInfoExt::~DSIGKeyInfoExt() {} // -------------------------------------------------------------------------------- // Load and Get functions // -------------------------------------------------------------------------------- void DSIGKeyInfoExt::load(void) { // Assuming we have a valid DOM_Node to start with, load the extension so that it can // be used later on if (mp_keyInfoDOMNode == NULL) { // Attempt to load an empty signature element throw XSECException(XSECException::LoadEmptyInfoName); } } xml-security-c-1.7.3/xsec/dsig/DSIGTransform.cpp000644 001751 001751 00000003016 12003301053 022576 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransform := Base (virtual) class that defines a DSIG Transform * * $Id: DSIGTransform.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include XERCES_CPP_NAMESPACE_USE DOMElement * DSIGTransform::createTransformNode() { // Create a transform node (and transforms if they do not exist) safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); return ret; } xml-security-c-1.7.3/xsec/dsig/DSIGTransformC14n.cpp000644 001751 001751 00000023721 12003301053 023231 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * DSIGTransformC14n := Class that performs C14n canonicalisation * * $Id: DSIGTransformC14n.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- DSIGTransformC14n::DSIGTransformC14n(const XSECEnv * env, DOMNode * node) : DSIGTransform(env, node) { m_cMethod = CANON_NONE; mp_inclNSNode = NULL; mp_inclNSStr = NULL; } DSIGTransformC14n::DSIGTransformC14n(const XSECEnv * env) : DSIGTransform(env) { m_cMethod = CANON_NONE; mp_inclNSNode = NULL; mp_inclNSStr = NULL; } DSIGTransformC14n::~DSIGTransformC14n() {}; // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- transformType DSIGTransformC14n::getTransformType() { if ((m_cMethod == CANON_C14NE_NOC) || (m_cMethod == CANON_C14NE_COM)) return TRANSFORM_EXC_C14N; else if ((m_cMethod == CANON_C14N11_NOC) || (m_cMethod == CANON_C14N11_COM)) return TRANSFORM_C14N11; return TRANSFORM_C14N; } void DSIGTransformC14n::appendTransformer(TXFMChain * input) { TXFMC14n * c; XSECnew(c, TXFMC14n(mp_txfmNode->getOwnerDocument())); input->appendTxfm(c); switch (m_cMethod) { case (CANON_C14N_NOC) : case (CANON_C14N11_NOC) : case (CANON_C14NE_NOC) : c->stripComments(); break; case (CANON_C14N_COM) : case (CANON_C14N11_COM) : case (CANON_C14NE_COM) : c->activateComments(); break; default: break; } // Check for exclusive and 1.1 if (m_cMethod == CANON_C14NE_COM || m_cMethod == CANON_C14NE_NOC) { if (mp_inclNSStr == NULL) { c->setExclusive(); } else { safeBuffer incl; incl << (*(mp_env->getSBFormatter()) << mp_inclNSStr); c->setExclusive(incl); } } else if (m_cMethod == CANON_C14N11_COM || m_cMethod == CANON_C14N11_NOC) { c->setInclusive11(); } } DOMElement * DSIGTransformC14n::createBlankTransform(DOMDocument * parentDoc) { safeBuffer str; const XMLCh * prefix; DOMElement *ret; DOMDocument *doc = mp_env->getParentDocument(); prefix = mp_env->getDSIGNSPrefix(); // Create the transform node makeQName(str, prefix, "Transform"); ret = doc->createElementNS(DSIGConstants::s_unicodeStrURIDSIG, str.rawXMLChBuffer()); ret->setAttributeNS(NULL,DSIGConstants::s_unicodeStrAlgorithm, DSIGConstants::s_unicodeStrURIC14N_NOC); mp_txfmNode = ret; mp_inclNSStr = NULL; mp_inclNSNode = NULL; return ret; } void DSIGTransformC14n::load(void) { const XMLCh * uri; DOMNamedNodeMap * atts; DOMNode *att; // Read the URI for the type if (mp_txfmNode == NULL) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected Node in DSIGTrasnformC14n::load"); } atts = mp_txfmNode->getAttributes(); if (atts == NULL || ((att = atts->getNamedItem(DSIGConstants::s_unicodeStrAlgorithm)) == NULL)) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected to find Algorithm attribute in node"); } uri = att->getNodeValue(); if (strEquals(uri, DSIGConstants::s_unicodeStrURIC14N_COM)) { m_cMethod = CANON_C14N_COM; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIC14N_NOC)) { m_cMethod = CANON_C14N_NOC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIC14N11_COM)) { m_cMethod = CANON_C14N11_COM; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIC14N11_NOC)) { m_cMethod = CANON_C14N11_NOC; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIEXC_C14N_COM)) { m_cMethod = CANON_C14NE_COM; } else if (strEquals(uri, DSIGConstants::s_unicodeStrURIEXC_C14N_NOC)) { m_cMethod = CANON_C14NE_NOC; } else { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Unexpected URI found in canonicalisation "); } // Determine whether there is an InclusiveNamespaces list if (m_cMethod == CANON_C14NE_NOC || m_cMethod == CANON_C14NE_COM) { // Exclusive, so there may be an InclusiveNamespaces node DOMNode * inclNSNode = mp_txfmNode->getFirstChild(); while (inclNSNode != NULL && (inclNSNode->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(getECLocalName(inclNSNode), "InclusiveNamespaces"))) inclNSNode = inclNSNode->getNextSibling(); if (inclNSNode != 0) { mp_inclNSNode = static_cast(inclNSNode); // Have a prefix list atts = mp_inclNSNode->getAttributes(); safeBuffer inSB; if (atts == 0 || ((att = atts->getNamedItem(MAKE_UNICODE_STRING("PrefixList"))) == NULL)) { throw XSECException(XSECException::ExpectedDSIGChildNotFound, "Expected PrefixList in InclusiveNamespaces"); } mp_inclNSStr = att->getNodeValue(); } } } // -------------------------------------------------------------------------------- // Canonicalization Specific Methods // -------------------------------------------------------------------------------- void DSIGTransformC14n::setCanonicalizationMethod(canonicalizationMethod method) { const XMLCh * m = canonicalizationMethod2UNICODEURI(method); if (strEquals(m, DSIGConstants::s_unicodeStrEmpty) || mp_txfmNode == NULL) { throw XSECException(XSECException::TransformError, "Either method unknown or Node not set in setCanonicalizationMethod"); } if (method == CANON_C14N_NOC || method == CANON_C14N_COM || method == CANON_C14N11_NOC || method == CANON_C14N11_COM) { if (m_cMethod == CANON_C14NE_NOC || m_cMethod == CANON_C14NE_COM) { if (mp_inclNSNode != 0) { mp_txfmNode->removeChild(mp_inclNSNode); mp_inclNSNode->release(); // No longer required mp_inclNSNode = NULL; mp_inclNSStr = NULL; } } } // Now do the set. ((DOMElement *) mp_txfmNode)->setAttributeNS(NULL,MAKE_UNICODE_STRING("Algorithm"), m); m_cMethod = method; } canonicalizationMethod DSIGTransformC14n::getCanonicalizationMethod(void) { return m_cMethod; } void DSIGTransformC14n::createInclusiveNamespaceNode(void) { // Creates an empty inclusiveNamespace node. Does _not_ set the prefixlist attribute if (mp_inclNSNode != NULL) return; // Already exists safeBuffer str; const XMLCh * prefix; DOMDocument *doc = mp_env->getParentDocument(); // Use the Exclusive Canonicalisation prefix prefix = mp_env->getECNSPrefix(); // Create the transform node makeQName(str, prefix, "InclusiveNamespaces"); mp_inclNSNode = doc->createElementNS(DSIGConstants::s_unicodeStrURIEC, str.rawXMLChBuffer()); // Add the node to the owner element mp_env->doPrettyPrint(mp_txfmNode); mp_txfmNode->appendChild(mp_inclNSNode); mp_env->doPrettyPrint(mp_txfmNode); // Set the namespace attribute if (prefix[0] == '\0') { str.sbTranscodeIn("xmlns"); } else { str.sbTranscodeIn("xmlns:"); str.sbXMLChCat(prefix); } mp_inclNSNode->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, str.rawXMLChBuffer(), DSIGConstants::s_unicodeStrURIEC); } void DSIGTransformC14n::setInclusiveNamespaces(const XMLCh * ns) { // Set all the namespaces at once if (m_cMethod != CANON_C14NE_COM && m_cMethod != CANON_C14NE_NOC) { throw XSECException(XSECException::TransformError, "Cannot set inclusive namespaces on non Exclusive Canonicalisation"); } if (mp_inclNSNode == NULL) { // Create the transform node createInclusiveNamespaceNode(); } // Now create the prefix list mp_inclNSNode->setAttributeNS(NULL,MAKE_UNICODE_STRING("PrefixList"), ns); mp_inclNSStr = mp_inclNSNode->getAttributes()->getNamedItem(MAKE_UNICODE_STRING("PrefixList"))->getNodeValue(); } void DSIGTransformC14n::addInclusiveNamespace(const char * ns) { if (m_cMethod != CANON_C14NE_COM && m_cMethod != CANON_C14NE_NOC) { throw XSECException(XSECException::TransformError, "Cannot set inclusive namespaces on non Exclusive Canonicalisation"); } if (mp_inclNSNode == NULL) { // Create the transform node createInclusiveNamespaceNode(); // Now create the prefix list mp_inclNSNode->setAttributeNS(NULL,MAKE_UNICODE_STRING("PrefixList"), MAKE_UNICODE_STRING(ns)); mp_inclNSStr = mp_inclNSNode->getAttributes()->getNamedItem(MAKE_UNICODE_STRING("PrefixList"))->getNodeValue(); } else { // More tricky safeBuffer str; str << (*(mp_env->getSBFormatter()) << mp_inclNSStr); str.sbStrcatIn(" "); str.sbStrcatIn((char *) ns); mp_inclNSNode->setAttributeNS(NULL,MAKE_UNICODE_STRING("PrefixList"), str.sbStrToXMLCh()); mp_inclNSStr = mp_inclNSNode->getAttributes()->getNamedItem(MAKE_UNICODE_STRING("PrefixList"))->getNodeValue(); } } const XMLCh * DSIGTransformC14n::getPrefixList(void) { return mp_inclNSStr; } void DSIGTransformC14n::clearInclusiveNamespaces(void) { if (mp_inclNSNode != 0) { mp_txfmNode->removeChild(mp_inclNSNode); mp_inclNSNode->release(); // No longer required mp_inclNSNode = NULL; mp_inclNSStr = NULL; } } xml-security-c-1.7.3/xsec/canon/XSECXMLNSStack.hpp000644 001751 001751 00000006027 12003301053 022710 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECXMLNSStack := NS Stack for simple canonicalisation * * $Id: XSECXMLNSStack.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECXMLNSSTACK_INCLUDE #define XSECXMLNSSTACK_INCLUDE // XSEC #include // Xerces XSEC_DECLARE_XERCES_CLASS(DOMNode) // General #include #include // -------------------------------------------------------------------------------- // Holder structures // -------------------------------------------------------------------------------- struct XSECNSHolderStruct; struct XSECNSElementStruct; typedef struct XSECNSHolderStruct XSECNSHolder; typedef struct XSECNSElementStruct XSECNSElement; #if defined(XSEC_NO_NAMESPACES) typedef vector XSECNSHolderVectorType; typedef stack XSECNSElementStackType; #else typedef std::vector XSECNSHolderVectorType; typedef std::stack XSECNSElementStackType; #endif // -------------------------------------------------------------------------------- // The stack // -------------------------------------------------------------------------------- class XSECXMLNSStack { public: XSECXMLNSStack(); ~XSECXMLNSStack(); // Stack functions void pushElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * elt); void popElement(); // NS Functions void addNamespace(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * ns); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getFirstNamespace(void); XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getNextNamespace(void); // Mark the namespace as printed void printNamespace(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * ns, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * elt); // Return whether the stack includes xmlns="something" bool isNonEmptyDefaultNS(void); private: // The stack holds all the elements, with a linked list of NS nodes // THat were pushed in for each element XSECNSElementStackType m_elements; // The vector holds all the "currently visible" namespaces for this element XSECNSHolderVectorType m_currentNS; // Hold a pointer into the visible namespace list for the current element XSECNSHolderVectorType::iterator m_currentNSIterator; }; #endif /* XSECXMLNSSTACK_INCLUDE */ xml-security-c-1.7.3/xsec/canon/XSECCanon.hpp000644 001751 001751 00000006275 12003301053 022064 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCanon := Base (abstract) class for canonicalisation objects * * * Author(s): Berin Lautenbach * * $Id: XSECCanon.hpp 1125514 2011-05-20 19:08:33Z scantor $ */ // XSEC includes #include #include XSEC_DECLARE_XERCES_CLASS(DOMNode) XSEC_DECLARE_XERCES_CLASS(DOMDocument) // -------------------------------------------------------------------------------- // Defines // -------------------------------------------------------------------------------- #define XSECCANNON_BUFFER_START_SIZE 8192 /* Default size for the outBuffer */ // -------------------------------------------------------------------------------- // XSECCanon Virtual Class definition // -------------------------------------------------------------------------------- // Most of the interface work is done within this class. However the actual // processing is done via the processNextNode virtual function that must be // implemented by all children classes. class CANON_EXPORT XSECCanon { protected: // Data structures XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; // Xerces DOM Node that defines the document XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_startNode, // Node to start processing from *mp_nextNode; // Next Node to be processeed safeBuffer m_buffer; // Buffer holding parsed output xsecsize_t m_bufferLength, // Length of input currently in buffer m_bufferPoint; // Next "character" to copy out bool m_allNodesDone; // Have we completed? public: // Constructors XSECCanon(); XSECCanon(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc); XSECCanon( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *newStartNode); // Destructors virtual ~XSECCanon(); // Public Methods // outputBuffer is used by all canonicalisers to output the next numBytes bytes of // canonicalised XML to the nominated buffer xsecsize_t outputBuffer(unsigned char *outBuffer, xsecsize_t numBytes); // setStartNode sets the starting point for the output if it is a sub-document // that needs canonicalisation and we want to re-start bool setStartNode(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *newStartNode); protected: // processNextNode is the pure virtual function that must be implemented by all canons virtual xsecsize_t processNextNode() = 0; }; xml-security-c-1.7.3/xsec/canon/XSECC14n20010315.hpp000644 001751 001751 00000013020 12003301053 022331 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECC14n20010315 := Canonicaliser object to process XML document in line with * RFC 3076 * * Author(s): Berin Lautenbach * * $Id: XSECC14n20010315.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECC14n20010315_INCLUDE #define XSECC14n20010315_INCLUDE //XSEC includes #include #include #include #include #include #include // General includes #include #include XSEC_USING_XERCES(XMLFormatter); XSEC_USING_XERCES(XMLFormatTarget); class XSECSafeBufferFormatter; // -------------------------------------------------------------------------------- // Simple structure for holding a list of nodes // -------------------------------------------------------------------------------- // NOTE: We don't use NamedNodeMap or DOMNodeList as we are unsure what might happen // to them in the future. Also, to add items we would have to delve into the inards // of Xerces (and use the "...impl" classes). Such an approach might not be supported // in the future. struct XSECNodeListElt { XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *element; // Element referred to safeBuffer sortString; // The string that is used to sort the nodes XSECNodeListElt *next, *last; // For the list }; // Used for the sorting function #define XMLNS_PREFIX "a" #define ATTRIBUTE_PREFIX "b" #define NOURI_PREFIX "a" #define HAVEURI_PREFIX "b" // -------------------------------------------------------------------------------- // XSECC14n20010315 Object definition // -------------------------------------------------------------------------------- class CANON_EXPORT XSECC14n20010315 : public XSECCanon { #if defined(XALAN_NO_NAMESPACES) typedef vector CharListVectorType; #else typedef std::vector CharListVectorType; #endif #if defined(XALAN_SIZE_T_IN_NAMESPACE_STD) typedef std::size_t size_type; #else typedef size_t size_type; #endif public: // Constructors XSECC14n20010315(); XSECC14n20010315(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc); XSECC14n20010315(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *newStartNode); virtual ~XSECC14n20010315(); // XPath processor int XPathSelectNodes(const char * XPathExpr); void setXPathMap(const XSECXPathNodeList & map); // Comments processing void setCommentsProcessing(bool onoff); bool getCommentsProcessing(void); // Exclusive processing void setExclusive(void); void setExclusive(char * xmlnsList); // Inclusive 1.1 processing void setInclusive11(void); // Namespace processing void setUseNamespaceStack(bool flag) {m_useNamespaceStack = flag;} protected: // Implementation of virtual function xsecsize_t processNextNode(); // Test whether a name space is in the non-exclusive list bool inNonExclNSList(safeBuffer &ns); private: void init(); bool checkRenderNameSpaceNode(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *e, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *a); void stackInit(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n); // For formatting the buffers XSECSafeBufferFormatter * mp_formatter; safeBuffer m_formatBuffer; // For holding state whilst walking the DOM tree XSECNodeListElt * mp_attributes, // Start of list * mp_currentAttribute, // Where we currently are in list * mp_firstNonNsAttribute; // First NON XMLNS element in list XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_attributeParent; // To return up the tree bool m_returnedFromChild; // Did we get to this node from below? XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_firstElementNode; // The root element of the document bool m_firstElementProcessed; // Has the first node been handled? unsigned char * mp_charBuffer; // For XPath evaluation bool m_XPathSelection; // Are we doing an XPath? XSECXPathNodeList m_XPathMap; // The elements in the XPath // For comment processing bool m_processComments; // Whether comments are in or out (in by default) // For exclusive canonicalisation CharListVectorType m_exclNSList; bool m_exclusive; bool m_exclusiveDefault; // For Inclusive 1.1 support bool m_incl11; // How do we handle namespaces? // Use the namespace stack if name space expansion has not been run on the document. // NOTE : Using the name space stack *will* cause problems if a full XPath expression // has been run to select the input nodeset. Otherwise we should be fine. bool m_useNamespaceStack; XSECXMLNSStack m_nsStack; }; #endif /* XSECC14n20010315_INCLUDE */ xml-security-c-1.7.3/xsec/canon/XSECC14n20010315.cpp000644 001751 001751 00000106123 12157717415 022362 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECC14n20010315 := Canonicaliser object to process XML document in line with * RFC 3076 * * Author(s): Berin Lautenbach * * $Id: XSECC14n20010315.cpp 1493975 2013-06-17 23:43:09Z scantor $ * */ //XSEC includes #include #include #include #include #include // Xerces includes #include #include #include #include XERCES_CPP_NAMESPACE_USE #ifndef XSEC_NO_XALAN // Xalan includes #include #include #include #include #include #include // Namespace definitions XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XercesDOMSupport) XALAN_USING_XALAN(XercesParserLiaison) XALAN_USING_XALAN(XalanDocument) XALAN_USING_XALAN(XalanNode) XALAN_USING_XALAN(XalanElement) XALAN_USING_XALAN(XalanDOMString) XALAN_USING_XALAN(XalanDOMChar) XALAN_USING_XALAN(NodeRefList) XALAN_USING_XALAN(XercesDocumentWrapper) XALAN_USING_XALAN(XercesWrapperNavigator) XALAN_USING_XALAN(c_wstr) #endif // General includes #include #include #include // -------------------------------------------------------------------------------- // Some useful utilities // -------------------------------------------------------------------------------- // Find a node in an XSECNodeList bool NodeInList(const XSECNodeListElt * lst, const DOMNode * toFind) { const XSECNodeListElt * tmp = lst; while (tmp != NULL) { if (tmp->element == toFind) return true; tmp = tmp->next; } return false; } XSECNodeListElt * insertNodeIntoList(XSECNodeListElt * lst, XSECNodeListElt *toIns) { XSECNodeListElt *tmp, *last; if (lst == NULL) { // Goes at start toIns->next = NULL; toIns->last = NULL; return toIns; } /* if mp_attributes == NULL */ // Need to run through start of list tmp = lst; last = NULL; int res = -1; // Used to remove a gcc warning while ((tmp != NULL) && ((res = toIns->sortString.sbStrcmp(tmp->sortString)) >= 0)) { last = tmp; tmp = tmp->next; } /* while */ if (res ==0) { // Already exists! delete toIns; return lst; } if (last == NULL) { // It sits before first element toIns->next = lst; toIns->last = NULL; lst->last = tmp; return toIns; } /* if last == NULL */ // We have found where it goes toIns->next = tmp; toIns->last = last; if (tmp != NULL) tmp->last = toIns; last->next = toIns; return lst; } // -------------------------------------------------------------------------------- // Exclusive Canonicalisation Methods // -------------------------------------------------------------------------------- bool visiblyUtilises(DOMNode *node, safeBuffer &ns) { // Test whether the node uses the name space passed in if (strEquals(node->getPrefix(), (char *) ns.rawBuffer())) return true; if (ns.sbStrcmp("") == 0) return false; // Attributes are never in default namespace // Check the attributes DOMNamedNodeMap *atts = node->getAttributes(); if (atts == NULL) return false; XMLSize_t size = atts->getLength(); for (XMLSize_t i = 0; i < size; ++i) { if (strEquals(atts->item(i)->getPrefix(), (char *) ns.rawBuffer()) && !strEquals(atts->item(i)->getLocalName(), "xmlns")) return true; } return false; } bool XSECC14n20010315::inNonExclNSList(safeBuffer &ns) { int size = (int) m_exclNSList.size(); for (int i = 0; i < size; ++i) { if (!strcmp((char *) ns.rawBuffer(), m_exclNSList[i])) return true; } return false; } void XSECC14n20010315::setInclusive11(void) { m_incl11 = true; m_exclusive = false; m_exclusiveDefault = false; } void XSECC14n20010315::setExclusive(void) { m_exclusive = true; m_exclusiveDefault = true; m_incl11 = false; } void XSECC14n20010315::setExclusive(char * xmlnsList) { char * nsBuf; setExclusive(); // Set up the define non-exclusive prefixes nsBuf = new char [strlen(xmlnsList) + 1]; if (nsBuf == NULL) { throw XSECException (XSECException::MemoryAllocationFail, "Error allocating a string buffer in XSECC14n20010315::setExclusive"); } ArrayJanitor j_nsBuf(nsBuf); int i, j; i = 0; while (xmlnsList[i] != '\0') { while (xmlnsList[i] == ' ' || xmlnsList[i] == '\t' || xmlnsList[i] == '\r' || xmlnsList[i] == '\n') { ++i; // Skip white space } j = 0; while (!(xmlnsList[i] == ' ' || xmlnsList[i] == '\0' || xmlnsList[i] == '\t' || xmlnsList[i] == '\r' || xmlnsList[i] == '\n')) { nsBuf[j++] = xmlnsList[i++]; // Copy name } // Terminate the string nsBuf[j] = '\0'; if (strcmp(nsBuf, "#default") == 0) { // Default is not to be exclusive m_exclusiveDefault = false; } else { // Add this to the list m_exclNSList.push_back(strdup(nsBuf)); } } } // -------------------------------------------------------------------------------- // XSECC14n20010315 methods // -------------------------------------------------------------------------------- void XSECC14n20010315::stackInit(DOMNode * n) { if (n == NULL) return; stackInit(n->getParentNode()); m_nsStack.pushElement(n); XMLSize_t size; DOMNamedNodeMap *tmpAtts = n->getAttributes(); safeBuffer currentName; if (tmpAtts != NULL) size = tmpAtts->getLength(); else size = 0; XMLSize_t i; for (i = 0; i < size; ++i) { currentName << (*mp_formatter << tmpAtts->item(i)->getNodeName()); if (currentName.sbStrncmp("xmlns", 5) == 0) m_nsStack.addNamespace(tmpAtts->item(i)); } } // Constructors void XSECC14n20010315::init() { // This does the work of setting us up and checks to make sure everyhing is OK // Set up the Xerces formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); // Set up for first attribute list mp_attributes = mp_currentAttribute = mp_firstNonNsAttribute = NULL; // By default process comments m_processComments = true; // Set up for tree walking m_returnedFromChild = false; mp_firstElementNode = mp_startNode; m_firstElementProcessed = false; // XPath setup m_XPathSelection = false; m_XPathMap.clear(); // Exclusive Canonicalisation setup m_exclNSList.clear(); m_exclusive = false; m_exclusiveDefault = false; // Default to 1.0 mode m_incl11 = false; // Namespace handling m_useNamespaceStack = true; // INitialise the stack - even if we don't use it later, at least this sets us up if (mp_startNode != NULL) { stackInit(mp_startNode->getParentNode()); } } XSECC14n20010315::XSECC14n20010315() {}; XSECC14n20010315::XSECC14n20010315(DOMDocument *newDoc) : XSECCanon(newDoc) { // Just call the init function; init(); }; XSECC14n20010315::XSECC14n20010315(DOMDocument *newDoc, DOMNode *newStartNode) : XSECCanon(newDoc, newStartNode) { // Just call the init function init(); } XSECC14n20010315::~XSECC14n20010315() { if (mp_formatter != NULL) delete mp_formatter; // Clear out the exclusive namespace list int size = (int) m_exclNSList.size(); for (int i = 0; i < size; ++i) { free(m_exclNSList[i]); } m_exclNSList.clear(); while (mp_attributes != NULL) { mp_currentAttribute = mp_attributes->next; delete mp_attributes; mp_attributes = mp_currentAttribute; } mp_attributes = mp_currentAttribute = mp_firstNonNsAttribute = NULL; } // -------------------------------------------------------------------------------- // XSECC14n20010315 Comments procesing // -------------------------------------------------------------------------------- void XSECC14n20010315::setCommentsProcessing(bool onoff) { m_processComments = onoff; } bool XSECC14n20010315::getCommentsProcessing(void) { return m_processComments; } // -------------------------------------------------------------------------------- // XSECC14n20010315 XPathSelectNodes method // -------------------------------------------------------------------------------- // Use an XPath expression to select a subset of nodes from the document int XSECC14n20010315::XPathSelectNodes(const char * XPathExpr) { #ifdef XSEC_NO_XPATH throw XSECException(XSECException::UnsupportedFunction, "This library has been compiled without XPath support"); #else XPathEvaluator::initialize(); // We use Xalan to process the Xerces DOM tree and get the XPath nodes #if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10 XercesParserLiaison theParserLiaison; XercesDOMSupport theDOMSupport(theParserLiaison); #else XercesDOMSupport theDOMSupport; #if defined XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT XercesParserLiaison theParserLiaison(theDOMSupport); #else XercesParserLiaison theParserLiaison; #endif #endif // XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10 if (mp_doc == 0) { throw XSECException(XSECException::UnsupportedFunction, "XPath selection only supported in C14n for full documents"); } DOMElement* theXercesNode = mp_doc->createElement(c_wstr(XalanDOMString("ns"))); theXercesNode->setAttribute(c_wstr(XalanDOMString("xmlns:ietf")), c_wstr(XalanDOMString("http://www.ietf.org"))); XalanDocument* theDoc = theParserLiaison.createDocument(mp_doc); // Set up the XPath evaluator XPathEvaluator theEvaluator; // OK, let's find the context node... XalanDOMString cd = XalanDOMString("/"); // For the moment assume the root is the context const XalanDOMChar * cexpr = cd.c_str(); XalanNode* const theContextNode = theEvaluator.selectSingleNode( theDOMSupport, theDoc, cexpr, theDoc->getDocumentElement()); if (theContextNode == 0) { // No appropriate nodes. return 0; } // OK, let's evaluate the expression... XalanDOMString ed = XalanDOMString(XPathExpr); const XalanDOMChar * expr = ed.c_str(); #if defined XSEC_SELECTNODELIST_REQS_NODEREFLIST NodeRefList output; NodeRefList theResult( theEvaluator.selectNodeList( output, theDOMSupport, theContextNode, expr, theDoc->getElementById(XalanDOMString("ns")))); #else NodeRefList theResult( theEvaluator.selectNodeList( theDOMSupport, theContextNode, expr, theDoc->getElementById(XalanDOMString("ns")))); //theDoc->getDocumentElement())); #endif //XercesDocumentBridge *theBridge = theParserLiaison.mapDocument(theDoc); XercesDocumentWrapper *theWrapper = theParserLiaison.mapDocumentToWrapper(theDoc); XercesWrapperNavigator theWrapperNavigator(theWrapper); int size = (int) theResult.getLength(); const DOMNode *item; for (int i = 0; i < size; ++ i) { item = theWrapperNavigator.mapNode(theResult.item(i)); m_XPathMap.addNode(item); //tmp->element = theBridgeNavigator.mapNode(theResult.item(i)); } m_XPathSelection = true; return size; #endif } void XSECC14n20010315::setXPathMap(const XSECXPathNodeList & map) { // XPath already done! m_XPathMap = map; m_XPathSelection = true; } // -------------------------------------------------------------------------------- // XSECC14n20010315 processNextNode method // -------------------------------------------------------------------------------- safeBuffer c14nCleanText(safeBuffer &input) { /* c14n Requires : & -> & < -> < > -> > LF -> */ xsecsize_t len = input.sbStrlen(); safeBuffer ret; xsecsize_t i, j; unsigned char c; j = 0; for (i = 0; i < len; ++i) { c = input[i]; switch (c) { case '&' : ret[j++] = '&'; ret[j++] = 'a'; ret[j++] = 'm'; ret[j++] = 'p'; ret[j++] = ';'; break; case '<' : ret[j++] = '&'; ret[j++] = 'l'; ret[j++] = 't'; ret[j++] = ';'; break; case '>' : ret[j++] = '&'; ret[j++] = 'g'; ret[j++] = 't'; ret[j++] = ';'; break; case 0xD : ret[j++] = '&'; ret[j++] = '#'; ret[j++] = 'x'; ret[j++] = 'D'; ret[j++] = ';'; break; default : ret[j++] = c; } } // final character: ret[j] = '\0'; ret.setBufferType(safeBuffer::BUFFER_CHAR); return ret; } safeBuffer c14nCleanAttribute(safeBuffer &input) { /* c14n Requires : & -> & < -> < " -> " #x9 -> #xA -> LF -> */ xsecsize_t len = input.sbStrlen(); safeBuffer ret; xsecsize_t i, j; unsigned char c; j = 0; for (i = 0; i < len; ++i) { c = input[i]; switch (c) { case '&' : ret[j++] = '&'; ret[j++] = 'a'; ret[j++] = 'm'; ret[j++] = 'p'; ret[j++] = ';'; break; case '"' : ret[j++] = '&'; ret[j++] = 'q'; ret[j++] = 'u'; ret[j++] = 'o'; ret[j++] = 't'; ret[j++] = ';'; break; case '<' : ret[j++] = '&'; ret[j++] = 'l'; ret[j++] = 't'; ret[j++] = ';'; break; case 0x9 : ret[j++] = '&'; ret[j++] = '#'; ret[j++] = 'x'; ret[j++] = '9'; ret[j++] = ';'; break; case 0xA : ret[j++] = '&'; ret[j++] = '#'; ret[j++] = 'x'; ret[j++] = 'A'; ret[j++] = ';'; break; case 0xD : ret[j++] = '&'; ret[j++] = '#'; ret[j++] = 'x'; ret[j++] = 'D'; ret[j++] = ';'; break; default : ret[j++] = c; } } // final character: ret[j] = '\0'; ret.setBufferType(safeBuffer::BUFFER_CHAR); return ret; } bool XSECC14n20010315::checkRenderNameSpaceNode(DOMNode *e, DOMNode *a) { DOMNode *parent; DOMNode *att; DOMNamedNodeMap *atts; // If XPath and node not selected, then never print if (m_XPathSelection && ! m_XPathMap.hasNode(a)) return false; // BUGFIX: we need to skip xmlns:xml if the value is http://www.w3.org/XML/1998/namespace if (strEquals(a->getLocalName(), "xml") && strEquals(a->getNodeValue(), "http://www.w3.org/XML/1998/namespace")) return false; // First - are we exclusive? safeBuffer localName; bool processAsExclusive = false; if (m_exclusive) { if (strEquals(a->getNodeName(), "xmlns")) { processAsExclusive = m_exclusiveDefault; } else { localName << (*mp_formatter << a->getLocalName()); processAsExclusive = !inNonExclNSList(localName); } } if (processAsExclusive) { // Is the parent in the node-set? if (m_XPathSelection && !m_XPathMap.hasNode(e)) return false; // Is the name space visibly utilised? localName << (*mp_formatter << a->getLocalName()); if (localName.sbStrcmp("xmlns") == 0) localName[0] = '\0'; // Is this correct or should Xerces return "" for default? if (!visiblyUtilises(e, localName)) return false; // If we are the top node, then this has never been printer if (e == mp_firstElementNode) return true; // Make sure previous nodes do not use the name space (and have it printed) parent = e->getParentNode(); while (parent != NULL) { if (!m_XPathSelection || m_XPathMap.hasNode(parent)) { // An output ancestor if (visiblyUtilises(parent, localName)) { // Have a hit! while (parent != NULL) { atts = parent->getAttributes(); att = (atts != NULL) ? atts->getNamedItem(a->getNodeName()) : NULL; if (att != NULL && (!m_XPathSelection || m_XPathMap.hasNode(att))) { // Check URI is the same if (strEquals(att->getNodeValue(), a->getNodeValue())) return false; return true; } // If we are using the namespace stack, we need to go up until // we found the defining attribute for this node if (m_useNamespaceStack) { parent = parent->getParentNode(); } else return true; } // Even if we are using the namespace stack, we have never // printed this namespace return true; } } if (parent == mp_firstElementNode) parent = NULL; else parent = parent->getParentNode(); } // Didn't find it rendered! return true; } // Either we are now in non-exclusive mode, or the name space in question // Is to be treated as non-exclusive // Never directly render a default if (strEquals(a->getNodeName(), "xmlns") && strEquals(a->getNodeValue(), "")) return false; // If using a namespace stack, then we need to check whether the current node is in the nodeset // Only really necessary for envelope txfms in boundary conditions if (m_useNamespaceStack && m_XPathSelection && !m_XPathMap.hasNode(e)) return false; // Otherwise, of node is at base of selected document, then print if (e == mp_firstElementNode) return true; if (m_useNamespaceStack) { // In this case, we need to go up until we find the namespace definition // in question parent = e->getParentNode(); while (parent != NULL) { if (!m_XPathSelection || m_XPathMap.hasNode(parent)) { DOMNamedNodeMap *pmap = parent->getAttributes(); DOMNode *pns; if (pmap) pns = pmap->getNamedItem(a->getNodeName()); else pns = NULL; if (pns != NULL) { // Note we don't check XPath inclusion, as we shouldn't be // using the namespace stack for XPath expressions if (strEquals(pns->getNodeValue(), a->getNodeValue())) return false; else return true; // Was defined but differently } } parent = parent->getParentNode(); } // Obviously we haven't found it! return true; } // Find the parent and check if the node is already defined or if the node // was out of scope parent = e->getParentNode(); // if (m_XPathSelection && !m_XPathMap.hasNode(parent)) // return true; while (m_XPathSelection && parent != NULL && !m_XPathMap.hasNode(parent)) parent = parent->getParentNode(); if (parent == NULL) return true; DOMNamedNodeMap *pmap = parent->getAttributes(); DOMNode *pns = pmap->getNamedItem(a->getNodeName()); if (pns != NULL) { if (m_XPathSelection && !m_XPathMap.hasNode(pns)) return true; // Not printed in previous node if (strEquals(pns->getNodeValue(), a->getNodeValue())) return false; else return true; // Was defined but differently } return true; // Not defined in previous node } // Check an attribute to see if we should output // This is the main worker function of this class xsecsize_t XSECC14n20010315::processNextNode() { // The information currently in the buffer has all been used. We now process the // next node. DOMNode *next; // For working (had *ns) DOMNamedNodeMap *tmpAtts; // " " safeBuffer currentName(128), currentValue(1024), sbWork; bool done, xmlnsFound; if (m_allNodesDone) { return 0; // No bytes copied because nothing more to be done } // Always zeroise buffers to make work simpler m_bufferLength = m_bufferPoint = 0; m_buffer.sbStrcpyIn(""); // Find out if this is a node to process bool processNode; int nodeT; if (mp_nextNode == 0) { // Dummy element - we need to insert a default namespace nodeT = DOMNode::ATTRIBUTE_NODE; processNode = true; } else { processNode = ((!m_XPathSelection) || (m_XPathMap.hasNode(mp_nextNode))); nodeT = mp_nextNode->getNodeType(); } switch (nodeT) { case DOMNode::DOCUMENT_NODE : // Start of a document // Check if finished if (m_returnedFromChild) { // All done! m_allNodesDone = true; return 0; } // In c14n we don't actually do anything for a document node except // process the childeren mp_firstElementNode = ((DOMDocument *) mp_nextNode)->getDocumentElement(); next = mp_nextNode->getFirstChild(); if (next == NULL) { // Empty document? m_allNodesDone = true; } mp_nextNode = next; m_bufferLength = m_bufferPoint = 0; // To ensure nobody copies "nothing" return 0; case DOMNode::DOCUMENT_TYPE_NODE : // Ignore me m_returnedFromChild = true; m_buffer.sbStrcpyIn(""); break; case DOMNode::PROCESSING_INSTRUCTION_NODE : // Just print if (processNode) { if ((mp_nextNode->getParentNode() == mp_doc) && m_firstElementProcessed) { // this is a top level node and first element done m_buffer.sbStrcpyIn("\x00AgetNodeName()); m_buffer.sbStrcatIn(m_formatBuffer); m_formatBuffer << (*mp_formatter << ((DOMProcessingInstruction *) mp_nextNode)->getData()); if (m_formatBuffer.sbStrlen() > 0) { m_buffer.sbStrcatIn(" "); m_buffer.sbStrcatIn(m_formatBuffer); } m_buffer.sbStrcatIn("?>"); if ((mp_nextNode->getParentNode() == mp_doc) && !m_firstElementProcessed) { // this is a top level node and first element done m_buffer.sbStrcatIn("\x00A"); } } // Node fully processed m_returnedFromChild = true; break; case DOMNode::COMMENT_NODE : // Just print out if (processNode && m_processComments) { if ((mp_nextNode->getParentNode() == mp_doc) && m_firstElementProcessed) { // this is a top level node and first element done m_buffer.sbStrcpyIn("\x00A"); if ((mp_nextNode->getParentNode() == mp_doc) && !m_firstElementProcessed) { // this is a top level node and first element done m_buffer.sbStrcatIn("\x00A"); } } m_returnedFromChild = true; // Fool the tree processor break; case DOMNode::CDATA_SECTION_NODE : case DOMNode::TEXT_NODE : // Straight copy for now if (processNode) { m_formatBuffer << (*mp_formatter << mp_nextNode->getNodeValue()); // Do c14n cleaning on the text string m_buffer = c14nCleanText(m_formatBuffer); } // Fall through m_returnedFromChild = true; // Fool the tree processor break; case DOMNode::ELEMENT_NODE : // This is an element that we can easily process // If we are going "up" then we simply close off the element if (m_returnedFromChild) { if (processNode) { m_buffer.sbStrcpyIn ("getNodeName()); m_buffer.sbStrcatIn(m_formatBuffer); m_buffer.sbStrcatIn(">"); } if (m_useNamespaceStack) m_nsStack.popElement(); break; } if (processNode) { m_buffer.sbStrcpyIn("<"); m_formatBuffer << (*mp_formatter << mp_nextNode->getNodeName()); m_buffer.sbStrcatIn(m_formatBuffer); } // We now set up for attributes and name spaces if (m_useNamespaceStack) m_nsStack.pushElement(mp_nextNode); mp_attributes = NULL; tmpAtts = mp_nextNode->getAttributes(); next = mp_nextNode; done = false; xmlnsFound = false; while (!done) { // Need to sort the attributes XMLSize_t size; if (tmpAtts != NULL) size = tmpAtts->getLength(); else size = 0; XSECNodeListElt *toIns; XMLSize_t i; for (i = 0; i < size; ++i) { // Get the name and value of the attribute currentName << (*mp_formatter << tmpAtts->item(i)->getNodeName()); currentValue << (*mp_formatter << tmpAtts->item(i)->getNodeValue()); // Build the string used to sort this node if ((next == mp_nextNode) && currentName.sbStrncmp("xmlns", 5) == 0) { // Are we using the namespace stack? If so - store this for later // processing if (m_useNamespaceStack) { m_nsStack.addNamespace(tmpAtts->item(i)); } else { // Is this the default? if (currentName.sbStrcmp("xmlns") == 0 && (!m_XPathSelection || m_XPathMap.hasNode(tmpAtts->item(i))) && !currentValue.sbStrcmp("") == 0) xmlnsFound = true; // A namespace node - See if we need to output if (checkRenderNameSpaceNode(mp_nextNode, tmpAtts->item(i))) { // Add to the list m_formatBuffer << (*mp_formatter << tmpAtts->item(i)->getNodeName()); if (m_formatBuffer[5] == ':') currentName.sbStrcpyIn((char *) &m_formatBuffer[6]); else currentName.sbStrcpyIn(""); toIns = new XSECNodeListElt; toIns->element = tmpAtts->item(i); // Build and insert name space node toIns->sortString.sbStrcpyIn(XMLNS_PREFIX); toIns->sortString.sbStrcatIn(currentName); // Insert node mp_attributes = insertNodeIntoList(mp_attributes, toIns); } } } else { // A "normal" attribute - only process if selected or no XPath or is an // XML node from a previously un-printed Element node bool XMLElement = (next != mp_nextNode) && (!m_exclusive) && !currentName.sbStrncmp("xml:", 4) && (!m_incl11 || currentName.sbStrcmp("xml:id")); // If we have an XML element, make sure it was not printed between this // node and the node currently being worked on if (XMLElement) { DOMNode *t = mp_nextNode->getParentNode(); if (m_XPathSelection && m_XPathMap.hasNode(t)) XMLElement = false; else { // This is a real node that we have to check t = mp_nextNode; while (t != next) { DOMNamedNodeMap *ta; XMLSize_t sz; ta = t->getAttributes(); if (ta != NULL) sz = ta->getLength(); else sz = 0; for (XMLSize_t j = 0; j < sz; ++j) { if (strEquals(ta->item(j)->getNodeName(), tmpAtts->item(i)->getNodeName()) == true) { XMLElement = false; break; } } t = t->getParentNode(); } } } if ((!m_XPathSelection && next == mp_nextNode) || XMLElement || ((next == mp_nextNode) && m_XPathMap.hasNode(tmpAtts->item(i)))) { toIns = new XSECNodeListElt; toIns->element = tmpAtts->item(i); // First the correct prefix to ensure will be sorted // in correct placing against XMLNS nodes toIns->sortString.sbStrcpyIn(ATTRIBUTE_PREFIX); // Find the namespace URI const XMLCh * nsURI = tmpAtts->item(i)->getNamespaceURI(); if (nsURI == NULL) { toIns->sortString.sbStrcatIn(NOURI_PREFIX); } else { m_formatBuffer << (*mp_formatter << nsURI); toIns->sortString.sbStrcatIn(HAVEURI_PREFIX); toIns->sortString.sbStrcatIn(m_formatBuffer); } // Append the local name as the secondary key const XMLCh * ln = tmpAtts->item(i)->getNodeName(); int index = XMLString::indexOf(ln, chColon); if (index >= 0) ln = &ln[index+1]; m_formatBuffer << (*mp_formatter << ln); toIns->sortString.sbStrcatIn(m_formatBuffer); // Insert node mp_attributes = insertNodeIntoList(mp_attributes, toIns); } /* else (sbStrCmp xmlns) */ } } /* for */ #if 1 // Now go upwards and find parent for xml name spaces if (processNode && (m_XPathSelection || mp_nextNode == mp_firstElementNode)) { next = next->getParentNode(); if (next == 0) // || NodeInList(mp_XPathMap, next)) done = true; else tmpAtts = next->getAttributes(); } else #endif done = true; } /* while tmpAtts != NULL */ // Now add namespace nodes - but only if we are using the namespace stack // (They have already been added otherwise if (m_useNamespaceStack) { DOMNode * nsnode = m_nsStack.getFirstNamespace(); while (nsnode != NULL) { // Get the name and value of the attribute currentName << (*mp_formatter << nsnode->getNodeName()); currentValue << (*mp_formatter << nsnode->getNodeValue()); // Is this the default? if (currentName.sbStrcmp("xmlns") == 0 && (!m_XPathSelection || m_XPathMap.hasNode(nsnode)) && !currentValue.sbStrcmp("") == 0) xmlnsFound = true; // A namespace node - See if we need to output if (checkRenderNameSpaceNode(mp_nextNode, nsnode)) { // Add to the list XSECNodeListElt *toIns; m_formatBuffer << (*mp_formatter << nsnode->getNodeName()); if (m_formatBuffer[5] == ':') currentName.sbStrcpyIn((char *) &m_formatBuffer[6]); else currentName.sbStrcpyIn(""); toIns = new XSECNodeListElt; toIns->element = nsnode; // Build and insert name space node toIns->sortString.sbStrcpyIn(XMLNS_PREFIX); toIns->sortString.sbStrcatIn(currentName); // Insert node mp_attributes = insertNodeIntoList(mp_attributes, toIns); // Mark as printed in the NS Stack m_nsStack.printNamespace(nsnode, mp_nextNode); } nsnode = m_nsStack.getNextNamespace(); } // Fix for bug#47353, make sure we set xmlnsFound regardless of what the printing process saw. if (!xmlnsFound) xmlnsFound = m_nsStack.isNonEmptyDefaultNS(); } /* if (m_useNamespaceStack) */ // Check to see if we add xmlns="" if (processNode && !xmlnsFound && mp_nextNode != mp_firstElementNode) { // Is this exclusive? safeBuffer sbLocalName(""); if (m_exclusiveDefault) { if (visiblyUtilises(mp_nextNode, sbLocalName)) { // May have to output! next = mp_nextNode->getParentNode(); while (next != NULL) { if (!m_XPathSelection || m_useNamespaceStack || m_XPathMap.hasNode(next)) { DOMNode *tmpAtt; // An output ancestor if (visiblyUtilises(next, sbLocalName)) { DOMNode * nextAttParent = next; while (nextAttParent != NULL) { // Have a hit! tmpAtts = nextAttParent->getAttributes(); if (tmpAtts != NULL) tmpAtt = tmpAtts->getNamedItem(DSIGConstants::s_unicodeStrXmlns); if (tmpAtts != NULL && tmpAtt != NULL && (!m_XPathSelection || m_useNamespaceStack || m_XPathMap.hasNode(tmpAtt))) { // Check URI is the same if (!strEquals(tmpAtt->getNodeValue(), "")) { xmlnsFound = true; nextAttParent = NULL; } } else { // Doesn't have a default namespace in the node-set next = nextAttParent = NULL; break; } if (m_useNamespaceStack && nextAttParent) nextAttParent = nextAttParent->getParentNode(); else nextAttParent = NULL; } } } if (next) next = next->getParentNode(); } } } /* m_exclusiveDefault */ else { //DOM_Node next; next = mp_nextNode->getParentNode(); while (!xmlnsFound && next != NULL) { while (next != NULL && !m_useNamespaceStack && (m_XPathSelection && !m_XPathMap.hasNode(next))) next = next->getParentNode(); XMLSize_t size; if (next != NULL) tmpAtts = next->getAttributes(); if (next != NULL && tmpAtts != NULL) size = tmpAtts->getLength(); else size = 0; for (XMLSize_t i = 0; i < size; ++i) { currentName << (*mp_formatter << tmpAtts->item(i)->getNodeName()); currentValue << (*mp_formatter << tmpAtts->item(i)->getNodeValue()); if ((currentName.sbStrcmp("xmlns") == 0) && (m_useNamespaceStack || !m_XPathSelection || m_XPathMap.hasNode(tmpAtts->item(i)))) { if (currentValue.sbStrcmp("") != 0) { xmlnsFound = true; } else { xmlnsFound = false; next = NULL; } } } if (m_useNamespaceStack && next != NULL) next = next->getParentNode(); else next = NULL; } } // Did we find a non empty namespace? if (xmlnsFound) { currentName.sbStrcpyIn(""); // Don't include xmlns prefix XSECNodeListElt * toIns; toIns = new XSECNodeListElt; toIns->element = NULL; // To trigger the state engine // Build and insert name space node toIns->sortString.sbStrcpyIn(XMLNS_PREFIX); toIns->sortString.sbStrcatIn(currentName); // Insert node mp_attributes = insertNodeIntoList(mp_attributes, toIns); } } if (mp_attributes != NULL) { // Now we have set up the attribute list, set next node and return! mp_attributeParent = mp_nextNode; mp_nextNode = mp_attributes->element; mp_currentAttribute = mp_attributes; m_bufferLength = m_buffer.sbStrlen(); m_bufferPoint = 0; return m_bufferLength; } /* attrributes != NULL */ if (processNode) m_buffer.sbStrcatIn(">"); // Fall through to find next node break; case DOMNode::ATTRIBUTE_NODE : // Output attr_name="value" // Always process an attribute node as we have already checked they should // be printed m_buffer.sbStrcpyIn(" "); if (mp_nextNode != 0) { m_formatBuffer << (*mp_formatter << mp_nextNode->getNodeName()); m_buffer.sbStrcatIn(m_formatBuffer); m_buffer.sbStrcatIn("=\""); m_formatBuffer << (*mp_formatter << mp_nextNode->getNodeValue()); sbWork = c14nCleanAttribute(m_formatBuffer); m_buffer.sbStrcatIn(sbWork); m_buffer.sbStrcatIn("\""); } else { m_buffer.sbStrcatIn("xmlns"); m_buffer.sbStrcatIn("=\""); m_buffer.sbStrcatIn("\""); } // Now see if next node is an attribute mp_currentAttribute = mp_currentAttribute->next; if (mp_currentAttribute != NULL) { // Easy case mp_nextNode = mp_currentAttribute->element; m_bufferLength = m_buffer.sbStrlen(); m_bufferPoint = 0; return m_bufferLength; } /* if mp_currentAttributes != NULL) */ // need to clear out the node list while (mp_attributes != NULL) { mp_currentAttribute = mp_attributes->next; delete mp_attributes; mp_attributes = mp_currentAttribute; } mp_attributes = mp_currentAttribute = mp_firstNonNsAttribute = NULL; // return us to the element node mp_nextNode = mp_attributeParent; // End the element definition if (!m_XPathSelection || (m_XPathMap.hasNode(mp_nextNode))) m_buffer.sbStrcatIn(">"); m_returnedFromChild = false; break; default: break; } // A node has fallen through to the default case for finding the next node. m_bufferLength = m_buffer.sbStrlen();; m_bufferPoint = 0; // Firstly, was the last piece of processing because we "came up" from a child node? if (m_returnedFromChild) { if (mp_nextNode == mp_startNode) { // we have closed off the document! m_allNodesDone = true; return m_bufferLength; } if (mp_nextNode == mp_firstElementNode) { // we have closed off the main mp_doc elt m_firstElementProcessed = true; } } else { // Going down - so check for children nodes next = mp_nextNode->getFirstChild(); if (next != NULL) mp_nextNode = next; else // No children, so need to close this node off! m_returnedFromChild = true; return m_bufferLength; } // If we get here all childeren (if there are any) are done next = mp_nextNode->getNextSibling(); if (next != NULL) { m_returnedFromChild = false; mp_nextNode = next; return m_bufferLength; } // No more nodes at this level either! mp_nextNode = mp_nextNode->getParentNode(); m_returnedFromChild = true; return m_bufferLength; } xml-security-c-1.7.3/xsec/canon/XSECXMLNSStack.cpp000644 001751 001751 00000015000 12003301053 022672 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECXMLNSStack := NS Stack for simple canonicalisation * * $Id: XSECXMLNSStack.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include // Xerces XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Holder structures // -------------------------------------------------------------------------------- typedef struct XSECNSHolderStruct { XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_ns; // Actual NS attribute XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_owner; // Owner Element struct XSECNSHolderStruct * mp_hides; // WHat does this NS hide? struct XSECNSHolderStruct * mp_next; // Next in list XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_printed; // Node at which it was printed bool m_isDefault; // Is this a default NS? } XSECNSHolder; typedef struct XSECNSElementStruct { XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_elt; // Element struct XSECNSHolderStruct * mp_firstNS; // WHat does this NS hide? } XSECNSElement; // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XSECXMLNSStack::XSECXMLNSStack() { } XSECXMLNSStack::~XSECXMLNSStack() { // Need to iterate through the Stack to XSECNSElement * t; XSECNSHolder * u, *v; while (m_elements.size() > 0) { t = m_elements.top(); u = t->mp_firstNS; while (u != NULL) { v = u->mp_next; delete u; u = v; } delete t; m_elements.pop(); } } // -------------------------------------------------------------------------------- // Stack Functions // -------------------------------------------------------------------------------- void XSECXMLNSStack::pushElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * elt) { XSECNSElement * t; XSECnew(t, XSECNSElement); t->mp_elt = elt; t->mp_firstNS = NULL; m_elements.push(t); } void XSECXMLNSStack::popElement() { // First - are there any namespaces to remove from the currently visible list? XSECNSHolder * t, *u; XSECNSElement * e = m_elements.top(); // Iterate through the current namespaces vector XSECNSHolderVectorType::iterator it = m_currentNS.begin(); while (it != m_currentNS.end()) { t = *it; if (t->mp_owner == e->mp_elt) { // Need to delete this m_currentNS.erase(it); if (t->mp_hides != NULL) { m_currentNS.push_back(t->mp_hides); } // TODO - Fix this, it is naieve and slow it = m_currentNS.begin(); } else { if (t->mp_printed == e->mp_elt) t->mp_printed = NULL; it++; } } // OK - Now we delete the NS nodes t = e->mp_firstNS; while (t != NULL) { u = t->mp_next; delete t; t = u; } // Now delete the element holder itself m_elements.pop(); delete e; } // -------------------------------------------------------------------------------- // NS Addition // -------------------------------------------------------------------------------- void XSECXMLNSStack::addNamespace(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * ns) { // Create the new entry for this node XSECNSHolder * t, *u; XSECnew(t, XSECNSHolder); t->mp_hides = NULL; t->mp_next = NULL; t->mp_ns = ns; t->mp_owner = (m_elements.top())->mp_elt; t->mp_printed = NULL; t->m_isDefault = strEquals(ns->getNodeName(), DSIGConstants::s_unicodeStrXmlns); // Does this hide something in the current namespace list? XSECNSHolderVectorType::iterator it = m_currentNS.begin(); while (it != m_currentNS.end()) { u = (*it); if (strEquals(u->mp_ns->getNodeName(), ns->getNodeName())) { // This hides a current NS entry t->mp_hides = u; m_currentNS.erase(it); it = m_currentNS.end(); } else it++; } // Now push it onto the namespace vector m_currentNS.push_back(t); // Add me to the current element's namespaces XSECNSElement * e = m_elements.top(); t->mp_next = e->mp_firstNS; e->mp_firstNS = t; } void XSECXMLNSStack::printNamespace(DOMNode * ns, DOMNode * elt) { XSECNSHolder * t; XSECNSHolderVectorType::iterator it = m_currentNS.begin(); while (it != m_currentNS.end()) { t = (*it); // Fix for bug#47353, go ahead and track printing of default namespaces. if (t->mp_ns == ns) { // && t->m_isDefault == false) { t->mp_printed = elt; break; } it++; } } // -------------------------------------------------------------------------------- // NS Searching // -------------------------------------------------------------------------------- DOMNode * XSECXMLNSStack::getFirstNamespace(void) { m_currentNSIterator = m_currentNS.begin(); while (m_currentNSIterator != m_currentNS.end() && (*m_currentNSIterator)->mp_printed != NULL) m_currentNSIterator++; if (m_currentNSIterator != m_currentNS.end()) return (*m_currentNSIterator)->mp_ns; return NULL; } DOMNode * XSECXMLNSStack::getNextNamespace(void) { if (m_currentNSIterator == m_currentNS.end()) return NULL; m_currentNSIterator++; while (m_currentNSIterator != m_currentNS.end() && (*m_currentNSIterator)->mp_printed != NULL) m_currentNSIterator++; if (m_currentNSIterator == m_currentNS.end()) return NULL; return (*m_currentNSIterator)->mp_ns; } // Fix for bug#47353, explicit check for non-empty default NS decl. bool XSECXMLNSStack::isNonEmptyDefaultNS(void) { for (XSECNSHolderVectorType::iterator it = m_currentNS.begin(); it != m_currentNS.end(); ++it) { if ((*it)->m_isDefault) { const XMLCh* val = (*it)->mp_ns->getNodeValue(); if (val && *val) return true; } } return false; } xml-security-c-1.7.3/xsec/canon/XSECCanon.cpp000644 001751 001751 00000006646 12003301053 022061 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECCanon := Base (virtual) class for canonicalisation objects * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include #include #include XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // XSECCanon Virtual Class implementation // -------------------------------------------------------------------------------- // Constructors XSECCanon::XSECCanon() {}; XSECCanon::XSECCanon(DOMDocument *newDoc) : m_buffer() { mp_doc = newDoc; mp_startNode = mp_nextNode = newDoc; // By default, start from startNode m_bufferLength = m_bufferPoint = 0; // Start with an empty buffer m_allNodesDone = false; }; XSECCanon::XSECCanon(DOMDocument *newDoc, DOMNode *newStartNode) { mp_doc = newDoc; mp_startNode = mp_nextNode = newStartNode; m_bufferLength = m_bufferPoint = 0; // Start with an empty buffer m_allNodesDone = false; }; // Destructors XSECCanon::~XSECCanon() {}; // Public Methods xsecsize_t XSECCanon::outputBuffer(unsigned char *outBuffer, xsecsize_t numBytes) { // numBytes of data are required to be placed in outBuffer. // Calculate amount left in buffer xsecsize_t remaining = m_bufferLength - m_bufferPoint; xsecsize_t bytesToGo = numBytes; xsecsize_t i = 0; // current point in outBuffer // While we don't have enough, and have not completed - while (!m_allNodesDone && (remaining < bytesToGo)) { // Copy what we have and get some more in the buffer memcpy(&outBuffer[i], &m_buffer[m_bufferPoint], remaining); i += remaining; m_bufferPoint += remaining; bytesToGo -= remaining; // Get more processNextNode(); remaining = m_bufferLength - m_bufferPoint; // This will be reset by processNextElement // "-bufferPoint" is just in case. } if (m_allNodesDone && (remaining < bytesToGo)) { // Was not enough data to fill everything up memcpy (&outBuffer[i], &m_buffer[m_bufferPoint], remaining); m_bufferPoint += remaining; return i + remaining; } // Copy the tail of the buffer memcpy(&outBuffer[i], &m_buffer[m_bufferPoint], bytesToGo); m_bufferPoint += bytesToGo; return (bytesToGo + i); } // setStartNode sets the starting point for the output if it is a sub-document // that needs canonicalisation and we want to re-start bool XSECCanon::setStartNode(DOMNode *newStartNode) { mp_startNode = newStartNode; m_bufferPoint = 0; m_bufferLength = 0; mp_nextNode = mp_startNode; m_allNodesDone = false; // Restart return true; // Should check to ensure that the StartNode is part of the doc. } xml-security-c-1.7.3/xsec/tools/threadTest/000755 001751 001751 00000000000 12477614643 022024 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/c14n/000755 001751 001751 00000000000 12477614644 020463 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/checksig/000755 001751 001751 00000000000 12477614644 021476 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/cipher/000755 001751 001751 00000000000 12477614644 021170 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/siginf/000755 001751 001751 00000000000 12477614644 021175 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/templatesign/000755 001751 001751 00000000000 12477614644 022412 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/txfmout/000755 001751 001751 00000000000 12477614644 021424 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/xklient/000755 001751 001751 00000000000 12477614645 021375 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/xtest/000755 001751 001751 00000000000 12477614645 021066 5ustar00scantorscantor000000 000000 xml-security-c-1.7.3/xsec/tools/xtest/xtest.cpp000644 001751 001751 00000221426 12003301052 022712 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * xtest := basic test application to run through a series of tests of * the XSEC library. * * Author(s): Berin Lautenbach * * $Id: xtest.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // XALAN #ifndef XSEC_NO_XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif // XSEC #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined (XSEC_HAVE_OPENSSL) # include # include # include # include # include #endif #if defined (XSEC_HAVE_WINCAPI) # include # include # include #endif #if defined (XSEC_HAVE_NSS) # include # include # include #endif using std::ostream; using std::cout; using std::cerr; using std::endl; using std::flush; /* * Because of all the characters, it's easiest to inject entire Xerces namespace * into global */ XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Global variables // -------------------------------------------------------------------------------- bool g_printDocs = false; bool g_useWinCAPI = false; bool g_useNSS = false; bool g_haveAES = true; // -------------------------------------------------------------------------------- // Known "Good" Values // -------------------------------------------------------------------------------- unsigned char createdDocRefs [9][20] = { { 0x51, 0x3c, 0xb5, 0xdf, 0xb9, 0x1e, 0x9d, 0xaf, 0xd4, 0x4a, 0x95, 0x79, 0xf1, 0xd6, 0x54, 0xe, 0xb0, 0xb0, 0x29, 0xe3, }, { 0x51, 0x3c, 0xb5, 0xdf, 0xb9, 0x1e, 0x9d, 0xaf, 0xd4, 0x4a, 0x95, 0x79, 0xf1, 0xd6, 0x54, 0xe, 0xb0, 0xb0, 0x29, 0xe3, }, { 0x52, 0x74, 0xc3, 0xe4, 0xc5, 0xf7, 0x20, 0xb0, 0xd9, 0x52, 0xdb, 0xb3, 0xee, 0x46, 0x66, 0x8f, 0xe1, 0xb6, 0x30, 0x9d, }, { 0x5a, 0x14, 0x9c, 0x5a, 0x40, 0x34, 0x51, 0x4f, 0xef, 0x1d, 0x85, 0x44, 0xc7, 0x2a, 0xd3, 0xd2, 0x2, 0xed, 0x67, 0xb4, }, { 0x88, 0xd1, 0x65, 0xed, 0x2a, 0xe7, 0xc0, 0xbd, 0xea, 0x3e, 0xe6, 0xf3, 0xd4, 0x8c, 0xf7, 0xdd, 0xc8, 0x85, 0xa9, 0x6d, }, { 0x52, 0x74, 0xc3, 0xe4, 0xc5, 0xf7, 0x20, 0xb0, 0xd9, 0x52, 0xdb, 0xb3, 0xee, 0x46, 0x66, 0x8f, 0xe1, 0xb6, 0x30, 0x9d, }, { 0x52, 0x74, 0xc3, 0xe4, 0xc5, 0xf7, 0x20, 0xb0, 0xd9, 0x52, 0xdb, 0xb3, 0xee, 0x46, 0x66, 0x8f, 0xe1, 0xb6, 0x30, 0x9d, }, { 0x69, 0xBA, 0xF1, 0x53, 0x7D, 0x81, 0x78, 0xCA, 0xCA, 0x60, 0x3B, 0x2F, 0x55, 0x9C, 0x8E, 0x5F, 0xEB, 0x35, 0x38, 0x25, }, { 0x51, 0x3c, 0xb5, 0xdf, 0xb9, 0x1e, 0x9d, 0xaf, 0xd4, 0x4a, 0x95, 0x79, 0xf1, 0xd6, 0x54, 0xe, 0xb0, 0xb0, 0x29, 0xe3, } }; unsigned char longShaRefs [4][64] = { { 0x7f, 0xa4, 0xab, 0xe8, 0x07, 0x06, 0x35, 0xf3, 0xa3, 0x56, 0xe8, 0x64, 0x2d, 0xc4, 0x7c, 0x8c, 0x1e, 0x48, 0x74, 0xf0, 0x48, 0x63, 0x1b, 0xea, 0x57, 0xec, 0x96, 0xa6, }, { 0x75, 0xec, 0xba, 0x51, 0xda, 0xb7, 0x42, 0x16, 0x34, 0x2d, 0xd7, 0x4e, 0x6a, 0x33, 0xb6, 0xb3, 0xe3, 0x2d, 0x28, 0xf6, 0x7b, 0x87, 0x21, 0xfd, 0xd2, 0x2e, 0x50, 0xb9, 0x55, 0x81, 0x23, 0x06, }, { 0x99, 0x25, 0x92, 0xa3, 0xa9, 0x44, 0x12, 0x4d, 0xa1, 0x86, 0x3f, 0x81, 0xd3, 0xa7, 0x37, 0x61, 0xff, 0x86, 0x9f, 0x02, 0x16, 0x48, 0x16, 0xa0, 0xec, 0x7c, 0xd5, 0x33, 0x30, 0xeb, 0xb2, 0x9f, 0x93, 0xb9, 0x4a, 0x32, 0x20, 0x2e, 0x8a, 0xfd, 0xa6, 0x6e, 0x67, 0x1d, 0x96, 0xcd, 0xf1, 0xcb, }, { 0xf8, 0xf5, 0xf3, 0xb6, 0xab, 0x7c, 0x25, 0x52, 0x06, 0x23, 0x2c, 0x9f, 0x4e, 0x25, 0x0f, 0x16, 0x58, 0xf3, 0xc6, 0xdc, 0xb4, 0x85, 0x04, 0x3d, 0x9f, 0xee, 0x7d, 0x5d, 0x73, 0x86, 0xe3, 0xd4, 0x3a, 0xe0, 0xd5, 0x8a, 0xec, 0x7f, 0xd4, 0x63, 0x4f, 0x9a, 0xcf, 0xfa, 0x15, 0xdb, 0x0f, 0xe5, 0x09, 0x6b, 0xf1, 0xa1, 0x36, 0x05, 0x42, 0x69, 0x49, 0xc3, 0x9e, 0x8c, 0x99, 0xa6, 0x75, 0xae, }, }; // -------------------------------------------------------------------------------- // Some test data // -------------------------------------------------------------------------------- // "CN=,O=XSEC " XMLCh s_tstDName[] = { chLatin_C, chLatin_N, chEqual, chOpenAngle, chLatin_T, chLatin_e, chLatin_s, chLatin_t, chComma, chCloseAngle, chComma, chLatin_O, chEqual, chLatin_X, chLatin_S, chLatin_E, chLatin_C, chSpace, chSpace, chNull }; XMLCh s_tstKeyName[] = { chLatin_F, chLatin_r, chLatin_e, chLatin_d, chSingleQuote, chLatin_s, chSpace, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chNull }; XMLCh s_tstPGPKeyID[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_P, chLatin_G, chLatin_P, chSpace, chLatin_I, chLatin_D, chNull }; XMLCh s_tstPGPKeyPacket[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_P, chLatin_G, chLatin_P, chSpace, chLatin_P, chLatin_a, chLatin_c, chLatin_k, chLatin_e, chLatin_t, chNull }; XMLCh s_tstSexp1[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_S, chLatin_e, chLatin_x, chLatin_p, chDigit_1, chNull }; XMLCh s_tstSexp2[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_S, chLatin_e, chLatin_x, chLatin_p, chDigit_2, chNull }; XMLCh s_tstMgmtData[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_M, chLatin_g, chLatin_m, chLatin_t, chSpace, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull }; XMLCh s_tstCarriedKeyName[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_C, chLatin_a, chLatin_r, chLatin_r, chLatin_y, chNull }; XMLCh s_tstRecipient[] = { chLatin_D, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chSpace, chLatin_R, chLatin_e, chLatin_c, chLatin_i, chLatin_p, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull }; XMLCh s_tstEncoding[] = { chLatin_B, chLatin_a, chLatin_s, chLatin_e, chDigit_6, chDigit_4, chNull }; XMLCh s_tstMimeType[] = { chLatin_i, chLatin_m, chLatin_a, chLatin_g, chLatin_e, chForwardSlash, chLatin_p, chLatin_n, chLatin_g, chNull }; unsigned char s_tstOAEPparams[] = "12345678"; unsigned char s_tstBase64EncodedString[] = "YmNkZWZnaGlqa2xtbm9wcRrPXjQ1hvhDFT+EdesMAPE4F6vlT+y0HPXe0+nAGLQ8"; char s_tstDecryptedString[] = "A test encrypted secret"; // -------------------------------------------------------------------------------- // Some test keys // -------------------------------------------------------------------------------- // A PKCS8 PEM encoded PrivateKey structure (not Encrypted) char s_tstRSAPrivateKey[] = "\n\ -----BEGIN RSA PRIVATE KEY-----\n\ MIICXAIBAAKBgQDQj3pktZckAzwshRnfvLhz3daNU6xpAzoHo3qjCftxDwH1RynP\n\ A5eycJVkV8mwH2C1PFktpjtQTZ2CvPjuKmUV5zEvmYzuIo6SWYaVZN/PJjzsEZMa\n\ VA+U8GhfX1YF/rsuFzXCi8r6FVd3LN//pXHEwoDGdJUdlpdVEuX1iFKlNQIDAQAB\n\ AoGAYQ7Uc7e6Xa0PvNw4XVHzOSC870pISxqQT+u5b9R+anAEhkQW5dsTJpyUOX1N\n\ RCRmGhG6oq7gnY9xRN1yr0uVfJNtc9/HnzJL7L1jeJC8Ub+zbEBvNuPDL2P21ArW\n\ tcXRycUlfRCRBLop7rfOYPXsjtboAGnQY/6hK4rOF4XGrQUCQQD3Euj+0mZqRRZ4\n\ M1yN2wVP0mKOMg2i/HZXaNeVd9X/wyBgK6b7BxHf6onf/mIBWnJnRBlvdCrSdhuT\n\ lPKEoSgvAkEA2BhfWwQihqD4qJcV65nfosjzOZG41rHX69nIqHI7Ejx5ZgeQByH9\n\ Ym96yXoSpZj9ZlFsJYNogTBBnUBjs+jL2wJAFjpVS9eR7y2X/+hfA0QZDj1XMIPA\n\ RlGANAzymDfXwNLFLuG+fAb+zK5FCSnRl12TvUabIzPIRnbptDVKPDRjcQJBALn8\n\ 0CVv+59P8HR6BR3QRBDBT8Xey+3NB4Aw42lHV9wsPHg6ThY1hPYx6MZ70IzCjmZ/\n\ 8cqfvVRjijWj86wm0z0CQFKfRfBRraOZqfmOiAB4+ILhbJwKBBO6avX9TPgMYkyN\n\ mWKCxS+9fPiy1iI+G+B9xkw2gJ9i8P81t7fsOvdTDFA=\n\ -----END RSA PRIVATE KEY-----"; static char s_keyStr[] = "abcdefghijklmnopqrstuvwxyzabcdef"; // -------------------------------------------------------------------------------- // Find a node // -------------------------------------------------------------------------------- DOMNode * findNode(DOMNode * n, XMLCh * name) { if (XMLString::compareString(name, n->getNodeName()) == 0) return n; DOMNode * c = n->getFirstChild(); while (c != NULL) { if (c->getNodeType() == DOMNode::ELEMENT_NODE) { DOMNode * s = findNode(c, name); if (s != NULL) return s; } c = c->getNextSibling(); } return NULL; } // -------------------------------------------------------------------------------- // Create a key // -------------------------------------------------------------------------------- XSECCryptoKeyHMAC * createHMACKey(const unsigned char * str) { // Create the HMAC key XSECCryptoKeyHMAC * hmacKey = NULL; #if defined(XSEC_HAVE_WINCAPI) if (g_useWinCAPI == true) { hmacKey = new WinCAPICryptoKeyHMAC(0); } #endif # if defined (XSEC_HAVE_NSS) if (g_useNSS == true) { hmacKey = new NSSCryptoKeyHMAC(); } #endif #if defined (XSEC_HAVE_OPENSSL) if (hmacKey == NULL) hmacKey = new OpenSSLCryptoKeyHMAC(); #endif hmacKey->setKey((unsigned char *) str, (unsigned int) strlen((char *)str)); return hmacKey; } // -------------------------------------------------------------------------------- // Utility function for outputting hex data // -------------------------------------------------------------------------------- void outputHex(unsigned char * buf, int len) { cout << std::hex; for (int i = 0; i < len; ++i) { cout << "0x" << (unsigned int) buf[i] << ", "; } cout << std::ios::dec << endl; } // -------------------------------------------------------------------------------- // Create a basic document // -------------------------------------------------------------------------------- DOMDocument * createTestDoc(DOMImplementation * impl) { DOMDocument *doc = impl->createDocument( 0, // root element namespace URI. MAKE_UNICODE_STRING("ADoc"), // root element name NULL);// DOMDocumentType()); // document type object (DTD). DOMElement *rootElem = doc->getDocumentElement(); rootElem->setAttributeNS(DSIGConstants::s_unicodeStrURIXMLNS, MAKE_UNICODE_STRING("xmlns:foo"), MAKE_UNICODE_STRING("http://www.foo.org")); DOMElement * prodElem = doc->createElement(MAKE_UNICODE_STRING("product")); rootElem->appendChild(prodElem); DOMText * prodDataVal = doc->createTextNode(MAKE_UNICODE_STRING("XMLSecurityC")); prodElem->appendChild(prodDataVal); DOMElement *catElem = doc->createElement(MAKE_UNICODE_STRING("category")); rootElem->appendChild(catElem); catElem->setAttributeNS(NULL,MAKE_UNICODE_STRING("idea"), MAKE_UNICODE_STRING("great")); DOMText *catDataVal = doc->createTextNode(MAKE_UNICODE_STRING("XML Security Tools")); catElem->appendChild(catDataVal); return doc; } // -------------------------------------------------------------------------------- // Output a document if so required // -------------------------------------------------------------------------------- void outputDoc(DOMImplementation * impl, DOMDocument * doc) { if (g_printDocs == false) return; XMLFormatTarget *formatTarget = new StdOutFormatTarget(); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); #endif cerr << endl; #if defined (XSEC_XERCES_DOMLSSERIALIZER) theSerializer->write(doc, theOutput); #else theSerializer->writeNode(formatTarget, *doc); #endif cout << endl; cerr << endl; delete theSerializer; delete formatTarget; } // -------------------------------------------------------------------------------- // Unit test helper functions // -------------------------------------------------------------------------------- bool reValidateSig(DOMImplementation *impl, DOMDocument * inDoc, XSECCryptoKey *k) { // Take a signature in DOM, serialise and re-validate try { MemBufFormatTarget *formatTarget = new MemBufFormatTarget(); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(inDoc,theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); theSerializer->writeNode(formatTarget, *inDoc); #endif // Copy to a new buffer xsecsize_t len = formatTarget->getLen(); char * mbuf = new char [len + 1]; memcpy(mbuf, formatTarget->getRawBuffer(), len); mbuf[len] = '\0'; delete theSerializer; delete formatTarget; /* * Re-parse */ XercesDOMParser parser; parser.setDoNamespaces(true); parser.setCreateEntityReferenceNodes(true); MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) mbuf, len, "XSECMem"); parser.parse(*memIS); DOMDocument * doc = parser.adoptDocument(); delete(memIS); delete[] mbuf; /* * Validate signature */ XSECProvider prov; DSIGSignature * sig = prov.newSignatureFromDOM(doc); sig->load(); sig->setSigningKey(k); bool ret = sig->verify(); doc->release(); return ret; } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } } // -------------------------------------------------------------------------------- // Unit tests for signature // -------------------------------------------------------------------------------- void unitTestEnvelopingSignature(DOMImplementation * impl) { // This tests an enveloping signature as the root node cerr << "Creating enveloping signature ... "; try { // Create a document DOMDocument * doc = impl->createDocument(); // Create the signature XSECProvider prov; DSIGSignature *sig; DOMElement *sigNode; sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sig->setPrettyPrint(true); sigNode = sig->createBlankSignature(doc, DSIGConstants::s_unicodeStrURIC14N_COM, DSIGConstants::s_unicodeStrURIHMAC_SHA1); doc->appendChild(sigNode); // Add an object DSIGObject * obj = sig->appendObject(); obj->setId(MAKE_UNICODE_STRING("ObjectId")); // Create a text node DOMText * txt= doc->createTextNode(MAKE_UNICODE_STRING("A test string")); obj->appendChild(txt); // Add a Reference sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA1); // Get a key cerr << "signing ... "; sig->setSigningKey(createHMACKey((unsigned char *) "secret")); sig->sign(); cerr << "validating ... "; if (!sig->verify()) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... serialise and re-verify ... "; if (!reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... "; // Now set to bad txt->setNodeValue(MAKE_UNICODE_STRING("A bad string")); cerr << "verify bad data ... "; if (sig->verify()) { cerr << "bad - should have failed!" << endl; exit(1); } cerr << "OK (verify false) ... serialise and re-verify ... "; if (reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad - should have failed" << endl; exit(1); } cerr << "OK" << endl; // Reset to OK txt->setNodeValue(MAKE_UNICODE_STRING("A test string")); outputDoc(impl, doc); doc->release(); } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } } void unitTestBase64NodeSignature(DOMImplementation * impl) { // This tests a normal signature with a reference to a Base64 element cerr << "Creating a base64 Element reference ... "; try { // Create a document DOMDocument * doc = impl->createDocument(); // Create the signature XSECProvider prov; DSIGSignature *sig; DOMElement *sigNode; sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sig->setPrettyPrint(true); #if defined (XSEC_XERCES_HAS_SETIDATTRIBUTE) sig->setIdByAttributeName(false); // Do not search by name #endif sigNode = sig->createBlankSignature(doc, DSIGConstants::s_unicodeStrURIC14N_COM, DSIGConstants::s_unicodeStrURIHMAC_SHA1); doc->appendChild(sigNode); // Add an object DSIGObject * obj = sig->appendObject(); obj->setId(MAKE_UNICODE_STRING("ObjectId")); // Create a text node DOMText * txt= doc->createTextNode(MAKE_UNICODE_STRING("QSB0ZXN0IHN0cmluZw==")); obj->appendChild(txt); // Add a Reference DSIGReference * ref = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA1); // Add a Base64 transform ref->appendBase64Transform(); // Get a key cerr << "signing ... "; sig->setSigningKey(createHMACKey((unsigned char *) "secret")); sig->sign(); cerr << "validating ... "; if (!sig->verify()) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... serialise and re-verify ... "; if (!reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... "; // Now set to bad txt->setNodeValue(MAKE_UNICODE_STRING("QSAybmQgdGVzdCBzdHJpbmc=")); cerr << "verify bad data ... "; if (sig->verify()) { cerr << "bad - should have failed!" << endl; exit(1); } cerr << "OK (verify false) ... serialise and re-verify ... "; if (reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad - should have failed" << endl; exit(1); } cerr << "OK" << endl; // Reset to OK txt->setNodeValue(MAKE_UNICODE_STRING("QSB0ZXN0IHN0cmluZw==")); outputDoc(impl, doc); doc->release(); } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } } void unitTestLongSHA(DOMImplementation * impl) { // This tests an enveloping signature as the root node, using SHA224/256/384/512 cerr << "Creating long SHA references using SHA512 HMAC... "; try { // Create a document DOMDocument * doc = impl->createDocument(); // Create the signature XSECProvider prov; DSIGSignature *sig; DOMElement *sigNode; DSIGReference *ref[4]; sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sig->setPrettyPrint(true); sigNode = sig->createBlankSignature(doc, DSIGConstants::s_unicodeStrURIC14N_COM, DSIGConstants::s_unicodeStrURIHMAC_SHA512); doc->appendChild(sigNode); // Add an object DSIGObject * obj = sig->appendObject(); obj->setId(MAKE_UNICODE_STRING("ObjectId")); // Create a text node DOMText * txt= doc->createTextNode(MAKE_UNICODE_STRING("A test string")); obj->appendChild(txt); // Add a Reference if (XSECPlatformUtils::g_cryptoProvider->algorithmSupported(XSECCryptoHash::HASH_SHA224)) { cerr << "224 ... "; ref[0] = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA224); } cerr << "256 ... "; ref[1] = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA256); cerr << "384 ... "; ref[2] = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA384); cerr << "512 ... "; ref[3] = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA512); // Get a key cerr << "signing ... "; sig->setSigningKey(createHMACKey((unsigned char *) "secret")); sig->sign(); cerr << "validating ... "; if (!sig->verify()) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... serialise and re-verify ... "; if (!reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... "; // Now set to bad txt->setNodeValue(MAKE_UNICODE_STRING("A bad string")); cerr << "verify bad data ... "; if (sig->verify()) { cerr << "bad - should have failed!" << endl; exit(1); } cerr << "OK (verify false) ... serialise and re-verify ... "; if (reValidateSig(impl, doc, createHMACKey((unsigned char *) "secret"))) { cerr << "bad - should have failed" << endl; exit(1); } cerr << "OK" << endl; // Reset to OK txt->setNodeValue(MAKE_UNICODE_STRING("A test string")); // Now check the references cerr << " Checking reference values against known good" << endl; unsigned char buf[128]; int len; const char * shastrings[] = { "SHA224", "SHA256", "SHA384", "SHA512" }; /* * Validate the reference hash values from known good */ int i; for (i = 0; i < 4; ++i) { cerr << " Calculating hash for reference " << shastrings[i] << " ... "; len = (int) ref[i]->calculateHash(buf, 128); cerr << " Done\n Checking -> "; if (len < 20) { cerr << "Bad (Length = " << len << ")" << endl; exit (1); } for (int j = 0; j < len; ++j) { if (buf[j] != longShaRefs[i][j]) { cerr << "Bad at location " << j << endl; for (j = 0; j < len; ++j) { fprintf(stderr, "0x%02x, ", buf[j]); } exit (1); } } cerr << "Good.\n"; } outputDoc(impl, doc); doc->release(); } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } } void unitTestRSASig(DOMImplementation * impl, XSECCryptoKeyRSA * k, const XMLCh * AlgURI) { // Given a specific RSA key and particular algorithm URI, sign and validate a document try { // Create a document DOMDocument * doc = impl->createDocument(); // Create the signature XSECProvider prov; DSIGSignature *sig; DOMElement *sigNode; DSIGReference *ref[4]; sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sig->setPrettyPrint(true); sigNode = sig->createBlankSignature(doc, DSIGConstants::s_unicodeStrURIC14N_COM, AlgURI); doc->appendChild(sigNode); // Add an object DSIGObject * obj = sig->appendObject(); obj->setId(MAKE_UNICODE_STRING("ObjectId")); // Create a text node DOMText * txt= doc->createTextNode(MAKE_UNICODE_STRING("A test string")); obj->appendChild(txt); // Add a Reference ref[0] = sig->createReference(MAKE_UNICODE_STRING("#ObjectId"), DSIGConstants::s_unicodeStrURISHA1); // Get a key cerr << "signing ... "; sig->setSigningKey(k->clone()); sig->sign(); cerr << "OK ... "; cerr << "validating ... "; if (!sig->verify()) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK ... serialise and re-verify ... "; if (!reValidateSig(impl, doc, k)) { cerr << "bad verify!" << endl; exit(1); } cerr << "OK"; #if 0 #if defined XSEC_HAVE_OPENSSL if (g_useWinCAPI || g_useNSS) { cerr << " ... validate against OpenSSL" << endl; BIO * bioMem = BIO_new(BIO_s_mem()); BIO_puts(bioMem, s_tstRSAPrivateKey); EVP_PKEY * pk = PEM_read_bio_PrivateKey(bioMem, NULL, NULL, NULL); OpenSSLCryptoKeyRSA * rsaKey = new OpenSSLCryptoKeyRSA(pk); sig->setSigningKey(rsaKey); if (!sig->verify()) { cerr << "bad verify!" << endl; exit (1); } cerr << "OK"; BIO_free(bioMem); EVP_PKEY_free(pk); } #endif #endif cerr << "\n"; outputDoc(impl, doc); doc->release(); } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } } void unitTestRSA(DOMImplementation * impl) { /* First we load some keys to use! */ XSECCryptoKeyRSA * rsaKey; #if defined (XSEC_HAVE_OPENSSL) if (!g_useWinCAPI && !g_useNSS) { // Load the key BIO * bioMem = BIO_new(BIO_s_mem()); BIO_puts(bioMem, s_tstRSAPrivateKey); EVP_PKEY * pk = PEM_read_bio_PrivateKey(bioMem, NULL, NULL, NULL); rsaKey = new OpenSSLCryptoKeyRSA(pk); BIO_free(bioMem); EVP_PKEY_free(pk); } #endif #if defined (XSEC_HAVE_WINCAPI) if (g_useWinCAPI) { // Use the internal key WinCAPICryptoProvider *cp = (WinCAPICryptoProvider *) (XSECPlatformUtils::g_cryptoProvider); HCRYPTPROV p = cp->getApacheKeyStore(); rsaKey = new WinCAPICryptoKeyRSA(p, AT_KEYEXCHANGE, true); } #endif #if defined (XSEC_HAVE_NSS) if (g_useNSS) { // Heavily based on Mozilla example code SECKEYPrivateKey *prvKey = 0; SECKEYPublicKey *pubKey = 0; PK11SlotInfo *slot = 0; PK11RSAGenParams rsaParams; // Use a bog standard key size rsaParams.keySizeInBits = 1024; rsaParams.pe = 65537; // We need somewhere to temporarily store a generated key slot = PK11_GetInternalKeySlot(); if (!slot) { cerr << "Error generating key - can't get NSS slot\n"; exit (1); } // Do the generate prvKey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, &rsaParams, &pubKey, PR_FALSE, PR_TRUE, 0); if (!prvKey) { if (slot) PK11_FreeSlot(slot); cerr << "Error generating key within NSS\n"; exit (1); } // Now use the key! rsaKey = new NSSCryptoKeyRSA(pubKey, prvKey); } #endif cerr << "Unit testing RSA-SHA1 signature ... "; unitTestRSASig(impl, (XSECCryptoKeyRSA *) rsaKey->clone(), DSIGConstants::s_unicodeStrURIRSA_SHA1); if (XSECPlatformUtils::g_cryptoProvider->algorithmSupported(XSECCryptoHash::HASH_SHA512)) { cerr << "Unit testing RSA-SHA224 signature ... "; unitTestRSASig(impl, (XSECCryptoKeyRSA *) rsaKey->clone(), DSIGConstants::s_unicodeStrURIRSA_SHA224); cerr << "Unit testing RSA-SHA256 signature ... "; unitTestRSASig(impl, (XSECCryptoKeyRSA *) rsaKey->clone(), DSIGConstants::s_unicodeStrURIRSA_SHA256); cerr << "Unit testing RSA-SHA384 signature ... "; unitTestRSASig(impl, (XSECCryptoKeyRSA *) rsaKey->clone(), DSIGConstants::s_unicodeStrURIRSA_SHA384); cerr << "Unit testing RSA-SHA512 signature ... "; unitTestRSASig(impl, (XSECCryptoKeyRSA *) rsaKey->clone(), DSIGConstants::s_unicodeStrURIRSA_SHA512); } else cerr << "Skipping non SHA 224/256/384/512 RSA signatures" << endl; cerr << "Unit testing RSA-MD5 signature ... "; unitTestRSASig(impl, rsaKey, DSIGConstants::s_unicodeStrURIRSA_MD5); } void unitTestSignature(DOMImplementation * impl) { // Test an enveloping signature unitTestEnvelopingSignature(impl); #ifndef XSEC_NO_XALAN unitTestBase64NodeSignature(impl); #else cerr << "Skipping base64 node test (Requires XPath)" << endl; #endif // Test "long" sha hashes if (XSECPlatformUtils::g_cryptoProvider->algorithmSupported(XSECCryptoHash::HASH_SHA512)) unitTestLongSHA(impl); else cerr << "Skipping long SHA hash tests as SHA512 not supported by crypto provider" << endl; // Test RSA Signatures unitTestRSA(impl); } // -------------------------------------------------------------------------------- // Basic tests of signature function // -------------------------------------------------------------------------------- void testSignature(DOMImplementation *impl) { cerr << "Creating a known doc and signing (HMAC-SHA1)" << endl; // Create a document DOMDocument * doc = createTestDoc(impl); // Check signature functions XSECProvider prov; DSIGSignature *sig; DSIGReference *ref[10]; DOMElement *sigNode; int refCount; try { /* * Now we have a document, create a signature for it. */ sig = prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sig->setPrettyPrint(true); sigNode = sig->createBlankSignature(doc, DSIGConstants::s_unicodeStrURIC14N_COM, DSIGConstants::s_unicodeStrURIHMAC_SHA1); DOMElement * rootElem = doc->getDocumentElement(); DOMNode * prodElem = rootElem->getFirstChild(); rootElem->appendChild(doc->createTextNode(DSIGConstants::s_unicodeStrNL)); rootElem->insertBefore(doc->createComment(MAKE_UNICODE_STRING(" a comment ")), prodElem); rootElem->appendChild(sigNode); rootElem->insertBefore(doc->createTextNode(DSIGConstants::s_unicodeStrNL), prodElem); /* * Add some test references */ ref[0] = sig->createReference(MAKE_UNICODE_STRING(""), DSIGConstants::s_unicodeStrURISHA1); ref[0]->appendEnvelopedSignatureTransform(); ref[1] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[1]->appendEnvelopedSignatureTransform(); ref[1]->appendCanonicalizationTransform(DSIGConstants::s_unicodeStrURIC14N_NOC); ref[2] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[2]->appendEnvelopedSignatureTransform(); ref[2]->appendCanonicalizationTransform(DSIGConstants::s_unicodeStrURIC14N_COM); ref[3] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[3]->appendEnvelopedSignatureTransform(); ref[3]->appendCanonicalizationTransform(DSIGConstants::s_unicodeStrURIEXC_C14N_NOC); ref[4] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[4]->appendEnvelopedSignatureTransform(); ref[4]->appendCanonicalizationTransform(DSIGConstants::s_unicodeStrURIEXC_C14N_COM); ref[5] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[5]->appendEnvelopedSignatureTransform(); DSIGTransformC14n * ce = ref[5]->appendCanonicalizationTransform( DSIGConstants::s_unicodeStrURIEXC_C14N_COM); ce->addInclusiveNamespace("foo"); sig->setECNSPrefix(MAKE_UNICODE_STRING("ec")); ref[6] = sig->createReference(MAKE_UNICODE_STRING("#xpointer(/)"), DSIGConstants::s_unicodeStrURISHA1); ref[6]->appendEnvelopedSignatureTransform(); ce = ref[6]->appendCanonicalizationTransform( DSIGConstants::s_unicodeStrURIEXC_C14N_COM); ce->addInclusiveNamespace("foo"); #ifdef XSEC_NO_XALAN cerr << "WARNING : No testing of XPath being performed as Xalan not present" << endl; refCount = 7; #else /* * Create some XPath/XPathFilter references */ ref[7] = sig->createReference(MAKE_UNICODE_STRING(""), DSIGConstants::s_unicodeStrURISHA1); sig->setXPFNSPrefix(MAKE_UNICODE_STRING("xpf")); DSIGTransformXPathFilter * xpf = ref[7]->appendXPathFilterTransform(); xpf->appendFilter(FILTER_INTERSECT, MAKE_UNICODE_STRING("//ADoc/category")); ref[8] = sig->createReference(MAKE_UNICODE_STRING(""), DSIGConstants::s_unicodeStrURISHA1); /* ref[5]->appendXPathTransform("ancestor-or-self::dsig:Signature", "xmlns:dsig=http://www.w3.org/2000/09/xmldsig#"); */ DSIGTransformXPath * x = ref[8]->appendXPathTransform("count(ancestor-or-self::dsig:Signature | \ here()/ancestor::dsig:Signature[1]) > \ count(ancestor-or-self::dsig:Signature)"); x->setNamespace("dsig", "http://www.w3.org/2000/09/xmldsig#"); refCount = 9; #endif /* * Sign the document, using an HMAC algorithm and the key "secret" */ sig->appendKeyName(MAKE_UNICODE_STRING("The secret key is \"secret\"")); // Append a test DNames DSIGKeyInfoX509 * x509 = sig->appendX509Data(); x509->setX509SubjectName(s_tstDName); // Append a test PGPData element sig->appendPGPData(s_tstPGPKeyID, s_tstPGPKeyPacket); // Append an SPKIData element DSIGKeyInfoSPKIData * spki = sig->appendSPKIData(s_tstSexp1); spki->appendSexp(s_tstSexp2); // Append a MgmtData element sig->appendMgmtData(s_tstMgmtData); sig->setSigningKey(createHMACKey((unsigned char *) "secret")); sig->sign(); // Output the document post signature if necessary outputDoc(impl, doc); cerr << endl << "Doc signed OK - Checking values against Known Good" << endl; unsigned char buf[128]; xsecsize_t len; /* * Validate the reference hash values from known good */ int i; for (i = 0; i < refCount; ++i) { cerr << "Calculating hash for reference " << i << " ... "; len = (int) ref[i]->calculateHash(buf, 128); cerr << " Done\nChecking -> "; if (len != 20) { cerr << "Bad (Length = " << len << ")" << endl; exit (1); } for (int j = 0; j < 20; ++j) { if (buf[j] != createdDocRefs[i][j]) { cerr << "Bad at location " << j << endl; exit (1); } } cerr << "Good.\n"; } /* * Verify the signature check works */ cerr << "Running \"verifySignatureOnly()\" on calculated signature ... "; if (sig->verifySignatureOnly()) { cerr << "OK" << endl; } else { cerr << "Failed" << endl; char * e = XMLString::transcode(sig->getErrMsgs()); cout << e << endl; XSEC_RELEASE_XMLCH(e); exit(1); } /* * Change the document and ensure the signature fails. */ cerr << "Setting incorrect key in Signature object" << endl; sig->setSigningKey(createHMACKey((unsigned char *) "badsecret")); cerr << "Running \"verifySignatureOnly()\" on calculated signature ... "; if (!sig->verifySignatureOnly()) { cerr << "OK (Signature bad)" << endl; } else { cerr << "Failed (signature OK but should be bad)" << endl; exit(1); } // Don't need the signature now the DOM structure is in place prov.releaseSignature(sig); /* * Now serialise the document to memory so we can re-parse and check from scratch */ cerr << "Serialising the document to a memory buffer ... "; MemBufFormatTarget *formatTarget = new MemBufFormatTarget(); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(doc,theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); theSerializer->writeNode(formatTarget, *doc); #endif // Copy to a new buffer len = formatTarget->getLen(); char * mbuf = new char [len + 1]; memcpy(mbuf, formatTarget->getRawBuffer(), len); mbuf[len] = '\0'; #if 0 cout << mbuf << endl; #endif delete theSerializer; delete formatTarget; cerr << "done\nParsing memory buffer back to DOM ... "; // Also release the document so that we can re-load from scratch doc->release(); /* * Re-parse */ XercesDOMParser parser; parser.setDoNamespaces(true); parser.setCreateEntityReferenceNodes(true); MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) mbuf, len, "XSECMem"); parser.parse(*memIS); doc = parser.adoptDocument(); delete(memIS); delete[] mbuf; cerr << "done\nValidating signature ..."; /* * Validate signature */ sig = prov.newSignatureFromDOM(doc); sig->load(); sig->setSigningKey(createHMACKey((unsigned char *) "secret")); if (sig->verify()) { cerr << "OK" << endl; } else { cerr << "Failed\n" << endl; char * e = XMLString::transcode(sig->getErrMsgs()); cerr << e << endl; XSEC_RELEASE_XMLCH(e); exit(1); } /* * Ensure DNames are read back in and decoded properly */ DSIGKeyInfoList * kil = sig->getKeyInfoList(); int nki = (int) kil->getSize(); cerr << "Checking Distinguished name is decoded correctly ... "; for (i = 0; i < nki; ++i) { if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { if (strEquals(s_tstDName, ((DSIGKeyInfoX509 *) kil->item(i))->getX509SubjectName())) { cerr << "yes" << endl; } else { cerr << "decoded incorrectly" << endl;; exit (1); } } if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_PGPDATA) { cerr << "Validating PGPData read back OK ... "; DSIGKeyInfoPGPData * p = (DSIGKeyInfoPGPData *)kil->item(i); if (!(strEquals(p->getKeyID(), s_tstPGPKeyID) && strEquals(p->getKeyPacket(), s_tstPGPKeyPacket))) { cerr << "no!"; exit(1); } cerr << "yes\n"; } if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_SPKIDATA) { cerr << "Validating SPKIData read back OK ... "; DSIGKeyInfoSPKIData * s = (DSIGKeyInfoSPKIData *)kil->item(i); if (s->getSexpSize() != 2) { cerr << "no - expected two S-expressions"; exit(1); } if (!(strEquals(s->getSexp(0), s_tstSexp1) && strEquals(s->getSexp(1), s_tstSexp2))) { cerr << "no!"; exit(1); } cerr << "yes\n"; } if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_MGMTDATA) { cerr << "Validating MgmtData read back OK ... "; DSIGKeyInfoMgmtData * m = (DSIGKeyInfoMgmtData *)kil->item(i); if (!strEquals(m->getData(), s_tstMgmtData)) { cerr << "no!"; exit(1); } cerr << "yes\n"; } } } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } // Output the document post signature if necessary outputDoc(impl, doc); doc->release(); } // -------------------------------------------------------------------------------- // Unit tests for test encrypt/Decrypt // -------------------------------------------------------------------------------- void unitTestCipherReference(DOMImplementation * impl) { DOMDocument *doc = impl->createDocument( 0, // root element namespace URI. MAKE_UNICODE_STRING("ADoc"), // root element name NULL);// DOMDocumentType()); // document type object (DTD). DOMElement *rootElem = doc->getDocumentElement(); // Use key k to wrap a test key, decrypt it and make sure it is still OK XSECProvider prov; XENCCipher * cipher; try { cipher = prov.newCipher(doc); cerr << "Creating CipherReference ... "; XENCEncryptedData * xenc = cipher->createEncryptedData(XENCCipherData::REFERENCE_TYPE, DSIGConstants::s_unicodeStrURIAES128_CBC, MAKE_UNICODE_STRING("#CipherText")); rootElem->appendChild(xenc->getElement()); // Now create the data that is referenced DOMElement * cipherVal = doc->createElement(MAKE_UNICODE_STRING("MyCipherValue")); rootElem->appendChild(cipherVal); cipherVal->setAttributeNS(NULL, MAKE_UNICODE_STRING("Id"), MAKE_UNICODE_STRING("CipherText")); #if defined(XSEC_XERCES_HAS_SETIDATTRIBUTE) cipherVal->setIdAttribute(MAKE_UNICODE_STRING("Id")); #endif cipherVal->appendChild(doc->createTextNode(MAKE_UNICODE_STRING((char *) s_tstBase64EncodedString))); // Now add the transforms necessary to decrypt XENCCipherReference *cref = xenc->getCipherData()->getCipherReference(); if (cref == NULL) { cerr << "Failed - no CipherReference object" << endl; exit(1); } cerr << "done ... appending XPath and Base64 transforms ... "; //cref->appendXPathTransform("self::text()[parent::rep:CipherValue[@Id="example1"]]"); cref->appendXPathTransform("self::text()[parent::MyCipherValue[@Id=\"CipherText\"]]"); cref->appendBase64Transform(); cerr << "done ... decrypting ... "; // Create a key XSECCryptoSymmetricKey * ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); ks->setKey((unsigned char *) s_keyStr, 16); cipher->setKey(ks); // Now try to decrypt DOMNode * n = findXENCNode(doc, "EncryptedData"); XSECBinTXFMInputStream *is = cipher->decryptToBinInputStream((DOMElement *) n); Janitor j_is(is); XMLByte buf[1024]; cerr << "done ... comparing to known good ... "; xsecsize_t bytesRead = is->readBytes(buf, 1024); buf[bytesRead] = '\0'; if (strcmp((char *) buf, s_tstDecryptedString) == 0) { cerr << "OK" << endl; } else { cerr << "failed - bad compare of decrypted data" << endl; } } catch (XSECException &e) { cerr << "failed\n"; cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "failed\n"; cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } outputDoc(impl, doc); doc->release(); } void unitTestElementContentEncrypt(DOMImplementation *impl, XSECCryptoKey * key, encryptionMethod em, bool doElementContent) { if (doElementContent) cerr << "Encrypting Element Content ... "; else cerr << "Encrypting Element ... "; // Create a document DOMDocument * doc = createTestDoc(impl); DOMNode * categoryNode = findNode(doc, MAKE_UNICODE_STRING("category")); if (categoryNode == NULL) { cerr << "Error finding category node for encryption test" << endl; exit(1); } // Create and execute cipher XSECProvider prov; XENCCipher * cipher; try { /* * Now we have a document, find the data node. */ cipher = prov.newCipher(doc); cipher->setXENCNSPrefix(MAKE_UNICODE_STRING("xenc")); cipher->setPrettyPrint(true); // Set a key cipher->setKey(key->clone()); // Now encrypt! if (doElementContent) cipher->encryptElementContent(doc->getDocumentElement(), em); else cipher->encryptElement((DOMElement *) categoryNode, em); cerr << "done ... check encrypted ... "; DOMNode * t = findNode(doc, MAKE_UNICODE_STRING("category")); if (t != NULL) { cerr << "no - a category child still exists" << endl; exit(1); } else cerr << "yes" << endl; outputDoc(impl, doc); if (doElementContent) cerr << "Decrypting Element content ... "; else cerr << "Decrypting Element ... "; // OK - Now we try to decrypt // Find the EncryptedData node DOMNode * n = findXENCNode(doc, "EncryptedData"); XENCCipher * cipher2 = prov.newCipher(doc); cipher2->setKey(key); cipher2->decryptElement(static_cast(n)); cerr << "done ... check decrypt ... "; t = findNode(doc, MAKE_UNICODE_STRING("category")); if (t == NULL) { cerr << " failed - category did not decrypt properly" << endl; exit(1); } else cerr << "OK" << endl; outputDoc(impl, doc); } catch (XSECException &e) { cerr << "An error occured during encryption processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during encryption processing\n Message: " << e.getMsg() << endl; exit(1); } doc->release(); } void unitTestSmallElement(DOMImplementation *impl) { cerr << "Encrypt small input... "; // Create a document DOMDocument * doc = createTestDoc(impl); DOMElement * productNode = (DOMElement *) findNode(doc, MAKE_UNICODE_STRING("product")); if (productNode == NULL) { cerr << "Error finding product node for small input encryption test" << endl; exit(1); } // Shrink the input text DOMNode * textNode = productNode->getFirstChild(); textNode->setNodeValue(MAKE_UNICODE_STRING("sm")); // Create and execute cipher XSECProvider prov; XENCCipher * cipher; try { /* * Now we have a document, find the data node. */ cipher = prov.newCipher(doc); cipher->setXENCNSPrefix(MAKE_UNICODE_STRING("xenc")); cipher->setPrettyPrint(true); // Set a key XSECCryptoSymmetricKey * ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); ks->setKey((unsigned char *) s_keyStr, 24); cipher->setKey(ks->clone()); // Now encrypt! cipher->encryptElementContent(productNode, ENCRYPT_3DES_CBC); cerr << "done ... check encrypted ... "; DOMNode * t = findNode(doc, MAKE_UNICODE_STRING("product")); t = findFirstChildOfType(t, DOMNode::TEXT_NODE); while (t != NULL && ! strEquals(t->getNodeValue(), "sm")) t = findNextChildOfType(t, DOMNode::TEXT_NODE); if (t != NULL) { cerr << "no - text child still exists" << endl; exit(1); } else cerr << "yes" << endl; outputDoc(impl, doc); cerr << "Decrypting Element content ... "; // OK - Now we try to decrypt // Find the EncryptedData node DOMNode * n = findXENCNode(doc, "EncryptedData"); XENCCipher * cipher2 = prov.newCipher(doc); cipher2->setKey(ks); cipher2->decryptElement(static_cast(n)); cerr << "done ... check decrypt ... "; t = findNode(doc, MAKE_UNICODE_STRING("product")); t = findFirstChildOfType(t, DOMNode::TEXT_NODE); if (t == NULL || !strEquals(t->getNodeValue(), "sm")) { cerr << " failed - small text did not decrypt properly" << endl; exit(1); } else cerr << "OK" << endl; outputDoc(impl, doc); } catch (XSECException &e) { cerr << "An error occured during encryption processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during encryption processing\n Message: " << e.getMsg() << endl; exit(1); } doc->release(); } void unitTestKeyEncrypt(DOMImplementation *impl, XSECCryptoKey * k, encryptionMethod em) { // Create a document that we will embed the encrypted key in DOMDocument *doc = impl->createDocument( 0, // root element namespace URI. MAKE_UNICODE_STRING("ADoc"), // root element name NULL);// DOMDocumentType()); // document type object (DTD). DOMElement *rootElem = doc->getDocumentElement(); // Use key k to wrap a test key, decrypt it and make sure it is still OK XSECProvider prov; XENCCipher * cipher; try { // Encrypt a dummy key cerr << "encrypt ... "; static unsigned char toEncryptStr[] = "A test key to use for da"; cipher = prov.newCipher(doc); cipher->setXENCNSPrefix(MAKE_UNICODE_STRING("xenc")); cipher->setPrettyPrint(true); // Set a key cipher->setKEK(k); XENCEncryptedKey * encryptedKey; encryptedKey = cipher->encryptKey(toEncryptStr, (unsigned int) strlen((char *) toEncryptStr), em); Janitor j_encryptedKey(encryptedKey); rootElem->appendChild(encryptedKey->getElement()); // Decrypt cerr << "decrypt ... "; XMLByte decBuf[64]; cipher->decryptKey(encryptedKey, decBuf, 64); // Check cerr << "comparing ... "; if (memcmp(decBuf, toEncryptStr, strlen((char *) toEncryptStr)) == 0) { cerr << "OK ... "; } else { cerr << "different = failed!" << endl; exit(2); } cerr << "decrypt from DOM ... "; // Decrypt from DOM DOMNode * keyNode = findXENCNode(doc, "EncryptedKey"); if (keyNode == NULL) { cerr << "no key - failed!" << endl; exit(2); } memset(decBuf, 0, 64); cipher->decryptKey((DOMElement *) keyNode, decBuf, 64); cerr << "comparing ... "; if (memcmp(decBuf, toEncryptStr, strlen((char *) toEncryptStr)) == 0) { cerr << "OK" << endl; } else { cerr << "different = failed!" << endl; exit(2); } } catch (XSECException &e) { cerr << "failed\n"; cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "failed\n"; cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } outputDoc(impl, doc); doc->release(); } void unitTestEncrypt(DOMImplementation *impl) { try { // Key wraps cerr << "RSA key wrap... "; #if defined (XSEC_HAVE_OPENSSL) if (!g_useWinCAPI && !g_useNSS) { // Load the key BIO * bioMem = BIO_new(BIO_s_mem()); BIO_puts(bioMem, s_tstRSAPrivateKey); EVP_PKEY * pk = PEM_read_bio_PrivateKey(bioMem, NULL, NULL, NULL); OpenSSLCryptoKeyRSA * k = new OpenSSLCryptoKeyRSA(pk); unitTestKeyEncrypt(impl, k, ENCRYPT_RSA_15); cerr << "RSA OAEP key wrap... "; k = new OpenSSLCryptoKeyRSA(pk); unitTestKeyEncrypt(impl, k, ENCRYPT_RSA_OAEP_MGFP1); cerr << "RSA OAEP key wrap + params... "; k = new OpenSSLCryptoKeyRSA(pk); k->setOAEPparams(s_tstOAEPparams, (unsigned int) strlen((char *) s_tstOAEPparams)); unitTestKeyEncrypt(impl, k, ENCRYPT_RSA_OAEP_MGFP1); BIO_free(bioMem); EVP_PKEY_free(pk); } #endif #if defined (XSEC_HAVE_WINCAPI) if (g_useWinCAPI) { // Use the internal key WinCAPICryptoProvider *cp = (WinCAPICryptoProvider *) (XSECPlatformUtils::g_cryptoProvider); HCRYPTPROV p = cp->getApacheKeyStore(); WinCAPICryptoKeyRSA * rsaKey = new WinCAPICryptoKeyRSA(p, AT_KEYEXCHANGE, true); unitTestKeyEncrypt(impl, rsaKey, ENCRYPT_RSA_15); cerr << "RSA OAEP key wrap... "; rsaKey = new WinCAPICryptoKeyRSA(p, AT_KEYEXCHANGE, true); unitTestKeyEncrypt(impl, rsaKey, ENCRYPT_RSA_OAEP_MGFP1); } #endif #if defined (XSEC_HAVE_NSS) if (g_useNSS) { // Heavily based on Mozilla example code SECKEYPrivateKey *prvKey = 0; SECKEYPublicKey *pubKey = 0; PK11SlotInfo *slot = 0; PK11RSAGenParams rsaParams; // Use a bog standard key size rsaParams.keySizeInBits = 1024; rsaParams.pe = 65537; // We need somewhere to temporarily store a generated key slot = PK11_GetInternalKeySlot(); if (!slot) { cerr << "Error generating key - can't get NSS slot\n"; exit (1); } // Do the generate prvKey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, &rsaParams, &pubKey, PR_FALSE, PR_TRUE, 0); if (!prvKey) { if (slot) PK11_FreeSlot(slot); cerr << "Error generating key within NSS\n"; exit (1); } // Now use the key! NSSCryptoKeyRSA * rsaKey = new NSSCryptoKeyRSA(pubKey, prvKey); unitTestKeyEncrypt(impl, rsaKey, ENCRYPT_RSA_15); if (slot) // Actual keys will be deleted by the provider PK11_FreeSlot(slot); cerr << "RSA OAEP key wrap skipped - not yet supported in NSS crypto provider\n"; } #endif XSECCryptoSymmetricKey * ks; if (g_haveAES) { cerr << "AES 128 key wrap... "; ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); ks->setKey((unsigned char *) s_keyStr, 16); unitTestKeyEncrypt(impl, ks, ENCRYPT_KW_AES128); cerr << "AES 192 key wrap... "; ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_192); ks->setKey((unsigned char *) s_keyStr, 24); unitTestKeyEncrypt(impl, ks, ENCRYPT_KW_AES192); cerr << "AES 256 key wrap... "; ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); ks->setKey((unsigned char *) s_keyStr, 32); unitTestKeyEncrypt(impl, ks, ENCRYPT_KW_AES256); } else cerr << "Skipped AES key wrap tests" << endl; cerr << "Triple DES key wrap... "; ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); ks->setKey((unsigned char *) s_keyStr, 24); unitTestKeyEncrypt(impl, ks, ENCRYPT_KW_3DES); // Now do Element encrypts if (g_haveAES) { // 128 AES ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); ks->setKey((unsigned char *) s_keyStr, 16); cerr << "Unit testing AES 128 bit CBC encryption" << endl; unitTestElementContentEncrypt(impl, ks->clone(), ENCRYPT_AES128_CBC, false); unitTestElementContentEncrypt(impl, ks, ENCRYPT_AES128_CBC, true); //192 AES ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_192); ks->setKey((unsigned char *) s_keyStr, 24); cerr << "Unit testing AES 192 bit CBC encryption" << endl; unitTestElementContentEncrypt(impl, ks->clone(), ENCRYPT_AES192_CBC, false); unitTestElementContentEncrypt(impl, ks, ENCRYPT_AES192_CBC, true); // 256 AES ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); ks->setKey((unsigned char *) s_keyStr, 32); cerr << "Unit testing AES 256 bit CBC encryption" << endl; unitTestElementContentEncrypt(impl, ks->clone(), ENCRYPT_AES256_CBC, false); unitTestElementContentEncrypt(impl, ks, ENCRYPT_AES256_CBC, true); } else cerr << "Skipped AES Element tests" << endl; // 192 3DES ks = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); ks->setKey((unsigned char *) s_keyStr, 24); cerr << "Unit testing 3DES CBC encryption" << endl; unitTestElementContentEncrypt(impl, ks->clone(), ENCRYPT_3DES_CBC, false); unitTestElementContentEncrypt(impl, ks, ENCRYPT_3DES_CBC, true); #ifndef XSEC_NO_XALAN if (g_haveAES) { cerr << "Unit testing CipherReference creation and decryption" << endl; unitTestCipherReference(impl); } else { cerr << "Skipped Cipher Reference Test (uses AES)" << endl; } #else cerr << "Skipped Cipher Reference Test (requires XPath)" << endl; #endif cerr << "Misc. encryption tests" << endl; unitTestSmallElement(impl); } catch (XSECCryptoException &e) { cerr << "failed\n"; cerr << "A cryptographic error occured during encryption unit tests\n Message: " << e.getMsg() << endl; exit(1); } } // -------------------------------------------------------------------------------- // Test encrypt/Decrypt // -------------------------------------------------------------------------------- void testEncrypt(DOMImplementation *impl) { cerr << "Creating a known doc encrypting a portion of it" << endl; // Create a document DOMDocument * doc = createTestDoc(impl); DOMNode * categoryNode = findNode(doc, MAKE_UNICODE_STRING("category")); if (categoryNode == NULL) { cerr << "Error finding category node for encryption test" << endl; exit(1); } // Check signature functions XSECProvider prov; XENCCipher * cipher; try { /* * Now we have a document, find the data node. */ // Generate a key unsigned char randomBuffer[256]; if (XSECPlatformUtils::g_cryptoProvider->getRandom(randomBuffer, 256) != 256) { cerr << "Unable to obtain enough random bytes from Crypto Provider" << endl; exit(1); } cipher = prov.newCipher(doc); cipher->setXENCNSPrefix(MAKE_UNICODE_STRING("xenc")); cipher->setPrettyPrint(true); // Set a key XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); k->setKey((unsigned char *) randomBuffer, 24); cipher->setKey(k); // Now encrypt! cerr << "Performing 3DES encryption on element ... "; cipher->encryptElement((DOMElement *) categoryNode, ENCRYPT_3DES_CBC); // Add a KeyInfo cerr << "done\nAppending a ... "; XENCEncryptedData * encryptedData = cipher->getEncryptedData(); encryptedData->appendKeyName(s_tstKeyName); cerr << "done\nAdding Encoding and MimeType ... "; // Add MimeType and Encoding encryptedData->setEncoding(s_tstEncoding); encryptedData->setMimeType(s_tstMimeType); // Set a KeySize cerr << "done\nSetting ... "; encryptedData->getEncryptionMethod()->setKeySize(192); cerr << "done\nSearching for ... "; DOMNode * t = findNode(doc, MAKE_UNICODE_STRING("category")); if (t != NULL) { cerr << "found!\nError - category is not encrypted" << endl; exit(1); } else cerr << "not found (OK - now encrypted)" << endl; // Now try to encrypt the Key cerr << "Encrypting symmetric key ... " << endl; XSECCryptoSymmetricKey * kek; if (g_haveAES) { kek = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); kek->setKey((unsigned char *) s_keyStr, 16); } else { kek = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); kek->setKey((unsigned char *) s_keyStr, 24); } cipher->setKEK(kek); XENCEncryptedKey * encryptedKey; if (g_haveAES) encryptedKey = cipher->encryptKey(randomBuffer, 24, ENCRYPT_KW_AES128); else encryptedKey = cipher->encryptKey(randomBuffer, 24, ENCRYPT_KW_3DES); cerr << "done!" << endl; cerr << "Adding CarriedKeyName and Recipient to encryptedKey ... " << endl; encryptedKey->setCarriedKeyName(s_tstCarriedKeyName); encryptedKey->setRecipient(s_tstRecipient); cerr << "done!" << endl; encryptedData->appendEncryptedKey(encryptedKey); outputDoc(impl, doc); // OK - Now we try to decrypt // Find the EncryptedData node DOMNode * n = findXENCNode(doc, "EncryptedData"); XENCCipher * cipher2 = prov.newCipher(doc); XSECCryptoSymmetricKey * k2; if (g_haveAES) { k2 = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); k2->setKey((unsigned char *) s_keyStr, 16); } else { k2 = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); k2->setKey((unsigned char *) s_keyStr, 24); } cipher2->setKEK(k2); cerr << "Decrypting ... "; cipher2->decryptElement(static_cast(n)); cerr << "done" << endl; cerr << "Checking for element ... "; t = findNode(doc, MAKE_UNICODE_STRING("category")); if (t == NULL) { cerr << " not found!\nError - category did not decrypt properly" << endl; exit(1); } else cerr << "found" << endl; cerr << "Checking element is set correctly ... "; encryptedData = cipher2->getEncryptedData(); if (encryptedData == NULL) { cerr << "no - cannot access EncryptedData element" << endl; exit(1); } DSIGKeyInfoList * kil = encryptedData->getKeyInfoList(); int nki = (int) kil->getSize(); bool foundNameOK = false; int i; for (i = 0; i < nki; ++i) { if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_NAME) { DSIGKeyInfoName *n = (DSIGKeyInfoName *) (kil->item(i)); if (!strEquals(n->getKeyName(), s_tstKeyName)) { cerr << "no!" << endl; exit (1); } foundNameOK = true; break; } } if (foundNameOK == false) { cerr << "no!" << endl; exit(1); } else cerr << "yes." << endl; cerr << "Checking CarriedKeyName and Recipient values ... "; bool foundCCN = false; bool foundRecipient = false; for (i = 0; i < nki; ++i) { if (kil->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_ENCRYPTEDKEY) { XENCEncryptedKey * xek = (XENCEncryptedKey*)(kil->item(i)); if (strEquals(xek->getCarriedKeyName(), s_tstCarriedKeyName)) { foundCCN = true; } if (strEquals(xek->getRecipient(), s_tstRecipient)) { foundRecipient = true; } } } if (foundCCN == false || foundRecipient == false) { cerr << "no!" << endl; exit(1); } else { cerr << "OK" << endl; } cerr << "Checking MimeType and Encoding ... "; if (encryptedData->getMimeType() == NULL || !strEquals(encryptedData->getMimeType(), s_tstMimeType)) { cerr << "Bad MimeType" << endl; exit(1); } if (encryptedData->getEncoding() == NULL || !strEquals(encryptedData->getEncoding(), s_tstEncoding)) { cerr << "Bad Encoding" << endl; exit(1); } cerr << "OK" << endl; cerr << "Checking KeySize in EncryptionMethod ... "; if (encryptedData->getEncryptionMethod() == NULL || encryptedData->getEncryptionMethod()->getKeySize() != 192) { cerr << "Bad KeySize" << endl; exit(1); } cerr << "OK" << endl; } catch (XSECException &e) { cerr << "An error occured during signature processing\n Message: "; char * ce = XMLString::transcode(e.getMsg()); cerr << ce << endl; delete ce; exit(1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature processing\n Message: " << e.getMsg() << endl; exit(1); } outputDoc(impl, doc); doc->release(); } // -------------------------------------------------------------------------------- // Test XKMS basics // -------------------------------------------------------------------------------- #if 0 void testXKMS(DOMImplementation *impl) { // This is really a place holder cerr << "Making POST call to server ... " << endl; // Create a document DOMDocument * doc = createTestDoc(impl); DOMNode * categoryNode = findNode(doc, MAKE_UNICODE_STRING("category")); /* XSECSOAPRequestorSimpleWin32 req(MAKE_UNICODE_STRING("http://zeus/post.php")); req.doRequest(doc); */ doc->release(); } #endif // -------------------------------------------------------------------------------- // Print usage instructions // -------------------------------------------------------------------------------- void printUsage(void) { cerr << "\nUsage: xtest [options]\n\n"; cerr << " Where options are :\n\n"; cerr << " --help/-h\n"; cerr << " This help message\n\n"; #if defined (XSEC_HAVE_WINCAPI) && defined (XSEC_HAVE_OPENSSL) cerr << " --wincapi/-w\n"; cerr << " Use Windows Crypto API for crypto functionality\n\n"; #endif #if defined (XSEC_HAVE_NSS) cerr << " --nss/-n\n"; cerr << " Use NSS Crypto API for crypto functionality\n\n"; #endif cerr << " --print-docs/-p\n"; cerr << " Print the test documents\n\n"; cerr << " --signature-only/-s\n"; cerr << " Only run basic signature test\n\n"; cerr << " --signature-unit-only/-t\n"; cerr << " Only run signature unit tests\n\n"; cerr << " --encryption-only/-e\n"; cerr << " Only run basic encryption test\n\n"; cerr << " --encryption-unit-only/-u\n"; cerr << " Only run encryption unit tests\n\n"; // cerr << " --xkms-only/-x\n"; // cerr << " Only run basic XKMS test\n\n"; } // -------------------------------------------------------------------------------- // Main // -------------------------------------------------------------------------------- int main(int argc, char **argv) { /* We output a version number to overcome a "feature" in Microsoft's memory leak detection */ cerr << "DSIG Info - Using Apache XML-Security-C Library v" << XSEC_VERSION_MAJOR << "." << XSEC_VERSION_MEDIUM << "." << XSEC_VERSION_MINOR << " (" << _XSEC_VERSION_FULL << ")\n"; // Check parameters bool doEncryptionTest = true; bool doEncryptionUnitTests = true; bool doSignatureTest = true; bool doSignatureUnitTests = true; bool doXKMSTest = true; int paramCount = 1; while (paramCount < argc) { if (_stricmp(argv[paramCount], "--help") == 0 || _stricmp(argv[paramCount], "-h") == 0) { printUsage(); exit(0); } else if (_stricmp(argv[paramCount], "--print-docs") == 0 || _stricmp(argv[paramCount], "-p") == 0) { g_printDocs = true; paramCount++; } #if defined(XSEC_HAVE_WINCAPI) && defined(XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--wincapi") == 0 || _stricmp(argv[paramCount], "-w") == 0) { g_useWinCAPI = true; paramCount++; } #endif #if defined(XSEC_HAVE_NSS) else if (stricmp(argv[paramCount], "--nss") == 0 || stricmp(argv[paramCount], "-n") == 0) { g_useNSS = true; paramCount++; } #endif else if (_stricmp(argv[paramCount], "--signature-only") == 0 || _stricmp(argv[paramCount], "-s") == 0) { doEncryptionTest = false; doEncryptionUnitTests = false; doSignatureUnitTests = false; doXKMSTest = false; paramCount++; } else if (_stricmp(argv[paramCount], "--encryption-only") == 0 || _stricmp(argv[paramCount], "-e") == 0) { doSignatureTest = false; doEncryptionUnitTests = false; doSignatureUnitTests = false; doXKMSTest = false; paramCount++; } else if (_stricmp(argv[paramCount], "--encryption-unit-only") == 0 || _stricmp(argv[paramCount], "-u") == 0) { doEncryptionTest = false; doSignatureTest = false; doSignatureUnitTests = false; doXKMSTest = false; paramCount++; } else if (_stricmp(argv[paramCount], "--signature-unit-only") == 0 || _stricmp(argv[paramCount], "-t") == 0) { doEncryptionTest = false; doSignatureTest = false; doEncryptionUnitTests = false; doXKMSTest = false; paramCount++; } /* else if (stricmp(argv[paramCount], "--xkms-only") == 0 || stricmp(argv[paramCount], "-x") == 0) { doEncryptionTest = false; doSignatureTest = false; doEncryptionUnitTests = false; doSignatureUnitTests = false; paramCount++; }*/ else { printUsage(); return 2; } } #if defined (_DEBUG) && defined (_MSC_VER) && defined (_XSEC_DO_MEMDEBUG) // Do some memory debugging under Visual C++ _CrtMemState s1, s2, s3; // At this point we are about to start really using XSEC, so // Take a "before" checkpoing _CrtMemCheckpoint( &s1 ); #endif // First initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); #if defined (XSEC_HAVE_OPENSSL) && defined (XSEC_HAVE_WINCAPI) if (g_useWinCAPI) { // Setup for Windows Crypt API WinCAPICryptoProvider * cp; // First set windows as the crypto provider cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); } #endif #if defined (XSEC_HAVE_NSS) if (g_useNSS) { // Setup for NSS Crypt API NSSCryptoProvider * cp; // First set windows as the crypto provider cp = new NSSCryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); } #endif } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } { // Set up for tests g_haveAES = XSECPlatformUtils::g_cryptoProvider->algorithmSupported(XSECCryptoSymmetricKey::KEY_AES_128); // Setup for building documents XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); // Output some info char * provName = XMLString::transcode(XSECPlatformUtils::g_cryptoProvider->getProviderName()); cerr << "Crypto Provider string : " << provName << endl; XSEC_RELEASE_XMLCH(provName); // Test signature functions if (doSignatureTest) { cerr << endl << "===================================="; cerr << endl << "Testing Signature Function"; cerr << endl << "===================================="; cerr << endl << endl; testSignature(impl); } // Test signature functions if (doSignatureUnitTests) { cerr << endl << "===================================="; cerr << endl << "Performing Signature Unit Tests"; cerr << endl << "===================================="; cerr << endl << endl; unitTestSignature(impl); } // Test encrypt function if (doEncryptionTest) { cerr << endl << "===================================="; cerr << endl << "Testing Encryption Function"; cerr << endl << "===================================="; cerr << endl << endl; testEncrypt(impl); } // Running Encryption Unit test if (doEncryptionUnitTests) { cerr << endl << "===================================="; cerr << endl << "Performing Encryption Unit Tests"; cerr << endl << "===================================="; cerr << endl << endl; unitTestEncrypt(impl); } /* // Running XKMS Base test if (doXKMSTest) { cerr << endl << "===================================="; cerr << endl << "Performing XKMS Function"; cerr << endl << "===================================="; cerr << endl << endl; testXKMS(impl); } */ cerr << endl << "All tests passed" << endl; } XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); #if defined (_DEBUG) && defined (_MSC_VER) && defined (_XSEC_DO_MEMDEBUG) _CrtMemCheckpoint( &s2 ); if ( _CrtMemDifference( &s3, &s1, &s2 ) && ( s3.lCounts[0] > 0 || s3.lCounts[1] > 1 || // s3.lCounts[2] > 2 || We don't worry about C Runtime s3.lCounts[3] > 0 || s3.lCounts[4] > 0)) { // Note that there is generally 1 Normal and 1 CRT block // still taken. 1 is from Xalan and 1 from stdio // Send all reports to STDOUT _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Dumpy memory stats _CrtMemDumpAllObjectsSince( &s3 ); _CrtMemDumpStatistics( &s3 ); } // Now turn off memory leak checking and end as there are some // Globals that are allocated that get seen as leaks (Xalan?) int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag &= ~(_CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag( dbgFlag ); #endif return 0; } xml-security-c-1.7.3/xsec/tools/xklient/xklient.cpp000644 001751 001751 00000370637 12003301052 023541 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * xklient := Act as a client for an XKMS service * * $Id: xklient.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // General #include #include #include #include #if !defined(_WIN32) # include # include #endif #if defined (_DEBUG) && defined (_MSC_VER) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE using std::cerr; using std::cout; using std::endl; using std::ostream; #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif #if defined (XSEC_HAVE_OPENSSL) // OpenSSL # include # include # include # include # include # include # include # include # include # include # include #endif // -------------------------------------------------------------------------------- // Global definitions // -------------------------------------------------------------------------------- bool g_txtOut = false; char * g_authPassPhrase = NULL; char * g_privateKeyFile = NULL; char * g_privateKeyPassPhrase = NULL; int doParsedMsgDump(DOMDocument * doc); // -------------------------------------------------------------------------------- // General functions // -------------------------------------------------------------------------------- #ifdef XSEC_NO_XALAN ostream& operator<< (ostream& target, const XMLCh * s) { char *p = XMLString::transcode(s); target << p; XSEC_RELEASE_XMLCH(p); return target; } #endif class X2C { public: X2C(const XMLCh * in) { mp_cStr = XMLString::transcode(in); } ~X2C() { XSEC_RELEASE_XMLCH(mp_cStr); } char * str(void) { return mp_cStr; } private : char * mp_cStr; }; ostream & operator<<(ostream& target, X2C &x) { target << x.str(); return target; } inline void levelSet(int level) { for (int i = 0; i < level; ++i) cout << " "; } void outputDoc(DOMDocument * doc) { XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); XMLFormatTarget *formatTarget = new StdOutFormatTarget(); cerr << endl; #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(doc, theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); theSerializer->writeNode(formatTarget, *doc); #endif cout << endl; cerr << endl; delete theSerializer; delete formatTarget; } XSECCryptoX509 * loadX509(const char * infile) { FILE * f = fopen(infile, "r"); if (f == NULL) return NULL; safeBuffer sb; char buf[1024]; int i = (int) fread(buf, 1, 1024, f); int j = 0; while (i != 0) { sb.sbMemcpyIn(j, buf, i); j += i; i = (int) fread(buf, 1, 1024, f); } sb[j] = '\0'; XSECCryptoX509 * ret = XSECPlatformUtils::g_cryptoProvider->X509(); ret->loadX509PEM(sb.rawCharBuffer()); return ret; } #if defined (XSEC_HAVE_OPENSSL) XMLCh * BN2b64(BIGNUM * bn) { int bytes = BN_num_bytes(bn); unsigned char * binbuf = new unsigned char[bytes + 1]; ArrayJanitor j_binbuf(binbuf); bytes = BN_bn2bin(bn, binbuf); int bufLen = bytes * 4; int len = bufLen; unsigned char * buf; XSECnew(buf, unsigned char[bufLen]); ArrayJanitor j_buf(buf); XSCryptCryptoBase64 *b64; XSECnew(b64, XSCryptCryptoBase64); Janitor j_b64(b64); b64->encodeInit(); bufLen = b64->encode(binbuf, bytes, buf, bufLen); bufLen += b64->encodeFinish(&buf[bufLen], len-bufLen); buf[bufLen] = '\0'; // Now translate to a bignum return XMLString::transcode((char *) buf); } #endif DSIGKeyInfoX509 * findX509Data(DSIGKeyInfoList * lst) { if (lst == NULL) return NULL; int sz = (int) lst->getSize(); for (int i = 0; i < sz; ++i) { DSIGKeyInfo *ki = lst->item(i); if (ki->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) return (DSIGKeyInfoX509*) ki; } return NULL; } // -------------------------------------------------------------------------------- // ErrorHandler // -------------------------------------------------------------------------------- class xkmsErrorHandler : public ErrorHandler { public: xkmsErrorHandler() {} ~xkmsErrorHandler() {} // Interface virtual void warning (const SAXParseException &exc); virtual void error (const SAXParseException &exc); virtual void fatalError (const SAXParseException &exc); virtual void resetErrors (); private: void outputError(const SAXParseException &exc); }; void xkmsErrorHandler::outputError(const SAXParseException &exc) { char * systemId = XMLString::transcode(exc.getSystemId()); char * msg = XMLString::transcode(exc.getMessage()); if (exc.getLineNumber() > 0 || exc.getColumnNumber() > 0) { cerr << "File: " << systemId << " Line : " << exc.getLineNumber() << " Column : " << exc.getColumnNumber() << ". " << msg << endl; } else { cerr << msg << endl; } XSEC_RELEASE_XMLCH(msg); XSEC_RELEASE_XMLCH(systemId); } void xkmsErrorHandler::warning(const SAXParseException &exc) { cerr << "Parser warning - "; outputError(exc); } void xkmsErrorHandler::error (const SAXParseException &exc) { cerr << "Parser error - "; outputError(exc); } void xkmsErrorHandler::fatalError (const SAXParseException &exc) { cerr << "Parser fatal error - "; outputError(exc); } void xkmsErrorHandler::resetErrors () { } // -------------------------------------------------------------------------------- // Create a LocateRequest // -------------------------------------------------------------------------------- void printLocateRequestUsage(void) { cerr << "\nUsage LocateRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-cert/-a : add cert in filename as a KeyInfo\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Excange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-responselimit/-l \n"; cerr << " : Set for ResponseLimit\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-rsa/-sr \n"; cerr << " : Sign using the RSA key in file protected by passphrase\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n\n"; } XKMSMessageAbstractType * createLocateRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printLocateRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSLocateRequest * lr; if (cr == NULL) lr = factory->createLocateRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else lr = cr->createLocateRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-cert") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete lr; return NULL; } XSECCryptoX509 * x = loadX509(argv[paramCount]); if (x == NULL) { delete lr; (*doc)->release(); cerr << "Error opening Certificate file : " << argv[paramCount] << endl; return NULL; } Janitor j_x(x); XKMSQueryKeyBinding * qkb = lr->getQueryKeyBinding(); if (qkb == NULL) { qkb = lr->addQueryKeyBinding(); } // See if there is already an X.509 element DSIGKeyInfoX509 * kix; if ((kix = findX509Data(qkb->getKeyInfoList())) == NULL) kix = qkb->appendX509Data(); safeBuffer sb = x->getDEREncodingSB(); kix->appendX509Certificate(sb.sbStrToXMLCh()); paramCount++; } else if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete lr; return NULL; } XKMSQueryKeyBinding * qkb = lr->addQueryKeyBinding(); qkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete lr; return NULL; } lr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSQueryKeyBinding * qkb = lr->getQueryKeyBinding(); if (qkb == NULL) qkb = lr->addQueryKeyBinding(); qkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSQueryKeyBinding * qkb = lr->getQueryKeyBinding(); if (qkb == NULL) qkb = lr->addQueryKeyBinding(); qkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSQueryKeyBinding * qkb = lr->getQueryKeyBinding(); if (qkb == NULL) qkb = lr->addQueryKeyBinding(); qkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responselimit") == 0 || _stricmp(argv[paramCount], "-l") == 0) { if (paramCount >= argc+1) { printLocateRequestUsage(); delete lr; return NULL; } paramCount++; lr->setResponseLimit(atoi(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printLocateRequestUsage(); delete lr; return NULL; } XKMSQueryKeyBinding *qkb = lr->getQueryKeyBinding(); if (qkb == NULL) qkb = lr->addQueryKeyBinding(); qkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete lr; return NULL; } lr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete lr; return NULL; } lr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printLocateRequestUsage(); delete lr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = lr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = lr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "dsa/rsa" */ #endif else { printLocateRequestUsage(); delete lr; (*doc)->release(); return NULL; } } return lr; } // -------------------------------------------------------------------------------- // Create a ValidateRequest // -------------------------------------------------------------------------------- void printValidateRequestUsage(void) { cerr << "\nUsage ValidateRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-cert/-a : add cert in filename as a KeyInfo\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Excange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-responselimit/-l \n"; cerr << " : Set for ResponseLimit\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-rsa/-sr \n"; cerr << " : Sign using the RSA key in file protected by passphrase\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n"; cerr << " --sign-cert/-sc \n"; cerr << " : Add the indicated certificate to the signature KeyInfo\n\n"; } XKMSMessageAbstractType * createValidateRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printValidateRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSValidateRequest * vr; if (cr == NULL) vr = factory->createValidateRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else vr = cr->createValidateRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-cert") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc) { printValidateRequestUsage(); delete vr; return NULL; } XSECCryptoX509 * x = loadX509(argv[paramCount]); if (x == NULL) { delete vr; (*doc)->release(); cerr << "Error opening Certificate file : " << argv[paramCount] << endl; return NULL; } Janitor j_x(x); XKMSQueryKeyBinding * qkb = vr->getQueryKeyBinding(); if (qkb == NULL) { qkb = vr->addQueryKeyBinding(); } // See if there is already an X.509 element DSIGKeyInfoX509 * kix; if ((kix = findX509Data(qkb->getKeyInfoList())) == NULL) kix = qkb->appendX509Data(); safeBuffer sb = x->getDEREncodingSB(); kix->appendX509Certificate(sb.sbStrToXMLCh()); paramCount++; } else if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printValidateRequestUsage(); delete vr; return NULL; } XKMSQueryKeyBinding * qkb = vr->addQueryKeyBinding(); qkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printValidateRequestUsage(); delete vr; return NULL; } vr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printValidateRequestUsage(); delete vr; return NULL; } vr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printLocateRequestUsage(); delete vr; return NULL; } vr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responselimit") == 0 || _stricmp(argv[paramCount], "-l") == 0) { if (paramCount >= argc+1) { printValidateRequestUsage(); delete vr; return NULL; } paramCount++; vr->setResponseLimit(atoi(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSQueryKeyBinding * qkb = vr->getQueryKeyBinding(); if (qkb == NULL) qkb = vr->addQueryKeyBinding(); qkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSQueryKeyBinding * qkb = vr->getQueryKeyBinding(); if (qkb == NULL) qkb = vr->addQueryKeyBinding(); qkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSQueryKeyBinding * qkb = vr->getQueryKeyBinding(); if (qkb == NULL) qkb = vr->addQueryKeyBinding(); qkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printValidateRequestUsage(); delete vr; return NULL; } XKMSQueryKeyBinding *qkb = vr->getQueryKeyBinding(); if (qkb == NULL) qkb = vr->addQueryKeyBinding(); qkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printValidateRequestUsage(); delete vr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = vr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = vr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "dsa/rsa" */ else if (_stricmp(argv[paramCount], "--sign-cert") == 0 || _stricmp(argv[paramCount], "-sc") == 0) { if (++paramCount >= argc) { printValidateRequestUsage(); delete vr; return NULL; } XSECCryptoX509 * x = loadX509(argv[paramCount]); if (x == NULL) { delete vr; (*doc)->release(); cerr << "Error opening Certificate file : " << argv[paramCount] << endl; return NULL; } Janitor j_x(x); DSIGSignature * sig = vr->getSignature(); if (sig == NULL) { cerr << "Can only add Certificates to signature after signing\n"; return NULL; } // See if there is already an X.509 element DSIGKeyInfoX509 * kix; if ((kix = findX509Data(sig->getKeyInfoList())) == NULL) kix = sig->appendX509Data(); safeBuffer sb = x->getDEREncodingSB(); kix->appendX509Certificate(sb.sbStrToXMLCh()); paramCount++; } #endif else { printValidateRequestUsage(); delete vr; (*doc)->release(); return NULL; } } return vr; } // -------------------------------------------------------------------------------- // Create a RegisterRequest // -------------------------------------------------------------------------------- void printRegisterRequestUsage(void) { cerr << "\nUsage RegisterRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Exchange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n"; cerr << " --add-value-dsa/-vd (and do proof-of-possession sig)\n"; cerr << " : Add the DSA key as a keyvalue\n"; cerr << " --add-value-rsa/-vr (and do proof-of-possession sig)\n"; cerr << " : Add the RSA key as a keyvalue\n"; cerr << " --revocation/-v : Set as revocation code\n"; cerr << " --kek/-k : Key phrase to use for PrivateKey decryption\n"; #if defined (XSEC_HAVE_OPENSSL) cerr << " --output-private-key/-p \n"; cerr << " : Write PEM encoded private key to file\n"; #endif cerr << " --authenticate/-a \n"; cerr << " : Use as the authentication key for the request\n"; cerr << " NOTE - This must come *after* adding of KeyInfo elements\n\n"; } XKMSMessageAbstractType * createRegisterRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { XSECCryptoKey *proofOfPossessionKey = NULL; signatureMethod proofOfPossessionSm = SIGNATURE_DSA; if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printRegisterRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSRegisterRequest * rr; if (cr == NULL) rr = factory->createRegisterRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else rr = cr->createRegisterRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } XKMSPrototypeKeyBinding * pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); pkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } rr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--kek") == 0 || _stricmp(argv[paramCount], "-k") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } g_authPassPhrase = argv[paramCount++]; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } rr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } rr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSPrototypeKeyBinding * pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); pkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSPrototypeKeyBinding * pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); pkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSPrototypeKeyBinding * pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); pkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printRegisterRequestUsage(); delete rr; return NULL; } XKMSPrototypeKeyBinding *pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); pkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--output-private-key") == 0 || _stricmp(argv[paramCount], "-p") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } ++paramCount; g_privateKeyFile = argv[paramCount++]; g_privateKeyPassPhrase = argv[paramCount++]; } #endif else if (_stricmp(argv[paramCount], "--revocation") == 0 || _stricmp(argv[paramCount], "-v") == 0) { if (++paramCount >= argc) { printRegisterRequestUsage(); delete rr; return NULL; } XKMSPrototypeKeyBinding *pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); // Create the RevocationCodeIdentifier unsigned char rciBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSRevocationCodeIdentifierEncoding2((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), rciBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cerr << "Error creating revocation code!\n"; delete rr; return NULL; } // Convert to base64 XMLCh * str = EncodeToBase64XMLCh(rciBuf, len); pkb->setRevocationCodeIdentifier(str); XSEC_RELEASE_XMLCH(str); paramCount++;; } else if (_stricmp(argv[paramCount], "--authenticate") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc + 1) { printRegisterRequestUsage(); delete rr; return NULL; } // Create the signature unsigned char keyBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSAuthenticationKey((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), keyBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cout << "Error creating key from pass phrase" << endl; delete rr; return NULL; } XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(keyBuf, len); // Set key and validate XKMSAuthentication * a = rr->addAuthentication(); DSIGSignature * sig = a->addKeyBindingAuthenticationSignature(); sig->setSigningKey(k); sig->sign(); paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "sign dsa/rsa" */ else if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0 || _stricmp(argv[paramCount], "--add-value-rsa") == 0 || _stricmp(argv[paramCount], "-vr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XKMSPrototypeKeyBinding * pkb = rr->getPrototypeKeyBinding(); if (pkb == NULL) pkb = rr->addPrototypeKeyBinding(); if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } proofOfPossessionKey = new OpenSSLCryptoKeyDSA(pkey); proofOfPossessionSm = SIGNATURE_DSA; XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); pkb->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } proofOfPossessionKey = new OpenSSLCryptoKeyRSA(pkey); proofOfPossessionSm = SIGNATURE_RSA; XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); pkb->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "value dsa/rsa" */ #endif else { printRegisterRequestUsage(); delete rr; (*doc)->release(); return NULL; } } if (proofOfPossessionKey != NULL) { // Set up the proof of possession DSIGSignature * s = rr->addProofOfPossessionSignature(CANON_C14NE_NOC, proofOfPossessionSm); s->setSigningKey(proofOfPossessionKey); s->sign(); } return rr; } // -------------------------------------------------------------------------------- // Create a RevokeRequest // -------------------------------------------------------------------------------- void printRevokeRequestUsage(void) { cerr << "\nUsage RevokeRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Exchange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n"; cerr << " --add-value-dsa/-vd \n"; cerr << " : Add the DSA key as a keyvalue\n"; cerr << " --add-value-rsa/-vr \n"; cerr << " : Add the RSA key as a keyvalue\n"; cerr << " --revocation/-v : Set as revocation code\n"; cerr << " --authenticate/-a \n"; cerr << " : Use as the authentication key for the request\n"; cerr << " NOTE - This must come *after* adding of KeyInfo elements\n\n"; } XKMSMessageAbstractType * createRevokeRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printRegisterRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSRevokeRequest * rr; if (cr == NULL) rr = factory->createRevokeRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else rr = cr->createRevokeRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printRevokeRequestUsage(); delete rr; return NULL; } XKMSRevokeKeyBinding * rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); rkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printRevokeRequestUsage(); delete rr; return NULL; } rr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printRevokeRequestUsage(); delete rr; return NULL; } rr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printRevokeRequestUsage(); delete rr; return NULL; } rr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSRevokeKeyBinding * rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); rkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSRevokeKeyBinding * rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); rkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSRevokeKeyBinding * rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); rkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printRevokeRequestUsage(); delete rr; return NULL; } XKMSRevokeKeyBinding *rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); rkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } else if (_stricmp(argv[paramCount], "--revocation") == 0 || _stricmp(argv[paramCount], "-v") == 0) { if (++paramCount >= argc) { printRevokeRequestUsage(); delete rr; return NULL; } // Create the RevocationCode value unsigned char rciBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSRevocationCodeIdentifierEncoding1((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), rciBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cerr << "Error creating revocation code!\n"; delete rr; return NULL; } // Convert to base64 XMLCh * str = EncodeToBase64XMLCh(rciBuf, len); rr->addRevocationCode(str); XSEC_RELEASE_XMLCH(str); paramCount++;; } else if (_stricmp(argv[paramCount], "--authenticate") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc + 1) { printRevokeRequestUsage(); delete rr; return NULL; } // Create the signature unsigned char keyBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSAuthenticationKey((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), keyBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cout << "Error creating key from pass phrase" << endl; delete rr; return NULL; } XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(keyBuf, len); // Set key and validate XKMSAuthentication * a = rr->addAuthentication(); DSIGSignature * sig = a->addKeyBindingAuthenticationSignature(); sig->setSigningKey(k); sig->sign(); paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "sign dsa/rsa" */ else if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0 || _stricmp(argv[paramCount], "--add-value-rsa") == 0 || _stricmp(argv[paramCount], "-vr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XKMSRevokeKeyBinding * rkb = rr->getRevokeKeyBinding(); if (rkb == NULL) rkb = rr->addRevokeKeyBinding(XKMSStatus::Indeterminate); if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); rkb->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); rkb->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "value dsa/rsa" */ #endif else { printRevokeRequestUsage(); delete rr; (*doc)->release(); return NULL; } } return rr; } // -------------------------------------------------------------------------------- // Create a ReissueRequest // -------------------------------------------------------------------------------- void printReissueRequestUsage(void) { cerr << "\nUsage ReissueRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Exchange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n"; cerr << " --add-value-dsa/-vd \n"; cerr << " : Add the DSA key as a keyvalue (and do proof-of-possession sig)\n"; cerr << " --add-value-rsa/-vr \n"; cerr << " : Add the RSA key as a keyvalue (and do proof-of-possession sig)\n"; cerr << " --authenticate/-a \n"; cerr << " : Use as the authentication key for the request\n"; cerr << " NOTE - This must come *after* adding of KeyInfo elements\n\n"; } XKMSMessageAbstractType * createReissueRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { XSECCryptoKey *proofOfPossessionKey = NULL; signatureMethod proofOfPossessionSm = SIGNATURE_DSA; if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printReissueRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSReissueRequest * rr; if (cr == NULL) rr = factory->createReissueRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else rr = cr->createReissueRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printReissueRequestUsage(); delete rr; return NULL; } XKMSReissueKeyBinding * pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); pkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printReissueRequestUsage(); delete rr; return NULL; } rr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printReissueRequestUsage(); delete rr; return NULL; } rr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printReissueRequestUsage(); delete rr; return NULL; } rr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSReissueKeyBinding * pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); pkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSReissueKeyBinding * pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); pkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSReissueKeyBinding * pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); pkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printReissueRequestUsage(); delete rr; return NULL; } XKMSReissueKeyBinding *pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); pkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } else if (_stricmp(argv[paramCount], "--authenticate") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc + 1) { printReissueRequestUsage(); delete rr; return NULL; } // Create the signature unsigned char keyBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSAuthenticationKey((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), keyBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cout << "Error creating key from pass phrase" << endl; delete rr; return NULL; } XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(keyBuf, len); // Set key and validate XKMSAuthentication * a = rr->addAuthentication(); DSIGSignature * sig = a->addKeyBindingAuthenticationSignature(); sig->setSigningKey(k); sig->sign(); paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printReissueRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "sign dsa/rsa" */ else if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0 || _stricmp(argv[paramCount], "--add-value-rsa") == 0 || _stricmp(argv[paramCount], "-vr") == 0) { if (paramCount >= argc + 2) { printReissueRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XKMSReissueKeyBinding * pkb = rr->getReissueKeyBinding(); if (pkb == NULL) pkb = rr->addReissueKeyBinding(XKMSStatus::Indeterminate); if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } proofOfPossessionKey = new OpenSSLCryptoKeyDSA(pkey); proofOfPossessionSm = SIGNATURE_DSA; XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); pkb->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } proofOfPossessionKey = new OpenSSLCryptoKeyRSA(pkey); proofOfPossessionSm = SIGNATURE_RSA; XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); pkb->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "value dsa/rsa" */ #endif else { printReissueRequestUsage(); delete rr; (*doc)->release(); return NULL; } } if (proofOfPossessionKey != NULL) { // Set up the proof of possession DSIGSignature * s = rr->addProofOfPossessionSignature(CANON_C14NE_NOC, proofOfPossessionSm); s->setSigningKey(proofOfPossessionKey); s->sign(); } return rr; } // -------------------------------------------------------------------------------- // Create a RecoverRequest // -------------------------------------------------------------------------------- void printRecoverRequestUsage(void) { cerr << "\nUsage RecoverRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; cerr << " --add-name/-n : Add name as a KeyInfoName\n"; cerr << " --add-opaque/-o : Add an opaque data string\n"; cerr << " --add-usage-sig/-us : Add Signature Key Usage\n"; cerr << " --add-usage-exc/-ux : Add Exchange Key Usage\n"; cerr << " --add-usage-enc/-ue : Add Encryption Key Usage\n"; cerr << " --add-usekeywith/-u \n"; cerr << " : Add a UseKeyWith element\n"; cerr << " --add-respondwith/-r \n"; cerr << " : Add a RespondWith element\n"; cerr << " --add-responsemechanism/-m \n"; cerr << " : Add a ResponseMechanism element\n"; cerr << " --sign-dsa/-sd \n"; cerr << " : Sign using the DSA key in file protected by passphrase\n"; cerr << " --add-value-dsa/-vd \n"; cerr << " : Add the DSA key as a keyvalue\n"; cerr << " --add-value-rsa/-vr \n"; cerr << " : Add the RSA key as a keyvalue\n"; cerr << " --kek/-k : Key phrase to use for PrivateKey decryption\n"; #if defined (XSEC_HAVE_OPENSSL) cerr << " --output-private-key/-p \n"; cerr << " : Write PEM encoded private key to file\n"; #endif cerr << " --authenticate/-a \n"; cerr << " : Use as the authentication key for the request\n"; cerr << " NOTE - This must come *after* adding of KeyInfo elements\n\n"; } XKMSMessageAbstractType * createRecoverRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int ¶mCount, XKMSCompoundRequest * cr = NULL) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printRegisterRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSRecoverRequest * rr; if (cr == NULL) rr = factory->createRecoverRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); else rr = cr->createRecoverRequest(MAKE_UNICODE_STRING(argv[paramCount++])); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--add-name") == 0 || _stricmp(argv[paramCount], "-n") == 0) { if (++paramCount >= argc) { printRecoverRequestUsage(); delete rr; return NULL; } XKMSRecoverKeyBinding * rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); rkb->appendKeyName(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-opaque") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printRecoverRequestUsage(); delete rr; return NULL; } rr->appendOpaqueClientDataItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-respondwith") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printRecoverRequestUsage(); delete rr; return NULL; } rr->appendRespondWithItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-responsemechanism") == 0 || _stricmp(argv[paramCount], "-m") == 0) { if (++paramCount >= argc) { printRecoverRequestUsage(); delete rr; return NULL; } rr->appendResponseMechanismItem(MAKE_UNICODE_STRING(argv[paramCount])); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-sig") == 0 || _stricmp(argv[paramCount], "-us") == 0) { XKMSRecoverKeyBinding * rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); rkb->setSignatureKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-exc") == 0 || _stricmp(argv[paramCount], "-ux") == 0) { XKMSRecoverKeyBinding * rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); rkb->setExchangeKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usage-enc") == 0 || _stricmp(argv[paramCount], "-ue") == 0) { XKMSRecoverKeyBinding * rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); rkb->setEncryptionKeyUsage(); paramCount++; } else if (_stricmp(argv[paramCount], "--add-usekeywith") == 0 || _stricmp(argv[paramCount], "-u") == 0) { if (++paramCount >= argc + 1) { printRecoverRequestUsage(); delete rr; return NULL; } XKMSRecoverKeyBinding *rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); rkb->appendUseKeyWithItem(MAKE_UNICODE_STRING(argv[paramCount]), MAKE_UNICODE_STRING(argv[paramCount + 1])); paramCount += 2; } else if (_stricmp(argv[paramCount], "--kek") == 0 || _stricmp(argv[paramCount], "-k") == 0) { if (++paramCount >= argc) { printRecoverRequestUsage(); delete rr; return NULL; } g_authPassPhrase = argv[paramCount++]; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--output-private-key") == 0 || _stricmp(argv[paramCount], "-p") == 0) { if (paramCount >= argc + 2) { printRecoverRequestUsage(); delete rr; return NULL; } ++paramCount; g_privateKeyFile = argv[paramCount++]; g_privateKeyPassPhrase = argv[paramCount++]; } #endif else if (_stricmp(argv[paramCount], "--authenticate") == 0 || _stricmp(argv[paramCount], "-a") == 0) { if (++paramCount >= argc + 1) { printRecoverRequestUsage(); delete rr; return NULL; } // Create the signature unsigned char keyBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSAuthenticationKey((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), keyBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cout << "Error creating key from pass phrase" << endl; delete rr; return NULL; } XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(keyBuf, len); // Set key and validate XKMSAuthentication * a = rr->addAuthentication(); DSIGSignature * sig = a->addKeyBindingAuthenticationSignature(); sig->setSigningKey(k); sig->sign(); paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0 || _stricmp(argv[paramCount], "--sign-rsa") == 0 || _stricmp(argv[paramCount], "-sr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XSECCryptoKey *key; DSIGSignature * sig; if (_stricmp(argv[paramCount], "--sign-dsa") == 0 || _stricmp(argv[paramCount], "-sd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_DSA, HASH_SHA1); // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); sig->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } sig = rr->addSignature(CANON_C14N_NOC, SIGNATURE_RSA, HASH_SHA1); key = new OpenSSLCryptoKeyRSA(pkey); XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); sig->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } sig->setSigningKey(key); sig->sign(); EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "sign dsa/rsa" */ else if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0 || _stricmp(argv[paramCount], "--add-value-rsa") == 0 || _stricmp(argv[paramCount], "-vr") == 0) { if (paramCount >= argc + 2) { printRegisterRequestUsage(); delete rr; return NULL; } // DSA or RSA OpenSSL Key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return NULL; } if (BIO_read_filename(bioKey, argv[paramCount+1]) <= 0) { cerr << "Error opening private key file : " << argv[paramCount+1] << endl; return NULL; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); return NULL; } XKMSRecoverKeyBinding * rkb = rr->getRecoverKeyBinding(); if (rkb == NULL) rkb = rr->addRecoverKeyBinding(XKMSStatus::Indeterminate); if (_stricmp(argv[paramCount], "--add-value-dsa") == 0 || _stricmp(argv[paramCount], "-vd") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; return NULL; } XMLCh * P = BN2b64(pkey->pkey.dsa->p); XMLCh * Q = BN2b64(pkey->pkey.dsa->q); XMLCh * G = BN2b64(pkey->pkey.dsa->g); XMLCh * Y = BN2b64(pkey->pkey.dsa->pub_key); rkb->appendDSAKeyValue(P,Q,G,Y); XSEC_RELEASE_XMLCH(P); XSEC_RELEASE_XMLCH(Q); XSEC_RELEASE_XMLCH(G); XSEC_RELEASE_XMLCH(Y); } else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } XMLCh * mod = BN2b64(pkey->pkey.rsa->n); XMLCh * exp = BN2b64(pkey->pkey.rsa->e); rkb->appendRSAKeyValue(mod, exp); XSEC_RELEASE_XMLCH(mod); XSEC_RELEASE_XMLCH(exp); } EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "value dsa/rsa" */ #endif else { printRecoverRequestUsage(); delete rr; (*doc)->release(); return NULL; } } return rr; } // -------------------------------------------------------------------------------- // Create a PendingRequest // -------------------------------------------------------------------------------- void printPendingRequestUsage(void) { cerr << "\nUsage PendingRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n"; cerr << " --original-request-id/-o \n"; cerr << " : Set original request ID\n"; cerr << " --response-id/-r \n"; cerr << " : Set Response ID\n\n"; } XKMSMessageAbstractType * createPendingRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int paramCount) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printPendingRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSPendingRequest * pr = factory->createPendingRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--original-request-id") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printPendingRequestUsage(); delete pr; return NULL; } pr->setOriginalRequestId(MAKE_UNICODE_STRING(argv[paramCount++])); } else if (_stricmp(argv[paramCount], "--response-id") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printPendingRequestUsage(); delete pr; return NULL; } pr->setResponseId(MAKE_UNICODE_STRING(argv[paramCount++])); } else { printPendingRequestUsage(); delete pr; return NULL; } } return pr; } // -------------------------------------------------------------------------------- // Create a StatusRequest // -------------------------------------------------------------------------------- void printStatusRequestUsage(void) { cerr << "\nUsage StatusRequest [--help|-h] [options]\n"; cerr << " --help/-h : print this screen and exit\n"; cerr << " --original-request-id/-o \n"; cerr << " : Set original request ID\n"; cerr << " --response-id/-r \n"; cerr << " : Set Response ID\n\n"; } XKMSMessageAbstractType * createStatusRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int paramCount) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printStatusRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSStatusRequest * sr = factory->createStatusRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); while (paramCount < argc && _stricmp(argv[paramCount], "--") != 0) { if (_stricmp(argv[paramCount], "--original-request-id") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (++paramCount >= argc) { printStatusRequestUsage(); delete sr; return NULL; } sr->setOriginalRequestId(MAKE_UNICODE_STRING(argv[paramCount++])); } else if (_stricmp(argv[paramCount], "--response-id") == 0 || _stricmp(argv[paramCount], "-r") == 0) { if (++paramCount >= argc) { printStatusRequestUsage(); delete sr; return NULL; } sr->setResponseId(MAKE_UNICODE_STRING(argv[paramCount++])); } else { printStatusRequestUsage(); delete sr; return NULL; } } return sr; } // -------------------------------------------------------------------------------- // Create a CompoundRequest // -------------------------------------------------------------------------------- void printCompoundRequestUsage(void) { cerr << "\nUsage CompoundRequest [--help|-h] .... [-- LocateRequest|ValidateRequest|PendingRequest]*\n"; cerr << " --help/-h : print this screen and exit\n\n"; } XKMSMessageAbstractType * createCompoundRequest(XSECProvider &prov, DOMDocument **doc, int argc, char ** argv, int paramCount) { if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printCompoundRequestUsage(); return NULL; } /* First create the basic request */ XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); XKMSCompoundRequest * cr = factory->createCompoundRequest(MAKE_UNICODE_STRING(argv[paramCount++]), doc); while (paramCount < argc) { if ((_stricmp(argv[paramCount], "LocateRequest") == 0) || (_stricmp(argv[paramCount], "lr") == 0)) { paramCount++; XKMSLocateRequest * r = (XKMSLocateRequest *) (createLocateRequest(prov, NULL, argc, argv, paramCount, cr)); if (r == NULL) { delete cr; return NULL; } } else if ((_stricmp(argv[paramCount], "ValidateRequest") == 0) || (_stricmp(argv[paramCount], "vr") == 0)) { paramCount++; XKMSValidateRequest * r = (XKMSValidateRequest *) (createValidateRequest(prov, NULL, argc, argv, paramCount, cr)); if (r == NULL) { delete cr; return NULL; } } else { printCompoundRequestUsage(); delete cr; (*doc)->release(); return NULL; } if (paramCount < argc && _stricmp(argv[paramCount], "--") == 0) paramCount++; } return cr; } // -------------------------------------------------------------------------------- // MsgDump // -------------------------------------------------------------------------------- void doMessageAbstractTypeDump(XKMSMessageAbstractType *msg, int level) { cout << endl; levelSet(level); cout << "Base message information : " << endl << endl; char * s = XMLString::transcode(msg->getId()); levelSet(level); cout << "Id = " << s << endl; XSEC_RELEASE_XMLCH(s); s = XMLString::transcode(msg->getService()); levelSet(level); cout << "Service URI = " << s << endl; XSEC_RELEASE_XMLCH(s); s = XMLString::transcode(msg->getNonce()); levelSet(level); if (s != NULL) { cout << "Nonce = " << s << endl; XSEC_RELEASE_XMLCH(s); } else cout << "Nonce = " << endl; /* Check for OpaqueClientData */ if (msg->getOpaqueClientDataSize() > 0) { levelSet(level); cout << "Opaque Client Data found : " << endl; for (int i = 0; i < msg->getOpaqueClientDataSize(); ++i) { s = XMLString::transcode(msg->getOpaqueClientDataItemStr(i)); if (s != NULL) { levelSet(level + 1); cout << i << " : " << s << endl; XSEC_RELEASE_XMLCH(s); } } } } void doRequestAbstractTypeDump(XKMSRequestAbstractType *msg, int level) { levelSet(level); int i = msg->getRespondWithSize(); cout << "Request message has " << i << " RespondWith elements" << endl << endl; for (int j = 0; j < i; ++j) { levelSet(level +1); char * s = XMLString::transcode(msg->getRespondWithItemStr(j)); cout << "Item " << j+1 << " : " << s << endl; XSEC_RELEASE_XMLCH(s); } } void doResultTypeDump(XKMSResultType *msg, int level) { const XMLCh * rid = msg->getRequestId(); char * s; if (rid != NULL) { levelSet(level); cout << "Result is in response to MsgID : "; s = XMLString::transcode(rid); cout << s << endl; XSEC_RELEASE_XMLCH(s); } levelSet(level); cout << "Result Major code = "; s = XMLString::transcode(XKMSConstants::s_tagResultMajorCodes[msg->getResultMajor()]); cout << s << endl; XSEC_RELEASE_XMLCH(s); XKMSResultType::ResultMinor rm = msg->getResultMinor(); if (rm != XKMSResultType::NoneMinor) { levelSet(level); cout << "Result Minor code = "; char * s = XMLString::transcode(XKMSConstants::s_tagResultMinorCodes[rm]); cout << s << endl; XSEC_RELEASE_XMLCH(s); } rid = msg->getRequestSignatureValue(); if (rid != NULL) { levelSet(level); cout << "RequestSignatureValue = "; s = XMLString::transcode(rid); cout << s << endl; XSEC_RELEASE_XMLCH(s); } } void doKeyInfoDump(DSIGKeyInfoList * l, int level) { int size = (int) l->getSize(); for (int i = 0 ; i < size ; ++ i) { DSIGKeyInfoValue * kiv; DSIGKeyInfoName * kn; char * b; DSIGKeyInfo * ki = l->item(i); switch (ki->getKeyInfoType()) { case DSIGKeyInfo::KEYINFO_VALUE_RSA : kiv = (DSIGKeyInfoValue *) ki; levelSet(level); cout << "RSA Key Value" << endl; levelSet(level+1); b = XMLString::transcode(kiv->getRSAExponent()); cout << "Base64 encoded exponent = " << b << endl; delete[] b; levelSet(level+1); b = XMLString::transcode(kiv->getRSAModulus()); cout << "Base64 encoded modulus = " << b << endl; delete[] b; break; case DSIGKeyInfo::KEYINFO_VALUE_DSA : kiv = (DSIGKeyInfoValue *) ki; levelSet(level); cout << "DSA Key Value" << endl; levelSet(level+1); b = XMLString::transcode(kiv->getDSAG()); cout << "G = " << b << endl; delete[] b; levelSet(level+1); b = XMLString::transcode(kiv->getDSAP()); cout << "P = " << b << endl; delete[] b; levelSet(level+1); b = XMLString::transcode(kiv->getDSAQ()); cout << "Q = " << b << endl; delete[] b; levelSet(level+1); b = XMLString::transcode(kiv->getDSAY()); cout << "Y = " << b << endl; delete[] b; break; case DSIGKeyInfo::KEYINFO_NAME : kn = (DSIGKeyInfoName *) ki; levelSet(level); cout << "Key Name" << endl; levelSet(level+1); b = XMLString::transcode(kn->getKeyName()); cout << "Name = " << b << endl; delete[] b; break; default: levelSet(level); cout << "Unknown KeyInfo type" << endl; } } } void doKeyBindingAbstractDump(XKMSKeyBindingAbstractType * msg, int level) { levelSet(level); cout << "Key Binding found." << endl; levelSet(level+1); cout << "KeyUsage Encryption : "; if (msg->getEncryptionKeyUsage()) cout << "yes" << endl; else cout << "no" << endl; levelSet(level+1); cout << "KeyUsage Exchange : "; if (msg->getExchangeKeyUsage()) cout << "yes" << endl; else cout << "no" << endl; levelSet(level+1); cout << "KeyUsage Signature : "; if (msg->getSignatureKeyUsage()) cout << "yes" << endl; else cout << "no" << endl; int n = msg->getUseKeyWithSize(); levelSet(level+1); if (n == 0) { cout << "No UseKeyWith items found" << endl; } else { cout << "UseKeyWith items : \n"; } for (int i = 0; i < msg->getUseKeyWithSize() ; ++i) { XKMSUseKeyWith * ukw = msg->getUseKeyWithItem(i); levelSet(level+2); char * a = XMLString::transcode(ukw->getApplication()); char * id = XMLString::transcode(ukw->getIdentifier()); cout << "Application : \"" << a << "\"\n"; levelSet(level+2); cout << "Identifier : \"" << id << "\"" << endl; XSEC_RELEASE_XMLCH(a); XSEC_RELEASE_XMLCH(id); } // Now dump any KeyInfo levelSet(level+1); cout << "KeyInfo information:" << endl << endl; doKeyInfoDump(msg->getKeyInfoList(), level + 2); } void doUnverifiedKeyBindingDump(XKMSUnverifiedKeyBinding * ukb, int level) { doKeyBindingAbstractDump((XKMSKeyBindingAbstractType *) ukb, level); } void doStatusReasonDump(XKMSStatus::StatusValue v, XKMSStatus *s, int level) { char * sr = XMLString::transcode(XKMSConstants::s_tagStatusValueCodes[v]); for (XKMSStatus::StatusReason i = XKMSStatus::Signature; i > XKMSStatus::ReasonUndefined; i = (XKMSStatus::StatusReason) (i-1)) { if (s->getStatusReason(v, i)) { levelSet(level); char * rc = XMLString::transcode(XKMSConstants::s_tagStatusReasonCodes[i]); cout << sr << "Reason = " << rc << endl; XSEC_RELEASE_XMLCH(rc); } } XSEC_RELEASE_XMLCH(sr); } void doKeyBindingDump(XKMSKeyBinding * kb, int level) { /* Dump the status */ XKMSStatus * s = kb->getStatus(); if (s == NULL) return; char * sr = XMLString::transcode(XKMSConstants::s_tagStatusValueCodes[s->getStatusValue()]); levelSet(level); cout << "Status = " << sr << endl; XSEC_RELEASE_XMLCH(sr); /* Dump the status reasons */ doStatusReasonDump(XKMSStatus::Valid, s, level+1); doStatusReasonDump(XKMSStatus::Invalid, s, level+1); doStatusReasonDump(XKMSStatus::Indeterminate, s, level+1); /* Now the actual key */ doKeyBindingAbstractDump((XKMSKeyBindingAbstractType *) kb, level); } void doRevokeKeyBindingDump(XKMSRevokeKeyBinding * kb, int level) { /* Dump the status */ XKMSStatus * s = kb->getStatus(); if (s == NULL) return; char * sr = XMLString::transcode(XKMSConstants::s_tagStatusValueCodes[s->getStatusValue()]); levelSet(level); cout << "Status = " << sr << endl; XSEC_RELEASE_XMLCH(sr); /* Dump the status reasons */ doStatusReasonDump(XKMSStatus::Valid, s, level+1); doStatusReasonDump(XKMSStatus::Invalid, s, level+1); doStatusReasonDump(XKMSStatus::Indeterminate, s, level+1); /* Now the actual key */ doKeyBindingAbstractDump((XKMSKeyBindingAbstractType *) kb, level); } void doRecoverKeyBindingDump(XKMSRecoverKeyBinding * kb, int level) { /* Dump the status */ XKMSStatus * s = kb->getStatus(); if (s == NULL) return; char * sr = XMLString::transcode(XKMSConstants::s_tagStatusValueCodes[s->getStatusValue()]); levelSet(level); cout << "Status = " << sr << endl; XSEC_RELEASE_XMLCH(sr); /* Dump the status reasons */ doStatusReasonDump(XKMSStatus::Valid, s, level+1); doStatusReasonDump(XKMSStatus::Invalid, s, level+1); doStatusReasonDump(XKMSStatus::Indeterminate, s, level+1); /* Now the actual key */ doKeyBindingAbstractDump((XKMSKeyBindingAbstractType *) kb, level); } void doReissueKeyBindingDump(XKMSReissueKeyBinding * kb, int level) { /* Dump the status */ XKMSStatus * s = kb->getStatus(); if (s == NULL) return; char * sr = XMLString::transcode(XKMSConstants::s_tagStatusValueCodes[s->getStatusValue()]); levelSet(level); cout << "Status = " << sr << endl; XSEC_RELEASE_XMLCH(sr); /* Dump the status reasons */ doStatusReasonDump(XKMSStatus::Valid, s, level+1); doStatusReasonDump(XKMSStatus::Invalid, s, level+1); doStatusReasonDump(XKMSStatus::Indeterminate, s, level+1); /* Now the actual key */ doKeyBindingAbstractDump((XKMSKeyBindingAbstractType *) kb, level); } void doAuthenticationDump(XKMSAuthentication *a, int level) { if (a == NULL) return; DSIGSignature * sig = a->getKeyBindingAuthenticationSignature(); if (sig != NULL) { levelSet(level); cout << "KeyBindingAuthentication Signature found. "; if (g_authPassPhrase == NULL) { cout << "Cannot check - no pass phrase set" << endl; return; } cout << "Checking.... "; // Create the key unsigned char keyBuf[XSEC_MAX_HASH_SIZE]; int len = CalculateXKMSAuthenticationKey((unsigned char *) g_authPassPhrase, (int) strlen(g_authPassPhrase), keyBuf, XSEC_MAX_HASH_SIZE); if (len <= 0) { cout << "Error creating key from pass phrase" << endl; return; } XSECCryptoKeyHMAC * k = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); k->setKey(keyBuf, len); //k->setKey((unsigned char *) g_authPassPhrase, strlen(g_authPassPhrase)); // Set key and validate sig->setSigningKey(k); if (sig->verify()) cout << "OK!" << endl; else cout << "Signature BAD!" << endl; } return; } int doLocateRequestDump(XKMSLocateRequest *msg) { cout << endl << "This is a LocateRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSQueryKeyBinding *qkb = msg->getQueryKeyBinding(); if (qkb != NULL) doKeyBindingAbstractDump(qkb, level); return 0; } int doStatusRequestDump(XKMSStatusRequest *msg) { cout << endl << "This is a StatusRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); return 0; } int doValidateRequestDump(XKMSValidateRequest *msg) { cout << endl << "This is a ValidateRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSQueryKeyBinding *qkb = msg->getQueryKeyBinding(); if (qkb != NULL) doKeyBindingAbstractDump(qkb, level); return 0; } int doLocateResultDump(XKMSLocateResult *msg) { cout << endl << "This is a LocateResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getUnverifiedKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Unverified Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doUnverifiedKeyBindingDump(msg->getUnverifiedKeyBindingItem(i), level + 1); } } return 0; } int doValidateResultDump(XKMSValidateResult *msg) { cout << endl << "This is a ValidateResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doKeyBindingDump(msg->getKeyBindingItem(i), level + 1); } } return 0; } int doRegisterResultDump(XKMSRegisterResult *msg) { cout << endl << "This is a RegisterResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doKeyBindingDump(msg->getKeyBindingItem(i), level + 1); } } // Check if there is a private key if (g_authPassPhrase) { XKMSRSAKeyPair * kp = msg->getRSAKeyPair(g_authPassPhrase); if (kp != NULL) { cout << endl; levelSet(level); cout << "RSAKeyPair found" << endl << endl; level += 1; // Translate the parameters to char strings char * sModulus = XMLString::transcode(kp->getModulus()); char * sExponent = XMLString::transcode(kp->getExponent()); char * sP = XMLString::transcode(kp->getP()); char * sQ = XMLString::transcode(kp->getQ()); char * sDP = XMLString::transcode(kp->getDP()); char * sDQ = XMLString::transcode(kp->getDQ()); char * sInverseQ = XMLString::transcode(kp->getInverseQ()); char * sD = XMLString::transcode(kp->getD()); #if defined (XSEC_HAVE_OPENSSL) if (g_privateKeyFile != NULL) { levelSet(level); cout << "Writing private key to file " << g_privateKeyFile; // Create the RSA key file RSA * rsa = RSA_new(); rsa->n = OpenSSLCryptoBase64::b642BN(sModulus, (unsigned int) strlen(sModulus)); rsa->e = OpenSSLCryptoBase64::b642BN(sExponent, (unsigned int) strlen(sExponent)); rsa->d = OpenSSLCryptoBase64::b642BN(sD, (unsigned int) strlen(sD)); rsa->p = OpenSSLCryptoBase64::b642BN(sP, (unsigned int) strlen(sP)); rsa->q = OpenSSLCryptoBase64::b642BN(sQ, (unsigned int) strlen(sQ)); rsa->dmp1 = OpenSSLCryptoBase64::b642BN(sDP, (unsigned int) strlen(sDP)); rsa->dmq1 = OpenSSLCryptoBase64::b642BN(sDQ, (unsigned int) strlen(sDQ)); rsa->iqmp = OpenSSLCryptoBase64::b642BN(sInverseQ, (unsigned int) strlen(sInverseQ)); // Write it to disk BIO *out; out = BIO_new_file(g_privateKeyFile, "w"); if(!out) cout << "Error occurred in opening file!" << endl << endl; if (!PEM_write_bio_RSAPrivateKey(out, rsa, EVP_des_ede3_cbc(), NULL, 0, 0, g_privateKeyPassPhrase)) { cout << "Error creating PEM output" << endl << endl; } BIO_free(out); RSA_free(rsa); cout << " done" << endl << endl; } #endif // Now output levelSet(level); cout << "Modulus = " << sModulus << endl; XSEC_RELEASE_XMLCH(sModulus); levelSet(level); cout << "Exponent = " << sExponent << endl; XSEC_RELEASE_XMLCH(sExponent); levelSet(level); cout << "P = " << sP << endl; XSEC_RELEASE_XMLCH(sP); levelSet(level); cout << "Q = " << sQ << endl; XSEC_RELEASE_XMLCH(sQ); levelSet(level); cout << "DP = " << sDP << endl; XSEC_RELEASE_XMLCH(sDP); levelSet(level); cout << "DQ = " << sDQ << endl; XSEC_RELEASE_XMLCH(sDQ); levelSet(level); cout << "Inverse Q = " << sInverseQ << endl; XSEC_RELEASE_XMLCH(sInverseQ); levelSet(level); cout << "D = " << sD << endl; XSEC_RELEASE_XMLCH(sD); } } else { levelSet(level); cout << "Not checking for private key as no decryption phrase set"; } return 0; } int doRecoverResultDump(XKMSRecoverResult *msg) { cout << endl << "This is a RecoverResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doKeyBindingDump(msg->getKeyBindingItem(i), level + 1); } } // Check if there is a private key if (g_authPassPhrase) { XKMSRSAKeyPair * kp = msg->getRSAKeyPair(g_authPassPhrase); if (kp != NULL) { cout << endl; levelSet(level); cout << "RSAKeyPair found" << endl << endl; level += 1; // Translate the parameters to char strings char * sModulus = XMLString::transcode(kp->getModulus()); char * sExponent = XMLString::transcode(kp->getExponent()); char * sP = XMLString::transcode(kp->getP()); char * sQ = XMLString::transcode(kp->getQ()); char * sDP = XMLString::transcode(kp->getDP()); char * sDQ = XMLString::transcode(kp->getDQ()); char * sInverseQ = XMLString::transcode(kp->getInverseQ()); char * sD = XMLString::transcode(kp->getD()); #if defined (XSEC_HAVE_OPENSSL) if (g_privateKeyFile != NULL) { levelSet(level); cout << "Writing private key to file " << g_privateKeyFile; // Create the RSA key file RSA * rsa = RSA_new(); rsa->n = OpenSSLCryptoBase64::b642BN(sModulus, (unsigned int) strlen(sModulus)); rsa->e = OpenSSLCryptoBase64::b642BN(sExponent, (unsigned int) strlen(sExponent)); rsa->d = OpenSSLCryptoBase64::b642BN(sD, (unsigned int) strlen(sD)); rsa->p = OpenSSLCryptoBase64::b642BN(sP, (unsigned int) strlen(sP)); rsa->q = OpenSSLCryptoBase64::b642BN(sQ, (unsigned int) strlen(sQ)); rsa->dmp1 = OpenSSLCryptoBase64::b642BN(sDP, (unsigned int) strlen(sDP)); rsa->dmq1 = OpenSSLCryptoBase64::b642BN(sDQ, (unsigned int) strlen(sDQ)); rsa->iqmp = OpenSSLCryptoBase64::b642BN(sInverseQ, (unsigned int) strlen(sInverseQ)); // Write it to disk BIO *out; out = BIO_new_file(g_privateKeyFile, "w"); if(!out) cout << "Error occurred in opening file!" << endl << endl; if (!PEM_write_bio_RSAPrivateKey(out, rsa, EVP_des_ede3_cbc(), NULL, 0, 0, g_privateKeyPassPhrase)) { cout << "Error creating PEM output" << endl << endl; } BIO_free(out); RSA_free(rsa); cout << " done" << endl << endl; } #endif // Now output levelSet(level); cout << "Modulus = " << sModulus << endl; XSEC_RELEASE_XMLCH(sModulus); levelSet(level); cout << "Exponent = " << sExponent << endl; XSEC_RELEASE_XMLCH(sExponent); levelSet(level); cout << "P = " << sP << endl; XSEC_RELEASE_XMLCH(sP); levelSet(level); cout << "Q = " << sQ << endl; XSEC_RELEASE_XMLCH(sQ); levelSet(level); cout << "DP = " << sDP << endl; XSEC_RELEASE_XMLCH(sDP); levelSet(level); cout << "DQ = " << sDQ << endl; XSEC_RELEASE_XMLCH(sDQ); levelSet(level); cout << "Inverse Q = " << sInverseQ << endl; XSEC_RELEASE_XMLCH(sInverseQ); levelSet(level); cout << "D = " << sD << endl; XSEC_RELEASE_XMLCH(sD); } } else { levelSet(level); cout << "Not checking for private key as no decryption phrase set"; } return 0; } int doRevokeResultDump(XKMSRevokeResult *msg) { cout << endl << "This is a RevokeResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doKeyBindingDump(msg->getKeyBindingItem(i), level + 1); } } return 0; } int doReissueResultDump(XKMSReissueResult *msg) { cout << endl << "This is a ReissueResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); int j; if ((j = msg->getKeyBindingSize()) > 0) { cout << endl; levelSet(level); cout << "Key Bindings" << endl << endl; for (int i = 0; i < j ; ++i) { doKeyBindingDump(msg->getKeyBindingItem(i), level + 1); } } return 0; } int doStatusResultDump(XKMSStatusResult *msg) { cout << endl << "This is a StatusResult Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); return 0; } int doResultDump(XKMSResult *msg) { cout << endl << "This is a Result Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doResultTypeDump(msg, level); return 0; } int doRegisterRequestDump(XKMSRegisterRequest *msg) { cout << endl << "This is a RegisterRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSPrototypeKeyBinding *pkb = msg->getPrototypeKeyBinding(); if (pkb != NULL) { const XMLCh * rci = pkb->getRevocationCodeIdentifier(); if (rci != NULL) { levelSet(1); char * sr = XMLString::transcode(rci); cout << "Revocation Code found = " << sr << endl; XSEC_RELEASE_XMLCH(sr); } doKeyBindingAbstractDump(pkb, level); } // Check authentication doAuthenticationDump(msg->getAuthentication(), level); // Check ProofOfPossession levelSet(1); DSIGSignature * sig = msg->getProofOfPossessionSignature(); if (sig != NULL) { cout << "Proof of PossessionSignature signature found. Checking.... "; // Try to find the key XSECKeyInfoResolverDefault kir; XSECCryptoKey * k = kir.resolveKey(pkb->getKeyInfoList()); if (k != NULL) { sig->setSigningKey(k); if (sig->verify()) cout << "OK!" << endl; else cout << "Signature Bad!" << endl; } else cout << "Cannot obtain key from PrototypeKeyBinding" << endl; } else { cout << "No ProofOfPossession Signature found" << endl; } return 0; } int doRevokeRequestDump(XKMSRevokeRequest *msg) { cout << endl << "This is a RevokeRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSRevokeKeyBinding *rkb = msg->getRevokeKeyBinding(); if (rkb != NULL) { doRevokeKeyBindingDump(rkb, level); } // Check authentication if (msg->getAuthentication()) doAuthenticationDump(msg->getAuthentication(), level); if (msg->getRevocationCode()) { levelSet(1); cout << "RevocationCode found = "; char * sr = XMLString::transcode(msg->getRevocationCode()); cout << sr << endl; XSEC_RELEASE_XMLCH(sr); } return 0; } int doRecoverRequestDump(XKMSRecoverRequest *msg) { cout << endl << "This is a RecoverRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSRecoverKeyBinding *rkb = msg->getRecoverKeyBinding(); if (rkb != NULL) { doRecoverKeyBindingDump(rkb, level); } // Check authentication if (msg->getAuthentication()) doAuthenticationDump(msg->getAuthentication(), level); return 0; } int doReissueRequestDump(XKMSReissueRequest *msg) { cout << endl << "This is a ReiussueRequest Message" << endl; int level = 1; doMessageAbstractTypeDump(msg, level); doRequestAbstractTypeDump(msg, level); XKMSReissueKeyBinding *rkb = msg->getReissueKeyBinding(); if (rkb != NULL) { doReissueKeyBindingDump(rkb, level); } // Check authentication doAuthenticationDump(msg->getAuthentication(), level); // Check ProofOfPossession levelSet(1); DSIGSignature * sig = msg->getProofOfPossessionSignature(); if (sig != NULL) { cout << "Proof of PossessionSignature signature found. Checking.... "; // Try to find the key XSECKeyInfoResolverDefault kir; XSECCryptoKey * k = kir.resolveKey(rkb->getKeyInfoList()); if (k != NULL) { sig->setSigningKey(k); if (sig->verify()) cout << "OK!" << endl; else cout << "Signature Bad!" << endl; } else cout << "Cannot obtain key from PrototypeKeyBinding" << endl; } else { cout << "No ProofOfPossession Signature found" << endl; } return 0; } int doMsgDump(XKMSMessageAbstractType * msg) { if (msg->isSigned()) { cout << "Message is signed. Checking signature ... "; try { XSECKeyInfoResolverDefault theKeyInfoResolver; DSIGSignature * sig = msg->getSignature(); // The only way we can verify is using keys read directly from the KeyInfo list, // so we add a KeyInfoResolverDefault to the Signature. sig->setKeyInfoResolver(&theKeyInfoResolver); if (sig->verify()) cout << "OK!" << endl; else cout << "Bad!" << endl; } catch (XSECException &e) { cout << "Bad!. Caught exception : " << endl; char * msg = XMLString::transcode(e.getMsg()); cout << msg << endl; XSEC_RELEASE_XMLCH(msg); } } int i; switch (msg->getMessageType()) { case XKMSMessageAbstractType::CompoundRequest : cout << "Compound Request\n\n"; for (i = 0 ; i < ((XKMSCompoundRequest *) (msg))->getRequestListSize(); ++i) { cout << "Message " << i << endl; doMsgDump(((XKMSCompoundRequest *) msg)->getRequestListItem(i)); } break; case XKMSMessageAbstractType::CompoundResult : cout << "Compound Result\n\n"; for (i = 0 ; i < ((XKMSCompoundResult *)(msg))->getResultListSize(); ++i) { cout << "Message " << i << endl; doMsgDump(((XKMSCompoundResult *) msg)->getResultListItem(i)); } break; case XKMSMessageAbstractType::LocateRequest : doLocateRequestDump((XKMSLocateRequest *) msg); break; case XKMSMessageAbstractType::LocateResult : doLocateResultDump((XKMSLocateResult *) msg); break; case XKMSMessageAbstractType::StatusRequest : doStatusRequestDump((XKMSStatusRequest *) msg); break; case XKMSMessageAbstractType::StatusResult : doStatusResultDump((XKMSStatusResult *) msg); break; case XKMSMessageAbstractType::Result : doResultDump((XKMSResult *) msg); break; case XKMSMessageAbstractType::ValidateRequest : doValidateRequestDump((XKMSValidateRequest *) msg); break; case XKMSMessageAbstractType::ValidateResult : doValidateResultDump((XKMSValidateResult *) msg); break; case XKMSMessageAbstractType::RegisterRequest : doRegisterRequestDump((XKMSRegisterRequest *) msg); break; case XKMSMessageAbstractType::RegisterResult : doRegisterResultDump((XKMSRegisterResult *) msg); break; case XKMSMessageAbstractType::RevokeRequest : doRevokeRequestDump((XKMSRevokeRequest *) msg); break; case XKMSMessageAbstractType::RevokeResult : doRevokeResultDump((XKMSRevokeResult *) msg); break; case XKMSMessageAbstractType::RecoverRequest : doRecoverRequestDump((XKMSRecoverRequest *) msg); break; case XKMSMessageAbstractType::RecoverResult : doRecoverResultDump((XKMSRecoverResult *) msg); break; case XKMSMessageAbstractType::ReissueRequest : doReissueRequestDump((XKMSReissueRequest *) msg); break; case XKMSMessageAbstractType::ReissueResult : doReissueResultDump((XKMSReissueResult *) msg); break; default : cout << "Unknown message type!" << endl; } return 0; } int doParsedMsgDump(DOMDocument * doc) { // Get an XKMS Message Factory XSECProvider prov; XKMSMessageFactory * factory = prov.getXKMSMessageFactory(); int errorsOccured; try { XKMSMessageAbstractType * msg = factory->newMessageFromDOM(doc->getDocumentElement()); if (msg == NULL) { cerr << "Unable to create XKMS msg from parsed DOM\n" << endl; return 2; } Janitor j_msg(msg); return doMsgDump(msg); } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occured during message loading\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; return 2; } catch (XSECCryptoException &e) { cerr << "An error occured during encryption/signature processing\n Message: " << e.getMsg() << endl; errorsOccured = true; #if defined (XSEC_HAVE_OPENSSL) ERR_load_crypto_strings(); BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); ERR_print_errors(bio_err); #endif return 2; } catch (...) { cerr << "Unknown Exception type occured. Cleaning up and exitting\n" << endl; return 2; } // Clean up return 0; } // -------------------------------------------------------------------------------- // Base MessageCreate module // -------------------------------------------------------------------------------- void printMsgCreateUsage(void) { cerr << "\nUsage messagecreate [options] {LocateRequest} [msg specific options]\n"; cerr << " --help/-h : print this screen and exit\n\n"; } int doMsgCreate(int argc, char ** argv, int paramCount) { XSECProvider prov; DOMDocument * doc; XKMSMessageAbstractType *msg; if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printMsgCreateUsage(); return -1; } if ((_stricmp(argv[paramCount], "LocateRequest") == 0) || (_stricmp(argv[paramCount], "lr") == 0)) { paramCount++; msg = createLocateRequest(prov, &doc, argc, argv, paramCount); if (msg == NULL) { return -1; } } else { printMsgCreateUsage(); return -1; } outputDoc(doc); // Cleanup message stuff delete msg; doc->release(); return 0; } // -------------------------------------------------------------------------------- // Base request module // -------------------------------------------------------------------------------- void printDoRequestUsage(void) { cerr << "\nUsage request [options] {RequestType} [msg specific options]\n"; cerr << " --help/-h : Print this screen and exit\n"; cerr << " --two-phase/-t : Indicate Two-Phase support in the request message\n"; cerr << " --nonce/-n [nonce]\n"; cerr << " : Set two phase nonce value\n"; cerr << " --original-requestid/-o [id]\n"; cerr << " : set OriginalRequestId attribute in request\n"; cerr << " --envelope-type/-e [NONE|SOAP11|SOAP12]\n"; cerr << " : Set envelope wrapper for request\n"; cerr << " NONE = No wrapper - straight HTTP request\n"; cerr << " SOAP11 = Use a SOAP 1.1 envelope\n"; cerr << " SOAP12 = Use a SOAP 1.2 envelope\n\n"; cerr << " Where RequestType = one of :\n"; cerr << " CompoundRequest (cr)\n"; cerr << " LocateRequest (lr)\n"; cerr << " ValidateRequest (vr)\n"; cerr << " PendingRequest (pr)\n"; cerr << " RegisterRequest (rr)\n"; cerr << " ReissueRequest (ir)\n"; cerr << " RecoverRequest (or)\n"; cerr << " RevokeRequest (er)\n\n"; } int doRequest(int argc, char ** argv, int paramCount) { XSECProvider prov; DOMDocument * doc; XKMSMessageAbstractType *msg = NULL; XSECSOAPRequestorSimple::envelopeType et = XSECSOAPRequestorSimple::ENVELOPE_SOAP11; bool twoPhase = false; bool parmsDone = false; char * nonce = NULL; char * originalRequestId = NULL; if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printDoRequestUsage(); return -1; } while (!parmsDone) { if ((_stricmp(argv[paramCount], "--two-phase") == 0) || (_stricmp(argv[paramCount], "-t") == 0)) { twoPhase = true; paramCount++; } else if ((_stricmp(argv[paramCount], "--nonce") == 0) || (_stricmp(argv[paramCount], "-n") == 0)) { paramCount++; if (paramCount == argc) { printDoRequestUsage(); return -1; } nonce=argv[paramCount++]; } else if ((_stricmp(argv[paramCount], "--original-requestid") == 0) || (_stricmp(argv[paramCount], "-o") == 0)) { paramCount++; if (paramCount == argc) { printDoRequestUsage(); return -1; } originalRequestId=argv[paramCount++]; } else if ((_stricmp(argv[paramCount], "--envelope") == 0) || (_stricmp(argv[paramCount], "-e") == 0)) { // Set the wrapper envelope type paramCount++; if (paramCount == argc) { printDoRequestUsage(); return -1; } if (_stricmp(argv[paramCount], "NONE") == 0) { et = XSECSOAPRequestorSimple::ENVELOPE_NONE; } else if (_stricmp(argv[paramCount], "SOAP11") == 0) { et = XSECSOAPRequestorSimple::ENVELOPE_SOAP11; } else if (_stricmp(argv[paramCount], "SOAP12") == 0) { et = XSECSOAPRequestorSimple::ENVELOPE_SOAP12; } else { printDoRequestUsage(); return -1; } paramCount++; } else if ((_stricmp(argv[paramCount], "LocateRequest") == 0) || (_stricmp(argv[paramCount], "lr") == 0)) { paramCount++; XKMSLocateRequest * r = (XKMSLocateRequest *) (createLocateRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "ValidateRequest") == 0) || (_stricmp(argv[paramCount], "vr") == 0)) { paramCount++; XKMSValidateRequest * r = (XKMSValidateRequest *) (createValidateRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "RegisterRequest") == 0) || (_stricmp(argv[paramCount], "rr") == 0)) { paramCount++; XKMSRegisterRequest * r = (XKMSRegisterRequest *) (createRegisterRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "RevokeRequest") == 0) || (_stricmp(argv[paramCount], "er") == 0)) { paramCount++; XKMSRevokeRequest * r = (XKMSRevokeRequest *) (createRevokeRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "RecoverRequest") == 0) || (_stricmp(argv[paramCount], "or") == 0)) { paramCount++; XKMSRecoverRequest * r = (XKMSRecoverRequest *) (createRecoverRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "ReissueRequest") == 0) || (_stricmp(argv[paramCount], "ir") == 0)) { paramCount++; XKMSReissueRequest * r = (XKMSReissueRequest *) (createReissueRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "PendingRequest") == 0) || (_stricmp(argv[paramCount], "pr") == 0)) { paramCount++; XKMSPendingRequest * r = (XKMSPendingRequest *) (createPendingRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "StatusRequest") == 0) || (_stricmp(argv[paramCount], "sr") == 0)) { paramCount++; XKMSStatusRequest * r = (XKMSStatusRequest *) (createStatusRequest(prov, &doc, argc, argv, paramCount)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else if ((_stricmp(argv[paramCount], "CompoundRequest") == 0) || (_stricmp(argv[paramCount], "cr") == 0)) { XKMSCompoundRequest * r = (XKMSCompoundRequest *) (createCompoundRequest(prov, &doc, argc, argv, paramCount + 1)); if (r == NULL) { return -1; } if (twoPhase) r->appendResponseMechanismItem(XKMSConstants::s_tagRepresent); msg = r; parmsDone = true; } else { printDoRequestUsage(); return -1; } } XKMSMessageFactory * f = prov.getXKMSMessageFactory(); XKMSRequestAbstractType * request = f->toRequestAbstractType(msg); if (nonce != NULL) request->setNonce(MAKE_UNICODE_STRING(nonce)); if (originalRequestId != NULL) request->setOriginalRequestId(MAKE_UNICODE_STRING(originalRequestId)); try { if (g_txtOut) { outputDoc(doc); } } catch (...) { delete msg; doc->release(); throw; } DOMDocument * responseDoc; try { XSECSOAPRequestorSimple req(msg->getService()); #if !defined(_WIN32) struct timeval tv1, tv2; gettimeofday(&tv1, NULL); #endif req.setEnvelopeType(et); responseDoc = req.doRequest(doc); #if !defined(_WIN32) gettimeofday(&tv2, NULL); long seconds = tv2.tv_sec - tv1.tv_sec; long useconds; if (seconds != 0) { useconds = 1000000 - tv1.tv_usec + tv2.tv_usec; seconds--; } else { useconds = tv2.tv_usec - tv1.tv_usec; } if (useconds >= 1000000) { useconds -= 1000000; seconds++; } cout << "Time taken for request = " << seconds << " seconds, " << useconds << " useconds" << endl; #endif /* If two-phase - re-do the request */ if (twoPhase) { XKMSResultType * r = f->toResultType(f->newMessageFromDOM(responseDoc->getDocumentElement())); if (r->getResultMajor() == XKMSResultType::Represent) { cerr << "Intermediate response of a two phase sequence received\n\n"; if (g_txtOut) { outputDoc(responseDoc); } doParsedMsgDump(responseDoc); //XKMSRequestAbstractType * request = f->toRequestAbstractType(msg); for (int k = 0; k < request->getResponseMechanismSize(); ++k) { if (strEquals(request->getResponseMechanismItemStr(k), XKMSConstants::s_tagRepresent)) { request->removeResponseMechanismItem(k); break; } } request->setNonce(r->getNonce()); request->setOriginalRequestId(request->getId()); XMLCh * myId = generateId(); request->setId(myId); XSEC_RELEASE_XMLCH(myId); responseDoc->release(); responseDoc = req.doRequest(doc); } delete r; } } catch (XSECException &e) { char * m = XMLString::transcode(e.getMsg()); cerr << "Error sending request: " << m << endl; XSEC_RELEASE_XMLCH(m); delete msg; doc->release(); return -1; } catch (...) { delete msg; doc->release(); throw; } // Cleanup request stuff delete msg; doc->release(); // Now lets process the result int ret; try { if (g_txtOut) { outputDoc(responseDoc); } ret = doParsedMsgDump(responseDoc); } catch (...) { responseDoc->release(); throw; } responseDoc->release(); return ret; } // -------------------------------------------------------------------------------- // Base msgdump module // -------------------------------------------------------------------------------- #if 0 class XMLSchemaDTDResolver : public EntityResolver { public: XMLSchemaDTDResolver() {} ~XMLSchemaDTDResolver() {} InputSource * resolveEntity (const XMLCh* const publicId, const XMLCh* const systemId); }; InputSource * XMLSchemaDTDResolver::resolveEntity (const XMLCh* const publicId, const XMLCh* const systemId) { if (strEquals(systemId, "http://www.w3.org/2001/XMLSchema")) { return new LocalFileInputSource(MAKE_UNICODE_STRING("C:\\prog\\SRC\\xml-security\\c\\Build\\Win32\\VC6\\Debug\\XMLSchema.dtd")); } else { return NULL; } } #endif void printMsgDumpUsage(void) { cerr << "\nUsage msgdump [options] \n"; cerr << " --help/-h : print this screen and exit\n"; cerr << " --validate/-v : validate the input messages\n"; cerr << " --auth-phrase/-a \n"; cerr << " : use for authentication/private key in X-KRSS messages\n"; #if defined (XSEC_HAVE_OPENSSL) cerr << " --output-private-key/-p \n"; cerr << " : Write private keys from Register or Recover requests to the file\n\n"; #endif cerr << " filename = name of file containing XKMS msg to dump\n\n"; } int doMsgDump(int argc, char ** argv, int paramCount) { char * inputFile = NULL; bool doValidate = false; if (paramCount >= argc || (_stricmp(argv[paramCount], "--help") == 0) || (_stricmp(argv[paramCount], "-h") == 0)) { printMsgDumpUsage(); return -1; } while (paramCount < argc-1) { if ((_stricmp(argv[paramCount], "--validate") == 0) || (_stricmp(argv[paramCount], "-v") == 0)) { doValidate = true; paramCount++; } else if ((_stricmp(argv[paramCount], "--auth-phrase") == 0) || (_stricmp(argv[paramCount], "-a") == 0)) { paramCount++; g_authPassPhrase = argv[paramCount]; paramCount++; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--output-private-key") == 0 || _stricmp(argv[paramCount], "-p") == 0) { if (paramCount >= argc + 2) { printMsgDumpUsage(); return -1; } ++paramCount; g_privateKeyFile = argv[paramCount++]; g_privateKeyPassPhrase = argv[paramCount++]; } #endif else { printMsgDumpUsage(); return -1; } } if (paramCount >= argc) { printMsgDumpUsage(); return -1; } inputFile = argv[paramCount]; // Dump the details of an XKMS message to the console cout << "Decoding XKMS Message contained in " << inputFile << endl; // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; Janitor j_parser(parser); parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Error handling xkmsErrorHandler xeh; parser->setErrorHandler(&xeh); #if 0 // Local load of XMLSchema.dtd XMLSchemaDTDResolver sdr; parser->setEntityResolver(&sdr); #endif // Schema handling if (doValidate) { parser->setDoSchema(true); parser->setExternalSchemaLocation("http://www.w3.org/2002/03/xkms# http://www.w3.org/TR/xkms2/Schemas/xkms.xsd"); } bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(inputFile); errorCount = parser->getErrorCount(); } catch (const XMLException& e) { char * msg = XMLString::transcode(e.getMessage()); cerr << "An error occured during parsing\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorCount > 0 || errorsOccured) { cout << "Errors during parse" << endl; return (2); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMDocument *doc = parser->getDocument(); return doParsedMsgDump(doc); } // -------------------------------------------------------------------------------- // Startup and main // -------------------------------------------------------------------------------- void printUsage(void) { cerr << "\nUsage: xklient [base options] {msgdump|msgcreate|dorequest} [command specific options]\n\n"; cerr << " msgdump : Read an XKMS message and print details\n"; cerr << " msgcreate : Create a message of type :\n"; cerr << " LocateRequest\n"; cerr << " ValidateRequest\n"; cerr << " PendingRequest\n"; cerr << " RegisterRequest\n"; cerr << " RecoverRequest\n"; cerr << " ReissueRequest\n"; cerr << " RevokeRequest\n"; cerr << " PendingRequest\n"; cerr << " send to service URI and output result\n\n"; cerr << " Where options are :\n\n"; cerr << " --text/-t\n"; cerr << " Print any created XML to screen\n"; } int evaluate(int argc, char ** argv) { if (argc < 2) { printUsage(); return 2; } int paramCount = 1; // Run through parameters while (paramCount < argc) { if (_stricmp(argv[paramCount], "--text") == 0 || _stricmp(argv[paramCount], "-t") == 0) { g_txtOut = true; paramCount++; } else if (_stricmp(argv[paramCount], "MsgDump") == 0 || _stricmp(argv[paramCount], "md") == 0) { // Perform a MsgDump operation return doMsgDump(argc, argv, paramCount +1); } else if (_stricmp(argv[paramCount], "MsgCreate") == 0 || _stricmp(argv[paramCount], "mc") == 0) { // Perform a MsgDump operation return doMsgCreate(argc, argv, paramCount +1); } else if (_stricmp(argv[paramCount], "Request") == 0 || _stricmp(argv[paramCount], "req") == 0) { // Perform a MsgDump operation return doRequest(argc, argv, paramCount +1); } else { printUsage(); return 2; } } return 1; } int main(int argc, char **argv) { int retResult; /* We output a version number to overcome a "feature" in Microsoft's memory leak detection */ cout << "XKMS Client (Using Apache XML-Security-C Library v" << XSEC_VERSION_MAJOR << "." << XSEC_VERSION_MEDIUM << "." << XSEC_VERSION_MINOR << ")\n"; #if defined (_DEBUG) && defined (_MSC_VER) // Do some memory debugging under Visual C++ _CrtMemState s1, s2, s3; // At this point we are about to start really using XSEC, so // Take a "before" checkpoing _CrtMemCheckpoint( &s1 ); #endif // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } retResult = evaluate(argc, argv); XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); #if defined (_DEBUG) && defined (_MSC_VER) _CrtMemCheckpoint( &s2 ); if ( _CrtMemDifference( &s3, &s1, &s2 ) && s3.lCounts[1] > 1) { std::cerr << "Total count = " << (unsigned int) s3.lTotalCount << endl; // Send all reports to STDOUT _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Dumpy memory stats _CrtMemDumpAllObjectsSince( &s3 ); _CrtMemDumpStatistics( &s3 ); } // Now turn off memory leak checking and end as there are some // Globals that are allocated that get seen as leaks (Xalan?) int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag &= ~(_CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag( dbgFlag ); #endif return retResult; } xml-security-c-1.7.3/xsec/tools/txfmout/txfmout.cpp000644 001751 001751 00000027554 12462600235 023634 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * txfmout:= tool to output the results of the various transforms * used when validating the attached signature. * * Author(s): Berin Lautenbach * * $Id: txfmout.cpp 1655934 2015-01-30 04:36:29Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #if defined(_WIN32) #include #else #include #endif // General #include #include #include #include #include #if defined(HAVE_UNISTD_H) # include #else # if defined(HAVE_DIRECT_H) # include # endif #endif #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE using std::ios; using std::cout; using std::cerr; using std::endl; using std::ofstream; #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif #ifdef XSEC_NO_XALAN std::ostream& operator<< (std::ostream& target, const XMLCh * s) { char *p = XMLString::transcode(s); target << p; XSEC_RELEASE_XMLCH(p); return target; } #endif // --------------------------------------------------------------------------- // Outputter // --------------------------------------------------------------------------- class outputter { public: outputter(); ~outputter(); // Set methods // Will tell not to use cout and open on this base void setFilename(const char * name); // Will append a number and re-open for each "open" call void setNewFilePerOpen(); // Re-open the file if necessary (new output) void openSection(); // Close if necessary (output section finished) void closeSection(); // Close of and finish void closeAll(); // Output a buffer void output(const unsigned char * buf, unsigned int sz); // Info int getIndex(void); private: char * m_name; // Name of the file (or base name) bool m_cout; // Are we using cout? bool m_newFilePerOpen; // Should we re-open? bool m_fileOpen; // Do we have an open file we should close? int m_counter; // The counter ofstream m_out; // Current output file }; outputter::outputter() : m_name(0), m_cout(true), m_newFilePerOpen(false), m_fileOpen(false), m_counter(0) { } outputter::~outputter() { if (m_fileOpen == true) { m_out.close(); m_fileOpen = false; } if (m_name != 0) delete[] m_name; } void outputter::setFilename(const char * name) { m_name = strdup(name); m_cout = false; } void outputter::setNewFilePerOpen() { m_newFilePerOpen = true; } void outputter::openSection() { if (m_cout == true) return; if (m_fileOpen == true && m_newFilePerOpen == false) return; if (m_out.is_open() != 0) { m_out.close(); } char * buf = new char[strlen(m_name) + 10]; strcpy(buf, m_name); if (m_newFilePerOpen == true) { char numBuf[10]; sprintf(numBuf, "%d", m_counter); //_itoa(m_counter, numBuf, 10); strcat(buf, "."); strcat(buf, numBuf); } m_out.open(buf, ios::out | ios::binary); m_fileOpen = true; delete [] buf; } void outputter::closeSection() { m_counter++; if (m_cout == false && m_newFilePerOpen == true && m_out.is_open() != 0) { m_out.close(); m_fileOpen = false; } } int outputter::getIndex(void) { return m_counter; } void outputter::closeAll() { if (m_out.is_open() != 0) m_out.close(); m_fileOpen = false; } void outputter::output(const unsigned char * buf, unsigned int sz) { if (m_cout || m_out.is_open() == false) { cout.write((const char *) buf,sz); } else { m_out.write((const char *) buf, sz); } } // --------------------------------------------------------------------------- // Main Program // --------------------------------------------------------------------------- void printUsage(void) { cerr << "\nUsage: txfmout [options] \n\n"; cerr << " Where options are :\n\n"; cerr << " --signedinfo/-s\n"; cerr << " Output canonicalised SignedInfo only\n"; cerr << " --out/-o\n"; cerr << " Output to the nominated file name\n"; cerr << " --references/-r [num]\n"; cerr << " Output only references. [num] defines a single reference to output\n"; cerr << " --newfiles/-n\n"; cerr << " Create a new file for each reference/SignedInfo (append .#)\n"; } // --------------------------------------------------------------------------- // Reference Outputter // --------------------------------------------------------------------------- void outputReferenceList (DSIGReferenceList * lst, outputter & theOutputter, int refNum) { if (lst == 0) return; DSIGReference * ref; unsigned int sz; XSECBinTXFMInputStream * is; unsigned char buf[1024]; DSIGReferenceList::size_type lstSz = (int) lst->getSize(); for (DSIGReferenceList::size_type i = 0; i < lstSz; ++i) { ref = lst->item(i); if (refNum == -1 || theOutputter.getIndex() == refNum) { theOutputter.openSection(); try { is = ref->makeBinInputStream(); } catch (NetAccessorException e) { cerr << "Network error in reference " << theOutputter.getIndex() << endl; is = 0; } if (is != 0) { sz = (unsigned int) is->readBytes(buf, 1023); while (sz != 0) { buf[sz] = '\0'; theOutputter.output(buf, sz); sz = (unsigned int) is->readBytes(buf, 1023); } delete is; } } theOutputter.closeSection(); } // Look for manifests for (DSIGReferenceList::size_type i = 0; i < lstSz; ++i) { ref = lst->item(i); if (ref->isManifest() == true) { outputReferenceList(ref->getManifestReferenceList(), theOutputter, refNum); } } } // --------------------------------------------------------------------------- // Main Program // --------------------------------------------------------------------------- int main(int argc, char **argv) { char * filename = NULL; bool signedInfo = true; bool references = true; outputter theOutputter; int refNum = -1; if (argc < 2) { printUsage(); exit (2); } // Run through parameters int paramCount = 1; while (paramCount < argc - 1) { if (_stricmp(argv[paramCount], "--signedinfo") == 0 || _stricmp(argv[paramCount], "-s") == 0) { paramCount++; references = false; } else if (_stricmp(argv[paramCount], "--out") == 0 || _stricmp(argv[paramCount], "-o") == 0) { paramCount++; theOutputter.setFilename(argv[paramCount++]); } else if (_stricmp(argv[paramCount], "--references") == 0 || _stricmp(argv[paramCount], "-r") == 0) { paramCount++; signedInfo = false; if (argv[paramCount][0] >= '0' && argv[paramCount][0] <= '9') refNum = atoi(argv[paramCount++]); } else if (_stricmp(argv[paramCount], "--newfiles") == 0 || _stricmp(argv[paramCount], "-n") == 0) { paramCount++; theOutputter.setNewFilePerOpen(); } else { printUsage(); exit(2); } } if (paramCount >= argc) { printUsage(); exit (2); } filename = argv[paramCount]; // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Now parse out file bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(filename); errorCount = parser->getErrorCount(); if (errorCount > 0) errorsOccured = true; } catch (const XMLException& e) { cerr << "An error occured during parsing\n Message: " << e.getMessage() << endl; errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorsOccured) { cout << "Errors during parse" << endl; exit (2); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMNode *doc; // The document that we parsed doc = parser->getDocument(); DOMDocument *theDOM = parser->getDocument(); // Find the signature node DOMNode *sigNode = findDSIGNode(doc, "Signature"); // Create the signature checker if (sigNode == 0) { cerr << "Could not find node in " << argv[argc-1] << endl; exit(2); } XSECProvider prov; DSIGSignature * sig = prov.newSignatureFromDOM(theDOM, sigNode); sig->registerIdAttributeName(MAKE_UNICODE_STRING("ID")); #if defined(_WIN32) XSECURIResolverGenericWin32 #else XSECURIResolverGenericUnix #endif theResolver; // Map out base path of the file #if XSEC_HAVE_GETCWD_DYN char *path = getcwd(NULL, 0); char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1); #else char path[PATH_MAX]; char baseURI[(PATH_MAX * 2) + 10]; getcwd(path, PATH_MAX); #endif strcpy(baseURI, "file:///"); strcat(baseURI, path); strcat(baseURI, "/"); strcat(baseURI, filename); // Find any ':' and "\" characters int lastSlash = 0; for (unsigned int i = 8; i < strlen(baseURI); ++i) { if (baseURI[i] == '\\') { lastSlash = i; baseURI[i] = '/'; } else if (baseURI[i] == '/') lastSlash = i; } // The last "\\" must prefix the filename baseURI[lastSlash + 1] = '\0'; theResolver.setBaseURI(MAKE_UNICODE_STRING(baseURI)); #if XSEC_HAVE_GETCWD_DYN free(path); free(baseURI); #endif sig->setURIResolver(&theResolver); try { XSECBinTXFMInputStream * is; XMLByte buf[1024]; unsigned int sz; sig->load(); if (references) { outputReferenceList(sig->getReferenceList(), theOutputter, refNum); } if (signedInfo) { is = sig->makeBinInputStream(); if (is != NULL) { theOutputter.openSection(); sz = (unsigned int) is->readBytes(buf, 1023); while (sz != 0) { buf[sz] = '\0'; theOutputter.output(buf, sz); sz = (unsigned int) is->readBytes(buf, 1023); } theOutputter.closeSection(); delete is; } } } catch (XSECException &e) { char * m = XMLString::transcode(e.getMsg()); cerr << "An error occured during signature processing\n Message: " << m << endl; XSEC_RELEASE_XMLCH(m); errorsOccured = true; exit (2); } theOutputter.closeAll(); prov.releaseSignature(sig); return 0; } xml-security-c-1.7.3/xsec/tools/templatesign/templatesign.cpp000644 001751 001751 00000114576 12462600235 025611 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * templatesign := tool to sign a template XML signature file * * Author(s): Berin Lautenbach * * $Id: templatesign.cpp 1655934 2015-01-30 04:36:29Z scantor $ * */ //XSEC includes // XSEC #include #include #include #include #include #include #include #include #if defined(_WIN32) # include #else # include #endif #if defined (XSEC_HAVE_OPENSSL) # include # include # include # include # include # include # include # include # include # include #endif #if defined(XSEC_HAVE_WINCAPI) # include # include # include # include #endif #include #include #include #include #if defined(HAVE_UNISTD_H) # include #else # if defined(HAVE_DIRECT_H) # include # endif #endif #include #include #include #include #include #include #include #include #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif using std::ostream; using std::cout; using std::cerr; using std::endl; using std::flush; // Uplift entire program into Xerces namespace XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Much code taken from the DOMPrint Xerces example // -------------------------------------------------------------------------------- static XMLFormatter* gFormatter = 0; static XMLCh* gEncodingName = 0; static XMLFormatter::UnRepFlags gUnRepFlags = XMLFormatter::UnRep_CharRef; static const XMLCh gEndElement[] = { chOpenAngle, chForwardSlash, chNull }; static const XMLCh gEndPI[] = { chQuestion, chCloseAngle, chNull}; static const XMLCh gStartPI[] = { chOpenAngle, chQuestion, chNull }; static const XMLCh gXMLDecl1[] = { chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l , chSpace, chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i , chLatin_o, chLatin_n, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl2[] = { chDoubleQuote, chSpace, chLatin_e, chLatin_n, chLatin_c , chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chEqual , chDoubleQuote, chNull }; static const XMLCh gXMLDecl3[] = { chDoubleQuote, chSpace, chLatin_s, chLatin_t, chLatin_a , chLatin_n, chLatin_d, chLatin_a, chLatin_l, chLatin_o , chLatin_n, chLatin_e, chEqual, chDoubleQuote, chNull }; static const XMLCh gXMLDecl4[] = { chDoubleQuote, chQuestion, chCloseAngle , chLF, chNull }; static const XMLCh gStartCDATA[] = { chOpenAngle, chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chOpenSquare, chNull }; static const XMLCh gEndCDATA[] = { chCloseSquare, chCloseSquare, chCloseAngle, chNull }; static const XMLCh gStartComment[] = { chOpenAngle, chBang, chDash, chDash, chNull }; static const XMLCh gEndComment[] = { chDash, chDash, chCloseAngle, chNull }; static const XMLCh gStartDoctype[] = { chOpenAngle, chBang, chLatin_D, chLatin_O, chLatin_C, chLatin_T, chLatin_Y, chLatin_P, chLatin_E, chSpace, chNull }; static const XMLCh gPublic[] = { chLatin_P, chLatin_U, chLatin_B, chLatin_L, chLatin_I, chLatin_C, chSpace, chDoubleQuote, chNull }; static const XMLCh gSystem[] = { chLatin_S, chLatin_Y, chLatin_S, chLatin_T, chLatin_E, chLatin_M, chSpace, chDoubleQuote, chNull }; static const XMLCh gStartEntity[] = { chOpenAngle, chBang, chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chLatin_Y, chSpace, chNull }; static const XMLCh gNotation[] = { chLatin_N, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chSpace, chDoubleQuote, chNull }; // --------------------------------------------------------------------------- // Local classes // --------------------------------------------------------------------------- class DOMPrintFormatTarget : public XMLFormatTarget { public: DOMPrintFormatTarget() {}; ~DOMPrintFormatTarget() {}; // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const xsecsize_t count, XMLFormatter * const formatter) { // Surprisingly, Solaris was the only platform on which // required the char* cast to print out the string correctly. // Without the cast, it was printing the pointer value in hex. // Quite annoying, considering every other platform printed // the string with the explicit cast to char* below. cout.write((char *) toWrite, (int) count); }; private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- DOMPrintFormatTarget(const DOMPrintFormatTarget& other); void operator=(const DOMPrintFormatTarget& rhs); }; // --------------------------------------------------------------------------- // ostream << DOMNode // // Stream out a DOM node, and, recursively, all of its children. This // function is the heart of writing a DOM tree out as XML source. Give it // a document node and it will do the whole thing. // --------------------------------------------------------------------------- ostream& operator<<(ostream& target, DOMNode* toWrite) { // Get the name and value out for convenience const XMLCh* nodeName = toWrite->getNodeName(); const XMLCh* nodeValue = toWrite->getNodeValue(); xsecsize_t lent = XMLString::stringLen(nodeValue); switch (toWrite->getNodeType()) { case DOMNode::TEXT_NODE: { gFormatter->formatBuf(nodeValue, lent, XMLFormatter::CharEscapes); break; } case DOMNode::PROCESSING_INSTRUCTION_NODE : { *gFormatter << XMLFormatter::NoEscapes << gStartPI << nodeName; if (lent > 0) { *gFormatter << chSpace << nodeValue; } *gFormatter << XMLFormatter::NoEscapes << gEndPI; break; } case DOMNode::DOCUMENT_NODE : { DOMNode *child = toWrite->getFirstChild(); while( child != 0) { target << child; // add linefeed in requested output encoding *gFormatter << chLF; target << flush; child = child->getNextSibling(); } break; } case DOMNode::ELEMENT_NODE : { // The name has to be representable without any escapes *gFormatter << XMLFormatter::NoEscapes << chOpenAngle << nodeName; // Output the element start tag. // Output any attributes on this element DOMNamedNodeMap *attributes = toWrite->getAttributes(); XMLSize_t attrCount = attributes->getLength(); for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode *attribute = attributes->item(i); // // Again the name has to be completely representable. But the // attribute can have refs and requires the attribute style // escaping. // *gFormatter << XMLFormatter::NoEscapes << chSpace << attribute->getNodeName() << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << attribute->getNodeValue() << XMLFormatter::NoEscapes << chDoubleQuote; } // // Test for the presence of children, which includes both // text content and nested elements. // DOMNode *child = toWrite->getFirstChild(); if (child != 0) { // There are children. Close start-tag, and output children. // No escapes are legal here *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; while( child != 0) { target << child; child = child->getNextSibling(); } // // Done with children. Output the end tag. // *gFormatter << XMLFormatter::NoEscapes << gEndElement << nodeName << chCloseAngle; } else { // // There were no children. Output the short form close of // the element start tag, making it an empty-element tag. // *gFormatter << XMLFormatter::NoEscapes << chForwardSlash << chCloseAngle; } break; } case DOMNode::ENTITY_REFERENCE_NODE: { //DOMNode *child; #if 0 for (child = toWrite.getFirstChild(); child != 0; child = child.getNextSibling()) { target << child; } #else // // Instead of printing the refernece tree // we'd output the actual text as it appeared in the xml file. // This would be the case when -e option was chosen // *gFormatter << XMLFormatter::NoEscapes << chAmpersand << nodeName << chSemiColon; #endif break; } case DOMNode::CDATA_SECTION_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartCDATA << nodeValue << gEndCDATA; break; } case DOMNode::COMMENT_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartComment << nodeValue << gEndComment; break; } case DOMNode::DOCUMENT_TYPE_NODE: { DOMDocumentType *doctype = (DOMDocumentType *)toWrite;; *gFormatter << XMLFormatter::NoEscapes << gStartDoctype << nodeName; const XMLCh* id = doctype->getPublicId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gPublic << id << chDoubleQuote; id = doctype->getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << chDoubleQuote << id << chDoubleQuote; } } else { id = doctype->getSystemId(); if (id != 0) { *gFormatter << XMLFormatter::NoEscapes << chSpace << gSystem << id << chDoubleQuote; } } id = doctype->getInternalSubset(); if (id !=0) *gFormatter << XMLFormatter::NoEscapes << chOpenSquare << id << chCloseSquare; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle; break; } case DOMNode::ENTITY_NODE: { *gFormatter << XMLFormatter::NoEscapes << gStartEntity << nodeName; const XMLCh * id = ((DOMEntity *)toWrite)->getPublicId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gPublic << id << chDoubleQuote; id = ((DOMEntity *)toWrite)->getSystemId(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gSystem << id << chDoubleQuote; id = ((DOMEntity *)toWrite)->getNotationName(); if (id != 0) *gFormatter << XMLFormatter::NoEscapes << gNotation << id << chDoubleQuote; *gFormatter << XMLFormatter::NoEscapes << chCloseAngle << chLF; break; } /* case DOMNode::NOTATION_NODE: { const XMLCh * str; *gFormatter << gXMLDecl1 << ((DOMXMLDecl *)toWrite)->getVersion(); *gFormatter << gXMLDecl2 << gEncodingName; str = ((DOMXMLDecl *)toWrite)->getStandalone(); if (str != 0) *gFormatter << gXMLDecl3 << str; *gFormatter << gXMLDecl4; break; } */ default: cerr << "Unrecognized node type = " << (long)toWrite->getNodeType() << endl; } return target; } // -------------------------------------------------------------------------------- // End of outputter // -------------------------------------------------------------------------------- class DOMMemFormatTarget : public XMLFormatTarget { public: unsigned char * buffer; // Buffer to write to DOMMemFormatTarget() {}; ~DOMMemFormatTarget() {}; void setBuffer (unsigned char * toSet) {buffer = toSet;}; // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- void writeChars(const XMLByte* const toWrite, const unsigned int count, XMLFormatter * const formatter) { // Surprisingly, Solaris was the only platform on which // required the char* cast to print out the string correctly. // Without the cast, it was printing the pointer value in hex. // Quite annoying, considering every other platform printed // the string with the explicit cast to char* below. memcpy(buffer, (char *) toWrite, (int) count); buffer[count] = '\0'; }; private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- DOMMemFormatTarget(const DOMMemFormatTarget& other); void operator=(const DOMMemFormatTarget& rhs); }; // --------------------------------------------------------------------------- // ostream << DOMString // // Stream out a DOM string. Doing this requires that we first transcode // to char * form in the default code page for the system // --------------------------------------------------------------------------- DOMPrintFormatTarget *DOMtarget; DOMMemFormatTarget *MEMtarget; XMLFormatter *formatter, *MEMformatter; unsigned char *charBuffer; void printUsage(void) { cerr << "\nUsage: templatesign \n\n"; #if defined (XSEC_HAVE_OPENSSL) cerr << " Where are one of :\n\n"; cerr << " --x509subjectname/-s \n"; cerr << " will be set as SubjectName in x509\n"; cerr << " --dsakey/-d \n"; cerr << " contains a PEM encoded private key\n"; cerr << " is the password used to decrypt the key file\n"; # if defined (XSEC_HAVE_WINCAPI) cerr << " NOTE: Not usable if --wincapi previously set\n"; # endif # if defined(XSEC_OPENSSL_HAVE_EC) cerr << " --eckey/-e \n"; cerr << " contains a PEM encoded private key\n"; cerr << " is the password used to decrypt the key file\n"; # endif # if defined (XSEC_HAVE_WINCAPI) cerr << " NOTE: Not usable if --wincapi previously set\n"; # endif cerr << " --rsakey/-r \n"; cerr << " contains a PEM encoded private key\n"; cerr << " is the password used to decrypt the key file\n"; cerr << " --x509cert/-x \n"; cerr << " contains a PEM certificate to be added as a KeyInfo\n"; #endif cerr << " --hmackey/-h \n"; cerr << " is the hmac key to set\n"; cerr << " --clearkeys/-c\n"; cerr << " Clears out any current KeyInfo elements in the file\n"; #if defined(XSEC_HAVE_WINCAPI) cerr << " --windss/-wd\n"; cerr << " Use the default user AT_SIGNATURE key from default\n"; cerr << " Windows DSS CSP\n"; cerr << " --winrsa/-wr\n"; cerr << " Use the default user AT_SIGNATURE key from default\n"; cerr << " Windows RSA CSP\n"; cerr << " --winhmac/-wh \n"; cerr << " Create a windows HMAC key using as the password.\n"; cerr << " Uses a SHA-1 hash of the password to derive a key\n"; #if defined (CRYPT_ACQUIRE_CACHE_FLAG) cerr << " --wincer/-wc \n"; cerr << " Use the private key associated with the named certificate in the Windows certificate store\n"; #endif /* CRYPT_ACQUIRE_CACHE_FLAG */ cerr << " --windsskeyinfo/-wdi\n"; cerr << " Clear KeyInfo elements and insert DSS parameters from windows key\n"; cerr << " --winrsakeyinfo/-wri\n"; cerr << " Clear KeyInfo elements and insert RSA parameters from windows key\n"; #endif } int main(int argc, char **argv) { XSECCryptoKey * key = NULL; DSIGKeyInfoX509 * keyInfoX509 = NULL; const char * x509SubjectName = NULL; #if defined (XSEC_HAVE_OPENSSL) OpenSSLCryptoX509 * certs[128]; #endif int certCount = 0; int paramCount; bool clearKeyInfo = false; #if defined(XSEC_HAVE_WINCAPI) HCRYPTPROV win32DSSCSP = 0; // Crypto Provider HCRYPTPROV win32RSACSP = 0; // Crypto Provider bool winDssKeyInfo = false; bool winRsaKeyInfo = false; WinCAPICryptoKeyDSA * winKeyDSA = NULL; WinCAPICryptoKeyRSA * winKeyRSA = NULL; #endif // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } #if defined (XSEC_HAVE_OPENSSL) // Initialise OpenSSL ERR_load_crypto_strings(); BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); #endif if (argc < 2) { printUsage(); exit (1); } paramCount = 1; while (paramCount < argc - 1) { // Run through all parameters if (_stricmp(argv[paramCount], "--x509subjectname") == 0 || _stricmp(argv[paramCount], "-s") == 0) { if (paramCount +2 >= argc) { printUsage(); exit(1); } // Get the subject name x509SubjectName = argv[paramCount + 1]; paramCount += 2; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--dsakey") == 0 || _stricmp(argv[paramCount], "-d") == 0 || _stricmp(argv[paramCount], "--rsakey") == 0 || _stricmp(argv[paramCount], "-r") == 0 # if defined(XSEC_OPENSSL_HAVE_EC) || _stricmp(argv[paramCount], "--eckey") == 0 || _stricmp(argv[paramCount], "-e") == 0 # endif ) { // OpenSSL Key if (paramCount + 3 >= argc) { printUsage(); exit (1); } if (key != 0) { cerr << "\nError loading private key - another key already loaded\n\n"; printUsage(); exit(1); } // Load the signing key // For now just read a particular file BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; exit (1); } if (BIO_read_filename(bioKey, argv[paramCount + 1]) <= 0) { cerr << "Error opening private key file\n\n"; exit (1); } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { cerr << "Error loading private key\n\n"; ERR_print_errors(bio_err); exit (1); } if (_stricmp(argv[paramCount], "--dsakey") == 0 || _stricmp(argv[paramCount], "-d") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_DSA) { cerr << "DSA Key requested, but OpenSSL loaded something else\n"; exit (1); } // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyDSA(pkey); } # if defined(XSEC_OPENSSL_HAVE_EC) else if (_stricmp(argv[paramCount], "--eckey") == 0 || _stricmp(argv[paramCount], "-e") == 0) { // Check type is correct if (pkey->type != EVP_PKEY_EC) { cerr << "EC Key requested, but OpenSSL loaded something else\n"; exit (1); } // Create the XSEC OpenSSL interface key = new OpenSSLCryptoKeyEC(pkey); } # endif else { if (pkey->type != EVP_PKEY_RSA) { cerr << "RSA Key requested, but OpenSSL loaded something else\n"; exit (1); } key = new OpenSSLCryptoKeyRSA(pkey); } EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } /* argv[1] = "dsa/rsa/ec" */ else if (_stricmp(argv[paramCount], "--x509cert") == 0 || _stricmp(argv[paramCount], "-x") == 0) { // X509Data keyInfo if (paramCount + 2 >= argc) { printUsage(); exit (1); } // Load the cert. // For now just read a particular file BIO * bioX509; if ((bioX509 = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening file\n\n"; exit (1); } if (BIO_read_filename(bioX509, argv[paramCount + 1]) <= 0) { cerr << "Error opening X509 Certificate " << argv[paramCount + 1] << "\n\n"; exit (1); } X509 * x ; x = PEM_read_bio_X509_AUX(bioX509,NULL,NULL,NULL); if (x == NULL) { cerr << "Error loading certificate\n\n"; ERR_print_errors(bio_err); exit (1); } // Create the XSEC OpenSSL interface - used only to translate to Base64 certs[certCount++] = new OpenSSLCryptoX509(x); X509_free(x); BIO_free(bioX509); paramCount += 2; } /* argv[1] = "--x509cert" */ else #endif if (_stricmp(argv[paramCount], "--hmackey") == 0 || _stricmp(argv[paramCount], "-h") == 0) { #if defined (XSEC_HAVE_OPENSSL) OpenSSLCryptoKeyHMAC * hmacKey = new OpenSSLCryptoKeyHMAC(); #else # if defined (XSEC_HAVE_WINCAPI) WinCAPICryptoKeyHMAC * hmacKey = new WinCAPICryptoKeyHMAC(0); # endif #endif hmacKey->setKey((unsigned char *) argv[paramCount + 1], (unsigned int) strlen(argv[paramCount + 1])); key = hmacKey; paramCount += 2; } else if (_stricmp(argv[paramCount], "--clearkeys") == 0 || _stricmp(argv[paramCount], "-c") == 0) { clearKeyInfo = true; paramCount += 1; } #if defined (XSEC_HAVE_WINCAPI) else if (_stricmp(argv[paramCount], "--windss") == 0 || _stricmp(argv[paramCount], "-wd") == 0) { WinCAPICryptoProvider * cp; // First set windows as the crypto provider cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); // Now set the key if (!CryptAcquireContext(&win32DSSCSP, NULL, NULL, PROV_DSS, 0)) { cerr << "Error acquiring Crypto context - Attempting to generate new key pair" << endl; // Attempt to gen a new keyset if (!CryptAcquireContext(&win32DSSCSP, NULL, NULL, PROV_DSS, CRYPT_NEWKEYSET)) { cerr << "Error acquiring DSS Crypto Service Provider with new keyset" << endl; return 2; } else { HCRYPTKEY k; if (!CryptGenKey(win32DSSCSP, AT_SIGNATURE, CRYPT_EXPORTABLE, &k)) { cerr << "Error generating DSS keyset" << endl; return 2; } CryptDestroyKey(k); } } winKeyDSA = new WinCAPICryptoKeyDSA(win32DSSCSP, AT_SIGNATURE, true); key = winKeyDSA; paramCount++; } else if (_stricmp(argv[paramCount], "--winrsa") == 0 || _stricmp(argv[paramCount], "-wr") == 0) { WinCAPICryptoProvider * cp; cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); if (!CryptAcquireContext(&win32RSACSP, NULL, NULL, PROV_RSA_FULL, 0)) { cerr << "Error acquiring Crypto context - Attempting to generate new RSA key pair" << endl; // Attempt to gen a new keyset if (!CryptAcquireContext(&win32RSACSP, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) { cerr << "Error acquiring RSA Crypto Service Provider with new keyset" << endl; return 2; } else { HCRYPTKEY k; if (!CryptGenKey(win32RSACSP, AT_SIGNATURE, CRYPT_EXPORTABLE, &k)) { cerr << "Error generating RSA keyset" << endl; return 2; } CryptDestroyKey(k); } } winKeyRSA = new WinCAPICryptoKeyRSA(win32RSACSP, AT_SIGNATURE, true); key = winKeyRSA; paramCount++; } else if (_stricmp(argv[paramCount], "--winhmac") == 0 || _stricmp(argv[paramCount], "-wh") == 0) { WinCAPICryptoProvider * cp; // Obtain default PROV_RSA, with default user key container // Note we open in VERIFYCONTEXT as we do not require a assymetric key pair if (!CryptAcquireContext(&win32RSACSP, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { cerr << "Error acquiring RSA Crypto Service Provider" << endl; return 2; } cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); paramCount++; HCRYPTKEY k; HCRYPTHASH h; BOOL fResult = CryptCreateHash( win32RSACSP, CALG_SHA, 0, 0, &h); if (fResult == 0) { cerr << "Error creating hash to create windows hmac key from password" << endl; return 2; } fResult = CryptHashData( h, (unsigned char *) argv[paramCount], (DWORD) strlen(argv[paramCount]), 0); if (fResult == 0) { cerr << "Error hashing password to create windows hmac key" << endl; return 2; } // Now create a key fResult = CryptDeriveKey( win32RSACSP, CALG_RC2, h, CRYPT_EXPORTABLE, &k); if (fResult == 0) { cerr << "Error deriving key from hash value" << endl; return 2; } // Wrap in a WinCAPI object WinCAPICryptoKeyHMAC * hk; hk = new WinCAPICryptoKeyHMAC(win32RSACSP); hk->setWinKey(k); key = hk; CryptDestroyHash(h); paramCount++; } else if (_stricmp(argv[paramCount], "--windsskeyinfo") == 0 || _stricmp(argv[paramCount], "-wdi") == 0) { winDssKeyInfo = true; paramCount++; } else if (_stricmp(argv[paramCount], "--winrsakeyinfo") == 0 || _stricmp(argv[paramCount], "-wri") == 0) { winRsaKeyInfo = true; paramCount++; } // Need to find a better way to check this // If CryptAcquireCertificatePrivateKey is not defined in the included // version of wincapi.h, CRYPT_ACQUIRE_CACHE_FLAG will not be set #if defined (CRYPT_ACQUIRE_CACHE_FLAG) // Code provided by Milan Tomic //Please note that this example below use CryptAcquireCertificatePrivateKey() function //which is not declared in wincrypt.h that ships with VC++ 6. If you would like to run //this example you'll need to replace your old wincrypt.h and crypt32.lib with new versions. //This example below is compatible with Windows 98/IE 5 and above OS/IE versions. else if (_stricmp(argv[paramCount], "--wincer") == 0 || _stricmp(argv[paramCount], "-wc") == 0) { WinCAPICryptoProvider * cp; PCCERT_CONTEXT pSignerCert = NULL; DWORD dwKeySpec; HCERTSTORE hStoreHandle; #define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING) // Obtain default PROV_DSS with default user key container if (!CryptAcquireContext(&win32DSSCSP, NULL, NULL, PROV_DSS, 0)) { cerr << "Error acquiring DSS Crypto Service Provider" << endl; return 2; }//*/ // Open 'Personal' certificate store if (!(hStoreHandle = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL, CERT_SYSTEM_STORE_CURRENT_USER, L"MY"))) { cerr << "Error opening 'Personal' store." << endl; return 2; } // Find desired cerificate if (!(pSignerCert = CertFindCertificateInStore(hStoreHandle, MY_ENCODING_TYPE, 0, CERT_FIND_SUBJECT_STR_A, argv[paramCount+1], NULL))) { cerr << "Can't find '" << argv[paramCount+1] << "' certificate in 'Personal' store." << endl; return 2; } // Now get certificate's private key if (!CryptAcquireCertificatePrivateKey(pSignerCert, 0, NULL, &win32RSACSP, &dwKeySpec, NULL)) { cerr << "Can't acquire private key of '" << argv[paramCount+1] << "' certificate." << endl; exit(1); } cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); HCRYPTKEY k; BOOL fResult = CryptGetUserKey( win32RSACSP, dwKeySpec, &k); if (!fResult || k == 0) { cerr << "Error obtaining default user (AT_SIGNATURE or AT_KEYEXCHANGE) key from windows RSA provider.\n"; exit(1); }; winKeyRSA = new WinCAPICryptoKeyRSA(win32RSACSP, k); key = winKeyRSA; paramCount += 2; CertFreeCertificateContext(pSignerCert); CertCloseStore(hStoreHandle, 0); } #endif /* CRYPT_ACQUIRE_CACHE_FLAG */ #endif /* XSEC_HAVE_WINCAPI */ else { printUsage(); exit(1); } } // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Now parse out file bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(argv[argc - 1]); errorCount = parser->getErrorCount(); if (errorCount > 0) errorsOccured = true; } catch (const XMLException& e) { cerr << "An error occured during parsing\n Message: " << e.getMessage() << endl; errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorsOccured) { cout << "Errors during parse" << endl; exit (1); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMNode *doc; // The document that we parsed doc = parser->getDocument(); DOMDocument *theDOM = parser->getDocument(); // Find the signature node DOMNode *sigNode = findDSIGNode(doc, "Signature"); // Create the signature checker if (sigNode == 0) { cerr << "Could not find node in " << argv[argc-1] << endl; exit(1); } XSECProvider * prov = new XSECProvider; DSIGSignature * sig = prov->newSignatureFromDOM(theDOM, sigNode); // Use the internal URI resolver #if defined(_WIN32) XSECURIResolverGenericWin32* theResolver = new XSECURIResolverGenericWin32(); #else XSECURIResolverGenericUnix* theResolver = new XSECURIResolverGenericUnix(); #endif // Map out base path of the file char * filename=argv[argc-1]; #if XSEC_HAVE_GETCWD_DYN char *path = getcwd(NULL, 0); char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1); #else char path[PATH_MAX]; char baseURI[(PATH_MAX * 2) + 10]; getcwd(path, PATH_MAX); #endif strcpy(baseURI, "file:///"); // Ugly and nasty but quick if (filename[0] != '\\' && filename[0] != '/' && filename[1] != ':') { strcat(baseURI, path); strcat(baseURI, "/"); } else if (path[1] == ':') { path[2] = '\0'; strcat(baseURI, path); } strcat(baseURI, filename); // Find any ':' and "\" characters int lastSlash = 0; for (unsigned int i = 8; i < strlen(baseURI); ++i) { if (baseURI[i] == '\\') { lastSlash = i; baseURI[i] = '/'; } else if (baseURI[i] == '/') lastSlash = i; } // The last "\\" must prefix the filename baseURI[lastSlash + 1] = '\0'; theResolver->setBaseURI(MAKE_UNICODE_STRING(baseURI)); sig->setURIResolver(theResolver); #if XSEC_HAVE_GETCWD_DYN free(path); free(baseURI); #endif try { sig->load(); if (clearKeyInfo == true) sig->clearKeyInfo(); if (key != NULL) sig->setSigningKey(key); sig->sign(); // Add any KeyInfo elements #if defined(XSEC_HAVE_WINCAPI) if (winDssKeyInfo == true && winKeyDSA != NULL) { char pBuf[1024]; char qBuf[1024]; char gBuf[1024]; char yBuf[1024]; unsigned int i; i = winKeyDSA->getPBase64BigNums((char *) pBuf, 1024); pBuf[i] = '\0'; i = winKeyDSA->getQBase64BigNums((char *) qBuf, 1024); qBuf[i] = '\0'; i = winKeyDSA->getGBase64BigNums((char *) gBuf, 1024); gBuf[i] = '\0'; i = winKeyDSA->getYBase64BigNums((char *) yBuf, 1024); yBuf[i] = '\0'; sig->clearKeyInfo(); sig->appendDSAKeyValue( MAKE_UNICODE_STRING(pBuf), MAKE_UNICODE_STRING(qBuf), MAKE_UNICODE_STRING(gBuf), MAKE_UNICODE_STRING(yBuf)); } if (winRsaKeyInfo == true && winKeyRSA != NULL) { char eBuf[1024]; char mBuf[1024]; unsigned int i; i = winKeyRSA->getExponentBase64BigNums((char *) eBuf, 1024); eBuf[i] = '\0'; i = winKeyRSA->getModulusBase64BigNums((char *) mBuf, 1024); mBuf[i] = '\0'; sig->clearKeyInfo(); sig->appendRSAKeyValue( MAKE_UNICODE_STRING(mBuf), MAKE_UNICODE_STRING(eBuf)); } #endif #if defined (XSEC_HAVE_OPENSSL) if (certCount > 0) { int i; // Have some certificates - see if there is already an X509 list DSIGKeyInfoList * kiList = sig->getKeyInfoList(); int kiSize = (int) kiList->getSize(); for (i = 0; i < kiSize; ++i) { if (kiList->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { keyInfoX509 = (DSIGKeyInfoX509 *) kiList->item(i); break; } } if (keyInfoX509 == 0) { // Not found - need to create keyInfoX509 = sig->appendX509Data(); } for (i = 0; i < certCount; ++i) { keyInfoX509->appendX509Certificate(certs[i]->getDEREncodingSB().sbStrToXMLCh()); } } /* certCount > 0 */ #endif if (x509SubjectName != NULL) { int i; // Have some certificates - see if there is already an X509 list DSIGKeyInfoList * kiList = sig->getKeyInfoList(); int kiSize = (int) kiList->getSize(); for (i = 0; i < kiSize; ++i) { if (kiList->item(i)->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { keyInfoX509 = (DSIGKeyInfoX509 *) kiList->item(i); break; } } if (keyInfoX509 == 0) { // Not found - need to create keyInfoX509 = sig->appendX509Data(); } keyInfoX509->setX509SubjectName(MAKE_UNICODE_STRING(x509SubjectName)); } /* certCount > 0 */ } catch (XSECException &e) { char * m = XMLString::transcode(e.getMsg()); cerr << "An error occured during signing operation\n Message: " << m << endl; XSEC_RELEASE_XMLCH(m); errorsOccured = true; exit (1); } catch (XSECCryptoException &e) { cerr << "A cryptographic error occured during signature operation\n Message: " << e.getMsg() << endl; errorsOccured = true; exit(1); } catch (NetAccessorException) { cerr << "A network error occurred during signing operation\n" << endl; errorsOccured = true; exit(1); } // Print out the result DOMPrintFormatTarget* formatTarget = new DOMPrintFormatTarget(); const XMLCh* encNameStr = XMLString::transcode("UTF-8"); DOMNode *aNode = doc->getFirstChild(); if (aNode->getNodeType() == DOMNode::ENTITY_NODE) { const XMLCh* aStr = #if defined XSEC_XERCES_DOMENTITYINPUTENCODING ((DOMEntity *)aNode)->getInputEncoding(); #else ((DOMEntity *)aNode)->getEncoding(); #endif if (!strEquals(aStr, "")) { encNameStr = aStr; } } xsecsize_t lent = XMLString::stringLen(encNameStr); gEncodingName = new XMLCh[lent + 1]; XMLString::copyNString(gEncodingName, encNameStr, lent); gEncodingName[lent] = 0; #if defined(XSEC_XERCES_FORMATTER_REQUIRES_VERSION) gFormatter = new XMLFormatter("UTF-8", 0, formatTarget, XMLFormatter::NoEscapes, gUnRepFlags); #else gFormatter = new XMLFormatter("UTF-8", formatTarget, XMLFormatter::NoEscapes, gUnRepFlags); #endif cout << doc; delete [] gEncodingName; XMLCh * toRelease = (XMLCh *) encNameStr; XSEC_RELEASE_XMLCH(toRelease); delete gFormatter; delete formatTarget; #if defined (_WIN32) && defined (XSEC_HAVE_WINCAPI) if (win32DSSCSP != 0) CryptReleaseContext(win32DSSCSP,0); if (win32RSACSP != 0) CryptReleaseContext(win32RSACSP,0); #endif prov->releaseSignature(sig); delete parser; delete prov; delete theResolver; XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); return 0; } xml-security-c-1.7.3/xsec/tools/siginf/siginf.cpp000644 001751 001751 00000031447 12003301052 023134 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * siginf := Output information about a signature found in an XML file * * Author(s): Berin Lautenbach * * $Id: siginf.cpp 1354660 2012-06-27 18:40:57Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // General #include #include #include #include #if defined (_DEBUG) && defined (_MSC_VER) #include #endif #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE using std::cerr; using std::cout; using std::endl; using std::ostream; #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif #ifdef XSEC_NO_XALAN ostream& operator<< (ostream& target, const XMLCh * s) { char *p = XMLString::transcode(s); target << p; XSEC_RELEASE_XMLCH(p); return target; } #endif class X2C { public: X2C(const XMLCh * in) { mp_cStr = XMLString::transcode(in); } ~X2C() { XSEC_RELEASE_XMLCH(mp_cStr); } char * str(void) { return mp_cStr; } private : char * mp_cStr; }; ostream & operator<<(ostream& target, X2C &x) { target << x.str(); return target; } inline void levelSet(int level) { for (int i = 0; i < level; ++i) cout << " "; } void outputTransform(DSIGTransform * t, int level) { switch (t->getTransformType()) { case (TRANSFORM_BASE64) : cout << "Base64 Decode" << endl; return; case (TRANSFORM_C14N) : cout << "c14n 1.0 canonicalisation "; if (((DSIGTransformC14n *) t)->getCanonicalizationMethod() == CANON_C14N_NOC) cout << "(without comments)" << endl; else cout << "(with comments)" << endl; return; case (TRANSFORM_C14N11) : cout << "c14n 1.1 canonicalisation "; if (((DSIGTransformC14n *) t)->getCanonicalizationMethod() == CANON_C14N11_NOC) cout << "(without comments)" << endl; else cout << "(with comments)" << endl; return; case (TRANSFORM_EXC_C14N) : cout << "Exclusive c14n 1.0 canonicalisation "; if (((DSIGTransformC14n *) t)->getCanonicalizationMethod() == CANON_C14NE_NOC) cout << "(without comments)" << endl; else cout << "(with comments)" << endl; // Check for inclusive namespaces if (((DSIGTransformC14n *) t)->getPrefixList() != NULL) { levelSet(level); cout << "Inclusive prefixes : " << X2C(((DSIGTransformC14n *) t)->getPrefixList()).str() << endl; } return; case (TRANSFORM_ENVELOPED_SIGNATURE) : cout << "enveloped signature" << endl; return; case (TRANSFORM_XPATH) : { DSIGTransformXPath * xp = (DSIGTransformXPath *) t; cout << "XPath" << endl; // Check for namespaces DOMNamedNodeMap * atts = xp->getNamespaces(); if (atts != 0) { XMLSize_t s = atts->getLength(); for (XMLSize_t i = 0 ; i < s; ++i) { levelSet(level); cout << "Namespace : " << X2C(atts->item(i)->getNodeName()).str() << "=\"" << X2C(atts->item(i)->getNodeValue()).str() << "\"\n"; } } levelSet(level); // Hmm - this is really a bug. This should return a XMLCh string cout << "Expr : " << xp->getExpression() << endl; return; } case (TRANSFORM_XPATH_FILTER) : { DSIGTransformXPathFilter * xpf = (DSIGTransformXPathFilter *) t; cout << "XPath-Filter2" << endl; unsigned int s = xpf->getExprNum(); for (unsigned int i = 0; i < s; ++i) { levelSet(level); cout << "Filter : "; DSIGXPathFilterExpr * e = xpf->expr(i); switch (e->getFilterType()) { case FILTER_UNION : cout << "union : \""; break; case FILTER_INTERSECT : cout << "intersect : \""; break; default : cout << "subtract : \""; } // Now the expression char * str = XMLString::transcode(e->getFilter()); cout << str << "\"" << endl; XSEC_RELEASE_XMLCH(str); } break; } case (TRANSFORM_XSLT) : { cout << "XSLT" << endl; // Really should serialise and output stylesheet. return; } default : cout << "unknown transform type" << endl; } } void outputReferences(DSIGReferenceList *rl, int level) { int s = (int) rl->getSize(); for (int i = 0; i < s; ++i) { levelSet(level); cout << "Reference " << i + 1 << " : " << endl; levelSet(level + 1); cout << "URI : \"" << X2C(rl->item(i)->getURI()).str() << "\"" << endl; levelSet(level + 1); cout << "Digest Algorithm : "; char* alg = XMLString::transcode(rl->item(i)->getAlgorithmURI()); cout << (alg ? alg : "Unknown") << endl; XSEC_RELEASE_XMLCH(alg); // Now the transforms DSIGTransformList * tl = rl->item(i)->getTransforms(); if (tl != NULL) { int tlSize = (int) tl->getSize(); for (int j = 0 ; j < tlSize; ++j) { levelSet(level+1); cout << "Transform " << j + 1 << " : "; outputTransform(tl->item(j), level + 2); } } if (rl->item(i)->isManifest() == true) { levelSet(level + 1); cout << "Manifest References : " << endl; outputReferences(rl->item(i)->getManifestReferenceList(), level + 2); levelSet(level + 1); cout << "End Manifest References" << endl; } } } void outputSignatureInfo(DSIGSignature *sig, bool skipReferences) { // First get some information about the main signature cout << "Signature (Signed Info) settings : " << endl; cout << " Canonicalisation Method : "; switch (sig->getCanonicalizationMethod()) { case (CANON_C14N_NOC) : cout << "c14n 1.0 (without comments)"; break; case (CANON_C14N_COM) : cout << "c14n 1.0 (with comments)"; break; case (CANON_C14N11_NOC) : cout << "c14n 1.1 (without comments)"; break; case (CANON_C14N11_COM) : cout << "c14n 1.1 (with comments)"; break; case (CANON_C14NE_NOC) : cout << "exclusive c14n 1.0 (without comments)"; break; case (CANON_C14NE_COM) : cout << "exclusive c14n 1.0 (with comments)"; break; default : cout << "none set"; break; } cout << endl; cout << " Signature Algorithm : "; char* alg = XMLString::transcode(sig->getAlgorithmURI()); cout << (alg ? alg : "Unknown") << endl; XSEC_RELEASE_XMLCH(alg); // Read in the references and output if (skipReferences == false) { DSIGReferenceList * rl = sig->getReferenceList(); if (rl != NULL) { cout << endl << "Reference List : " << endl; outputReferences(rl, 1); } } } void printUsage(void) { cerr << "\nUsage: siginf [options] \n\n"; cerr << " Where options are :\n\n"; cerr << " --skiprefs/-s\n"; cerr << " Skip information on references - output main sig info only\n\n"; } int evaluate(int argc, char ** argv) { char * filename = NULL; bool skipRefs = false; if (argc < 2) { printUsage(); return 2; } // Run through parameters int paramCount = 1; while (paramCount < argc - 1) { if (_stricmp(argv[paramCount], "--skiprefs") == 0 || _stricmp(argv[paramCount], "-s") == 0) { skipRefs = true; paramCount++; } else { printUsage(); return 2; } } if (paramCount >= argc) { printUsage(); return 2; } filename = argv[paramCount]; // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; Janitor j_parser(parser); parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Now parse out file bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(filename); errorCount = parser->getErrorCount(); } catch (const XMLException& e) { char * msg = XMLString::transcode(e.getMessage()); cerr << "An error occured during parsing\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorCount > 0 || errorsOccured) { cout << "Errors during parse" << endl; return (2); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMNode *doc = parser->getDocument(); DOMDocument *theDOM = parser->getDocument(); // Find the signature node DOMNode *sigNode = findDSIGNode(doc, "Signature"); // Create the signature checker if (sigNode == 0) { cerr << "Could not find node in " << argv[argc-1] << endl; return 1; } XSECProvider prov; DSIGSignature * sig = prov.newSignatureFromDOM(theDOM, sigNode); try { sig->load(); // If we didn't get an exception, things went well cout << "Filename : " << filename << endl; outputSignatureInfo(sig, skipRefs); // if (skipRefs == false) // result = sig->verifySignatureOnly(); // else // result = sig->verify(); } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occured during signature loading\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; return 2; } catch (...) { cerr << "Unknown Exception type occured. Cleaning up and exiting\n" << endl; return 2; } // Clean up prov.releaseSignature(sig); // Janitor will clean up the parser return 0; } int main(int argc, char **argv) { int retResult; /* We output a version number to overcome a "feature" in Microsoft's memory leak detection */ cout << "DSIG Info (Using Apache XML-Security-C Library v" << XSEC_VERSION_MAJOR << "." << XSEC_VERSION_MEDIUM << "." << XSEC_VERSION_MINOR << ")\n"; #if defined (_DEBUG) && defined (_MSC_VER) // Do some memory debugging under Visual C++ _CrtMemState s1, s2, s3; // At this point we are about to start really using XSEC, so // Take a "before" checkpoing _CrtMemCheckpoint( &s1 ); #endif // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } retResult = evaluate(argc, argv); XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); #if defined (_DEBUG) && defined (_MSC_VER) _CrtMemCheckpoint( &s2 ); if ( _CrtMemDifference( &s3, &s1, &s2 ) && s3.lCounts[1] > 1) { std::cerr << "Total count = " << (unsigned int) s3.lTotalCount << endl; // Send all reports to STDOUT _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Dumpy memory stats _CrtMemDumpAllObjectsSince( &s3 ); _CrtMemDumpStatistics( &s3 ); } // Now turn off memory leak checking and end as there are some // Globals that are allocated that get seen as leaks (Xalan?) int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag &= ~(_CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag( dbgFlag ); #endif return retResult; } xml-security-c-1.7.3/xsec/tools/cipher/cipher.cpp000644 001751 001751 00000057204 12462600235 023137 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * cipher := Tool to handle basic encryption/decryption of XML documents * * Author(s): Berin Lautenbach * * $Id: cipher.cpp 1655934 2015-01-30 04:36:29Z scantor $ * */ // XSEC #include #include #include #include #include #include #include #include #include #include "XencInteropResolver.hpp" // ugly :< #if defined(_WIN32) # include #else # include #endif // General #include #include #include #include #include #if defined(HAVE_UNISTD_H) # include #else # if defined(HAVE_DIRECT_H) # include # endif #endif #if defined (_DEBUG) && defined (_MSC_VER) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE using std::cerr; using std::cout; using std::endl; using std::ostream; #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif #if !defined (XSEC_HAVE_OPENSSL) && !defined(XSEC_HAVE_WINCAPI) && !defined(XSEC_HAVE_NSS) # error No available cryptoAPI #endif #if defined (XSEC_HAVE_OPENSSL) // OpenSSL # include # include # include # include # include # include #endif #if defined (XSEC_HAVE_WINCAPI) # include # include # include #endif #if defined (XSEC_HAVE_NSS) # include # include # include #endif #include #ifdef XSEC_NO_XALAN std::ostream& operator<< (std::ostream& target, const XMLCh * s) { char *p = XMLString::transcode(s); target << p; XSEC_RELEASE_XMLCH(p); return target; } #endif // ---------------------------------------------------------------------------- // Checksig // ---------------------------------------------------------------------------- void printUsage(void) { cerr << "\nUsage: cipher [options] \n\n"; cerr << " Where options are :\n\n"; cerr << " --decrypt/-d\n"; cerr << " Operate in decrypt mode (default) - outputs the decrypted octet stream\n"; cerr << " Reads in the input file as an XML file, searches for an EncryptedData node\n"; cerr << " and decrypts the content\n"; cerr << " --decrypt-element/-de\n"; cerr << " Operate in decrypt and XML mode.\n"; cerr << " This will output the original XML document with the first encrypted\n"; cerr << " element decrypted.\n"; cerr << " --encrypt-file/-ef\n"; cerr << " Encrypt the contents of the input file as raw data and create an\n"; cerr << " XML Encrypted Data outpu\n"; cerr << " --encrypt-xml/-ex\n"; cerr << " Parse the input file and encrypt the doc element down, storing the\n"; cerr << " output as a XML Encrypted Data\n"; cerr << " --key/-k [kek] [options]\n"; cerr << " Set the key to use.\n"; cerr << " If the first parameter is \"kek\", the key arguments will be used\n"; cerr << " as a Key EncryptionKey\n"; cerr << " KEY_TYPE defines what the key is. Can be one of :\n"; cerr << " X509, RSA, AES128, AES192, AES256, AES128-GCM, AES192-GCM, AES256-GCM or 3DES\n"; cerr << " options are :\n"; cerr << " - for X509 PEM files (must be an RSA KEK certificate\n"; cerr << " - for RSA private key files (MUST be a KEK)\n"; cerr << " - For a string to use as the key for AES or DES keys\n"; cerr << " --xkms/-x\n"; cerr << " The key that follows on the command line is to be interpreted as\n"; cerr << " an XKMS RSAKeyPair encryption key\n"; cerr << " --interop/-i\n"; cerr << " Use the interop resolver for Baltimore interop examples\n"; cerr << " --out-file/-o\n"; cerr << " Output the result to the indicated file (rather than stdout)\n"; #if defined (XSEC_HAVE_WINCAPI) cerr << " --wincapi/-w\n"; cerr << " Force use of Windows Crypto API\n"; #endif #if defined (XSEC_HAVE_NSS) cerr << " --nss/-n\n"; cerr << " Force use of NSS Crypto API\n"; #endif cerr << "\n Exits with codes :\n"; cerr << " 0 = Decrypt/Encrypt OK\n"; cerr << " 1 = Decrypt/Encrypt failed\n"; cerr << " 2 = Processing error\n"; } int evaluate(int argc, char ** argv) { char * filename = NULL; char * outfile = NULL; unsigned char * keyStr = NULL; bool doDecrypt = true; bool errorsOccured = false; bool doDecryptElement = false; bool useInteropResolver = false; bool encryptFileAsData = false; bool parseXMLInput = true; bool doXMLOutput = false; bool isXKMSKey = false; XSECCryptoKey * kek = NULL; XSECCryptoKey * key = NULL; int keyLen = 0; encryptionMethod kekAlg = ENCRYPT_NONE; encryptionMethod keyAlg = ENCRYPT_NONE; DOMDocument *doc; unsigned char keyBuf[24]; XMLFormatTarget *formatTarget ; #if defined(_WIN32) && defined (XSEC_HAVE_WINCAPI) HCRYPTPROV win32DSSCSP = 0; // Crypto Providers HCRYPTPROV win32RSACSP = 0; CryptAcquireContext(&win32DSSCSP, NULL, NULL, PROV_DSS, CRYPT_VERIFYCONTEXT); CryptAcquireContext(&win32RSACSP, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); #endif if (argc < 2) { printUsage(); return 2; } // Run through parameters int paramCount = 1; while (paramCount < argc - 1) { if (_stricmp(argv[paramCount], "--decrypt-element") == 0 || _stricmp(argv[paramCount], "-de") == 0) { paramCount++; doDecrypt = true; doDecryptElement = true; doXMLOutput = true; parseXMLInput = true; } else if (_stricmp(argv[paramCount], "--interop") == 0 || _stricmp(argv[paramCount], "-i") == 0) { // Use the interop key resolver useInteropResolver = true; paramCount++; } else if (_stricmp(argv[paramCount], "--encrypt-file") == 0 || _stricmp(argv[paramCount], "-ef") == 0) { // Use this file as the input doDecrypt = false; encryptFileAsData = true; doXMLOutput = true; parseXMLInput = false; paramCount++; } else if (_stricmp(argv[paramCount], "--encrypt-xml") == 0 || _stricmp(argv[paramCount], "-ex") == 0) { // Us this file as an XML input file doDecrypt = false; encryptFileAsData = false; doXMLOutput = true; parseXMLInput = true; paramCount++; } else if (_stricmp(argv[paramCount], "--out-file") == 0 || _stricmp(argv[paramCount], "-o") == 0) { if (paramCount +2 >= argc) { printUsage(); return 1; } paramCount++; outfile = argv[paramCount]; paramCount++; } else if (_stricmp(argv[paramCount], "--xkms") == 0 || _stricmp(argv[paramCount], "-x") == 0) { paramCount++; isXKMSKey = true; } #if defined (XSEC_HAVE_WINCAPI) else if (_stricmp(argv[paramCount], "--wincapi") == 0 || _stricmp(argv[paramCount], "-w") == 0) { // Use the interop key resolver WinCAPICryptoProvider * cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); paramCount++; } #endif #if defined (XSEC_HAVE_NSS) else if (_stricmp(argv[paramCount], "--nss") == 0 || _stricmp(argv[paramCount], "-n") == 0) { // NSS Crypto Provider NSSCryptoProvider * cp = new NSSCryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); paramCount++; } #endif else if (_stricmp(argv[paramCount], "--key") == 0 || _stricmp(argv[paramCount], "-k") == 0) { // Have a key! paramCount++; bool isKEK = false; XSECCryptoSymmetricKey::SymmetricKeyType loadKeyAs = XSECCryptoSymmetricKey::KEY_NONE; if (_stricmp(argv[paramCount], "kek") == 0) { isKEK = true; paramCount++; if (paramCount >= argc) { printUsage(); return 2; } } if (_stricmp(argv[paramCount], "3DES") == 0 || _stricmp(argv[paramCount], "AES128") == 0 || _stricmp(argv[paramCount], "AES192") == 0 || _stricmp(argv[paramCount], "AES256") == 0 || _stricmp(argv[paramCount], "AES128-GCM") == 0 || _stricmp(argv[paramCount], "AES192-GCM") == 0 || _stricmp(argv[paramCount], "AES256-GCM") == 0) { if (paramCount +2 >= argc) { printUsage(); return 2; } switch(argv[paramCount][4]) { case '\0' : keyLen = 24; loadKeyAs = XSECCryptoSymmetricKey::KEY_3DES_192; keyAlg = ENCRYPT_3DES_CBC; break; case '2' : keyLen = 16; loadKeyAs = XSECCryptoSymmetricKey::KEY_AES_128; if (isKEK) { kekAlg = ENCRYPT_KW_AES128; } else if (strlen(argv[paramCount]) == 6) { keyAlg = ENCRYPT_AES128_CBC; } else { keyAlg = ENCRYPT_AES128_GCM; } break; case '9' : keyLen = 24; loadKeyAs = XSECCryptoSymmetricKey::KEY_AES_192; if (isKEK) { kekAlg = ENCRYPT_KW_AES192; } else if (strlen(argv[paramCount]) == 6) { keyAlg = ENCRYPT_AES192_CBC; } else { keyAlg = ENCRYPT_AES192_GCM; } break; case '5' : keyLen = 32; loadKeyAs = XSECCryptoSymmetricKey::KEY_AES_256; if (isKEK) { kekAlg = ENCRYPT_KW_AES256; } else if (strlen(argv[paramCount]) == 6) { keyAlg = ENCRYPT_AES256_CBC; } else { keyAlg = ENCRYPT_AES256_GCM; } break; } paramCount++; unsigned char keyStr[64]; if (strlen(argv[paramCount]) > 64) { cerr << "Key string too long\n"; return 2; } XSECCryptoSymmetricKey * sk = XSECPlatformUtils::g_cryptoProvider->keySymmetric(loadKeyAs); if (isXKMSKey) { unsigned char kbuf[XSEC_MAX_HASH_SIZE]; CalculateXKMSKEK((unsigned char *) argv[paramCount], (int) strlen(argv[paramCount]), kbuf, XSEC_MAX_HASH_SIZE); sk->setKey(kbuf, keyLen); } else { memset(keyStr, 0, 64); strcpy((char *) keyStr, argv[paramCount]); sk->setKey(keyStr, keyLen); } paramCount++; if (isKEK) kek = sk; else key = sk; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "RSA") == 0) { // RSA private key file if (paramCount + 3 >= argc) { printUsage(); return 2; } if (!isKEK) { cerr << "RSA private keys may only be KEKs\n"; return 2; } BIO * bioKey; if ((bioKey = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening private key file\n\n"; return 1; } if (BIO_read_filename(bioKey, argv[paramCount + 1]) <= 0) { cerr << "Error opening private key file\n\n"; return 1; } EVP_PKEY * pkey; pkey = PEM_read_bio_PrivateKey(bioKey,NULL,NULL,argv[paramCount + 2]); if (pkey == NULL) { cerr << "Error loading private key\n\n"; return 1; } kek = new OpenSSLCryptoKeyRSA(pkey); kekAlg = ENCRYPT_RSA_15; EVP_PKEY_free(pkey); BIO_free(bioKey); paramCount += 3; } else if (_stricmp(argv[paramCount], "X509") == 0) { // X509 cert used to load an encrypting key if (paramCount + 2 >= argc) { printUsage(); exit (1); } if (!isKEK) { cerr << "X509 private keys may only be KEKs\n"; return 2; } // Load the encrypting key // For now just read a particular file BIO * bioX509; if ((bioX509 = BIO_new(BIO_s_file())) == NULL) { cerr << "Error opening file\n\n"; exit (1); } if (BIO_read_filename(bioX509, argv[paramCount + 1]) <= 0) { cerr << "Error opening X509 Certificate " << argv[paramCount + 1] << "\n\n"; exit (1); } X509 * x ; x = PEM_read_bio_X509_AUX(bioX509,NULL,NULL,NULL); if (x == NULL) { BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); cerr << "Error loading certificate key\n\n"; ERR_print_errors(bio_err); BIO_free(bio_err); exit (1); } // Now load the key EVP_PKEY *pkey; pkey = X509_get_pubkey(x); if (pkey == NULL || pkey->type != EVP_PKEY_RSA) { cerr << "Error extracting RSA key from certificate" << endl; } kek = new OpenSSLCryptoKeyRSA(pkey); kekAlg = ENCRYPT_RSA_15; // Clean up EVP_PKEY_free (pkey); X509_free(x); BIO_free(bioX509); paramCount += 2; } /* argv[1] = "--x509cert" */ #endif /* XSEC_HAVE_OPENSSL */ else { printUsage(); return 2; } } else { cerr << "Unknown option: " << argv[paramCount] << endl; printUsage(); return 2; } } if (paramCount >= argc) { printUsage(); return 2; } if (outfile != NULL) { formatTarget = new LocalFileFormatTarget(outfile); } else { formatTarget = new StdOutFormatTarget(); } filename = argv[paramCount]; if (parseXMLInput) { XercesDOMParser * parser = new XercesDOMParser; Janitor j_parser(parser); parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Now parse out file xsecsize_t errorCount = 0; try { parser->parse(filename); errorCount = parser->getErrorCount(); if (errorCount > 0) errorsOccured = true; } catch (const XMLException& e) { cerr << "An error occured during parsing\n Message: " << e.getMessage() << endl; errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorsOccured) { cout << "Errors during parse" << endl; return (2); } /* Now that we have the parsed file, get the DOM document and start looking at it */ doc = parser->adoptDocument(); } else { // Create an empty document XMLCh tempStr[100]; XMLString::transcode("Core", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); doc = impl->createDocument( 0, // root element namespace URI. MAKE_UNICODE_STRING("ADoc"), // root element name NULL);// DOMDocumentType()); // document type object (DTD). } XSECProvider prov; XENCCipher * cipher = prov.newCipher(doc); if (kek != NULL) cipher->setKEK(kek); if (key != NULL) cipher->setKey(key); try { if (doDecrypt) { if (useInteropResolver == true) { // Map out base path of the file #if XSEC_HAVE_GETCWD_DYN char *path = getcwd(NULL, 0); char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1); #else char path[PATH_MAX]; char baseURI[(PATH_MAX * 2) + 10]; getcwd(path, PATH_MAX); #endif strcpy(baseURI, "file:///"); // Ugly and nasty but quick if (filename[0] != '\\' && filename[0] != '/' && filename[1] != ':') { strcat(baseURI, path); strcat(baseURI, "/"); } else if (path[1] == ':') { path[2] = '\0'; strcat(baseURI, path); } strcat(baseURI, filename); // Find any ':' and "\" characters int lastSlash = 0; for (unsigned int i = 8; i < strlen(baseURI); ++i) { if (baseURI[i] == '\\') { lastSlash = i; baseURI[i] = '/'; } else if (baseURI[i] == '/') lastSlash = i; } // The last "\\" must prefix the filename baseURI[lastSlash + 1] = '\0'; XMLCh * uriT = XMLString::transcode(baseURI); #if XSEC_HAVE_GETCWD_DYN free(path); free(baseURI); #endif XencInteropResolver ires(doc, &(uriT[8])); XSEC_RELEASE_XMLCH(uriT); cipher->setKeyInfoResolver(&ires); } // Find the EncryptedData node DOMNode * n = findXENCNode(doc, "EncryptedData"); if (doDecryptElement) { while (n != NULL) { // decrypt cipher->decryptElement(static_cast(n)); // Find the next EncryptedData node n = findXENCNode(doc, "EncryptedData"); } } else { XSECBinTXFMInputStream * bis = cipher->decryptToBinInputStream(static_cast(n)); Janitor j_bis(bis); XMLByte buf[1024]; xsecsize_t read = bis->readBytes(buf, 1023); while (read > 0) { formatTarget->writeChars(buf, read, NULL); read = bis->readBytes(buf, 1023); } } } else { XENCEncryptedData *xenc = NULL; // Encrypting if (kek != NULL && key == NULL) { XSECPlatformUtils::g_cryptoProvider->getRandom(keyBuf, 24); XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); k->setKey(keyBuf, 24); cipher->setKey(k); keyAlg = ENCRYPT_3DES_CBC; keyStr = keyBuf; keyLen = 24; } if (encryptFileAsData) { // Create a BinInputStream #if defined(XSEC_XERCES_REQUIRES_MEMMGR) BinFileInputStream * is = new BinFileInputStream(filename, XMLPlatformUtils::fgMemoryManager); #else BinFileInputStream * is = new BinFileInputStream(filename); #endif xenc = cipher->encryptBinInputStream(is, keyAlg); // Replace the document element DOMElement * elt = doc->getDocumentElement(); doc->replaceChild(xenc->getElement(), elt); elt->release(); } else { // Document encryption cipher->encryptElement(doc->getDocumentElement(), keyAlg); } // Do we encrypt a created key? if (kek != NULL && xenc != NULL) { XENCEncryptedKey *xkey = cipher->encryptKey(keyStr, keyLen, kekAlg); // Add to the EncryptedData xenc->appendEncryptedKey(xkey); } } if (doXMLOutput) { // Output the result XMLCh core[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_C, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_o, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_r, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_e, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(core); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); Janitor j_theSerializer(theSerializer); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(doc, theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); Janitor j_theSerializer(theSerializer); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); theSerializer->writeNode(formatTarget, *doc); #endif cout << endl; } } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occured during encryption/decryption operation\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; if (formatTarget != NULL) delete formatTarget; doc->release(); return 2; } catch (XSECCryptoException &e) { cerr << "An error occured during encryption/decryption operation\n Message: " << e.getMsg() << endl; errorsOccured = true; if (formatTarget != NULL) delete formatTarget; doc->release(); #if defined (XSEC_HAVE_OPENSSL) ERR_load_crypto_strings(); BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); ERR_print_errors(bio_err); #endif return 2; } if (formatTarget != NULL) delete formatTarget; doc->release(); return 0; } int main(int argc, char **argv) { int retResult; #if defined (_DEBUG) && defined (_MSC_VER) // Do some memory debugging under Visual C++ _CrtMemState s1, s2, s3; // At this point we are about to start really using XSEC, so // Take a "before" checkpoing _CrtMemCheckpoint( &s1 ); #endif // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } retResult = evaluate(argc, argv); XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); #if defined (_DEBUG) && defined (_MSC_VER) _CrtMemCheckpoint( &s2 ); if ( _CrtMemDifference( &s3, &s1, &s2 ) && ( s3.lCounts[0] > 0 || s3.lCounts[1] > 1 || // s3.lCounts[2] > 2 || We don't worry about C Runtime s3.lCounts[3] > 0 || s3.lCounts[4] > 0)) { // Note that there is generally 1 Normal and 1 CRT block // still taken. 1 is from Xalan and 1 from stdio // Send all reports to STDOUT _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Dumpy memory stats _CrtMemDumpAllObjectsSince( &s3 ); _CrtMemDumpStatistics( &s3 ); } // Now turn off memory leak checking and end as there are some // Globals that are allocated that get seen as leaks (Xalan?) int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag &= ~(_CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag( dbgFlag ); #endif return retResult; } xml-security-c-1.7.3/xsec/tools/cipher/XencInteropResolver.hpp000644 001751 001751 00000003601 12003301052 025624 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XencInteropResolver := Class to resolve key elements into certificates for * interop test * * Author(s): Berin Lautenbach * * $Id: XencInteropResolver.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #if defined (_WIN32) # include #else # include #endif class XencInteropResolver : public XSECKeyInfoResolver { public : XencInteropResolver(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, const XMLCh * baseURI); ~XencInteropResolver(); // Interface functions virtual XSECCryptoKey * resolveKey(DSIGKeyInfoList * lst); virtual XSECKeyInfoResolver * clone(void) const; // Internal functions private: XSECCryptoSymmetricKey * makeSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType); XMLCh * mp_baseURI; XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *mp_doc; #if defined (_WIN32) _finddata_t m_finder; long m_handle; #else glob_t m_globbuf; int m_fcount; #endif }; xml-security-c-1.7.3/xsec/tools/cipher/XencInteropResolver.cpp000644 001751 001751 00000031717 12003301052 025630 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XencInteropResolver := Class to resolve key elements into certificates for * interop test * * $Id: XencInteropResolver.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include "XencInteropResolver.hpp" #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #if !defined (XSEC_HAVE_OPENSSL) && !defined (XSEC_HAVE_WINCAPI) && !defined (XSEC_HAVE_NSS) # error Require OpenSSL or Windows Crypto API for the Merlin Resolver #endif #if defined (XSEC_HAVE_OPENSSL) # include # include # include # include # include #endif #if defined (XSEC_HAVE_WINCAPI) # include # include #endif #if defined (XSEC_HAVE_NSS) # include # include #endif // -------------------------------------------------------------------------------- // Merlin Xenc-Five keys and Strings // -------------------------------------------------------------------------------- static XMLCh s_bobName[] = { chLatin_b, chLatin_o, chLatin_b, chNull }; static XMLCh s_jobName[] = { chLatin_j, chLatin_o, chLatin_b, chNull }; static XMLCh s_jebName[] = { chLatin_j, chLatin_e, chLatin_b, chNull }; static XMLCh s_jedName[] = { chLatin_j, chLatin_e, chLatin_d, chNull }; static char s_bobKey[] = "abcdefghijklmnopqrstuvwx"; static char s_jobKey[] = "abcdefghijklmnop"; static char s_jebKey[] = "abcdefghijklmnopqrstuvwx"; static char s_jedKey[] = "abcdefghijklmnopqrstuvwxyz012345"; // -------------------------------------------------------------------------------- // Phaos xenc-three strings and keys // -------------------------------------------------------------------------------- static XMLCh s_phaosRSAName[] = { chLatin_m, chLatin_y, chDash, chLatin_r, chLatin_s, chLatin_a, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; static XMLCh s_phaosTripleDESName[] = { chLatin_m, chLatin_y, chDash, chLatin_t, chLatin_r, chLatin_i, chLatin_p, chLatin_l, chLatin_e, chLatin_d, chLatin_e, chLatin_s, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; static XMLCh s_phaos3DESName[] = { chLatin_m, chLatin_y, chDash, chDigit_3, chLatin_d, chLatin_e, chLatin_s, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; static XMLCh s_phaosAES128Name[] = { chLatin_m, chLatin_y, chDash, chLatin_a, chLatin_e, chLatin_s, chDigit_1, chDigit_2, chDigit_8, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; static XMLCh s_phaosAES192Name[] = { chLatin_m, chLatin_y, chDash, chLatin_a, chLatin_e, chLatin_s, chDigit_1, chDigit_9, chDigit_2, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; static XMLCh s_phaosAES256Name[] = { chLatin_m, chLatin_y, chDash, chLatin_a, chLatin_e, chLatin_s, chDigit_2, chDigit_5, chDigit_6, chDash, chLatin_k, chLatin_e, chLatin_y, chNull }; unsigned char s_phaos3DESKey[] = { 0xc8, 0x8f, 0x89, 0xd5, 0xfd, 0xe9, 0xb9, 0x80, 0x04, 0x46, 0x32, 0x1c, 0x4f, 0xab, 0xdf, 0x83, 0xa4, 0x62, 0xb6, 0x62, 0x97, 0xf2, 0x70, 0xf4 }; unsigned char s_phaosAES128Key[] = { 0xd3, 0x5f, 0xb2, 0xb9, 0x0d, 0xa1, 0xb8, 0xf4, 0xb5, 0xf9, 0x0b, 0xf4, 0x2c, 0x7f, 0xb3, 0x69 }; unsigned char s_phaosAES192Key[] = { 0x22, 0x57, 0xee, 0x4b, 0x8d, 0x0b, 0xbd, 0x2b, 0x55, 0x53, 0x43, 0x23, 0xf1, 0xe3, 0xeb, 0xac, 0x61, 0xd5, 0x84, 0x06, 0xf8, 0xf3, 0x2f, 0xbe }; unsigned char s_phaosAES256Key[] = { 0x66, 0x16, 0x78, 0xbf, 0x74, 0x65, 0xc1, 0x39, 0x42, 0x10, 0xea, 0x48, 0xac, 0x77, 0xcb, 0x29, 0x5c, 0x89, 0x38, 0x10, 0xed, 0x10, 0x93, 0x8e, 0x40, 0x36, 0xad, 0xff, 0x8c, 0x51, 0xd5, 0xb0 }; // -------------------------------------------------------------------------------- // Construct/Destruct // -------------------------------------------------------------------------------- XencInteropResolver::XencInteropResolver(DOMDocument * doc, const XMLCh * baseURI) { if (baseURI != NULL) mp_baseURI = XMLString::replicate(baseURI); else mp_baseURI = NULL; #if !defined(_WIN32) m_fcount = 0; #endif mp_doc = doc; } XencInteropResolver::~XencInteropResolver() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } // -------------------------------------------------------------------------------- // Utility functions // -------------------------------------------------------------------------------- #if defined(_WIN32) void reverseSlash(safeBuffer &path) { for (int i = 0; i < (int) strlen(path.rawCharBuffer()); ++i) { if (path[i] == '/') path[i] = '\\'; } } #endif XSECCryptoSymmetricKey * XencInteropResolver::makeSymmetricKey(XSECCryptoSymmetricKey::SymmetricKeyType type) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(type); return k; } #if defined (XSEC_HAVE_OPENSSL) BIO * createFileBIO(const XMLCh * baseURI, const char * name) { // Open file URI relative to the encrypted file BIO * bioFile; if ((bioFile = BIO_new(BIO_s_file())) == NULL) { return NULL; } safeBuffer fname; fname.sbTranscodeIn(baseURI); fname.sbStrcatIn("/"); fname.sbStrcatIn(name); #if defined(_WIN32) reverseSlash(fname); #endif if (BIO_read_filename(bioFile, fname.rawCharBuffer()) <= 0) { return NULL; } return bioFile; } #endif // -------------------------------------------------------------------------------- // Resolver // -------------------------------------------------------------------------------- XSECCryptoKey * XencInteropResolver::resolveKey(DSIGKeyInfoList * lst) { int lstSize = (int) lst->getSize(); for (int i = 0; i < lstSize; ++i) { DSIGKeyInfo * ki = lst->item(i); if (ki->getKeyInfoType() == DSIGKeyInfo::KEYINFO_NAME) { DSIGKeyInfoName * kn = (DSIGKeyInfoName *) ki; const XMLCh * name = kn->getKeyName(); // Check if this is a key we know if (strEquals(s_bobName, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); try { k->setKey((unsigned char *) s_bobKey, (unsigned int) strlen(s_bobKey)); } catch (...) { delete k; throw; } return k; } if (strEquals(s_jobName, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); try { k->setKey((unsigned char *) s_jobKey, (unsigned int) strlen(s_jobKey)); } catch(...) { delete k; throw; } return k; } if (strEquals(s_jebName, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_192); try { k->setKey((unsigned char *) s_jebKey, (unsigned int) strlen(s_jebKey)); } catch(...) { delete k; throw; } return k; } if (strEquals(s_jedName, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); try { k->setKey((unsigned char *) s_jedKey, (unsigned int) strlen(s_jedKey)); } catch(...) { delete k; throw; } return k; } // PHAOS Keys if (strEquals(s_phaos3DESName, name) || strEquals(s_phaosTripleDESName, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_3DES_192); try { k->setKey(s_phaos3DESKey, 24); } catch (...) { delete k; throw; } return k; } if (strEquals(s_phaosAES128Name, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_128); try { k->setKey(s_phaosAES128Key, 16); } catch(...) { delete k; throw; } return k; } if (strEquals(s_phaosAES192Name, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_192); try { k->setKey(s_phaosAES192Key, 24); } catch(...) { delete k; throw; } return k; } if (strEquals(s_phaosAES256Name, name)) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); try { k->setKey(s_phaosAES256Key, 32); } catch(...) { delete k; throw; } return k; } #if defined (XSEC_HAVE_OPENSSL) if (strEquals(s_phaosRSAName, name)) { // This is the Phaos RSA key BIO * rsaFile = createFileBIO(mp_baseURI, "rsa-priv-key.der"); if (rsaFile == NULL) return NULL; PKCS8_PRIV_KEY_INFO * p8inf; p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(rsaFile, NULL); EVP_PKEY * pk = EVP_PKCS82PKEY(p8inf); OpenSSLCryptoKeyRSA * k = new OpenSSLCryptoKeyRSA(pk); PKCS8_PRIV_KEY_INFO_free(p8inf); BIO_free_all(rsaFile); return k; } #endif // If we get this far, we don't know it. So look for EncryptedKey elements // containing this name as a CarriedKeyName DOMNode * c = mp_doc->getDocumentElement()->getFirstChild(); while (c != NULL) { if (c->getNodeType() == DOMNode::ELEMENT_NODE && strEquals(getDSIGLocalName(c), MAKE_UNICODE_STRING("KeyInfo"))) { DOMNode * ek = c->getFirstChild(); while (ek != NULL) { if (ek->getNodeType() == DOMNode::ELEMENT_NODE && strEquals(getXENCLocalName(ek), MAKE_UNICODE_STRING("EncryptedKey"))) { // Load XSECProvider prov; XENCCipher * cipher = prov.newCipher(mp_doc); XENCEncryptedKey * xek = cipher->loadEncryptedKey(static_cast(ek)); Janitor j_xek(xek); if (strEquals(xek->getCarriedKeyName(), name) && strEquals(xek->getRecipient(), MAKE_UNICODE_STRING("you"))) { // This is it! cipher->setKeyInfoResolver(this); unsigned char keyBuf[1024]; int sz = cipher->decryptKey(xek, keyBuf, 1024); if (sz > 0) { XSECCryptoSymmetricKey * k = XSECPlatformUtils::g_cryptoProvider->keySymmetric(XSECCryptoSymmetricKey::KEY_AES_256); try { k->setKey(keyBuf, sz); } catch (...) { delete k; throw; } return k; } } } ek = ek->getNextSibling(); } } c = c->getNextSibling(); } } else if (ki->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { DSIGKeyInfoX509 * kix = (DSIGKeyInfoX509 *) ki; XSECCryptoX509 * XCX509 = kix->getCertificateCryptoItem(0); if (XCX509 != 0) { #if defined (XSEC_HAVE_OPENSSL) if (strEquals(XCX509->getProviderName(),DSIGConstants::s_unicodeStrPROVOpenSSL)) { OpenSSLCryptoX509 * OSSLX509 = (OpenSSLCryptoX509 *) XCX509; X509 * x509 = OSSLX509->getOpenSSLX509(); // Check the serial number BIGNUM * bnserial = ASN1_INTEGER_to_BN(x509->cert_info->serialNumber, NULL); BN_free(bnserial); BIO * rsaFile = createFileBIO(mp_baseURI, "rsa.p8"); if (rsaFile == NULL) return NULL; PKCS8_PRIV_KEY_INFO * p8inf; p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(rsaFile, NULL); EVP_PKEY * pk = EVP_PKCS82PKEY(p8inf); OpenSSLCryptoKeyRSA * k = new OpenSSLCryptoKeyRSA(pk); PKCS8_PRIV_KEY_INFO_free(p8inf); BIO_free_all(rsaFile); return k; } #if defined (XSEC_HAVE_WINCAPI) else { #endif /* XSEC_HAVE_WINCAPI */ #endif /* XSEC_HAVE_OPENSSL */ #if defined (XSEC_HAVE_WINCAPI) std::cerr << "WARNING - Unable to load PKCS8 private key file into Windows CAPI" << std::endl; #if defined (XSEC_HAVE_OPENSSL) } #endif /* XSEC_HAVE_WINCAPI */ #endif /* XSEC_HAVE_OPENSSL */ } } } return NULL; } XSECKeyInfoResolver * XencInteropResolver::clone(void) const { return new XencInteropResolver(mp_doc, mp_baseURI); } xml-security-c-1.7.3/xsec/tools/checksig/checksig.cpp000644 001751 001751 00000037350 12462600235 023753 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * checkSig := (Very ugly) tool to check a signature embedded in an XML file * * $Id: checksig.cpp 1655934 2015-01-30 04:36:29Z scantor $ * */ #include "AnonymousResolver.hpp" #include "InteropResolver.hpp" // XSEC #include #include #include #include #include #include #include #include // ugly :< #if defined(_WIN32) # include #else # include #endif // General #include #include #include #include #if defined(HAVE_UNISTD_H) # include #else # if defined(HAVE_DIRECT_H) # include # endif #endif #if defined (_DEBUG) && defined (_MSC_VER) #include #endif #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE using std::cerr; using std::cout; using std::endl; #ifndef XSEC_NO_XALAN // XALAN #include #include XALAN_USING_XALAN(XPathEvaluator) XALAN_USING_XALAN(XalanTransformer) #endif #if defined (XSEC_HAVE_OPENSSL) // OpenSSL # include # include #endif #if defined (XSEC_HAVE_WINCAPI) # include # include #endif #if defined (XSEC_HAVE_NSS) # include # include #endif #include #ifdef XSEC_NO_XALAN std::ostream& operator<< (std::ostream& target, const XMLCh * s) { char *p = XMLString::transcode(s); target << p; XSEC_RELEASE_XMLCH(p); return target; } #endif // ---------------------------------------------------------------------------- // Checksig // ---------------------------------------------------------------------------- void printUsage(void) { cerr << "\nUsage: checksig [options] \n\n"; cerr << " Where options are :\n\n"; cerr << " --skiprefs/-s\n"; cerr << " Skip checking references - check signature only\n\n"; cerr << " --hmackey/-h \n"; cerr << " Set an hmac key using the \n\n"; cerr << " --xsecresolver/-x\n"; cerr << " Use the xml-security test XMLDSig URI resolver\n\n"; cerr << " --id \n"; cerr << " Define an attribute Id by name\n\n"; cerr << " --idns/-d \n"; cerr << " Define an attribute Id by namespace URI and name\n\n"; #if defined (XSEC_HAVE_OPENSSL) cerr << " --interop/-i\n"; cerr << " Use the interop resolver for Baltimore interop examples\n\n"; #endif #if defined(XSEC_HAVE_WINCAPI) # if defined (XSEC_HAVE_OPENSSL) cerr << " --wincapi/-w\n"; cerr << " Use the Windows CAPI crypto Provider\n\n"; # endif cerr << " --winhmackey/-wh \n"; cerr << " Use the Windows CAPI crypto provider and hash the \n"; cerr << " into a Windows key using SHA-1\n\n"; #endif cerr << " Exits with codes :\n"; cerr << " 0 = Signature OK\n"; cerr << " 1 = Signature Bad\n"; cerr << " 2 = Processing error\n"; } int evaluate(int argc, char ** argv) { char * filename = NULL; char * hmacKeyStr = NULL; char * useIdAttributeNS = NULL; char * useIdAttributeName = NULL; XSECCryptoKey * key = NULL; bool useXSECURIResolver = false; bool useAnonymousResolver = false; bool useInteropResolver = false; #if defined (XSEC_HAVE_WINCAPI) HCRYPTPROV win32CSP = 0; #endif bool skipRefs = false; if (argc < 2) { printUsage(); return 2; } // Run through parameters int paramCount = 1; while (paramCount < argc - 1) { if (_stricmp(argv[paramCount], "--hmackey") == 0 || _stricmp(argv[paramCount], "-h") == 0) { paramCount++; hmacKeyStr = argv[paramCount++]; } else if (_stricmp(argv[paramCount], "--skiprefs") == 0 || _stricmp(argv[paramCount], "-s") == 0) { skipRefs = true; paramCount++; } else if (_stricmp(argv[paramCount], "--xsecresolver") == 0 || _stricmp(argv[paramCount], "-x") == 0) { useXSECURIResolver = true; paramCount++; } else if (_stricmp(argv[paramCount], "--id") == 0) { if (paramCount +1 >= argc) { printUsage(); return 2; } paramCount++; useIdAttributeName = argv[paramCount++]; } else if (_stricmp(argv[paramCount], "--idns") == 0 || _stricmp(argv[paramCount], "-d") == 0) { if (paramCount +2 >= argc) { printUsage(); return 2; } paramCount++; useIdAttributeNS = argv[paramCount++]; useIdAttributeName = argv[paramCount++]; } #if defined (XSEC_HAVE_OPENSSL) else if (_stricmp(argv[paramCount], "--interop") == 0 || _stricmp(argv[paramCount], "-i") == 0) { // Use the interop key resolver useInteropResolver = true; paramCount++; } #endif else if (_stricmp(argv[paramCount], "--anonymousresolver") == 0 || _stricmp(argv[paramCount], "-a") ==0) { useAnonymousResolver = true; paramCount++; } #if defined (XSEC_HAVE_WINCAPI) else if (_stricmp(argv[paramCount], "--wincapi") == 0 || _stricmp(argv[paramCount], "-w") == 0 || _stricmp(argv[paramCount], "--winhmackey") == 0 || _stricmp(argv[paramCount], "-wh") == 0) { WinCAPICryptoProvider * cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); if (_stricmp(argv[paramCount], "--winhmackey") == 0 || _stricmp(argv[paramCount], "-wh") == 0) { // Create a SHA-1 based key based on the parameter paramCount++; if (!CryptAcquireContext(&win32CSP, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { cerr << "Error obtaining default RSA_PROV" << endl; return 2; } HCRYPTKEY k; HCRYPTHASH h; BOOL fResult = CryptCreateHash( win32CSP, CALG_SHA, 0, 0, &h); if (fResult == 0) { cerr << "Error creating hash to create windows hmac key from password" << endl; return 2; } fResult = CryptHashData( h, (unsigned char *) argv[paramCount], (DWORD) strlen(argv[paramCount]), 0); if (fResult == 0) { cerr << "Error hashing password to create windows hmac key" << endl; return 2; } // Now create a key fResult = CryptDeriveKey( win32CSP, CALG_RC2, h, CRYPT_EXPORTABLE, &k); if (fResult == 0) { cerr << "Error deriving key from hash value" << endl; return 2; } // Wrap in a WinCAPI object WinCAPICryptoKeyHMAC * hk; hk = new WinCAPICryptoKeyHMAC(win32CSP); hk->setWinKey(k); key = hk; CryptDestroyHash(h); } paramCount++; } #endif else { cerr << "Unknown option: " << argv[paramCount] << endl << endl; printUsage(); return 2; } } #if defined (XSEC_HAVE_WINCAPI) && !defined(XSEC_HAVE_OPENSSL) // Use default DSS provider WinCAPICryptoProvider * cp = new WinCAPICryptoProvider(); XSECPlatformUtils::SetCryptoProvider(cp); #endif if (paramCount >= argc) { printUsage(); return 2; } filename = argv[paramCount]; // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; Janitor j_parser(parser); parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Now parse out file bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(filename); errorCount = parser->getErrorCount(); if (errorCount > 0) errorsOccured = true; } catch (const XMLException& e) { cerr << "An error occured during parsing\n Message: " << e.getMessage() << endl; errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorsOccured) { cout << "Errors during parse" << endl; return (2); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMNode *doc; // The document that we parsed doc = parser->getDocument(); DOMDocument *theDOM = parser->getDocument(); // Find the signature node DOMNode *sigNode = findDSIGNode(doc, "Signature"); // Create the signature checker if (sigNode == 0) { cerr << "Could not find node in " << argv[argc-1] << endl; return 2; } XSECProvider prov; XSECKeyInfoResolverDefault theKeyInfoResolver; DSIGSignature * sig = prov.newSignatureFromDOM(theDOM, sigNode); // The only way we can verify is using keys read directly from the KeyInfo list, // so we add a KeyInfoResolverDefault to the Signature. sig->setKeyInfoResolver(&theKeyInfoResolver); // Register defined attribute name if (useIdAttributeName != NULL) { sig->setIdByAttributeName(true); if (useIdAttributeNS != NULL) { sig->registerIdAttributeNameNS(MAKE_UNICODE_STRING(useIdAttributeNS), MAKE_UNICODE_STRING(useIdAttributeName)); } else { sig->registerIdAttributeName(MAKE_UNICODE_STRING(useIdAttributeName)); } } // Check whether we should use the internal resolver if (useXSECURIResolver == true || useAnonymousResolver == true || useInteropResolver == true) { #if defined(_WIN32) XSECURIResolverGenericWin32 #else XSECURIResolverGenericUnix #endif theResolver; AnonymousResolver theAnonymousResolver; // Map out base path of the file #if XSEC_HAVE_GETCWD_DYN char *path = getcwd(NULL, 0); char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1); #else char path[PATH_MAX]; char baseURI[(PATH_MAX * 2) + 10]; getcwd(path, PATH_MAX); #endif strcpy(baseURI, "file:///"); // Ugly and nasty but quick if (filename[0] != '\\' && filename[0] != '/' && filename[1] != ':') { strcat(baseURI, path); strcat(baseURI, "/"); } else if (path[1] == ':') { path[2] = '\0'; strcat(baseURI, path); } strcat(baseURI, filename); // Find any ':' and "\" characters int lastSlash = 0; for (unsigned int i = 8; i < strlen(baseURI); ++i) { if (baseURI[i] == '\\') { lastSlash = i; baseURI[i] = '/'; } else if (baseURI[i] == '/') lastSlash = i; } // The last "\\" must prefix the filename baseURI[lastSlash + 1] = '\0'; XMLCh * baseURIXMLCh = XMLString::transcode(baseURI); XMLUri uri(MAKE_UNICODE_STRING(baseURI)); #if XSEC_HAVE_GETCWD_DYN free(path); free(baseURI); #endif if (useAnonymousResolver == true) { // AnonymousResolver takes precedence theAnonymousResolver.setBaseURI(baseURIXMLCh); sig->setURIResolver(&theAnonymousResolver); } else if (useXSECURIResolver == true) { theResolver.setBaseURI(baseURIXMLCh); sig->setURIResolver(&theResolver); } #if defined (XSEC_HAVE_OPENSSL) if (useInteropResolver == true) { InteropResolver ires(&(baseURIXMLCh[8])); sig->setKeyInfoResolver(&ires); } #endif XSEC_RELEASE_XMLCH(baseURIXMLCh); } bool result; try { // Load a key if necessary if (hmacKeyStr != NULL) { XSECCryptoKeyHMAC * hmacKey = XSECPlatformUtils::g_cryptoProvider->keyHMAC(); hmacKey->setKey((unsigned char *) hmacKeyStr, (unsigned int) strlen(hmacKeyStr)); sig->setSigningKey(hmacKey); } else if (key != NULL) { sig->setSigningKey(key); } sig->load(); if (skipRefs) result = sig->verifySignatureOnly(); else result = sig->verify(); } catch (XSECException &e) { char * msg = XMLString::transcode(e.getMsg()); cerr << "An error occured during signature verification\n Message: " << msg << endl; XSEC_RELEASE_XMLCH(msg); errorsOccured = true; return 2; } catch (XSECCryptoException &e) { cerr << "An error occured during signature verification\n Message: " << e.getMsg() << endl; errorsOccured = true; #if defined (XSEC_HAVE_OPENSSL) ERR_load_crypto_strings(); BIO * bio_err; if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); ERR_print_errors(bio_err); #endif return 2; } #if 0 catch (...) { cerr << "Unknown Exception type occured. Cleaning up and exiting\n" << endl; return 2; } #endif int retResult; if (result) { cout << "Signature verified OK!" << endl; retResult = 0; } else { cout << "Signature failed verification" << endl; char * e = XMLString::transcode(sig->getErrMsgs()); cout << e << endl; XSEC_RELEASE_XMLCH(e); retResult = 1; } #if defined (XSEC_HAVE_WINCAPI) // Clean up the handle to the CSP if (win32CSP != 0) CryptReleaseContext(win32CSP, 0); #endif // Janitor will clean up the parser return retResult; } int main(int argc, char **argv) { int retResult; #if defined (_DEBUG) && defined (_MSC_VER) // Do some memory debugging under Visual C++ _CrtMemState s1, s2, s3; // At this point we are about to start really using XSEC, so // Take a "before" checkpoing _CrtMemCheckpoint( &s1 ); #endif // Initialise the XML system try { XMLPlatformUtils::Initialize(); #ifndef XSEC_NO_XALAN XPathEvaluator::initialize(); XalanTransformer::initialize(); #endif XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } retResult = evaluate(argc, argv); XSECPlatformUtils::Terminate(); #ifndef XSEC_NO_XALAN XalanTransformer::terminate(); XPathEvaluator::terminate(); #endif XMLPlatformUtils::Terminate(); #if defined (_DEBUG) && defined (_MSC_VER) _CrtMemCheckpoint( &s2 ); if ( _CrtMemDifference( &s3, &s1, &s2 ) && ( s3.lCounts[0] > 0 || s3.lCounts[1] > 1 || // s3.lCounts[2] > 2 || We don't worry about C Runtime s3.lCounts[3] > 0 || s3.lCounts[4] > 0)) { // Note that there is generally 1 Normal and 1 CRT block // still taken. 1 is from Xalan and 1 from stdio // Send all reports to STDOUT _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Dumpy memory stats _CrtMemDumpAllObjectsSince( &s3 ); _CrtMemDumpStatistics( &s3 ); } // Now turn off memory leak checking and end as there are some // Globals that are allocated that get seen as leaks (Xalan?) int dbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); dbgFlag &= ~(_CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag( dbgFlag ); #endif return retResult; } xml-security-c-1.7.3/xsec/tools/checksig/AnonymousResolver.hpp000644 001751 001751 00000003746 12003301052 025676 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * AnonymousResolver := Class to resolve the IAIK anonymous sample reference * * Author(s): Berin Lautenbach * * $Id: AnonymousResolver.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #define anonURI "../digestInputs/anonymousReferenceSignature.firstReference.txt" // ---------------------------------------------------------------------------- // AnonymousResolver // ---------------------------------------------------------------------------- /* * The anonymous resolver is a very simple resolver used for the IAIK * anonymousReferenceSignature.xml interop test example. * It simply takes an anonymous (NULL) uri reference and links to the * relevant file in the data suite */ class AnonymousResolver : public XSECURIResolver { public: AnonymousResolver() {mp_baseURI = NULL;} virtual ~AnonymousResolver(); // Interface method virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * resolveURI(const XMLCh * uri); // Interface method virtual XSECURIResolver * clone(void); // Extra methods void setBaseURI(const XMLCh * uri); private: XMLCh * mp_baseURI; }; xml-security-c-1.7.3/xsec/tools/checksig/AnonymousResolver.cpp000644 001751 001751 00000005544 12003301052 025667 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * AnonymousResolver := Class to resolve the IAIK anonymous sample reference * * Author(s): Berin Lautenbach * * $Id: AnonymousResolver.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include "AnonymousResolver.hpp" // XSEC #include #include #include #include #include XERCES_CPP_NAMESPACE_USE // ---------------------------------------------------------------------------- // AnonymousResolver // ---------------------------------------------------------------------------- AnonymousResolver::~AnonymousResolver() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } XSECURIResolver * AnonymousResolver::clone(void) { AnonymousResolver * ret; ret = new AnonymousResolver(); if (this->mp_baseURI != 0) ret->mp_baseURI = XMLString::replicate(this->mp_baseURI); else ret->mp_baseURI = 0; return ret; } void AnonymousResolver::setBaseURI(const XMLCh * uri) { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); mp_baseURI = XMLString::replicate(uri); } BinInputStream * AnonymousResolver::resolveURI(const XMLCh * uri) { XSEC_USING_XERCES(URLInputSource); XSEC_USING_XERCES(XMLURL); XSEC_USING_XERCES(BinInputStream); URLInputSource * URLS; // Use Xerces URL Input source BinInputStream * is; // To handle the actual input if (uri != NULL) { throw XSECException(XSECException::ErrorOpeningURI, "AnonymousResolver - only anonymous references supported"); } if (mp_baseURI == 0) { URLS = new URLInputSource(XMLURL(MAKE_UNICODE_STRING(anonURI))); } else { URLS = new URLInputSource(XMLURL(XMLURL(mp_baseURI), MAKE_UNICODE_STRING(anonURI))); } // makeStream can (and is quite likely to) throw an exception Janitor j_URLS(URLS); is = URLS->makeStream(); if (is == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "An error occurred in AnonymousResolver when opening an URLInputStream"); } return is; } xml-security-c-1.7.3/xsec/tools/checksig/InteropResolver.hpp000644 001751 001751 00000003623 12003301052 025320 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * InteropResolver := Class to resolve key elements into certificates for * merlin-18 interop test * * Author(s): Berin Lautenbach * * $Id: InteropResolver.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #if defined (_WIN32) # include #else # include #endif #if defined (XSEC_HAVE_OPENSSL) # include class InteropResolver : public XSECKeyInfoResolver { public : InteropResolver(const XMLCh * baseURI); ~InteropResolver(); // Interface functions virtual XSECCryptoKey * resolveKey(DSIGKeyInfoList * lst); virtual XSECKeyInfoResolver * clone(void) const; // Internal functions X509 * nextFile2Cert(void); bool checkMatch(DSIGKeyInfoList * lst, X509 * x); XSECCryptoKey * openCertURI(const XMLCh * uri); private: XMLCh * mp_baseURI; bool m_searchStarted; bool m_searchFinished; #if defined (_WIN32) _finddata_t m_finder; long m_handle; #else glob_t m_globbuf; int m_fcount; #endif }; #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/tools/checksig/InteropResolver.cpp000644 001751 001751 00000032432 12003301052 025313 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * InteropResolver := Class to resolve key elements into certificates for * merlin-18 interop test * * $Id: InteropResolver.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include "InteropResolver.hpp" #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include #if defined (XSEC_HAVE_OPENSSL) InteropResolver::InteropResolver(const XMLCh * baseURI) { if (baseURI != NULL) mp_baseURI = XMLString::replicate(baseURI); else mp_baseURI = NULL; m_searchStarted = false; m_searchFinished = false; #if !defined(_WIN32) m_fcount = 0; #endif } InteropResolver::~InteropResolver() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } #if defined(_WIN32) void reverseSlash(safeBuffer &path) { for (int i = 0; i < (int) strlen(path.rawCharBuffer()); ++i) { if (path[i] == '/') path[i] = '\\'; } } #endif X509 * InteropResolver::nextFile2Cert(void) { if (m_searchFinished) return NULL; int res; if (!m_searchStarted) { char * base = XMLString::transcode(mp_baseURI); safeBuffer path = base; XSEC_RELEASE_XMLCH(base); path.sbStrcatIn("/certs/*.crt"); #if defined(_WIN32) // Reverse the "backslash" characters reverseSlash(path); m_handle = (long) _findfirst(path.rawCharBuffer(), &m_finder); res = m_handle; #else if (glob(path.rawCharBuffer(), 0, NULL, &m_globbuf) != 0) res = -1; else res = 0; #endif m_searchStarted = true; } else { #if defined(_WIN32) res = _findnext(m_handle, &m_finder); #else if (m_fcount == (int) m_globbuf.gl_pathc) res = -1; else res = 0; #endif } if (res == -1) { m_searchFinished = true; return NULL; } /* * Create the OpenSSL BIOs necessary to read in the X509 cert */ BIO * bioCert; if ((bioCert = BIO_new(BIO_s_file())) == NULL) { std::cerr << "Error opening certificate file\n\n"; exit (1); } // Create the filename safeBuffer fname; #if defined(_WIN32) fname.sbTranscodeIn(mp_baseURI); fname.sbStrcatIn("/certs/"); fname.sbStrcatIn(m_finder.name); reverseSlash(fname); #else fname.sbStrcpyIn(m_globbuf.gl_pathv[m_fcount++]); #endif if (BIO_read_filename(bioCert, fname.rawCharBuffer()) <= 0) { std::cerr << "Error opening certificate file\n" << fname.rawCharBuffer() << std::endl; return NULL; } X509 * x509 = d2i_X509_bio(bioCert, NULL); BIO_free(bioCert); return x509; } X509_NAME * X509_NAME_create_from_txt(const char * n) { // I'm sure there must be a function to do this in OpenSSL, but I'm // darned if I can find it. int idx = 0; int j; bool ok = true; X509_NAME_ENTRY * entries[10]; int entCount = 0; char * name = new char[strlen(n)]; char * value = new char[strlen(n)]; while (true) { while (n[idx] == ' ' || n[idx] == '\t' || n[idx] == '\n' || n[idx] == '\r') idx++; if (n[idx] == 0) break; j = 0; while (n[idx] != 0 && n[idx] != '=') { name[j++] = n[idx++]; } if (j == 0 || n[idx] == 0) { ok = false; break; } name[j] = '\0'; idx++; // Now the value j = 0; while (n[idx] != 0 && n[idx] != '\n' && n[idx] != '\r') { if (n[idx] == ',') { // find out if this is a marker for end of RDN int jdx = idx + 1; while (n[jdx] != '\0' && n[jdx] != '=' && n[jdx] != ',') ++jdx; if (n[jdx] != ',') break; } value[j++] = n[idx++]; } if (j == 0) { ok = false; break; } if (n[idx] != 0) idx++; value[j] = '\0'; X509_NAME_ENTRY * xne; xne = X509_NAME_ENTRY_create_by_txt(NULL, name, MBSTRING_ASC, (unsigned char *) value, -1); if (xne != NULL) { entries[entCount++] = xne; if (entCount == 10) { ok = false; break; } } else { ok = false; break; } } delete[] name; delete[] value; X509_NAME *ret = NULL; int i; if (ok) { // Create the return value ret = X509_NAME_new(); for (i = entCount - 1; i >= 0; --i) { if (!X509_NAME_add_entry(ret, entries[i], -1, 0)) { X509_NAME_free(ret); ret = NULL; break; } } } // Clean out the entries for (i = 0; i < entCount; ++i) { X509_NAME_ENTRY_free(entries[i]); } return ret; } bool InteropResolver::checkMatch(DSIGKeyInfoList * lst, X509 * x) { // Check if the parameters in x match the required certificate int sz = (int) lst->getSize(); DSIGKeyInfo* k; for (int i = 0; i < sz; ++i) { k = lst->item(i); if (k->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { DSIGKeyInfoX509 * kx = static_cast(k); const XMLCh * serial = kx->getX509IssuerSerialNumber(); if (serial != NULL) { char * cserial = XMLString::transcode(serial); char * xserial; BIGNUM * bnserial = ASN1_INTEGER_to_BN(x->cert_info->serialNumber, NULL); xserial = BN_bn2dec(bnserial); BN_free(bnserial); if (strcmp(xserial, cserial) == 0) { OPENSSL_free(xserial); XSEC_RELEASE_XMLCH(cserial); return true; } //delete[] xserial; XSEC_RELEASE_XMLCH(cserial); OPENSSL_free(xserial); } /* * Either it's not a serial number, or we didn't pass, so lets * look at the next option. */ const XMLCh * ski = kx->getX509SKI(); if (ski != NULL) { char * cski = XMLString::transcode(ski); int clen = (int) strlen(cski); unsigned char * xski = new unsigned char[clen]; ArrayJanitor j_xski(xski); // Decode OpenSSLCryptoBase64 b64; b64.decodeInit(); int xlen = b64.decode((unsigned char *) cski, clen, xski, clen); xlen += b64.decodeFinish(&xski[xlen], clen - xlen); XSEC_RELEASE_XMLCH(cski); if (xlen != 0) { // Have a buffer with a number in it STACK_OF(X509_EXTENSION) *exts; exts = x->cert_info->extensions; if (exts != NULL) { // Find the Subject Key Identifier OID X509_EXTENSION * ext; ASN1_OBJECT * objski = OBJ_nid2obj(NID_subject_key_identifier); int extn = X509v3_get_ext_by_OBJ(exts, objski, -1); if (extn != -1) { // Dummy up an OCTET_STRING from the xski unsigned char * octxski = new unsigned char[xlen + 2]; ArrayJanitor j_octxski(octxski); octxski[0] = 4; octxski[1] = xlen; memcpy(&octxski[2], xski, xlen); ext = sk_X509_EXTENSION_value(exts,extn); ASN1_OCTET_STRING *skid = ext->value; ASN1_OCTET_STRING * xskid = M_ASN1_OCTET_STRING_new(); ASN1_STRING_set(xskid, octxski, xlen+2); if (ASN1_OCTET_STRING_cmp(xskid, skid) == 0) { ASN1_OCTET_STRING_free(xskid); return true; } } } } } /* Not a subject key identifier */ const XMLCh *sn = kx->getX509SubjectName(); if (sn != NULL) { char * csn = XMLString::transcode(sn); X509_NAME * x509name = X509_get_subject_name(x); X509_NAME * snname = X509_NAME_create_from_txt(csn); XSEC_RELEASE_XMLCH(csn); if (snname != NULL) { if (!X509_NAME_cmp(x509name, snname)) { X509_NAME_free(snname); return true; } X509_NAME_free(snname); } } } } return false; } XSECCryptoKey * InteropResolver::openCertURI(const XMLCh * uri) { // Open a certificate from a file URI relative to the signature file BIO * bioCert; if ((bioCert = BIO_new(BIO_s_file())) == NULL) { return NULL; } safeBuffer fname; char * u = XMLString::transcode(uri); fname.sbTranscodeIn(mp_baseURI); fname.sbStrcatIn("/"); fname.sbStrcatIn(u); XSEC_RELEASE_XMLCH(u); #if defined(_WIN32) reverseSlash(fname); #endif if (BIO_read_filename(bioCert, fname.rawCharBuffer()) <= 0) { return NULL; } X509 * x509 = d2i_X509_bio(bioCert, NULL); BIO_free(bioCert); OpenSSLCryptoX509 oX509(x509); X509_free(x509); return oX509.clonePublicKey(); } XSECCryptoKey * InteropResolver::resolveKey(DSIGKeyInfoList * lst) { // First check if this has an X509 cert + an X509 CRL const XMLCh * b64cert = NULL; const XMLCh * b64crl = NULL; int lstSize = (int) lst->getSize(); for (int i = 0; i < lstSize; ++i) { DSIGKeyInfo * ki; ki = lst->item(i); const XMLCh * rawuri; if (ki->getKeyInfoType() == DSIGKeyInfo::KEYINFO_X509) { DSIGKeyInfoX509 * kix509 = static_cast(ki); if ((rawuri = kix509->getRawRetrievalURI()) != NULL) { // We have a raw certificate by de-reference // Assume it is just a file dereference and open the cert return openCertURI(rawuri); } if (kix509->getCertificateListSize() == 1) { b64cert = kix509->getCertificateItem(0); } if (b64crl == NULL) { b64crl = kix509->getX509CRL(); } } else if (ki->getKeyInfoType() == DSIGKeyInfo::KEYINFO_NAME) { DSIGKeyInfoName * kn = static_cast(ki); if (kn->getKeyName() != NULL) { static XMLCh certStr[] = { XERCES_CPP_NAMESPACE_QUALIFIER chLatin_c, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_e, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_r, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_t, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_s, XERCES_CPP_NAMESPACE_QUALIFIER chForwardSlash, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; static XMLCh extStr[] = { XERCES_CPP_NAMESPACE_QUALIFIER chPeriod, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_c, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_r, XERCES_CPP_NAMESPACE_QUALIFIER chLatin_t, XERCES_CPP_NAMESPACE_QUALIFIER chNull }; safeBuffer fname; fname = certStr; fname.sbXMLChCat(kn->getKeyName()); fname.sbXMLChCat(extStr); fname.sbStrlwr(); return openCertURI(fname.rawXMLChBuffer()); } } } if (b64cert != NULL && b64crl != NULL) { // We have a certificate and a crl, lets get the cert and check in the crl OpenSSLCryptoBase64 b64; char * transb64cert = XMLString::transcode(b64cert); unsigned char * x509buf = new unsigned char[strlen(transb64cert)]; ArrayJanitor j_x509buf(x509buf); int x509bufLen; X509 *x; b64.decodeInit(); x509bufLen = b64.decode((unsigned char *) transb64cert, (unsigned int) strlen(transb64cert), x509buf, (unsigned int) strlen(transb64cert)); x509bufLen += b64.decodeFinish(&x509buf[x509bufLen], (unsigned int) strlen(transb64cert) - x509bufLen); XSEC_RELEASE_XMLCH(transb64cert); if (x509bufLen > 0) { #if defined(XSEC_OPENSSL_D2IX509_CONST_BUFFER) x = d2i_X509(NULL, (const unsigned char **) (&x509buf), x509bufLen ); #else x = d2i_X509(NULL, &x509buf, x509bufLen); #endif } else return NULL; // Something has gone wrong if (x == NULL) return NULL; // Now the CRL char * transb64crl = XMLString::transcode(b64crl); unsigned char * crlbuf = new unsigned char[strlen(transb64crl)]; ArrayJanitor j_crlbuf(crlbuf); int crlbufLen; X509_CRL * c; b64.decodeInit(); crlbufLen = b64.decode((unsigned char*) transb64crl, (unsigned int) strlen(transb64crl), crlbuf, (unsigned int) strlen(transb64crl)); crlbufLen += b64.decodeFinish(&crlbuf[crlbufLen], (unsigned int) strlen(transb64crl) - crlbufLen); XSEC_RELEASE_XMLCH(transb64crl); if (crlbufLen > 0) { #if defined(XSEC_OPENSSL_D2IX509_CONST_BUFFER) c = d2i_X509_CRL(NULL, (const unsigned char **) (&crlbuf), crlbufLen); #else c = d2i_X509_CRL(NULL, &crlbuf, crlbufLen); #endif } else return NULL; // Something has gone wrong if (c == NULL) return NULL; // Now check if the cert is in the CRL (code lifted from OpenSSL x509_vfy.c int idx; X509_REVOKED rtmp; /* Look for serial number of certificate in CRL */ rtmp.serialNumber = X509_get_serialNumber(x); idx = sk_X509_REVOKED_find(c->crl->revoked, &rtmp); /* Not found: OK */ if(idx != -1) { std::cerr << "Warning - certificate revoked in attached CRL" << std::endl; } OpenSSLCryptoX509 ox(x); X509_free(x); X509_CRL_free(c); return ox.clonePublicKey(); } // Do a run through each match in the directory while (m_searchFinished == false) { X509 * x = nextFile2Cert(); if (x != NULL) { if (checkMatch(lst, x)) { OpenSSLCryptoX509 ox(x); X509_free(x); return ox.clonePublicKey(); } } X509_free(x); } return false; } XSECKeyInfoResolver * InteropResolver::clone(void) const { return new InteropResolver(mp_baseURI); } #endif /* XSEC_HAVE_OPENSSL */ xml-security-c-1.7.3/xsec/tools/c14n/c14n.cpp000644 001751 001751 00000012252 12003301052 021701 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * c14n := tool to dump a XML file to the console after canonacalising it thru * c14n * * $Id: c14n.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ //XSEC includes //#include //#include #include #include #include #include #include #include #include #include #include // XSEC #include #include #include XERCES_CPP_NAMESPACE_USE using std::endl; using std::cout; using std::cerr; void printUsage(void) { cerr << "\nUsage: c14n [-n] [-x] [-1.1] [-id ID] \n"; cerr << " -n = No comments\n"; cerr << " -1.1 = Use c14n 1.1\n"; cerr << " -x = Use exclusive c14n\n"; cerr << " -id ID = References node to canonicalize by ID\n\n"; } int main(int argc, char **argv) { const char* id = NULL; bool printComments = true; bool exclusive = false; bool inclusive11 = false; // Check arguments if (argc < 2) { printUsage(); exit (1); } if (argc > 2) { for (int i = 1; i < argc - 1; ++i) { if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "-N")) printComments = false; else if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "-X")) exclusive = true; else if (!strcmp(argv[i], "-1.1")) inclusive11 = true; else if (!strcmp(argv[i], "-id") && argc > i + 1) id = argv[++i]; else { cerr << "Unknown option %s\n\n"; printUsage(); exit (1); } } } // Initialise the XML system try { XMLPlatformUtils::Initialize(); XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Create and set up the parser XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setValidationScheme(XercesDOMParser::Val_Never); parser->setDoSchema(false); parser->setCreateEntityReferenceNodes(false); // Now parse out file bool errorsOccured = false; xsecsize_t errorCount = 0; try { parser->parse(argv[argc-1]); errorCount = parser->getErrorCount(); if (errorCount > 0) errorsOccured = true; } catch (const XMLException& e) { cerr << "An error occured during parsing\n Message: " << e.getMessage() << endl; errorsOccured = true; } catch (const DOMException& e) { cerr << "A DOM error occured during parsing\n DOMException code: " << e.code << endl; errorsOccured = true; } if (errorsOccured) { cout << "Errors during parse" << endl; exit (1); } /* Now that we have the parsed file, get the DOM document and start looking at it */ DOMNode *subtree = NULL; DOMDocument *theDOM = parser->getDocument(); if (id) { XMLCh* temp = XMLString::transcode(id); subtree = theDOM->getElementById(temp); XSEC_RELEASE_XMLCH(temp); if (!subtree) { cerr << "ID reference did not resolve" << endl; exit(1); } } // Create the canonicalizer XSECC14n20010315* canon=NULL; if (subtree) canon = new XSECC14n20010315(theDOM, subtree); else canon = new XSECC14n20010315(theDOM); canon->setCommentsProcessing(printComments); canon->setUseNamespaceStack(true); if (inclusive11) canon->setInclusive11(); else if (exclusive) canon->setExclusive(); // canon->XPathSelectNodes("(/descendant-or-self::node() | /descendant-or-self::node()/attribute::* | /descendant-or-self::node()/namespace::*)[ self::ietf:e1 or (parent::ietf:e1 and not(self::text() or self::e2)) or count (id(\"E3\") | ancestor-or-self::node()) = count (ancestor-or-self::node())]"); char buffer[512]; xsecsize_t res = canon->outputBuffer((unsigned char *) buffer, 128); while (res != 0) { buffer[res] = '\0'; cout << buffer; res = canon->outputBuffer((unsigned char *) buffer, 128); } cout << endl; delete canon; delete parser; XSECPlatformUtils::Terminate(); XMLPlatformUtils::Terminate(); return 0; } xml-security-c-1.7.3/xsec/tools/threadTest/threadtest.cpp000644 001751 001751 00000042134 12003301052 024647 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * threadTest := Run up a number of threads signing and validating * the signatures. * * Author(s): Berin Lautenbach * * $Id: threadtest.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC #include #include #include #if defined (XSEC_HAVE_OPENSSL) # include #else # if defined (XSEC_HAVE_WINCAPI) # include # else # error No crypto provider available # endif #endif #include #include #include #include #include #include #include #include #include #include #include #define WIN32_LEAN_AND_MEAN #include #include using std::endl; using std::cerr; using std::cout; using std::queue; using std::vector; using std::ostrstream; XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Globals used and read by all threads // -------------------------------------------------------------------------------- #define numThreads 7 #define secretKey "secret" #define sleepTime 30 typedef queue charQueueType; XSECProvider * g_provider; HANDLE g_toVerifyQueueSemaphore; HANDLE g_toSignQueueSemaphore; XMLMutex g_toVerifyQueueMutex; charQueueType g_toVerifyQueue; // Control markers XMLMutex g_initMutex; bool g_completed; int g_initVerifyCount; int g_initSignCount; unsigned int g_signCount[numThreads]; unsigned int g_verifyCount[numThreads]; unsigned int g_errors; // -------------------------------------------------------------------------------- // Document manipulation functions // -------------------------------------------------------------------------------- void outputDoc (DOMImplementation *impl, DOMDocument * doc) { XMLFormatTarget *formatTarget = new StdOutFormatTarget(); // Output a doc to stdout #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(doc, theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); theSerializer->writeNode(formatTarget, *doc); #endif cout << endl; delete theSerializer; delete formatTarget; } void addDocToQueue (DOMImplementation *impl, DOMDocument * doc) { // Output a document to a memory buffer and add the buffer to // the queue MemBufFormatTarget *formatTarget = new MemBufFormatTarget(); #if defined (XSEC_XERCES_DOMLSSERIALIZER) // DOM L3 version as per Xerces 3.0 API DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // Get the config so we can set up pretty printing DOMConfiguration *dc = theSerializer->getDomConfig(); dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false); // Now create an output object to format to UTF-8 DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); Janitor j_theOutput(theOutput); theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8")); theOutput->setByteStream(formatTarget); theSerializer->write(doc, theOutput); #else DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8")); if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false)) theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false); theSerializer->writeNode(formatTarget, *doc); #endif // Copy to a new buffer xsecsize_t len = formatTarget->getLen(); char * buf = new char [len + 1]; memcpy(buf, formatTarget->getRawBuffer(), len); buf[len] = '\0'; // Add to the queue (but wait for queue to be small enough) WaitForSingleObject(g_toSignQueueSemaphore, INFINITE); g_toVerifyQueueMutex.lock(); g_toVerifyQueue.push(buf); g_toVerifyQueueMutex.unlock(); // Signal a validate thread that this is ready to read ReleaseSemaphore(g_toVerifyQueueSemaphore, 1, NULL); delete theSerializer; delete formatTarget; } DOMText *createDocSkeleton(DOMImplementation *impl, char * tid) { // Create a new document skeleton that can be used by the // calling thread //g_providerMutex.lock(); DOMDocument *doc = impl->createDocument( 0, MAKE_UNICODE_STRING("Document"), NULL); //g_providerMutex.unlock(); DOMElement *rootElem = doc->getDocumentElement(); // Add the thread ID element DOMElement * tidElem = doc->createElement(MAKE_UNICODE_STRING("ThreadID")); tidElem->appendChild(doc->createTextNode(MAKE_UNICODE_STRING(tid))); rootElem->appendChild(tidElem); rootElem->appendChild(doc->createTextNode(DSIGConstants::s_unicodeStrNL)); // Create an element for the unique element DOMElement * uniqueElem = doc->createElement(MAKE_UNICODE_STRING("UniqueData")); DOMText * uniqueTextElem = doc->createTextNode(MAKE_UNICODE_STRING("preUnique")); rootElem->appendChild(uniqueElem); rootElem->appendChild(doc->createTextNode(DSIGConstants::s_unicodeStrNL)); uniqueElem->appendChild(uniqueTextElem); return uniqueTextElem; } // -------------------------------------------------------------------------------- // Signing Thread // -------------------------------------------------------------------------------- DWORD WINAPI doSignThread (LPVOID Param) { // This is called to start up a new thread int myId; ostrstream msg; ostrstream tid; DOMImplementation *impl; DOMDocument * myDoc; DOMElement * myRootElem; DOMText * myText; impl = reinterpret_cast(Param); const DWORD theThreadID = GetCurrentThreadId(); tid << theThreadID << '\0'; // Obtain an thread number; g_initMutex.lock(); myId = g_initSignCount++; g_initMutex.unlock(); g_signCount[myId] = 0; // Sign while (g_completed == false) { // Create a document to sign myText = createDocSkeleton(impl, tid.str()); myDoc = myText->getOwnerDocument(); myRootElem = myDoc->getDocumentElement(); // The provider object internally manages multiple threads DSIGSignature * sig = g_provider->newSignature(); DSIGReference * ref; DOMElement * sigNode; sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds")); sigNode = sig->createBlankSignature(myDoc, CANON_C14N_COM, SIGNATURE_HMAC, HASH_SHA1); myRootElem->appendChild(sigNode); myRootElem->appendChild(myDoc->createTextNode(DSIGConstants::s_unicodeStrNL)); ref = sig->createReference(MAKE_UNICODE_STRING("")); ref->appendEnvelopedSignatureTransform(); sig->appendKeyName(MAKE_UNICODE_STRING("The secret key is \"secret\"")); #if defined (XSEC_HAVE_OPENSSL) OpenSSLCryptoKeyHMAC * hmacKey = new OpenSSLCryptoKeyHMAC(); #else WinCAPICryptoKeyHMAC * hmacKey = new WinCAPICryptoKeyHMAC(0); #endif hmacKey->setKey((unsigned char *) "secret", (unsigned int) strlen("secret")); sig->setSigningKey(hmacKey); sig->sign(); g_provider->releaseSignature(sig); // Serialise and add to verify queue addDocToQueue(impl, myDoc); myDoc->release(); // Tell the control thread what we have done g_signCount[myId] += 1; // Sleep for a while Sleep (sleepTime + (rand() % sleepTime)); } msg << "Ending signing thread - " << theThreadID << endl << '\0'; cerr << msg.str(); // Allow the output stream memory to be released. tid.freeze(false); msg.freeze(false); return 0; } // -------------------------------------------------------------------------------- // Verify Thread // -------------------------------------------------------------------------------- DWORD WINAPI doVerifyThread (LPVOID Param) { // This is called to start up a new thread int myId; ostrstream msg; DOMImplementation *impl; DOMDocument * myDoc; impl = reinterpret_cast(Param); const DWORD theThreadID = GetCurrentThreadId(); // Find my ID g_initMutex.lock(); myId = g_initVerifyCount++; g_initMutex.unlock(); g_verifyCount[myId] = 0; // Create a parser XercesDOMParser * parser = new XercesDOMParser; parser->setDoNamespaces(true); parser->setCreateEntityReferenceNodes(true); // Wait for a semaphore event to tell us that there is a buffer to validate WaitForSingleObject( g_toVerifyQueueSemaphore , // handle to semaphore INFINITE); while (g_completed == false) { // Get the buffer g_toVerifyQueueMutex.lock(); char * buf = g_toVerifyQueue.front(); g_toVerifyQueue.pop(); g_toVerifyQueueMutex.unlock(); // Signal the signing proceses that there is room in the queue ReleaseSemaphore(g_toSignQueueSemaphore, 1, NULL); // Now parse and validate the signature MemBufInputSource* memIS = new MemBufInputSource ((const XMLByte*) buf, (unsigned int) strlen(buf), "XSECMem"); parser->parse(*memIS); delete(memIS); myDoc = parser->adoptDocument(); if ((rand() % 5) == 1) { // Reset the value of "UniqueData" to invalidate the signature DOMNode * n = myDoc->getDocumentElement()->getFirstChild(); while (n != NULL && (n->getNodeType() != DOMNode::ELEMENT_NODE || !strEquals(n->getNodeName(), "UniqueData"))) n = n->getNextSibling(); if (n != NULL) { n = n->getFirstChild(); if (n->getNodeType() == DOMNode::TEXT_NODE) { n->setNodeValue(MAKE_UNICODE_STRING("bad unique data")); } } } DSIGSignature * sig = g_provider->newSignatureFromDOM(myDoc); #if defined (XSEC_HAVE_OPENSSL) OpenSSLCryptoKeyHMAC *hmacKey = new OpenSSLCryptoKeyHMAC(); #else WinCAPICryptoKeyHMAC *hmacKey = new WinCAPICryptoKeyHMAC(0); #endif hmacKey->setKey((unsigned char *) secretKey, (unsigned int) strlen(secretKey)); sig->setSigningKey(hmacKey); sig->load(); if (sig->verify() != true) { // Re-use the init Mutex to protect g_errors g_initMutex.lock(); g_errors++; g_initMutex.unlock(); } g_provider->releaseSignature(sig); // Delete the validated buffer delete[] buf; // Clean the doc myDoc->release(); g_verifyCount[myId] += 1; Sleep (sleepTime + (rand() % sleepTime)); // Wait for another object WaitForSingleObject( g_toVerifyQueueSemaphore , // handle to semaphore INFINITE); } msg << "Ending validate thread : " << theThreadID << endl << '\0'; cerr << msg.str(); msg.freeze(false); delete parser; return 0; } // -------------------------------------------------------------------------------- // Control thread - used to shut down program // -------------------------------------------------------------------------------- DWORD WINAPI doControlThread (LPVOID Param) { // Output stats and shutdown when done using std::cin; using std::cout; // Quick and dirty cin.peek(); // Signal all other threads g_completed = true; ReleaseSemaphore(g_toVerifyQueueSemaphore, 5, NULL); ReleaseSemaphore(g_toSignQueueSemaphore, 5, NULL); return 0; } // -------------------------------------------------------------------------------- // Output Thread // -------------------------------------------------------------------------------- DWORD WINAPI doOutputThread (LPVOID Param) { // Output stats int i, total, lastSignTotal, lastVerifyTotal; lastSignTotal = lastVerifyTotal = 0; while (g_completed != true) { // Output some info cerr << "Signing Threads" << endl; cerr << "---------------" << endl << endl; total = 0; for (i = 0; i < numThreads; ++ i) { cerr << "Thread: " << g_signCount[i] << endl; total += g_signCount[i]; } cerr << endl << "Total: " << total << endl; cerr << "Ops/Sec: " << total - lastSignTotal << endl << endl; lastSignTotal = total; cerr << "Verify Threads" << endl; cerr << "--------------" << endl << endl; total = 0; for (i = 0; i < numThreads; ++ i) { cerr << "Thread: " << g_verifyCount[i] << endl; total += g_verifyCount[i]; } cerr << endl << "Total: " << total << endl; cerr << "Ops/Sec: " << total - lastVerifyTotal << endl << endl; lastVerifyTotal = total; cerr << "Total Errors : " << g_errors << endl; cerr << "Buffers in Queue : " << (unsigned int) g_toVerifyQueue.size() << endl; // Go to sleep for a second Sleep(1000); } return 0; } // -------------------------------------------------------------------------------- // Start up threads // -------------------------------------------------------------------------------- void runThreads(DOMImplementation * impl, int nThreads) { // Set up the worker queue g_toVerifyQueueSemaphore = CreateSemaphore(NULL, 0, 20, "verifyQueue"); g_toSignQueueSemaphore = CreateSemaphore(NULL, 20, 20, "signQueue"); // Ensure nobody stops too soon g_completed = false; // How many signature errors do we have? g_errors = 0; int i; for (i = 0; i < numThreads; ++i) { g_signCount[i] = 0; g_verifyCount[i] = 0; } vector hThreads; hThreads.reserve(nThreads); i = 0; for (; i < nThreads; ++i) { DWORD threadID; const HANDLE hThread = CreateThread( 0, 4096, // Stack size for thread. doSignThread, // pointer to thread function reinterpret_cast(impl), // argument for new thread 0, // creation flags &threadID); assert(hThread != 0); hThreads.push_back(hThread); } for (; i < nThreads * 2; ++i) { DWORD threadID; const HANDLE hThread = CreateThread( 0, 4096, // Stack size for thread. doVerifyThread, // pointer to thread function reinterpret_cast(impl), // argument for new thread 0, // creation flags &threadID); assert(hThread != 0); hThreads.push_back(hThread); } // Start the control thread DWORD threadID; const HANDLE hThread = CreateThread( 0, 4096, // Stack size for thread. doControlThread, // pointer to thread function reinterpret_cast(impl), // argument for new thread 0, // creation flags &threadID); assert(hThread != 0); hThreads.push_back(hThread); // Start the output thread const HANDLE h2Thread = CreateThread( 0, 4096, // Stack size for thread. doOutputThread, // pointer to thread function reinterpret_cast(impl), // argument for new thread 0, // creation flags &threadID); assert(h2Thread != 0); hThreads.push_back(h2Thread); WaitForMultipleObjects((DWORD) hThreads.size(), &hThreads[0], TRUE, INFINITE); for (i = 0; i < nThreads; ++i) { CloseHandle(hThreads[i]); } // Clear out the unverified buffers while (g_toVerifyQueue.size() != 0) { char * buf = g_toVerifyQueue.front(); g_toVerifyQueue.pop(); delete[] buf; } } // -------------------------------------------------------------------------------- // Main // -------------------------------------------------------------------------------- int main (int argc, char ** argv) { // Initialise the XML system try { XMLPlatformUtils::Initialize(); XSECPlatformUtils::Initialise(); } catch (const XMLException &e) { cerr << "Error during initialisation of Xerces" << endl; cerr << "Error Message = : " << e.getMessage() << endl; } // Create a single implementation DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(MAKE_UNICODE_STRING("core")); // Initialise that which needs to be initialised prior to thread startup g_provider = new XSECProvider; runThreads(impl, numThreads); // Clean up delete g_provider; XSECPlatformUtils::Terminate(); XMLPlatformUtils::Terminate(); return 0; } xml-security-c-1.7.3/xsec/framework/XSECConfig.hpp.in000644 001751 001751 00000004673 12462600235 023554 0ustar00scantorscantor000000 000000 /* xsec/framework/XSECConfig.hpp.in. Generated from configure.ac by autoheader. */ /* Define if NSS is in use. */ #undef XSEC_HAVE_NSS /* Define if OpenSSL is in use. */ #undef XSEC_HAVE_OPENSSL /* Define to 1 if strcasecmp present. */ #undef XSEC_HAVE_STRCASECMP /* Define to 1 if getcwd(NULL, 0) works. */ #undef XSEC_HAVE_GETCWD_DYN /* Define to 1 if Xalan is unavailable. */ #undef XSEC_NO_XALAN /* Define to 1 if OpenSSL has EVP_CIPHER_CTX_set_padding. */ #undef XSEC_OPENSSL_CANSET_PADDING /* Define to 1 if OpenSSL uses const input buffers. */ #undef XSEC_OPENSSL_CONST_BUFFERS /* Define to 1 if OpenSSL X509 API has const input buffer. */ #undef XSEC_OPENSSL_D2IX509_CONST_BUFFER /* Define to 1 if OpenSSL has full AES support. */ #undef XSEC_OPENSSL_HAVE_AES /* Define to 1 if OpenSSL has GCM support. */ #undef XSEC_OPENSSL_HAVE_GCM /* Define to 1 if OpenSSL has CRYPTO_cleanup_all_ex_data. */ #undef XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA /* Define to 1 if OpenSSL has EC support. */ #undef XSEC_OPENSSL_HAVE_EC /* Define to 1 if OpenSSL has SHA2 support. */ #undef XSEC_OPENSSL_HAVE_SHA2 /* Define to 1 if Xalan XPathEvaluator requires NodeRefList. */ #undef XSEC_SELECTNODELIST_REQS_NODEREFLIST /* Define to 1 if Xalan requires MemoryManager */ #undef XSEC_XALAN_REQS_MEMORYMANAGER /* Define to 1 if Xalan XercesParserLiaison ctor takes XercesDOMSupport. */ #undef XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT /* Define to 1 if Xerces has a 64-bit-safe API. */ #undef XSEC_XERCES_64BITSAFE /* Define to 1 if Xerces DOMEntity has getInputEncoding. */ #undef XSEC_XERCES_DOMENTITYINPUTENCODING /* Define to 1 if Xerces has DOMLSSerializer. */ #undef XSEC_XERCES_DOMLSSERIALIZER /* Define to 1 if Xerces XMLFormatter requires version. */ #undef XSEC_XERCES_FORMATTER_REQUIRES_VERSION /* Define to 1 if Xerces DOM ID methods take extra parameter. */ #undef XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE /* Define to 1 if Xerces has legacy setIdAttribute. */ #undef XSEC_XERCES_HAS_SETIDATTRIBUTE /* Define to 1 if Xerces InputStream class requires getContentType. */ #undef XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE /* Define to 1 if Xerces XMLFormatter requires MemoryManager. */ #undef XSEC_XERCES_REQUIRES_MEMMGR /* Define to 1 if Xerces XMLString has release method. */ #undef XSEC_XERCES_XMLSTRING_HAS_RELEASE /* Define to 1 if Xalan XSLException returns XalanDOMString. */ #undef XSEC_XSLEXCEPTION_RETURNS_DOMSTRING #include xml-security-c-1.7.3/xsec/framework/resource.h000644 001751 001751 00000000614 12003301053 022520 0ustar00scantorscantor000000 000000 //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by version.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif xml-security-c-1.7.3/xsec/framework/version.rc000644 001751 001751 00000005453 12475453106 022565 0ustar00scantorscantor000000 000000 //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (Australia) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END 2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,7,3,0 PRODUCTVERSION 1,7,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "0c0904b0" BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "The Apache Software Foundation\0" VALUE "FileDescription", "Santuario C++ XML Security Library\0" VALUE "FileVersion", "1, 7, 3, 0\0" #ifdef _DEBUG VALUE "InternalName", "xsec_1_7D\0" #else VALUE "InternalName", "xsec_1_7\0" #endif VALUE "LegalCopyright", "Copyright � 2002-2015 The Apache Software Foundation\0" VALUE "LegalTrademarks", "\0" #ifdef _DEBUG VALUE "OriginalFilename", "xsec_1_7D.dll\0" #else VALUE "OriginalFilename", "xsec_1_7.dll\0" #endif VALUE "PrivateBuild", "\0" VALUE "ProductName", "Santuario C++ XML Security Library\0" VALUE "ProductVersion", "1, 7, 3, 0\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0xc09, 1200 END END #endif // !_MAC #endif // English (Australia) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED xml-security-c-1.7.3/xsec/framework/XSECAlgorithmHandler.hpp000644 001751 001751 00000023565 12003301053 025152 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmHandler := Interface class to define handling of * encryption and signature algorithms * * $Id: XSECAlgorithmHandler.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECALGHANDLER_INCLUDE #define XSECALGHANDLER_INCLUDE // XSEC Includes #include class TXFMChain; class XENCEncryptionMethod; class XSECCryptoKey; class safeBuffer; class XSECBinTXFMInputStream; XSEC_DECLARE_XERCES_CLASS(DOMDocument); // Xerces /** * @ingroup xenc *\@{*/ /** * @brief Interface class to provide handlers for processing different * encryption, signature and hashing types. * * The XENCCipher class allows users and callers to register algorithm * handlers for different Type URIs, as used in the various XML Signature * or Encryption elements. * * Default handlers are provided by the * library, and are used to process all algorithms defined as mandatory * (and many optional) within the standard. * * Users can extend this class to provide custom algorithm handlers * for their own classes. * * @note The library will use a single clone of any provided object for * a given algorithm. So all implementation classes must be * thread safe! */ class XSECAlgorithmHandler { public: /** @name Constructors and Destructors */ //@{ virtual ~XSECAlgorithmHandler() {}; //@} /** @name Encryption Methods */ //@{ /** * \brief Encrypt an input Transform chain to a safeBuffer. * * This method takes a TXFMChain that will provide the plain * text data, and places the encrypted and base64 encoded output * in a safeBuffer. * * The EncryptionMethod object is provided so that any algorithm * specific parameters can be embedded by the processor. Default * parameters can be set directly (OAEParams and KeySize). Anything * additional will need to be set within the DOM directly. * * @param plainText Chain that will provide the plain bytes. Ownership * remains with the caller - do not delete. * @param encryptionMethod Information about the algorithm to use. * Can also be used to set the required encryption parameters * @param key The key that has been provided by the calling * application to perform the encryption. * * @param doc Document in which to operate * @param result SafeBuffer object to place result into * @note This is not quite the symmetric opposite of decryptToSafeBuffer * because of the way the library uses transformers. It is expected * that this method will create a safeBuffer with base64 encoded * data. (It's easier to throw a TXFMBase64 txfmer on the end of the * chain than to do the encryption and then separately base64 encode.) */ virtual bool encryptToSafeBuffer( TXFMChain * plainText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ) = 0; //@} /** @name Decryption Methods */ //@{ /** * \brief Decrypt an input Transform chain to a safeBuffer. * * This method takes a TXFMChain that will provide the cipher * text data, and places the output in a safeBuffer. * * The EncryptionMethod object is provided so that any algorithm * specific parameters can be found by the processor. It also * allows applications to embed multiple algorithms in a single * processing object. The Type value can then be read from the * EncryptionMethod object to determine what to do. * * @param cipherText Chain that will provide the cipherText. * Ownership remains with the caller - do not delete. * @param encryptionMethod Information about the algorithm to use * @param key The key that has been determined via a resolver or * that has been provided by the calling application. * @param doc Document in which to operate * @param result SafeBuffer object to place result into * @returns The number of plain bytes placed in the safeBuffer */ virtual unsigned int decryptToSafeBuffer( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc, safeBuffer & result ) = 0; /** * \brief Append an appropriate decrypt TXFMer to a cipher txfm chain. * * This method takes a TXFMChain that will provide the cipher * text data, and appends the appropriate cipher transformer to * decrypt the output. * * The EncryptionMethod object is provided so that any algorithm * specific parameters can be found by the processor. It also * allows applications to embed multiple algorithms in a single * processing object. The Type value can then be read from the * EncryptionMethod object to determine what to do. * * @param cipherText Chain that will provide the cipherText. * Ownership remains with the caller - do not delete. * @param encryptionMethod Information about the algorithm to use * @param key The key that has been determined via a resolver or * that has been provided by the calling application. * @param doc Document from which to create XML Nodes * @returns The resulting BinInputStream */ virtual bool appendDecryptCipherTXFM( TXFMChain * cipherText, XENCEncryptionMethod * encryptionMethod, XSECCryptoKey * key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc ) = 0; //@} /** @name SigningMethods */ //@{ /** * \brief Sign an input TXFMChain. * * This method takes a TXFMChain that will provide the plain * text data, and places a (null terminated) base64 encoded * hash into a result safeBuffer. * * Unlike the encryption methods, the URI must also be passed in, * as a single AlgorithmHandler might be used to support multiple * different signing algorithms, but the overhead of passing in the * entire SignedInfo is not required. * * @param plainText Chain that will provide the plain bytes. Ownership * remains with the caller - do not delete. * @param URI Algorithm URI to use for the signing operation. * @param key The key that has been provided by the calling * application to perform the signature. * @param outputLength Max length of an HMAC signature to use in output * @param result SafeBuffer object to place result into * @returns the number of bytes placed in the output safeBuffer */ virtual unsigned int signToSafeBuffer( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key, unsigned int outputLength, safeBuffer & result ) = 0; /** * \brief Validate a signature using an input TXFMChain * * Using the input plain text bytes (in the form of a transform chain) * validate the associated base64 encoded signature using the supplied * key. * * The URI value is used to determine the algorithm to be called upon to * validate the signature. * * @param plainText Chain that will provide the plain bytes. Ownership * remains with the caller - do not delete. * @param URI Algorithm URI to use for the signing operation. * @param sig Base64 encoded signature value * @param key The key that has been provided by the calling * application to perform the signature. * @returns true if successful validate, false otherwise */ virtual bool verifyBase64Signature( TXFMChain * inputBytes, const XMLCh * URI, const char * sig, unsigned int outputLength, XSECCryptoKey * key ) = 0; //@} /** @name Hash appending */ //@{ /** * \brief Append a signature hash to a TXFM Chain based on URI * * Given a URI string create the appropriate hash TXFM. NOTE the * input URI should be a SIGNATURE URI - e.g. #hash-sha1 * * @param inputBytes the Input TXFMChain to append the hash to * @param uri URI string to match hash against * @param key The key for this signature (in case of an HMAC hash) * @returns true if a match was found and a hash was appended */ virtual bool appendSignatureHashTxfm( TXFMChain * inputBytes, const XMLCh * URI, XSECCryptoKey * key ) = 0; /** * \brief Append a hash to a TXFM Chain based on URI * * Given a URI string create the appropriate hash TXFM. NOTE the * input URI should be a "stright" (i.e. non-signature) hash * algorithm URI - e.g. #sha1 * * @param inputBytes the Input TXFMChain to append the hash to * @param uri URI string to match hash against * @returns true if a match was found and a hash was appended */ virtual bool appendHashTxfm( TXFMChain * inputBytes, const XMLCh * URI ) = 0; //@} /** @name Key handling */ //@{ /** * \brief Create a key that will support a given URI * * Given a URI string and a raw bit string, create the associated key * * @param uri URI string to match key to * @param keyBuffer Raw bits to set in the key * @param keyLen Number of bytes in the key */ virtual XSECCryptoKey * createKeyForURI( const XMLCh * uri, const unsigned char * keyBuffer, unsigned int keyLen ) = 0; //@} /** @name Miscellaneous Functions */ //@{ /** * \brief Create a new instance of the handler * * Provides a means for the library to create a new instance * of the object without knowing its type */ virtual XSECAlgorithmHandler * clone(void) const = 0; //@} }; /*\@}*/ #endif /* XSECALGHANDLER_INCLUDE*/ xml-security-c-1.7.3/xsec/framework/XSECURIResolver.hpp000644 001751 001751 00000005773 12003301053 024110 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolver := Virtual Interface class that takes a URI and * creates a binary input stream from it. * * $Id: XSECURIResolver.hpp 1125514 2011-05-20 19:08:33Z scantor $ */ #ifndef XSECURIRESOLVER_INCLUDE #define XSECURIRESOLVER_INCLUDE #include XSEC_DECLARE_XERCES_CLASS(BinInputStream); /** * @ingroup pubsig */ /*\@{*/ /** * @brief Interface class for resolving URIs. * * The XML Digital Signature standard makes heavy use of URIs to * identify information to be referenced and signed. * * The library internally handles reference URIs within the * document that contains the signature, but uses URIResolver * classes to dereference a URI into a byte stream that can * then be processed. * * The interface class allows others to re-implement and install * their own resolves according to their needs. The basic * implementations found in the library are just that - very basic. * Enough to do the job for interoperability testing, but not * enough to provide robustness in a major application. * */ class DSIG_EXPORT XSECURIResolver { public: /** @name Constructors and Destructors */ //@{ XSECURIResolver() {}; virtual ~XSECURIResolver() {}; //@} /** @name Interface Methods */ //@{ /** * \brief Create a BYTE_STREAM from a URI. * * The resolver is required to take the input URI and * dereference it to an actual stream of octets. * * The octets are provided back to the library using * the Xerces BinInputStream class. * * @note The returned stream is "owned" by the caller, which * will delete it when processing is complete. * @param uri The string containing the URI to be de-referenced. NULL * if this is an anonymous reference. * @returns The octet stream corresponding to the URI. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * resolveURI(const XMLCh * uri) = 0; /** * \brief Clone the resolver to be installed in a new object. * * When URIResolvers are passed into signatures and other * objects, they are cloned and control of the original object * is left with the caller. * */ virtual XSECURIResolver * clone(void) = 0; //@} }; #endif /* XSECURIRESOLVER_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECDefs.hpp000644 001751 001751 00000011140 12157707211 022611 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECDefs := File for general XSEC definitions * * Author(s): Berin Lautenbach * * $Id: XSECDefs.hpp 1493962 2013-06-17 22:32:41Z scantor $ * */ // Use Xerces to do the "hard work in determining compilers etc." for us #ifndef XSECDEFS_HEADER #define XSECDEFS_HEADER // General includes #include #include // Include the generated include file #if defined (_WIN32) # include # if defined (_DEBUG) && defined (_XSEC_DO_MEMDEBUG) # define _CRTDBG_MAP_ALLOC # include # endif # define WIN32_LEAN_AND_MEAN # include #elif defined (XSEC_LIBRARY_BUILD) # include "config.h" #else # include #endif // Xalan //#include // Xerces #include // Define "sizes" of data to correspond to Xerces APIs #ifdef XSEC_XERCES_64BITSAFE typedef XMLSize_t xsecsize_t; #else typedef unsigned int xsecsize_t; #endif // Pending API change, compile in a limit for Xerces SecurityManager entity expansion #define XSEC_ENTITY_EXPANSION_LIMIT 1000 // -------------------------------------------------------------------------------- // Namespace Handling // -------------------------------------------------------------------------------- // Use an approach similar to that used in Xalan to process Xerces namespaces #if defined(XERCES_HAS_CPP_NAMESPACE) # define XSEC_USING_XERCES(NAME) using XERCES_CPP_NAMESPACE :: NAME # define XSEC_DECLARE_XERCES_CLASS(NAME) namespace XERCES_CPP_NAMESPACE { class NAME; } # define XSEC_DECLARE_XERCES_STRUCT(NAME) namespace XERCES_CPP_NAMESPACE { struct NAME; } #else # define XERCES_CPP_NAMESPACE_QUALIFIER # define XERCES_CPP_NAMESPACE_BEGIN # define XERCES_CPP_NAMESPACE_END # define XERCES_CPP_NAMESPACE_USE # define XSEC_USING_XERCES(NAME) # define XSEC_DECLARE_XERCES_CLASS(NAME) class NAME; # define XSEC_DECLARE_XERCES_STRUCT(NAME) struct NAME; #endif #if defined (XSEC_XERCES_XMLSTRING_HAS_RELEASE) # define XSEC_RELEASE_XMLCH(x) XMLString::release(&(x)) #else # define XSEC_RELEASE_XMLCH(x) delete[] (x); #endif // -------------------------------------------------------------------------------- // Project Library Handling // -------------------------------------------------------------------------------- #if defined (PLATFORM_EXPORT) # define XSEC_PLATFORM_EXPORT PLATFORM_EXPORT # define XSEC_PLATFORM_IMPORT PLATFORM_IMPORT #else # define XSEC_PLATFORM_EXPORT XERCES_PLATFORM_EXPORT # define XSEC_PLATFORM_IMPORT XERCES_PLATFORM_IMPORT #endif #if defined (PROJ_CANON) #define CANON_EXPORT XSEC_PLATFORM_EXPORT #else #define CANON_EXPORT XSEC_PLATFORM_IMPORT #endif #if defined (PROJ_DSIG) #define DSIG_EXPORT XSEC_PLATFORM_EXPORT #else #define DSIG_EXPORT XSEC_PLATFORM_IMPORT #endif // Platform includes. Much of this is taken from Xalan #if defined(_MSC_VER) // Microsoft VC++ # pragma warning(disable: 4127 4251 4511 4503 4512 4514 4702 4710 4711 4786 4097; error: 4150 4172 4238 4239 4715) # define XSEC_NO_COVARIANT_RETURN_TYPE /* * Removed to allow any compiler to compile - might not work, but .... * #elif defined(__GNUC__) * #elif defined(__INTEL_COMPILER) * #else * #error Unknown compiler. */ #endif // Configuration includes // We want to use XPath calculated transforms //#define XSEC_USE_XPATH_ENVELOPE // Given the configuration - what should we set? #ifdef XSEC_NO_XALAN // Xalan is not available! # define XSEC_NO_XPATH # define XSEC_NO_XSLT #endif /* XSEC_NO_XALAN */ #ifdef XSEC_NO_XPATH # ifdef XSEC_USE_XPATH_ENVELOPE # undef XSEC_USE_XPATH_ENVELOPE # endif #endif #ifdef XSEC_LIBRARY_BUILD # ifdef XSEC_HAVE_STRCASECMP # define _stricmp(x,y) strcasecmp(x,y) # else # define _stricmp(x,y) stricmp(x,y) # endif #endif #endif /* XSECDEFS_HEADER */ xml-security-c-1.7.3/xsec/framework/XSECEnv.hpp000644 001751 001751 00000035663 12003301053 022460 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECEnv := Configuration class - used by the other classes to retrieve * information on the environment they are working under * * $Id: XSECEnv.hpp 1350043 2012-06-13 22:31:04Z scantor $ * */ #ifndef XSECENV_INCLUDE #define XSECENV_INCLUDE // XSEC Includes #include #include #include // Xerces Includes #include class XSECURIResolver; /** * @ingroup internal */ /*\@{*/ /** * @brief Holds environmental information * * The various XSEC classes need to be able to retrieve information * about the environment they are operating in (namespace prefixes, * owning document etc.) - this class is used to provide and hold * this info. * */ class DSIG_EXPORT XSECEnv { public: /** @name Constructors and Destructors */ //@{ /** * \brief Contructor. * */ XSECEnv(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); XSECEnv(const XSECEnv & theOther); virtual ~XSECEnv(); //@} /** @name Prefix handling. */ //@{ /** * \brief Set the prefix be used for the DSIG namespace. * *

When the XSEC library creates XML Element nodes, it uses the prefix here * for all nodes created. By default, the library assumes that the default * namespace is used.

* *

The #createBlankSignature function will use this prefix to setup the * dsig namespace. E.g. (assuming a call has been made to set the prefix to "ds") * the \ element will have a namespace attribute added of

* *

xmlns:ds="http://www.w3.org/2000/09/xmldsig#"

* *

If no prefix has been set, this attribute will be set as the default namespace

* * @see #createBlankSignature * @param prefix The UTF-16 encoded NS prefix to use for the XML * Digital Signature nodes */ void setDSIGNSPrefix(const XMLCh * prefix); /** * \brief Set the prefix be used for the DSIG 1.1 namespace. * *

When the XSEC library creates XML Element nodes, it uses the prefix here * for all nodes created. By default, the library assumes that the default * namespace is used.

* * @param prefix The UTF-16 encoded NS prefix to use for the XML * Digital Signature 1.1 nodes */ void setDSIG11NSPrefix(const XMLCh * prefix); /** * \brief Set the prefix be used for the Exclusive Canonicalisation namespace. * * The Exclusive Canonicalisation specification defines a new namespace for the * InclusiveNamespaces node. This function can be used to set the prefix * that the library will use when creating nodes within this namespace. * *

xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#"

* * If no prefix is set, the default namespace will be used * * @see #createBlankSignature * @param prefix The UTF-16 encoded NS prefix to use for the XML * Exclusive Canonicalisation nodes */ void setECNSPrefix(const XMLCh * prefix); /** * \brief Set the prefix be used for the XPath-Filter2 namespace. * * The XPathFilter definition uses its own namespace. This * method can be used to set the prefix that the library will use * when creating elements in this namespace * *

xmlns:ds="http://www.w3.org/2002/06/xmldsig-filter2"

* * If no prefix is set, the default namespace will be used * * @see #createBlankSignature * @param prefix The UTF-16 encoded NS prefix to use for the XPath * filter nodes */ void setXPFNSPrefix(const XMLCh * prefix); /** * \brief Set prefix for XENC nodes * * Set the namespace prefix the library will use when creating * nodes in the XENC namespace */ void setXENCNSPrefix(const XMLCh * prefix); /** * \brief Set prefix for XENC 1.1 nodes * * Set the namespace prefix the library will use when creating * nodes in the XENC 1.1 namespace */ void setXENC11NSPrefix(const XMLCh * prefix); /** * \brief Set prefix for XKMS nodes * * Set the namespace prefix the library will use when creating * nodes in the XKMS namespace */ void setXKMSNSPrefix(const XMLCh * prefix); /** * \brief Get the NS Prefix being used for DSIG elements. * * @returns A pointer to the buffer holding the prefix * @see #setDSIGNSPrefix * */ const XMLCh * getDSIGNSPrefix() const {return mp_prefixNS;} /** * \brief Get the NS Prefix being used for DSIG 1.1 elements. * * @returns A pointer to the buffer holding the prefix * @see #setDSIG11NSPrefix * */ const XMLCh * getDSIG11NSPrefix() const {return mp_11PrefixNS;} /** * \brief Get the NS being used for EC nodes * * @returns A pointer to the buffer holding the prefix * @see #setECNSPrefix */ const XMLCh * getECNSPrefix() const {return mp_ecPrefixNS;} /** * \brief Get the NS being used for XPath Filter2 nodes * * @returns A pointer to the buffer holding the prefix * @see #setXPFNSPrefix */ const XMLCh * getXPFNSPrefix() const {return mp_xpfPrefixNS;} /** * \brief Get namespace prefix for XENC nodes * * Find the string being used by the library to prefix nodes in the * xenc: namespace. * * @returns XENC namespace prefix */ const XMLCh * getXENCNSPrefix(void) const {return mp_xencPrefixNS;} /** * \brief Get the NS Prefix being used for XENC 1.1 elements. * * @returns A pointer to the buffer holding the prefix * @see #setXENC11NSPrefix * */ const XMLCh * getXENC11NSPrefix() const {return mp_xenc11PrefixNS;} /** * \brief Get namespace prefix for XKMS nodes * * Find the string being used by the library to prefix nodes in the * xkms: namespace. * * @returns XKMS namespace prefix */ const XMLCh * getXKMSNSPrefix(void) const {return mp_xkmsPrefixNS;} //@} /** @name Pretty Printing Functions */ //@{ /** * \brief Set Pretty Print flag * * The pretty print flag controls whether the library will output * CR/LF after the elements it adds to a document * * By default the library will do pretty printing (flag is true) * * @param flag Value to set the flag (true = do pretty printing) */ void setPrettyPrintFlag(bool flag) {m_prettyPrintFlag = flag;} /** * \brief Return the current value of the PrettyPrint flag * * @returns The value of the pretty print flag */ bool getPrettyPrintFlag(void) const {return m_prettyPrintFlag;} /** * \brief Do a pretty print output * * The library calls this function to perform CR/LF outputting * * At the moment htis is really redundant, but it is more a holder * so that we can set up something in the library to allow users * to install a pretty print function. * * @param node Node to append pretty print content to */ void doPrettyPrint(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node) const; //@} /** @name General information functions */ //@{ /** * \brief * * Get the DOMDocument that the super class is operating within. * * Mainly used by the library itself. * * @returns The DOM_Document node. */ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * getParentDocument() const {return mp_doc;} /** * \brief * * Set the DOMDocument that the super class is operating within. * * Mainly used by the library itself. * * @param doc The Document node. */ void setParentDocument(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc) {mp_doc = doc;} //@} /** @name Resolver manipulation */ //@{ /** * \brief Register a URIResolver * * Registers a URIResolver to be used by the Signature when dereferencing * a URI in a Reference element * */ void setURIResolver(XSECURIResolver * resolver); /** * \brief Return a pointer to the resolver being used * * @returns A pointer to the URIResolver registered in this signature */ XSECURIResolver * getURIResolver(void) const; //@} /** @name ID handling */ //@{ /** * \brief Set Id finding behaviour * * The library de-references "#obj" URI references to ID attributes within * a DOM document. Currently, the library first uses DOM calls to find if * the Id has been properly set within the document via the parser or one * of the DOM Level 3 calls to set an Id. * * If no Id is found of the correct name, the library then starts searching * for attributes of a given name with the required value. This list defaults * to "id" and "Id", but can be modified via a call to addIdAttributeName() * * The setIdByAttributeName call enables or disables the second part of the Id * search. I.e. when the Id doesn't exist as an attribute of Type=ID, whether or * not to search for an attribute of a name in the list of names. By default * this behaviour is enabled. * * @warning This is currently enabled by default for backwards compatibility * reasons only. Future version may reverse this and ship disabled by default, as * this behaviour is a potential security risk. * * @param flag Enable (true) or Disable (false) searching for Id attributes by name */ void setIdByAttributeName(bool flag); /** * \brief Determine Id finding behaviour * * Allows a caller to determine whether the library is currently searching for * Id attributes by name * * @returns The value of the IdByAttributeName flag */ bool getIdByAttributeName(void) const; /** * \brief Add an attribute name to be searched for when looking for Id attributes * * This allows a user to add an attribute name to be used to identify Id attributes * when they are not set to be of Type=ID in the DOM * * @note Two names are registered by default - "Id" and "id". These can be * removed by calling deregisterIdAttributeName * * @param name Name to append to the list of those used to find Id attributes */ void registerIdAttributeName(const XMLCh * name); /** * \brief Remove an attribute name to be searched for when looking for Id attributes * * This allows a user to de-register a particular name to be used to identify Id * attributes. * * @param name Name to remove from the list of those used to find Id attributes * @returns true if found and removed, false if was not in the list */ bool deregisterIdAttributeName(const XMLCh * name); /** * \brief Determine if an attribute name is registered as an Id name * * @param name String to check in the idAttributeName list * @returns true if the passed in name is registered as an Attribute name */ bool isRegisteredIdAttributeName(const XMLCh * name) const; /** * \brief Add an attribute name and namespace to be searched for when looking for * Id attributes * * This allows a user to add an attribute name in a parcicular namespace to * be used to identify Id attributes * when they are not set to be of Type=ID in the DOM * * @note Two names are registered by default - "Id" and "id". These can be * removed by calling deregisterIdAttributeName * * @param ns Namespace URI in which attribute appears * @param name Name to append to the list of those used to find Id attributes */ void registerIdAttributeNameNS(const XMLCh * ns, const XMLCh * name); /** * \brief Remove an attribute name and namespace to be searched for when * looking for Id attributes * * This allows a user to de-register a particular name to be used to identify Id * attributes. * * @param ns Namespace in which attribute resides * @param name Name to remove from the list of those used to find Id attributes * @returns true if found and removed, false if was not in the list */ bool deregisterIdAttributeNameNS(const XMLCh *ns, const XMLCh * name); /** * \brief Determine if an attribute name and namespace is registered * as an Id name * * @param ns Namespace in which attribute resides * @param name String to check in the idAttributeName list * @returns true if the passed in name is registered as an Attribute name */ bool isRegisteredIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) const; /** * \brief Get number of Attribute Names registered as Id attributes * * @returns the number of elements in the list */ int getIdAttributeNameListSize() const; /* * \brief Get an indexed attribute name to use as an Id * * Returns the item at index point in the list * * @note This is an internal function and should not be called directly * * @param index Pointer into the list * @returns The indicated element or NULL if it does not exist. */ const XMLCh * getIdAttributeNameListItem(int index) const; /* * \brief Get an indexed attribute Namespace to use as an Id * * Returns the item at index point in the list * * @note This is an internal function and should not be called directly * * @param index Pointer into the list * @returns The indicated element or NULL if it does not exist. */ const XMLCh * getIdAttributeNameListItemNS(int index) const; /* * \brief Determine whether the indexed item is namespace aware * * Returns the item at index point in the list * * @note This is an internal function and should not be called directly * * @param index Pointer into the list * @returns The indicated element or NULL if it does not exist. */ bool getIdAttributeNameListItemIsNS(int index) const; //@} /** @name Formatters */ //@{ /** * \brief Get a safeBufferFormatter * * Return a UTF-8 safeBuffer formatter * * @returns A pointer to a safeBuffer formatter */ XSECSafeBufferFormatter * getSBFormatter(void) const {return mp_formatter;} //@} private: struct IdAttributeStruct; typedef struct IdAttributeStruct IdAttributeType; #if defined(XSEC_NO_NAMESPACES) typedef vector IdNameVectorType; #else typedef std::vector IdNameVectorType; #endif // Internal functions XSECSafeBufferFormatter * mp_formatter; XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * mp_doc; // For creating functions XMLCh * mp_prefixNS; XMLCh * mp_11PrefixNS; XMLCh * mp_ecPrefixNS; XMLCh * mp_xpfPrefixNS; XMLCh * mp_xencPrefixNS; XMLCh * mp_xenc11PrefixNS; XMLCh * mp_xkmsPrefixNS; // Resolvers XSECURIResolver * mp_URIResolver; // Flags bool m_prettyPrintFlag; bool m_idByAttributeNameFlag; // Id handling IdNameVectorType m_idAttributeNameList; XSECEnv(); /*\@}*/ }; #endif /* XSECENV_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECException.hpp000644 001751 001751 00000011513 12003301053 023652 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECException:= How we throw exceptions in XSEC * * Author(s): Berin Lautenbach * * $Id: XSECException.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECEXCEPTION_INCLUDE #define XSECEXCEPTION_INCLUDE #include /** * @addtogroup pubsig * @{ */ /** * @brief Exception Class. * *

This class is used for all Exceptions raised by the XSEC library. * It holds a "type" number that can be used to find the generic type * of the exception, as well as a XMLCh string that holds a description of * the error

* */ class DSIG_EXPORT XSECException { public: /** * \brief Type of Exception thrown. * * This enumerated type is used to inform the recipient of the * exception what generic error caused it to be raised. */ enum XSECExceptionType { None = 0, MemoryAllocationFail = 1, NoHashFoundInDigestValue = 2, UnknownDSIGAttribute = 3, ExpectedDSIGChildNotFound = 4, UnknownTransform = 5, TransformInputOutputFail = 6, IDNotFoundInDOMDoc = 7, UnsupportedXpointerExpr = 8, XPathError = 9, XSLError = 10, Unsupported = 11, LoadEmptySignature = 12, LoadNonSignature = 13, UnknownCanonicalization = 14, UnknownSignatureAlgorithm = 15, LoadEmptyX509 = 16, LoadNonX509 = 17, OpenSSLError = 18, SigVfyError = 19, LoadEmptySignedInfo = 20, LoadNonSignedInfo = 21, ExpectedReferenceURI = 22, NotLoaded = 23, CryptoProviderError = 24, KeyInfoError = 25, SigningError = 26, LoadEmptyInfoName = 27, LoadNonInfoName = 28, UnknownKeyValue = 29, SignatureCreationError = 30, ErrorOpeningURI = 31, ProviderError = 32, InternalError = 33, EnvelopeError = 34, UnsupportedFunction = 35, TransformError = 36, SafeBufferError = 37, HTTPURIInputStreamError = 38, LoadEmptyXPathFilter = 39, XPathFilterError = 40, DNameDecodeError = 41, // Encryption errors EncryptedTypeError = 42, ExpectedXENCChildNotFound = 43, CipherDataError = 44, CipherValueError = 45, CipherError = 46, AlgorithmMapperError = 47, EncryptionMethodError = 48, CipherReferenceError = 49, ObjectError = 50, // XKMS Error XKMSError = 51, ExpectedXKMSChildNotFound = 52, MessageAbstractTypeError = 53, RequestAbstractTypeError = 54, ResultTypeError = 55, StatusError = 56, UnknownError = 58 // Must be last! }; /** @name Constructors and Destructors */ //@{ /** * \brief General Constructor * * Generic constructor used within the library. Where inMsg == NULL, * the general string for this exception type will be used. * * @param eNum Exception type * @param inMsg Msg to be used or NULL for general system message */ XSECException(XSECExceptionType eNum, const XMLCh * inMsg = NULL); /** * \brief Local code page constructor * * Shortcut constructor to allow local code page strings to be used * for the message. Strings are converted to UTF-16. * * @param eNum Exception type * @param inMsg Msg to be used or NULL for general system message */ XSECException(XSECExceptionType eNum, const char * inMsg); // XSECException(XSECExceptionType eNum, safeBuffer &inMsg); /** * \brief Copy Constructor */ XSECException(const XSECException &toCopy); /** * \brief Destructor */ ~XSECException(); //@} /** @name Information functions */ //@{ /** * \brief Get message * * Return a pointer to the XMLCh buffer holding the error message * * @returns A pointer to the buffer within the exception that holds the * error message */ const XMLCh * getMsg(void); /** * \brief Get error type * * Returns an XSECExceptionType coding of the generic error that raised * this exception * * @returns The excetpion type */ XSECExceptionType getType(void); private: XMLCh * msg; // Message to the caller XSECExceptionType type; // Type of exception /* Unimplemented Constructor */ XSECException(); }; /** @}*/ #endif /* XSECEXCEPTION_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECError.hpp000644 001751 001751 00000004350 12003301053 023006 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECError := General include file for handling errors * * Author(s): Berin Lautenbach * * $Id: XSECError.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include /** * @defgroup pubsig Main Signature API * This section describes the main classes and interfaces necessary for * programming with the XML-Security-C library. * @{ */ /** * \brief Error strings * * An array that can be used to obtain an error string associated with * an exception number. */ extern const char * XSECExceptionStrings []; /** @} */ #if defined (_WIN32) && defined (_DEBUG) && defined (_XSEC_DO_MEMDEBUG_OLD) # define XSECnew( a, b ) \ try {\ if (( a = DEBUG_NEW b ) == NULL) { \ throw XSECException (XSECException::MemoryAllocationFail); \ }\ } \ catch (XSECCryptoException &e) \ {\ throw XSECException (XSECException::InternalError, e.getMsg()); \ } \ catch (std::bad_alloc&) { \ throw XSECException (XSECException::MemoryAllocationFail); \ } #else # define XSECnew(a, b) \ try {\ if ((a = new b) == NULL) { \ throw XSECException (XSECException::MemoryAllocationFail); \ } \ } \ catch (XSECCryptoException &e) \ {\ throw XSECException (XSECException::InternalError, e.getMsg()); \ } \ catch (std::bad_alloc&) { \ throw XSECException (XSECException::MemoryAllocationFail); \ } #endif xml-security-c-1.7.3/xsec/framework/XSECProvider.hpp000644 001751 001751 00000017676 12003301053 023526 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECProvider.hpp := Main interface class that applications use to * get access to Signature and Encryption functions. * * $Id: XSECProvider.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECPROVIDER_INCLUDE #define XSECPROVIDER_INCLUDE #include #include #include #include #include #include /** * @addtogroup pubsig * @{ */ /** * @brief The main provider class for XML Digital Signatures and Encryption objects. * *

The XSECProvider class is used to create and destroy signature objects and * encryption objects. It provides a number of methods to create signature * and encryption objects for a variety of situations - in particular creating an * empty signature or cipher with which to create the DOM structure or creating a * security object based on an already existing DOM structure.

* */ class DSIG_EXPORT XSECProvider { #if defined(XALAN_NO_NAMESPACES) typedef vector SignatureListVectorType; #else typedef std::vector SignatureListVectorType; #endif #if defined(XALAN_NO_NAMESPACES) typedef vector CipherListVectorType; #else typedef std::vector CipherListVectorType; #endif public: /** @name Constructors and Destructors */ //@{ /** * \brief Default constructor. * *

The provider class requires no parameters for construction

* */ XSECProvider(); ~XSECProvider(); //@} /** @name Signature Creation Classes */ //@{ /** * \brief DSIGSignature creator for use with existing XML signatures or templates. * *

Create a DSIGSignature object based on an already existing * DSIG Signature XML node. It is assumed that the underlying * DOM structure is in place and works correctly.

* *

In this case, the caller can pass in the signature DOM Node for cases * where there may be more than one signature in a document. The caller * needs to specify which signature tree is to be used.

* * @param doc The DOM document node in which the signature is embedded. * @param sigNode The DOM node (within doc) that is to be used as the * base of the signature. * @see DSIGSignature#load */ DSIGSignature * newSignatureFromDOM( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *sigNode ); /** * \brief DSIGSignature creator for use with existing XML signatures or templates. * *

Create a DSIGSignature object based on an already existing * DSIG Signature XML node. It is assumed that the underlying * DOM structure is in place and works correctly.

* *

In this case, the XML-Security libraries will find the signature * node.

* * @note The library will only find and use the first signature node * in the document. If there are more, they will not be validated * @param doc The DOM document node in which the signature is embedded. * @see DSIGSignature#load */ DSIGSignature * newSignatureFromDOM(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc); /** * \brief DSIGSignature creator for creating new XML signatures. * *

Create an empty DSIGSignature object that can be used to create new * signature values. The returned signature object needs to be initialised * with a document so a blank signature DOM structure can be created

* * @see DSIGSignature#createBlankSignature */ DSIGSignature * newSignature(void); /** * \brief Method for destroying DSIGSignature objects created via this provider. * *

The provider keeps track of all signature objects created during the lifetime * of the provider. This method can be called to delete a signature whilst the * provider is still in scope. Otherwise the objects will be automatically * deleted when the provider object goes out of scope.

* *

In cases where the DSIGSignature has been used to create a new DOM structure, * it can be safely deleted once the signature operations have been completed without * impacting the underlying DOM structure.

* * @param toRelease The DSIGSignature object to be deleted. * @todo The DSIGSignature objects are fairly bulky in terms of creation and deletion. * There should be a capability to store "released" objects in a re-use stack. At the * moment the Provider class simply deletes the objects. * @see DSIGSignature#createBlankSignature */ void releaseSignature(DSIGSignature * toRelease); //@} /** @name Encryption Creation Functions */ //@{ /** * \brief Create an XENCCipher object based on a particular DOM Document * * XENCCipher is an engine class that is used to wrap encryption/decryption * functions. Unlike the Signature functions, only a XENCCipher object attached * to a particular document is required. Arbitrary objects within this document * can then be encrypted/decrypted using this class. * * @param doc Document to attach the XENCCipher to. * @returns An implementation object for XENCCipher */ XENCCipher * newCipher(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc); /** * \brief Method to delete XENCCipher objects created via this provider * *

The provider keeps track of all objects by it. This method can be used * to delete any previously created XENCCipher objects prior to the provider * being deleted. Any XENCCipher objects not released using this function will * automatically be deleted when the provider goes out of scope (or is itself * deleted). * * @param toRelease The XENCCipher object to be deleted */ void releaseCipher(XENCCipher * toRelease); //@} /** @name XKMS Functions */ //@{ /** * \brief Obtain a pointer to the XKMSMessageFactory. * * The XKMSMessageFactory is used to create and manipulate XKMS messages. * * @note Unlike other objects created by the provider, only one * XKMSMessageFactory is ever instantiated for a particular provider. * Applications should never delete the Factory, as it is taken * care of by the provider. */ XKMSMessageFactory * getXKMSMessageFactory(void); /** @name Environmental Options */ //@{ /** * \brief Set the default URIResolver. * * DSIGSignature objects require a URIResolver to allow them to de-reference * URIs in reference elements. * * This function sets the resolver that will be used for all * signatures created after this is set. The resolver is * cloned, so the object passed in can be safely deleted once the * function has been completed. */ void setDefaultURIResolver(XSECURIResolver * resolver); //@} private: // Copy constructor is disabled XSECProvider(const XSECProvider &); XSECProvider * operator = (const XSECProvider &); // Internal functions void setup(DSIGSignature *sig); void setup(XENCCipher *cipher); SignatureListVectorType m_activeSignatures; CipherListVectorType m_activeCiphers; XKMSMessageFactory * mp_xkmsMessageFactory; XSECURIResolver * mp_URIResolver; XERCES_CPP_NAMESPACE_QUALIFIER XMLMutex m_providerMutex; }; /** @} */ #endif /* XSECPROVIDER_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECConfig.hpp000644 001751 001751 00000005164 12462600671 023147 0ustar00scantorscantor000000 000000 /* xsec/framework/XSECConfig.hpp. Generated from XSECConfig.hpp.in by configure. */ /* xsec/framework/XSECConfig.hpp.in. Generated from configure.ac by autoheader. */ /* Define if NSS is in use. */ /* #undef XSEC_HAVE_NSS */ /* Define if OpenSSL is in use. */ #define XSEC_HAVE_OPENSSL 1 /* Define to 1 if strcasecmp present. */ #define XSEC_HAVE_STRCASECMP 1 /* Define to 1 if getcwd(NULL, 0) works. */ #define XSEC_HAVE_GETCWD_DYN 1 /* Define to 1 if Xalan is unavailable. */ #define XSEC_NO_XALAN 1 /* Define to 1 if OpenSSL has EVP_CIPHER_CTX_set_padding. */ #define XSEC_OPENSSL_CANSET_PADDING 1 /* Define to 1 if OpenSSL uses const input buffers. */ #define XSEC_OPENSSL_CONST_BUFFERS 1 /* Define to 1 if OpenSSL X509 API has const input buffer. */ #define XSEC_OPENSSL_D2IX509_CONST_BUFFER 1 /* Define to 1 if OpenSSL has full AES support. */ #define XSEC_OPENSSL_HAVE_AES 1 /* Define to 1 if OpenSSL has GCM support. */ /* #undef XSEC_OPENSSL_HAVE_GCM */ /* Define to 1 if OpenSSL has CRYPTO_cleanup_all_ex_data. */ #define XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 /* Define to 1 if OpenSSL has EC support. */ #define XSEC_OPENSSL_HAVE_EC 1 /* Define to 1 if OpenSSL has SHA2 support. */ #define XSEC_OPENSSL_HAVE_SHA2 1 /* Define to 1 if Xalan XPathEvaluator requires NodeRefList. */ /* #undef XSEC_SELECTNODELIST_REQS_NODEREFLIST */ /* Define to 1 if Xalan requires MemoryManager */ /* #undef XSEC_XALAN_REQS_MEMORYMANAGER */ /* Define to 1 if Xalan XercesParserLiaison ctor takes XercesDOMSupport. */ /* #undef XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT */ /* Define to 1 if Xerces has a 64-bit-safe API. */ #define XSEC_XERCES_64BITSAFE 1 /* Define to 1 if Xerces DOMEntity has getInputEncoding. */ #define XSEC_XERCES_DOMENTITYINPUTENCODING 1 /* Define to 1 if Xerces has DOMLSSerializer. */ #define XSEC_XERCES_DOMLSSERIALIZER 1 /* Define to 1 if Xerces XMLFormatter requires version. */ #define XSEC_XERCES_FORMATTER_REQUIRES_VERSION 1 /* Define to 1 if Xerces DOM ID methods take extra parameter. */ #define XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE 1 /* Define to 1 if Xerces has legacy setIdAttribute. */ /* #undef XSEC_XERCES_HAS_SETIDATTRIBUTE */ /* Define to 1 if Xerces InputStream class requires getContentType. */ #define XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE 1 /* Define to 1 if Xerces XMLFormatter requires MemoryManager. */ #define XSEC_XERCES_REQUIRES_MEMMGR 1 /* Define to 1 if Xerces XMLString has release method. */ #define XSEC_XERCES_XMLSTRING_HAS_RELEASE 1 /* Define to 1 if Xalan XSLException returns XalanDOMString. */ /* #undef XSEC_XSLEXCEPTION_RETURNS_DOMSTRING */ #include xml-security-c-1.7.3/xsec/framework/XSECURIResolverXerces.hpp000644 001751 001751 00000005467 12003301053 025262 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverXerces := Virtual Interface class that takes a URI and * creates a binary input stream from it. * * $Id: XSECURIResolverXerces.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECURIRESOLVERXERCES_INCLUDE #define XSECURIRESOLVERXERCES_INCLUDE #include /** * @ingroup pubsig */ /*\@{*/ /** * @brief URIResolver implementation class based on Xerces functions. * * This class provides the default implementation of the XSECURIResolver * class. If no other resolver is specified, the XSECProvider will * install this into the Signatures that are created. * * The class is very simple - it calls on the Xerces functions * to provide primitive URI resolving support. * */ class DSIG_EXPORT XSECURIResolverXerces : public XSECURIResolver { public: /** @name Constructors and Destructors */ //@{ /** * \brief Constructor * * @param baseURI Provide a URI that relative URIs can be * matched to. */ XSECURIResolverXerces(const XMLCh * baseURI = 0); virtual ~XSECURIResolverXerces(); //@} /** @name Interface Methods */ //@{ /** * \brief Create a BYTE_STREAM from a URI. * * The resolver is required to take the input URI and * dereference it to an actual stream of octets. * * @param uri The string containing the URI to be de-referenced. * @returns The octet stream corresponding to the URI. */ virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * resolveURI(const XMLCh * uri); /** * \brief Clone the resolver to be installed in a new object. * * When URIResolvers are passed into signatures and other * objects, they are cloned and control of the original object * is left with the caller. * */ virtual XSECURIResolver * clone(void); //@} /** @name XSECURIResolverXerces Specific Methods */ //@{ /** * \brief Set the base URI for relative URIs. * */ void setBaseURI(const XMLCh * uri); //@} private: XMLCh * mp_baseURI; }; #endif /* XSECURIRESOLVERXERCES_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECAlgorithmMapper.hpp000644 001751 001751 00000005256 12003301053 025016 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmMapper := Provides a table of AlgorithmHandlers * Mapped by Type URI * * $Id: XSECAlgorithmMapper.hpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #ifndef XSECALGMAPPER_INCLUDE #define XSECALGMAPPER_INCLUDE // XSEC Includes #include #include class XSECAlgorithmHandler; /** * @ingroup internal *\@{*/ /** * @brief Holder class for mapping Algorithms to Handlers * */ class DSIG_EXPORT XSECAlgorithmMapper { public: /** @name Constructors and Destructors */ //@{ XSECAlgorithmMapper(void); ~XSECAlgorithmMapper(); //@} /** @name Default mapping strings */ //@{ static const XMLCh s_defaultEncryptionMapping[]; /** @name Map Methods */ //@{ /** * \brief Map a URI to a handler */ XSECAlgorithmHandler * mapURIToHandler(const XMLCh * URI) const; //@} /** @name Registration Methods */ //@{ /** * \brief Register a new handler */ void registerHandler(const XMLCh * URI, const XSECAlgorithmHandler & handler); /** * \brief Indicate an algorithm is approved for use, implying others are not. */ void whitelistAlgorithm(const XMLCh* URI); /** * \brief Indicate an algorithm is not approved for use, implying others are. */ void blacklistAlgorithm(const XMLCh* URI); //@} private: struct MapperEntry { XMLCh * mp_uri; XSECAlgorithmHandler * mp_handler; }; MapperEntry * findEntry(const XMLCh * URI) const; #if defined(XSEC_NO_NAMESPACES) typedef vector MapperEntryVectorType; typedef vector WhitelistVectorType; #else typedef std::vector MapperEntryVectorType; typedef std::vector WhitelistVectorType; #endif MapperEntryVectorType m_mapping; WhitelistVectorType m_whitelist,m_blacklist; }; /*\@}*/ #endif /* XSECALGMAPPER_INCLUDE */ xml-security-c-1.7.3/xsec/framework/XSECW32Config.hpp000644 001751 001751 00000012227 12462600235 023435 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * Configuration file for Windows platform * * Needs to be modified by hand * * Author(s): Berin Lautenbach * * $Id: XSECW32Config.hpp 1655934 2015-01-30 04:36:29Z scantor $ * */ #include /* * Because we don't have a configure script, we need to rely on version * numbers to understand library idiosycracies */ #if (XERCES_VERSION_MAJOR >= 3) /* Is it possible to setIdAttributes? - DOM level 3 call. V3.x API Version */ # define XSEC_XERCES_HAS_BOOLSETIDATTRIBUTE 1 /* 3.0 no longer supports DOMWriter, must use DOMLSSerializer instead */ # define XSEC_XERCES_DOMLSSERIALIZER 1 /* 3.0 now uses getInputEncoding rather than getEncoding to determine encoding that was found in input document */ # define XSEC_XERCES_DOMENTITYINPUTENCODING 1 /* 3.0 now 64-bit safe */ # define XSEC_XERCES_64BITSAFE 1 /* 3.0 InputStream must expose content type */ # define XSEC_XERCES_INPUTSTREAM_HAS_CONTENTTYPE 1 #endif #if (XERCES_VERSION_MAJOR == 3) || ((XERCES_VERSION_MAJOR == 2) && (XERCES_VERSION_MINOR >= 3)) /* * As of version 2.3, xerces requires a version parameter in XMLFormatter * constructors */ # define XSEC_XERCES_FORMATTER_REQUIRES_VERSION 1 /* 2.3 and above use a user defined Memory Manager. In some cases, this actually needs to be passed to functions */ # define XSEC_XERCES_REQUIRES_MEMMGR 1 /* Does XMLString::release() exist */ # define XSEC_XERCES_XMLSTRING_HAS_RELEASE 1 # if (XERCES_VERSION_MAJOR < 3) /* Is it possible to setIdAttributes? - DOM level 3 call. V2.x API */ # define XSEC_XERCES_HAS_SETIDATTRIBUTE 1 # endif #else /* * In version 2.2, the XMLUri class was broken for relative URI de-referencing */ # define XSEC_XERCES_BROKEN_XMLURI 1 #endif /* * The following defines whether Xalan integration is required. * * Xalan is used for XSLT and complex XPath processing. * Activate this #define if Xalan is not required (or desired) */ #define XSEC_NO_XALAN #if !defined (XSEC_NO_XALAN) # include # if (_XALAN_VERSION <= 10800) # define XSEC_XSLEXCEPTION_RETURNS_DOMSTRING 1 # endif # if (_XALAN_VERSION >= 10900) /* 1.9 and above have XSLException::getType() returns XalanDOMChar *, not XalanDOMString */ # undef XSEC_XSLEXCEPTION_RETURNS_DOMSTRING /* 1.9 and above do not take a XercesDOMSupport as input to the ctor */ # undef XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT /* 1.9 and above require a NodeRefList as input to XPathEvaluator:: selectNodeList */ # define XSEC_SELECTNODELIST_REQS_NODEREFLIST /* 1.9 and above use MemoryManager for the XPath Function classes */ # define XSEC_XALAN_REQS_MEMORYMANAGER # else /* 1.9 and above have XSLException::getType() returns XalanDOMChar *, not XalanDOMString */ # define XSEC_XSLEXCEPTION_RETURNS_DOMSTRING 1 /* 1.9 and above do not take a XercesDOMSupport as input to the ctor */ # define XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT /* 1.9 and above require a NodeRefList as input to XPathEvaluator:: selectNodeList */ # undef XSEC_SELECTNODELIST_REQS_NODEREFLIST /* 1.9 and above use MemoryManager for the XPath Function classes */ # undef XSEC_XALAN_REQS_MEMORYMANAGER # endif #endif /* * Define presence of cryptographic providers */ #define XSEC_HAVE_OPENSSL 1 #define XSEC_HAVE_WINCAPI 1 // NSS Code is currently alpha. It should work, but you will also // need to include the NSS libraries during the link. /* #define XSEC_HAVE_NSS 1 */ /* * Some settings for OpenSSL if we have it * */ #if defined (XSEC_HAVE_OPENSSL) # include # if (OPENSSL_VERSION_NUMBER >= 0x00907000) # define XSEC_OPENSSL_CONST_BUFFERS # define XSEC_OPENSSL_HAVE_AES # define XSEC_OPENSSL_HAVE_EC # define XSEC_OPENSSL_CANSET_PADDING # define XSEC_OPENSSL_HAVE_CRYPTO_CLEANUP_ALL_EX_DATA # endif # if (OPENSSL_VERSION_NUMBER >= 0x00908000) # define XSEC_OPENSSL_D2IX509_CONST_BUFFER # define XSEC_OPENSSL_HAVE_SHA2 # define XSEC_OPENSSL_HAVE_MGF1 # endif # if (OPENSSL_VERSION_NUMBER >= 0x10001000) # define XSEC_OPENSSL_HAVE_GCM # endif #endif /* * Macros used to determine what header files exist on this * system */ /* Posix unistd.h */ /* #define HAVE_UNISTD_H */ /* Windows direct.h */ #define HAVE_DIRECT_H 1 /* Define to 1 if getcwd(NULL, 0) works. */ #define XSEC_HAVE_GETCWD_DYN 1 #include xml-security-c-1.7.3/xsec/framework/XSECVersion.hpp000644 001751 001751 00000004560 12463754252 023374 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSECVersion.hpp * * Version information for the package */ /* * These are the high level numerics that need to be changed to bump the * version number. They are used to create version strings. */ #define XSEC_VERSION_MAJOR 1 #define XSEC_VERSION_MEDIUM 7 #define XSEC_VERSION_MINOR 3 // -------------------------------------------------------------------------------- // Version Handling // -------------------------------------------------------------------------------- /* * The following code makes use of the Xerces version handling macros to define * some constants that can be used during conditional compilation. */ /* This can be used for conditional compilation and for testing during * autoconfigures. * * It will create a string of the form 10000 * MAJOR + 100 * MEDIUM + MINOR * E.g. 10301 for version 1.3.1 */ #define _XSEC_VERSION_FULL CALC_EXPANDED_FORM (XSEC_VERSION_MAJOR,XSEC_VERSION_MEDIUM,XSEC_VERSION_MINOR) /* Some useful strings for versioning - based on the same strings from Xerces */ #define XSEC_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XSEC_VERSION_MAJOR,XSEC_VERSION_MEDIUM,XSEC_VERSION_MINOR) #define XSEC_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XSEC_VERSION_MAJOR,XSEC_VERSION_MEDIUM,XSEC_VERSION_MINOR) #define XSEC_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XSEC_VERSION_MAJOR,XSEC_VERSION_MEDIUM,XSEC_VERSION_MINOR) #define XSEC_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(XSEC_VERSION_MAJOR,XSEC_VERSION_MEDIUM) /* The following is used for backwards compatibility with previous version handling */ #define XSEC_VERSION "XSEC_FULLVERSIONDOT" xml-security-c-1.7.3/xsec/framework/XSECError.cpp000644 001751 001751 00000007703 12003301053 023006 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECError := General class for handling errors * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include #include // Real definition of strings const char * XSECExceptionStrings [] = { "No Error", "Error allocating memory", "No TEXT child found under element", "Unknown Attribute found in DSIG element", "Did not find expected DSIG child element", "Unknown algorithm found in element", "Transform input/output mismatch", "Referenced ID is not in DOM Document", "Unsupported Xpointer expression found", "An error occured during an XPath evalaution", "An error occured during an XSLT transformation", "The called feature is unsupported (general error)", "Attempted to load an empty signature node", "Attempted to load a non signature DOM Node as a ", "Unknown canonicalization algorithm referenced", "Unknown signature and hashing algorithms referenced", "Attempted to load an empty X509Data Node", "Attempted to load a non X509Data node as a ", "Error occurred in OpenSSL routine", "Error occured when attempting to Verify a Signature", "Attempted to load an empty SignedInfo node", "Attempted to load a non SignedInfo node as a ", "Expected URI attribute in node", "A method has been called without load() being called first", "An error occurred when interacting with the Crypto Provider", "An error occurred during processing of list", "An error occurred during a signing operation", "Attempted to load an empty KeyInfoName node", "Attempted to load a non node as a KeyName", "Unknown key type found in element", "An error occurred during the creation of a DSIGSignature object", "An error occurred when trying to open a URI input stream", "An error occurred in the XSEC Provider", "CATASTROPHE - An error has been found in internal state", "An error occurred in the Envelope Transform handler", "A function has been called which is not supported in the compiled library", "An error occured in a DSIGTransform holder", "An error occured in a safe buffer", "An error occurred processing an HTTP request via internal resolver", "An error occurred decoding a DSIG encoded Distinguished name", "An error occurred during processing of an Encrypted[Data|Key] node", "Did not find expected XENC child element", "An error occurred processing a CipherData node", "An error occurred processing a CipherValue node", "An error occurred in the XSECCipher processor", "An error occurred in the Algorithm Mapper", "An error occurred processing an EncryptionMethod node", "An error occurred processing a CipherReference node", "An error occurred processing an Object node", "An error occurred in XKMS processing", "An expected XKMS DOM node or attribute was not found", "An error occurred processing a MessageAbstractType object", "An error occurred processing a RequestAbstractType object", "An error occurred processing a ResultType object", "An error occurred processing a Status object", "Unknown Error type", }; //const char ** XSECExceptionStrings = XSECExceptionStringsArray; xml-security-c-1.7.3/xsec/framework/XSECAlgorithmMapper.cpp000644 001751 001751 00000010660 12003301053 025004 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECAlgorithmMapper := Provides a table of AlgorithmHandlers * Mapped by Type URI * * $Id: XSECAlgorithmMapper.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ // XSEC Includes #include #include #include #include #include // Xerces #include #include XERCES_CPP_NAMESPACE_USE // Default strings const XMLCh XSECAlgorithmMapper::s_defaultEncryptionMapping [] = { chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chLatin_E, chLatin_n, chLatin_c, chLatin_r, chLatin_y, chLatin_p, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; XSECAlgorithmMapper::XSECAlgorithmMapper(void) { } XSECAlgorithmMapper::~XSECAlgorithmMapper() { MapperEntryVectorType::iterator it = m_mapping.begin(); while (it != m_mapping.end()) { XSEC_RELEASE_XMLCH(((*it)->mp_uri)); delete (*it)->mp_handler; delete (*it); it++; } m_mapping.clear(); XMLCh* ptr; for (WhitelistVectorType::const_iterator i = m_whitelist.begin(); i != m_whitelist.end(); ++i) { ptr = *i; XSEC_RELEASE_XMLCH(ptr); } m_whitelist.clear(); for (WhitelistVectorType::const_iterator i = m_blacklist.begin(); i != m_blacklist.end(); ++i) { ptr = *i; XSEC_RELEASE_XMLCH(ptr); } m_blacklist.clear(); } XSECAlgorithmMapper::MapperEntry * XSECAlgorithmMapper::findEntry(const XMLCh * URI) const { MapperEntryVectorType::const_iterator it = m_mapping.begin(); while (it != m_mapping.end()) { if (strEquals((*it)->mp_uri, URI)) { return (*it); } it++; } return NULL; } XSECAlgorithmHandler * XSECAlgorithmMapper::mapURIToHandler(const XMLCh * URI) const { bool allowed = true; if (!m_whitelist.empty()) { allowed = false; for (WhitelistVectorType::const_iterator i = m_whitelist.begin(); !allowed && i != m_whitelist.end(); ++i) { if (XMLString::equals(URI, *i)) allowed = true; } } if (allowed && !m_blacklist.empty()) { for (WhitelistVectorType::const_iterator i = m_blacklist.begin(); allowed && i != m_blacklist.end(); ++i) { if (XMLString::equals(URI, *i)) allowed = false; } } if (!allowed) { safeBuffer output; output.sbTranscodeIn("XSECAlgorithmMapper::mapURIToHandler - URI "); output.sbXMLChCat(URI); output.sbXMLChCat(" disallowed by whitelist/blacklist policy"); throw XSECException(XSECException::AlgorithmMapperError, output.rawXMLChBuffer()); } MapperEntry * entry = findEntry(URI); if (entry == NULL) { safeBuffer output; output.sbTranscodeIn("XSECAlgorithmMapper::mapURIToHandler - URI "); output.sbXMLChCat(URI); output.sbXMLChCat(" not found"); throw XSECException(XSECException::AlgorithmMapperError, output.rawXMLChBuffer()); } return entry->mp_handler; } void XSECAlgorithmMapper::registerHandler(const XMLCh * URI, const XSECAlgorithmHandler & handler) { MapperEntry * entry = findEntry(URI); if (entry != NULL) { delete entry->mp_handler; } else { XSECnew(entry, MapperEntry); entry->mp_uri = XMLString::replicate(URI); m_mapping.push_back(entry); } entry->mp_handler = handler.clone(); } void XSECAlgorithmMapper::whitelistAlgorithm(const XMLCh* URI) { m_whitelist.push_back(XMLString::replicate(URI)); } void XSECAlgorithmMapper::blacklistAlgorithm(const XMLCh* URI) { m_blacklist.push_back(XMLString::replicate(URI)); } xml-security-c-1.7.3/xsec/framework/XSECEnv.cpp000644 001751 001751 00000026303 12147777032 022471 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECEnv := Configuration class - used by the other classes to retrieve * information on the environment they are working under * * $Id: XSECEnv.cpp 1478615 2013-05-03 00:07:02Z scantor $ * */ // XSEC Includes #include #include #include #include #include #include struct XSECEnv::IdAttributeStruct { bool m_useNamespace; /* Was this defined with a namespace? */ XMLCh * mp_namespace; /* Namespace of attribute */ XMLCh * mp_name; /* Name of attribute */ }; XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Default prefix strings // -------------------------------------------------------------------------------- const XMLCh s_default11Prefix[] = { chLatin_d, chLatin_s, chDigit_1, chDigit_1, chNull }; const XMLCh s_defaultECPrefix[] = { chLatin_e, chLatin_c, chNull }; const XMLCh s_defaultXPFPrefix[] = { chLatin_x, chLatin_p, chLatin_f, chNull }; const XMLCh s_defaultXENCPrefix[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chNull }; const XMLCh s_defaultXENC11Prefix[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chDigit_1, chDigit_1, chNull }; const XMLCh s_defaultXKMSPrefix[] = { chLatin_x, chLatin_k, chLatin_m, chLatin_s, chNull }; // -------------------------------------------------------------------------------- // Default Id names // -------------------------------------------------------------------------------- const XMLCh s_Id[] = { chLatin_I, chLatin_d, chNull }; const XMLCh s_id[] = { chLatin_i, chLatin_d, chNull }; // -------------------------------------------------------------------------------- // Env // -------------------------------------------------------------------------------- // Constructors and Destructors XSECEnv::XSECEnv(DOMDocument *doc) { mp_doc = doc; mp_prefixNS = XMLString::replicate(DSIGConstants::s_unicodeStrEmpty); mp_11PrefixNS = XMLString::replicate(s_default11Prefix); mp_ecPrefixNS = XMLString::replicate(s_defaultECPrefix); mp_xpfPrefixNS = XMLString::replicate(s_defaultXPFPrefix); mp_xencPrefixNS = XMLString::replicate(s_defaultXENCPrefix); mp_xenc11PrefixNS = XMLString::replicate(s_defaultXENC11Prefix); mp_xkmsPrefixNS = XMLString::replicate(s_defaultXKMSPrefix); m_prettyPrintFlag = true; mp_URIResolver = NULL; // Set up our formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); // Set up IDs m_idByAttributeNameFlag = true; // At the moment this is on by default // Register "Id" and "id" as valid Attribute names registerIdAttributeName(s_Id); registerIdAttributeName(s_id); } XSECEnv::XSECEnv(const XSECEnv & theOther) { mp_doc = theOther.mp_doc; mp_prefixNS = XMLString::replicate(theOther.mp_prefixNS); mp_11PrefixNS = XMLString::replicate(theOther.mp_11PrefixNS); mp_ecPrefixNS = XMLString::replicate(theOther.mp_ecPrefixNS); mp_xpfPrefixNS = XMLString::replicate(theOther.mp_xpfPrefixNS); mp_xencPrefixNS = XMLString::replicate(theOther.mp_xencPrefixNS); mp_xenc11PrefixNS = XMLString::replicate(s_defaultXENC11Prefix); mp_xkmsPrefixNS = XMLString::replicate(theOther.mp_xkmsPrefixNS); m_prettyPrintFlag = theOther.m_prettyPrintFlag; if (theOther.mp_URIResolver != NULL) mp_URIResolver = theOther.mp_URIResolver->clone(); else mp_URIResolver = NULL; // Set up our formatter XSECnew(mp_formatter, XSECSafeBufferFormatter("UTF-8",XMLFormatter::NoEscapes, XMLFormatter::UnRep_CharRef)); // Set up IDs m_idByAttributeNameFlag = theOther.m_idByAttributeNameFlag; for (int i = 0; i < theOther.getIdAttributeNameListSize() ; ++i) { registerIdAttributeName(theOther.getIdAttributeNameListItem(i)); } } XSECEnv::~XSECEnv() { if (mp_formatter != NULL) { delete mp_formatter; } if (mp_prefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_prefixNS); } if (mp_11PrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_11PrefixNS); } if (mp_ecPrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_ecPrefixNS); } if (mp_xpfPrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_xpfPrefixNS); } if (mp_xencPrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_xencPrefixNS); } if (mp_xenc11PrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_xenc11PrefixNS); } if (mp_xkmsPrefixNS != NULL) { XSEC_RELEASE_XMLCH(mp_xkmsPrefixNS); } if (mp_URIResolver != NULL) { delete mp_URIResolver; } // Clean up Id attribute names IdNameVectorType::iterator it; for (it = m_idAttributeNameList.begin(); it != m_idAttributeNameList.end(); it++) { IdAttributeType * i = *it; if (i->mp_namespace != NULL) XSEC_RELEASE_XMLCH((i->mp_namespace)); if (i->mp_name) XSEC_RELEASE_XMLCH((i->mp_name)); delete *it; } m_idAttributeNameList.empty(); } // -------------------------------------------------------------------------------- // Set and Get Resolvers // -------------------------------------------------------------------------------- void XSECEnv::setURIResolver(XSECURIResolver * resolver) { if (mp_URIResolver != 0) delete mp_URIResolver; mp_URIResolver = resolver->clone(); } XSECURIResolver * XSECEnv::getURIResolver(void) const { return mp_URIResolver; } // -------------------------------------------------------------------------------- // Set and Get Prefixes // -------------------------------------------------------------------------------- void XSECEnv::setDSIGNSPrefix(const XMLCh * prefix) { if (mp_prefixNS != NULL) XSEC_RELEASE_XMLCH(mp_prefixNS); mp_prefixNS = XMLString::replicate(prefix); } void XSECEnv::setDSIG11NSPrefix(const XMLCh * prefix) { if (mp_11PrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_11PrefixNS); mp_11PrefixNS = XMLString::replicate(prefix); } void XSECEnv::setECNSPrefix(const XMLCh * prefix) { if (mp_ecPrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_ecPrefixNS); mp_ecPrefixNS = XMLString::replicate(prefix); } void XSECEnv::setXPFNSPrefix(const XMLCh * prefix) { if (mp_xpfPrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_xpfPrefixNS); mp_xpfPrefixNS = XMLString::replicate(prefix); } void XSECEnv::setXENCNSPrefix(const XMLCh * prefix) { if (mp_xencPrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_xencPrefixNS); mp_xencPrefixNS = XMLString::replicate(prefix); } void XSECEnv::setXENC11NSPrefix(const XMLCh * prefix) { if (mp_xenc11PrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_xenc11PrefixNS); mp_xenc11PrefixNS = XMLString::replicate(prefix); } void XSECEnv::setXKMSNSPrefix(const XMLCh * prefix) { if (mp_xkmsPrefixNS != NULL) XSEC_RELEASE_XMLCH(mp_xkmsPrefixNS); mp_xkmsPrefixNS = XMLString::replicate(prefix); } // -------------------------------------------------------------------------------- // Id Attribute Names Handling // -------------------------------------------------------------------------------- void XSECEnv::setIdByAttributeName(bool flag) { m_idByAttributeNameFlag = flag; } bool XSECEnv::getIdByAttributeName(void) const { return m_idByAttributeNameFlag; } bool XSECEnv::isRegisteredIdAttributeName(const XMLCh * name) const { int sz = (int) m_idAttributeNameList.size(); for (int i = 0; i < sz; ++i) { if (!m_idAttributeNameList[i]->m_useNamespace && strEquals(m_idAttributeNameList[i]->mp_name, name)) return true; } return false; } void XSECEnv::registerIdAttributeName(const XMLCh * name) { if (isRegisteredIdAttributeName(name)) return; IdAttributeType * iat; iat = new IdAttributeType; m_idAttributeNameList.push_back(iat); iat->m_useNamespace = false; iat->mp_namespace = NULL; iat->mp_name = XMLString::replicate(name); } bool XSECEnv::deregisterIdAttributeName(const XMLCh * name) { IdNameVectorType::iterator it; for (it = m_idAttributeNameList.begin(); it != m_idAttributeNameList.end(); it++) { if (!((*it)->m_useNamespace) && strEquals((*it)->mp_name, name)) { // Remove this item XSEC_RELEASE_XMLCH(((*it)->mp_name)); delete *it; m_idAttributeNameList.erase(it); return true; } } return false; } bool XSECEnv::isRegisteredIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) const { int sz = (int) m_idAttributeNameList.size(); for (int i = 0; i < sz; ++i) { if (m_idAttributeNameList[i]->m_useNamespace && strEquals(m_idAttributeNameList[i]->mp_namespace, ns) && strEquals(m_idAttributeNameList[i]->mp_name, name)) return true; } return false; } void XSECEnv::registerIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) { if (isRegisteredIdAttributeNameNS(ns, name)) return; IdAttributeType * iat; iat = new IdAttributeType; m_idAttributeNameList.push_back(iat); iat->m_useNamespace = true; iat->mp_namespace = XMLString::replicate(ns);; iat->mp_name = XMLString::replicate(name); } bool XSECEnv::deregisterIdAttributeNameNS(const XMLCh * ns, const XMLCh * name) { IdNameVectorType::iterator it; for (it = m_idAttributeNameList.begin(); it != m_idAttributeNameList.end(); it++) { if (((*it)->m_useNamespace) && strEquals((*it)->mp_namespace, ns) && strEquals((*it)->mp_name, name)) { // Remove this item XSEC_RELEASE_XMLCH(((*it)->mp_name)); delete *it; m_idAttributeNameList.erase(it); return true; } } return false; } int XSECEnv::getIdAttributeNameListSize() const { return (int) m_idAttributeNameList.size(); } const XMLCh * XSECEnv::getIdAttributeNameListItem(int index) const { if (index >= 0 && index < (int) m_idAttributeNameList.size()) return m_idAttributeNameList[index]->mp_name; return NULL; } const XMLCh * XSECEnv::getIdAttributeNameListItemNS(int index) const { if (index >= 0 && index < (int) m_idAttributeNameList.size()) return m_idAttributeNameList[index]->mp_namespace; return NULL; } bool XSECEnv::getIdAttributeNameListItemIsNS(int index) const { if (index >= 0 && index < (int) m_idAttributeNameList.size()) return m_idAttributeNameList[index]->m_useNamespace; return false; } // -------------------------------------------------------------------------------- // Set and Get Resolvers // -------------------------------------------------------------------------------- void XSECEnv::doPrettyPrint(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node) const { // Very simple if (m_prettyPrintFlag) node->appendChild(mp_doc->createTextNode(DSIGConstants::s_unicodeStrNL)); } xml-security-c-1.7.3/xsec/framework/XSECProvider.cpp000644 001751 001751 00000013541 12003301053 023504 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECProvider.hpp := The main interface for users wishing to gain access * to signature objects * * $Id: XSECProvider.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include "../xenc/impl/XENCCipherImpl.hpp" #include "../xkms/impl/XKMSMessageFactoryImpl.hpp" XERCES_CPP_NAMESPACE_USE // -------------------------------------------------------------------------------- // Constructors/Destructors // -------------------------------------------------------------------------------- XSECProvider::XSECProvider() { mp_URIResolver = new XSECURIResolverXerces(); XSECnew(mp_xkmsMessageFactory, XKMSMessageFactoryImpl()); } XSECProvider::~XSECProvider() { // First delete signatures SignatureListVectorType::iterator i; for (i = m_activeSignatures.begin(); i != m_activeSignatures.end(); ++i) delete *i; m_activeSignatures.clear(); if (mp_URIResolver != NULL) delete mp_URIResolver; // Now delete ciphers CipherListVectorType::iterator j; for (j = m_activeCiphers.begin(); j != m_activeCiphers.end(); ++j) delete *j; m_activeCiphers.clear(); // Clean up XKMS stuff delete mp_xkmsMessageFactory; } // -------------------------------------------------------------------------------- // Signature Creation/Deletion // -------------------------------------------------------------------------------- DSIGSignature * XSECProvider::newSignatureFromDOM(DOMDocument *doc, DOMNode *sigNode) { DSIGSignature * ret; XSECnew(ret, DSIGSignature(doc, sigNode)); setup(ret); return ret; } DSIGSignature * XSECProvider::newSignatureFromDOM(DOMDocument *doc) { DSIGSignature * ret; DOMNode *sigNode = findDSIGNode(doc, "Signature"); if (sigNode == NULL) { throw XSECException(XSECException::SignatureCreationError, "Could not find a signature node in passed in DOM document"); } XSECnew(ret, DSIGSignature(doc, sigNode)); setup(ret); return ret; } DSIGSignature * XSECProvider::newSignature(void) { DSIGSignature * ret; XSECnew(ret, DSIGSignature()); setup(ret); return ret; } void XSECProvider::releaseSignature(DSIGSignature * toRelease) { // Find in the active list SignatureListVectorType::iterator i; m_providerMutex.lock(); i = m_activeSignatures.begin(); while (i != m_activeSignatures.end() && *i != toRelease) ++i; if (i == m_activeSignatures.end()) { m_providerMutex.unlock(); throw XSECException(XSECException::ProviderError, "Attempt to release a signature that was not created by this provider"); } // For now - remove from list. Would be better to recycle m_activeSignatures.erase(i); m_providerMutex.unlock(); delete toRelease; } // -------------------------------------------------------------------------------- // Cipher Creation/Deletion // -------------------------------------------------------------------------------- XENCCipher * XSECProvider::newCipher(DOMDocument * doc) { XENCCipherImpl * ret; XSECnew(ret, XENCCipherImpl(doc)); setup(ret); return ret; } void XSECProvider::releaseCipher(XENCCipher * toRelease) { // Find in the active list CipherListVectorType::iterator i; m_providerMutex.lock(); i = m_activeCiphers.begin(); while (i != m_activeCiphers.end() && *i != toRelease) ++i; if (i == m_activeCiphers.end()) { m_providerMutex.unlock(); throw XSECException(XSECException::ProviderError, "Attempt to release a cipher that was not created by this provider"); } // For now - remove from list. Would be better to recycle m_activeCiphers.erase(i); m_providerMutex.unlock(); delete toRelease; } // -------------------------------------------------------------------------------- // XKMS Methods // -------------------------------------------------------------------------------- XKMSMessageFactory * XSECProvider::getXKMSMessageFactory(void) { return mp_xkmsMessageFactory; } // -------------------------------------------------------------------------------- // Environmental methods // -------------------------------------------------------------------------------- void XSECProvider::setDefaultURIResolver(XSECURIResolver * resolver) { if (mp_URIResolver != 0) delete mp_URIResolver; mp_URIResolver = resolver->clone(); } // -------------------------------------------------------------------------------- // Internal functions // -------------------------------------------------------------------------------- void XSECProvider::setup(DSIGSignature *sig) { // Called by all Signature creation methods to set up the sig // Add to the active list m_providerMutex.lock(); m_activeSignatures.push_back(sig); m_providerMutex.unlock(); sig->setURIResolver(mp_URIResolver); } void XSECProvider::setup(XENCCipher * cipher) { // Called by all Signature creation methods to set up the sig // Add to the active list m_providerMutex.lock(); m_activeCiphers.push_back(cipher); m_providerMutex.unlock(); } xml-security-c-1.7.3/xsec/framework/XSECException.cpp000644 001751 001751 00000003726 12003301053 023654 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECException:= How we throw exceptions in XSEC * * Author(s): Berin Lautenbach * * $ID$ * * $LOG$ * */ #include #include XSECException::XSECException(XSECExceptionType eNum, const XMLCh * inMsg) { if (eNum > UnknownError) type = UnknownError; else type = eNum; if (inMsg != NULL) { msg = XMLString::replicate(inMsg); } else { msg = XMLString::transcode(XSECExceptionStrings[type]); } } XSECException::XSECException(XSECExceptionType eNum, const char * inMsg) { if (eNum > UnknownError) type = UnknownError; else type = eNum; if (inMsg != NULL) { msg = XMLString::transcode(inMsg); } else { msg = XMLString::transcode(XSECExceptionStrings[type]); } } XSECException::XSECException(const XSECException &toCopy) { // Copy Constructor type = toCopy.type; if (toCopy.msg == NULL) msg = NULL; else { msg = XMLString::replicate(toCopy.msg); } } XSECException::~XSECException() { if (msg != NULL) XSEC_RELEASE_XMLCH(msg); } const XMLCh * XSECException::getMsg(void) { return msg; } XSECException::XSECExceptionType XSECException::getType(void) { return type; } xml-security-c-1.7.3/xsec/framework/XSECURIResolverXerces.cpp000644 001751 001751 00000007020 12003301053 025240 0ustar00scantorscantor000000 000000 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * XSEC * * XSECURIResolverXerces := Virtual Interface class that takes a URI and * creates a binary input stream from it. * * $Id: XSECURIResolverXerces.cpp 1125514 2011-05-20 19:08:33Z scantor $ * */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_USE #include // -------------------------------------------------------------------------------- // Constructors and Destructors // -------------------------------------------------------------------------------- XSECURIResolverXerces::XSECURIResolverXerces(const XMLCh * baseURI) { if (baseURI != 0) { mp_baseURI = XMLString::replicate(baseURI); } else mp_baseURI = NULL; }; XSECURIResolverXerces::~XSECURIResolverXerces() { if (mp_baseURI != NULL) XSEC_RELEASE_XMLCH(mp_baseURI); } // -------------------------------------------------------------------------------- // Interface Methods // -------------------------------------------------------------------------------- XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream * XSECURIResolverXerces::resolveURI(const XMLCh * uri) { XSEC_USING_XERCES(URLInputSource); XSEC_USING_XERCES(XMLURL); XSEC_USING_XERCES(BinInputStream); URLInputSource * URLS; // Use Xerces URL Input source BinInputStream * is; // To handle the actual input if (uri == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "XSECURIResolverXerces - anonymous references not supported in default URI Resolvers"); } if (mp_baseURI == 0) { URLS = new URLInputSource(XMLURL(uri)); } else { URLS = new URLInputSource(XMLURL(XMLURL(mp_baseURI), uri)); } // makeStream can (and is quite likely to) throw an exception Janitor j_URLS(URLS); is = URLS->makeStream(); if (is == NULL) { throw XSECException(XSECException::ErrorOpeningURI, "An error occurred in XSECURIREsolverXerces when opening an URLInputStream"); } return is; } XSECURIResolver * XSECURIResolverXerces::clone(void) { XSECURIResolverXerces * ret; ret = new XSECURIResolverXerces(); if (this->mp_baseURI != 0) ret->mp_baseURI = XMLString::replicate(this->mp_baseURI); else ret->mp_baseURI = 0; return ret; } // -------------------------------------------------------------------------------- // Specific Methods // -------------------------------------------------------------------------------- void XSECURIResolverXerces::setBaseURI(const XMLCh * uri) { if (mp_baseURI != 0) XSEC_RELEASE_XMLCH(mp_baseURI); mp_baseURI = XMLString::replicate(uri); }; xml-security-c-1.7.3/m4/ax_pthread.m4000644 001751 001751 00000030440 12003301052 020461 0ustar00scantorscantor000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # # 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 3 of the License, 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, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 16 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) AC_MSG_RESULT($ax_pthread_ok) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; *-darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($ax_pthread_ok) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $attr; return attr /* ; */])], [attr_name=$attr; break], []) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *-osf* | *-hpux*) flag="-D_REENTRANT";; *solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], ax_cv_PTHREAD_PRIO_INHERIT, [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD xml-security-c-1.7.3/m4/libtool.m4000644 001751 001751 00001124601 12475453701 020040 0ustar00scantorscantor000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" ## -------------------------------------- ## ## Shell functions shared with configure. ## ## -------------------------------------- ## _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \$@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # lt_cv_sys_lib... is unaugmented for libtool script decls... lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for # LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xml-security-c-1.7.3/m4/ltoptions.m4000644 001751 001751 00000034262 12475453701 020431 0ustar00scantorscantor000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) xml-security-c-1.7.3/m4/ltsugar.m4000644 001751 001751 00000010440 12475453701 020047 0ustar00scantorscantor000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) xml-security-c-1.7.3/m4/ltversion.m4000644 001751 001751 00000001273 12475453701 020417 0ustar00scantorscantor000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 4171 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.5]) m4_define([LT_PACKAGE_REVISION], [2.4.5]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.5' macro_revision='2.4.5' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xml-security-c-1.7.3/m4/lt~obsolete.m4000644 001751 001751 00000013774 12475453701 020755 0ustar00scantorscantor000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) xml-security-c-1.7.3/build-aux/compile000755 001751 001751 00000016245 12475453705 021071 0ustar00scantorscantor000000 000000 #! /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: xml-security-c-1.7.3/build-aux/config.guess000755 001751 001751 00000127737 12475453705 022044 0ustar00scantorscantor000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-05-16' # This file 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 3 of the License, 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xml-security-c-1.7.3/build-aux/config.sub000755 001751 001751 00000105124 12475453705 021471 0ustar00scantorscantor000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # This file 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 3 of the License, 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xml-security-c-1.7.3/build-aux/install-sh000755 001751 001751 00000034523 12475453705 021516 0ustar00scantorscantor000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # 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. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/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. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 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: xml-security-c-1.7.3/build-aux/ltmain.sh000644 001751 001751 00001170672 12475453701 021335 0ustar00scantorscantor000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.5 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.5 package_revision=2.4.5 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2014-01-03.01; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 3 of the License, 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.5' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=$long_help_message" MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.5 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: xml-security-c-1.7.3/build-aux/missing000755 001751 001751 00000015330 12475453705 021104 0ustar00scantorscantor000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # 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: xml-security-c-1.7.3/build-aux/depcomp000755 001751 001751 00000056016 12475453706 021071 0ustar00scantorscantor000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # 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: