Skip to content

Commit

Permalink
core: REE FS: use a single file per object
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jenswi-linaro committed Nov 7, 2016
1 parent 6854052 commit 361fb3e
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 473 deletions.
18 changes: 18 additions & 0 deletions core/include/tee/tee_fs_key_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,29 @@
#define TEE_FS_KM_IV_LEN 12 /* bytes */
#define TEE_FS_KM_MAX_TAG_LEN 16 /* bytes */


#define BLOCK_FILE_SHIFT 12

#define BLOCK_FILE_SIZE (1 << BLOCK_FILE_SHIFT)

#define NUM_BLOCKS_PER_FILE 1024

enum tee_fs_file_type {
META_FILE,
BLOCK_FILE
};

struct tee_fs_file_info {
size_t length;
uint32_t backup_version_table[NUM_BLOCKS_PER_FILE / 32];
};

struct tee_fs_file_meta {
struct tee_fs_file_info info;
uint8_t encrypted_fek[TEE_FS_KM_FEK_SIZE];
uint32_t counter;
};

struct common_header {
uint8_t iv[TEE_FS_KM_IV_LEN];
uint8_t tag[TEE_FS_KM_MAX_TAG_LEN];
Expand Down
Loading

0 comments on commit 361fb3e

Please sign in to comment.