diff options
Diffstat (limited to 'test')
5 files changed, 17 insertions, 13 deletions
diff --git a/test/suites/attestation/attest_public_key.c b/test/suites/attestation/attest_public_key.c index 5cb645f115..f2ecc7e8d6 100644 --- a/test/suites/attestation/attest_public_key.c +++ b/test/suites/attestation/attest_public_key.c @@ -1,15 +1,14 @@ /* - * Copyright (c) 2019, Arm Limited. All rights reserved. + * Copyright (c) 2019-2020, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * */ #include "attest_public_key.h" -#include "psa/initial_attestation.h" #include "psa/crypto.h" -#include "psa/crypto_types.h" #include <stdint.h> +#include "attestation.h" /*! * \def ECC_CURVE_SECP256R1_PULBIC_KEY_LENGTH diff --git a/test/suites/attestation/attest_token_decode.c b/test/suites/attestation/attest_token_decode.c index ccd21dcd72..9bcf053c1c 100644 --- a/test/suites/attestation/attest_token_decode.c +++ b/test/suites/attestation/attest_token_decode.c @@ -15,7 +15,7 @@ #include "qcbor_util.h" #include "psa/crypto.h" #include "attest_public_key.h" - +#include "attestation.h" /** * \file attest_token_decode.c diff --git a/test/suites/attestation/attest_token_test.c b/test/suites/attestation/attest_token_test.c index a8caf9f990..6b0efd58af 100644 --- a/test/suites/attestation/attest_token_test.c +++ b/test/suites/attestation/attest_token_test.c @@ -14,6 +14,7 @@ #include "psa/initial_attestation.h" #include "attest_token_decode.h" #include "attest_token_test_values.h" +#include "psa/crypto.h" /** @@ -45,7 +46,7 @@ * \param[out] completed_token Place to put pointer and length * of completed token. * - * \return various errors. See \ref attest_token_err_t. + * \return various errors. See \ref psa_status_t. * */ int token_main_alt(uint32_t option_flags, @@ -53,7 +54,7 @@ int token_main_alt(uint32_t option_flags, struct q_useful_buf buffer, struct q_useful_buf_c *completed_token) { - int return_value; + psa_status_t return_value; uint32_t completed_token_len; struct q_useful_buf_c actual_nonce; Q_USEFUL_BUF_MAKE_STACK_UB( actual_nonce_storage, 64); @@ -77,7 +78,11 @@ int token_main_alt(uint32_t option_flags, *completed_token = (struct q_useful_buf_c){buffer.ptr, completed_token_len}; - return return_value; + if (return_value != PSA_SUCCESS) { + return (int)return_value; + } + + return 0; } #ifdef INCLUDE_TEST_CODE /* Remove them from release build */ diff --git a/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c b/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c index fae87ac374..cf3b28bfe6 100644 --- a/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c +++ b/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c @@ -150,7 +150,7 @@ static void tfm_attest_test_2004(struct test_result_t *ret) */ static void tfm_attest_test_2005(struct test_result_t *ret) { - enum psa_attest_err_t err; + psa_status_t err; uint32_t token_size = TEST_TOKEN_SIZE; /* Call with with bigger challenge object than allowed */ @@ -159,7 +159,7 @@ static void tfm_attest_test_2005(struct test_result_t *ret) token_buffer, &token_size); - if (err != PSA_ATTEST_ERR_INVALID_INPUT) { + if (err != PSA_ERROR_INVALID_ARGUMENT) { TEST_FAIL("Attestation should fail with too big challenge object"); return; } @@ -171,7 +171,7 @@ static void tfm_attest_test_2005(struct test_result_t *ret) token_buffer, &token_size); - if (err != PSA_ATTEST_ERR_TOKEN_BUFFER_OVERFLOW) { + if (err != PSA_ERROR_BUFFER_TOO_SMALL) { TEST_FAIL("Attestation should fail with too small token buffer"); return; } diff --git a/test/suites/attestation/secure/attestation_s_interface_testsuite.c b/test/suites/attestation/secure/attestation_s_interface_testsuite.c index 9c911a3a68..7dec677a44 100644 --- a/test/suites/attestation/secure/attestation_s_interface_testsuite.c +++ b/test/suites/attestation/secure/attestation_s_interface_testsuite.c @@ -150,7 +150,7 @@ static void tfm_attest_test_1004(struct test_result_t *ret) */ static void tfm_attest_test_1005(struct test_result_t *ret) { - enum psa_attest_err_t err; + psa_status_t err; uint32_t token_size = TEST_TOKEN_SIZE; /* Call with with bigger challenge object than allowed */ @@ -159,7 +159,7 @@ static void tfm_attest_test_1005(struct test_result_t *ret) token_buffer, &token_size); - if (err != PSA_ATTEST_ERR_INVALID_INPUT) { + if (err != PSA_ERROR_INVALID_ARGUMENT) { TEST_FAIL("Attestation should fail with too big challenge object"); return; } @@ -171,7 +171,7 @@ static void tfm_attest_test_1005(struct test_result_t *ret) token_buffer, &token_size); - if (err != PSA_ATTEST_ERR_TOKEN_BUFFER_OVERFLOW) { + if (err != PSA_ERROR_BUFFER_TOO_SMALL) { TEST_FAIL("Attestation should fail with too small token buffer"); return; } |