Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Import opensc-0.13.0git20140221130957 as wip/opensc.

From TODO:

    (The following is current as of opensc-0.13.0git20140221130957.)

    This is a newer version of security/opensc (a recent snapshot from
    the upstream Git repository).  Only minimal changes to
    opensc-0.12.2 have been made to get it to build; some of the
    contents of the Makefile may no longer be necessary (e.g.,
    CONFIGURE_ARGS, CONFIGURE_ENV, dependencies) and new
    settings/dependencies may be required.  No testing has been done,
    other than to ensure that it builds on NetBSD 6.1 i386.

    TODO:
      * basic testing
      * prune obsolete dependencies and settings from Makefile, if any
      * prune obsolete patches, if any
      * add new dependencies, if any
      * verify that options.mk is still appropriate

From DESCR:

    OpenSC provides a set of libraries and utilities to access smart
    cards.  Its main focus is on cards that support cryptographic
    operations, and facilitate their use in security applications such
    as mail encryption, authentication, and digital signature.  OpenSC
    implements the PKCS#11 API so applications supporting this API
    such as Mozilla Firefox and Thunderbird can use it.  OpenSC
    implements the PKCS#15 standard and aims to be compatible with
    every software that does so, too.
  • Loading branch information...
commit dcbedb6fc31f99d3fcdb63d33af7b4ac52d2fff3 1 parent c9736aa
r-hansen authored
View
1  Makefile
@@ -1912,6 +1912,7 @@ SUBDIR+= openmpi
SUBDIR+= openmpi163
SUBDIR+= openmx-openmpi
SUBDIR+= opennurbs
+SUBDIR+= opensc
SUBDIR+= openscep
SUBDIR+= opensips
SUBDIR+= opentracker-current
View
7 opensc/DESCR
@@ -0,0 +1,7 @@
+OpenSC provides a set of libraries and utilities to access smart cards.
+Its main focus is on cards that support cryptographic operations, and
+facilitate their use in security applications such as mail encryption,
+authentication, and digital signature. OpenSC implements the PKCS#11 API
+so applications supporting this API such as Mozilla Firefox and Thunderbird
+can use it. OpenSC implements the PKCS#15 standard and aims to be compatible
+with every software that does so, too.
View
68 opensc/Makefile
@@ -0,0 +1,68 @@
+# $NetBSD: Makefile,v 1.16 2013/07/15 02:02:28 ryoon Exp $
+
+# the Git SHA1 ID of the snapshot
+OPENSC_GIT_REVISION= a399905d234d3d6d2a9aa8501a4c8ba1224c6b31
+# this suffix is what is generated by the '-S' option to './bootstrap'
+# (when run from a Git clone of the OpenSC repository)
+OPENSC_VERSION_SUFFIX= git20140221130957
+# this revision is what is generated by the '-R' option to './bootstrap'
+# (when run from a Git clone of the OpenSC repository)
+OPENSC_VERSION_REVISION= 220
+OPENSC_PKG_VERSION= 0.13.0${OPENSC_VERSION_SUFFIX}
+DISTNAME= opensc-${OPENSC_PKG_VERSION}
+CATEGORIES= security
+MASTER_SITES= -https://github.com/OpenSC/OpenSC/archive/${OPENSC_GIT_REVISION}.tar.gz
+WRKSRC= ${WRKDIR}/OpenSC-${OPENSC_GIT_REVISION}
+
+MAINTAINER= rhansen@bbn.com
+HOMEPAGE= https://github.com/OpenSC/OpenSC/wiki
+COMMENT= Smart Card drivers and middleware
+LICENSE= gnu-lgpl-v2.1
+
+GNU_CONFIGURE= YES
+USE_LIBTOOL= YES
+USE_OLD_DES_API= YES
+USE_TOOLS+= gmake pkg-config
+
+USE_TOOLS+= autoreconf autoconf automake
+AUTOCONF_REQD= 2.60
+AUTOMAKE_REQD= 1.10
+pre-configure:
+ cd ${WRKSRC:Q} && \
+ ./bootstrap \
+ -s ${OPENSC_VERSION_SUFFIX:Q} \
+ -r ${OPENSC_VERSION_REVISION:Q}
+
+.include "options.mk"
+
+# Previous versions needed these, but 0.12.2 configure does not
+# recognize them.
+#CONFIGURE_ARGS+= --with-openssl=${SSLBASE:Q}
+#CONFIGURE_ARGS+= --disable-sensitive-logging
+
+# Is this necessary (and non-default)?
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
+
+# This is perhaps an upstream bug.
+CONFIGURE_ENV+= PCSC_CFLAGS=-I${PREFIX}/include/PCSC
+
+# The stylesheets are not found without this.
+CONFIGURE_ARGS+= --with-xsl-stylesheetsdir=${BUILDLINK_PREFIX.docbook-xsl}/share/xsl/docbook
+
+EGDIR= ${PREFIX}/share/examples/opensc
+CONF_FILES+= ${EGDIR}/opensc.conf ${PKG_SYSCONFDIR}/opensc.conf
+
+INSTALLATION_DIRS= ${EGDIR}
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/etc/opensc.conf ${DESTDIR}${EGDIR}
+
+# build tools for doc; should be TOOLS
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../textproc/docbook-xsl/buildlink3.mk"
+
+.include "../../devel/libltdl/buildlink3.mk"
+.include "../../mk/readline.buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+BUILDLINK_API_DEPENDS.openssl+= openssl>=0.9.7
+.include "../../security/openssl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
View
69 opensc/PLIST
@@ -0,0 +1,69 @@
+@comment $NetBSD: PLIST,v 1.6 2012/11/30 14:44:34 gdt Exp $
+bin/cardos-tool
+bin/cryptoflex-tool
+bin/dnie-tool
+bin/eidenv
+bin/iasecc-tool
+bin/netkey-tool
+bin/openpgp-tool
+bin/opensc-explorer
+bin/opensc-tool
+bin/piv-tool
+bin/pkcs11-tool
+bin/pkcs15-crypt
+bin/pkcs15-init
+bin/pkcs15-tool
+bin/sc-hsm-tool
+bin/westcos-tool
+lib/libopensc.la
+lib/opensc-pkcs11.la
+lib/pkcs11-spy.la
+lib/pkcs11/opensc-pkcs11.so
+lib/pkcs11/pkcs11-spy.so
+man/man1/cardos-tool.1
+man/man1/cryptoflex-tool.1
+man/man1/eidenv.1
+man/man1/iasecc-tool.1
+man/man1/netkey-tool.1
+man/man1/openpgp-tool.1
+man/man1/opensc-explorer.1
+man/man1/opensc-tool.1
+man/man1/piv-tool.1
+man/man1/pkcs11-tool.1
+man/man1/pkcs15-crypt.1
+man/man1/pkcs15-init.1
+man/man1/pkcs15-tool.1
+man/man1/sc-hsm-tool.1
+man/man1/westcos-tool.1
+man/man5/pkcs15-profile.5
+share/doc/opensc/NEWS
+share/examples/opensc/opensc.conf
+share/opensc/asepcos.profile
+share/opensc/authentic.profile
+share/opensc/cardos.profile
+share/opensc/cyberflex.profile
+share/opensc/entersafe.profile
+share/opensc/epass2003.profile
+share/opensc/flex.profile
+share/opensc/gpk.profile
+share/opensc/ias_adele_admin1.profile
+share/opensc/ias_adele_admin2.profile
+share/opensc/ias_adele_common.profile
+share/opensc/iasecc.profile
+share/opensc/iasecc_admin_eid.profile
+share/opensc/iasecc_generic_oberthur.profile
+share/opensc/iasecc_generic_pki.profile
+share/opensc/incrypto34.profile
+share/opensc/jcop.profile
+share/opensc/miocos.profile
+share/opensc/muscle.profile
+share/opensc/myeid.profile
+share/opensc/oberthur.profile
+share/opensc/openpgp.profile
+share/opensc/pkcs15.profile
+share/opensc/rutoken.profile
+share/opensc/rutoken_ecp.profile
+share/opensc/sc-hsm.profile
+share/opensc/setcos.profile
+share/opensc/starcos.profile
+share/opensc/westcos.profile
View
16 opensc/TODO
@@ -0,0 +1,16 @@
+(The following is current as of opensc-0.13.0git20140221130957.)
+
+This is a newer version of security/opensc (a recent snapshot from the
+upstream Git repository). Only minimal changes to opensc-0.12.2 have
+been made to get it to build; some of the contents of the Makefile may
+no longer be necessary (e.g., CONFIGURE_ARGS, CONFIGURE_ENV,
+dependencies) and new settings/dependencies may be required. No
+testing has been done, other than to ensure that it builds on NetBSD
+6.1 i386.
+
+TODO:
+ * basic testing
+ * prune obsolete dependencies and settings from Makefile, if any
+ * prune obsolete patches, if any
+ * add new dependencies, if any
+ * verify that options.mk is still appropriate
View
12 opensc/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.10 2012/11/30 14:44:34 gdt Exp $
+
+SHA1 (opensc-0.13.0git20140221130957.tar.gz) = 6d7b05dc43ed9e0f9f1c25d0bfe8dd6c105f954c
+RMD160 (opensc-0.13.0git20140221130957.tar.gz) = 0c258f159751dc579f8a202bc8bd425e0b3c1a3d
+Size (opensc-0.13.0git20140221130957.tar.gz) = 1173029 bytes
+SHA1 (patch-aa) = 900d27328ccdf63e1b6fb00b9c99f28a486e2ac6
+SHA1 (patch-ab) = 64ce4684571014fd3405e5dc908d96c88d2a4c69
+SHA1 (patch-bootstrap) = 6c2d40f3c1520ab3cdcf5089e3ca955cf569748b
+SHA1 (patch-src_common_compat__getopt.c) = cf295b41fc79e223b4dac2939e1344591a045b02
+SHA1 (patch-src_common_compat__getopt.h) = 22c56f61e006be917422d68c902d769d7beabc99
+SHA1 (patch-src_common_compat__getopt__main.c) = b37df3ea71978a55a100249724103ae14111fb29
+SHA1 (patch-src_pkcs11_pkcs11-global.c) = 5356ee2a94e4fe019b3127558c04e95a595db675
View
26 opensc/options.mk
@@ -0,0 +1,26 @@
+# $NetBSD: options.mk,v 1.3 2012/12/03 20:23:15 gdt Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.opensc
+
+# Arguably these should be selectable individually, but upstream requires
+# that exactly one be chosen.
+PKG_OPTIONS_REQUIRED_GROUPS= cardreader
+PKG_OPTIONS_GROUP.cardreader= pcsc-lite openct
+PKG_SUGGESTED_OPTIONS= pcsc-lite
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mpcsc-lite)
+.include "../../security/pcsc-lite/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-pcsc
+CONFIGURE_ARGS+= --with-pcsc-provider=${BUILDLINK_PREFIX.pcsc-lite}/lib/libpcsclite.la
+.else
+CONFIGURE_ARGS+= --disable-pcsc
+.endif
+
+.if !empty(PKG_OPTIONS:Mopenct)
+.include "../../security/openct/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-openct
+.else
+CONFIGURE_ARGS+= --disable-openct
+.endif
View
19 opensc/patches/patch-aa
@@ -0,0 +1,19 @@
+$NetBSD: patch-aa,v 1.3 2012/11/30 14:44:34 gdt Exp $
+
+Disable installation of config file, because pkgsrc installs config
+files as examples.
+
+--- etc/Makefile.am.orig 2014-02-21 12:09:57.000000000 +0000
++++ etc/Makefile.am
+@@ -22,11 +22,3 @@ opensc.conf: opensc.conf.in force
+ -e 's|@DEFAULT_SM_MODULE[@]|$(DEFAULT_SM_MODULE)|g' \
+ -e 's|@DEBUG_FILE[@]|$(DEBUG_FILE)|g' \
+ < $< > $@
+-
+-install-exec-hook: opensc.conf
+- $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
+- if [ -f "$(DESTDIR)$(sysconfdir)/opensc.conf" ]; then \
+- $(INSTALL_DATA) opensc.conf "$(DESTDIR)$(sysconfdir)/opensc.conf.new"; \
+- else \
+- $(INSTALL_DATA) opensc.conf "$(DESTDIR)$(sysconfdir)/opensc.conf"; \
+- fi
View
15 opensc/patches/patch-ab
@@ -0,0 +1,15 @@
+$NetBSD: patch-ab,v 1.3 2012/11/30 14:44:34 gdt Exp $
+
+This patch was added 2009-09-10 by hasso@, with comment:
+ More userfriendly default configuration.
+
+--- etc/opensc.conf.in.orig 2014-02-21 12:09:57.000000000 +0000
++++ etc/opensc.conf.in
+@@ -459,6 +459,7 @@ app default {
+ #
+ # Default: no
+ # try_emulation_first = yes;
++ try_emulation_first = yes;
+
+ # Enable builtin emulators.
+ # Default: yes
View
35 opensc/patches/patch-bootstrap
@@ -0,0 +1,35 @@
+$NetBSD$
+
+ * fix sed regular expressions to be POSIX BREs (change '\s' to
+ '[[:space:]]', '+' to '\{1,\}') (not yet reported upstream)
+ * quote $SUFFIX and $REVISION variable expansions (not yet reported
+ upstream)
+
+--- bootstrap.orig 2014-02-24 21:54:33.000000000 +0000
++++ bootstrap
+@@ -32,7 +32,7 @@ do
+ SUFFIX=$OPTARG
+ ;;
+ S)
+- SUFFIX=git`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
++ SUFFIX=git`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:[[:space:]](.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)[[:space:]]\{1,\}.*/\1\2\3\4\5\6/'`
+ ;;
+ r)
+ REVISION=$OPTARG
+@@ -65,14 +65,14 @@ then
+ if [ -n "$SUFFIX" ]
+ then
+ echo Set package suffix "$SUFFIX"
+- sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' configure.ac > configure.ac.next
++ sed 's/^define(\[PACKAGE_SUFFIX\],[[:space:]]*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['"$SUFFIX"'\])/g' configure.ac > configure.ac.next
+ mv configure.ac.next configure.ac
+ fi
+
+ if [ -n "$REVISION" ]
+ then
+ echo Set package revision "$REVISION"
+- sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' configure.ac > configure.ac.next
++ sed 's/^define(\[PACKAGE_VERSION_REVISION\],[[:space:]]*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['"$REVISION"'\])/g' configure.ac > configure.ac.next
+ mv configure.ac.next configure.ac
+ fi
+ fi
View
15 opensc/patches/patch-src_common_compat__getopt.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_common_compat__getopt.c,v 1.1 2012/11/30 14:44:35 gdt Exp $
+
+See comment in patch-src_common_compat__getopt.h.
+
+--- src/common/compat_getopt.c.orig 2014-02-21 12:09:57.000000000 +0000
++++ src/common/compat_getopt.c
+@@ -25,7 +25,7 @@
+
+ #include "config.h"
+
+-#if ! ( defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) && defined(HAVE_GETOPT_LONG_ONLY) )
++#if ! ( defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) )
+
+ #include <sys/types.h>
+ #include <stdlib.h>
View
41 opensc/patches/patch-src_common_compat__getopt.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_common_compat__getopt.h,v 1.1 2012/11/30 14:44:35 gdt Exp $
+
+NetBSD has getopt_long but not getopt_long_only. Replacing
+getopt_long causes a type conflict with the built-in implementation.
+The replacement is unnecesssary because getopt_long_only is not
+actually used.
+
+Reported upstream:
+http://article.gmane.org/gmane.comp.encryption.opensc.user/5931
+
+The following is the original mail archive URL, but it currently
+yields a '404 not found' error:
+https://www.opensc-project.org/pipermail/opensc-devel/2012-November/018668.html
+
+--- src/common/compat_getopt.h.orig 2014-02-21 12:09:57.000000000 +0000
++++ src/common/compat_getopt.h
+@@ -30,7 +30,7 @@
+ #include "config.h"
+ #endif
+
+-#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) && defined(HAVE_GETOPT_LONG_ONLY)
++#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG)
+ #include <getopt.h>
+ #else
+
+@@ -43,7 +43,6 @@ extern "C" {
+
+ #define getopt my_getopt
+ #define getopt_long my_getopt_long
+-#define getopt_long_only my_getopt_long_only
+ #define _getopt_internal _my_getopt_internal
+ #define opterr my_opterr
+ #define optind my_optind
+@@ -86,6 +85,6 @@ extern int _my_getopt_internal(int argc,
+ }
+ #endif
+
+-#endif /* HAVE_GETOPT_H && HAVE_GETOPT_LONG && HAVE_GETOPT_LONG_ONLY */
++#endif /* HAVE_GETOPT_H && HAVE_GETOPT_LONG */
+
+ #endif /* MY_GETOPT_H_INCLUDED */
View
17 opensc/patches/patch-src_common_compat__getopt__main.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_common_compat__getopt__main.c,v 1.1 2012/11/30 14:44:35 gdt Exp $
+
+See comment in patch-src_common_compat__getopt.h. In addition, a
+kludge is added here to get the test file to build, pending a new
+release from upstream with the issue properly addressed.
+
+--- src/common/compat_getopt_main.c.orig 2014-02-21 12:09:57.000000000 +0000
++++ src/common/compat_getopt_main.c
+@@ -173,6 +173,8 @@ main(int argc, char * argv[])
+ progname);
+ }
+
++#define getopt_long_only getopt_long
++
+ /* parse all options from the command line */
+ while ((opt =
+ getopt_long_only(argc, argv, shortopts, longopts, &longind)) != -1)
View
17 opensc/patches/patch-src_pkcs11_pkcs11-global.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_pkcs11_pkcs11-global.c,v 1.2 2012/11/30 14:44:35 gdt Exp $
+
+Use correct size for malloc.
+
+Not yet reported upstream.
+
+--- src/pkcs11/pkcs11-global.c.orig 2014-02-21 12:09:57.000000000 +0000
++++ src/pkcs11/pkcs11-global.c
+@@ -42,7 +42,7 @@ extern CK_FUNCTION_LIST pkcs11_function_
+ #include <pthread.h>
+ CK_RV mutex_create(void **mutex)
+ {
+- pthread_mutex_t *m = calloc(1, sizeof(*mutex));
++ pthread_mutex_t *m = calloc(1, sizeof(*m));
+ if (m == NULL)
+ return CKR_GENERAL_ERROR;;
+ pthread_mutex_init(m, NULL);
Please sign in to comment.
Something went wrong with that request. Please try again.