Skip to content

Commit df549a6

Browse files
joerchannordicjm
authored andcommitted
lib: identity_key: Add identity key free function
Add identity_key_free function which calls the nrf_cc3xx_platform_identity_key_free function. This makes the identity_key library a complete abstraction over the nrf_cc3xx_platform library. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
1 parent dfa5d5f commit df549a6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/identity_key.h

+10
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ bool identity_key_is_written(void);
7171
*/
7272
int identity_key_read(uint8_t key[IDENTITY_KEY_SIZE_BYTES]);
7373

74+
/** @brief Function to clear out an identity key after usage
75+
*
76+
* @details This function will clear out the memory of an identity key.
77+
* This must be called after the identity key is used to ensure that
78+
* it is not leaked in the system.
79+
*
80+
* @param[in,out] key Key to clear out
81+
*/
82+
void identity_key_free(uint8_t key[IDENTITY_KEY_SIZE_BYTES]);
83+
7484
/**
7585
* @brief Function to write a random identity key to KMU
7686
*

lib/identity_key/identity_key.c

+5
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,8 @@ int identity_key_read(uint8_t key[IDENTITY_KEY_SIZE_BYTES])
171171

172172
return IDENTITY_KEY_SUCCESS;
173173
}
174+
175+
void identity_key_free(uint8_t key[IDENTITY_KEY_SIZE_BYTES])
176+
{
177+
nrf_cc3xx_platform_identity_key_free(key);
178+
}

0 commit comments

Comments
 (0)