Wed Mar 12 21:29:25 2014 UTC ()
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.


(gdt)
diff -r0 -r1.1 pkgsrc/security/gpshell/DESCR
diff -r0 -r1.1 pkgsrc/security/gpshell/Makefile
diff -r0 -r1.1 pkgsrc/security/gpshell/PLIST
diff -r0 -r1.1 pkgsrc/security/gpshell/distinfo
diff -r0 -r1.1 pkgsrc/security/gpshell/patches/patch-src_gpshell.c

File Added: pkgsrc/security/gpshell/Attic/DESCR
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.

File Added: pkgsrc/security/gpshell/Attic/Makefile
# $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"

File Added: pkgsrc/security/gpshell/Attic/PLIST
@comment $NetBSD: PLIST,v 1.1 2014/03/12 21:29:24 gdt Exp $
bin/gpshell
man/man1/gpshell.1

File Added: pkgsrc/security/gpshell/Attic/distinfo
$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

File Added: pkgsrc/security/gpshell/patches/Attic/patch-src_gpshell.c
$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;