Skip to content

Commit

Permalink
[#283] Added SA_OPERATIONAL checkc
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnie-Ice committed Aug 28, 2024
1 parent d8252c6 commit c2b47e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/crypto_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,10 @@ uint8_t* Crypto_Prepare_TC_AAD(uint8_t* buffer, uint16_t len_aad, uint8_t* abm_b
**/
static int32_t crypto_tc_validate_sa(SecurityAssociation_t* sa)
{
if (sa->sa_state != SA_OPERATIONAL)
{
return CRYPTO_LIB_ERR_SA_NOT_OPERATIONAL;
}
if (sa->shivf_len > 0 && crypto_config.iv_type == IV_CRYPTO_MODULE && crypto_config.cryptography_type != CRYPTOGRAPHY_TYPE_KMCCRYPTO)
{
return CRYPTO_LIB_ERR_NULL_IV;
Expand Down

0 comments on commit c2b47e3

Please sign in to comment.