cancel
Showing results for 
Search instead for 
Did you mean: 

STSAFE-A110, Key Establish and Wrap/Unwrap example doesn't work

sunghwan
Associate

Hi,

I have issue on Key Establish and Wrap/Unwrap example.

I have X-NUCLEO-SAFEA1 and NUCLEO-L476RG for testing.

I downloaded X-CUBE-SAFEA1 from ST web site, version is V1.2.2.

 

Here's what I tried.

  • I ran paring example.
    • I commented out "_FORCE_DEFAULT_FLASH_" like "//#define _FORCE_DEFAULT_FLASH_"
    • it works successfully.
  • I ran All_Use_Cases example in Example_X-Cube_Cryptolib.
    • Authentication worked.
    • Key-pair generation worked.
    • Key establish is failed.
      • it fails at step 5, "5. Verify if shared secret is identical (0 means success): 49"
        • StSafeA_AssignLVBuffer() function returns STSAFEA_INVALID_RESP_LENGTH
        • pDestLVBuffer->Length was 16927 (looks like garbage value), but ExpectedLen was 32
    • Wrap/unwrap is failed.
      • it also fails at step 5, "5. Local envelope Local envelope demonstration result (0x0 means success): 0x6"
        • StSafeA_ReceiveBytes() function returns STSAFEA_BUFFER_LENGTH_EXCEEDED
        • pOutBuffer->LV.Length was 65009 (garbage value), but STSAFEA_BUFFER_DATA_PACKET_SIZE 507

Could you help me to understand what's going on?

 

Sung

 

2 REPLIES 2
Billy OWEN
ST Employee

Hi @sunghwan 

 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Billy

Teedoubleyuh
Associate II

I have a very similar issue to original post where the Key Establishment and Wrap/Unwrap envelope demos do not succeed. Are they not meant to be run with a single dev kit?

Key Establishment demo fails on step 3 when calling mbedtls_ecp_mul. It is passing a NULL value for rng function to mbedtls_ecp_mul_restartable which then returns MBEDTLS_ERR_ECP_BAD_INPUT_DATA. 

Wrap/Unwrap demonstration fails on step 2 StSafeA_WrapLocalEnvelope where the local envelope response is STSAFEA_KEY_NOT_FOUND