New port: security/ifd-gpr400: PC/SC Lite IFD for Gemplus GPR400

This is the user-space IFD driver to support the Gemplus
	GPR400 PCMCIA Smart Card Reader under PC/SC Lite.

PR:		ports/42697
Submitted by:	Bruce M Simpson <bms@spc.org>
This commit is contained in:
Edwin Groothuis 2003-01-20 07:00:02 +00:00
parent 25ff9d847d
commit 66a53cafed
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=73622
10 changed files with 158 additions and 0 deletions

View File

@ -85,6 +85,7 @@
SUBDIR += ident2
SUBDIR += identify
SUBDIR += ifd-devkit
SUBDIR += ifd-gpr400
SUBDIR += inflex
SUBDIR += integrit
SUBDIR += ipfmeta

View File

@ -0,0 +1,24 @@
# New ports collection makefile for: ifd-gpr400
# Date created: 23 August 2002
# Whom: Bruce M Simpson
#
# $FreeBSD$
#
PORTNAME= ifd-gpr400
PORTVERSION= 0.3
CATEGORIES= security
MASTER_SITES= http://www.innovationsw.com/~jaiger/downloads/smartcard/
MAINTAINER= bms@spc.org
BUILD_DEPENDS= ${LOCALBASE}/include/ifdhandler.h:${PORTSDIR}/security/ifd-devkit
LIB_DEPENDS= pcsclite.0:${PORTSDIR}/devel/pcsc-lite
MAKE_ENV+= DESTDIR="${PREFIX}"
INSTALLS_SHLIB= yes
NOMAN=
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (ifd-gpr400-0.3.tar.gz) = 3c990234519aad05ffb1c0fb4c7b0a1c

View File

@ -0,0 +1,75 @@
--- Makefile.orig Thu Aug 9 06:14:42 2001
+++ Makefile Sun Sep 8 18:11:11 2002
@@ -1,36 +1,41 @@
-# GPR400 IFD Handler Makefile
-#
-# Author: Joe Phillips <joe.phillips@innovationsw.com>
-# Based on the IFD Devkit Makefile by David Corcoran and MUSCLE
#
-# $Id: Makefile,v 1.2 2001/08/09 05:14:42 jaiger Exp $
+# BSD makefile for ifd-gpr400
#
-CC = cc
-CFLAGS = -g -fpic -w
-LD = ld
-LEX = flex
-OBJ := $(filter-out test.o, $(patsubst %.c,%.o,$(wildcard *.c)))
-INCLUDE = -I.
+#XXX
+PREFIX?= /usr/local
+DESTDIR?= ${PREFIX}
+
+# XXX
+LIBDIR= /lib
+#LIBDIR= /pcsc
+INCSDIR= /include
+
+SHLIB_NAME= libgpr400_ifd.so
+SHLIB_MAJOR= 0
+SHLIB_MINOR= 3
+
+NOMAN= 1
+NOPROFILE= 1
+
+.if !defined(NO_DEBUG)
+CFLAGS+= -g -Wall
+.endif
+
+GPRDEVNAME?= /dev/gprsc0
+
+CFLAGS+= -I. -I${DESTDIR}${INCSDIR} -DGPRDEVNAME=\"${GPRDEVNAME}\"
+LDFLAGS+= -L${DESTDIR}/lib
+LDADD+= -lpcsclite
+
+.if !defined(NO_PCSC_DEBUG)
+CFLAGS+= -DPCSC_DEBUG=1
+.if defined(PCSC_ATR_DEBUG)
+CFLAGS+= -DATR_DEBUG=1
+.endif
+.endif
-MAKEXE = make
-LIBNAME = libgpr400_ifd.so
-PREFIX = /usr/local/pcsc
+SRCS= gpr400_ifd.c
+INCS= gpr400.h
-DEFS = -DPCSC_DEBUG=1 #-DATR_DEBUG=1
-
-all: unix
-
-clean:
- rm -f *.o $(LIBNAME) core
-
-osx: $(OBJ)
- $(CC) -dynamiclib $(OBJ) -o $(LIBNAME)
-
-unix: $(OBJ)
- $(LD) -shared $(OBJ) -o $(LIBNAME)
-
-$(patsubst %.c,%.o,$(wildcard *.c)) : %.o : %.c
- $(CC) $(CFLAGS) -c $< $(INCLUDE) $(DEFS)
-
-##
+.include <bsd.lib.mk>

View File

@ -0,0 +1,11 @@
--- gpr400.h.orig Thu Aug 9 03:14:27 2001
+++ gpr400.h Sun Sep 8 18:10:47 2002
@@ -18,7 +18,7 @@
#ifndef gpr400_h
#define gpr400_h
-#include <linux/ioctl.h>
+#include <sys/ioccom.h>
/*
* Structure used to fetch reader status information

View File

@ -0,0 +1,11 @@
--- gpr400_ifd.c.orig Wed Aug 22 03:21:43 2001
+++ gpr400_ifd.c Sun Sep 8 18:10:47 2002
@@ -77,7 +77,7 @@
printf("IFDHCreateChannel:\n");
#endif
if(gpr_fd < 0){
- gpr_fd= open("/dev/gpr400", O_RDWR);
+ gpr_fd= open(GPRDEVNAME, O_RDWR);
if(gpr_fd < 0){
return IFD_COMMUNICATION_ERROR;
}

View File

@ -0,0 +1,18 @@
--- pcscdefines.h.orig Thu Aug 9 03:14:27 2001
+++ pcscdefines.h Sun Sep 8 18:10:47 2002
@@ -18,6 +18,7 @@
/* Defines a list of pseudo types. */
+#if !defined(__FreeBSD__)
typedef unsigned long DWORD;
typedef unsigned long* PDWORD;
typedef unsigned char UCHAR;
@@ -25,6 +26,7 @@
typedef char* LPSTR;
typedef long RESPONSECODE;
typedef void VOID;
+#endif
#define MAX_RESPONSE_SIZE 264
#define MAX_ATR_SIZE 33

View File

@ -0,0 +1 @@
PC/SC Lite driver for Gemplus GPR400 PCMCIA Smart Card Readers

View File

@ -0,0 +1,14 @@
This is the IFD driver for the Gemplus GPR400 PCMCIA Smart Card Reader,
written by Joe Phillips <joe.phillips@innovationsw.com>. This particular
reader has been rebranded as part of the IBM SecureWay Smart Card Kit.
It requires the pcsc-lite library in order to build and be useful. Once you
have installed and configured this IFD driver on your system, you should
be able to access the device using CITI's libsectok library, if compiled
with pcsc-lite support.
WWW: http://www.innovationsw.com/~jaiger/downloads/smartcard.html
Bruce
bms@spc.org

View File

@ -0,0 +1,2 @@
lib/libgpr400_ifd.so
include/gpr400.h