- dropped pace_transmit_apdu in favour of a solution with sm_transmit_apdu.

post_transmit and pre_transmit can be used to perform actions before
  encrypting/decrypting a sm apdu (such as incrementing the ssc for pace).
- fixed ssc problems. encrypted communication with more than one apdu (e.g.
  resuming the pin) is now working.
- fixed uninitialized pointer in sm_decrypt


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@131 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-06-05 14:34:50 +00:00
parent c88e4892ac
commit e02e2abdfb
5 changed files with 41 additions and 60 deletions

View File

@@ -166,7 +166,7 @@ int pace_translate_apdus(struct sm_ctx *sctx, sc_card_t *card)
apdu.resp = buf;
apdu.resplen = sizeof(buf);
r = pace_transmit_apdu(sctx, card, &apdu);
r = sm_transmit_apdu(sctx, card, &apdu);
if (r < 0) {
sc_error(card->ctx, "Could not send APDU: %s", sc_strerror(r));
continue;
@@ -307,18 +307,13 @@ main (int argc, char **argv)
printf("Established PACE channel with CAN in %.0fs.\n",
difftime(t_end, t_start));
/*i = pace_reset_retry_counter(&tmpctx, card, PACE_PIN, 0, NULL, 0);*/
/*if (i < 0)*/
/*goto err;*/
/*printf("Resumed PIN.\n");*/
i = pace_get_channel(&tmpctx, card,
PACE_PIN, pin, pin ? strlen(pin) : 0,
&channeldata, &channeldatalen, &sctx);
if (i < 0)
goto err;
t_start = time(NULL);
printf("Established PACE channel with PIN in %.0fs.\n",
printf("Established PACE channel with PIN in %.0fs. PIN resumed.\n",
difftime(t_start, t_end));
}