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

SDLS-EP Baseline: Key Management #147

Closed
jlucas9 opened this issue Mar 24, 2023 · 6 comments · Fixed by #333
Closed

SDLS-EP Baseline: Key Management #147

jlucas9 opened this issue Mar 24, 2023 · 6 comments · Fixed by #333
Assignees
Labels
cmp NASA GSFC CMP

Comments

@jlucas9
Copy link
Collaborator

jlucas9 commented Mar 24, 2023

No description provided.

@jlucas9 jlucas9 added the cmp NASA GSFC CMP label Jun 21, 2023
@jlucas9 jlucas9 self-assigned this Jun 22, 2023
@Donnie-Ice
Copy link
Contributor

@rjbrown2
Copy link
Member

rjbrown2 commented Sep 4, 2024

Closes #44

@dccutrig dccutrig self-assigned this Sep 12, 2024
@dccutrig
Copy link
Contributor

For reference / my starting point on this: There are issues with the UTs in ut_ep_key_validation.c that involve memory corruption.

@Donnie-Ice
Copy link
Contributor

According to @dccutrig, all Key Management unit tests are passing with no changes to the code. Can now resume work on this.

Donnie-Ice added a commit that referenced this issue Sep 16, 2024
@dccutrig
Copy link
Contributor

After much debate, we're jotting down our thoughts about how to proceed with this:

Note: We are able to create a buffer and gather the expected output.

  • The ingest from TC_Process is the raw frame that TC is processing. This ingest is passed several levels and winds up passed into Crypto_Key_mgmt.c-> Crypto_Key_Verify ca. line 430.

  • The core of the issue is we receive a static frame (Say, 40 bytes). The PDU Reply will be larger, it will have an encrypted challenge PLUS a Mac for each challenge, this causes a buffer overflow / stomps things.

  • So, the output needs to be something besides the ingest. Crypto_key_verify needs a way to access / or generate / a TM_Frame to get this reply to the ground. Unfortunately, nominally, the aggregation and building of a frame is handled outside and above CryptoLib. This means that likely a semaphore/mutex is needed for CryptoLib to grab a clean TM_Frame, fill it with a reply, and send the reply. A mutex is needed because The Reply happens nominally as part of a CI library call, whereas Telemetry is generally created as part of a TO library call.

@dccutrig
Copy link
Contributor

dccutrig commented Oct 7, 2024

This is 99% resolved! We tracked the issue to a declared, but un-initialized local variable. During further testing and a re-write to get the sdls reply locally, it was causing garbage data to populate the IV and propagated through several function calls. There is a note / TODO about how to handle IV Generation for Key Verification - the old code assumed this happened in an SA with an active IV that could be used, but this is probably not what we want to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmp NASA GSFC CMP
Projects
Status: Done
4 participants