From 77f6e94e6f4644a88a01fe5d597da76cb3f71273 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Thu, 23 Mar 2017 21:03:07 +0100 Subject: [PATCH] fixed import of multiple symbols regression of 45a7ea9737075b5901fe7a5d65ed898733140315: due to the change in the linkage, the symbols should be found in opensc.dll instead of the static support libraries. --- src/tools/Makefile.am | 3 +-- src/tools/Makefile.mak | 2 -- src/tools/npa-tool.c | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index cef8b243..7211a3c5 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -38,7 +38,7 @@ LIBS = \ $(top_builddir)/src/common/libcompat.la sceac_example_SOURCES = sceac-example.c -sceac_example_LDADD = $(top_builddir)/src/sm/libsmeac.la $(top_builddir)/src/libopensc/libopensc.la $(OPENPACE_LIBS) +sceac_example_LDADD = $(top_builddir)/src/libopensc/libopensc.la $(OPENPACE_LIBS) sceac_example_CFLAGS = -I$(top_srcdir)/src $(OPENPACE_CFLAGS) opensc_tool_SOURCES = opensc-tool.c util.c @@ -78,7 +78,6 @@ gids_tool_LDADD = $(OPTIONAL_OPENSSL_LIBS) npa_tool_SOURCES = npa-tool.c fread_to_eof.c $(NPA_TOOL_BUILT_SOURCES) npa_tool_LDADD = $(top_builddir)/src/libopensc/libopensc.la \ - $(top_builddir)/src/sm/libsmeac.la \ $(OPENPACE_LIBS) npa_tool_CFLAGS = -I$(top_srcdir)/src $(OPENPACE_CFLAGS) $(OPENSSL_CFLAGS) diff --git a/src/tools/Makefile.mak b/src/tools/Makefile.mak index d9bf0cbf..d03c52c7 100644 --- a/src/tools/Makefile.mak +++ b/src/tools/Makefile.mak @@ -14,8 +14,6 @@ LIBS = $(TOPDIR)\src\common\common.lib \ $(TOPDIR)\src\libopensc\opensc.lib \ $(TOPDIR)\src\pkcs15init\pkcs15init.lib \ $(TOPDIR)\src\common\libpkcs11.lib \ - $(TOPDIR)\src\sm\libsmeac.lib \ - $(TOPDIR)\src\sm\libsmiso.lib \ $(TOPDIR)\src\common\libscdl.lib all: $(TARGETS) diff --git a/src/tools/npa-tool.c b/src/tools/npa-tool.c index b44f0015..a2a74a04 100644 --- a/src/tools/npa-tool.c +++ b/src/tools/npa-tool.c @@ -81,6 +81,21 @@ static int getline(char **lineptr, size_t *n, FILE *stream) } #endif +/* we don't want to export this from libopensc so we implement it here, again */ +#include + +#define ASN1_APP_IMP_OPT(stname, field, type, tag) ASN1_EX_TYPE(ASN1_TFLG_IMPTAG|ASN1_TFLG_APPLICATION|ASN1_TFLG_OPTIONAL, tag, stname, field, type) +#define ASN1_APP_IMP(stname, field, type, tag) ASN1_EX_TYPE(ASN1_TFLG_IMPTAG|ASN1_TFLG_APPLICATION, tag, stname, field, type) + +/* 0x67 + * Auxiliary authenticated data */ +ASN1_ITEM_TEMPLATE(ASN1_AUXILIARY_DATA) = + ASN1_EX_TEMPLATE_TYPE( + ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_IMPTAG|ASN1_TFLG_APPLICATION, + 7, AuxiliaryAuthenticatedData, CVC_DISCRETIONARY_DATA_TEMPLATE) +ASN1_ITEM_TEMPLATE_END(ASN1_AUXILIARY_DATA) +IMPLEMENT_ASN1_FUNCTIONS(ASN1_AUXILIARY_DATA) + /** * @brief Print binary data to a file stream *