This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM2432:使用 AM2432 中的 DKEK

Guru**** 2873830 points

Other Parts Discussed in Thread: AM2432

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1630032/am2432-use-dkek-in-am2432

器件型号: AM2432

您好、  

我将 AM2432 与工业 SDK 11.00.00.08 配合使用、

我有兴趣使用 DKEK 加密数据。  

我 在这里读到 ,有两种可能的机制,但我有问题与两个. 使用第一种机制将 DKEK 直接提供给 SA2UL、我找不到在 SA2UL 安全上下文标志中设置 USE_DKEK 的位置。 但在这两种情况下、当我尝试使用 此处声明的函数时、 编译器始终报告“unresolved symbol Sciclient_set/get/releaseDKEK“

AM2432 是否支持使用 DKEK? 是否缺少一个步骤? 是否有使用它的示例?

谢谢您、

此致、

Andrea

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    但在这两种情况下 、当我尝试使用此处声明的函数时、 编译器始终报告“未解析的符号 Sciclient_set/get/releaseDKEK“

    函数似乎仅在 SDK 中声明但未定义。

    AM2432 是否真正支持使用 DKEK? 是否缺少一个步骤? 是否有使用它的示例?

    SDK 中没有演示 TISCI DKEK API 或 DKEK 用例的示例。

    请注意、由于此响应中所述的安全交付、您无法在应用程序中使用 DKEK API

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1627031/am2432-am2432-jtag-handling/6274257

    此致、

    Prashant

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Prashant、  

    感谢您的答复。

    似乎函数仅在 SDK 中声明但未定义。

    有没有其他方法可以使用它呢? 例如、使用 Sciclient_service。 也可以使用一些等效的密钥作为加密密钥、从而保持机密。

    请注意、由于此响应中所述的安全交付、您无法在应用程序中使用 DKEK API

    这不是问题、我会在安全交付之前在 SBL 中使用它。

    谢谢您、

    此致、

    Andrea

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    请参阅以下补丁以检索 DKEK

    diff --git a/examples/hello_world/hello_world.c b/examples/hello_world/hello_world.c
    index 8694deccc11..aea6a258ba8 100644
    --- a/examples/hello_world/hello_world.c
    +++ b/examples/hello_world/hello_world.c
    @@ -37,6 +37,66 @@
     #include "ti_drivers_open_close.h"
     #include "ti_board_open_close.h"
     
    +int32_t App_getDKEK(
    +    const struct tisci_msg_sa2ul_get_dkek_req *req,
    +    struct tisci_msg_sa2ul_get_dkek_resp *resp,
    +    uint32_t timeout)
    +{
    +    int32_t status;
    +    struct tisci_msg_sa2ul_get_dkek_req localReq = *req;
    +    const Sciclient_ReqPrm_t reqPrm =
    +    {
    +        TISCI_MSG_SA2UL_GET_DKEK,
    +        TISCI_MSG_FLAG_AOP,
    +        (const uint8_t *)&localReq,
    +        sizeof(localReq),
    +        timeout
    +    };
    +    Sciclient_RespPrm_t respPrm =
    +    {
    +        0,
    +        (uint8_t *)resp,
    +        sizeof(*resp)
    +    };
    +
    +    status = Sciclient_service(&reqPrm, &respPrm);
    +    if ((status != SystemP_SUCCESS) || (respPrm.flags != TISCI_MSG_FLAG_ACK))
    +    {
    +        status = SystemP_FAILURE;
    +    }
    +    return status;
    +}
    +
    +void test_func()
    +{
    +    int32_t status;
    +    uint32_t i;
    +    struct tisci_msg_sa2ul_get_dkek_req req = {
    +        .sa2ul_instance  = 0U,
    +        .kdf_label_len   = 5U,
    +        .kdf_context_len = 7U,
    +        .kdf_label_and_context = { 'L', 'A', 'B', 'E', 'L', 'C', 'O', 'N', 'T', 'E', 'X', 'T' },
    +    };
    +    struct tisci_msg_sa2ul_get_dkek_resp resp = {0};
    +
    +    status = App_getDKEK(&req, &resp, SystemP_WAIT_FOREVER);
    +
    +    if (status == SystemP_SUCCESS)
    +    {
    +        DebugP_log("DKEK retrieval successful!\r\n");
    +        DebugP_log("DKEK: ");
    +        for (i = 0U; i < CRYPTO_DKEK_KEY_LEN; i++)
    +        {
    +            DebugP_log("%02x ", resp.dkek[i]);
    +        }
    +        DebugP_log("\r\n");
    +    }
    +    else
    +    {
    +        DebugP_log("DKEK retrieval failed! Status: %d\r\n", status);
    +    }
    +}
    +
     void hello_world_main(void *args)
     {
         /* Open drivers to open the UART driver for console */
    @@ -47,6 +107,7 @@ void hello_world_main(void *args)
     #else
         DebugP_log("Hello World!\r\n");
     #endif
    +    test_func();
     
         Board_driversClose();
         Drivers_close();
    diff --git a/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.c b/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.c
    index c8b8085457f..cb4ee7849c0 100644
    --- a/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.c
    +++ b/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.c
    @@ -1001,7 +1001,7 @@ int32_t Bootloader_socCpuResetReleaseSelf(void)
             }
             if(status==SystemP_SUCCESS)
             {
    -            status = Bootloader_socSecHandover();
    +            // status = Bootloader_socSecHandover();
             }
             if(status==SystemP_SUCCESS)
             {
    diff --git a/source/drivers/sciclient/sciclient.c b/source/drivers/sciclient/sciclient.c
    index ed1044e476a..367817b953a 100644
    --- a/source/drivers/sciclient/sciclient.c
    +++ b/source/drivers/sciclient/sciclient.c
    @@ -706,6 +706,7 @@ uint32_t Sciclient_getCurrentContext(uint16_t messageType)
            (TISCI_MSG_WRITE_SWREV == messageType) ||
            (TISCI_MSG_READ_KEYCNT_KEYREV == messageType) ||
            (TISCI_MSG_WRITE_KEYREV == messageType) ||
    +       (TISCI_MSG_SA2UL_GET_DKEK == messageType) ||
            (TISCI_MSG_BOARD_CONFIG_PM == messageType))
         {
             retVal = gSciclientHandle.secureContextId;