From c78f17f85bc2b2586446d3fdd46f4df9dc3e63ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Lepp=C3=A4nen?= Date: Thu, 8 Oct 2020 12:03:11 +0300 Subject: [PATCH] Added certificate remove before add to wisun tasklet This prevents tasklet from adding own certificates multiple times to Nanostack in case bootstrap is made again. --- features/nanostack/mbed-mesh-api/source/wisun_tasklet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c index 593b9eefe7b..81cbafe0bd5 100644 --- a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c @@ -290,6 +290,7 @@ static void wisun_tasklet_configure_and_connect_to_network(void) #else trusted_cert.cert_len = strlen((const char *) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE) + 1; #endif + arm_network_trusted_certificates_remove(); arm_network_trusted_certificate_add((const arm_certificate_entry_s *)&trusted_cert); arm_certificate_entry_s own_cert = { @@ -308,6 +309,7 @@ static void wisun_tasklet_configure_and_connect_to_network(void) #else own_cert.key_len = strlen((const char *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE_KEY) + 1; #endif + arm_network_own_certificates_remove(); arm_network_own_certificate_add((const arm_certificate_entry_s *)&own_cert); #endif