nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ suit_check_installed_component_digest()

suit_ssf_err_t suit_check_installed_component_digest ( suit_plat_mreg_t *  component_id,
int  alg_id,
suit_plat_mreg_t *  digest 
)

Check if the installed component digest matches.

The purpose of this function is to check if the specific component is installed in the system. The function checks the input digest against the value stored inside the manifest(s) that were used to boot the system. If the input component boundaries differ from the one that is installed, the function will return false, even if the overlapping binary contents matches. This behaviour is mandatory, so an attacker cannot check each byte of the memory against the dictionary of the known hashes and read back the whole memory.

Parameters
[in]component_idPointer to the structure with the component ID.
[in]alg_idID of an algorithm that was used to calculate the digest.
[in]digestThe digest to check.
Return values
SUIT_PLAT_SUCCESSif successful.
SUIT_PLAT_ERR_INVALif input parameters are invalid.
SUIT_PLAT_ERR_UNSUPPORTEDif specified digest type is not supported.
SUIT_SSF_FAIL_CONDITIONif the digest does not match.
SUIT_SSF_MISSING_COMPONENTif the digest of the specified memory is unknown.
SUIT_PLAT_ERR_IPCin case of SSF protocol error.