esp-cryptoauthlib build error IDF 4.4.1: mbedtls_ecdsa_signature_to_asn1

gc-wesd
Posts: 6
Joined: Mon Jun 26, 2017 1:52 pm

esp-cryptoauthlib build error IDF 4.4.1: mbedtls_ecdsa_signature_to_asn1

Postby gc-wesd » Thu Dec 15, 2022 9:57 pm

I tried building an application using esp-cryptoauthlib with ESP-IDF 4.4.1

The build failed because because the symbol "mbedtls_ecdsa_signature_to_asn1" was not defined. I did a workspace-wide text search for that string and found defined in only two places: esp-cryptoauthlib and an example project under esp-idf, both in atca_mbedtls_wrap.

Has this function been deprecated and replaced? I can find no references to that effect. The compiler suggests using "mbedtls_ecdsa_sign_det_ext" but I don't know if that is the correct replacement.

Here is the error message:

Code: Select all

../components/esp-cryptoauthlib/cryptoauthlib/lib/mbedtls/atca_mbedtls_wrap.c: In function 'atca_mbedtls_eckey_sign':
../components/esp-cryptoauthlib/cryptoauthlib/lib/mbedtls/atca_mbedtls_wrap.c:1013:19: error: implicit declaration of function 'mbedtls_ecdsa_signature_to_asn1'; did you mean 'mbedtls_ecdsa_sign_det_ext'? [-Werror=implicit-function-declaration]
             ret = mbedtls_ecdsa_signature_to_asn1(&r, &s, sig, sig_len);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   mbedtls_ecdsa_sign_det_ext
cc1.exe: some warnings being treated as errors
[

ESP_flying_raijin
Posts: 25
Joined: Tue Aug 13, 2019 2:03 pm

Re: esp-cryptoauthlib build error IDF 4.4.1: mbedtls_ecdsa_signature_to_asn1

Postby ESP_flying_raijin » Tue Dec 20, 2022 6:30 am

Hi @gc-wesd

By default IDF uses the MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_VERIFY_ALT for importing the atca_mbedtls_ecdsa_sign and atca_mbedtls_ecdsa_verify APIs. In that case the API that you have mentioned is not required.

Have you changed the default config when building ? If possible can you share the sdkconfig file for the project ?

Thanks,
Aditya

Who is online

Users browsing this forum: jgrossholtz, kapucin22, MicroController, niels.1234 and 130 guests