Skip to content

Commit 361fb3e

Browse files
committed
core: REE FS: use a single file per object
Prior to this commit each persistent object was represented by a directory with several files. With this commit each persistent object is represented by a single file instead to simplify the implementation. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 parent 6854052 commit 361fb3e

File tree

5 files changed

+219
-473
lines changed

5 files changed

+219
-473
lines changed

core/include/tee/tee_fs_key_manager.h

+18
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,29 @@
4141
#define TEE_FS_KM_IV_LEN 12 /* bytes */
4242
#define TEE_FS_KM_MAX_TAG_LEN 16 /* bytes */
4343

44+
45+
#define BLOCK_FILE_SHIFT 12
46+
47+
#define BLOCK_FILE_SIZE (1 << BLOCK_FILE_SHIFT)
48+
49+
#define NUM_BLOCKS_PER_FILE 1024
50+
4451
enum tee_fs_file_type {
4552
META_FILE,
4653
BLOCK_FILE
4754
};
4855

56+
struct tee_fs_file_info {
57+
size_t length;
58+
uint32_t backup_version_table[NUM_BLOCKS_PER_FILE / 32];
59+
};
60+
61+
struct tee_fs_file_meta {
62+
struct tee_fs_file_info info;
63+
uint8_t encrypted_fek[TEE_FS_KM_FEK_SIZE];
64+
uint32_t counter;
65+
};
66+
4967
struct common_header {
5068
uint8_t iv[TEE_FS_KM_IV_LEN];
5169
uint8_t tag[TEE_FS_KM_MAX_TAG_LEN];

0 commit comments

Comments
 (0)