Imported Upstream version 1.5.0 upstream/1.5.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 23 Dec 2021 01:56:17 +0000 (10:56 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 23 Dec 2021 01:56:17 +0000 (10:56 +0900)
36 files changed:
AUTHORS
ChangeLog
Makefile.in
NEWS
aclocal.m4
config.h.in
configure
configure.ac
doc/Makefile.in
doc/ksba.info
doc/stamp-vti
doc/version.texi
gl/Makefile.in
m4/Makefile.am
m4/Makefile.in
m4/gnupg-typedef.m4 [deleted file]
m4/gpg-error.m4
m4/libgcrypt.m4
m4/libtool.m4
src/Makefile.in
src/cms-parser.c
src/cms.c
src/keyinfo.c
src/ksba.h
src/ksba.h.in
src/ksba.m4
src/version.c
src/versioninfo.rc.in
tests/Makefile.am
tests/Makefile.in
tests/samples/ecdsa-sample1.p7s [new file with mode: 0644]
tests/samples/ecdsa-sample1.p7s.asn [new file with mode: 0644]
tests/samples/rsa-sample1.p7m.asn [deleted file]
tests/samples/rsa-sample1.p7s [new file with mode: 0644]
tests/sha1.c
tests/t-cms-parser.c

diff --git a/AUTHORS b/AUTHORS
index c161951..ae0ecf2 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,5 @@
 Program: Libksba
-Download: ftp://ftp.gnupg.org/gcrypt/libksba/
+Download: https://gnupg.org/ftp/gcrypt/libksba/
 Repository: git://git.gnupg.org/libksba.git
 Maintainer: Werner Koch <wk@gnupg.org>
 Bug reports: https://bugs.gnupg.org
@@ -24,7 +24,7 @@ Copyright
 =========
 
  | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
- |               2012, 2013, 2014, 2015, 2018, 2019 g10 Code GmbH
+ |               2012, 2013, 2014, 2015, 2018, 2019, 2020 g10 Code GmbH
  | Copyright (C) 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
  | Copyright (C) 2000, 2001 Fabio Fiorina
 
index c137a84..a0a20f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2020-11-18  Werner Koch  <wk@gnupg.org>
+
+       Release 1.5.0.
+       + commit 9c0a818cd89cf90e87a3fdf5f7b2d82062645229
+       * configure.ac: Set LT version to C21/A13/R0.
+
+       Add SPDX identifiers.
+       + commit b426d2216583b8165abe89900578e0dbf9590571
+       * src/version.c (cright_blurb): New.
+       (ksba_check_version): Detect request for the cright blurb.
+
+       Allow for NDEF list of certs and CRLs in CMS.
+       + commit b6438e768cf969a74b985bf2686d7cf0b4323355
+       * src/cms-parser.c (_ksba_cms_parse_signed_data_part_2): Fix endtag
+       detection.
+
+       * tests/t-cms-parser.c (main): Allow several files on the command line
+       and add more files to the default invocation.
+
+2020-11-18  NIIBE Yutaka  <gniibe@fsij.org>
+
+       m4: Update with newer autoconf constructs.
+       + commit 1ef7f310d8bb0990d2c7a65f34ffa46f77c5d35d
+       * src/ksba.m4: Replace AC_HELP_STRING to AS_HELP_STRING.
+
+       build: Update to newer autoconf constructs.
+       + commit 0d46f2c000c45147db9a2c418248108bf444afb9
+       * configure.ac (AC_INIT): Use 'https://'.
+       Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER.
+       Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE.
+       Use AS_HELP_STRING instead of AC_HELP_STRING.
+       * gl/m4/onceonly_2_57.m4: Remove.
+       * m4/gpg-error.m4: Update from libgpg-error.
+       * m4/libtool.m4: Update from libgpg-error.
+       * m4/libgcrypt.m4: Update from libgcrypt.
+
+       build: Use modern Autoconf check for type.
+       + commit 60b32609ae7f7940c11117cb545c571356743624
+       * configure.ac (u32): Use AC_CHECK_TYPES.
+       * m4/Makefile.am (EXTRA_DIST): Update.
+       * m4/gnupg-typedef.m4: Remove.
+       * tests/sha1.c: Use HAVE_TYPE_U32.
+
+2020-06-17  Werner Koch  <wk@gnupg.org>
+
+       Support TR-03111 plain format ECDSA signature verification.
+       + commit 486fb0257d08c9a90571aa8433c1c61b53dda4fe
+       * src/keyinfo.c (sig_algo_table): Add ECDSA algos from TR-03111.
+       (cryptval_to_sexp): Support plain ecdsa format.
+
+2020-05-28  Werner Koch  <wk@gnupg.org>
+
+       Let ksba_cms_identify detect the new OpenPGP keyblock content.
+       + commit 5cdf0b5b0f1994405c8689ceaee76126755dcd1c
+       * src/ksba.h.in (KSBA_CT_OPENPGP_KEYBLOCK): New.
+       * src/cms.c: Add to table.
+       * tests/t-cms-parser.c (one_file): Ditto.
+
 2020-05-19  Werner Koch  <wk@gnupg.org>
 
        Release 1.4.0.
index 7edc7cd..3a8ab1d 100644 (file)
@@ -112,7 +112,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -378,6 +377,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/NEWS b/NEWS
index f4b235f..4720179 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,20 @@
+Noteworthy changes in version 1.5.0 (2020-11-18) [C21/A13/R0]
+------------------------------------------------
+
+ * ksba_cms_identify now identifies OpenPGP keyblock content.
+
+ * Supports TR-03111 plain format ECDSA signature verification.
+
+ * Fixes a CMS signed data parser bug exhibited by a somewhat strange
+   CMS message.  [b6438e768c]
+
+ * Interface changes relative to the 1.4.0 release:
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   KSBA_CT_OPENPGP_KEYBLOCK         NEW.
+
+ Release-info: https://dev.gnupg.org/T5146
+
+
 Noteworthy changes in version 1.4.0 (2020-05-19) [C20/A12/R0]
 ------------------------------------------------
 
index 92f814f..509980c 100644 (file)
@@ -753,35 +753,6 @@ else
 fi
 ])
 
-#  -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
-#
-# Copyright (C) 1996-2018 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.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
-AC_CONFIG_HEADERS($@)])
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should simply use the 'AC][_PROG_CC' macro instead.
-Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
-but upon 'ac_cv_prog_cc_stdc'.])])
-
-AC_DEFUN([AM_C_PROTOTYPES],
-         [AC_FATAL([automatic de-ANSI-fication support has been removed])])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
@@ -1204,7 +1175,6 @@ m4_include([gl/m4/valgrind-tests.m4])
 m4_include([m4/autobuild.m4])
 m4_include([m4/ax_prog_bison.m4])
 m4_include([m4/gcov.m4])
