aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdison Ai <edison.ai@arm.com>2019-06-21 11:14:08 +0800
committerKen Liu <ken.liu@arm.com>2019-07-19 10:14:51 +0000
commit870abb4d77aee748a78a107fc79ce5e3bed69aab (patch)
tree9bf801127db681987cfda0f3eb634a9850c2eb10
parent5bf0bfc6e4681f1156767145cec9a131320c9208 (diff)
downloadtrusted-firmware-m-870abb4d77aee748a78a107fc79ce5e3bed69aab.tar.gz
Attest: Use macros generated by tools
- Use the SID and service version defined in sid.h. - Use signal defined in tfm_initial_attestation.h. - Remove tfm_attest_defs.h and tfm_attest_signal.h. Change-Id: I36a5be19c8d89ca1e9dfb5978438bb0e66f3cde7 Signed-off-by: Edison Ai <edison.ai@arm.com>
-rw-r--r--interface/include/tfm_attest_defs.h30
-rw-r--r--interface/src/tfm_initial_attestation_api.c6
-rw-r--r--secure_fw/services/initial_attestation/tfm_attest_signal.h15
-rw-r--r--secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c2
-rw-r--r--secure_fw/services/initial_attestation/tfm_attestation_secure_api.c6
5 files changed, 7 insertions, 52 deletions
diff --git a/interface/include/tfm_attest_defs.h b/interface/include/tfm_attest_defs.h
deleted file mode 100644
index 5cbca7a6c..000000000
--- a/interface/include/tfm_attest_defs.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_ATTEST_DEFS_H__
-#define __TFM_ATTEST_DEFS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef TFM_PSA_API
-/*
- * Defines for SID and minor version number. These SIDs must align with the
- * value in service manifest file.
- */
-#define TFM_ATTEST_GET_TOKEN_SID (0x00000020)
-#define TFM_ATTEST_GET_TOKEN_MINOR_VER (0x0001)
-#define TFM_ATTEST_GET_TOKEN_SIZE_SID (0x00000021)
-#define TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER (0x0001)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_ATTEST_DEFS_H__ */ \ No newline at end of file
diff --git a/interface/src/tfm_initial_attestation_api.c b/interface/src/tfm_initial_attestation_api.c
index 9d002142f..7324b1f6c 100644
--- a/interface/src/tfm_initial_attestation_api.c
+++ b/interface/src/tfm_initial_attestation_api.c
@@ -10,7 +10,7 @@
#include "tfm_ns_lock.h"
#include "psa/client.h"
#ifdef TFM_PSA_API
-#include "tfm_attest_defs.h"
+#include "psa_manifest/sid.h"
#endif
#define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
@@ -36,7 +36,7 @@ psa_initial_attest_get_token(const uint8_t *challenge_obj,
#ifdef TFM_PSA_API
handle = psa_connect(TFM_ATTEST_GET_TOKEN_SID,
- TFM_ATTEST_GET_TOKEN_MINOR_VER);
+ TFM_ATTEST_GET_TOKEN_VERSION);
if (handle <= 0) {
return PSA_ATTEST_ERR_GENERAL;
}
@@ -85,7 +85,7 @@ psa_initial_attest_get_token_size(uint32_t challenge_size,
#ifdef TFM_PSA_API
handle = psa_connect(TFM_ATTEST_GET_TOKEN_SIZE_SID,
- TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER);
+ TFM_ATTEST_GET_TOKEN_SIZE_VERSION);
if (handle <= 0) {
return PSA_ATTEST_ERR_GENERAL;
}
diff --git a/secure_fw/services/initial_attestation/tfm_attest_signal.h b/secure_fw/services/initial_attestation/tfm_attest_signal.h
deleted file mode 100644
index 2acd0fd8b..000000000
--- a/secure_fw/services/initial_attestation/tfm_attest_signal.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_ATTEST_SIGNAL_H__
-#define __TFM_ATTEST_SIGNAL_H__
-
-/* FixMe: hardcode it since the tool cannot support now */
-#define PSA_ATTEST_GET_TOKEN_SIG (1 << (0 + 4))
-#define PSA_ATTEST_GET_TOKEN_SIZE_SIG (1 << (1 + 4))
-
-#endif /* __TFM_ATTEST_SIGNAL_H__ */ \ No newline at end of file
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
index 97042bda0..8036fcffc 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
@@ -10,7 +10,7 @@
#include "attestation.h"
#ifdef TFM_PSA_API
-#include "tfm_attest_signal.h"
+#include "psa_manifest/tfm_initial_attestation.h"
#include "tfm_client.h"
#include "psa/service.h"
#include "region_defs.h"
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
index 1e426d7cf..282698c2a 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
@@ -11,7 +11,7 @@
#include "tfm_client.h"
#include "tfm_secure_api.h"
#ifdef TFM_PSA_API
-#include "tfm_attest_defs.h"
+#include "psa_manifest/sid.h"
#endif
#include <string.h>
@@ -49,7 +49,7 @@ psa_initial_attest_get_token(const uint8_t *challenge_obj,
#ifdef TFM_PSA_API
handle = psa_connect(TFM_ATTEST_GET_TOKEN_SID,
- TFM_ATTEST_GET_TOKEN_MINOR_VER);
+ TFM_ATTEST_GET_TOKEN_VERSION);
if (handle <= 0) {
return PSA_ATTEST_ERR_GENERAL;
}
@@ -129,7 +129,7 @@ psa_initial_attest_get_token_size(uint32_t challenge_size,
#ifdef TFM_PSA_API
handle = psa_connect(TFM_ATTEST_GET_TOKEN_SIZE_SID,
- TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER);
+ TFM_ATTEST_GET_TOKEN_SIZE_VERSION);
if (handle <= 0) {
return PSA_ATTEST_ERR_GENERAL;
}