Skip to content

Commit

Permalink
Merge pull request #168 from nasa/154-tm-encryption-support
Browse files Browse the repository at this point in the history
154 tm encryption support
  • Loading branch information
jlucas9 committed Jun 16, 2023
2 parents ef88a4e + 8cd913c commit a6eb64b
Show file tree
Hide file tree
Showing 5 changed files with 359 additions and 110 deletions.
2 changes: 1 addition & 1 deletion include/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extern int32_t Crypto_TC_ApplySecurity_Cam(const uint8_t* p_in_frame, const uint
extern int32_t Crypto_TC_ProcessSecurity_Cam(uint8_t* ingest, int *len_ingest, TC_t* tc_sdls_processed_frame, char* cam_cookies);
// Telemetry (TM)
extern int32_t Crypto_TM_ApplySecurity(SecurityAssociation_t *sa_ptr);
extern int32_t Crypto_TM_ProcessSecurity(const uint8_t* p_ingest, const uint16_t len_ingest, uint8_t** pp_processed_frame, uint16_t *p_decrypted_length);
extern int32_t Crypto_TM_ProcessSecurity(uint8_t* p_ingest, uint16_t len_ingest, uint8_t** pp_processed_frame, uint16_t *p_decrypted_length);
// Advanced Orbiting Systems (AOS)
extern int32_t Crypto_AOS_ApplySecurity(uint8_t* ingest, int *len_ingest);
extern int32_t Crypto_AOS_ProcessSecurity(uint8_t* ingest, int *len_ingest);
Expand Down
7 changes: 7 additions & 0 deletions src/core/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,17 @@ uint8_t Crypto_Is_AEAD_Algorithm(uint32_t cipher_suite_id)
// TODO - Add cipher suite mapping to which algorithms are AEAD and which are not.
if((cipher_suite_id == CRYPTO_CIPHER_AES256_GCM) || (cipher_suite_id == CRYPTO_CIPHER_AES256_CBC_MAC))
{
#ifdef CRYPTO_DEBUG
printf(KYEL "CRYPTO IS AEAD? : TRUE\n" RESET);
#endif
return CRYPTO_TRUE;

}
else
{
#ifdef CRYPTO_DEBUG
printf(KYEL "CRYPTO IS AEAD? : FALSE\n" RESET);
#endif
return CRYPTO_FALSE;
}
}
Expand Down
Loading

0 comments on commit a6eb64b

Please sign in to comment.