diff --git a/platforms/common/include/px4_platform_common/crypto_backend.h b/platforms/common/include/px4_platform_common/crypto_backend.h index 5093933679..ea8ad85b06 100644 --- a/platforms/common/include/px4_platform_common/crypto_backend.h +++ b/platforms/common/include/px4_platform_common/crypto_backend.h @@ -93,6 +93,13 @@ bool keystore_put_key(keystore_session_handle_t handle, uint8_t idx, uint8_t *ke void crypto_init(void); +/* + * De-initialize hw level crypto + * This may be called to shut down hw level crypto + */ + +void crypto_deinit(void); + /* * Open a session for performing crypto functions * algorithm: The crypto algorithm to be used in this session diff --git a/platforms/nuttx/src/bootloader/common/bl.c b/platforms/nuttx/src/bootloader/common/bl.c index 1e934ed528..c0c68bff1c 100644 --- a/platforms/nuttx/src/bootloader/common/bl.c +++ b/platforms/nuttx/src/bootloader/common/bl.c @@ -392,6 +392,10 @@ jump_to_app() #endif +#ifdef BOOTLOADER_USE_SECURITY + crypto_deinit(); +#endif + /* just for paranoia's sake */ arch_flash_lock(); diff --git a/src/drivers/sw_crypto/crypto.c b/src/drivers/sw_crypto/crypto.c index 13786b87ab..e4ced4fd1a 100644 --- a/src/drivers/sw_crypto/crypto.c +++ b/src/drivers/sw_crypto/crypto.c @@ -151,6 +151,10 @@ void crypto_init() clear_key_cache(); } +void crypto_deinit() +{ +} + crypto_session_handle_t crypto_open(px4_crypto_algorithm_t algorithm) { crypto_session_handle_t ret;