migration of crypto code (RSA2048) from SSP 1.2.0 to SSP 1.6.0 generates SSP_ERR_ASSERTION error on call to g_sce_rsa_0.p_api->decrypt()

I am attempting to port an old application from SSP 1.2.0 to SSP 1.6.0 on an S7G2 system.

The application uses the RSA crypto features through the SCE HAL interface.

The steps that used to work in SSP 1.2.0 were:

g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg);

g_sce_rsa_0.p_api->open(g_sce_rsa_0.p_ctrl, g_sce_rsa_0.p_cfg);

g_sce_rsa_0.p_api->decrypt(g_sce_rsa_0.p_ctrl, rsa_private_key, NULL, 16, (uint32_t *)e_hdr, (uint32_t *)d_hdr);

The call to g_sce_rsa_0.p_api->decrypt fails with a return value of SSP_ERR_ASSERTION with SSP 1.6.0. The first 2 calls both return SUCCESS.

I verified that the input parameters are correct and that g_sce_rsa_0.p_ctrl is not NULL. When I examine g_sce_rsa_0.p_ctrl in the debugger, the p_crypto_ctrl structure member points to 0x0.

Is this causing the SSP_ERR_ASSERTION? If so, what should it be set to. If not, what is the error and how do I resolve it.

thanks,

pete

  • Hi,

    Can you provide a project demonstrating the problem?

    Regards,

    Ian.
  • In reply to Ian:

    Hi Ian ,

    The project I have is part of a proprietary secure bootloader that runs on a custom board.

    I will put together a simplified project that will run on the SK-S7G2 and open a support ticket to upload it due to the proprietary nature of the section of code.

    thanks,
    pete
  • In reply to Peter Giacomini:

    Hi,

    The problem maybe caused by the size of the MetaData buffer. Try increasing it in the properties to 20000 and see if it solves the problem. There is an API nx_secure_tls_metadata_size_calculate() which can be used to get a more accurate value but 20000 should work for testing.

    If this doesn't work then I will be happy to take a look at a project if you are able to supply one. The NetX APIs all return error codes which should be able to shed more light on the situation.

    Regards,

    Ian.
  • Hi Ian,

    I am not using NetX in the application. The application is a bootloader that gets the file to be decrypted from a USB stick. The only Framework and HAL features in the application are USBX, FileX, and the SCE HAL components.

    I opened a support ticket and uploaded a project based on the SK-S7G2 SCE_HAL_MG_AP project that exhibits the issue..

    thanks,
    pete
  • In reply to Peter Giacomini:

    Hi Pete,

    I have answered via the support ticket.

    Regards,

    Ian.
  • In reply to Ian:

    Hi Ian,

    I just added final status to the support ticket. I have this working using your suggestions, so you can close the ticket.

    thanks,
    pete