diff --git a/include/crypto.h b/include/crypto.h index f6a3bdfa..dcfd141f 100644 --- a/include/crypto.h +++ b/include/crypto.h @@ -55,16 +55,16 @@ extern int32_t Crypto_Config_CryptoLib(uint8_t sadb_type, uint8_t cryptography_type, uint8_t crypto_create_fecf, uint8_t process_sdls_pdus, uint8_t has_pus_hdr, uint8_t ignore_sa_state, uint8_t ignore_anti_replay, uint8_t unique_sa_per_mapid, uint8_t crypto_check_fecf, uint8_t vcid_bitmask); -extern int32_t Crypto_Config_MariaDB(char *mysql_hostname, char *mysql_database, uint16_t mysql_port, +extern int32_t Crypto_Config_MariaDB(char* mysql_hostname, char* mysql_database, uint16_t mysql_port, uint8_t mysql_require_secure_transport, uint8_t mysql_tls_verify_server, - char *mysql_tls_ca, char *mysql_tls_capath, char *mysql_mtls_cert, - char *mysql_mtls_key, - char *mysql_mtls_client_key_password, char *mysql_username, char *mysql_password); -extern int32_t Crypto_Config_Kmc_Crypto_Service(char *protocol, char *kmc_crypto_hostname, uint16_t kmc_crypto_port, - char *kmc_crypto_app, char *kmc_tls_ca_bundle, char *kmc_tls_ca_path, - uint8_t kmc_ignore_ssl_hostname_validation, char *mtls_client_cert_path, - char *mtls_client_cert_type, char *mtls_client_key_path, - char *mtls_client_key_pass, char *mtls_issuer_cert); + char* mysql_tls_ca, char* mysql_tls_capath, char* mysql_mtls_cert, + char* mysql_mtls_key, + char* mysql_mtls_client_key_password, char* mysql_username, char* mysql_password); +extern int32_t Crypto_Config_Kmc_Crypto_Service(char* protocol, char* kmc_crypto_hostname, uint16_t kmc_crypto_port, + char* kmc_crypto_app, char* kmc_tls_ca_bundle, char* kmc_tls_ca_path, + uint8_t kmc_ignore_ssl_hostname_validation, char* mtls_client_cert_path, + char* mtls_client_cert_type, char* mtls_client_key_path, + char* mtls_client_key_pass, char* mtls_issuer_cert); extern int32_t Crypto_Config_Add_Gvcid_Managed_Parameter(uint8_t tfvn, uint16_t scid, uint8_t vcid, uint8_t has_fecf, uint8_t has_segmentation_hdr); diff --git a/include/crypto_config_structs.h b/include/crypto_config_structs.h index 64d45936..467ab99a 100644 --- a/include/crypto_config_structs.h +++ b/include/crypto_config_structs.h @@ -135,10 +135,10 @@ struct _GvcidManagedParameters_t */ typedef struct { - char *mysql_username; - char *mysql_password; - char *mysql_hostname; - char *mysql_database; + char* mysql_username; + char* mysql_password; + char* mysql_hostname; + char* mysql_database; uint16_t mysql_port; char* mysql_mtls_cert; char* mysql_mtls_key; diff --git a/src/src_cryptography/src_kmc_crypto_service/cryptography_interface_kmc_crypto_service.template.c b/src/src_cryptography/src_kmc_crypto_service/cryptography_interface_kmc_crypto_service.template.c index be834503..faf714fe 100644 --- a/src/src_cryptography/src_kmc_crypto_service/cryptography_interface_kmc_crypto_service.template.c +++ b/src/src_cryptography/src_kmc_crypto_service/cryptography_interface_kmc_crypto_service.template.c @@ -73,9 +73,9 @@ static int32_t cryptography_aead_decrypt(uint8_t* data_out, size_t len_data_out, // libcurl call back and support function declarations static void configure_curl_connect_opts(CURL* curl); static size_t write_callback(void* data, size_t size, size_t nmemb, void* userp); -static size_t read_callback(char *dest, size_t size, size_t nmemb, void* userp); +static size_t read_callback(char* dest, size_t size, size_t nmemb, void* userp); static char* int_to_str(uint32_t int_src, uint32_t* converted_str_length); -static int jsoneq(const char *json, jsmntok_t* tok, const char *s); +static int jsoneq(const char* json, jsmntok_t* tok, const char* s); /* @@ -106,12 +106,12 @@ static const char* AES_CMAC_TRANSFORMATION="AESCMAC"; // libcurl call-back response handling Structures typedef struct { - char *response; + char* response; size_t size; } memory_write; #define MEMORY_WRITE_SIZE (sizeof(memory_write)) typedef struct { - char *response; + char* response; size_t size; } memory_read; #define MEMORY_READ_SIZE (sizeof(memory_read)) @@ -1088,7 +1088,7 @@ static size_t write_callback(void* data, size_t size, size_t nmemb, void* userp) size_t realsize = size * nmemb; memory_write *mem = (memory_write *)userp; - char *ptr; + char* ptr; if(mem->response != NULL) { ptr = realloc(mem->response, mem->size + realsize + 1); @@ -1109,7 +1109,7 @@ static size_t write_callback(void* data, size_t size, size_t nmemb, void* userp) return realsize; } -static size_t read_callback(char *dest, size_t size, size_t nmemb, void* userp) +static size_t read_callback(char* dest, size_t size, size_t nmemb, void* userp) { memory_read *wt = (memory_read *)userp; size_t buffer_size = size*nmemb; @@ -1183,7 +1183,7 @@ static char* int_to_str(uint32_t int_src, uint32_t* converted_str_length) // JSON local functions -static int jsoneq(const char *json, jsmntok_t* tok, const char *s) +static int jsoneq(const char* json, jsmntok_t* tok, const char* s) { if (tok->type == JSMN_STRING && (int)strlen(s) == tok->end - tok->start && strncmp(json + tok->start, s, tok->end - tok->start) == 0) { diff --git a/src/src_cryptography/src_kmc_crypto_service/jsmn.h b/src/src_cryptography/src_kmc_crypto_service/jsmn.h index c8a50153..606aaf9a 100644 --- a/src/src_cryptography/src_kmc_crypto_service/jsmn.h +++ b/src/src_cryptography/src_kmc_crypto_service/jsmn.h @@ -96,7 +96,7 @@ JSMN_API void jsmn_init(jsmn_parser *parser); * describing * a single JSON object. */ -JSMN_API int jsmn_parse(jsmn_parser *parser, const char *js, const size_t len, +JSMN_API int jsmn_parse(jsmn_parser *parser, const char* js, const size_t len, jsmntok_t* tokens, const unsigned int num_tokens); #ifndef JSMN_HEADER @@ -132,7 +132,7 @@ static void jsmn_fill_token(jsmntok_t* token, const jsmntype_t type, /** * Fills next available token with JSON primitive. */ -static int jsmn_parse_primitive(jsmn_parser *parser, const char *js, +static int jsmn_parse_primitive(jsmn_parser *parser, const char* js, const size_t len, jsmntok_t* tokens, const size_t num_tokens) { jsmntok_t* token; @@ -190,7 +190,7 @@ static int jsmn_parse_primitive(jsmn_parser *parser, const char *js, /** * Fills next token with JSON string. */ -static int jsmn_parse_string(jsmn_parser *parser, const char *js, +static int jsmn_parse_string(jsmn_parser *parser, const char* js, const size_t len, jsmntok_t* tokens, const size_t num_tokens) { jsmntok_t* token; @@ -265,7 +265,7 @@ static int jsmn_parse_string(jsmn_parser *parser, const char *js, /** * Parse JSON string and fill tokens. */ -JSMN_API int jsmn_parse(jsmn_parser *parser, const char *js, const size_t len, +JSMN_API int jsmn_parse(jsmn_parser *parser, const char* js, const size_t len, jsmntok_t* tokens, const unsigned int num_tokens) { int r; int i; diff --git a/src/src_main/crypto_config.c b/src/src_main/crypto_config.c index fb9e3f93..27bd6eb7 100644 --- a/src/src_main/crypto_config.c +++ b/src/src_main/crypto_config.c @@ -265,10 +265,10 @@ int32_t Crypto_Config_CryptoLib(uint8_t sadb_type, uint8_t cryptography_type, ui * @return int32: Success/Failure **/ /*set parameters for an encrypted TLS connection*/ -int32_t Crypto_Config_MariaDB(char *mysql_hostname, char *mysql_database, uint16_t mysql_port, +int32_t Crypto_Config_MariaDB(char* mysql_hostname, char* mysql_database, uint16_t mysql_port, uint8_t mysql_require_secure_transport, uint8_t mysql_tls_verify_server, - char *mysql_tls_ca, char *mysql_tls_capath, char *mysql_mtls_cert, char *mysql_mtls_key, - char *mysql_mtls_client_key_password, char *mysql_username, char *mysql_password) + char* mysql_tls_ca, char* mysql_tls_capath, char* mysql_mtls_cert, char* mysql_mtls_key, + char* mysql_mtls_client_key_password, char* mysql_username, char* mysql_password) { int32_t status = CRYPTO_LIB_ERROR; sadb_mariadb_config = (SadbMariaDBConfig_t*)calloc(1, SADB_MARIADB_CONFIG_SIZE); @@ -293,11 +293,11 @@ int32_t Crypto_Config_MariaDB(char *mysql_hostname, char *mysql_database, uint16 return status; } -extern int32_t Crypto_Config_Kmc_Crypto_Service(char *protocol, char *kmc_crypto_hostname, uint16_t kmc_crypto_port, - char *kmc_crypto_app, char *kmc_tls_ca_bundle, char *kmc_tls_ca_path, - uint8_t kmc_ignore_ssl_hostname_validation, char *mtls_client_cert_path, - char *mtls_client_cert_type, char *mtls_client_key_path, - char *mtls_client_key_pass, char *mtls_issuer_cert) +extern int32_t Crypto_Config_Kmc_Crypto_Service(char* protocol, char* kmc_crypto_hostname, uint16_t kmc_crypto_port, + char* kmc_crypto_app, char* kmc_tls_ca_bundle, char* kmc_tls_ca_path, + uint8_t kmc_ignore_ssl_hostname_validation, char* mtls_client_cert_path, + char* mtls_client_cert_type, char* mtls_client_key_path, + char* mtls_client_key_pass, char* mtls_issuer_cert) { int32_t status = CRYPTO_LIB_SUCCESS; cryptography_kmc_crypto_config = (CryptographyKmcCryptoServiceConfig_t* )calloc(1, CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_CONFIG_SIZE); diff --git a/src/src_mysql/sadb_routine_mariadb.template.c b/src/src_mysql/sadb_routine_mariadb.template.c index 05fe58b8..21a9ac7a 100644 --- a/src/src_mysql/sadb_routine_mariadb.template.c +++ b/src/src_mysql/sadb_routine_mariadb.template.c @@ -44,25 +44,25 @@ static int32_t sadb_sa_delete(void); // MySQL local functions static int32_t finish_with_error(MYSQL *con, int err); // MySQL Queries -static const char *SQL_SADB_GET_SA_BY_SPI = +static const char* SQL_SADB_GET_SA_BY_SPI = "SELECT " "spi,ekid,akid,sa_state,tfvn,scid,vcid,mapid,lpid,est,ast,shivf_len,shsnf_len,shplf_len,stmacf_len,ecs_len,HEX(ecs)" ",HEX(iv),acs_len,acs,abm_len,HEX(abm),arc_len,HEX(arc),arcw_len,HEX(arcw)" " FROM security_associations WHERE spi='%d'"; -static const char *SQL_SADB_GET_SA_BY_GVCID = +static const char* SQL_SADB_GET_SA_BY_GVCID = "SELECT " "spi,ekid,akid,sa_state,tfvn,scid,vcid,mapid,lpid,est,ast,shivf_len,shsnf_len,shplf_len,stmacf_len,ecs_len,HEX(ecs)" ",HEX(iv),acs_len,acs,abm_len,HEX(abm),arc_len,HEX(arc),arcw_len,HEX(arcw)" " FROM security_associations WHERE tfvn='%d' AND scid='%d' AND vcid='%d' AND mapid='%d' AND sa_state='%d'"; -static const char *SQL_SADB_UPDATE_IV_ARC_BY_SPI = +static const char* SQL_SADB_UPDATE_IV_ARC_BY_SPI = "UPDATE security_associations" " SET iv=X'%s', arc=X'%s'" " 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 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); +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); /* ** Global Variables @@ -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)); @@ -307,14 +307,14 @@ static int32_t parse_sa_from_mysql_query(char *query, SecurityAssociation_t* *se MYSQL_ROW row; MYSQL_FIELD *field; - char *field_names[num_fields]; //[64]; 64 == max length of column name in MySQL + char* field_names[num_fields]; //[64]; 64 == max length of column name in MySQL // TODO -- Need to store mysql query hex string and then malloc sa->iv according to size. // TODO -- IV && arc && abm as uint8_t* instead of uint8[]!!! - char *iv_byte_str; - char *arc_byte_str; - char *abm_byte_str; - char *ecs_byte_str; + char* iv_byte_str; + char* arc_byte_str; + char* abm_byte_str; + char* ecs_byte_str; while ((row = mysql_fetch_row(result))) { for (int i = 0; i < num_fields; i++) @@ -498,10 +498,10 @@ static int32_t parse_sa_from_mysql_query(char *query, SecurityAssociation_t* *se return status; } -static int32_t convert_hexstring_to_byte_array(char *source_str, uint8_t* dest_buffer) +static int32_t convert_hexstring_to_byte_array(char* source_str, uint8_t* dest_buffer) { // https://stackoverflow.com/questions/3408706/hexadecimal-string-to-byte-array-in-c/56247335#56247335 - char *line = source_str; - char *data = line; + char* line = source_str; + char* data = line; int offset; unsigned int read_byte; uint32_t data_len = 0; @@ -514,15 +514,15 @@ static int32_t convert_hexstring_to_byte_array(char *source_str, uint8_t* dest_b return data_len; } -static char *convert_byte_array_to_hexstring(void* src_buffer, size_t buffer_length) +static char* convert_byte_array_to_hexstring(void* src_buffer, size_t buffer_length) { if (buffer_length == 0) { // Return empty string (with null char!) if buffer is empty return ""; } - unsigned char *bytes = src_buffer; - char *hexstr = malloc(buffer_length * 2 + 1); + unsigned char* bytes = src_buffer; + char* hexstr = malloc(buffer_length * 2 + 1); if (src_buffer == NULL) return NULL; diff --git a/util/include/shared_util.h b/util/include/shared_util.h index 088e1c17..ce2c66b8 100644 --- a/util/include/shared_util.h +++ b/util/include/shared_util.h @@ -33,13 +33,13 @@ extern "C" #include "crypto_error.h" - char *c_read_file(const char *f_name, long *f_size); + char* c_read_file(const char* f_name, long *f_size); - void debug_printf(const char *format, ...); - void debug_hexprintf(const char *bin_data, int size_bin_data); + 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); - int convert_hexstring_to_byte_array(char *source_str, char *dest_buffer); + 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 } /* Close scope of 'extern "C"' declaration which encloses file. */ diff --git a/util/include/utest.h b/util/include/utest.h index f9d57bcd..d54be926 100644 --- a/util/include/utest.h +++ b/util/include/utest.h @@ -321,7 +321,7 @@ typedef void (*utest_testcase_t)(int *, size_t); struct utest_test_state_s { utest_testcase_t func; size_t index; - char *name; + char* name; }; struct utest_state_s { @@ -799,9 +799,9 @@ utest_type_printer(long long unsigned int i) { } \ UTEST_INITIALIZER(utest_register_##SET##_##NAME) { \ const size_t index = utest_state.tests_length++; \ - const char *name_part = #SET "." #NAME; \ + const char* name_part = #SET "." #NAME; \ const size_t name_size = strlen(name_part) + 1; \ - char *name = UTEST_PTR_CAST(char *, malloc(name_size)); \ + char* name = UTEST_PTR_CAST(char* , malloc(name_size)); \ utest_state.tests = UTEST_PTR_CAST( \ struct utest_test_state_s *, \ utest_realloc(UTEST_PTR_CAST(void* , utest_state.tests), \ @@ -841,9 +841,9 @@ utest_type_printer(long long unsigned int i) { } \ UTEST_INITIALIZER(utest_register_##FIXTURE##_##NAME) { \ const size_t index = utest_state.tests_length++; \ - const char *name_part = #FIXTURE "." #NAME; \ + const char* name_part = #FIXTURE "." #NAME; \ const size_t name_size = strlen(name_part) + 1; \ - char *name = UTEST_PTR_CAST(char *, malloc(name_size)); \ + char* name = UTEST_PTR_CAST(char* , malloc(name_size)); \ utest_state.tests = UTEST_PTR_CAST( \ struct utest_test_state_s *, \ utest_realloc(UTEST_PTR_CAST(void* , utest_state.tests), \ @@ -883,9 +883,9 @@ utest_type_printer(long long unsigned int i) { utest_uint64_t iUp; \ for (i = 0; i < (INDEX); i++) { \ const size_t index = utest_state.tests_length++; \ - const char *name_part = #FIXTURE "." #NAME; \ + const char* name_part = #FIXTURE "." #NAME; \ const size_t name_size = strlen(name_part) + 32; \ - char *name = UTEST_PTR_CAST(char *, malloc(name_size)); \ + char* name = UTEST_PTR_CAST(char* , malloc(name_size)); \ utest_state.tests = UTEST_PTR_CAST( \ struct utest_test_state_s *, \ utest_realloc(UTEST_PTR_CAST(void* , utest_state.tests), \ @@ -902,13 +902,13 @@ utest_type_printer(long long unsigned int i) { struct FIXTURE *utest_fixture) UTEST_WEAK -int utest_should_filter_test(const char *filter, const char *testcase); -UTEST_WEAK int utest_should_filter_test(const char *filter, - const char *testcase) { +int utest_should_filter_test(const char* filter, const char* testcase); +UTEST_WEAK int utest_should_filter_test(const char* filter, + const char* testcase) { if (filter) { - const char *filter_cur = filter; - const char *testcase_cur = testcase; - const char *filter_wildcard = UTEST_NULL; + const char* filter_cur = filter; + const char* testcase_cur = testcase; + const char* filter_wildcard = UTEST_NULL; while (('\0' != *filter_cur) && ('\0' != *testcase_cur)) { if ('*' == *filter_cur) { @@ -969,7 +969,7 @@ UTEST_WEAK int utest_should_filter_test(const char *filter, return 0; } -static UTEST_INLINE FILE *utest_fopen(const char *filename, const char *mode) { +static UTEST_INLINE FILE *utest_fopen(const char* filename, const char* mode) { #ifdef _MSC_VER FILE *file; if (0 == fopen_s(&file, filename, mode)) { @@ -982,19 +982,19 @@ static UTEST_INLINE FILE *utest_fopen(const char *filename, const char *mode) { #endif } -static UTEST_INLINE int utest_main(int argc, const char *const argv[]); -int utest_main(int argc, const char *const argv[]) { +static UTEST_INLINE int utest_main(int argc, const char* const argv[]); +int utest_main(int argc, const char* const argv[]) { utest_uint64_t failed = 0; size_t index = 0; size_t* failed_testcases = UTEST_NULL; size_t failed_testcases_length = 0; - const char *filter = UTEST_NULL; + const char* filter = UTEST_NULL; utest_uint64_t ran_tests = 0; enum colours { U_RESET, U_GREEN, U_RED }; const int use_colours = UTEST_COLOUR_OUTPUT(); - const char *colours[] = {"\033[0m", "\033[32m", "\033[31m"}; + const char* colours[] = {"\033[0m", "\033[32m", "\033[31m"}; if (!use_colours) { for (index = 0; index < sizeof colours / sizeof colours[0]; index++) { @@ -1149,7 +1149,7 @@ int utest_main(int argc, const char *const argv[]) { */ #define UTEST_MAIN() \ UTEST_STATE(); \ - int main(int argc, const char *const argv[]) { \ + int main(int argc, const char* const argv[]) { \ return utest_main(argc, argv); \ } diff --git a/util/src_util/apply_security.c b/util/src_util/apply_security.c index 6be8a7a0..ec8c4d23 100644 --- a/util/src_util/apply_security.c +++ b/util/src_util/apply_security.c @@ -23,13 +23,13 @@ #include "apply_security.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - char *buffer = NULL; - const char *filename; + char* buffer = NULL; + const char* filename; long buffer_size; char st[64]; - char *security_type = st; + char* security_type = st; if (argc == 3) { diff --git a/util/src_util/crypto_sequence.c b/util/src_util/crypto_sequence.c index c8150e38..c1b0695a 100644 --- a/util/src_util/crypto_sequence.c +++ b/util/src_util/crypto_sequence.c @@ -22,12 +22,12 @@ #include "crypto_sequence.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - char *buffer; - const char *filename; + char* buffer; + const char* filename; long buffer_size; - char *security_type; + char* security_type; if (argc < 3 || argc % 2 == 0) { diff --git a/util/src_util/et_dt_validation.c b/util/src_util/et_dt_validation.c index 2712ef9c..e3a808f1 100644 --- a/util/src_util/et_dt_validation.c +++ b/util/src_util/et_dt_validation.c @@ -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(); @@ -96,7 +96,7 @@ void python_cmac(char *data, char *key, uint8_t* *expected, long *expected_lengt long temp_length = PyLong_AsLong(pValue); *expected_length = temp_length; pValue = PyObject_CallMethod(pInstance, "get_results", NULL); - char *temp_expected = PyBytes_AsString(pValue); + char* temp_expected = PyBytes_AsString(pValue); *expected = (uint8_t* )malloc(sizeof(uint8_t) * (int)*expected_length); memcpy(*expected, temp_expected, (int)*expected_length); return; @@ -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(); @@ -127,7 +127,7 @@ void python_auth_encryption(char *data, char *key, char *iv, char *header, char long temp_length = PyLong_AsLong(pValue); *expected_length = temp_length; pValue = PyObject_CallMethod(pInstance, "get_results", NULL); - char *temp_expected = PyBytes_AsString(pValue); + char* temp_expected = PyBytes_AsString(pValue); *expected = (uint8_t* )malloc(sizeof(uint8_t) * (int)*expected_length); memcpy(*expected, temp_expected, (int)*expected_length); return; @@ -149,14 +149,14 @@ UTEST(ET_VALIDATION, AUTH_ENCRYPTION_TEST) uint8_t* expected = NULL; long expected_length = 0; - char *activate_sa4_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; - char *enc_test_ping_h = "2003041600ff1880d2ca0008197f0b0031000039c5082d"; + char* activate_sa4_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; + char* enc_test_ping_h = "2003041600ff1880d2ca0008197f0b0031000039c5082d"; 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)); @@ -229,17 +229,17 @@ UTEST(DT_VALIDATION, AUTH_DECRYPTION_TEST) Crypto_Init_Unit_Test(); SadbRoutine sadb_routine = get_sadb_routine_inmemory(); - char *activate_sa4_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; - char *dec_test_ping_h = + char* activate_sa4_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; + char* dec_test_ping_h = "2003043400FF00040000000000000000000000017E1D8EEA8D45CEBA17888E0CDCD747DC78E5F372F997F2A63AA5DFC168395DC987"; - char *enc_test_ping_h = "1880d2ca0008197f0b0031000039c5"; + char* enc_test_ping_h = "1880d2ca0008197f0b0031000039c5"; 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)); @@ -327,10 +327,10 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "ef9f9284cf599eac3b119905a7d18851e7e374cf63aea04358586b0f757670f8"; - char *buffer_nist_pt_h = "2003001600722ee47da4b77424733546c2d400c4e567a8"; - char *buffer_nist_iv_h = "b6ac8e4963f49207ffd6374c"; - char *buffer_nist_ct_h = "1224dfefb72a20d49e09256908874979"; + char* buffer_nist_key_h = "ef9f9284cf599eac3b119905a7d18851e7e374cf63aea04358586b0f757670f8"; + char* buffer_nist_pt_h = "2003001600722ee47da4b77424733546c2d400c4e567a8"; + char* buffer_nist_iv_h = "b6ac8e4963f49207ffd6374c"; + char* buffer_nist_ct_h = "1224dfefb72a20d49e09256908874979"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_ct_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_ct_len, buffer_nist_key_len = 0; @@ -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) @@ -401,10 +401,10 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "ef9f9284cf599eac3b119905a7d18851e7e374cf63aea04358586b0f757670f8"; - char *buffer_nist_pt_h = "2003001600722ee47da4b77424733546c2d400c4e567a8"; - char *buffer_nist_iv_h = "b6ac8e4963f49207ffd6374c"; - char *buffer_nist_et_h = "2003002500FF0009B6AC8E4963F49207FFD6374C1224DFEFB72A20D49E09256908874979AD6F"; + char* buffer_nist_key_h = "ef9f9284cf599eac3b119905a7d18851e7e374cf63aea04358586b0f757670f8"; + char* buffer_nist_pt_h = "2003001600722ee47da4b77424733546c2d400c4e567a8"; + char* buffer_nist_iv_h = "b6ac8e4963f49207ffd6374c"; + char* buffer_nist_et_h = "2003002500FF0009B6AC8E4963F49207FFD6374C1224DFEFB72A20D49E09256908874979AD6F"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_et_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_et_len, buffer_nist_key_len = 0; @@ -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); @@ -478,10 +478,10 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) crypto_key_t* ek_ring = cryptography_if->get_ek_ring(); // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "e9ccd6eef27f740d1d5c70b187734e11e76a8ac0ad1702ff02180c5c1c9e5399"; - char *buffer_nist_pt_h = "2003001600419635e6e12b257a8ecae411f94480ff56be"; - char *buffer_nist_iv_h = "1af2613c4184dbd101fcedce"; - char *buffer_nist_ct_h = "9cd21f414f1f54d5f6f58b1f2f77e5b6"; + char* buffer_nist_key_h = "e9ccd6eef27f740d1d5c70b187734e11e76a8ac0ad1702ff02180c5c1c9e5399"; + char* buffer_nist_pt_h = "2003001600419635e6e12b257a8ecae411f94480ff56be"; + char* buffer_nist_iv_h = "1af2613c4184dbd101fcedce"; + char* buffer_nist_ct_h = "9cd21f414f1f54d5f6f58b1f2f77e5b6"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_ct_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_ct_len, buffer_nist_key_len = 0; @@ -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) @@ -549,10 +549,10 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) crypto_key_t* ek_ring = cryptography_if->get_ek_ring(); // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "e9ccd6eef27f740d1d5c70b187734e11e76a8ac0ad1702ff02180c5c1c9e5399"; - char *buffer_nist_pt_h = "2003001600419635e6e12b257a8ecae411f94480ff56be"; - char *buffer_nist_iv_h = "1af2613c4184dbd101fcedce"; - char *buffer_nist_et_h = "2003002500FF00091AF2613C4184DBD101FCEDCE9CD21F414F1F54D5F6F58B1F2F77E5B66987"; + char* buffer_nist_key_h = "e9ccd6eef27f740d1d5c70b187734e11e76a8ac0ad1702ff02180c5c1c9e5399"; + char* buffer_nist_pt_h = "2003001600419635e6e12b257a8ecae411f94480ff56be"; + char* buffer_nist_iv_h = "1af2613c4184dbd101fcedce"; + char* buffer_nist_et_h = "2003002500FF00091AF2613C4184DBD101FCEDCE9CD21F414F1F54D5F6F58B1F2F77E5B66987"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_et_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_et_len, buffer_nist_key_len = 0; @@ -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; @@ -627,10 +627,10 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_2) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "7ecc9dcb3d5b413cadc3af7b7812758bd869295f8aaf611ba9935de76bd87013"; - char *buffer_nist_pt_h = "200300160073d4d7984ce422ac983797c0526ac6f9446b"; - char *buffer_nist_iv_h = "6805be41e983717bf6781052"; - char *buffer_nist_ct_h = "487211dd440f4d09d00bc5c3158a822c"; + char* buffer_nist_key_h = "7ecc9dcb3d5b413cadc3af7b7812758bd869295f8aaf611ba9935de76bd87013"; + char* buffer_nist_pt_h = "200300160073d4d7984ce422ac983797c0526ac6f9446b"; + char* buffer_nist_iv_h = "6805be41e983717bf6781052"; + char* buffer_nist_ct_h = "487211dd440f4d09d00bc5c3158a822c"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_ct_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_ct_len, buffer_nist_key_len = 0; @@ -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) @@ -699,10 +699,10 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_2) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "7ecc9dcb3d5b413cadc3af7b7812758bd869295f8aaf611ba9935de76bd87013"; - char *buffer_nist_pt_h = "200300160073d4d7984ce422ac983797c0526ac6f9446b"; - char *buffer_nist_iv_h = "6805be41e983717bf6781052"; - char *buffer_nist_et_h = "2003002500FF00096805BE41E983717BF6781052487211DD440F4D09D00BC5C3158A822C46E3"; + char* buffer_nist_key_h = "7ecc9dcb3d5b413cadc3af7b7812758bd869295f8aaf611ba9935de76bd87013"; + char* buffer_nist_pt_h = "200300160073d4d7984ce422ac983797c0526ac6f9446b"; + char* buffer_nist_iv_h = "6805be41e983717bf6781052"; + char* buffer_nist_et_h = "2003002500FF00096805BE41E983717BF6781052487211DD440F4D09D00BC5C3158A822C46E3"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_et_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_et_len, buffer_nist_key_len = 0; @@ -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); @@ -774,10 +774,10 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_3) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "a881373e248615e3d6576f5a5fb68883515ae72d6a2938e3a6f0b8dcb639c9c0"; - char *buffer_nist_pt_h = "200300160007d1dc9930e710b1ebe533c81f671101e43c"; - char *buffer_nist_iv_h = "f0b744f157087df4e41818a9"; - char *buffer_nist_ct_h = "b65a2878b9dddbd4a0204dae6a6a6fc0"; + char* buffer_nist_key_h = "a881373e248615e3d6576f5a5fb68883515ae72d6a2938e3a6f0b8dcb639c9c0"; + char* buffer_nist_pt_h = "200300160007d1dc9930e710b1ebe533c81f671101e43c"; + char* buffer_nist_iv_h = "f0b744f157087df4e41818a9"; + char* buffer_nist_ct_h = "b65a2878b9dddbd4a0204dae6a6a6fc0"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_ct_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_ct_len, buffer_nist_key_len = 0; @@ -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) @@ -846,10 +846,10 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_3) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "a881373e248615e3d6576f5a5fb68883515ae72d6a2938e3a6f0b8dcb639c9c0"; - char *buffer_nist_pt_h = "200300160007d1dc9930e710b1ebe533c81f671101e43c"; - char *buffer_nist_iv_h = "f0b744f157087df4e41818a9"; - char *buffer_nist_et_h = "2003002500FF0009F0B744F157087DF4E41818A9B65A2878B9DDDBD4A0204DAE6A6A6FC0C327"; + char* buffer_nist_key_h = "a881373e248615e3d6576f5a5fb68883515ae72d6a2938e3a6f0b8dcb639c9c0"; + char* buffer_nist_pt_h = "200300160007d1dc9930e710b1ebe533c81f671101e43c"; + char* buffer_nist_iv_h = "f0b744f157087df4e41818a9"; + char* buffer_nist_et_h = "2003002500FF0009F0B744F157087DF4E41818A9B65A2878B9DDDBD4A0204DAE6A6A6FC0C327"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_et_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_et_len, buffer_nist_key_len = 0; @@ -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); @@ -921,10 +921,10 @@ UTEST(NIST_ENC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_4) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "84c90349539c2a7989cb24dfae5e4182382ae94ba717d385977017f74f0d87d6"; - char *buffer_nist_pt_h = "200300160031c4e1d0ccece6b7a999bfc31f38559af5dd"; - char *buffer_nist_iv_h = "eeddeaf4355c826dfd153393"; - char *buffer_nist_ct_h = "5c6cfbdd06c19445ecf500c21aeca173"; + char* buffer_nist_key_h = "84c90349539c2a7989cb24dfae5e4182382ae94ba717d385977017f74f0d87d6"; + char* buffer_nist_pt_h = "200300160031c4e1d0ccece6b7a999bfc31f38559af5dd"; + char* buffer_nist_iv_h = "eeddeaf4355c826dfd153393"; + char* buffer_nist_ct_h = "5c6cfbdd06c19445ecf500c21aeca173"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_ct_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_ct_len, buffer_nist_key_len = 0; @@ -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) @@ -993,10 +993,10 @@ UTEST(NIST_DEC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_4) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "84c90349539c2a7989cb24dfae5e4182382ae94ba717d385977017f74f0d87d6"; - char *buffer_nist_pt_h = "200300160031c4e1d0ccece6b7a999bfc31f38559af5dd"; - char *buffer_nist_iv_h = "eeddeaf4355c826dfd153393"; - char *buffer_nist_et_h = "2003002500FF0009EEDDEAF4355C826DFD1533935C6CFBDD06C19445ECF500C21AECA1738A7D"; + char* buffer_nist_key_h = "84c90349539c2a7989cb24dfae5e4182382ae94ba717d385977017f74f0d87d6"; + char* buffer_nist_pt_h = "200300160031c4e1d0ccece6b7a999bfc31f38559af5dd"; + char* buffer_nist_iv_h = "eeddeaf4355c826dfd153393"; + char* buffer_nist_et_h = "2003002500FF0009EEDDEAF4355C826DFD1533935C6CFBDD06C19445ECF500C21AECA1738A7D"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_et_b, *buffer_nist_key_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_et_len, buffer_nist_key_len = 0; @@ -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); @@ -1079,11 +1079,11 @@ UTEST(NIST_ENC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; - char *buffer_nist_pt_h = "200300060028C2"; // Empty Transfer frame - char *buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; - char *buffer_nist_aad_h = "b96baa8c1c75a671bfb2d08d06be5f36"; // Zeroed out by abm - char *buffer_cyber_chef_mac_h = "77e98911a1704df3d9745bc7b97cc66d"; + char* buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; + char* buffer_nist_pt_h = "200300060028C2"; // Empty Transfer frame + char* buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; + char* buffer_nist_aad_h = "b96baa8c1c75a671bfb2d08d06be5f36"; // Zeroed out by abm + char* buffer_cyber_chef_mac_h = "77e98911a1704df3d9745bc7b97cc66d"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_key_b, *buffer_nist_aad_b, *buffer_cyber_chef_mac_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_key_len, buffer_nist_aad_len, buffer_cyber_chef_mac_len = 0; @@ -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) @@ -1166,10 +1166,10 @@ UTEST(NIST_ENC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; - char *buffer_nist_pt_h = "200300060028C2"; // Empty Transfer frame - char *buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; - char *buffer_cyber_chef_mac_h = "629c2143c30e2f8450b059cd559a7102"; + char* buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; + char* buffer_nist_pt_h = "200300060028C2"; // Empty Transfer frame + char* buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; + char* buffer_cyber_chef_mac_h = "629c2143c30e2f8450b059cd559a7102"; uint8_t* buffer_nist_pt_b, *buffer_nist_iv_b, *buffer_nist_key_b, *buffer_cyber_chef_mac_b = NULL; int buffer_nist_pt_len, buffer_nist_iv_len, buffer_nist_key_len, buffer_cyber_chef_mac_len = 0; @@ -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); @@ -1247,14 +1247,14 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0) crypto_key_t* ek_ring = cryptography_if->get_ek_ring(); // NIST supplied vectors - char *buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; - char *buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; - char *buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; - char *buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; + char* buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; + char* buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; + char* buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; + char* buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; // Create a MAC'd frame by adding our headers and a fecf // | Header | SPI | iv | plaintext | mac |fecf| - char *buffer_nist_mac_frame_h = + char* buffer_nist_mac_frame_h = "2003003500FF0009D79CF22D504CC793C3FB6C8A722ee47da4b77424733546c2d400c4e534d0e323f5e4b80426401d4aa37930daf55f"; uint8_t* buffer_nist_iv_b, *buffer_nist_pt_b, *buffer_nist_key_b, *buffer_cyber_chef_mac_b, @@ -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); @@ -1372,15 +1372,15 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0_BAD_DATA) crypto_key_t* ek_ring = cryptography_if->get_ek_ring(); // NIST supplied vectors - char *buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; - char *buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; - // char *buffer_cyber_chef_mac_h = "99eff39be8327e6950f03a329209d577"; - char *buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; - char *buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; + char* buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; + char* buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; + // char* buffer_cyber_chef_mac_h = "99eff39be8327e6950f03a329209d577"; + char* buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; + char* buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; // Create a MAC'd frame by adding our headers and a fecf // | Header | SPI | iv | plaintext | mac |fecf| - char *buffer_nist_mac_frame_h = + char* buffer_nist_mac_frame_h = "2003003500FF0009D79CF22D504CC793C3FB6C8A722ee47da4b77424733546c2d400c40034d0e323f5e4b80426401d4aa37930da123b"; uint8_t* buffer_nist_iv_b, *buffer_nist_pt_b, *buffer_nist_key_b, *buffer_cyber_chef_mac_b, @@ -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); @@ -1473,15 +1473,15 @@ UTEST(NIST_DEC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_0_BAD_MAC) crypto_key_t* ek_ring = cryptography_if->get_ek_ring(); // NIST supplied vectors - char *buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; - char *buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; - // char *buffer_cyber_chef_mac_h = "99eff39be8327e6950f03a329209d577"; - char *buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; - char *buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; + char* buffer_nist_key_h = "78dc4e0aaf52d935c3c01eea57428f00ca1fd475f5da86a49c8dd73d68c8e223"; + char* buffer_nist_iv_h = "d79cf22d504cc793c3fb6c8a"; + // char* buffer_cyber_chef_mac_h = "99eff39be8327e6950f03a329209d577"; + char* buffer_cyber_chef_mac_h = "34d0e323f5e4b80426401d4aa37930da"; + char* buffer_nist_pt_h = "722ee47da4b77424733546c2d400c4e5"; // Create a MAC'd frame by adding our headers and a fecf // | Header | SPI | iv | plaintext | mac |fecf| - char *buffer_nist_mac_frame_h = + char* buffer_nist_mac_frame_h = "2003003500FF0009D79CF22D504CC793C3FB6C8A722ee47da4b77424733546c2d400c4e534d0e323f5e4b80426401d4aa37930009f68"; uint8_t* buffer_nist_iv_b, *buffer_nist_pt_b, *buffer_nist_key_b, *buffer_cyber_chef_mac_b, @@ -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); @@ -1576,9 +1576,9 @@ UTEST(NIST_ENC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_0) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; + char* buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; // | Header | NIST CMAC Test Vector |FECF| - char *buffer_frame_pt_h = "2003004600C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258C925"; + char* buffer_frame_pt_h = "2003004600C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258C925"; // Python truth string passed below is ZEROed out, not including a MAC or FECF which isn't hashed against, but the LENGTH (including fecf) needs to be updated in the Tf Header // Length is dependent on whatever the variable mac length to be updated in the header // | Header |SPI| ARSN | NIST CMAC Frame Data | @@ -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); @@ -1664,13 +1664,13 @@ UTEST(NIST_ENC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_1) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; + char* buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; // | Header | NIST CMAC Test Vector |FECF| - char *buffer_frame_pt_h = "2003004600C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258C925"; + char* buffer_frame_pt_h = "2003004600C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258C925"; // Python truth string passed below, not including a MAC or FECF which isn't hashed against, but the LENGTH (including fecf) needs to be updated in the Tf Header // Length is dependent on whatevr the variable mac length to be updated in the header // | Header |SPI| ARSN | NIST CMAC Frame Data | - // char *buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; + // char* buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; // 2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258CF549CC15D63EAB7AD25EB3089D94E6C2D9D // Python output MAC char* buffer_python_mac_h = "cf549cc15d63eab7ad25eb3089d94e6c"; @@ -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); @@ -1749,13 +1749,13 @@ UTEST(NIST_DEC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_0) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; + char* buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; // | Header |SPI| ARSN | NIST CMAC Test Vector | MAC |FECF| - char *buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F193942587629961f6b92145290ad3e149940511a46ce"; + char* buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F193942587629961f6b92145290ad3e149940511a46ce"; // Python truth string passed below, not including a MAC or FECF which isn't hashed against, but the LENGTH (including fecf) needs to be updated in the Tf Header // Length is dependent on whatevr the variable mac length to be updated in the header // | Header |SPI| ARSN | NIST CMAC Frame Data | - // char *buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; + // char* buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; // 2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258CF549CC15D63EAB7AD25EB3089D94E6C2D9D // Zeroed out w. bitmask 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 // Python output MAC @@ -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); @@ -1840,13 +1840,13 @@ UTEST(NIST_DEC_CMAC_VALIDATION, AES_CMAC_256_PT_128_TEST_1) // NIST supplied vectors // NOTE: Added Transfer Frame header to the plaintext - char *buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; + char* buffer_nist_key_h = "b228c753292acd5df351000a591bf960d8555c3f6284afe7c6846cbb6c6f5445"; // | Header |SPI| ARSN | NIST CMAC Test Vector | MAC |FECF| - char *buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258CF549CC15D63EAB7AD25EB3089D94E6C2D9D"; + char* buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258CF549CC15D63EAB7AD25EB3089D94E6C2D9D"; // Python truth string passed below, not including a MAC or FECF which isn't hashed against, but the LENGTH (including fecf) needs to be updated in the Tf Header // Length is dependent on whatevr the variable mac length to be updated in the header // | Header |SPI| ARSN | NIST CMAC Frame Data | - // char *buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; + // char* buffer_frame_pt_h = "2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258"; // 2003005C00000900000000C66D322247EBF272E6A353F9940B00847CF78E27F2BC0C81A696DB411E47C0E9630137D3FA860A71158E23D80B699E8006E52345FB7273B2E084407F19394258CF549CC15D63EAB7AD25EB3089D94E6C2D9D // Python output MAC char* buffer_python_mac_h = "cf549cc15d63eab7ad25eb3089d94e6c"; @@ -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); diff --git a/util/src_util/process_security.c b/util/src_util/process_security.c index b173aba8..56fe9ab5 100644 --- a/util/src_util/process_security.c +++ b/util/src_util/process_security.c @@ -23,12 +23,12 @@ #include "process_security.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - char *buffer; - const char *filename; + char* buffer; + const char* filename; long buffer_size; - char *security_type; + char* security_type; if (argc == 3) { diff --git a/util/src_util/ut_crypto.c b/util/src_util/ut_crypto.c index 2fcba819..ff5d6dcf 100644 --- a/util/src_util/ut_crypto.c +++ b/util/src_util/ut_crypto.c @@ -30,12 +30,12 @@ **/ UTEST(CRYPTO_C, CALC_CRC16) { - char *data_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95e"; + char* data_h = "2003002000ff000100001880d2c9000e197f0b001b0004000400003040d95e"; uint8_t* data_b = NULL; int data_b_len = 0; Crypto_Init_Unit_Test(); - hex_conversion(data_h, (char **)&data_b, &data_b_len); + hex_conversion(data_h, (char**) &data_b, &data_b_len); int size = 31; uint16_t crc = 0x00; @@ -58,8 +58,8 @@ UTEST(CRYPTO_C, BAD_CC_FLAG) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x0003, 0, TC_NO_FECF, TC_NO_SEGMENT_HDRS); Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x0003, 1, TC_NO_FECF, TC_NO_SEGMENT_HDRS); Crypto_Init(); - char *raw_tc_sdls_ping_h = "3003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "3003002000ff000100001880d2c9000e197f0b001b0004000400003040d95ea61a"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; hex_conversion(raw_tc_sdls_ping_h, &raw_tc_sdls_ping_b, &raw_tc_sdls_ping_len); diff --git a/util/src_util/ut_crypto_config.c b/util/src_util/ut_crypto_config.c index 52bd98e2..5e22459a 100644 --- a/util/src_util/ut_crypto_config.c +++ b/util/src_util/ut_crypto_config.c @@ -175,14 +175,14 @@ UTEST(CRYPTO_CONFIG, CRYPTO_CONFIG_KMC) char* hostname = "ITC_JPL"; int16_t port = 9999; - char *kmc_crypto_app_uri = "crypto-service"; - char *mtls_client_cert_path = "/dev/null"; - char *mtls_client_cert_type = "PEM"; - char *mtls_client_key_path = "/dev/null"; - char *mtls_client_key_pass = "12345"; - char *mtls_ca_bundle = "/dev/null"; - char *mtls_ca_path = "/dev/null"; - char *mtls_issuer_cert = "/dev/null"; + char* kmc_crypto_app_uri = "crypto-service"; + char* mtls_client_cert_path = "/dev/null"; + char* mtls_client_cert_type = "PEM"; + char* mtls_client_key_path = "/dev/null"; + char* mtls_client_key_pass = "12345"; + char* mtls_ca_bundle = "/dev/null"; + char* mtls_ca_path = "/dev/null"; + char* mtls_issuer_cert = "/dev/null"; uint8_t ignore_ssl_hostname_validation = CRYPTO_TRUE; status = Crypto_Config_Kmc_Crypto_Service(protocol, hostname, port, kmc_crypto_app_uri, mtls_ca_bundle, diff --git a/util/src_util/ut_kmc_crypto.c b/util/src_util/ut_kmc_crypto.c index 33aa7607..1cff3bfd 100644 --- a/util/src_util/ut_kmc_crypto.c +++ b/util/src_util/ut_kmc_crypto.c @@ -51,8 +51,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); @@ -102,8 +102,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH) // Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); // int32_t status = Crypto_Init(); // -// char *raw_tc_jpl_mmt_scid44_vcid1= "202c0808000001361c"; -// char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; +// char* raw_tc_jpl_mmt_scid44_vcid1= "202c0808000001361c"; +// char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; // int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; // // hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); @@ -158,8 +158,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_AUTH_ONLY) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c0C08000001bf1a"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c0C08000001bf1a"; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); @@ -215,8 +215,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_ENC_AND_AUTH) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *enc_tc_jpl_mmt_scid44_vcid1= "202C0426000002000000000000000000000001669C5639DCCFEA8C6CE33230EE2E7065496367CC"; - char *enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* enc_tc_jpl_mmt_scid44_vcid1= "202C0426000002000000000000000000000001669C5639DCCFEA8C6CE33230EE2E7065496367CC"; + char* enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; int enc_tc_jpl_mmt_scid44_vcid1_expect_len = 0; // Data=0001 @@ -275,8 +275,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_ENC_AND_AUTH) // Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); // int32_t status = Crypto_Init(); // -// char *enc_tc_jpl_mmt_scid44_vcid1= "202C0816000003000000000000000000000001669CD238"; -// char *enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; +// char* enc_tc_jpl_mmt_scid44_vcid1= "202C0816000003000000000000000000000001669CD238"; +// char* enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; // int enc_tc_jpl_mmt_scid44_vcid1_expect_len = 0; // // // IV = 000000000000000000000001 @@ -341,8 +341,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_AUTH_ONLY) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *enc_tc_jpl_mmt_scid44_vcid1= "202C0C2600000400000000000000000000000100016E2051F96CAB186BCE364A65AF599AE52F38"; - char *enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* enc_tc_jpl_mmt_scid44_vcid1= "202C0C2600000400000000000000000000000100016E2051F96CAB186BCE364A65AF599AE52F38"; + char* enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; int enc_tc_jpl_mmt_scid44_vcid1_expect_len = 0; // Data=0001 diff --git a/util/src_util/ut_kmc_crypto_aes_cmac.c b/util/src_util/ut_kmc_crypto_aes_cmac.c index 248168e4..adf7a925 100644 --- a/util/src_util/ut_kmc_crypto_aes_cmac.c +++ b/util/src_util/ut_kmc_crypto_aes_cmac.c @@ -48,9 +48,9 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_CMAC_AUTH_ONLY) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c1c08000001bb40"; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c1c08000001bb40"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); @@ -103,9 +103,9 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_CMAC_AUTH_ONLY) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - // char *enc_tc_jpl_mmt_scid44_vcid1= "202C1C1A0000050001C50827915AEB423F054402D5DC3C67566986"; // Returns CRYPTO_LIB_ERR_INVALID_HEADER since SN/ARC missing from header - char *enc_tc_jpl_mmt_scid44_vcid1= "202C1C1E000005000000050001C7BA93010000000000000000000000007ACC"; - char *enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; + // char* enc_tc_jpl_mmt_scid44_vcid1= "202C1C1A0000050001C50827915AEB423F054402D5DC3C67566986"; // Returns CRYPTO_LIB_ERR_INVALID_HEADER since SN/ARC missing from header + char* enc_tc_jpl_mmt_scid44_vcid1= "202C1C1E000005000000050001C7BA93010000000000000000000000007ACC"; + char* enc_tc_jpl_mmt_scid44_vcid1_expect = NULL; int enc_tc_jpl_mmt_scid44_vcid1_expect_len = 0; // Data=0001 @@ -165,9 +165,9 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_CMAC_LARGE_FRM_AUTH_ONLY) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c1f0700a6ec42999902579dac3a5af6aabe93288e18d5d4046e24cc5df1f8fa06bac515206d5b0dfcc9861db694f3207175b725bfa6e987fadc1e1e417bff0c30a90b143ca737f2fcf02525c6080c38fde4d4da229387339f363ccdabf42a1defa29f711926c8e0a7479e082ec00b495ae53c8e33b5dc001833aa1d909b4b3aecd60bc6b0af62e8febb58fa15979a5d1e37b9ba48d6d1bf4b9d669306375d7f93942908e410492d6535c91245abbb98a0584aa764815bfdcab44d8c0aeff3a2e2c712649497f95e9440bb1b562cb6fa70a5ff5e5fdbcad40a97fa3bf48f0560bc9c7125b758f25a27678996e5ee3a82a5b864672b80888c2d469fe690aca0501d0de3bec247825f3fbd7f51184f8099dd2ffeb140c9aad86ae8ade912eadbcbef0bb821e684366a084f8d65bd9d0acccfae5fb130d8bf27ff855cea8de4a4e249e5bc8ef9732c06d6d578574b9f936ae1837a61369a7871612337df2dc091dadc8386e53aba816f3a162b71c268e07583a0378805a1f435bf437c0e27193cee4b653273d965fc0b42cfd3c094e2ff89f276153d452814ff016bfcc1b5ec313667de1aaddeb2d31dcaa75f88e4ac758556c7a632374089c53852601385c89aa668b70fd735e9053473538614408241ac47f6ef12aff10c2bce36df6afe7610a5a06997680b579953888684543b7cdefc7cc5987459a9255d187c8790284ad1f2ca38a3a3d56d909a03af87f3788e00d1b9887296ea5ff4087306569c2a3581189a70892e01279812151fdb9f8ec71786edd9cddd8652558503aac1904cf542aeebf269b08c5f648145b498be842080ccbdfe14c8cad1f371e706c0c4ed27d963e2e645224510e7d43ddf50daf8225f484ec841c9e642e489bd70fdbc925c532ab988d0f3999e3e1bdc88d5b0dd61e2b8d72a4a994f3efdc19382cdffdb96ea55ee5a389b003fc91ebc493c0949f56dc7b4b6d69d10dbc937f3757fb36b9000bf67d049c9c768a586b14b5166bffb41fc29c1d5613f2aaa2868fd974a95a3461b0c1c0f1ca87eccf7624fd1ffbe2f45463505b649a0b32410182731dfbe23813e88c3b6bdec7e"; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c1f0700a6ec42999902579dac3a5af6aabe93288e18d5d4046e24cc5df1f8fa06bac515206d5b0dfcc9861db694f3207175b725bfa6e987fadc1e1e417bff0c30a90b143ca737f2fcf02525c6080c38fde4d4da229387339f363ccdabf42a1defa29f711926c8e0a7479e082ec00b495ae53c8e33b5dc001833aa1d909b4b3aecd60bc6b0af62e8febb58fa15979a5d1e37b9ba48d6d1bf4b9d669306375d7f93942908e410492d6535c91245abbb98a0584aa764815bfdcab44d8c0aeff3a2e2c712649497f95e9440bb1b562cb6fa70a5ff5e5fdbcad40a97fa3bf48f0560bc9c7125b758f25a27678996e5ee3a82a5b864672b80888c2d469fe690aca0501d0de3bec247825f3fbd7f51184f8099dd2ffeb140c9aad86ae8ade912eadbcbef0bb821e684366a084f8d65bd9d0acccfae5fb130d8bf27ff855cea8de4a4e249e5bc8ef9732c06d6d578574b9f936ae1837a61369a7871612337df2dc091dadc8386e53aba816f3a162b71c268e07583a0378805a1f435bf437c0e27193cee4b653273d965fc0b42cfd3c094e2ff89f276153d452814ff016bfcc1b5ec313667de1aaddeb2d31dcaa75f88e4ac758556c7a632374089c53852601385c89aa668b70fd735e9053473538614408241ac47f6ef12aff10c2bce36df6afe7610a5a06997680b579953888684543b7cdefc7cc5987459a9255d187c8790284ad1f2ca38a3a3d56d909a03af87f3788e00d1b9887296ea5ff4087306569c2a3581189a70892e01279812151fdb9f8ec71786edd9cddd8652558503aac1904cf542aeebf269b08c5f648145b498be842080ccbdfe14c8cad1f371e706c0c4ed27d963e2e645224510e7d43ddf50daf8225f484ec841c9e642e489bd70fdbc925c532ab988d0f3999e3e1bdc88d5b0dd61e2b8d72a4a994f3efdc19382cdffdb96ea55ee5a389b003fc91ebc493c0949f56dc7b4b6d69d10dbc937f3757fb36b9000bf67d049c9c768a586b14b5166bffb41fc29c1d5613f2aaa2868fd974a95a3461b0c1c0f1ca87eccf7624fd1ffbe2f45463505b649a0b32410182731dfbe23813e88c3b6bdec7e"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); diff --git a/util/src_util/ut_kmc_crypto_with_mtls_sadb.c b/util/src_util/ut_kmc_crypto_with_mtls_sadb.c index 981340b1..36cf2cf4 100644 --- a/util/src_util/ut_kmc_crypto_with_mtls_sadb.c +++ b/util/src_util/ut_kmc_crypto_with_mtls_sadb.c @@ -45,8 +45,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH_MTLS) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); @@ -93,8 +93,8 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH_TLS) Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 3, TC_HAS_FECF, TC_NO_SEGMENT_HDRS); int32_t status = Crypto_Init(); - char *raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; - char *raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; + char* raw_tc_jpl_mmt_scid44_vcid1= "202c0408000001bd37"; + char* raw_tc_jpl_mmt_scid44_vcid1_expect = NULL; int raw_tc_jpl_mmt_scid44_vcid1_expect_len = 0; hex_conversion(raw_tc_jpl_mmt_scid44_vcid1, &raw_tc_jpl_mmt_scid44_vcid1_expect, &raw_tc_jpl_mmt_scid44_vcid1_expect_len); diff --git a/util/src_util/ut_tc_apply.c b/util/src_util/ut_tc_apply.c index 889ad5dc..3a2025ec 100644 --- a/util/src_util/ut_tc_apply.c +++ b/util/src_util/ut_tc_apply.c @@ -33,8 +33,8 @@ UTEST(TC_APPLY_SECURITY, NO_CRYPTO_INIT) { // No Crypto_Init(), but we still Configure It; - char *raw_tc_sdls_ping_h = "20030015001880d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "20030015001880d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; hex_conversion(raw_tc_sdls_ping_h, &raw_tc_sdls_ping_b, &raw_tc_sdls_ping_len); @@ -59,8 +59,8 @@ UTEST(TC_APPLY_SECURITY, NO_CRYPTO_INIT) UTEST(TC_APPLY_SECURITY, NO_CONFIG) { // No Crypto_Init(), but we still Configure It; - char *raw_tc_sdls_ping_h = "20030015001880d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "20030015001880d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; hex_conversion(raw_tc_sdls_ping_h, &raw_tc_sdls_ping_b, &raw_tc_sdls_ping_len); @@ -83,8 +83,8 @@ UTEST(TC_APPLY_SECURITY, HAPPY_PATH_CLEAR) { // Setup & Initialize CryptoLib Crypto_Init_Unit_Test(); - char *raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; hex_conversion(raw_tc_sdls_ping_h, &raw_tc_sdls_ping_b, &raw_tc_sdls_ping_len); @@ -109,8 +109,8 @@ UTEST(TC_APPLY_SECURITY, HAPPY_PATH_ENC) { // Setup & Initialize CryptoLib Crypto_Init_Unit_Test(); - char *raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; SadbRoutine sadb_routine = get_sadb_routine_inmemory(); @@ -145,8 +145,8 @@ UTEST(TC_APPLY_SECURITY, HAPPY_PATH_AUTH_ENC) { // Setup & Initialize CryptoLib Crypto_Init_Unit_Test(); - char *raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_b = NULL; + char* raw_tc_sdls_ping_h = "20030015000080d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_b = NULL; int raw_tc_sdls_ping_len = 0; SadbRoutine sadb_routine = get_sadb_routine_inmemory(); @@ -182,8 +182,8 @@ UTEST(TC_APPLY_SECURITY, BAD_SPACE_CRAFT_ID) { // Setup & Initialize CryptoLib Crypto_Init_Unit_Test(); - char *raw_tc_sdls_ping_bad_scid_h = "20010015000080d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_bad_scid_b = NULL; + char* raw_tc_sdls_ping_bad_scid_h = "20010015000080d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_bad_scid_b = NULL; int raw_tc_sdls_ping_bad_scid_len = 0; hex_conversion(raw_tc_sdls_ping_bad_scid_h, &raw_tc_sdls_ping_bad_scid_b, &raw_tc_sdls_ping_bad_scid_len); @@ -208,8 +208,8 @@ UTEST(TC_APPLY_SECURITY, BAD_VIRTUAL_CHANNEL_ID) { // Setup & Initialize CryptoLib Crypto_Init_Unit_Test(); - char *raw_tc_sdls_ping_bad_vcid_h = "20032015000080d2c70008197f0b00310000b1fe3128"; - char *raw_tc_sdls_ping_bad_vcid_b = NULL; + char* raw_tc_sdls_ping_bad_vcid_h = "20032015000080d2c70008197f0b00310000b1fe3128"; + char* raw_tc_sdls_ping_bad_vcid_b = NULL; int raw_tc_sdls_ping_bad_vcid_len = 0; hex_conversion(raw_tc_sdls_ping_bad_vcid_h, &raw_tc_sdls_ping_bad_vcid_b, &raw_tc_sdls_ping_bad_vcid_len);