From 6d0cc5e90814b4eb4abec44a46301747a7f6ffe6 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Sat, 10 Apr 2010 15:12:37 +0000 Subject: [PATCH] added missing return buffer for select of CardSecurity git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@56 96b47cad-a561-4643-ad3b-153ac7d7599c --- ccid/pace.c | 2 ++ ccid/sm.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ccid/pace.c b/ccid/pace.c index e8c5dd1..2a938b3 100644 --- a/ccid/pace.c +++ b/ccid/pace.c @@ -850,6 +850,8 @@ int pace_test(sc_card_t *card) SC_TEST_RET(card->ctx, sm_encrypt(&sctx, card, &apdu, &sm_apdu), "Could not encrypt APDU."); bin_log(card->ctx, "SM APDU data", sm_apdu.data, sm_apdu.datalen); + sm_apdu.resplen = maxresp; + sm_apdu.resp = malloc(apdu.resplen); SC_TEST_RET(card->ctx, my_transmit_apdu(card, &sm_apdu), "Could not send SM APDU."); SC_TEST_RET(card->ctx, sm_decrypt(&sctx, card, &sm_apdu, &apdu), diff --git a/ccid/sm.c b/ccid/sm.c index a44eb01..5b94253 100644 --- a/ccid/sm.c +++ b/ccid/sm.c @@ -234,6 +234,10 @@ int sm_encrypt(const struct sm_ctx *ctx, sc_card_t *card, sc_copy_asn1_entry(c_sm_capdu, sm_capdu); + sm_apdu->sensitive = 0; + sm_apdu->resp = apdu->resp; + sm_apdu->resplen = apdu->resplen; + sm_apdu->control = apdu->control; sm_apdu->flags = apdu->flags; sm_apdu->cla = 0x0C; sm_apdu->ins = apdu->ins;