Skip to content

Commit 657795e

Browse files
author
Mika Leppänen
committed
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.
1 parent ad40b1b commit 657795e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

connectivity/nanostack/mbed-mesh-api/source/wisun_tasklet.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
291291
#else
292292
trusted_cert.cert_len = strlen((const char *) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE) + 1;
293293
#endif
294+
arm_network_trusted_certificates_remove();
294295
arm_network_trusted_certificate_add((const arm_certificate_entry_s *)&trusted_cert);
295296

296297
arm_certificate_entry_s own_cert = {
@@ -309,6 +310,7 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
309310
#else
310311
own_cert.key_len = strlen((const char *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE_KEY) + 1;
311312
#endif
313+
arm_network_own_certificates_remove();
312314
arm_network_own_certificate_add((const arm_certificate_entry_s *)&own_cert);
313315
#endif
314316

0 commit comments

Comments
 (0)