Skip to content

Commit

Permalink
Virt_cacard is no longer buildable as a submodule within OpenSC
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Louis Palant committed Aug 7, 2019
1 parent afde3b1 commit 95a7901
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 13 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
EXTRA_DIST = setup-softhsm2.sh

AM_CFLAGS = -Wall
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
autoreconf --install --verbose --symlink
1 change: 1 addition & 0 deletions build-aux/compile
1 change: 1 addition & 0 deletions build-aux/depcomp
1 change: 1 addition & 0 deletions build-aux/install-sh
1 change: 1 addition & 0 deletions build-aux/missing
40 changes: 40 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([virt_cacard], [1], [[email protected]])
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

0 comments on commit 95a7901

Please sign in to comment.