espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
266 stars 157 forks source link

Null pointer dereferencing after setting CONFIG_EXAMPLE_USE_SECURE_ELEMENT to TRUE (CA-243) #140

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello. I'm trying to use ATECC608 with my ESP32. In MQTT tls_mutual_auth example when I set CONFIG_EXAMPLE_USE_SECURE_ELEMENT to true, line 16 in network_transport.c under coreMQTT\port\network_transport causes core panic since it is trying to get strlen of a NULL pointer. pcClinetCertPem and pcClientKeyPem are set to NULL in mqtt_demo_mutual_auth.c (lines 568 and 569). Lines 15 and 16 in network_transport.c need to be moved inside the #else block (lines 23 - 28).

ghost commented 1 year ago

My bad! The certificates must be manually provided in case a custom configured ATECC608 is used. The example setting the buffers to NULL however might cause misunderstanding.