Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

365 rework tc status magic #368

Merged
merged 12 commits into from
Dec 18, 2024
Merged

365 rework tc status magic #368

merged 12 commits into from
Dec 18, 2024

Conversation

dccutrig
Copy link
Contributor

Resolves #366 (got the branch number off by one)

@dccutrig dccutrig self-assigned this Dec 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 93.59606% with 13 lines in your changes missing coverage. Please review.

Project coverage is 76.53%. Comparing base (22e03b3) to head (4567cee).
Report is 20 commits behind head on dev.

Files with missing lines Patch % Lines
src/core/crypto.c 82.75% 5 Missing and 5 partials ⚠️
test/unit/ut_ep_key_mgmt.c 97.72% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #368      +/-   ##
==========================================
- Coverage   84.12%   76.53%   -7.59%     
==========================================
  Files          81       81              
  Lines       21719    22041     +322     
  Branches     1757     1777      +20     
==========================================
- Hits        18271    16870    -1401     
- Misses       2765     4531    +1766     
+ Partials      683      640      -43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sdls_frame.pdu.hdr.pid = (tc_sdls_processed_frame->tc_pdu[10] & 0x0F);
sdls_frame.pdu.hdr.pdu_len =
(tc_sdls_processed_frame->tc_pdu[11] << 8) | tc_sdls_processed_frame->tc_pdu[12];
for (uint16_t x = 13; x < (13 + sdls_frame.hdr.pkt_length); x++)

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition

Comparison between [x](1) of type uint16_t and [... + ...](2) of wider type int.
sdls_frame.pdu.hdr.sg = (tc_sdls_processed_frame->tc_pdu[0] & 0x30) >> 4;
sdls_frame.pdu.hdr.pid = (tc_sdls_processed_frame->tc_pdu[0] & 0x0F);
sdls_frame.pdu.hdr.pdu_len = (tc_sdls_processed_frame->tc_pdu[1] << 8) | tc_sdls_processed_frame->tc_pdu[2];
for (uint16_t x = 3; x < (3 + tc_sdls_processed_frame->tc_header.fl); x++)

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition

Comparison between [x](1) of type uint16_t and [... + ...](2) of wider type int.
src/core/crypto.c Outdated Show resolved Hide resolved
src/core/crypto.c Outdated Show resolved Hide resolved
src/core/crypto.c Outdated Show resolved Hide resolved
@rjbrown2
Copy link
Member

Do we happen to have a test w/o the PUS header? I know we have the one that caught this initial issue, but did we add another for one that doesn't have one? (Just thinking aloud)

@dccutrig
Copy link
Contributor Author

@rjbrown2 I have tests now with and without PUS header, and some bounds checking. See what ya think

mc_if->mc_log(status);
status = CRYPTO_LIB_SUCCESS;
}
status = Crypto_Process_Extended_Procedure_Pdu(tc_sdls_processed_frame, ingest);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the SPI_MIN and SPI_MAX check above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@jlucas9 jlucas9 linked an issue Dec 18, 2024 that may be closed by this pull request
@dccutrig dccutrig merged commit c7cb887 into dev Dec 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crypto_tc.c Rework status code magic.
5 participants