Skip to content

Commit

Permalink
[#256] SA Rework Update - WIP Unit tests (Currently Broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrown6 committed Aug 2, 2024
1 parent e5019ff commit 435bec2
Show file tree
Hide file tree
Showing 16 changed files with 3,518 additions and 3,490 deletions.
1 change: 1 addition & 0 deletions include/crypto_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#define TYPE_TC 0
#define TYPE_MAP 1
#define TYPE_TM 2
#define TYPE_AOS 3

// Specific to Authentication
#define SA_NONE 0
Expand Down
2 changes: 1 addition & 1 deletion include/crypto_config_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef enum
} CreateFecfBool;
typedef enum
{
AOS_FHEC_NA,
AOS_FHEC_NA=0,
AOS_NO_FHEC,
AOS_HAS_FHEC
} AosFhecPresent;
Expand Down
3 changes: 2 additions & 1 deletion include/crypto_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
#define CRYPTO_STRUCTS_H

#include "crypto_config.h"
#include <stdio.h>

#ifdef NOS3 // NOS3/cFS build is ready
#include "common_types.h"
#else // Assume build outside of NOS3/cFS infrastructure
#include <stdint.h>
#ifndef KMC_CFFI_EXCLUDE // Exclude libraries that CFFI parser can’t process
#include <stdio.h>
#ifndef KMC_CFFI_EXCLUDE // Exclude libraries that CFFI parser can’t process
#include <stdlib.h>
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/core/crypto_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int32_t Crypto_Init_AOS_Unit_Test(void)

//Crypto_Config_Add_Gvcid_Managed_Parameter(1, 0x002c, 0, AOS_NO_FECF, AOS_SEGMENT_HDRS_NA, AOS_NO_OCF, 1786, AOS_FHEC_NA, AOS_IZ_NA, 0);
AOS_UT_Managed_Parameters.scid = 0x002c;
AOS_UT_Managed_Parameters.aos_has_fhec = AOS_NO_FECF;
AOS_UT_Managed_Parameters.has_fecf = AOS_NO_FECF;
Crypto_Config_Add_Gvcid_Managed_Parameters(AOS_UT_Managed_Parameters);

//Crypto_Config_Add_Gvcid_Managed_Parameter(1, 0x0042, 0, AOS_NO_FECF, AOS_SEGMENT_HDRS_NA, AOS_HAS_OCF, 1786, AOS_FHEC_NA, AOS_IZ_NA, 0);
Expand Down
1 change: 0 additions & 1 deletion src/core/crypto_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ int32_t Crypto_TC_Do_Encrypt_PLAINTEXT(uint8_t sa_service_type, SecurityAssociat
mc_if->mc_log(status);
return status;
}

if (ecs_is_aead_algorithm == CRYPTO_TRUE)
{
// Check that key length to be used ets the algorithm requirement
Expand Down
3 changes: 1 addition & 2 deletions src/key/custom_stub/key_interface_custom_stub.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
*/

#include "key_interface.h"

/* Variables */
static KeyInterfaceStruct key_if_struct;

/* Functions */
KeyInterface get_key_interface_custom(void)
{
fprintf(stderr,"ERROR: Loading custom key interface stub source code. Rebuild CryptoLib with -DKEY_CUSTOM=ON to use implementation.\n");
fprintf(stderr, "ERROR: Loading custom key interface stub source code. Rebuild CryptoLib with -DKEY_CUSTOM=ON to use implementation.\n");
return &key_if_struct;
}
Loading

0 comments on commit 435bec2

Please sign in to comment.