diff --git a/core/net/mac/tsch/README.md b/core/net/mac/tsch/README.md index a70b4806d..02fe0cb05 100644 --- a/core/net/mac/tsch/README.md +++ b/core/net/mac/tsch/README.md @@ -130,8 +130,6 @@ To include TSCH standard-compliant security, set the following: /* Enable security */ #undef LLSEC802154_CONF_ENABLED #define LLSEC802154_CONF_ENABLED 1 -#undef TSCH_SECURITY_CONF_LEVEL -#define TSCH_SECURITY_CONF_LEVEL 1 /* TSCH uses explicit keys to identify k1 and k2 */ #undef LLSEC802154_CONF_USES_EXPLICIT_KEYS #define LLSEC802154_CONF_USES_EXPLICIT_KEYS 1 diff --git a/core/net/mac/tsch/tsch-security.h b/core/net/mac/tsch/tsch-security.h index c01e7ea6b..42f18e8d9 100644 --- a/core/net/mac/tsch/tsch-security.h +++ b/core/net/mac/tsch/tsch-security.h @@ -46,23 +46,10 @@ /* To enable TSCH security: * - set LLSEC802154_CONF_ENABLED - * - set TSCH_SECURITY_CONF_LEVEL * - set LLSEC802154_CONF_USES_EXPLICIT_KEYS * - unset LLSEC802154_CONF_USES_FRAME_COUNTER * */ -#ifdef TSCH_SECURITY_CONF_LEVEL -#define TSCH_SECURITY_LEVEL TSCH_SECURITY_CONF_LEVEL -#else /* TSCH_SECURITY_CONF_LEVEL */ -#define TSCH_SECURITY_LEVEL FRAME802154_SECURITY_LEVEL_NONE -#endif /* TSCH_SECURITY_CONF_LEVEL */ - -#if LLSEC802154_ENABLED && !TSCH_SECURITY_LEVEL -#error LLSEC802154_ENABLED set but TSCH_SECURITY_LEVEL unset -#endif /* LLSEC802154_ENABLED */ -#if !LLSEC802154_ENABLED && TSCH_SECURITY_LEVEL -#error TSCH_SECURITY_LEVEL set but LLSEC802154_ENABLED unset -#endif /* LLSEC802154_ENABLED */ #if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS #error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset #endif /* LLSEC802154_ENABLED */ diff --git a/examples/ipv6/rpl-tsch/node.c b/examples/ipv6/rpl-tsch/node.c index 79f8719ea..af0db8845 100644 --- a/examples/ipv6/rpl-tsch/node.c +++ b/examples/ipv6/rpl-tsch/node.c @@ -144,7 +144,7 @@ PROCESS_THREAD(node_process, ev, data) /* Set node with ID == 1 as coordinator, convenient in Cooja. */ if(node_id == 1) { - if(TSCH_SECURITY_LEVEL) { + if(LLSEC802154_ENABLED) { node_role = role_6dr_sec; } else { node_role = role_6dr; @@ -169,7 +169,7 @@ PROCESS_THREAD(node_process, ev, data) || etimer_expired(&et)); if(ev == sensors_event && data == &button_sensor && button_sensor.value(0) > 0) { node_role = (node_role + 1) % 3; - if(TSCH_SECURITY_LEVEL == 0 && node_role == role_6dr_sec) { + if(LLSEC802154_ENABLED == 0 && node_role == role_6dr_sec) { node_role = (node_role + 1) % 3; } etimer_restart(&et); @@ -182,7 +182,7 @@ PROCESS_THREAD(node_process, ev, data) printf("Init: node starting with role %s\n", node_role == role_6ln ? "6ln" : (node_role == role_6dr) ? "6dr" : "6dr-sec"); - tsch_set_pan_secured(TSCH_SECURITY_LEVEL && (node_role == role_6dr_sec)); + tsch_set_pan_secured(LLSEC802154_ENABLED && (node_role == role_6dr_sec)); is_coordinator = node_role > role_6ln; if(is_coordinator) { diff --git a/examples/ipv6/rpl-tsch/project-conf.h b/examples/ipv6/rpl-tsch/project-conf.h index 11c882c43..30f638bb4 100644 --- a/examples/ipv6/rpl-tsch/project-conf.h +++ b/examples/ipv6/rpl-tsch/project-conf.h @@ -100,8 +100,6 @@ #if WITH_SECURITY /* Enable security */ -#undef TSCH_SECURITY_CONF_LEVEL -#define TSCH_SECURITY_CONF_LEVEL 1 #undef LLSEC802154_CONF_ENABLED #define LLSEC802154_CONF_ENABLED 1 /* TSCH uses explicit keys to identify k1 and k2 */