From 332916c28d6ffaec4798403a3242cdc5bbd0ac95 Mon Sep 17 00:00:00 2001 From: "Lucas, John P" Date: Thu, 3 Feb 2022 14:33:06 -0500 Subject: [PATCH] #69 - Find and replace issue fixed with `* *`; --- include/crypto.h | 4 +- include/sadb_routine.h | 4 +- src/src_main/crypto.c | 4 +- src/src_main/crypto_tc.c | 2 +- src/src_main/sadb_routine_inmemory.template.c | 8 +- src/src_mysql/sadb_routine_mariadb.template.c | 12 +- util/include/shared_util.h | 2 +- util/src_util/et_dt_validation.c | 170 +++++++++--------- 8 files changed, 103 insertions(+), 103 deletions(-) diff --git a/include/crypto.h b/include/crypto.h index dcfd141f..ff964eef 100644 --- a/include/crypto.h +++ b/include/crypto.h @@ -81,7 +81,7 @@ extern int32_t Crypto_Shutdown(void); // Free all allocated memory // Telecommand (TC) extern int32_t Crypto_TC_ApplySecurity(const uint8_t* p_in_frame, const uint16_t in_frame_length, - uint8_t* *pp_enc_frame, uint16_t* p_enc_frame_len); + uint8_t** pp_enc_frame, uint16_t* p_enc_frame_len); extern int32_t Crypto_TC_ProcessSecurity(uint8_t* ingest, int *len_ingest, TC_t* tc_sdls_processed_frame); // Telemetry (TM) extern int32_t Crypto_TM_ApplySecurity(uint8_t* ingest, int *len_ingest); @@ -143,7 +143,7 @@ int32_t Crypto_PDU(uint8_t* ingest, TC_t* tc_frame); // Managed Parameter Functions int32_t Crypto_Get_Managed_Parameters_For_Gvcid(uint8_t tfvn, uint16_t scid, uint8_t vcid, GvcidManagedParameters_t* managed_parameters_in, - GvcidManagedParameters_t* *managed_parameters_out); + GvcidManagedParameters_t** managed_parameters_out); int32_t crypto_config_add_gvcid_managed_parameter_recursion(uint8_t tfvn, uint16_t scid, uint8_t vcid, uint8_t has_fecf, uint8_t has_segmentation_hdr, GvcidManagedParameters_t* managed_parameter); diff --git a/include/sadb_routine.h b/include/sadb_routine.h index 3138b60e..de9bd534 100644 --- a/include/sadb_routine.h +++ b/include/sadb_routine.h @@ -33,8 +33,8 @@ typedef struct int32_t (*sadb_init)(void); int32_t (*sadb_close)(void); // Security Association Interaction Functions - int32_t (*sadb_get_sa_from_spi)(uint16_t, SecurityAssociation_t* *); - int32_t (*sadb_get_operational_sa_from_gvcid)(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t* *); + int32_t (*sadb_get_sa_from_spi)(uint16_t, SecurityAssociation_t** ); + int32_t (*sadb_get_operational_sa_from_gvcid)(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t**); int32_t (*sadb_save_sa)(SecurityAssociation_t* ); // Security Association Utility Functions int32_t (*sadb_sa_stop)(void); diff --git a/src/src_main/crypto.c b/src/src_main/crypto.c index 8460d0b3..2e3ac9e9 100644 --- a/src/src_main/crypto.c +++ b/src/src_main/crypto.c @@ -614,7 +614,7 @@ int32_t Crypto_PDU(uint8_t* ingest, TC_t* tc_frame) **/ int32_t Crypto_Get_Managed_Parameters_For_Gvcid(uint8_t tfvn, uint16_t scid, uint8_t vcid, GvcidManagedParameters_t* managed_parameters_in, - GvcidManagedParameters_t* *managed_parameters_out) + GvcidManagedParameters_t** managed_parameters_out) { int32_t status = MANAGED_PARAMETERS_FOR_GVCID_NOT_FOUND; @@ -664,7 +664,7 @@ void Crypto_Free_Managed_Parameters(GvcidManagedParameters_t* managed_parameters * @param tc_sdls_processed_frame: TC_t* * @param ingest: uint8_t* * @note TODO - Actually update based on variable config - * */ + **/ int32_t Crypto_Process_Extended_Procedure_Pdu(TC_t* tc_sdls_processed_frame, uint8_t* ingest) { int32_t status = CRYPTO_LIB_SUCCESS; diff --git a/src/src_main/crypto_tc.c b/src/src_main/crypto_tc.c index 9e328b53..cd3c615e 100644 --- a/src/src_main/crypto_tc.c +++ b/src/src_main/crypto_tc.c @@ -32,7 +32,7 @@ * @param p_enc_frame_len: uint16 * @return int32: Success/Failure **/ -int32_t Crypto_TC_ApplySecurity(const uint8_t* p_in_frame, const uint16_t in_frame_length, uint8_t* *pp_in_frame, +int32_t Crypto_TC_ApplySecurity(const uint8_t* p_in_frame, const uint16_t in_frame_length, uint8_t** pp_in_frame, uint16_t* p_enc_frame_len) { // Local Variables diff --git a/src/src_main/sadb_routine_inmemory.template.c b/src/src_main/sadb_routine_inmemory.template.c index 9803e846..5d94140c 100644 --- a/src/src_main/sadb_routine_inmemory.template.c +++ b/src/src_main/sadb_routine_inmemory.template.c @@ -19,8 +19,8 @@ static int32_t sadb_config(void); static int32_t sadb_init(void); static int32_t sadb_close(void); // Security Association Interaction Functions -static int32_t sadb_get_sa_from_spi(uint16_t, SecurityAssociation_t* *); -static int32_t sadb_get_operational_sa_from_gvcid(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t* *); +static int32_t sadb_get_sa_from_spi(uint16_t, SecurityAssociation_t**); +static int32_t sadb_get_operational_sa_from_gvcid(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t**); static int32_t sadb_save_sa(SecurityAssociation_t* sa); // Security Association Utility Functions static int32_t sadb_sa_stop(void); @@ -279,7 +279,7 @@ static int32_t sadb_close(void) * @param security_association: SecurityAssociation_t** * @return int32: Success/Failure **/ -static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t* *security_association) +static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t** security_association) { int32_t status = CRYPTO_LIB_SUCCESS; if (sa == NULL) @@ -312,7 +312,7 @@ static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t* *securi * @return int32: Success/Failure **/ static int32_t sadb_get_operational_sa_from_gvcid(uint8_t tfvn, uint16_t scid, uint16_t vcid, uint8_t mapid, - SecurityAssociation_t* *security_association) + SecurityAssociation_t** security_association) { int32_t status = CRYPTO_LIB_ERR_NO_OPERATIONAL_SA; int i; diff --git a/src/src_mysql/sadb_routine_mariadb.template.c b/src/src_mysql/sadb_routine_mariadb.template.c index 21a9ac7a..8f824b5c 100644 --- a/src/src_mysql/sadb_routine_mariadb.template.c +++ b/src/src_mysql/sadb_routine_mariadb.template.c @@ -28,8 +28,8 @@ static int32_t sadb_config(void); static int32_t sadb_init(void); static int32_t sadb_close(void); // Security Association Interaction Functions -static int32_t sadb_get_sa_from_spi(uint16_t, SecurityAssociation_t* *); -static int32_t sadb_get_operational_sa_from_gvcid(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t* *); +static int32_t sadb_get_sa_from_spi(uint16_t, SecurityAssociation_t**); +static int32_t sadb_get_operational_sa_from_gvcid(uint8_t, uint16_t, uint16_t, uint8_t, SecurityAssociation_t**); static int32_t sadb_save_sa(SecurityAssociation_t* sa); // Security Association Utility Functions static int32_t sadb_sa_stop(void); @@ -60,7 +60,7 @@ static const char* SQL_SADB_UPDATE_IV_ARC_BY_SPI = " WHERE spi='%d' AND tfvn='%d' AND scid='%d' AND vcid='%d' AND mapid='%d'"; // sadb_routine mariaDB private helper functions -static int32_t parse_sa_from_mysql_query(char* query, SecurityAssociation_t* *security_association); +static int32_t parse_sa_from_mysql_query(char* query, SecurityAssociation_t** security_association); static int32_t convert_hexstring_to_byte_array(char* hexstr, uint8_t* byte_array); static char* convert_byte_array_to_hexstring(void* src_buffer, size_t buffer_length); @@ -172,7 +172,7 @@ static int32_t sadb_close(void) } // Security Association Interaction Functions -static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t* *security_association) +static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t** security_association) { int32_t status = CRYPTO_LIB_SUCCESS; @@ -184,7 +184,7 @@ static int32_t sadb_get_sa_from_spi(uint16_t spi, SecurityAssociation_t* *securi return status; } static int32_t sadb_get_operational_sa_from_gvcid(uint8_t tfvn, uint16_t scid, uint16_t vcid, uint8_t mapid, - SecurityAssociation_t* *security_association) + SecurityAssociation_t** security_association) { int32_t status = CRYPTO_LIB_SUCCESS; @@ -272,7 +272,7 @@ static int32_t sadb_sa_delete(void) } // sadb_routine private helper functions -static int32_t parse_sa_from_mysql_query(char* query, SecurityAssociation_t* *security_association) +static int32_t parse_sa_from_mysql_query(char* query, SecurityAssociation_t** security_association) { int32_t status = CRYPTO_LIB_SUCCESS; SecurityAssociation_t* sa = malloc(sizeof(SecurityAssociation_t)); diff --git a/util/include/shared_util.h b/util/include/shared_util.h index ce2c66b8..9c0f2ca5 100644 --- a/util/include/shared_util.h +++ b/util/include/shared_util.h @@ -38,7 +38,7 @@ extern "C" void debug_printf(const char* format, ...); void debug_hexprintf(const char* bin_data, int size_bin_data); - void hex_conversion(char* buffer_h, char* *buffer_b, int *buffer_b_length); + void hex_conversion(char* buffer_h, char** buffer_b, int *buffer_b_length); int convert_hexstring_to_byte_array(char* source_str, char* dest_buffer); #ifdef __cplusplus diff --git a/util/src_util/et_dt_validation.c b/util/src_util/et_dt_validation.c index e3a808f1..045709f8 100644 --- a/util/src_util/et_dt_validation.c +++ b/util/src_util/et_dt_validation.c @@ -49,7 +49,7 @@ int EndPython() /** * @brief Python Setup * Sets up the use of python encryption class within CTests - * */ + **/ void setup_python() { Py_Initialize(); @@ -87,7 +87,7 @@ void setup_python() * @param expected_length The length of the expected character array this is set within this function * @note User must free memory themselves. **/ -void python_cmac(char* data, char* key, uint8_t* *expected, long *expected_length) +void python_cmac(char* data, char* key, uint8_t** expected, long *expected_length) { setup_python(); @@ -117,7 +117,7 @@ void python_cmac(char* data, char* key, uint8_t* *expected, long *expected_lengt * @note The char** expected that is passsed to this function must be freed by the user upon completion of unit test or *other call. **/ -void python_auth_encryption(char* data, char* key, char* iv, char* header, char* bitmask, uint8_t* *expected, +void python_auth_encryption(char* data, char* key, char* iv, char* header, char* bitmask, uint8_t** expected, long *expected_length) { setup_python(); @@ -138,7 +138,7 @@ void python_auth_encryption(char* data, char* key, char* iv, char* header, char* * Utilizes the python_auth_encryption(uint8_t* data, uint8_t* key, uint8_t* iv, uint8_t* header, uint8_t* bitmask, *uint8_t** expected, long* expected_length) function to create baseline truth data. This data is then compared against *the generated tag and cipher text that is generated by the Crypto_TC_ApplySecurity(const uint8_t* p_in_frame, const - *uint16_t in_frame_length, uint8_t* *pp_in_frame, uint16_t* p_enc_frame_len) function, as well as the FECF. + *uint16_t in_frame_length, uint8_t** pp_in_frame, uint16_t* p_enc_frame_len) function, as well as the FECF. **/ UTEST(ET_VALIDATION, AUTH_ENCRYPTION_TEST) { @@ -155,8 +155,8 @@ UTEST(ET_VALIDATION, AUTH_ENCRYPTION_TEST) uint8_t* activate_sa4_b, *enc_test_ping_b = NULL; int activate_sa4_len, enc_test_ping_len = 0; - hex_conversion(activate_sa4_h, (char* *)&activate_sa4_b, &activate_sa4_len); - hex_conversion(enc_test_ping_h, (char* *)&enc_test_ping_b, &enc_test_ping_len); + hex_conversion(activate_sa4_h, (char**) &activate_sa4_b, &activate_sa4_len); + hex_conversion(enc_test_ping_h, (char**) &enc_test_ping_b, &enc_test_ping_len); SecurityAssociation_t* test_association = NULL; test_association = malloc(sizeof(SecurityAssociation_t) * sizeof(uint8_t)); @@ -237,9 +237,9 @@ UTEST(DT_VALIDATION, AUTH_DECRYPTION_TEST) uint8_t* activate_sa4_b, *dec_test_ping_b, *enc_test_ping_b = NULL; int activate_sa4_len, dec_test_ping_len, enc_test_ping_len = 0; - hex_conversion(activate_sa4_h, (char* *)&activate_sa4_b, &activate_sa4_len); - hex_conversion(dec_test_ping_h, (char* *)&dec_test_ping_b, &dec_test_ping_len); - hex_conversion(enc_test_ping_h, (char* *)&enc_test_ping_b, &enc_test_ping_len); + hex_conversion(activate_sa4_h, (char**) &activate_sa4_b, &activate_sa4_len); + hex_conversion(dec_test_ping_h, (char**) &dec_test_ping_b, &dec_test_ping_len); + hex_conversion(enc_test_ping_h, (char**) &enc_test_ping_b, &enc_test_ping_len); SecurityAssociation_t* test_association = NULL; test_association = malloc(sizeof(SecurityAssociation_t) * sizeof(uint8_t)); @@ -348,18 +348,18 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); test_association->iv = malloc(*buffer_nist_iv_b * sizeof(uint8_t)); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_ct_h, (char* *)&buffer_nist_ct_b, &buffer_nist_ct_len); + hex_conversion(buffer_nist_ct_h, (char**) &buffer_nist_ct_b, &buffer_nist_ct_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -426,18 +426,18 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) test_association->ecs = calloc(1, test_association->ecs_len * sizeof(uint8_t)); *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); printf("NIST IV LEN: %d\n", buffer_nist_iv_len); // Convert input encryptedtext - hex_conversion(buffer_nist_et_h, (char* *)&buffer_nist_et_b, &buffer_nist_et_len); + hex_conversion(buffer_nist_et_h, (char**) &buffer_nist_et_b, &buffer_nist_et_len); Crypto_TC_ProcessSecurity(buffer_nist_et_b, &buffer_nist_et_len, tc_nist_processed_frame); @@ -499,17 +499,17 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_ct_h, (char* *)&buffer_nist_ct_b, &buffer_nist_ct_len); + hex_conversion(buffer_nist_ct_h, (char**) &buffer_nist_ct_b, &buffer_nist_ct_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -574,17 +574,17 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_et_h, (char* *)&buffer_nist_et_b, &buffer_nist_et_len); + hex_conversion(buffer_nist_et_h, (char**) &buffer_nist_et_b, &buffer_nist_et_len); int32_t status; @@ -648,17 +648,17 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_2) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_ct_h, (char* *)&buffer_nist_ct_b, &buffer_nist_ct_len); + hex_conversion(buffer_nist_ct_h, (char**) &buffer_nist_ct_b, &buffer_nist_ct_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -724,17 +724,17 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_2) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_et_h, (char* *)&buffer_nist_et_b, &buffer_nist_et_len); + hex_conversion(buffer_nist_et_h, (char**) &buffer_nist_et_b, &buffer_nist_et_len); Crypto_TC_ProcessSecurity(buffer_nist_et_b, &buffer_nist_et_len, tc_nist_processed_frame); @@ -795,17 +795,17 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_3) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_ct_h, (char* *)&buffer_nist_ct_b, &buffer_nist_ct_len); + hex_conversion(buffer_nist_ct_h, (char**) &buffer_nist_ct_b, &buffer_nist_ct_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -871,17 +871,17 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_3) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_et_h, (char* *)&buffer_nist_et_b, &buffer_nist_et_len); + hex_conversion(buffer_nist_et_h, (char**) &buffer_nist_et_b, &buffer_nist_et_len); Crypto_TC_ProcessSecurity(buffer_nist_et_b, &buffer_nist_et_len, tc_nist_processed_frame); @@ -942,17 +942,17 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_4) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_ct_h, (char* *)&buffer_nist_ct_b, &buffer_nist_ct_len); + hex_conversion(buffer_nist_ct_h, (char**) &buffer_nist_ct_b, &buffer_nist_ct_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -1018,17 +1018,17 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_4) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input ciphertext - hex_conversion(buffer_nist_et_h, (char* *)&buffer_nist_et_b, &buffer_nist_et_len); + hex_conversion(buffer_nist_et_h, (char**) &buffer_nist_et_b, &buffer_nist_et_len); Crypto_TC_ProcessSecurity(buffer_nist_et_b, &buffer_nist_et_len, tc_nist_processed_frame); @@ -1107,19 +1107,19 @@ UTEST(NIST_ENC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input aad - hex_conversion(buffer_nist_aad_h, (char* *)&buffer_nist_aad_b, &buffer_nist_aad_len); + hex_conversion(buffer_nist_aad_h, (char**) &buffer_nist_aad_b, &buffer_nist_aad_len); // Convert input mac - hex_conversion(buffer_cyber_chef_mac_h, (char* *)&buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); + hex_conversion(buffer_cyber_chef_mac_h, (char**) &buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); // Note: For comparison, interested in the TF payload (exclude headers and FECF if present) @@ -1193,17 +1193,17 @@ UTEST(NIST_ENC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input mac - hex_conversion(buffer_cyber_chef_mac_h, (char* *)&buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); + hex_conversion(buffer_cyber_chef_mac_h, (char**) &buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); Crypto_TC_ApplySecurity(buffer_nist_pt_b, buffer_nist_pt_len, &ptr_enc_frame, &enc_frame_len); @@ -1286,19 +1286,19 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input mac - hex_conversion(buffer_cyber_chef_mac_h, (char* *)&buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); + hex_conversion(buffer_cyber_chef_mac_h, (char**) &buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); // Convert mac frame - hex_conversion(buffer_nist_mac_frame_h, (char* *)&buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); + hex_conversion(buffer_nist_mac_frame_h, (char**) &buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); status = Crypto_TC_ProcessSecurity(buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len, tc_nist_processed_frame); //printf("TC_Process returned status %d\n", status); @@ -1412,19 +1412,19 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0_BAD_DATA) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input mac - hex_conversion(buffer_cyber_chef_mac_h, (char* *)&buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); + hex_conversion(buffer_cyber_chef_mac_h, (char**) &buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); // Convert mac frame - hex_conversion(buffer_nist_mac_frame_h, (char* *)&buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); + hex_conversion(buffer_nist_mac_frame_h, (char**) &buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); status = Crypto_TC_ProcessSecurity(buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len, tc_nist_processed_frame); //printf("TC_Process returned status %d\n", status); @@ -1513,19 +1513,19 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0_BAD_MAC) *test_association->ecs = CRYPTO_AES256_GCM; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext // TODO: Account for length of header and FECF (5+2) - hex_conversion(buffer_nist_pt_h, (char* *)&buffer_nist_pt_b, &buffer_nist_pt_len); + hex_conversion(buffer_nist_pt_h, (char**) &buffer_nist_pt_b, &buffer_nist_pt_len); // Convert/Set input IV - hex_conversion(buffer_nist_iv_h, (char* *)&buffer_nist_iv_b, &buffer_nist_iv_len); + hex_conversion(buffer_nist_iv_h, (char**) &buffer_nist_iv_b, &buffer_nist_iv_len); memcpy(test_association->iv, buffer_nist_iv_b, buffer_nist_iv_len); // Convert input mac - hex_conversion(buffer_cyber_chef_mac_h, (char* *)&buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); + hex_conversion(buffer_cyber_chef_mac_h, (char**) &buffer_cyber_chef_mac_b, &buffer_cyber_chef_mac_len); // Convert mac frame - hex_conversion(buffer_nist_mac_frame_h, (char* *)&buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); + hex_conversion(buffer_nist_mac_frame_h, (char**) &buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len); status = Crypto_TC_ProcessSecurity(buffer_nist_mac_frame_b, &buffer_nist_mac_frame_len, tc_nist_processed_frame); //printf("TC_Process returned status %d\n", status); @@ -1614,13 +1614,13 @@ UTEST(NIST_ENC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_0) test_association->acs = CRYPTO_AES256_CMAC; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext - hex_conversion(buffer_frame_pt_h, (char* *)&buffer_frame_pt_b, &buffer_frame_pt_len); + hex_conversion(buffer_frame_pt_h, (char**) &buffer_frame_pt_b, &buffer_frame_pt_len); // Convert input mac - hex_conversion(buffer_python_mac_h, (char* *)&buffer_python_mac_b, &buffer_python_mac_len); + hex_conversion(buffer_python_mac_h, (char**) &buffer_python_mac_b, &buffer_python_mac_len); Crypto_TC_ApplySecurity(buffer_frame_pt_b, buffer_frame_pt_len, &ptr_enc_frame, &enc_frame_len); @@ -1702,13 +1702,13 @@ UTEST(NIST_ENC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_1) test_association->acs = CRYPTO_AES256_CMAC; // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext - hex_conversion(buffer_frame_pt_h, (char* *)&buffer_frame_pt_b, &buffer_frame_pt_len); + hex_conversion(buffer_frame_pt_h, (char**) &buffer_frame_pt_b, &buffer_frame_pt_len); // Convert input mac - hex_conversion(buffer_python_mac_h, (char* *)&buffer_python_mac_b, &buffer_python_mac_len); + hex_conversion(buffer_python_mac_h, (char**) &buffer_python_mac_b, &buffer_python_mac_len); Crypto_TC_ApplySecurity(buffer_frame_pt_b, buffer_frame_pt_len, &ptr_enc_frame, &enc_frame_len); @@ -1791,13 +1791,13 @@ UTEST(NIST_DEC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_0) tc_sdls_processed_frame = calloc(1, sizeof(uint8_t) * TC_SIZE); // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext - hex_conversion(buffer_frame_pt_h, (char* *)&buffer_frame_pt_b, &buffer_frame_pt_len); + hex_conversion(buffer_frame_pt_h, (char**) &buffer_frame_pt_b, &buffer_frame_pt_len); // Convert input mac - hex_conversion(buffer_python_mac_h, (char* *)&buffer_python_mac_b, &buffer_python_mac_len); + hex_conversion(buffer_python_mac_h, (char**) &buffer_python_mac_b, &buffer_python_mac_len); Crypto_TC_ProcessSecurity(buffer_frame_pt_b, &buffer_frame_pt_len, tc_sdls_processed_frame); @@ -1881,13 +1881,13 @@ UTEST(NIST_DEC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_1) tc_sdls_processed_frame = calloc(1, sizeof(uint8_t) * TC_SIZE); // Insert key into keyring of SA 9 - hex_conversion(buffer_nist_key_h, (char* *)&buffer_nist_key_b, &buffer_nist_key_len); + hex_conversion(buffer_nist_key_h, (char**) &buffer_nist_key_b, &buffer_nist_key_len); memcpy(ek_ring[test_association->ekid].value, buffer_nist_key_b, buffer_nist_key_len); // Convert input plaintext - hex_conversion(buffer_frame_pt_h, (char* *)&buffer_frame_pt_b, &buffer_frame_pt_len); + hex_conversion(buffer_frame_pt_h, (char**) &buffer_frame_pt_b, &buffer_frame_pt_len); // Convert input mac - hex_conversion(buffer_python_mac_h, (char* *)&buffer_python_mac_b, &buffer_python_mac_len); + hex_conversion(buffer_python_mac_h, (char**) &buffer_python_mac_b, &buffer_python_mac_len); Crypto_TC_ProcessSecurity(buffer_frame_pt_b, &buffer_frame_pt_len, tc_sdls_processed_frame);