Lines Matching refs:cmdApdu
114 StEse_data cmdApdu; in transmit() local
116 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in transmit()
120 cmdApdu.len = data.size(); in transmit()
121 if (cmdApdu.len >= MIN_APDU_LENGTH) { in transmit()
122 cmdApdu.p_data = (uint8_t*)malloc(data.size() * sizeof(uint8_t)); in transmit()
123 memcpy(cmdApdu.p_data, data.data(), cmdApdu.len); in transmit()
125 if (aram_channel && (0x03 & cmdApdu.p_data[0]) == aram_channel && in transmit()
128 status = (ESESTATUS)Aram_transceive(&cmdApdu, &rspApdu); in transmit()
130 status = StEse_Transceive(&cmdApdu, &rspApdu); in transmit()
143 free(cmdApdu.p_data); in transmit()
173 StEse_data cmdApdu; in openLogicalChannel() local
176 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openLogicalChannel()
179 cmdApdu.len = manageChannelCommand.size(); in openLogicalChannel()
180 cmdApdu.p_data = in openLogicalChannel()
182 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
183 memcpy(cmdApdu.p_data, manageChannelCommand.data(), cmdApdu.len); in openLogicalChannel()
184 status = StEse_Transceive(&cmdApdu, &rspApdu); in openLogicalChannel()
212 free(cmdApdu.p_data); in openLogicalChannel()
213 cmdApdu.p_data = NULL; in openLogicalChannel()
235 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openLogicalChannel()
238 cmdApdu.len = (int32_t)(6 + aid.size()); in openLogicalChannel()
239 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openLogicalChannel()
240 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
242 cmdApdu.p_data[xx++] = resApduBuff.channelNumber; in openLogicalChannel()
243 cmdApdu.p_data[xx++] = 0xA4; // INS in openLogicalChannel()
244 cmdApdu.p_data[xx++] = 0x04; // P1 in openLogicalChannel()
245 cmdApdu.p_data[xx++] = p2; // P2 in openLogicalChannel()
246 cmdApdu.p_data[xx++] = aid.size(); // Lc in openLogicalChannel()
247 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openLogicalChannel()
248 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openLogicalChannel()
251 status = (ESESTATUS)Aram_transceive(&cmdApdu, &rspApdu); in openLogicalChannel()
253 status = StEse_Transceive(&cmdApdu, &rspApdu); in openLogicalChannel()
297 free(cmdApdu.p_data); in openLogicalChannel()
323 StEse_data cmdApdu; in openBasicChannel() local
326 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openBasicChannel()
329 cmdApdu.len = (int32_t)(6 + aid.size()); in openBasicChannel()
330 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openBasicChannel()
331 if (cmdApdu.p_data != NULL) { in openBasicChannel()
333 cmdApdu.p_data[xx++] = 0x00; // basic channel in openBasicChannel()
334 cmdApdu.p_data[xx++] = 0xA4; // INS in openBasicChannel()
335 cmdApdu.p_data[xx++] = 0x04; // P1 in openBasicChannel()
336 cmdApdu.p_data[xx++] = p2; // P2 in openBasicChannel()
337 cmdApdu.p_data[xx++] = aid.size(); // Lc in openBasicChannel()
338 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openBasicChannel()
339 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openBasicChannel()
341 status = StEse_Transceive(&cmdApdu, &rspApdu); in openBasicChannel()
386 free(cmdApdu.p_data); in openBasicChannel()
398 StEse_data cmdApdu; in closeChannel() local
412 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in closeChannel()
414 cmdApdu.p_data = (uint8_t*)malloc(5 * sizeof(uint8_t)); in closeChannel()
415 if (cmdApdu.p_data != NULL) { in closeChannel()
418 cmdApdu.p_data[xx++] = channelNumber; in closeChannel()
419 cmdApdu.p_data[xx++] = 0x70; // INS in closeChannel()
420 cmdApdu.p_data[xx++] = 0x80; // P1 in closeChannel()
421 cmdApdu.p_data[xx++] = channelNumber; // P2 in closeChannel()
422 cmdApdu.p_data[xx++] = 0x00; // Lc in closeChannel()
423 cmdApdu.len = xx; in closeChannel()
425 status = StEse_Transceive(&cmdApdu, &rspApdu); in closeChannel()
435 free(cmdApdu.p_data); in closeChannel()