Skip to content

Commit dfc3c0a

Browse files
AnhVoRVCDienPhamM
authored andcommitted
plat-rcar_gen4: standalone fs: Support for case object_id is NULL and object_id_len is zero
The TEE Internal Core API specification (v1.3.1) explicitly allows the use of an empty object ID in TEE_RenamePersistentObject(). The text is: newObjectID, newObjectIDLen: A buffer containing the new object identifier. The identifier contains arbitrary bytes, including the zero byte. The identifier length SHALL be less than or equal to TEE_OBJECT_ID_MAX_LEN and can be zero. Signed-off-by: Anh Vo <anh.vo.vx@renesas.com> Signed-off-by: Nhi Nguyen <nhi.nguyen.kx@renesas.com>
1 parent 536f6fe commit dfc3c0a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/arch/arm/plat-rcar_gen4/tee/tee_standalone_fs.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ static TEE_Result spi_alloc_file(struct tee_pobj *po, char **pfile,
358358
{
359359
TEE_Result res;
360360

361-
if ((po->obj_id != NULL) && (po->obj_id_len > 0U) &&
362-
(po->obj_id_len <= TEE_OBJECT_ID_MAX_LEN)) {
361+
if (po->obj_id_len <= TEE_OBJECT_ID_MAX_LEN) {
363362
res = spi_alloc_path(po, pfile, len_out);
364363
} else {
365364
res = TEE_ERROR_BAD_PARAMETERS;
@@ -385,7 +384,7 @@ static TEE_Result spi_alloc_path(struct tee_pobj *po, char **ppath,
385384
(void)memset(mpath, 0, dir_len + file_len);
386385
pos = tee_b2hs((uint8_t *)&po->uuid, (uint8_t *)mpath,
387386
sizeof(TEE_UUID), dir_len);
388-
if (po->obj_id_len > 0U) {
387+
if ((po->obj_id != NULL) && (po->obj_id_len > 0U)) {
389388
mpath[pos] = '/';
390389
pos++;
391390
pos += tee_b2hs((uint8_t *)po->obj_id,

0 commit comments

Comments
 (0)