Hi @S_GUED ,
It was just confirmed that the export APDU command has to be sent in the extend length format. so please apply the following patch and it will be fixed in the next release.
smStatus_t Se05x_API_ExportObject(
pSe05xSession_t session_ctx, uint32_t objectID, SE05x_RSAKeyComponent_t rsaKeyComp, uint8_t *data, size_t *pdataLen)
{
smStatus_t retStatus = SM_NOT_OK;
tlvHeader_t hdr = {{kSE05x_CLA, kSE05x_INS_READ, kSE05x_P1_DEFAULT, kSE05x_P2_EXPORT}};
uint8_t cmdbuf[SE05X_MAX_BUF_SIZE_CMD];
size_t cmdbufLen = 0;
uint8_t *pCmdbuf = &cmdbuf[0];
int tlvRet = 0;
uint8_t rspbuf[SE05X_MAX_BUF_SIZE_RSP] = {0};
uint8_t *pRspbuf = &rspbuf[0];
size_t rspbufLen = ARRAY_SIZE(rspbuf);
size_t rspIndex = 0;
#if VERBOSE_APDU_LOGS
NEWLINE();
nLog("APDU", NX_LEVEL_DEBUG, "ExportObject []");
#endif /* VERBOSE_APDU_LOGS */
tlvRet = TLVSET_U32("object id", &pCmdbuf, &cmdbufLen, kSE05x_TAG_1, objectID);
if (0 != tlvRet) {
goto cleanup;
}
tlvRet = TLVSET_RSAKeyComponent("rsaKeyComp", &pCmdbuf, &cmdbufLen, kSE05x_TAG_2, rsaKeyComp);
if (0 != tlvRet) {
goto cleanup;
}
retStatus = DoAPDUTxRx_s_Case4_ext(session_ctx, &hdr, cmdbuf, cmdbufLen, rspbuf, &rspbufLen);
if (retStatus == SM_OK) {
retStatus = SM_NOT_OK;
tlvRet = tlvGet_u8buf(pRspbuf, &rspIndex, rspbufLen, kSE05x_TAG_1, data, pdataLen); /* */
if (0 != tlvRet) {
goto cleanup;
}
if ((rspIndex + 2) == rspbufLen) {
retStatus = (smStatus_t)((pRspbuf[rspIndex] << | (pRspbuf[rspIndex + 1]));
}
}
cleanup:
return retStatus;
}
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------