mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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
This commit is contained in:
parent
8a7f3ab6fa
commit
750435509e
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user