From 750435509ee2e5e256053f04c4506d2e51714d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Sat, 27 Feb 2021 23:00:25 +0100 Subject: [PATCH] drivers/at86rf2xx: remove get NETOPT_ENCRYPTION_KEY setting NETOPT_ENCRYPTION_KEY in device driver was redundant because it is also done in the ieee802154 netdev driver and the key is transfered to the hardware in the ieee802154 security implementation --- drivers/at86rf2xx/at86rf2xx.c | 4 ---- drivers/at86rf2xx/at86rf2xx_netdev.c | 17 ----------------- 2 files changed, 21 deletions(-) diff --git a/drivers/at86rf2xx/at86rf2xx.c b/drivers/at86rf2xx/at86rf2xx.c index 866877938d..e9c4ae7e58 100644 --- a/drivers/at86rf2xx/at86rf2xx.c +++ b/drivers/at86rf2xx/at86rf2xx.c @@ -233,10 +233,6 @@ void at86rf2xx_reset(at86rf2xx_t *dev) IS_USED(MODULE_AT86RF2XX_AES_SPI) dev->netdev.sec_ctx.dev.cipher_ops = &_at86rf2xx_cipher_ops; dev->netdev.sec_ctx.dev.ctx = dev; - /* All configurations of the security module, the SRAM content, - and keys are reset during DEEP_SLEEP or RESET state. */ - at86rf2xx_aes_key_write_encrypt(dev, - dev->netdev.sec_ctx.cipher.context.context); #endif /* State to return after receiving or transmitting */ diff --git a/drivers/at86rf2xx/at86rf2xx_netdev.c b/drivers/at86rf2xx/at86rf2xx_netdev.c index 6988dfbcfe..3cd109ace6 100644 --- a/drivers/at86rf2xx/at86rf2xx_netdev.c +++ b/drivers/at86rf2xx/at86rf2xx_netdev.c @@ -629,23 +629,6 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len) break; #endif /* MODULE_NETDEV_IEEE802154_OQPSK */ - -#if IS_USED(MODULE_AT86RF2XX_AES_SPI) && \ - IS_USED(MODULE_IEEE802154_SECURITY) - case NETOPT_ENCRYPTION_KEY: - assert(len >= IEEE802154_SEC_KEY_LENGTH); - at86rf2xx_aes_key_write_encrypt(dev, val); - if (memcmp(dev->netdev.sec_ctx.cipher.context.context, val, len)) { - /* If the key changes, the frame conter can be reset to 0*/ - dev->netdev.sec_ctx.frame_counter = 0; - } - memcpy(dev->netdev.sec_ctx.cipher.context.context, val, - IEEE802154_SEC_KEY_LENGTH); - res = IEEE802154_SEC_KEY_LENGTH; - break; -#endif /* IS_USED(MODULE_AT86RF2XX_AES_SPI) && \ - IS_USED(MODULE_IEEE802154_SECURITY) */ - default: break; }