Skip to content

Commit 435bec2

Browse files
committed
[#256] SA Rework Update - WIP Unit tests (Currently Broken)
1 parent e5019ff commit 435bec2

16 files changed

+3518
-3490
lines changed

include/crypto_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#define TYPE_TC 0
7676
#define TYPE_MAP 1
7777
#define TYPE_TM 2
78+
#define TYPE_AOS 3
7879

7980
// Specific to Authentication
8081
#define SA_NONE 0

include/crypto_config_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ typedef enum
8989
} CreateFecfBool;
9090
typedef enum
9191
{
92-
AOS_FHEC_NA,
92+
AOS_FHEC_NA=0,
9393
AOS_NO_FHEC,
9494
AOS_HAS_FHEC
9595
} AosFhecPresent;

include/crypto_structs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
#define CRYPTO_STRUCTS_H
2121

2222
#include "crypto_config.h"
23+
#include <stdio.h>
2324

2425
#ifdef NOS3 // NOS3/cFS build is ready
2526
#include "common_types.h"
2627
#else // Assume build outside of NOS3/cFS infrastructure
2728
#include <stdint.h>
28-
#ifndef KMC_CFFI_EXCLUDE // Exclude libraries that CFFI parser can’t process
2929
#include <stdio.h>
30+
#ifndef KMC_CFFI_EXCLUDE // Exclude libraries that CFFI parser can’t process
3031
#include <stdlib.h>
3132
#endif
3233
#endif

src/core/crypto_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int32_t Crypto_Init_AOS_Unit_Test(void)
155155

156156
//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);
157157
AOS_UT_Managed_Parameters.scid = 0x002c;
158-
AOS_UT_Managed_Parameters.aos_has_fhec = AOS_NO_FECF;
158+
AOS_UT_Managed_Parameters.has_fecf = AOS_NO_FECF;
159159
Crypto_Config_Add_Gvcid_Managed_Parameters(AOS_UT_Managed_Parameters);
160160

161161
//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);

src/core/crypto_tc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ int32_t Crypto_TC_Do_Encrypt_PLAINTEXT(uint8_t sa_service_type, SecurityAssociat
386386
mc_if->mc_log(status);
387387
return status;
388388
}
389-
390389
if (ecs_is_aead_algorithm == CRYPTO_TRUE)
391390
{
392391
// Check that key length to be used ets the algorithm requirement

src/key/custom_stub/key_interface_custom_stub.template.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
*/
1818

1919
#include "key_interface.h"
20-
2120
/* Variables */
2221
static KeyInterfaceStruct key_if_struct;
2322

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

0 commit comments

Comments
 (0)