pkgsrc/security/gpshell/patches/patch-src_gpshell.c
gdt c781aa14a6 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.
2014-03-12 21:29:24 +00:00

25 lines
1.1 KiB
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;