Skip to content

Commit

Permalink
[#196] Unused Variable Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrown6 committed Mar 26, 2024
1 parent a3c2f59 commit b01824a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/crypto_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ int32_t Crypto_TC_Do_Encrypt_PLAINTEXT(uint8_t sa_service_type, SecurityAssociat

void Crypto_TC_Do_Encrypt_NONPLAINTEXT(uint8_t sa_service_type, SecurityAssociation_t* sa_ptr)
{
int i = 0;
if (sa_service_type != SA_PLAINTEXT)
{
#ifdef INCREMENT
Expand All @@ -437,6 +436,7 @@ void Crypto_TC_Do_Encrypt_NONPLAINTEXT(uint8_t sa_service_type, SecurityAssociat
#ifdef SA_DEBUG
if (sa_ptr->iv_len > 0)
{
int i = 0;
printf(KYEL "Next IV value is:\n\t");
for (i = 0; i < sa_ptr->iv_len; i++)
{
Expand Down Expand Up @@ -533,7 +533,6 @@ int32_t Crypto_TC_Check_Init_Setup(uint16_t in_frame_length)

int32_t Crypto_TC_Sanity_Setup(const uint8_t* p_in_frame, const uint16_t in_frame_length)
{
int i;
uint32_t status = CRYPTO_LIB_SUCCESS;
if (p_in_frame == NULL)
{
Expand All @@ -544,6 +543,7 @@ int32_t Crypto_TC_Sanity_Setup(const uint8_t* p_in_frame, const uint16_t in_fram
}

#ifdef DEBUG
int i;
printf("%d TF Bytes received\n", in_frame_length);
printf("DEBUG - ");
for (i = 0; i < in_frame_length; i++)
Expand Down Expand Up @@ -685,10 +685,10 @@ void Crypto_TC_Handle_Padding(uint32_t pkcs_padding, SecurityAssociation_t* sa_p
int32_t Crypto_TC_Set_IV(SecurityAssociation_t* sa_ptr, uint8_t* p_new_enc_frame, uint16_t* index)
{
uint32_t status = CRYPTO_LIB_SUCCESS;
int i = 0;
#ifdef SA_DEBUG
if (sa_ptr->shivf_len > 0 && sa_ptr->iv != NULL)
{
int i = 0;
printf(KYEL "Using IV value:\n\t");
for (i = 0; i < sa_ptr->iv_len; i++)
{
Expand Down
5 changes: 5 additions & 0 deletions src/sa/internal/sa_interface_inmemory.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@ void sa_debug_block(uint8_t tfvn, uint16_t scid, uint16_t vcid, uint8_t mapid)
printf(KYEL "\tvcid %d\n" RESET, vcid);
printf(KYEL "\tmapid %02X\n" RESET, mapid);
#endif
// Ignore Unused Variables
(void) tfvn;
(void) scid;
(void) vcid;
(void) mapid;
}

int32_t sa_get_operational_sa_from_gvcid_generate_error(int32_t* status, uint8_t tfvn, uint16_t scid, uint16_t vcid, uint8_t mapid)
Expand Down

0 comments on commit b01824a

Please sign in to comment.