Attest: Introduce PSA error codes
This change addresses the compliance with PSA initial attestation
API 1.0.0 version. It replaces the existing psa_attest_err_t enum
values with the error codes that are detailed in the
interface/include/psa/error.h file.
Change-Id: I1795331e7081589371c82f0e56655db6a543edd3
Signed-off-by: Sverteczky, Marcell <marcell.sverteczky@arm.com>
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/interface/include/psa/initial_attestation.h b/interface/include/psa/initial_attestation.h
index 4dd247b..aa4a414 100644
--- a/interface/include/psa/initial_attestation.h
+++ b/interface/include/psa/initial_attestation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,35 +33,6 @@
#define PSA_INITIAL_ATTEST_API_VERSION_MINOR (0)
/**
- * \enum psa_attest_err_t
- *
- * \brief Initial attestation service error types
- *
- */
-enum psa_attest_err_t {
- /** Action was performed successfully */
- PSA_ATTEST_ERR_SUCCESS = 0,
- /** Boot status data is unavailable or malformed */
- PSA_ATTEST_ERR_INIT_FAILED,
- /** Token buffer is too small to store the created token there */
- PSA_ATTEST_ERR_TOKEN_BUFFER_OVERFLOW,
- /** Attestation key buffer is too small to store the obtained key there */
- PSA_ATTEST_ERR_KEY_BUFFER_OVERFLOW,
- /** Some of the mandatory claims are unavailable */
- PSA_ATTEST_ERR_CLAIM_UNAVAILABLE,
- /** Some parameter or combination of parameters are recognised as invalid:
- * - challenge size is not allowed
- * - challenge object is unavailable
- * - token buffer is unavailable
- */
- PSA_ATTEST_ERR_INVALID_INPUT,
- /** Unexpected error happened during operation */
- PSA_ATTEST_ERR_GENERAL,
- /** Following entry is only to ensure the error code of integer size */
- PSA_ATTEST_ERR_FORCE_INT_SIZE = INT_MAX
-};
-
-/**
* The allowed size of input challenge in bytes: 32, 48, 64
* Challenge can be a nonce from server
* or the hash of some combined data : nonce + attested data by caller.
@@ -197,9 +168,9 @@
* updated by initial attestation service with
* final token size.
*
- * \return Returns error code as specified in \ref psa_attest_err_t
+ * \return Returns error code as specified in \ref psa_status_t
*/
-enum psa_attest_err_t
+psa_status_t
psa_initial_attest_get_token(const uint8_t *challenge_obj,
uint32_t challenge_size,
uint8_t *token,
@@ -215,9 +186,9 @@
* \param[out] token_size Size of the token in bytes, which is created by
* initial attestation service.
*
- * \return Returns error code as specified in \ref psa_attest_err_t
+ * \return Returns error code as specified in \ref psa_status_t
*/
-enum psa_attest_err_t
+psa_status_t
psa_initial_attest_get_token_size(uint32_t challenge_size,
uint32_t *token_size);
@@ -233,9 +204,9 @@
*
* \note Currently only the ECDSA P-256 over SHA-256 algorithm is supported.
*
- * \return Returns error code as specified in \ref psa_attest_err_t
+ * \return Returns error code as specified in \ref psa_status_t
*/
-enum psa_attest_err_t
+psa_status_t
tfm_initial_attest_get_public_key(uint8_t *public_key,
size_t public_key_buf_size,
size_t *public_key_len,