llsec: Removed TSCH_SECURITY_CONF_LEVEL and TSCH_SECURITY_LEVEL
This commit is contained in:
parent
431530bf6b
commit
4a88e9e537
@ -130,8 +130,6 @@ To include TSCH standard-compliant security, set the following:
|
|||||||
/* Enable security */
|
/* Enable security */
|
||||||
#undef LLSEC802154_CONF_ENABLED
|
#undef LLSEC802154_CONF_ENABLED
|
||||||
#define LLSEC802154_CONF_ENABLED 1
|
#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 */
|
/* TSCH uses explicit keys to identify k1 and k2 */
|
||||||
#undef LLSEC802154_CONF_USES_EXPLICIT_KEYS
|
#undef LLSEC802154_CONF_USES_EXPLICIT_KEYS
|
||||||
#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 1
|
#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 1
|
||||||
|
@ -46,23 +46,10 @@
|
|||||||
|
|
||||||
/* To enable TSCH security:
|
/* To enable TSCH security:
|
||||||
* - set LLSEC802154_CONF_ENABLED
|
* - set LLSEC802154_CONF_ENABLED
|
||||||
* - set TSCH_SECURITY_CONF_LEVEL
|
|
||||||
* - set LLSEC802154_CONF_USES_EXPLICIT_KEYS
|
* - set LLSEC802154_CONF_USES_EXPLICIT_KEYS
|
||||||
* - unset LLSEC802154_CONF_USES_FRAME_COUNTER
|
* - 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
|
#if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS
|
||||||
#error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset
|
#error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset
|
||||||
#endif /* LLSEC802154_ENABLED */
|
#endif /* LLSEC802154_ENABLED */
|
||||||
|
@ -144,7 +144,7 @@ PROCESS_THREAD(node_process, ev, data)
|
|||||||
|
|
||||||
/* Set node with ID == 1 as coordinator, convenient in Cooja. */
|
/* Set node with ID == 1 as coordinator, convenient in Cooja. */
|
||||||
if(node_id == 1) {
|
if(node_id == 1) {
|
||||||
if(TSCH_SECURITY_LEVEL) {
|
if(LLSEC802154_ENABLED) {
|
||||||
node_role = role_6dr_sec;
|
node_role = role_6dr_sec;
|
||||||
} else {
|
} else {
|
||||||
node_role = role_6dr;
|
node_role = role_6dr;
|
||||||
@ -169,7 +169,7 @@ PROCESS_THREAD(node_process, ev, data)
|
|||||||
|| etimer_expired(&et));
|
|| etimer_expired(&et));
|
||||||
if(ev == sensors_event && data == &button_sensor && button_sensor.value(0) > 0) {
|
if(ev == sensors_event && data == &button_sensor && button_sensor.value(0) > 0) {
|
||||||
node_role = (node_role + 1) % 3;
|
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;
|
node_role = (node_role + 1) % 3;
|
||||||
}
|
}
|
||||||
etimer_restart(&et);
|
etimer_restart(&et);
|
||||||
@ -182,7 +182,7 @@ PROCESS_THREAD(node_process, ev, data)
|
|||||||
printf("Init: node starting with role %s\n",
|
printf("Init: node starting with role %s\n",
|
||||||
node_role == role_6ln ? "6ln" : (node_role == role_6dr) ? "6dr" : "6dr-sec");
|
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;
|
is_coordinator = node_role > role_6ln;
|
||||||
|
|
||||||
if(is_coordinator) {
|
if(is_coordinator) {
|
||||||
|
@ -100,8 +100,6 @@
|
|||||||
#if WITH_SECURITY
|
#if WITH_SECURITY
|
||||||
|
|
||||||
/* Enable security */
|
/* Enable security */
|
||||||
#undef TSCH_SECURITY_CONF_LEVEL
|
|
||||||
#define TSCH_SECURITY_CONF_LEVEL 1
|
|
||||||
#undef LLSEC802154_CONF_ENABLED
|
#undef LLSEC802154_CONF_ENABLED
|
||||||
#define LLSEC802154_CONF_ENABLED 1
|
#define LLSEC802154_CONF_ENABLED 1
|
||||||
/* TSCH uses explicit keys to identify k1 and k2 */
|
/* TSCH uses explicit keys to identify k1 and k2 */
|
||||||
|
Loading…
Reference in New Issue
Block a user