llsec: Removed TSCH_SECURITY_CONF_LEVEL and TSCH_SECURITY_LEVEL

This commit is contained in:
kkrentz 2015-12-18 06:52:18 -08:00
parent 431530bf6b
commit 4a88e9e537
4 changed files with 3 additions and 20 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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) {

View file

@ -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 */