Lines Matching refs:cmdApdu
124 StEse_data cmdApdu; in transmit() local
126 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in transmit()
130 cmdApdu.len = data.size(); in transmit()
131 if (cmdApdu.len >= MIN_APDU_LENGTH) { in transmit()
132 cmdApdu.p_data = (uint8_t*)malloc(data.size() * sizeof(uint8_t)); in transmit()
133 memcpy(cmdApdu.p_data, data.data(), cmdApdu.len); in transmit()
134 status = StEse_Transceive(&cmdApdu, &rspApdu); in transmit()
146 free(cmdApdu.p_data); in transmit()
174 StEse_data cmdApdu; in openLogicalChannel() local
177 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openLogicalChannel()
180 cmdApdu.len = manageChannelCommand.size(); in openLogicalChannel()
181 cmdApdu.p_data = in openLogicalChannel()
183 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
184 memcpy(cmdApdu.p_data, manageChannelCommand.data(), cmdApdu.len); in openLogicalChannel()
185 status = StEse_Transceive(&cmdApdu, &rspApdu); in openLogicalChannel()
206 free(cmdApdu.p_data); in openLogicalChannel()
207 cmdApdu.p_data = NULL; in openLogicalChannel()
229 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openLogicalChannel()
232 cmdApdu.len = (int32_t)(6 + aid.size()); in openLogicalChannel()
233 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openLogicalChannel()
234 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
236 cmdApdu.p_data[xx++] = resApduBuff.channelNumber; in openLogicalChannel()
237 cmdApdu.p_data[xx++] = 0xA4; // INS in openLogicalChannel()
238 cmdApdu.p_data[xx++] = 0x04; // P1 in openLogicalChannel()
239 cmdApdu.p_data[xx++] = p2; // P2 in openLogicalChannel()
240 cmdApdu.p_data[xx++] = aid.size(); // Lc in openLogicalChannel()
241 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openLogicalChannel()
242 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openLogicalChannel()
243 status = StEse_Transceive(&cmdApdu, &rspApdu); in openLogicalChannel()
286 free(cmdApdu.p_data); in openLogicalChannel()
312 StEse_data cmdApdu; in openBasicChannel() local
315 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in openBasicChannel()
318 cmdApdu.len = (int32_t)(6 + aid.size()); in openBasicChannel()
319 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openBasicChannel()
320 if (cmdApdu.p_data != NULL) { in openBasicChannel()
322 cmdApdu.p_data[xx++] = 0x00; // basic channel in openBasicChannel()
323 cmdApdu.p_data[xx++] = 0xA4; // INS in openBasicChannel()
324 cmdApdu.p_data[xx++] = 0x04; // P1 in openBasicChannel()
325 cmdApdu.p_data[xx++] = p2; // P2 in openBasicChannel()
326 cmdApdu.p_data[xx++] = aid.size(); // Lc in openBasicChannel()
327 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openBasicChannel()
328 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openBasicChannel()
330 status = StEse_Transceive(&cmdApdu, &rspApdu); in openBasicChannel()
375 free(cmdApdu.p_data); in openBasicChannel()
387 StEse_data cmdApdu; in closeChannel() local
398 memset(&cmdApdu, 0x00, sizeof(StEse_data)); in closeChannel()
400 cmdApdu.p_data = (uint8_t*)malloc(5 * sizeof(uint8_t)); in closeChannel()
401 if (cmdApdu.p_data != NULL) { in closeChannel()
404 cmdApdu.p_data[xx++] = channelNumber; in closeChannel()
405 cmdApdu.p_data[xx++] = 0x70; // INS in closeChannel()
406 cmdApdu.p_data[xx++] = 0x80; // P1 in closeChannel()
407 cmdApdu.p_data[xx++] = channelNumber; // P2 in closeChannel()
408 cmdApdu.p_data[xx++] = 0x00; // Lc in closeChannel()
409 cmdApdu.len = xx; in closeChannel()
411 status = StEse_Transceive(&cmdApdu, &rspApdu); in closeChannel()
421 free(cmdApdu.p_data); in closeChannel()