Enabling visibility of PSA APIs
Making the visibility of PSA API-s configurable so they can be
provided by a shared library.
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: I0c3836d91d43f3e5c7b23696b64b8da509d2e9d9
diff --git a/components/service/attestation/include/psa/initial_attestation.h b/components/service/attestation/include/psa/initial_attestation.h
index 7b44220..3aacb29 100644
--- a/components/service/attestation/include/psa/initial_attestation.h
+++ b/components/service/attestation/include/psa/initial_attestation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -16,15 +16,21 @@
#define __PSA_INITIAL_ATTESTATION_H__
#include <limits.h>
-#include <stdint.h>
-#include <stddef.h>
#include <psa/crypto.h>
#include <psa/error.h>
+#include <stddef.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
+#ifdef EXPORT_PUBLIC_INTERFACE_PSA_ATTEST
+#define PSA_ATTEST_EXPORTED __attribute__((__visibility__("default")))
+#else
+#define PSA_ATTEST_EXPORTED
+#endif
+
/**
* \brief PSA INITIAL ATTESTATION API version
*
@@ -38,16 +44,16 @@
* Challenge can be a nonce from server
* or the hash of some combined data : nonce + attested data by caller.
*/
-#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_32 (32u)
-#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_48 (48u)
-#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_64 (64u)
+#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_32 (32u)
+#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_48 (48u)
+#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_64 (64u)
/**
* The maximum size of an attestation token that can be generated by the
* attestation service. Used to configure buffers for services that verify the
* produced tokens.
*/
-#define PSA_INITIAL_ATTEST_MAX_TOKEN_SIZE (4096)
+#define PSA_INITIAL_ATTEST_MAX_TOKEN_SIZE (4096)
/**
* The list of fixed claims in the initial attestation token is still evolving,
@@ -178,12 +184,11 @@
*
* \return Returns error code as specified in \ref psa_status_t
*/
-psa_status_t
-psa_initial_attest_get_token(const uint8_t *auth_challenge,
- size_t challenge_size,
- uint8_t *token_buf,
- size_t token_buf_size,
- size_t *token_size);
+PSA_ATTEST_EXPORTED psa_status_t psa_initial_attest_get_token(const uint8_t *auth_challenge,
+ size_t challenge_size,
+ uint8_t *token_buf,
+ size_t token_buf_size,
+ size_t *token_size);
/**
* \brief Get the exact size of initial attestation token in bytes.
@@ -198,9 +203,8 @@
*
* \return Returns error code as specified in \ref psa_status_t
*/
-psa_status_t
-psa_initial_attest_get_token_size(size_t challenge_size,
- size_t *token_size);
+PSA_ATTEST_EXPORTED psa_status_t psa_initial_attest_get_token_size(size_t challenge_size,
+ size_t *token_size);
/**
* \brief Get the attestation public key
@@ -220,11 +224,9 @@
*
* \return Returns error code as specified in \ref psa_status_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,
- psa_ecc_family_t *elliptic_curve_type);
+PSA_ATTEST_EXPORTED psa_status_t
+tfm_initial_attest_get_public_key(uint8_t *public_key, size_t public_key_buf_size,
+ size_t *public_key_len, psa_ecc_family_t *elliptic_curve_type);
#ifdef __cplusplus
}