aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorSummer Qin <summer.qin@arm.com>2021-05-12 11:07:16 +0800
committerDavid Hu <david.hu@arm.com>2021-05-17 09:42:49 +0200
commitfd7caf8e3a1eae0adaebe658d42b4b08f05c8450 (patch)
treefd2e4c329e988df563c5a4a7b6ba3a3e85039e6b /platform
parent855321afde18de7f08217e8f946e79153e674ba4 (diff)
downloadtrusted-firmware-m-fd7caf8e3a1eae0adaebe658d42b4b08f05c8450.tar.gz
Crypto: Fix crypto build warnings
- Include 'tfm_plat_crypto_nv_seed.h' file in mbedtls_an521_conf.h to fix the warning of implicit declaration of function 'tfm_plat_crypto_nv_seed_write' [-Wimplicit-function-declaration]. - Change the first parameter to 'const' in tfm_plat_crypto_nv_seed_write function. Change-Id: I5f1ae8bf7f8e9e67ced25af0d3a569306ed8814b Signed-off-by: Summer Qin <summer.qin@arm.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/ext/common/template/crypto_nv_seed.c2
-rw-r--r--platform/ext/target/mps2/an521/CMakeLists.txt5
-rw-r--r--platform/ext/target/mps2/an521/mbedtls_an521_conf.h2
-rw-r--r--platform/include/tfm_plat_crypto_nv_seed.h2
4 files changed, 9 insertions, 2 deletions
diff --git a/platform/ext/common/template/crypto_nv_seed.c b/platform/ext/common/template/crypto_nv_seed.c
index 97535da064..c868d953b3 100644
--- a/platform/ext/common/template/crypto_nv_seed.c
+++ b/platform/ext/common/template/crypto_nv_seed.c
@@ -24,7 +24,7 @@ int tfm_plat_crypto_nv_seed_read(unsigned char *buf, size_t buf_len)
}
}
-int tfm_plat_crypto_nv_seed_write(unsigned char *buf, size_t buf_len)
+int tfm_plat_crypto_nv_seed_write(const unsigned char *buf, size_t buf_len)
{
psa_storage_uid_t uid = NV_SEED_FILE_ID;
psa_status_t status;
diff --git a/platform/ext/target/mps2/an521/CMakeLists.txt b/platform/ext/target/mps2/an521/CMakeLists.txt
index e4f798cf62..840fded598 100644
--- a/platform/ext/target/mps2/an521/CMakeLists.txt
+++ b/platform/ext/target/mps2/an521/CMakeLists.txt
@@ -180,3 +180,8 @@ target_compile_definitions(tfm_psa_rot_partition_crypto
PRIVATE
$<$<AND:$<BOOL:${TFM_PSA_API}>,$<BOOL:${PLATFORM_DUMMY_NV_SEED}>>:PLATFORM_DUMMY_NV_SEED>
)
+
+target_include_directories(crypto_service_mbedcrypto
+ PUBLIC
+ ${CMAKE_SOURCE_DIR}/platform/include
+)
diff --git a/platform/ext/target/mps2/an521/mbedtls_an521_conf.h b/platform/ext/target/mps2/an521/mbedtls_an521_conf.h
index 6094cb05f0..ba37aff9eb 100644
--- a/platform/ext/target/mps2/an521/mbedtls_an521_conf.h
+++ b/platform/ext/target/mps2/an521/mbedtls_an521_conf.h
@@ -7,6 +7,8 @@
#ifndef __MBEDTLS_AN521_CONF_H__
#define __MBEDTLS_AN521_CONF_H__
+#include "tfm_plat_crypto_nv_seed.h"
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
diff --git a/platform/include/tfm_plat_crypto_nv_seed.h b/platform/include/tfm_plat_crypto_nv_seed.h
index 39b9e377c3..9b897c83e3 100644
--- a/platform/include/tfm_plat_crypto_nv_seed.h
+++ b/platform/include/tfm_plat_crypto_nv_seed.h
@@ -36,6 +36,6 @@ int tfm_plat_crypto_nv_seed_read(unsigned char *buf, size_t buf_len);
* \return Return TFM_CRYPTO_NV_SEED_SUCCESS on success,
* or TFM_CRYPTO_NV_SEED_FAILED on failure.
*/
-int tfm_plat_crypto_nv_seed_write(unsigned char *buf, size_t buf_len);
+int tfm_plat_crypto_nv_seed_write(const unsigned char *buf, size_t buf_len);
#endif /* __TFM_PLAT_CRYPTO_NV_SEED_H__ */