Lines Matching refs:p_data
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()
140 memcpy(&result[0], rspApdu.p_data, rspApdu.len); in transmit()
143 free(cmdApdu.p_data); in transmit()
144 free(rspApdu.p_data); in transmit()
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()
189 } else if (rspApdu.p_data[rspApdu.len - 2] == 0x90 && in openLogicalChannel()
190 rspApdu.p_data[rspApdu.len - 1] == 0x00) { in openLogicalChannel()
192 resApduBuff.channelNumber = rspApdu.p_data[0]; in openLogicalChannel()
203 } else if (rspApdu.p_data[rspApdu.len - 2] == 0x6A && in openLogicalChannel()
204 rspApdu.p_data[rspApdu.len - 1] == 0x81) { in openLogicalChannel()
206 } else if (((rspApdu.p_data[rspApdu.len - 2] == 0x6E) || in openLogicalChannel()
207 (rspApdu.p_data[rspApdu.len - 2] == 0x6D)) && in openLogicalChannel()
208 rspApdu.p_data[rspApdu.len - 1] == 0x00) { in openLogicalChannel()
212 free(cmdApdu.p_data); in openLogicalChannel()
213 cmdApdu.p_data = NULL; in openLogicalChannel()
214 free(rspApdu.p_data); in openLogicalChannel()
215 rspApdu.p_data = NULL; 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()
261 uint8_t sw1 = rspApdu.p_data[rspApdu.len - 2]; in openLogicalChannel()
262 uint8_t sw2 = rspApdu.p_data[rspApdu.len - 1]; in openLogicalChannel()
268 memcpy(&resApduBuff.selectResponse[0], rspApdu.p_data, rspApdu.len); in openLogicalChannel()
297 free(cmdApdu.p_data); in openLogicalChannel()
298 free(rspApdu.p_data); in openLogicalChannel()
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()
348 uint8_t sw1 = rspApdu.p_data[rspApdu.len - 2]; in openBasicChannel()
349 uint8_t sw2 = rspApdu.p_data[rspApdu.len - 1]; in openBasicChannel()
355 memcpy(&result[0], rspApdu.p_data, rspApdu.len); in openBasicChannel()
386 free(cmdApdu.p_data); in openBasicChannel()
387 free(rspApdu.p_data); in openBasicChannel()
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()
429 } else if ((rspApdu.p_data[rspApdu.len - 2] == 0x90) && in closeChannel()
430 (rspApdu.p_data[rspApdu.len - 1] == 0x00)) { in closeChannel()
435 free(cmdApdu.p_data); in closeChannel()
436 free(rspApdu.p_data); in closeChannel()