Hi, if I set PS_ENCRYPTION=OFF
set(PS_ENCRYPTION
OFF
CACHE
BOOL "Enable encryption for Protected
Storage partition")
I see this compile error:
In file included from /home/brian/gits/spe/source/third_party/tfm/secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.c:32:
/home/brian/gits/spe/source/third_party/tfm/secure_fw/partitions/internal_trusted_storage/../protected_storage/ps_object_defs.h:48:31: error: 'PS_TAG_LEN_BYTES' undeclared here (not in a function)
48 | #define PS_TAG_IV_LEN_MAX ((PS_TAG_LEN_BYTES > PS_IV_LEN_BYTES) ? \
| ^~~~~~~~~~~~~~~~
/home/brian/gits/spe/source/third_party/tfm/secure_fw/partitions/internal_trusted_storage/../protected_storage/ps_object_defs.h:60:20: note: in expansion of macro 'PS_TAG_IV_LEN_MAX'
60 | uint8_t tag_iv[PS_TAG_IV_LEN_MAX];
| ^~~~~~~~~~~~~~~~~
/home/brian/gits/spe/source/third_party/tfm/secure_fw/partitions/internal_trusted_storage/../protected_storage/ps_object_defs.h:48:50: error: 'PS_IV_LEN_BYTES' undeclared here (not in a function)
48 | #define PS_TAG_IV_LEN_MAX ((PS_TAG_LEN_BYTES > PS_IV_LEN_BYTES) ? \
| ^~~~~~~~~~~~~~~
/home/brian/gits/spe/source/third_party/tfm/secure_fw/partitions/internal_trusted_storage/../protected_storage/ps_object_defs.h:60:20: note: in expansion of macro 'PS_TAG_IV_LEN_MAX'
60 | uint8_t tag_iv[PS_TAG_IV_LEN_MAX];
| ^~~~~~~~~~~~~~~~~
make[7]: *** [secure_fw/partitions/internal_trusted_storage/CMakeFiles/tfm_psa_rot_partition_its.dir/build.make:90: secure_fw/partitions/internal_trusted_storage/CMakeFiles/tfm_psa_rot_partition_its.dir/tfm_internal_trusted_storage.o]
Error 1
I think the correct fix is to add the following highlighted code to ps_object_defs.h. Patch is attached.
/*!
*
\struct ps_object_t
*
*
\brief The object to be written to the file system below. Made up of the
* object header and the object data.
*/
struct
ps_object_t {
struct
ps_obj_header_t
header; /*!< Object header */
uint8_t
data[PS_MAX_OBJECT_DATA_SIZE];
/*!< Object data */
#ifdef
PS_ENCRYPTION
uint8_t
tag_iv[PS_TAG_IV_LEN_MAX];
#endif
};
Regards,
Brian Quach
SimpleLink MCU
Texas Instruments Inc.