piv-tool -s not sending APDU - missing code

The code to send the APDU to the piv card when using
piv-tool -s xx:xx:xx... was inadvertently removed
on 2011-04-26 02:29:53 by: 1cdb3fa971
APDU parsing: switch to Frank Morgner's implementation

The missing code is replaced.

The -s option is infrequently used, so the problem
was not spotted earlier.
This commit is contained in:
Doug Engert 2012-07-23 13:38:32 -05:00 committed by Viktor Tarasov
parent 124d6e3a40
commit 58a4821689
1 changed files with 9 additions and 0 deletions

View File

@ -390,6 +390,15 @@ static int send_apdu(void)
apdu.resp = rbuf;
apdu.resplen = sizeof(rbuf);
printf("Sending: ");
for (r = 0; r < len0; r++)
printf("%02X ", buf[r]);
printf("\n");
r = sc_transmit_apdu(card, &apdu);
if (r) {
fprintf(stderr, "APDU transmit failed: %s\n", sc_strerror(r));
return 1;
}
printf("Received (SW1=0x%02X, SW2=0x%02X)%s\n", apdu.sw1, apdu.sw2,
apdu.resplen ? ":" : "");
if (apdu.resplen)