How to enable Platform SCP when using SE050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable Platform SCP when using SE050

105 Views
yang_lee
Contributor III

Hello everyone,

I'm using SE050E and having trouble using Platform SCP. I followed the instructions in AN12542 (https://www.nxp.jp/docs/en/application-note/AN12542.pdf#4#4) and defined SSS_HAVE_SE05X_AUTH_PLATFSCP03 1, but when I open a session by calling the ex_sss_boot_open function, the result is kStatus_SSS_Fail. Did I do something wrong? Everything worked fine when I use plain communication. Please let me know if I need to configure anything else.

Thanks

Labels (1)
Tags (2)
0 Kudos
Reply
2 Replies

70 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @yang_lee ,

 

The example provided in the chapter 6 is just for SE050E, but at first please make sure which build system you are using.

1. For MCUXpresso SDK based, please follow the steps within 6.2 and 6.3

2. For Cmake based, please follow the steps within 6.4 and 6.5

 

Hope that helps,

 

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.
-------------------------------------------------------------------------------

0 Kudos
Reply

56 Views
yang_lee
Contributor III

Hi @Kan_Li ,

I followed the instructions in sections 6.2 and 6.3 and tried running the se05x_MandatePlatformSCP example in SE-PLUG-TRUST-MW_04.07.01, but the sss_key_object_init(eraseAuthCtx.auth.ctx.idobj.pObj, &pCtx->host_ks) function returned kStatus_SSS_InvalidArgument. Do I need to call the ex_sss_boot_open, ex_sss_key_store_and_object_init, and ex_sss_boot_open_host_session functions as in the ex_sss_main_inc.h file before calling the sss_key_object_init function? The code is below:

 

/* clang-format off */
#define MandateSCP_UserID_VALUE                 \
    {                                           \
        'N', 'E', 'E', 'D', 'S', 'C', 'P'            \
    }
