summaryrefslogtreecommitdiff
path: root/security/gpshell
diff options
context:
space:
mode:
authorgdt <gdt@pkgsrc.org>2014-03-12 21:29:24 +0000
committergdt <gdt@pkgsrc.org>2014-03-12 21:29:24 +0000
commitcce779c5e3154038d9bef600b329bd804797fae6 (patch)
tree39e758411aa1a65adbed2479a5b6e89ce61ccd8c /security/gpshell
parent05a3a73cc3e7df1e559b1590624c2e48c808f84d (diff)
downloadpkgsrc-cce779c5e3154038d9bef600b329bd804797fae6.tar.gz
Import gpshell-1.4.4 as security/gpshell.
Packaged in wip by Richard Hansen of BBN. GPShell is a script interpreter which talks to a smart card which complies to the GlobalPlatform Card Specification. It is written on top of the GlobalPlatform Library. It uses the PC-SC Connection Plugin for accessing smart cards. It can establish a secure channel with a smart card, load, instantiate, delete and list applications on supported smart cards. These applications are practically always JavaCard applets.
Diffstat (limited to 'security/gpshell')
-rw-r--r--security/gpshell/DESCR7
-rw-r--r--security/gpshell/Makefile19
-rw-r--r--security/gpshell/PLIST3
-rw-r--r--security/gpshell/distinfo6
-rw-r--r--security/gpshell/patches/patch-src_gpshell.c25
5 files changed, 60 insertions, 0 deletions
diff --git a/security/gpshell/DESCR b/security/gpshell/DESCR
new file mode 100644
index 00000000000..d0f8accfa1d
--- /dev/null
+++ b/security/gpshell/DESCR
@@ -0,0 +1,7 @@
+GPShell is a script interpreter which talks to a smart card which
+complies to the GlobalPlatform Card Specification. It is written on
+top of the GlobalPlatform Library. It uses the PC-SC Connection
+Plugin for accessing smart cards. It can establish a secure channel
+with a smart card, load, instantiate, delete and list applications on
+supported smart cards. These applications are practically always
+JavaCard applets.
diff --git a/security/gpshell/Makefile b/security/gpshell/Makefile
new file mode 100644
index 00000000000..727abcf760f
--- /dev/null
+++ b/security/gpshell/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2014/03/12 21:29:24 gdt Exp $
+
+DISTNAME= gpshell-1.4.4
+CATEGORIES= security
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=globalplatform/GPShell/GPShell-${PKGVERSION_NOREV}/}
+
+MAINTAINER= rhansen@bbn.com
+HOMEPAGE= http://globalplatform.sourceforge.net/
+COMMENT= Shell to manage the contents of GlobalPlatform smart cards
+LICENSE= gnu-gpl-v3
+
+GNU_CONFIGURE= yes
+USE_LANGUAGES+= c
+USE_LIBTOOL= yes
+USE_TOOLS+= pkg-config
+
+.include "../../security/pcsc-lite/buildlink3.mk"
+.include "../../security/libglobalplatform/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/security/gpshell/PLIST b/security/gpshell/PLIST
new file mode 100644
index 00000000000..953524a5574
--- /dev/null
+++ b/security/gpshell/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2014/03/12 21:29:24 gdt Exp $
+bin/gpshell
+man/man1/gpshell.1
diff --git a/security/gpshell/distinfo b/security/gpshell/distinfo
new file mode 100644
index 00000000000..03311d071f3
--- /dev/null
+++ b/security/gpshell/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2014/03/12 21:29:24 gdt Exp $
+
+SHA1 (gpshell-1.4.4.tar.gz) = 3efeb92263e881ff0886e73a7b790051a317df61
+RMD160 (gpshell-1.4.4.tar.gz) = cfada5b508651973e7f272d713104d0ec2787178
+Size (gpshell-1.4.4.tar.gz) = 155861 bytes
+SHA1 (patch-src_gpshell.c) = bd70f712c90dcae959d6d25bb5df0f67c8e17490
diff --git a/security/gpshell/patches/patch-src_gpshell.c b/security/gpshell/patches/patch-src_gpshell.c
new file mode 100644
index 00000000000..53eb641ef80
--- /dev/null
+++ b/security/gpshell/patches/patch-src_gpshell.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_gpshell.c,v 1.1 2014/03/12 21:29:25 gdt Exp $
+
+Don't exit with an error if the card is locked. See:
+http://sourceforge.net/mailarchive/forum.php?thread_name=CADr12F1tV04Atz-n5f43%2BenQNYF09HXMextZsLF-2QpomQAJWw%40mail.gmail.com&forum_name=opensc-devel
+Not yet reported upstream.
+
+--- src/gpshell.c.orig 2010-10-12 19:49:35.000000000 +0000
++++ src/gpshell.c
+@@ -935,8 +935,14 @@ static int handleCommands(FILE *fd)
+ {
+ _tprintf (_T("select_application() returns 0x%08lX (%s)\n"),
+ status.errorCode, status.errorMessage);
+- rv = EXIT_FAILURE;
+- goto end;
++
++ /* 6283 is warning we want to continue and unlock */
++ if (status.errorCode != OPGP_ISO7816_WARNING_CM_LOCKED)
++ {
++ rv = EXIT_FAILURE;
++ goto end;
++ }
++ status.errorStatus = OPGP_ERROR_STATUS_SUCCESS;
+ }
+ memcpy(selectedAID, optionStr.AID, optionStr.AIDLen);
+ selectedAIDLength = optionStr.AIDLen;