Page 1 of 1

multiple same name macros defined into embedTLS Header File

Posted: Thu May 18, 2017 10:49 am
by Ritesh
Hi,

We are planning to use embedTLS components from ESP32 IDF 2.0 Official Release and we have included one "compat-1.3h" file.

So, We are getting multiple re-definition of one macro ssl_set_bio form that header file. So, We have checked that header file and found following 2 lines.

Code: Select all

#define ssl_set_bio mbedtls_ssl_set_bio
#define ssl_set_bio mbedtls_ssl_set_bio_timeout
I think it should be something like this.

Code: Select all

#define ssl_set_bio mbedtls_ssl_set_bio
#define ssl_set_bio_timeout mbedtls_ssl_set_bio_timeout
Let me know if i am wrong.

Re: multiple same name macros defined into embedTLS Header File

Posted: Thu May 18, 2017 4:20 pm
by f.h-f.s.
Are you sure you should be using compat-1.3.h? It is deprecated and not included in any files in esp-idf, as far as I can see. What do you need it for?

Re: multiple same name macros defined into embedTLS Header File

Posted: Thu May 18, 2017 5:10 pm
by Ritesh
f.h-f.s. wrote:Are you sure you should be using compat-1.3.h? It is deprecated and not included in any files in esp-idf, as far as I can see. What do you need it for?
Yes. But, We have included that file from application and we are using ESP-IDF 2.0 official Release.

We have some requirement to include that file and that file is present with that macros into current master ESP32 IDF RTOS SDK.

Re: multiple same name macros defined into embedTLS Header File

Posted: Fri May 19, 2017 7:12 am
by ESP_Angus
This change looks correct. To be very clear, the compat-1.3.h header is included in mbedTLS for backwards compatibility with polarSSL, mbedTLS's predecessor, which was discontinued in 2014 (the last 1.3 releases were in mid-2014).

If you're not working with third party code that only works with polarSSL, I strongly recommend not including any "compat-xxx.h" headers. Use the regular mbedTLS headers instead.

Regarding this specific change, it looks like the upstream mbedTLS project has fixed this recently. We'll update to their latest release soon and integrate this fix.

Re: multiple same name macros defined into embedTLS Header File

Posted: Fri May 19, 2017 5:08 pm
by Ritesh
ESP_Angus wrote:This change looks correct. To be very clear, the compat-1.3.h header is included in mbedTLS for backwards compatibility with polarSSL, mbedTLS's predecessor, which was discontinued in 2014 (the last 1.3 releases were in mid-2014).

If you're not working with third party code that only works with polarSSL, I strongly recommend not including any "compat-xxx.h" headers. Use the regular mbedTLS headers instead.

Regarding this specific change, it looks like the upstream mbedTLS project has fixed this recently. We'll update to their latest release soon and integrate this fix.
Ok. No issues.

Just keep in mind to solve it into next SDK release.