Files
libcoap/tests
Alejandro Pacheco 1cddf3f3b0 coap_mbedtls.c: Do not move cached PKI SNI entries
pki_sni_callback() kept the PKI SNI cache as one array of entries that
hold the CA chain, certificate and key by value, and grew it with
realloc() for each new SNI. The certificate and key of an entry are
handed to the handshake with mbedtls_ssl_set_hs_ca_chain() and
mbedtls_ssl_set_hs_own_cert(), so when a second client asked for a new
SNI while another handshake was still running, that handshake was left
using freed memory.

Allocate each entry on its own and keep an array of pointers to them,
so an entry stays where it is for the life of the context. Also free
the partly set up credentials when setting up a new entry fails.

Add a unit test.
2026-10-16 15:02:07 +01:00
..
2026-01-05 10:37:26 +00:00
2026-01-05 10:37:26 +00:00
2026-08-08 12:05:03 +01:00
2026-01-05 10:37:26 +00:00
2026-06-05 15:22:38 +01:00
2026-04-18 09:11:19 +01:00