/* clang-format ON */
sss_status_t se050_platformSCP03(void)
{
sss_status_t status = kStatus_SSS_Fail;
    sss_object_t keyObject;
    ex_sss_boot_ctx_t gex_sss_mandate_scp_boot_ctx;
SE_Connect_Ctx_t eraseAuthCtx = { 0 };
sss_se05x_session_t *pSession = (sss_se05x_session_t *)&gex_sss_mandate_scp_boot_ctx.session;
    smStatus_t sw_status;
    Se05xSession_t *pSe05xSession;
    SE_Connect_Ctx_t* pOpenCtx;
    sss_object_t ex_id = { 0 };
 
    const uint8_t host_userid_value[] = MandateSCP_UserID_VALUE;
    const uint8_t userid_value_factoryreset[] = MandateSCP_UserID_VALUE;
    eraseAuthCtx.auth.ctx.idobj.pObj = &ex_id;
 
const char *portName = NULL;
 
    memset(&gex_sss_mandate_scp_boot_ctx, 0, sizeof(gex_sss_mandate_scp_boot_ctx));
 
//    /* initialize session to connect to the SE050 */
//    status = ex_sss_boot_open(&gex_sss_mandate_scp_boot_ctx, portName);
//    if (kStatus_SSS_Success != status)
//    {
//        ex_sss_session_close(&gex_sss_mandate_scp_boot_ctx);
//        return status; /* return error if can't initialize session with SE050 */
//    }
 
//    /* setup KeyStore */
//    status = ex_sss_key_store_and_object_init(&gex_sss_mandate_scp_boot_ctx);
//    if (kStatus_SSS_Success != status)
//    {
//        ex_sss_session_close(&gex_sss_mandate_scp_boot_ctx);
//        return status; /* close sesion and return error if can't initialize fail */
//    }
 
//    ex_sss_boot_open_host_session(&gex_sss_mandate_scp_boot_ctx);
    /* Prepare host */   
    status = sss_key_object_init(eraseAuthCtx.auth.ctx.idobj.pObj, &gex_sss_mandate_scp_boot_ctx.host_ks);
    if (kStatus_SSS_Success != status) {
        LOG_E("Failed sss_key_object_init");
        goto cleanup;
    }
    status = sss_key_object_allocate_handle(eraseAuthCtx.auth.ctx.idobj.pObj,
                                            MAKE_TEST_ID(__LINE__),
                                            kSSS_KeyPart_Default,
                                            kSSS_CipherType_UserID,
                                            sizeof(host_userid_value),
                                            kKeyObject_Mode_Transient);
    if (kStatus_SSS_Success != status) {
        LOG_E("Failed sss_key_object_allocate_handle");
        goto cleanup;
    }
    status = sss_key_store_set_key(&gex_sss_mandate_scp_boot_ctx.host_ks,
                                   eraseAuthCtx.auth.ctx.idobj.pObj,
                                   host_userid_value,
                                   sizeof(host_userid_value),
                                   sizeof(host_userid_value) * 8,
                                   NULL,
                                   0);
    if (kStatus_SSS_Success != status) {
        LOG_E("Failed sss_key_store_set_key");
        goto cleanup;
    }
 
    pSe05xSession = &pSession->s_ctx;
 
    sw_status = Se05x_API_WriteUserID(pSe05xSession,
        NULL,
        SE05x_MaxAttemps_NA,
        kSE05x_AppletResID_PLATFORM_SCP,
        userid_value_factoryreset,
        sizeof(userid_value_factoryreset),
        kSE05x_AttestationType_AUTH);
 
    pOpenCtx = &gex_sss_mandate_scp_boot_ctx.se05x_open_ctx;
    eraseAuthCtx.tunnelCtx = pOpenCtx->tunnelCtx;
    eraseAuthCtx.connType = pOpenCtx->connType;
    eraseAuthCtx.portName = pOpenCtx->portName;
    eraseAuthCtx.auth.authType = kSSS_AuthType_ID;
 
 
    sss_session_close(&gex_sss_mandate_scp_boot_ctx.session);
 
    pSe05xSession = &pSession->s_ctx;
 
    status = sss_session_open(&gex_sss_mandate_scp_boot_ctx.session, kType_SSS_SE_SE05x,
                               kSE05x_AppletResID_PLATFORM_SCP,
                               kSSS_ConnectionType_Password, &eraseAuthCtx);
 
 
    if (kStatus_SSS_Success != status) {
        LOG_E("Failed sss_session_open");
        goto cleanup;
    }
 
 
    /* Call SE05X API to Mandate Platform SCP. */
 
    sw_status = Se05x_API_SetPlatformSCPRequest(&pSession->s_ctx, kSE05x_PlatformSCPRequest_REQUIRED);
    if(SM_OK != sw_status) {
        LOG_E("Se05x_API_SetPlatformSCPRequest Failed");
        goto cleanup;
    }
    else {
        LOG_I("Se05x_API_SetPlatformSCPRequest Successful");
        LOG_W("Further communication must be encrypted");
    }
 
cleanup:
    if (kStatus_SSS_Success == status) {
        LOG_I("se05x_MandatePlatformSCP Example Success !!!...");
    }
    else {
        LOG_E("se05x_MandatePlatformSCP Example Failed !!!...");
    }
    return status;
}
 

Thanks,

Duong

 

