CryptoLib
CryptoLib copied to clipboard
Conditional Error Code Review
Wish to improve logic in scenarios such as follows in updated version of crypto_tm.c:
if((*(sa_ptr->acs) == CRYPTO_MAC_CMAC_AES256 || *(sa_ptr->acs) == CRYPTO_MAC_HMAC_SHA256 || *(sa_ptr->acs) == CRYPTO_MAC_HMAC_SHA512) &&
sa_ptr->iv_len > 0 )
{
return CRYPTO_LIB_ERR_IV_NOT_SUPPORTED_FOR_ACS_ALGO;
}
The intent of above is to make sure that IV cannot be set in ACS only algorithms, however this check would fail if a new ACS was added functionally and not updated here. This might need re-written (and check for similar cases) to reduce future code maintenance.
Issue to be analyzed further after TM integration.