Lines Matching refs:rpdu

46 static int getResponseInternal(uint8_t cla, phNxpEse_7816_rpdu_t& rpdu,
436 phNxpEse_7816_rpdu_t rpdu; in openLogicalChannel() local
438 phNxpEse_memset(&rpdu, 0x00, sizeof(phNxpEse_7816_rpdu_t)); in openLogicalChannel()
464 rpdu.len = 0x02; in openLogicalChannel()
465 rpdu.pdata = (uint8_t*)phNxpEse_memalloc(cpdu.le * sizeof(uint8_t)); in openLogicalChannel()
467 status = phNxpEse_7816_Transceive(&cpdu, &rpdu); in openLogicalChannel()
471 if (rpdu.len > 0 && (rpdu.sw1 == 0x64 && rpdu.sw2 == 0xFF)) { in openLogicalChannel()
479 uint16_t responseLen = rpdu.len + 2; in openLogicalChannel()
481 memcpy(&resApduBuff.selectResponse[0], rpdu.pdata, rpdu.len); in openLogicalChannel()
482 resApduBuff.selectResponse[responseLen - 1] = rpdu.sw2; in openLogicalChannel()
483 resApduBuff.selectResponse[responseLen - 2] = rpdu.sw1; in openLogicalChannel()
485 if (rpdu.sw1 == SW1_BYTES_REMAINING) { in openLogicalChannel()
487 getResponseInternal(cpdu.cla, rpdu, resApduBuff.selectResponse); in openLogicalChannel()
494 if ((rpdu.sw1 == 0x90 && rpdu.sw2 == 0x00) || (rpdu.sw1 == 0x62) || in openLogicalChannel()
495 (rpdu.sw1 == 0x63)) { in openLogicalChannel()
499 else if ((rpdu.sw1 == 0x6A && rpdu.sw2 == 0x82) || in openLogicalChannel()
500 (rpdu.sw1 == 0x69 && (rpdu.sw2 == 0x99 || rpdu.sw2 == 0x85))) { in openLogicalChannel()
504 else if (rpdu.sw1 == 0x6A && rpdu.sw2 == 0x86) { in openLogicalChannel()
524 phNxpEse_free(rpdu.pdata); in openLogicalChannel()
543 phNxpEse_7816_rpdu_t rpdu; in openBasicChannel() local
628 phNxpEse_memset(&rpdu, 0x00, sizeof(phNxpEse_7816_rpdu_t)); in openBasicChannel()
640 rpdu.len = 0x02; in openBasicChannel()
641 rpdu.pdata = (uint8_t*)phNxpEse_memalloc(cpdu.le * sizeof(uint8_t)); in openBasicChannel()
647 status = phNxpEse_7816_Transceive(&cpdu, &rpdu); in openBasicChannel()
653 if (rpdu.len > 0 && (rpdu.sw1 == 0x64 && rpdu.sw2 == 0xFF)) { in openBasicChannel()
661 uint16_t responseLen = rpdu.len + 2; in openBasicChannel()
663 memcpy(&result[0], rpdu.pdata, rpdu.len); in openBasicChannel()
664 result[responseLen - 1] = rpdu.sw2; in openBasicChannel()
665 result[responseLen - 2] = rpdu.sw1; in openBasicChannel()
666 if (rpdu.sw1 == SW1_BYTES_REMAINING) { in openBasicChannel()
667 sestatus = getResponseInternal(cpdu.cla, rpdu, result); in openBasicChannel()
674 if (((rpdu.sw1 == 0x90) && (rpdu.sw2 == 0x00)) || (rpdu.sw1 == 0x62) || in openBasicChannel()
675 (rpdu.sw1 == 0x63)) { in openBasicChannel()
685 else if ((rpdu.sw1 == 0x6A && rpdu.sw2 == 0x82) || in openBasicChannel()
686 (rpdu.sw1 == 0x69 && (rpdu.sw2 == 0x99 || rpdu.sw2 == 0x85))) { in openBasicChannel()
690 else if (rpdu.sw1 == 0x6A && rpdu.sw2 == 0x86) { in openBasicChannel()
708 phNxpEse_free(rpdu.pdata); in openBasicChannel()
718 phNxpEse_7816_rpdu_t rpdu; in internalCloseChannel() local
728 phNxpEse_memset(&rpdu, 0x00, sizeof(phNxpEse_7816_rpdu_t)); in internalCloseChannel()
744 status = phNxpEse_7816_Transceive(&cpdu, &rpdu); in internalCloseChannel()
746 if ((rpdu.sw1 == 0x90) && (rpdu.sw2 == 0x00)) { in internalCloseChannel()
897 static int getResponseInternal(uint8_t cla, phNxpEse_7816_rpdu_t& rpdu, in getResponseInternal() argument
903 uint16_t responseLen = rpdu.len; // Response already copied in getResponseInternal()
904 uint8_t getRespLe = rpdu.sw2; // Response pending to receive in getResponseInternal()
947 rpdu.sw1 = rspApdu.p_data[rspApdu.len - 2]; in getResponseInternal()
948 rpdu.sw2 = rspApdu.p_data[rspApdu.len - 1]; in getResponseInternal()
950 rpdu.sw1 = INVALID_LEN_SW1; in getResponseInternal()
951 rpdu.sw2 = INVALID_LEN_SW2; in getResponseInternal()