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;