summaryrefslogtreecommitdiff
path: root/core/tee/fs_htree.c
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2017-04-13 15:01:53 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2017-04-21 14:05:23 +0200
commit0c4e1284c44fe5700824a3fb47fff82d76025ff8 (patch)
tree20ebced529581219acc51014492dcab515f06f57 /core/tee/fs_htree.c
parent22efbd4a59b28eec98ca02cca5bc4b88f230487f (diff)
core: FS: key manager takes supplied UUID
The FS key manager takes a supplied UUID instead of extracting it from current session in order to be more flexible. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/tee/fs_htree.c')
-rw-r--r--core/tee/fs_htree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/tee/fs_htree.c b/core/tee/fs_htree.c
index 796b18f4..10a8b0e0 100644
--- a/core/tee/fs_htree.c
+++ b/core/tee/fs_htree.c
@@ -116,6 +116,7 @@ struct tee_fs_htree {
uint8_t fek[TEE_FS_HTREE_FEK_SIZE];
struct tee_fs_htree_imeta imeta;
bool dirty;
+ const TEE_UUID *uuid;
const struct tee_fs_htree_storage *stor;
void *stor_aux;
};
@@ -576,7 +577,7 @@ static TEE_Result verify_root(struct tee_fs_htree *ht)
TEE_Result res;
void *ctx;
- res = tee_fs_fek_crypt(TEE_MODE_DECRYPT, ht->head.enc_fek,
+ res = tee_fs_fek_crypt(ht->uuid, TEE_MODE_DECRYPT, ht->head.enc_fek,
sizeof(ht->fek), ht->fek);
if (res != TEE_SUCCESS)
return res;
@@ -649,7 +650,7 @@ static TEE_Result init_root_node(struct tee_fs_htree *ht)
return res;
}
-TEE_Result tee_fs_htree_open(bool create, uint8_t *hash,
+TEE_Result tee_fs_htree_open(bool create, uint8_t *hash, const TEE_UUID *uuid,
const struct tee_fs_htree_storage *stor,
void *stor_aux, struct tee_fs_htree **ht_ret)
{
@@ -659,6 +660,7 @@ TEE_Result tee_fs_htree_open(bool create, uint8_t *hash,
if (!ht)
return TEE_ERROR_OUT_OF_MEMORY;
+ ht->uuid = uuid;
ht->stor = stor;
ht->stor_aux = stor_aux;
@@ -669,7 +671,7 @@ TEE_Result tee_fs_htree_open(bool create, uint8_t *hash,
if (res != TEE_SUCCESS)
goto out;
- res = tee_fs_fek_crypt(TEE_MODE_ENCRYPT, ht->fek,
+ res = tee_fs_fek_crypt(ht->uuid, TEE_MODE_ENCRYPT, ht->fek,
sizeof(ht->fek), ht->head.enc_fek);
if (res != TEE_SUCCESS)
goto out;