Lines Matching refs:p_data

141     cmdApdu.p_data = (uint8_t*)malloc(data.size() * sizeof(uint8_t));  in transmit()
142 memcpy(cmdApdu.p_data, data.data(), cmdApdu.len); in transmit()
152 memcpy(&result[0], rspApdu.p_data, rspApdu.len); in transmit()
155 free(cmdApdu.p_data); in transmit()
156 free(rspApdu.p_data); in transmit()
197 cmdApdu.p_data = in openLogicalChannel()
199 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
200 memcpy(cmdApdu.p_data, manageChannelCommand.data(), cmdApdu.len); in openLogicalChannel()
206 } else if (rspApdu.p_data[rspApdu.len - 2] == 0x90 && in openLogicalChannel()
207 rspApdu.p_data[rspApdu.len - 1] == 0x00) { in openLogicalChannel()
209 resApduBuff.channelNumber = rspApdu.p_data[0]; in openLogicalChannel()
213 } else if (rspApdu.p_data[rspApdu.len - 2] == 0x6A && in openLogicalChannel()
214 rspApdu.p_data[rspApdu.len - 1] == 0x81) { in openLogicalChannel()
216 } else if (((rspApdu.p_data[rspApdu.len - 2] == 0x6E) || in openLogicalChannel()
217 (rspApdu.p_data[rspApdu.len - 2] == 0x6D)) && in openLogicalChannel()
218 rspApdu.p_data[rspApdu.len - 1] == 0x00) { in openLogicalChannel()
222 free(cmdApdu.p_data); in openLogicalChannel()
223 cmdApdu.p_data = NULL; in openLogicalChannel()
224 free(rspApdu.p_data); in openLogicalChannel()
225 rspApdu.p_data = NULL; in openLogicalChannel()
249 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openLogicalChannel()
250 if (cmdApdu.p_data != NULL) { in openLogicalChannel()
252 cmdApdu.p_data[xx++] = resApduBuff.channelNumber; in openLogicalChannel()
253 cmdApdu.p_data[xx++] = 0xA4; // INS in openLogicalChannel()
254 cmdApdu.p_data[xx++] = 0x04; // P1 in openLogicalChannel()
255 cmdApdu.p_data[xx++] = p2; // P2 in openLogicalChannel()
256 cmdApdu.p_data[xx++] = aid.size(); // Lc in openLogicalChannel()
257 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openLogicalChannel()
258 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openLogicalChannel()
266 uint8_t sw1 = rspApdu.p_data[rspApdu.len - 2]; in openLogicalChannel()
267 uint8_t sw2 = rspApdu.p_data[rspApdu.len - 1]; in openLogicalChannel()
273 memcpy(&resApduBuff.selectResponse[0], rspApdu.p_data, rspApdu.len); in openLogicalChannel()
302 free(cmdApdu.p_data); in openLogicalChannel()
303 free(rspApdu.p_data); in openLogicalChannel()
342 cmdApdu.p_data = (uint8_t*)malloc(cmdApdu.len * sizeof(uint8_t)); in openBasicChannel()
343 if (cmdApdu.p_data != NULL) { in openBasicChannel()
345 cmdApdu.p_data[xx++] = 0x00; // basic channel in openBasicChannel()
346 cmdApdu.p_data[xx++] = 0xA4; // INS in openBasicChannel()
347 cmdApdu.p_data[xx++] = 0x04; // P1 in openBasicChannel()
348 cmdApdu.p_data[xx++] = p2; // P2 in openBasicChannel()
349 cmdApdu.p_data[xx++] = aid.size(); // Lc in openBasicChannel()
350 memcpy(&cmdApdu.p_data[xx], aid.data(), aid.size()); in openBasicChannel()
351 cmdApdu.p_data[xx + aid.size()] = 0x00; // Le in openBasicChannel()
360 uint8_t sw1 = rspApdu.p_data[rspApdu.len - 2]; in openBasicChannel()
361 uint8_t sw2 = rspApdu.p_data[rspApdu.len - 1]; in openBasicChannel()
367 memcpy(&result[0], rspApdu.p_data, rspApdu.len); in openBasicChannel()
398 free(cmdApdu.p_data); in openBasicChannel()
399 free(rspApdu.p_data); in openBasicChannel()
423 cmdApdu.p_data = (uint8_t*)malloc(5 * sizeof(uint8_t)); in closeChannel()
424 if (cmdApdu.p_data != NULL) { in closeChannel()
427 cmdApdu.p_data[xx++] = channelNumber; in closeChannel()
428 cmdApdu.p_data[xx++] = 0x70; // INS in closeChannel()
429 cmdApdu.p_data[xx++] = 0x80; // P1 in closeChannel()
430 cmdApdu.p_data[xx++] = channelNumber; // P2 in closeChannel()
431 cmdApdu.p_data[xx++] = 0x00; // Lc in closeChannel()
438 } else if ((rspApdu.p_data[rspApdu.len - 2] == 0x90) && in closeChannel()
439 (rspApdu.p_data[rspApdu.len - 1] == 0x00)) { in closeChannel()
444 free(cmdApdu.p_data); in closeChannel()
445 free(rspApdu.p_data); in closeChannel()