Skip to content

Commit c78f17f

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 f5633c4 commit c78f17f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

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

295296
arm_certificate_entry_s own_cert = {
@@ -308,6 +309,7 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
308309
#else
309310
own_cert.key_len = strlen((const char *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE_KEY) + 1;
310311
#endif
312+
arm_network_own_certificates_remove();
311313
arm_network_own_certificate_add((const arm_certificate_entry_s *)&own_cert);
312314
#endif
313315

0 commit comments

Comments
 (0)