Add crypto_deinit function for crypto_backend module

Bootloader needs to have a mechanism to de-initialize crypto, in case some HW accelerator
is being used. This adds the needed function for it

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen 2023-03-20 10:58:10 +02:00 committed by Daniel Agar
parent 8497d3388f
commit b26669b085
3 changed files with 15 additions and 0 deletions

View File

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

View File

@ -392,6 +392,10 @@ jump_to_app()
#endif
#ifdef BOOTLOADER_USE_SECURITY
crypto_deinit();
#endif
/* just for paranoia's sake */
arch_flash_lock();

View File

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