From 7f837f004170f7b8f53f9dc4d9af52f65b3eab74 Mon Sep 17 00:00:00 2001 From: Ibraheem Saleh Date: Mon, 9 May 2022 16:00:32 -0700 Subject: [PATCH] AMMOSGH-89: Fix missing SDLS processed frame FECF parsing --- src/src_main/crypto_tc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/src_main/crypto_tc.c b/src/src_main/crypto_tc.c index 62ec36aa..59e60496 100644 --- a/src/src_main/crypto_tc.c +++ b/src/src_main/crypto_tc.c @@ -787,13 +787,15 @@ int32_t Crypto_TC_ProcessSecurity(uint8_t* ingest, int *len_ingest, TC_t* tc_sdl segment_hdr_len = 0; } - // Check FECF + // Parse & Check FECF if (current_managed_parameters->has_fecf == TC_HAS_FECF) { + tc_sdls_processed_frame->tc_sec_trailer.fecf = (((ingest[tc_sdls_processed_frame->tc_header.fl - 1] << 8) & 0xFF00) | + (ingest[tc_sdls_processed_frame->tc_header.fl] & 0x00FF)); + if (crypto_config->crypto_check_fecf == TC_CHECK_FECF_TRUE) { - uint16_t received_fecf = (((ingest[tc_sdls_processed_frame->tc_header.fl - 1] << 8) & 0xFF00) | - (ingest[tc_sdls_processed_frame->tc_header.fl] & 0x00FF)); + uint16_t received_fecf = tc_sdls_processed_frame->tc_sec_trailer.fecf; // Calculate our own uint16_t calculated_fecf = Crypto_Calc_FECF(ingest, *len_ingest - 2); // Compare