-m4_include([m4/gnupg-typedef.m4])
 m4_include([m4/gpg-error.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
index c89d72d..3874fd2 100644 (file)
@@ -84,8 +84,8 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-/* Defined if a `u32' is typedef'd */
-#undef HAVE_U32_TYPEDEF
+/* Define to 1 if the system has the type `u32'. */
+#undef HAVE_U32
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
index f632ccb..38f7cc4 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libksba 1.4.0.
+# Generated by GNU Autoconf 2.69 for libksba 1.5.0.
 #
-# Report bugs to <http://bugs.gnupg.org>.
+# Report bugs to <https://bugs.gnupg.org>.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -275,7 +275,7 @@ fi
     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
     $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: http://bugs.gnupg.org about your system, including any
+$0: https://bugs.gnupg.org about your system, including any
 $0: error possibly output before this message. Then install
 $0: a modern shell, or manually run the script under such a
 $0: shell if you do have one."
@@ -590,9 +590,9 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libksba'
 PACKAGE_TARNAME='libksba'
-PACKAGE_VERSION='1.4.0'
-PACKAGE_STRING='libksba 1.4.0'
-PACKAGE_BUGREPORT='http://bugs.gnupg.org'
+PACKAGE_VERSION='1.5.0'
+PACKAGE_STRING='libksba 1.5.0'
+PACKAGE_BUGREPORT='https://bugs.gnupg.org'
 PACKAGE_URL=''
 
 ac_unique_file="src/ksba.h.in"
@@ -776,6 +776,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -868,6 +869,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1120,6 +1122,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1257,7 +1268,7 @@ fi
 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
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1370,7 +1381,7 @@ 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 libksba 1.4.0 to adapt to many kinds of systems.
+\`configure' configures libksba 1.5.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1410,6 +1421,7 @@ Fine tuning of the installation directories:
   --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]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1440,7 +1452,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libksba 1.4.0:";;
+     short | recursive ) echo "Configuration of libksba 1.5.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1506,7 +1518,7 @@ Some influential environment variables:
 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 <http://bugs.gnupg.org>.
+Report bugs to <https://bugs.gnupg.org>.
 _ACEOF
 ac_status=$?
 fi
@@ -1569,7 +1581,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libksba configure 1.4.0
+libksba configure 1.5.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1728,9 +1740,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
 $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 http://bugs.gnupg.org ##
-## ------------------------------------ ##"
+( $as_echo "## ------------------------------------- ##
+## Report this to https://bugs.gnupg.org ##
+## ------------------------------------- ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
@@ -2175,7 +2187,7 @@ 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 libksba $as_me 1.4.0, which was
+It was created by libksba $as_me 1.5.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2529,8 +2541,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
 #   (No interfaces changed:                   REVISION++)
 # Please remember to document interface changes in the NEWS file.
-LIBKSBA_LT_CURRENT=20
-LIBKSBA_LT_AGE=12
+LIBKSBA_LT_CURRENT=21
+LIBKSBA_LT_AGE=13
 LIBKSBA_LT_REVISION=0
 #-------------------
 # If the API is changed in an incompatible way: increment the next counter.
@@ -3056,7 +3068,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libksba'
- VERSION='1.4.0'
+ VERSION='1.5.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4746,7 +4758,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
 
 
 
-
 # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
 case $host in
   *-*-linux*)
@@ -12433,7 +12444,7 @@ fi
 
 
 
-VERSION_NUMBER=0x010400
+VERSION_NUMBER=0x010500
 
 
 
@@ -14985,42 +14996,15 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u32 typedef" >&5
-$as_echo_n "checking for u32 typedef... " >&6; }
-    if ${gnupg_cv_typedef_u32+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
+ac_fn_c_check_type "$LINENO" "u32" "ac_cv_type_u32" "$ac_includes_default"
+if test "x$ac_cv_type_u32" = xyes; then :
 
-    #undef u32
-    int a = sizeof(u32);
-
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U32 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_u32=yes
-else
-  gnupg_cv_typedef_u32=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_u32" >&5
-$as_echo "$gnupg_cv_typedef_u32" >&6; }
-    if test "$gnupg_cv_typedef_u32" = yes; then
 
-$as_echo "#define HAVE_U32_TYPEDEF 1" >>confdefs.h
 
-    fi
+fi
 
 
 
 # Generate extended version information for W32.
 if test "$have_w32_system" = yes; then
       BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
-      BUILD_FILEVERSION="${BUILD_FILEVERSION}62223"
+      BUILD_FILEVERSION="${BUILD_FILEVERSION}39946"
 fi
 
 
-BUILD_REVISION="f30f604"
+BUILD_REVISION="9c0a818"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -15522,6 +15506,7 @@ 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$//'
@@ -15994,7 +15979,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libksba $as_me 1.4.0, which was
+This file was extended by libksba $as_me 1.5.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16054,13 +16039,13 @@ $config_headers
 Configuration commands:
 $config_commands
 
-Report bugs to <http://bugs.gnupg.org>."
+Report bugs to <https://bugs.gnupg.org>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libksba config.status 1.4.0
+libksba config.status 1.5.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -17288,7 +17273,7 @@ See \`config.log' for more details" "$LINENO" 5; }
 #
 # You should have received a copy of the GNU General Public License
 # along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# can be downloaded from https://www.gnu.org/licenses/gpl.html, or
 # obtained by writing to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -18071,7 +18056,7 @@ fi
 echo "
         Libksba v${VERSION} has been configured as follows:
 
-        Revision:  f30f604  (62223)
+        Revision:  9c0a818  (39946)
         Platform:  $host
 
 "
index 46c98e8..23e97d4 100644 (file)
@@ -18,7 +18,7 @@
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 # Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.61)
+AC_PREREQ([2.61])
 min_automake_version="1.14"
 
 
@@ -29,7 +29,7 @@ min_automake_version="1.14"
 # for the LT versions.
 m4_define([mym4_package],[libksba])
 m4_define([mym4_major], [1])
-m4_define([mym4_minor], [4])
+m4_define([mym4_minor], [5])
 m4_define([mym4_micro], [0])
 
 # Below is m4 magic to extract and compute the git revision number,
@@ -43,15 +43,15 @@ m4_define([mym4_version],      m4_argn(4, mym4_verslist))
 m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
 m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
 m4_esyscmd([echo ]mym4_version[>VERSION])
-AC_INIT([mym4_package],[mym4_version], [http://bugs.gnupg.org])
+AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
 
 # LT Version numbers: Remember to change them just *before* a release.
 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
 #   (No interfaces changed:                   REVISION++)
 # Please remember to document interface changes in the NEWS file.
-LIBKSBA_LT_CURRENT=20
-LIBKSBA_LT_AGE=12
+LIBKSBA_LT_CURRENT=21
+LIBKSBA_LT_AGE=13
 LIBKSBA_LT_REVISION=0
 #-------------------
 # If the API is changed in an incompatible way: increment the next counter.
@@ -64,12 +64,12 @@ NEED_GPG_ERROR_VERSION=1.8
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([src/ksba.h.in])
 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 AB_INIT
 
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
 
 # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
 dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
@@ -188,8 +188,8 @@ AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
 # This is handy for debugging so the compiler doesn't rearrange
 # things and eliminate variables.
 AC_ARG_ENABLE(optimization,
-       AC_HELP_STRING([--disable-optimization],
-                     [disable compiler optimization]),
+       AS_HELP_STRING([--disable-optimization],
+                      [disable compiler optimization]),
                       [if test $enableval = no ; then
                          CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
                        fi])
@@ -285,7 +285,7 @@ case "${host}" in
         ;;
 esac
 AC_ARG_ENABLE([ld-version-script],
-              AC_HELP_STRING([--enable-ld-version-script],
+              AS_HELP_STRING([--enable-ld-version-script],
                              [enable/disable use of linker version script.
                               (default is system dependent)]),
               [have_ld_version_script=$enableval],
@@ -401,7 +401,7 @@ AC_C_BIGENDIAN
 
 AC_CHECK_SIZEOF(unsigned int)
 AC_CHECK_SIZEOF(unsigned long)
-GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
+AC_CHECK_TYPES([u32])
 
 
 # Checks for library functions.
@@ -442,7 +442,7 @@ AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
                    [GIT commit id revision used to build this package])
 
 AC_ARG_ENABLE([build-timestamp],
-  AC_HELP_STRING([--enable-build-timestamp],
+  AS_HELP_STRING([--enable-build-timestamp],
                  [set an explicit build timestamp for reproducibility.
                   (default is the current time in ISO-8601 format)]),
      [if test "$enableval" = "yes"; then
@@ -456,7 +456,7 @@ AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
                    [The time this package was configured for a build])
 
 build_doc=yes
-AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
+AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc],
                                     [do not build the documentation]),
                      build_doc=$enableval, build_doc=yes)
 AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
index 3879b97..1e9fd8a 100644 (file)
@@ -112,7 +112,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -358,6 +357,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
index 6a95639..367a4ab 100644 (file)
@@ -8,8 +8,8 @@ END-INFO-DIR-ENTRY
 This file documents the KSBA library to access X.509 and CMS data
 structures.
 
-   This is edition 1.4.0, last updated 12 May 2020, of 'The KSBA
-Reference Manual', for Version 1.4.0.
+   This is edition 1.5.0, last updated 12 May 2020, of 'The KSBA
+Reference Manual', for Version 1.5.0.
 
    Copyright (C) 2002, 2003, 2004 g10 Code GmbH
 
@@ -25,8 +25,8 @@ File: ksba.info,  Node: Top,  Next: Introduction,  Up: (dir)
 Main Menu
 *********
 
-This is edition 1.4.0, last updated 12 May 2020, of 'The KSBA Reference
-Manual', for Version 1.4.0 of the KSBA library.
+This is edition 1.5.0, last updated 12 May 2020, of 'The KSBA Reference
+Manual', for Version 1.5.0 of the KSBA library.
 
    Copyright (C) 2002, 2003, 2004 g10 Code GmbH
 
index b8f2f82..ed887d3 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 12 May 2020
 @set UPDATED-MONTH May 2020
-@set EDITION 1.4.0
-@set VERSION 1.4.0
+@set EDITION 1.5.0
+@set VERSION 1.5.0
index b8f2f82..ed887d3 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 12 May 2020
 @set UPDATED-MONTH May 2020
-@set EDITION 1.4.0
-@set VERSION 1.4.0
+@set EDITION 1.5.0
+@set VERSION 1.5.0
index b6e9343..0f04558 100644 (file)
@@ -107,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -328,6 +327,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
index fdbffdd..c1f972e 100644 (file)
@@ -1,5 +1,5 @@
 
-EXTRA_DIST = autobuild.m4  gnupg-typedef.m4  gpg-error.m4  libgcrypt.m4 \
+EXTRA_DIST = autobuild.m4  gpg-error.m4  libgcrypt.m4 \
              libtool.m4 ax_prog_bison.m4 gcov.m4
 
 
index 0c7097b..28798d3 100644 (file)
@@ -94,7 +94,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -268,6 +267,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -276,7 +276,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-EXTRA_DIST = autobuild.m4  gnupg-typedef.m4  gpg-error.m4  libgcrypt.m4 \
+EXTRA_DIST = autobuild.m4  gpg-error.m4  libgcrypt.m4 \
              libtool.m4 ax_prog_bison.m4 gcov.m4
 
 all: all-am
diff --git a/m4/gnupg-typedef.m4 b/m4/gnupg-typedef.m4
deleted file mode 100644 (file)
index 8a40a88..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-dnl Typecheck macro from GnuPG
-dnl Copyright (C) 2001 Free Software Foundation, Inc.
-dnl
-dnl This file is part of Libksba.
-dnl
-dnl Libksba is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as
-dnl published by the Free Software Foundation; either version 3 of
-dnl the License, or (at your option) any later version.
-dnl
-dnl Libksba is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-dnl GNU Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
-dnl Check whether a typedef exists and create a #define $2 if it exists
-dnl
-AC_DEFUN([GNUPG_CHECK_TYPEDEF],
-  [ AC_MSG_CHECKING(for $1 typedef)
-    AC_CACHE_VAL(gnupg_cv_typedef_$1,
-    [AC_TRY_COMPILE([#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>], [
-    #undef $1
-    int a = sizeof($1);
-    ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
-    AC_MSG_RESULT($gnupg_cv_typedef_$1)
-    if test "$gnupg_cv_typedef_$1" = yes; then
-        AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd])
-    fi
-  ])
-
index a9d572f..c9b235f 100644 (file)
@@ -1,5 +1,5 @@
 # gpg-error.m4 - autoconf macro to detect libgpg-error.
-# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -9,7 +9,7 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Last-changed: 2018-11-02
+# Last-changed: 2020-11-17
 
 
 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
@@ -31,7 +31,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
   dnl since that is consistent with how our three siblings use the directory/
   dnl package name in --with-$dir_name-prefix=PFX.
   AC_ARG_WITH(libgpg-error-prefix,
-              AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+              AS_HELP_STRING([--with-libgpg-error-prefix=PFX],
                              [prefix where GPG Error is installed (optional)]),
               [gpg_error_config_prefix="$withval"])
 
index 37dfbea..19d514f 100644 (file)
@@ -1,5 +1,5 @@
 # libgcrypt.m4 - Autoconf macros to detect libgcrypt
-# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -9,15 +9,15 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Last-changed: 2018-11-13
+# Last-changed: 2020-09-27
 
 
 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
 dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
 dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
-dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
+dnl MINIMUM-VERSION is a string with the version number optionally prefixed
 dnl with the API version to also check the API compatibility. Example:
-dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
+dnl a MINIMUM-VERSION of 1:1.2.5 won't pass the test unless the installed
 dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
 dnl this features allows to prevent build against newer versions of libgcrypt
 dnl with a changed API.
@@ -30,7 +30,7 @@ dnl
 AC_DEFUN([AM_PATH_LIBGCRYPT],
 [ AC_REQUIRE([AC_CANONICAL_HOST])
   AC_ARG_WITH(libgcrypt-prefix,
-            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
+            AS_HELP_STRING([--with-libgcrypt-prefix=PFX],
                            [prefix where LIBGCRYPT is installed (optional)]),
      libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
   if test x"${LIBGCRYPT_CONFIG}" = x ; then
index 1d62b05..8795701 100644 (file)
@@ -34,7 +34,7 @@ m4_define([_LT_COPYING], [dnl
 #
 # You should have received a copy of the GNU General Public License
 # along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# can be downloaded from https://www.gnu.org/licenses/gpl.html, or
 # obtained by writing to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
@@ -7474,7 +7474,7 @@ AC_LANG_POP
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
+AC_LANG_PUSH([Java])
 
 # Source file extension for Java test sources.
 ac_ext=java
@@ -7530,7 +7530,7 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
-AC_LANG_RESTORE
+AC_LANG_POP
 
 GCC=$lt_save_GCC
 CC=$lt_save_CC
@@ -7545,7 +7545,7 @@ CFLAGS=$lt_save_CFLAGS
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
+AC_LANG_PUSH([Go])
 
 # Source file extension for Go test sources.
 ac_ext=go
@@ -7601,7 +7601,7 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
-AC_LANG_RESTORE
+AC_LANG_POP
 
 GCC=$lt_save_GCC
 CC=$lt_save_CC
@@ -7616,7 +7616,9 @@ CFLAGS=$lt_save_CFLAGS
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
+
+dnl Here, something like AC_LANG_PUSH([RC]) is expected.
+dnl But Resource Compiler is not supported as a language by autoconf
 
 # Source file extension for RC test sources.
 ac_ext=rc
@@ -7655,8 +7657,10 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
+dnl Here, AC_LANG_POP is expected.
 GCC=$lt_save_GCC
-AC_LANG_RESTORE
+dnl Back to C
+AC_LANG([C])
 CC=$lt_save_CC
 CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_RC_CONFIG
index 99899ee..6a574c2 100644 (file)
@@ -118,7 +118,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -426,6 +425,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
index b0ba8ee..f7f727d 100644 (file)
@@ -648,7 +648,7 @@ _ksba_cms_parse_signed_data_part_2 (ksba_cms_t cms)
           err = _ksba_ber_read_tl (cms->reader, &ti);
           if (err)
             return err;
-          if (expect_endtag && !ti.class && ti.tag == TYPE_NULL )
+          if (expect_endtag && !ti.class && !ti.tag)
             {
               /* This is an end tag.  Read the next tag but don't fail
                  if this is just an EOF.  */
@@ -709,7 +709,7 @@ _ksba_cms_parse_signed_data_part_2 (ksba_cms_t cms)
           err = _ksba_ber_read_tl (cms->reader, &ti);
           if (err)
             return err;
-          if (expect_endtag && !ti.class && ti.tag == TYPE_NULL )
+          if (expect_endtag && !ti.class && !ti.tag)
             {
               /* This is an end tag.  Read the next tag but don't fail
                  if this is just an EOF.  */
index 881443f..6a563bf 100644 (file)
--- a/src/cms.c
+++ b/src/cms.c
@@ -84,6 +84,8 @@ static struct {
   {  "1.2.840.113549.1.9.16.1.2", KSBA_CT_AUTH_DATA   },
   {  "1.3.6.1.4.1.311.2.1.4", KSBA_CT_SPC_IND_DATA_CTX,
      ct_parse_data   , ct_build_data                  },
+  {  "1.3.6.1.4.1.11591.2.3.1", KSBA_CT_OPENPGP_KEYBLOCK,
+     ct_parse_data   , ct_build_data                  },
   { NULL }
 };
 
index 666726f..011d9be 100644 (file)
@@ -70,7 +70,7 @@ struct algo_table_s {
   int supported;  /* Values > 1 are also used to indicate hacks.  */
   pkalgo_t pkalgo;
   const char *algo_string;
-  const char *elem_string; /* parameter name or '-' */
+  const char *elem_string; /* parameter names or '-', 'P' for plain ECDSA */
   const char *ctrl_string; /* expected tag values (value > 127 are raw data)*/
   const char *parmelem_string; /* parameter name or '-'. */
   const char *parmctrl_string; /* expected tag values.  */
@@ -203,6 +203,31 @@ static const struct algo_table_s sig_algo_table[] = {
     "\x2a\x86\x48\xce\x3d\x04\x03\x04", 8,
     1, PKALGO_ECC, "ecdsa", "-rs", "\x30\x02\x02", NULL, NULL, "sha512" },
 
+  { /* BSI TR-03111 bsiEcdsaWithSHA1 */
+    "0.4.0.127.0.7.1.1.4.1.1",
+    "\x04\x00\x7f\x00\x07\x01\x01\x04\x01\x01", 10,
+    1, PKALGO_ECC, "ecdsa", "P", "", NULL, NULL, "sha1" },
+
+  { /* BSI TR-03111 bsiEcdsaWithSHA224 */
+    "0.4.0.127.0.7.1.1.4.1.2",
+    "\x04\x00\x7f\x00\x07\x01\x01\x04\x01\x02", 10,
+    1, PKALGO_ECC, "ecdsa", "P", "", NULL, NULL, "sha224" },
+
+  { /* BSI TR-03111 bsiEcdsaWithSHA256 */
+    "0.4.0.127.0.7.1.1.4.1.3",
+    "\x04\x00\x7f\x00\x07\x01\x01\x04\x01\x03", 10,
+    1, PKALGO_ECC, "ecdsa", "P", "", NULL, NULL, "sha256" },
+
+  { /* BSI TR-03111 bsiEcdsaWithSHA384 */
+    "0.4.0.127.0.7.1.1.4.1.4",
+    "\x04\x00\x7f\x00\x07\x01\x01\x04\x01\x04", 10,
+    1, PKALGO_ECC, "ecdsa", "P", "", NULL, NULL, "sha384" },
+
+  { /* BSI TR-03111 bsiEcdsaWithSHA512 */
+    "0.4.0.127.0.7.1.1.4.1.5",
+    "\x04\x00\x7f\x00\x07\x01\x01\x04\x01\x05", 10,
+    1, PKALGO_ECC, "ecdsa", "P", "", NULL, NULL, "sha512" },
+
   { /* iso.member-body.us.rsadsi.pkcs.pkcs-1.1 */
     "1.2.840.113549.1.1.1", /* rsaEncryption used without hash algo*/
     "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01", 9,
@@ -1431,9 +1456,14 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
   /* FIXME: We don't release the stringbuf in case of error
      better let the macro jump to a label */
   if (!mode && (algo_table[algoidx].pkalgo == PKALGO_ED25519
-                ||algo_table[algoidx].pkalgo == PKALGO_ED448))
+                ||algo_table[algoidx].pkalgo == PKALGO_ED448
+                || (algo_table[algoidx].pkalgo == PKALGO_ECC
+                    && *algo_table[algoidx].elem_string == 'P')))
     {
-      /* EdDSA is special: R and S are simply concatenated; see rfc8410.  */
+      /* EdDSA is special: R and S are simply concatenated; see
+       * rfc8410.  The same code is used for Plain ECDSA format as
+       * specified in BSI TR-03111; we indicate this with a 'P' in the
+       * elem string.  */
       put_stringbuf (&sb, "(1:r");
       put_stringbuf_mem_sexp (&sb, der, derlen/2);
       put_stringbuf (&sb, ")");
index 3c12ba3..18ee93e 100644 (file)
@@ -1,6 +1,6 @@
 /* ksba.h - X.509 library used by GnuPG
  * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
- *               2012, 2013, 2104, 2015, 2019 g10 Code GmbH
+ *               2012, 2013, 2104, 2015, 2019, 2020 g10 Code GmbH
  *
  * This file is part of KSBA.
  *
@@ -27,6 +27,7 @@
  * You should have received a copies of the GNU General Public License
  * and the GNU Lesser General Public License along with this program;
  * if not, see <http://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-3.0-or-later OR GPL-2.0-or-later
  */
 
 #ifndef KSBA_H
@@ -45,11 +46,11 @@ extern "C" {
 /* The version of this header should match the one of the library.  Do
  * not use this symbol in your application; use assuan_check_version
  * instead.  */
-#define KSBA_VERSION "1.4.0"
+#define KSBA_VERSION "1.5.0"
 
 /* The version number of this header.  It may be used to handle minor
  * API incompatibilities.  */
-#define KSBA_VERSION_NUMBER 0x010400
+#define KSBA_VERSION_NUMBER 0x010500
 
 
 
@@ -124,7 +125,8 @@ typedef enum
     KSBA_CT_ENCRYPTED_DATA = 5,
     KSBA_CT_AUTH_DATA = 6,
     KSBA_CT_PKCS12 = 7,
-    KSBA_CT_SPC_IND_DATA_CTX = 8
+    KSBA_CT_SPC_IND_DATA_CTX = 8,
+    KSBA_CT_OPENPGP_KEYBLOCK = 9
   }
 ksba_content_type_t;
 typedef ksba_content_type_t KsbaContentType _KSBA_DEPRECATED;
index 78efc81..54f0a1c 100644 (file)
@@ -1,6 +1,6 @@
 /* ksba.h - X.509 library used by GnuPG
  * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
- *               2012, 2013, 2104, 2015, 2019 g10 Code GmbH
+ *               2012, 2013, 2104, 2015, 2019, 2020 g10 Code GmbH
  *
  * This file is part of KSBA.
  *
@@ -27,6 +27,7 @@
  * You should have received a copies of the GNU General Public License
  * and the GNU Lesser General Public License along with this program;
  * if not, see <http://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-3.0-or-later OR GPL-2.0-or-later
  */
 
 #ifndef KSBA_H
@@ -124,7 +125,8 @@ typedef enum
     KSBA_CT_ENCRYPTED_DATA = 5,
     KSBA_CT_AUTH_DATA = 6,
     KSBA_CT_PKCS12 = 7,
-    KSBA_CT_SPC_IND_DATA_CTX = 8
+    KSBA_CT_SPC_IND_DATA_CTX = 8,
+    KSBA_CT_OPENPGP_KEYBLOCK = 9
   }
 ksba_content_type_t;
 typedef ksba_content_type_t KsbaContentType _KSBA_DEPRECATED;
index ad8de4f..6b55bb8 100644 (file)
@@ -8,7 +8,8 @@
 # This file 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.
-
+#
+# Last-changed: 2020-11-18
 
 dnl AM_PATH_KSBA([MINIMUM-VERSION,
 dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
@@ -26,7 +27,7 @@ AC_DEFUN([AM_PATH_KSBA],
   dnl since that is consistent with how our three siblings use the directory/
   dnl package name in --with-$dir_name-prefix=PFX.
   AC_ARG_WITH(libksba-prefix,
-              AC_HELP_STRING([--with-libksba-prefix=PFX],
+              AS_HELP_STRING([--with-libksba-prefix=PFX],
                              [prefix where KSBA is installed (optional)]),
      ksba_config_prefix="$withval", ksba_config_prefix="")
 
index 0f2a390..9f4289a 100644 (file)
@@ -100,6 +100,23 @@ compare_versions (const char *my_version, const char *req_version)
   return NULL;
 }
 
+/* This is actually a dummy function to make sure that is module is
+   not empty.  Some compilers barf on empty modules.  */
+static const char *
+cright_blurb (void)
+{
+  static const char blurb[] =
+    "\n\n"
+    "This is Libksba " PACKAGE_VERSION " - An X.509 and CMS Library\n"
+    "Copyright 2001-2006,2010-2015,2018-2020 g10 Code GmbH\n"
+    "\n"
+    "SPDX-License-Identifier: LGPL-3.0-or-later OR GPL-2.0-or-later\n"
+    "(" BUILD_REVISION " " BUILD_TIMESTAMP ")\n"
+    "\n\n";
+  return blurb;
+}
+
+
 /**
  * ksba_check_version:
  * @req_version: A string with a version
@@ -118,6 +135,8 @@ const char *
 ksba_check_version (const char *req_version)
 {
   /* fixme: if we need global initializations.
-     Note that these the malloc hook might not have been run yet */
+     Note that the malloc hook might not have been run yet */
+  if (req_version && req_version[0] == 1 && req_version[1] == 1)
+    return cright_blurb ();
   return compare_versions (VERSION, req_version);
 }
index 9318e8b..ede7d74 100644 (file)
@@ -40,7 +40,7 @@ BEGIN
             VALUE "FileDescription", "Libksba - X.509 and CMS Library\0"
             VALUE "FileVersion", "@LIBKSBA_LT_CURRENT@.@LIBKSBA_LT_AGE@.@LIBKSBA_LT_REVISION@.@BUILD_REVISION@\0"
             VALUE "InternalName", "libksba\0"
-            VALUE "LegalCopyright", "Copyright Â© 2019 g10 Code GmbH\0"
+            VALUE "LegalCopyright", "Copyright Â© 2020 g10 Code GmbH\0"
             VALUE "LegalTrademarks", "\0"
             VALUE "OriginalFilename", "libksba.dll\0"
             VALUE "PrivateBuild", "\0"
index 0e7186f..2cf1f9c 100644 (file)
@@ -40,12 +40,16 @@ test_certs = samples/cert_dfn_pca01.der samples/cert_dfn_pca15.der \
 test_crls = samples/ov-test-crl.crl
 
 test_keys = samples/ov-server.p12  samples/ov-userrev.p12 \
-             samples/ov-serverrev.p12  samples/ov-user.p12
+            samples/ov-serverrev.p12  samples/ov-user.p12
 
-EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk \
+EXTRA_DIST = $(test_certs)  mkoidtbl.awk \
+             samples/README \
              samples/detached-sig.cms \
-            samples/rsa-sample1.p7m samples/rsa-sample1.p7m.asn \
-            samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn
+            samples/rsa-sample1.p7m  samples/rsa-sample1.p7m \
+            samples/rsa-sample1.p7s  samples/rsa-sample1.p7s \
+            samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn \
+            samples/ecdsa-sample1.p7s samples/ecdsa-sample1.p7s.asn
+
 
 BUILT_SOURCES = oidtranstbl.h
 CLEANFILES = oidtranstbl.h
index 21bf5a7..a4c72c7 100644 (file)
@@ -118,7 +118,6 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
        $(top_srcdir)/gl/m4/valgrind-tests.m4 \
        $(top_srcdir)/m4/autobuild.m4 \
        $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
-       $(top_srcdir)/m4/gnupg-typedef.m4 \
        $(top_srcdir)/m4/gpg-error.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 \
@@ -406,6 +405,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -433,12 +433,15 @@ test_certs = samples/cert_dfn_pca01.der samples/cert_dfn_pca15.der \
 
 test_crls = samples/ov-test-crl.crl
 test_keys = samples/ov-server.p12  samples/ov-userrev.p12 \
-             samples/ov-serverrev.p12  samples/ov-user.p12
+            samples/ov-serverrev.p12  samples/ov-user.p12
 
-EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk \
+EXTRA_DIST = $(test_certs)  mkoidtbl.awk \
+             samples/README \
              samples/detached-sig.cms \
-            samples/rsa-sample1.p7m samples/rsa-sample1.p7m.asn \
-            samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn
+            samples/rsa-sample1.p7m  samples/rsa-sample1.p7m \
+            samples/rsa-sample1.p7s  samples/rsa-sample1.p7s \
+            samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn \
+            samples/ecdsa-sample1.p7s samples/ecdsa-sample1.p7s.asn
 
 BUILT_SOURCES = oidtranstbl.h
 CLEANFILES = oidtranstbl.h
diff --git a/tests/samples/ecdsa-sample1.p7s b/tests/samples/ecdsa-sample1.p7s
new file mode 100644 (file)
index 0000000..28375b1
Binary files /dev/null and b/tests/samples/ecdsa-sample1.p7s differ
diff --git a/tests/samples/ecdsa-sample1.p7s.asn b/tests/samples/ecdsa-sample1.p7s.asn
new file mode 100644 (file)
index 0000000..82d42bb
--- /dev/null
@@ -0,0 +1,284 @@
+   0 NDEF: SEQUENCE { -- ContentInfo
+   2    9:   OBJECT IDENTIFIER signedData (1 2 840 113549 1 7 2)
+  13 NDEF:   [0] {  -- content
+  15 NDEF:     SEQUENCE {
+  17    1:       INTEGER 1    -- version
+  20   15:       SET {        -- digestAlgorithms
+  22   13:         SEQUENCE { -- digestalgorithmIdentifier
+  24    9:           OBJECT IDENTIFIER sha-256 (2 16 840 1 101 3 4 2 1)
+  35    0:           NULL
+         :           }
+         :         }
+  37 NDEF:       SEQUENCE {  -- encapContentInfo
+  39    9:         OBJECT IDENTIFIER data (1 2 840 113549 1 7 1)
+         :         }   -- (no data thus this is a detached signature)
+  52 NDEF:       [0] {  -- certificates
+  54  711:         SEQUENCE {
+  58  431:           SEQUENCE {
+  62    3:             [0] {
+  64    1:               INTEGER 2
+         :               }
+  67    4:             INTEGER 649228179
+  73   13:             SEQUENCE {
+  75    9:               OBJECT IDENTIFIER
+         :                 sha256WithRSAEncryption (1 2 840 113549 1 1 11)
+  86    0:               NULL
+         :               }
+  88  119:             SEQUENCE {
+  90   11:               SET {
+  92    9:                 SEQUENCE {
+  94    3:                   OBJECT IDENTIFIER countryName (2 5 4 6)
+  99    2:                   PrintableString 'DE'
+         :                   }
+         :                 }
+ 103   28:               SET {
+ 105   26:                 SEQUENCE {
+ 107    3:                   OBJECT IDENTIFIER organizationName (2 5 4 10)
+ 112   19:                   UTF8String 'Deutsche Telekom AG'
+         :                   }
+         :                 }
+ 133   18:               SET {
+ 135   16:                 SEQUENCE {
+ 137    3:                   OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
+ 142    9:                   UTF8String 'T-TeleSec'
+         :                   }
+         :                 }
+ 153   20:               SET {
+ 155   18:                 SEQUENCE {
+ 157    3:                   OBJECT IDENTIFIER commonName (2 5 4 3)
+ 162   11:                   UTF8String 'TKS CA 1:PN'
+         :                   }
+         :                 }
+ 175   10:               SET {
+ 177    8:                 SEQUENCE {
+ 179    3:                   OBJECT IDENTIFIER serialNumber (2 5 4 5)
+ 184    1:                   PrintableString '1'
+         :                   }
+         :                 }
+ 187   20:               SET {
+ 189   18:                 SEQUENCE {
+ 191    3:                   OBJECT IDENTIFIER pseudonym (2 5 4 65)
+ 196   11:                   UTF8String 'TKS CA 1:PN'
+         :                   }
+         :                 }
+         :               }
+ 209   30:             SEQUENCE {
+ 211   13:               UTCTime 05/02/2013 12:35:12 GMT
+ 226   13:               UTCTime 05/02/2023 12:35:12 GMT
+         :               }
+ 241   75:             SEQUENCE {
+ 243   11:               SET {
+ 245    9:                 SEQUENCE {
+ 247    3:                   OBJECT IDENTIFIER countryName (2 5 4 6)
+ 252    2:                   PrintableString 'DE'
+         :                   }
+         :                 }
+ 256   23:               SET {
+ 258   21:                 SEQUENCE {
+ 260    3:                   OBJECT IDENTIFIER commonName (2 5 4 3)
+ 265   14:                   UTF8String 'TKS 13 A 04562'
+         :                   }
+         :                 }
+ 281   10:               SET {
+ 283    8:                 SEQUENCE {
+ 285    3:                   OBJECT IDENTIFIER serialNumber (2 5 4 5)
+ 290    1:                   PrintableString '1'
+         :                   }
+         :                 }
+ 293   23:               SET {
+ 295   21:                 SEQUENCE {
+ 297    3:                   OBJECT IDENTIFIER pseudonym (2 5 4 65)
+ 302   14:                   UTF8String 'TKS 13 A 04562'
+         :                   }
+         :                 }
+         :               }
+ 318   89:             SEQUENCE {
+ 320   19:               SEQUENCE {
+ 322    7:                 OBJECT IDENTIFIER ecPublicKey (1 2 840 10045 2 1)
+ 331    8:                 OBJECT IDENTIFIER prime256v1 (1 2 840 10045 3 1 7)
+         :                 }
+ 341   66:               BIT STRING
+         :                 04 A4 1C 91 05 47 42 1F FB F9 08 BF 2E 4A 53 B6
+         :                 FB 9E D7 25 09 04 D7 71 9A 89 E0 5A 32 E6 DD 93
+         :                 19 9F E2 99 34 4F 7C 43 EB DC 71 23 47 7B BA 34
+         :                 BE 39 A7 CF 0F F5 82 E5 D1 FC 3F 10 4B 8E 6D 4F
+         :                 4F
+         :               }
+ 409   82:             [3] {
+ 411   80:               SEQUENCE {
+ 413   31:                 SEQUENCE {
+ 415    3:                   OBJECT IDENTIFIER
+         :                     authorityKeyIdentifier (2 5 29 35)
+ 420   24:                   OCTET STRING, encapsulates {
+ 422   22:                     SEQUENCE {
+ 424   20:                       [0]
+         :                     CB 03 DF 18 AD 26 0E C8 99 56 83 C6 CD 1D EA 61
+         :                     02 19 60 39
+         :                       }
+         :                     }
+         :                   }
+ 446   29:                 SEQUENCE {
+ 448    3:                   OBJECT IDENTIFIER subjectKeyIdentifier (2 5 29 14)
+ 453   22:                   OCTET STRING, encapsulates {
+ 455   20:                     OCTET STRING
+         :                     D2 A5 17 30 59 88 96 56 72 8A 1E B1 D6 02 18 69
+         :                     06 00 5A BA
+         :                     }
+         :                   }
+ 477   14:                 SEQUENCE {
+ 479    3:                   OBJECT IDENTIFIER keyUsage (2 5 29 15)
+ 484    1:                   BOOLEAN TRUE
+ 487    4:                   OCTET STRING, encapsulates {
+ 489    2:                     BIT STRING 7 unused bits
+         :                       '1'B (bit 0)
+         :                     }
+         :                   }
+         :                 }
+         :               }
+         :             }
+ 493   13:           SEQUENCE {
+ 495    9:             OBJECT IDENTIFIER
+         :               sha256WithRSAEncryption (1 2 840 113549 1 1 11)
+ 506    0:             NULL
+         :             }
+ 508  257:           BIT STRING
+         :             04 3C 56 07 7F B9 EB 93 4E FE CB 23 56 EC 73 B3
+         :             10 9A A4 80 91 45 56 77 48 B0 AC BA 25 E4 52 96
+         :             62 55 41 30 70 4C 0C 81 77 F3 E9 52 4E C9 DE FB
+         :             11 70 82 37 1E A1 CF F3 48 8C 26 F3 59 41 25 F5
+         :             39 55 56 80 42 D1 9E 63 90 41 BC C4 B2 4D 1C 66
+         :             1B CF 88 95 96 CB A0 83 B8 D3 D4 C9 0E E2 E1 89
+         :             A6 BE E3 2B FB 75 6F 36 43 BF 4E 8D FE 9C B2 79
+         :             ED 61 8F 63 74 6F C9 B4 AC C2 16 F6 A9 CD 00 0E
+         :             A7 21 7E 84 21 6A 69 FD 88 79 51 9E A4 63 8A 5B
+         :             00 CE 9F 8E B1 F5 E1 97 1F 53 7B A0 2A 5E 6C D7
+         :             62 9F 4B 11 45 43 44 1D 4B FF 8F 87 7D BB B6 38
+         :             E0 EE 0A 2B 55 72 43 58 66 61 9A 70 8A 34 18 E7
+         :             C1 68 05 7F C1 03 A3 11 1D ED A3 AD 6C F8 34 B6
+         :             63 6A EB 53 C8 21 13 9C 6E C4 68 B4 2D F5 AA 59
+         :             6D 42 C7 0D 24 0B 7F 28 8F 76 80 02 BE 8B 52 5F
+         :             2E B4 79 17 8B D9 9E E2 28 58 72 E5 F1 23 7E CF
+         :           }
+         :         }  -- end certificates
+ 771  447:       SET {  -- signerInfos
+ 775  443:         SEQUENCE {  -- SignerInfo
+ 779    1:           INTEGER 1  -- version
+ 782  127:           SEQUENCE {  --sid.signerIdentifier
+ 784  119:             SEQUENCE {
+ 786   11:               SET {
+ 788    9:                 SEQUENCE {
+ 790    3:                   OBJECT IDENTIFIER countryName (2 5 4 6)
+ 795    2:                   PrintableString 'DE'
+         :                   }
+         :                 }
+ 799   28:               SET {
+ 801   26:                 SEQUENCE {
+ 803    3:                   OBJECT IDENTIFIER organizationName (2 5 4 10)
+ 808   19:                   UTF8String 'Deutsche Telekom AG'
+         :                   }
+         :                 }
+ 829   18:               SET {
+ 831   16:                 SEQUENCE {
+ 833    3:                   OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
+ 838    9:                   UTF8String 'T-TeleSec'
+         :                   }
+         :                 }
+ 849   20:               SET {
+ 851   18:                 SEQUENCE {
+ 853    3:                   OBJECT IDENTIFIER commonName (2 5 4 3)
+ 858   11:                   UTF8String 'TKS CA 1:PN'
+         :                   }
+         :                 }
+ 871   10:               SET {
+ 873    8:                 SEQUENCE {
+ 875    3:                   OBJECT IDENTIFIER serialNumber (2 5 4 5)
+ 880    1:                   PrintableString '1'
+         :                   }
+         :                 }
+ 883   20:               SET {
+ 885   18:                 SEQUENCE {
+ 887    3:                   OBJECT IDENTIFIER pseudonym (2 5 4 65)
+ 892   11:                   UTF8String 'TKS CA 1:PN'
+         :                   }
+         :                 }
+         :               }
+ 905    4:             INTEGER 649228179
+         :             } -- end signerIdentifier
+ 911   13:           SEQUENCE {  -- digestAlgorithm
+ 913    9:             OBJECT IDENTIFIER sha-256 (2 16 840 1 101 3 4 2 1)
+ 924    0:             NULL
+         :             }
+ 926  206:           [0] {  -- signedAttrs
+ 929   24:             SEQUENCE {
+ 931    9:               OBJECT IDENTIFIER contentType (1 2 840 113549 1 9 3)
+ 942   11:               SET {
+ 944    9:                 OBJECT IDENTIFIER data (1 2 840 113549 1 7 1)
+         :                 }
+         :               }
+ 955   28:             SEQUENCE {
+ 957    9:               OBJECT IDENTIFIER signingTime (1 2 840 113549 1 9 5)
+ 968   15:               SET {
+ 970   13:                 UTCTime 08/05/2020 08:30:09 GMT
+         :                 }
+         :               }
+ 985   42:             SEQUENCE {
+ 987    9:               OBJECT IDENTIFIER '1 2 840 113549 1 9 52'
+ 998   29:               SET {
+1000   27:                 SEQUENCE {
+1002   13:                   SEQUENCE {
+1004    9:                     OBJECT IDENTIFIER
+         :                       sha-256 (2 16 840 1 101 3 4 2 1)
+1015    0:                     NULL
+         :                     }
+1017   10:                   [1] {
+1019    8:                     OBJECT IDENTIFIER
+         :                       ecdsaWithSHA256 (1 2 840 10045 4 3 2)
+         :                     }
+         :                   }
+         :                 }
+         :               }
+1029   47:             SEQUENCE {
+1031    9:               OBJECT IDENTIFIER messageDigest (1 2 840 113549 1 9 4)
+1042   34:               SET {
+1044   32:                 OCTET STRING
+         :                   A5 F1 A3 86 07 5E 07 9F 44 D3 9F 89 FF C6 4A E6
+         :                   A0 A3 7F DC F3 38 95 CC 7C A0 E8 17 DA E3 55 D6
+         :                 }
+         :               }
+1078   55:             SEQUENCE {
+1080   11:               OBJECT IDENTIFIER
+         :                 signingCertificateV2 (1 2 840 113549 1 9 16 2 47)
+1093   40:               SET {
+1095   38:                 SEQUENCE {
+1097   36:                   SEQUENCE {
+1099   34:                     SEQUENCE {
+1101   32:                       OCTET STRING
+         :                     DA AF A8 84 FE 82 0A BA 58 4C 4D 56 F8 31 46 4A
+         :                     E1 6B 56 66 40 9B F1 5D F1 2B 6C 90 8F 76 AD 23
+         :                       }
+         :                     }
+         :                   }
+         :                 }
+         :               }
+         :             }  -- end signedAttrs
+1135   10:           SEQUENCE {  -- signatureAlgorithm
+1137    8:             OBJECT IDENTIFIER ecdsaWithSHA256 (1 2 840 10045 4 3 2)
+         :             }
+1147   71:           OCTET STRING, encapsulates {  -- signature
+1149   69:             SEQUENCE {
+1151   33:               INTEGER
+         :                 00 A0 DE 18 D7 2A 72 FF E7 E4 47 27 80 67 F3 85
+         :                 0C 90 72 44 18 C3 30 18 7C 5A A1 E8 7F 1B C9 48
+         :                 3D
+1186   32:               INTEGER
+         :                 36 B1 15 F6 DA BA 02 16 48 64 91 17 32 D5 43 84
+         :                 35 80 0D E3 EF 00 10 FD BF 4D 26 8A 54 CD 72 BD
+         :               }
+         :             }
+1220    0:           [1]  -- unsignedAttrs
+         :             Error: Object has zero length.
+         :           }
+         :         }
+         :       }
+         :     }
+         :   }
diff --git a/tests/samples/rsa-sample1.p7m.asn b/tests/samples/rsa-sample1.p7m.asn
deleted file mode 100644 (file)
index a311aae..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-   0 NDEF: SEQUENCE {
-   2    9:   OBJECT IDENTIFIER envelopedData (1 2 840 113549 1 7 3)
-  13 NDEF:   [0] {  -- content
-  15 NDEF:     SEQUENCE {
-  17    1:       INTEGER 0  -- version CMSVersion
-  20  538:       SET {      -- recipientInfos
-  24  534:         SEQUENCE {  -- ktri
-  28    1:           INTEGER 0   -- version
-  31  126:           SEQUENCE {  -- rid.issuerAndSerialNumber
-  33  120:             SEQUENCE {
-  35   11:               SET {
-  37    9:                 SEQUENCE {
-  39    3:                   OBJECT IDENTIFIER countryName (2 5 4 6)
-  44    2:                   PrintableString 'DE'
-         :                   }
-         :                 }
-  48   22:               SET {
-  50   20:                 SEQUENCE {
-  52    3:                   OBJECT IDENTIFIER organizationName (2 5 4 10)
-  57   13:                   PrintableString 'g10 Code GmbH'
-         :                   }
-         :                 }
-  72   16:               SET {
-  74   14:                 SEQUENCE {
-  76    3:                   OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
-  81    7:                   PrintableString 'Testlab'
-         :                   }
-         :                 }
-  90   30:               SET {
-  92   28:                 SEQUENCE {
-  94    3:                   OBJECT IDENTIFIER commonName (2 5 4 3)
-  99   21:                   PrintableString 'g10 Code TEST CA 2019'
-         :                   }
-         :                 }
- 122   31:               SET {
- 124   29:                 SEQUENCE {
- 126    9:                   OBJECT IDENTIFIER
-         :                     emailAddress (1 2 840 113549 1 9 1)
- 137   16:                   IA5String 'info@g10code.com'
-         :                   }
-         :                 }
-         :               }
- 155    2:             INTEGER 6660
-         :             }  -- end rid.issuerAndSerialNumber
- 159   13:           SEQUENCE {  -- keyEncryptionAlgorithm
- 161    9:             OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 1 1)
- 172    0:             NULL
-         :             }
- 174  384:           OCTET STRING  -- encryptedKey
-         :             4F E8 F7 AF BD 6D 0A C0 96 69 A6 51 27 9A E9 D8
-         :             D4 95 FA E2 88 7B FF 72 09 89 56 E5 57 17 EA 31
-         :             65 8D 14 14 06 3A 30 05 C5 46 3F 47 F3 D0 14 8B
-         :             D9 9B 4B EA 09 26 F8 3E 6B 8B A5 EC 97 FE 77 9A
-         :             43 BC 6D 16 0C 5F 6E AA 1D 12 A8 C9 5F 41 A0 D6
-         :             65 19 CF EA 4C BE 9C 15 D4 B6 90 93 96 31 99 03
-         :             85 EF 43 0E 6E 4E 07 C7 F9 46 B4 22 81 B2 52 73
-         :             C8 0B 90 E7 F4 6D 15 61 79 0B D2 AA A2 F4 29 45
-         :             67 10 0E 39 E3 6B 5F BF 3A F3 E8 39 66 87 1A 49
-         :             12 1E 03 24 BF F6 26 7F 81 04 DC 52 DE 44 E5 5F
-         :             73 FA 7C 22 9E 55 D4 E3 EA 74 71 7F E0 07 EE 10
-         :             CF 35 7F 7D DE 64 6B A6 43 33 2A 74 96 23 D0 46
-         :             D3 F6 05 61 55 84 8C 98 EC FA 53 21 83 6E FE 6A
-         :             2A 2C 91 81 FD 4C 9A C5 C5 AB 55 89 98 64 54 33
-         :             CF A2 9B 1D FB 5A DE D6 B5 2A 11 5D 47 9C B5 37
-         :             AE 22 49 97 3B F4 9F E7 F7 5C 57 27 42 39 35 0B
-         :             3B 23 59 01 90 58 70 C0 06 FB DB 11 AE 57 9E AE
-         :             5F 1B 9B 2C 8C 9A EE 31 EB 69 F0 AE A4 68 54 18
-         :             68 4B 69 6A 7A 86 9E 60 86 80 20 51 A0 EC 8C 7D
-         :             18 7B FA 44 64 E9 4E D7 6A FA C0 AB 90 7A B3 E3
-         :             02 B9 FF 45 6F 6F B5 0C E3 D1 F2 F9 6E 05 BD E0
-         :             D7 A9 BB 10 DF A9 A4 13 65 3D DB 42 F3 04 7F 9E
-         :             62 6B 75 BE 89 6E 85 04 EF 38 DB 64 44 09 5C 64
-         :             79 73 99 F3 DD EB 16 BA 06 C2 92 84 A8 6B 7B 86
-         :           }  -- end ktri
-         :         }  -- end recipientInfos
- 562 NDEF:       SEQUENCE {  --encryptedContentInfo
- 564    9:         OBJECT IDENTIFIER data (1 2 840 113549 1 7 1)
- 575   29:         SEQUENCE { -- contentEncryptionAlgorithm
- 577    9:           OBJECT IDENTIFIER aes128-CBC (2 16 840 1 101 3 4 1 2)
- 588   16:           OCTET STRING A1 53 A3 8D A7 3A 23 5F 1D 46 10 8D 56 00 BC 3C
-         :           }
- 606 NDEF:         [0] { -- encryptedContent
- 608  112:           OCTET STRING
-         :             DA 9F 04 37 3F C5 7F 47 45 88 D6 04 AE 28 8E 98
-         :             99 14 DD C1 DC 0A A9 18 38 BC 96 6D 05 AA 6F 82
-         :             BB 10 06 55 CF 43 0D 97 AB 6C 30 9A 70 1F BE D2
-         :             35 A5 2E 96 F2 BC 4F 57 12 2F 2A FD 72 7A 79 CA
-         :             9E 76 A5 05 62 47 0B 36 25 59 EE 1C 9F 7F 82 39
-         :             F6 58 91 3C 3B 97 A1 3E 5B A4 FA 6D 54 75 AF D8
-         :             68 3F 24 52 56 C1 3D 88 39 53 0E 68 DD F8 5A 38
- 722   16:           OCTET STRING F4 3A D1 CC 9A 64 31 C8 B7 3E ED F7 B9 FF 8F DC
-         :           }
-         :         }
-         :       }
-         :     }
-         :   }
diff --git a/tests/samples/rsa-sample1.p7s b/tests/samples/rsa-sample1.p7s
new file mode 100644 (file)
index 0000000..c02b37f
Binary files /dev/null and b/tests/samples/rsa-sample1.p7s differ
index 9c45877..ba7be41 100644 (file)
@@ -30,7 +30,7 @@
 #include <string.h>
 #include <sys/types.h>
 
-#ifndef HAVE_U32_TYPEDEF
+#ifndef HAVE_TYPE_U32
 #undef u32         /* maybe there is a macro with this name */
 #if SIZEOF_UNSIGNED_INT == 4
     typedef unsigned int u32;
@@ -39,7 +39,7 @@
 #else
 #error no typedef for u32
 #endif
-#define HAVE_U32_TYPEDEF
+#define HAVE_TYPE_U32
 #endif
 
 typedef struct
index 3fe64fe..a3e8531 100644 (file)
@@ -101,6 +101,7 @@ one_file (const char *fname)
     case KSBA_CT_ENCRYPTED_DATA: s = "encrypted data"; break;
     case KSBA_CT_AUTH_DATA:      s = "auth data"; break;
     case KSBA_CT_SPC_IND_DATA_CTX:s = "spc indirect data context"; break;
+    case KSBA_CT_OPENPGP_KEYBLOCK:s = "openpgp keyblock"; break;
     default:                     s = "unknown"; break;
     }
   if (!quiet)
@@ -290,18 +291,37 @@ main (int argc, char **argv)
     }
 
   if (argc)
-    one_file (argv[0]);
+    {
+      for (; argc; argc--, argv++)
+        one_file (*argv);
+    }
   else
     {
-      char *fname = prepend_srcdir ("samples/detached-sig.cms");
+      static char *testfiles[] =
+        {
+         "samples/detached-sig.cms",
+         "samples/ecdh-sample1.p7m",
+         "samples/ecdsa-sample1.p7s",
+         "samples/rsa-sample1.p7m",
+         "samples/rsa-sample1.p7s",
+         NULL
+        };
+      char *fname;
+      int idx;
 
       if (!verbose)
         quiet = 1;
-      one_file (fname);
-      free(fname);
+
+      for (idx=0; testfiles[idx]; idx++)
+        {
+          fname = prepend_srcdir (testfiles[idx]);
+          one_file (fname);
+          free(fname);
+        }
     }
-  /*one_file ("pkcs7-1.ber");*/
-  /*one_file ("root-cert-2.der");  should fail */
+
+  if (!quiet)
+    printf ("*** all checks done\n");
 
   return 0;
 }