- fixed: pace-tool dumped wrong apdu buffer

- updated documentation on opensc


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@346 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-10-28 09:10:38 +00:00
parent c80c209a98
commit 8743b5030b
3 changed files with 15 additions and 6 deletions

View File

@@ -38,10 +38,18 @@ If you only use pace-tool for testing your card, you don't need gadgetfs.
@subsection o HINTS ON OPENSC
If ccid runs into a checking error, because the Le field of the APDU is 0 (as
set for the General Authenticate APDU during PACE), you need to patch libopensc
(see http://www.opensc-project.org/opensc/ticket/209). Such an error looks something like this:
[default] apdu.c:343:sc_check_apdu: Invalid Case 4 short APDU: cse=04 cla=0c ins=2a p1=00 p2=be lc=351 le=0
OpenSC older than r4244 will yield something like this error:
[default] apdu.c:341:sc_check_apdu: Invalid Case 4 short APDU:
cse=04 cla=10 ins=86 p1=00 p2=00 lc=2 le=0
resp=0x10353c0 resplen=256 data=0x1034a30 datalen=2
[default] pace.c:1110:EstablishPACEChannel: Could not get encrypted nonce from card (General Authenticate step 1 failed).
It requires the following patch:
http://www.opensc-project.org/opensc/raw-attachment/ticket/209/le0.patch
The following patch makes the hex dumped output more readable:
http://www.opensc-project.org/opensc/raw-attachment/ticket/263/hex_dump_align.patch
@section u USAGE

View File

@@ -25,4 +25,5 @@
00:B0:07:80:80
00:22:41:a4:0c:80:0a:04:00:7f:00:07:02:02:03:02:02
00860000457C43804104239E3D05EEB059117D30F86AEB5AE7D12E0EBF758889C79115F2A13DC1BB570A5CAD91A384337C09D1B74BED1C0FF195A7C3EA3A2CEDF86DDEF7B95D1FD1B35D00
0020001006010203040506

View File

@@ -136,14 +136,14 @@ int pace_translate_apdus(struct sm_ctx *sctx, sc_card_t *card, FILE *input)
break;
}
read[linelen - 1] = 0;
if (input != stdin)
bin_print(stdout, "Unencrypted C-APDU", read, linelen);
apdulen = sizeof buf;
if (sc_hex_to_bin(read, buf, &apdulen) < 0) {
sc_error(card->ctx, "Could not format binary string");
continue;
}
if (input != stdin)
bin_print(stdout, "Unencrypted C-APDU", buf, apdulen);
r = build_apdu(card->ctx, buf, apdulen, &apdu);
if (r < 0) {