Revert "MeasuredBoot: MEASUREMENT_BOOT_HASH_ALG is renamed"
This reverts commit 50464b7e8ff2c3649a0d7113a20b61fc48e48ed7.
Reason for revert: Dependent on other changes, incomplete yet.
Change-Id: Ia17b20838fd070cb6cc6c2f20ef0901ae5672b96
diff --git a/partitions/measured_boot/CMakeLists.txt b/partitions/measured_boot/CMakeLists.txt
index dd72f95..f3b92b5 100644
--- a/partitions/measured_boot/CMakeLists.txt
+++ b/partitions/measured_boot/CMakeLists.txt
@@ -52,23 +52,21 @@
psa_crypto_config
)
-string(REPLACE "SHA" "PSA_ALG_SHA_" PSA_MEASUREMENT_HASH_ALG ${MEASURED_BOOT_HASH_ALG})
-
-if(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
+if(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
# In accordance with IANA hash algorithm registry:
# https://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xml
set(MEASUREMENT_HASH_ALGO_NAME "sha-512")
set(MEASUREMENT_VALUE_SIZE 64)
-elseif(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
+elseif(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
set(MEASUREMENT_HASH_ALGO_NAME "sha-256")
set(MEASUREMENT_VALUE_SIZE 32)
else()
- message(FATAL_ERROR "Unknown hash algorithm ${PSA_MEASUREMENT_HASH_ALG}")
+ message(FATAL_ERROR "Unknown hash algorithm")
endif()
target_compile_definitions(tfm_psa_rot_partition_measured_boot
PRIVATE
- TFM_MEASURED_BOOT_HASH_ALG=${PSA_MEASUREMENT_HASH_ALG}
+ TFM_MEASURED_BOOT_HASH_ALG=${MEASURED_BOOT_HASH_ALG}
MEASUREMENT_VALUE_SIZE=${MEASUREMENT_VALUE_SIZE}
$<$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>:CONFIG_TFM_BOOT_STORE_MEASUREMENTS>
)
diff --git a/partitions/measured_boot/test/non_secure/CMakeLists.txt b/partitions/measured_boot/test/non_secure/CMakeLists.txt
index 96b8d3a..3296557 100644
--- a/partitions/measured_boot/test/non_secure/CMakeLists.txt
+++ b/partitions/measured_boot/test/non_secure/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2022-2025, Arm Limited. All rights reserved.
+# Copyright (c) 2022-2024, Arm Limited. All rights reserved.
# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
#
@@ -9,10 +9,9 @@
cmake_policy(SET CMP0079 NEW)
-string(REPLACE "SHA" "PSA_ALG_SHA_" PSA_MEASUREMENT_HASH_ALG ${MEASURED_BOOT_HASH_ALG})
-if(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
+if(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
set(MEASUREMENT_VALUE_SIZE 64)
-elseif(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
+elseif(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
set(MEASUREMENT_VALUE_SIZE 32)
else()
message(FATAL_ERROR "Unknown hash algorithm")
@@ -33,7 +32,7 @@
target_compile_definitions(tfm_test_suite_extra_ns
PRIVATE
- MEASURED_BOOT_HASH_ALG=${PSA_MEASUREMENT_HASH_ALG}
+ MEASURED_BOOT_HASH_ALG=${MEASURED_BOOT_HASH_ALG}
MEASUREMENT_VALUE_SIZE=${MEASUREMENT_VALUE_SIZE}
)
diff --git a/partitions/measured_boot/test/secure/CMakeLists.txt b/partitions/measured_boot/test/secure/CMakeLists.txt
index 2d0cef0..42f13cf 100644
--- a/partitions/measured_boot/test/secure/CMakeLists.txt
+++ b/partitions/measured_boot/test/secure/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2022-2025, Arm Limited. All rights reserved.
+# Copyright (c) 2022, Arm Limited. All rights reserved.
# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
#
@@ -9,10 +9,9 @@
cmake_policy(SET CMP0079 NEW)
-string(REPLACE "SHA" "PSA_ALG_SHA_" PSA_MEASUREMENT_HASH_ALG ${MEASURED_BOOT_HASH_ALG})
-if(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
+if(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_512")
set(MEASUREMENT_VALUE_SIZE 64)
-elseif(${PSA_MEASUREMENT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
+elseif(${MEASURED_BOOT_HASH_ALG} STREQUAL "PSA_ALG_SHA_256")
set(MEASUREMENT_VALUE_SIZE 32)
else()
message(FATAL_ERROR "Unknown hash algorithm")
@@ -32,7 +31,7 @@
target_compile_definitions(tfm_test_suite_extra_s
PRIVATE
- MEASURED_BOOT_HASH_ALG=${PSA_MEASUREMENT_HASH_ALG}
+ MEASURED_BOOT_HASH_ALG=${MEASURED_BOOT_HASH_ALG}
MEASUREMENT_VALUE_SIZE=${MEASUREMENT_VALUE_SIZE}
)