Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/wolfesp.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,20 +640,6 @@ esp_calc_icv_hmac(uint8_t * hash, const wolfIP_esp_sa * esp_sa,
return err;
}

/* From wolfcrypt misc.c */
static int
esp_const_memcmp(const uint8_t * vec_a, const uint8_t * vec_b, uint32_t len)
{
uint32_t i = 0;
int sum = 0;

for (i = 0; i < len; i++) {
sum |= vec_a[i] ^ vec_b[i];
}

return sum;
}

/**
* Get the encryption length for an ESP payload.
* */
Expand Down Expand Up @@ -1225,7 +1211,7 @@ esp_check_icv_hmac(const wolfIP_esp_sa * esp_sa, uint8_t * esp_data,
icv = esp_data + esp_len - esp_sa->icv_len;

/* compare the first N bits depending on truncation type. */
rc = esp_const_memcmp(icv, hash, esp_sa->icv_len);
rc = wc_ConstantCompare(icv, hash, esp_sa->icv_len);
if (rc) {
rc = -1;
}
Expand Down
Loading