From 95a79013882e8914c29208b4dbd39343c2b13a2c Mon Sep 17 00:00:00 2001 From: Pierre-Louis Palant Date: Wed, 7 Aug 2019 11:36:09 +0200 Subject: [PATCH] Virt_cacard is no longer buildable as a submodule within OpenSC --- Makefile.am | 1 - README.md | 13 +------------ autogen.sh | 2 ++ build-aux/compile | 1 + build-aux/depcomp | 1 + build-aux/install-sh | 1 + build-aux/missing | 1 + configure.ac | 40 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 47 insertions(+), 13 deletions(-) create mode 100755 autogen.sh create mode 120000 build-aux/compile create mode 120000 build-aux/depcomp create mode 120000 build-aux/install-sh create mode 120000 build-aux/missing create mode 100644 configure.ac diff --git a/Makefile.am b/Makefile.am index ad5efb6..8532c35 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,3 @@ -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in EXTRA_DIST = setup-softhsm2.sh AM_CFLAGS = -Wall diff --git a/README.md b/README.md index 611c3e7..385d735 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Virtual CAC using libcacard, virtualsmartcard's vpcd and softhsm2 to provide PCS The [virtual pcscd](https://github.com/frankmorgner/vsmartcard/tree/master/virtualsmartcard) provides a socket based interface on one side, and the classic PCSC API on the other. -[OpenSC](https://github.com/OpenSC/OpenSC) natively uses the PCSC API to communicate with smart cards. The vpcd relays those communications through its socket. This should work with any application using the PCSC API, but virt_cacard was designed to help with the CI/CD of OpenSC. +To use virt_cacard, you need a program (such as [OpenSC](https://github.com/OpenSC/OpenSC)'s tools that uses the PCSC API to communicate with smart cards. The vpcd relays those communications through its socket. This should work with any application using the PC/SC API, but virt_cacard was designed to help with the CI/CD of OpenSC. The virtual smart card, emulated with [libcacard](https://gitlab.freedesktop.org/spice/libcacard/), connects to the socket and can then get (and reply to) APDUs from the application. From the point of view of the application, the process is transparent. @@ -18,17 +18,6 @@ OpenSC tests: [![virt_cacard](https://gitlab.com/PL4typus/Ope --- ## How to build virt_cacard -At the time of writing, I recommend building from OpenSC as it is the most up to date and tested version. - -### How to build from OpenSC (*integration* branch only) - - ./bootstrap - ./configure --enable-virt_cacard - make -j4 && make check - ---- -### Standalone build (*current* branch only) - ./autogen.sh ./configure make diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..7e04724 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +autoreconf --install --verbose --symlink diff --git a/build-aux/compile b/build-aux/compile new file mode 120000 index 0000000..b6af400 --- /dev/null +++ b/build-aux/compile @@ -0,0 +1 @@ +/usr/share/automake-1.16/compile \ No newline at end of file diff --git a/build-aux/depcomp b/build-aux/depcomp new file mode 120000 index 0000000..4ed246b --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1 @@ +/usr/share/automake-1.16/depcomp \ No newline at end of file diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 120000 index 0000000..ae5e89b --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1 @@ +/usr/share/automake-1.16/install-sh \ No newline at end of file diff --git a/build-aux/missing b/build-aux/missing new file mode 120000 index 0000000..6059988 --- /dev/null +++ b/build-aux/missing @@ -0,0 +1 @@ +/usr/share/automake-1.16/missing \ No newline at end of file diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..3be51f1 --- /dev/null +++ b/configure.ac @@ -0,0 +1,40 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([virt_cacard], [1], [pl.palant@redhat.com]) +AC_CONFIG_SRCDIR([src/connection.h]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_AUX_DIR([build-aux]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +PKG_CHECK_MODULES([CACARD], [libcacard]) +AC_SUBST(CACARD_CFLAGS) +AC_SUBST(CACARD_LIBS) + + +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22]) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + + +# Checks for header files. +AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h ], + [], + [AC_MSG_ERROR([unable to find all required headers]) +]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_UINT16_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_CHECK_FUNCS([memset socket]) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT