From 9439bef44e9f63cd4d6bbb316356d0ea0a451a33 Mon Sep 17 00:00:00 2001 From: Laurence Lundblade Date: Thu, 19 Oct 2023 23:04:54 -0700 Subject: [PATCH] Fix prototype of functions with no args --- examples/init_keys_ossl.c | 2 +- test/t_cose_compute_validate_mac_test.c | 12 +++++----- test/t_cose_sign_verify_test.c | 6 ++--- test/t_cose_test.c | 32 ++++++++++++------------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/init_keys_ossl.c b/examples/init_keys_ossl.c index 8bb4cb84..40d262af 100644 --- a/examples/init_keys_ossl.c +++ b/examples/init_keys_ossl.c @@ -244,7 +244,7 @@ free_fixed_test_ec_encryption_key(struct t_cose_key key) /* * Public function, see init_keys.h */ -int check_for_key_allocation_leaks() +int check_for_key_allocation_leaks(void) { /* So far no good way to do this for OpenSSL or malloc() in general in a nice portable way. The PSA version does check so diff --git a/test/t_cose_compute_validate_mac_test.c b/test/t_cose_compute_validate_mac_test.c index 18dfdd72..3e000af4 100644 --- a/test/t_cose_compute_validate_mac_test.c +++ b/test/t_cose_compute_validate_mac_test.c @@ -136,7 +136,7 @@ static int32_t compute_validate_basic_test_alg_mac(int32_t cose_alg) /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_mac_basic_test() +int32_t compute_validate_mac_basic_test(void) { int32_t return_value; @@ -171,7 +171,7 @@ int32_t compute_validate_mac_basic_test() /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_mac_fail_test() +int32_t compute_validate_mac_fail_test(void) { struct t_cose_mac_calculate_ctx mac_ctx; struct t_cose_mac_validate_ctx validate_ctx; @@ -344,7 +344,7 @@ static int size_test(int32_t cose_algorithm_id, /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_get_size_mac_test() +int32_t compute_validate_get_size_mac_test(void) { enum t_cose_err_t return_value; struct t_cose_key key; @@ -404,7 +404,7 @@ int32_t compute_validate_get_size_mac_test() /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_known_good_test() +int32_t compute_validate_known_good_test(void) { struct t_cose_mac_calculate_ctx mac_ctx; struct t_cose_mac_validate_ctx validate_ctx; @@ -507,7 +507,7 @@ int32_t compute_validate_known_good_test() /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_detached_content_mac_fail_test() +int32_t compute_validate_detached_content_mac_fail_test(void) { struct t_cose_mac_calculate_ctx mac_ctx; struct t_cose_mac_validate_ctx validate_ctx; @@ -673,7 +673,7 @@ static int detached_content_size_test(int32_t cose_algorithm_id, /* * Public function, see t_cose_compute_validate_mac_test.h */ -int32_t compute_validate_get_size_detached_content_mac_test() +int32_t compute_validate_get_size_detached_content_mac_test(void) { enum t_cose_err_t return_value; struct t_cose_key key; diff --git a/test/t_cose_sign_verify_test.c b/test/t_cose_sign_verify_test.c index 6874d9d1..431f909a 100644 --- a/test/t_cose_sign_verify_test.c +++ b/test/t_cose_sign_verify_test.c @@ -401,7 +401,7 @@ static int32_t sig_fail_test(int32_t cose_alg) /* * Public function, see t_cose_sign_verify_test.h */ -int32_t sign_verify_sig_fail_test() +int32_t sign_verify_sig_fail_test(void) { int32_t return_value; const struct test_case* tc; @@ -420,7 +420,7 @@ int32_t sign_verify_sig_fail_test() /* * Public function, see t_cose_sign_verify_test.h */ -int32_t sign_verify_make_cwt_test() +int32_t sign_verify_make_cwt_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; QCBOREncodeContext cbor_encode; @@ -783,7 +783,7 @@ static int32_t signing_size_test(int32_t cose_algorithm_id, /* * Public function, see t_cose_sign_verify_test.h */ -int32_t sign_verify_get_size_test() +int32_t sign_verify_get_size_test(void) { int32_t return_value; const struct test_case* tc; diff --git a/test/t_cose_test.c b/test/t_cose_test.c index 0b747064..84a0e168 100644 --- a/test/t_cose_test.c +++ b/test/t_cose_test.c @@ -28,7 +28,7 @@ static const struct q_useful_buf_c s_input_payload = {SZ_CONTENT, sizeof(SZ_CONT /* * Public function, see t_cose_test.h */ -int32_t short_circuit_self_test() +int32_t short_circuit_self_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -142,7 +142,7 @@ int32_t short_circuit_self_test() /* * Public function, see t_cose_test.h */ -int32_t short_circuit_self_detached_content_test() +int32_t short_circuit_self_detached_content_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -212,7 +212,7 @@ int32_t short_circuit_self_detached_content_test() /* * Public function, see t_cose_test.h */ -int32_t short_circuit_verify_fail_test() +int32_t short_circuit_verify_fail_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -325,7 +325,7 @@ int32_t short_circuit_verify_fail_test() * Public function, see t_cose_test.h */ // TODO: name of this tests isn't right. -int32_t short_circuit_signing_error_conditions_test() +int32_t short_circuit_signing_error_conditions_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; enum t_cose_err_t result; @@ -406,7 +406,7 @@ int32_t short_circuit_signing_error_conditions_test() /* * Public function, see t_cose_test.h */ -int32_t short_circuit_make_cwt_test() +int32_t short_circuit_make_cwt_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -542,7 +542,7 @@ int32_t short_circuit_make_cwt_test() /* * Public function, see t_cose_test.h */ -int32_t short_circuit_decode_only_test() +int32_t short_circuit_decode_only_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -679,7 +679,7 @@ static const uint8_t rfc8152_example_2_1[] = { /* * Public function, see t_cose_test.h */ -int32_t cose_example_test() +int32_t cose_example_test(void) { enum t_cose_err_t result; Q_USEFUL_BUF_MAKE_STACK_UB( signed_cose_buffer, 200); @@ -787,7 +787,7 @@ static enum t_cose_err_t run_test_sign_and_verify(uint32_t test_mess_options, #ifndef T_COSE_DISABLE_SHORT_CIRCUIT_SIGN -int32_t all_header_parameters_test() +int32_t all_header_parameters_test(void) { enum t_cose_err_t result; Q_USEFUL_BUF_MAKE_STACK_UB( signed_cose_buffer, 300); @@ -910,7 +910,7 @@ static struct test_case bad_parameters_tests_table[] = { /* * Public function, see t_cose_test.h */ -int32_t bad_parameters_test() +int32_t bad_parameters_test(void) { struct test_case *test; enum t_cose_err_t err; @@ -980,7 +980,7 @@ static struct test_case crit_tests_table[] = { /* * Public function, see t_cose_test.h */ -int32_t crit_parameters_test() +int32_t crit_parameters_test(void) { struct test_case *test; enum t_cose_err_t err; @@ -1005,7 +1005,7 @@ int32_t crit_parameters_test() /* * Public function, see t_cose_test.h */ -int32_t content_type_test() +int32_t content_type_test(void) { struct t_cose_parameters parameters; struct t_cose_sign1_sign_ctx sign_ctx; @@ -1586,7 +1586,7 @@ extern int hash_test_mode; /* * Public function, see t_cose_test.h */ -int32_t short_circuit_hash_fail_test() +int32_t short_circuit_hash_fail_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; enum t_cose_err_t result; @@ -1644,7 +1644,7 @@ int32_t short_circuit_hash_fail_test() /* * Public function, see t_cose_test.h */ -int32_t tags_test() +int32_t tags_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; struct t_cose_sign1_verify_ctx verify_ctx; @@ -2011,7 +2011,7 @@ int32_t tags_test() } -int32_t get_size_test() +int32_t get_size_test(void) { struct t_cose_sign1_sign_ctx sign_ctx; QCBOREncodeContext cbor_encode; @@ -2117,7 +2117,7 @@ int32_t get_size_test() /* * Public function, see t_cose_test.h */ -int32_t indef_array_and_map_test() +int32_t indef_array_and_map_test(void) { enum t_cose_err_t return_value; #ifdef TODO_CRIT_PARAM_FIXED @@ -2165,7 +2165,7 @@ int32_t indef_array_and_map_test() /* * Public function, see t_cose_test.h */ -int32_t crypto_context_test() +int32_t crypto_context_test(void) { struct t_cose_sign_sign_ctx sign_ctx; struct t_cose_sign_verify_ctx verify_ctx;