Tags (2)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2372103%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20enable%20Platform%20SCP%20when%20using%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372103%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3EI'm%20using%20SE050E%20and%20having%20trouble%20using%20Platform%20SCP.%20I%20followed%20the%20instructions%20in%20AN12542%20(%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.jp%2Fdocs%2Fen%2Fapplication-note%2FAN12542.pdf%234%234%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.jp%2Fdocs%2Fen%2Fapplication-note%2FAN12542.pdf%234%234%3C%2FA%3E)%20and%20defined%20SSS_HAVE_SE05X_AUTH_PLATFSCP03%201%2C%20but%20when%20I%20open%20a%20session%20by%20calling%20the%20ex_sss_boot_open%20function%2C%20the%20result%20is%20kStatus_SSS_Fail.%20Did%20I%20do%20something%20wrong%3F%20Everything%20worked%20fine%20when%20I%20use%20plain%20communication.%20Please%20let%20me%20know%20if%20I%20need%20to%20configure%20anything%20else.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2372103%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ESE050%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2372709%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20enable%20Platform%20SCP%20when%20using%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372709%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59276%22%20target%3D%22_blank%22%3E%40Kan_Li%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EI%20followed%20the%20instructions%20in%20sections%206.2%20and%206.3%20and%20tried%20running%20the%20%3CEM%3Ese05x_MandatePlatformSCP%3C%2FEM%3E%20example%20in%20%3CSTRONG%3ESE-PLUG-TRUST-MW_04.07.01%3C%2FSTRONG%3E%2C%20but%20the%20%3CEM%3Esss_key_object_init%3C%2FEM%3E(eraseAuthCtx.auth.ctx.idobj.pObj%2C%20%26amp%3BpCtx-%26gt%3Bhost_ks)%20function%20returned%20kStatus_SSS_InvalidArgument.%20Do%20I%20need%20to%20call%20the%20ex_sss_boot_open%2C%20%3CEM%3Eex_sss_key_store_and_object_init%3C%2FEM%3E%2C%20and%20%3CEM%3Eex_sss_boot_open_host_session%3C%2FEM%3E%20functions%20as%20in%20the%20%3CEM%3Eex_sss_main_inc.h%3C%2FEM%3E%20file%20before%20calling%20the%20%3CEM%3Esss_key_object_init%3C%2FEM%3E%20function%3F%20The%20code%20is%20below%3A%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3E%2F*%20clang-format%20off%20*%2F%3C%2FDIV%3E%3CDIV%3E%23define%20MandateSCP_UserID_VALUE%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%5C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7B%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%5C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20'N'%2C%20'E'%2C%20'E'%2C%20'D'%2C%20'S'%2C%20'C'%2C%20'P'%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%5C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%2F*%20clang-format%20ON%20*%2F%3C%2FDIV%3E%3CDIV%3Esss_status_t%20se050_platformSCP03(void)%3C%2FDIV%3E%3CDIV%3E%7B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Esss_status_t%20status%20%3D%20kStatus_SSS_Fail%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20sss_object_t%20keyObject%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20ex_sss_boot_ctx_t%20gex_sss_mandate_scp_boot_ctx%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESE_Connect_Ctx_t%20eraseAuthCtx%20%3D%20%7B%200%20%7D%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Esss_se05x_session_t%20*pSession%20%3D%20(sss_se05x_session_t%20*)%26amp%3Bgex_sss_mandate_scp_boot_ctx.session%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20smStatus_t%20sw_status%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20Se05xSession_t%20*pSe05xSession%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20SE_Connect_Ctx_t*%20pOpenCtx%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20sss_object_t%20ex_id%20%3D%20%7B%200%20%7D%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20const%20uint8_t%20host_userid_value%5B%5D%20%3D%20MandateSCP_UserID_VALUE%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20const%20uint8_t%20userid_value_factoryreset%5B%5D%20%3D%20MandateSCP_UserID_VALUE%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20eraseAuthCtx.auth.ctx.idobj.pObj%20%3D%20%26amp%3Bex_id%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Econst%20char%20*portName%20%3D%20NULL%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20memset(%26amp%3Bgex_sss_mandate_scp_boot_ctx%2C%200%2C%20sizeof(gex_sss_mandate_scp_boot_ctx))%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%2F*%20initialize%20session%20to%20connect%20to%20the%20SE050%20*%2F%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20ex_sss_boot_open(%26amp%3Bgex_sss_mandate_scp_boot_ctx%2C%20portName)%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20ex_sss_session_close(%26amp%3Bgex_sss_mandate_scp_boot_ctx)%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20return%20status%3B%20%2F*%20return%20error%20if%20can't%20initialize%20session%20with%20SE050%20*%2F%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%2F*%20setup%20KeyStore%20*%2F%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20ex_sss_key_store_and_object_init(%26amp%3Bgex_sss_mandate_scp_boot_ctx)%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20ex_sss_session_close(%26amp%3Bgex_sss_mandate_scp_boot_ctx)%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20return%20status%3B%20%2F*%20close%20sesion%20and%20return%20error%20if%20can't%20initialize%20fail%20*%2F%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%2F%2F%26nbsp%3B%20%26nbsp%3B%20ex_sss_boot_open_host_session(%26amp%3Bgex_sss_mandate_scp_boot_ctx)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%2F*%20Prepare%20host%20*%2F%26nbsp%3B%20%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20sss_key_object_init(eraseAuthCtx.auth.ctx.idobj.pObj%2C%20%26amp%3Bgex_sss_mandate_scp_boot_ctx.host_ks)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22Failed%20sss_key_object_init%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20goto%20cleanup%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20sss_key_object_allocate_handle(eraseAuthCtx.auth.ctx.idobj.pObj%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20MAKE_TEST_ID(__LINE__)%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20kSSS_KeyPart_Default%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20kSSS_CipherType_UserID%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20sizeof(host_userid_value)%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20kKeyObject_Mode_Transient)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22Failed%20sss_key_object_allocate_handle%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20goto%20cleanup%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20sss_key_store_set_key(%26amp%3Bgex_sss_mandate_scp_boot_ctx.host_ks%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BeraseAuthCtx.auth.ctx.idobj.pObj%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bhost_userid_value%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bsizeof(host_userid_value)%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bsizeof(host_userid_value)%20*%208%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BNULL%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B0)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22Failed%20sss_key_store_set_key%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20goto%20cleanup%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20pSe05xSession%20%3D%20%26amp%3BpSession-%26gt%3Bs_ctx%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20sw_status%20%3D%20Se05x_API_WriteUserID(pSe05xSession%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20NULL%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20SE05x_MaxAttemps_NA%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20kSE05x_AppletResID_PLATFORM_SCP%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20userid_value_factoryreset%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20sizeof(userid_value_factoryreset)%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20kSE05x_AttestationType_AUTH)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20pOpenCtx%20%3D%20%26amp%3Bgex_sss_mandate_scp_boot_ctx.se05x_open_ctx%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20eraseAuthCtx.tunnelCtx%20%3D%20pOpenCtx-%26gt%3BtunnelCtx%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20eraseAuthCtx.connType%20%3D%20pOpenCtx-%26gt%3BconnType%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20eraseAuthCtx.portName%20%3D%20pOpenCtx-%26gt%3BportName%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20eraseAuthCtx.auth.authType%20%3D%20kSSS_AuthType_ID%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20sss_session_close(%26amp%3Bgex_sss_mandate_scp_boot_ctx.session)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20pSe05xSession%20%3D%20%26amp%3BpSession-%26gt%3Bs_ctx%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20sss_session_open(%26amp%3Bgex_sss_mandate_scp_boot_ctx.session%2C%20kType_SSS_SE_SE05x%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BkSE05x_AppletResID_PLATFORM_SCP%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BkSSS_ConnectionType_Password%2C%20%26amp%3BeraseAuthCtx)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20!%3D%20status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22Failed%20sss_session_open%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20goto%20cleanup%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%2F*%20Call%20SE05X%20API%20to%20Mandate%20Platform%20SCP.%20*%2F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20sw_status%20%3D%20Se05x_API_SetPlatformSCPRequest(%26amp%3BpSession-%26gt%3Bs_ctx%2C%20kSE05x_PlatformSCPRequest_REQUIRED)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if(SM_OK%20!%3D%20sw_status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22Se05x_API_SetPlatformSCPRequest%20Failed%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20goto%20cleanup%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20else%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_I(%22Se05x_API_SetPlatformSCPRequest%20Successful%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_W(%22Further%20communication%20must%20be%20encrypted%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3Ecleanup%3A%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20if%20(kStatus_SSS_Success%20%3D%3D%20status)%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_I(%22se05x_MandatePlatformSCP%20Example%20Success%20!!!...%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20else%20%7B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20LOG_E(%22se05x_MandatePlatformSCP%20Example%20Failed%20!!!...%22)%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20return%20status%3B%3C%2FDIV%3E%3CDIV%3E%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EDuong%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2372675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20enable%20Platform%20SCP%20when%20using%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252826%22%20target%3D%22_blank%22%3E%40yang_lee%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20example%20provided%20in%20the%20chapter%206%20is%20just%20for%20SE050E%2C%20but%20at%20first%20please%20make%20sure%20which%20build%20system%20you%20are%20using.%3C%2FP%3E%0A%3CP%3E1.%20For%26nbsp%3BMCUXpresso%20SDK%20based%2C%20please%20follow%20the%20steps%20within%206.2%20and%206.3%3C%2FP%3E%0A%3CP%3E2.%20For%20Cmake%20based%2C%20please%26nbsp%3Bfollow%20the%20steps%20within%206.4%20and%206.5%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHope%20that%20helps%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E