From 931e91359960361c880f98873da5cabc3350d52d Mon Sep 17 00:00:00 2001 From: Peter Marschall Date: Sun, 28 Aug 2011 11:49:28 +0200 Subject: [PATCH] iso7816.c: clean up iso7816_restore_security_env() No need for response buffers for APDUs of the APDU_CASE_1 type. This should fix OpenSC Ticket #299. --- src/libopensc/iso7816.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libopensc/iso7816.c b/src/libopensc/iso7816.c index 89c21e60..a2eb99c7 100644 --- a/src/libopensc/iso7816.c +++ b/src/libopensc/iso7816.c @@ -770,13 +770,10 @@ static int iso7816_restore_security_env(sc_card_t *card, int se_num) { sc_apdu_t apdu; int r; - u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; assert(card != NULL); sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0x22, 0xF3, se_num); - apdu.resplen = sizeof(rbuf) > 250 ? 250 : sizeof(rbuf); - apdu.resp = rbuf; r = sc_transmit_apdu(card, &apdu); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); return sc_check_sw(card, apdu.sw1, apdu.sw2);