MBedTLS + PSA cannot connect because RSA is default on (v3.1.0 -> v3.1.1)

Hello

There has been an interesting braking change between SDK v3.1.0 -> v3.1.1. When using PSA (CONFIG_MBEDTLS_USE_PSA_CRYPTO=y) and a server with signature algorithm SHA384withECDSA, MbedTLS successfully connects to the server with v3.1.0. But when compiling exactly the same project with SDK v3.1.1, it doesn't, with the error message:

<err> mbedtls: WEST_TOPDIR/modules/crypto/mbedtls/library/ssl_tls.c:7959: mbedtls_x509_crt_parse_der() returned -14848 (-0x3a00)

Which is:

/** Elliptic curve is unsupported (only NIST curves are supported). */
#define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00

The only difference between those two builds is that, when building with v3.1.1, CONFIG_MBEDTLS_RSA_C=y is automatically turned on. When turning it off in prj.conf (CONFIG_MBEDTLS_RSA_C=n), it works again.

Am I missing something or there is a bug in PSA MbedTLS? As fas as I understand, adding RSA support (without taking anything away from elliptic curve), should be able to use both, no?

Regards
Lauri

Parents
  • Hi,

    I would expect you should be able to use both yes, and I have not been able to find any references to this issue from before (though I must admit I have also not come across SHA384withECDSA before).

    Is it so that you see the same issue in 3.1.0 and 3.1.1 where it does not work with CONFIG_MBEDTLS_RSA_C=y in the build, and it works in both cases with it not in the build? Can you share the generated .config for your project both with and without it?

Reply
  • Hi,

    I would expect you should be able to use both yes, and I have not been able to find any references to this issue from before (though I must admit I have also not come across SHA384withECDSA before).

    Is it so that you see the same issue in 3.1.0 and 3.1.1 where it does not work with CONFIG_MBEDTLS_RSA_C=y in the build, and it works in both cases with it not in the build? Can you share the generated .config for your project both with and without it?

Children
Related