ADDED LICENSE Index: LICENSE ================================================================== --- /dev/null +++ LICENSE @@ -0,0 +1,17 @@ +The following files in this directory are the intellectual property of the +Free Software Foundation and are licensed under the terms of the GNU General +Public License (GPL): + config.guess, config.sub, install-sh + +The files in this directory and the "leakcheck" directory are the intellectual +property of the United States Government. It is not clear which, if any, +license is made on them. In addition, as of 07-JUN-2010 they have not be +cleared for public release. + +The files in the "pkcs11/" directory are licensed under the terms of the +following licenses: + mypkcs11.h : GNU General Public License 2.1. + pkcs11.h : GNU General Public License 2.1. + pkcs11f.h : GNU General Public License 2.1. + pkcs11n.h : Mozilla Public License or GNU General Public License + pkcs11t.h : GNU General Public License 2.1. ADDED README.txt Index: README.txt ================================================================== --- /dev/null +++ README.txt @@ -0,0 +1,31 @@ +Description: + CACKey provides a standard interface (PKCS#11) for smartcards connected + to a PC/SC compliant reader. It performs a similar function to + "CoolKey", but only supports Government Smartcards. It supports all + Government Smartcards that implement the Government Smartcard + Interoperability Specification (GSC-IS) v2.1 or newer. + +Compiling: + $ ./configure + $ make + # make install + + This will install two libraries (libcackey.so, and libcackey_g.so) into + "/usr/local/lib". + +Usage: + The libraries "libcackey.so" and "libcackey_g.so" are RSA PKCS#11 + Providers. They are meant to be linked into any application that + requires a PKCS#11 provider. + + The library "libcackey.so" is meant for general purpose use. + + The library "libcackey_g.so" is for debugging purposes. It has + debugging symbols compiled in and generates debugging information on + stderr. + +Testing: + $ make test + $ ./test + - or - + $ ./test 2>cackey_debug.log Index: aclocal/Makefile ================================================================== --- aclocal/Makefile +++ aclocal/Makefile @@ -1,2 +1,2 @@ -../aclocal.m4: acx_pthread.m4 dc_shobjs.m4 dc_pcscheaders.m4 dc_versionscript.m4 +../aclocal.m4: acx_pthread.m4 dc_shobjs.m4 dc_pcsc.m4 dc_versionscript.m4 cat $^ > "$@" ADDED aclocal/dc_pcsc.m4 Index: aclocal/dc_pcsc.m4 ================================================================== --- /dev/null +++ aclocal/dc_pcsc.m4 @@ -0,0 +1,74 @@ +AC_DEFUN(DC_PCSC_HEADERS, [ + SAVE_CFLAGS="${CFLAGS}" + SAVE_CPPFLAGS="${CPPFLAGS}" + ADD_CFLAGS="" + ADD_CPPFLAGS="" + + for headerpath in /usr/include /usr/local/include /usr/cac/include; do + for subdir in smartcard PCSC pcsc pcsclite ""; do + headerdir="${headerpath}/${subdir}" + CFLAGS="${SAVE_CFLAGS} -I${headerdir}" + CPPFLAGS="${SAVE_CPPFLAGS} -I${headerdir}" + + unset ac_cv_header_pcsclite_h + unset ac_cv_header_winscard_h + + AC_CHECK_HEADER(pcsclite.h, [ + AC_DEFINE(HAVE_PCSCLITE_H, [1], [Define if you have the PCSC-Lite header file (you should)]) + + ADD_CFLAGS=" -I${headerdir}" + ADD_CPPFLAGS=" -I${headerdir}" + + break + ]) + + AC_CHECK_HEADER(winscard.h, [ + AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)]) + + ADD_CFLAGS=" -I${headerdir}" + ADD_CPPFLAGS=" -I${headerdir}" + + break + ]) + done + + if test -n "${ADD_CFLAGS}" -o -n "${ADD_CPPFLAGS}"; then + break + fi + done + + CFLAGS="${SAVE_CFLAGS}${ADD_CFLAGS}" + CPPFLAGS="${SAVE_CPPFLAGS}${ADD_CPPFLAGS}" + + unset ac_cv_header_winscard_h + AC_CHECK_HEADER(winscard.h, [ + AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)]) + ], [ + AC_MSG_WARN([unable to find winscard.h from PC/SC, compilation will likely fail.]) + ]) +]) + +AC_DEFUN(DC_PCSC_LIBS, [ + foundlib="0" + for lib in pcsclite pcsc-lite pcsc; do + AC_CHECK_LIB(${lib}, SCardEstablishContext, [ + LIBS="${LIBS} -l${lib}" + + foundlib="1" + + break + ]) + done + + if test "${foundlib}" = "0"; then + AC_MSG_WARN([unable to find PCSC library, compilation will likely fail.]) + fi + + dnl Check for SCardIsValidContext, only in newer PCSC-Lite + AC_CHECK_FUNCS(SCardIsValidContext) +]) + +AC_DEFUN(DC_PCSC, [ + DC_PCSC_HEADERS + DC_PCSC_LIBS +]) DELETED aclocal/dc_pcscheaders.m4 Index: aclocal/dc_pcscheaders.m4 ================================================================== --- aclocal/dc_pcscheaders.m4 +++ /dev/null @@ -1,64 +0,0 @@ -AC_DEFUN(DC_PCSC_HEADERS, [ - SAVE_CFLAGS="${CFLAGS}" - SAVE_CPPFLAGS="${CPPFLAGS}" - ADD_CFLAGS="" - ADD_CPPFLAGS="" - - for headerpath in /usr/include /usr/local/include /usr/cac/include; do - for subdir in smartcard PCSC pcsc pcsclite ""; do - headerdir="${headerpath}/${subdir}" - CFLAGS="${SAVE_CFLAGS} -I${headerdir}" - CPPFLAGS="${SAVE_CPPFLAGS} -I${headerdir}" - - unset ac_cv_header_pcsclite_h - unset ac_cv_header_winscard_h - - AC_CHECK_HEADER(pcsclite.h, [ - AC_DEFINE(HAVE_PCSCLITE_H, [1], [Define if you have the PCSC-Lite header file (you should)]) - - ADD_CFLAGS=" -I${headerdir}" - ADD_CPPFLAGS=" -I${headerdir}" - - break - ]) - - AC_CHECK_HEADER(winscard.h, [ - AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)]) - - ADD_CFLAGS=" -I${headerdir}" - ADD_CPPFLAGS=" -I${headerdir}" - - break - ]) - done - - if test -n "${ADD_CFLAGS}" -o -n "${ADD_CPPFLAGS}"; then - break - fi - done - - CFLAGS="${SAVE_CFLAGS}${ADD_CFLAGS}" - CPPFLAGS="${SAVE_CPPFLAGS}${ADD_CPPFLAGS}" - - unset ac_cv_header_winscard_h - AC_CHECK_HEADER(winscard.h, [ - AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)]) - ]) -]) - -AC_DEFUN(DC_PCSC_LIBS, [ - for lib in pcsclite pcsc-lite pcsc; do - AC_CHECK_LIB(${lib}, SCardEstablishContext, [ - LIBS="${LIBS} -l${lib}" - - break - ]) - done - - AC_CHECK_FUNCS(SCardIsValidContext) -]) - -AC_DEFUN(DC_PCSC, [ - DC_PCSC_HEADERS - DC_PCSC_LIBS -]) Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -12,11 +12,11 @@ dnl Determine how to create shared objects on this platform DC_GET_SHOBJFLAGS ACX_PTHREAD(, [ - AC_WARN([Can't figure out how to compile with pthreads support, run-time will likely fail.]) + AC_MSG_WARN([Can not figure out how to compile with pthreads support, run-time will likely fail.]) ]) dnl Determine how to create static archives on this platform AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib)