Skip to content

Commit 73d6fcc

Browse files
author
Mika Leppänen
committed
Added support for network encryption key (GTK) set to border router
1 parent a26fa09 commit 73d6fcc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ The Wi-SUN specific parameters are listed below.
167167
| `root-certificate` | Root certificate |
168168
| `own-certificate` | Own certificate |
169169
| `own-certificate-key` | Own certificate's key |
170+
| `GTK0` | Set GTK0 to predefined value for testing |
170171

171172
Regulatory domain, operating class and operating mode are defined in the Wi-SUN PHY-specification.
172173

source/borderrouter_ws.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#ifdef MBED_CONF_APP_CERTIFICATE_HEADER
3232
#include MBED_CONF_APP_CERTIFICATE_HEADER
3333
#endif
34+
#if defined(MBED_CONF_APP_GTK0)
35+
#include "net_ws_test.h"
36+
#endif
3437

3538
#include "ns_trace.h"
3639
#define TRACE_GROUP "brro"
@@ -312,6 +315,17 @@ static int wisun_interface_up(void)
312315
}
313316
}
314317

318+
#if defined(MBED_CONF_APP_GTK0)
319+
uint8_t gtk0_value[16] = MBED_CONF_APP_GTK0;
320+
uint8_t *gtks[4] = {gtk0_value, NULL, NULL, NULL};
321+
ret = ws_test_gtk_set(ws_br_handler.ws_interface_id, gtks);
322+
if (ret != 0) {
323+
tr_error("Test GTK set failed %"PRIi32"", ret);
324+
return -1;
325+
}
326+
tr_info("Test GTK set: %s", trace_array(gtk0_value, 16));
327+
#endif
328+
315329
#if defined(MBED_CONF_APP_CERTIFICATE_HEADER)
316330
arm_certificate_chain_entry_s chain_info;
317331
memset(&chain_info, 0, sizeof(arm_certificate_chain_entry_s));

0 commit comments

Comments
 (0)