Lines Matching refs:entry
61 struct tadb_entry entry; member
69 struct tadb_entry entry; member
194 struct tadb_entry *entry) in read_ent() argument
196 size_t l = sizeof(*entry); in read_ent()
197 TEE_Result res = db->ops->read(db->fh, idx * l, entry, &l); in read_ent()
199 if (!res && l != sizeof(*entry)) in read_ent()
206 const struct tadb_entry *entry) in write_ent() argument
208 const size_t l = sizeof(*entry); in write_ent()
210 return db->ops->write(db->fh, idx * l, entry, l); in write_ent()
279 const struct tadb_entry *entry, in tadb_authenc_init() argument
284 const size_t enc_size = entry->prop.custom_size + entry->prop.bin_size; in tadb_authenc_init()
290 res = crypto_authenc_init(ctx, mode, entry->key, sizeof(entry->key), in tadb_authenc_init()
291 entry->iv, sizeof(entry->iv), in tadb_authenc_init()
292 sizeof(entry->tag), 0, enc_size); in tadb_authenc_init()
337 struct tadb_entry entry; in populate_files() local
339 res = read_ent(db, idx, &entry); in populate_files()
346 if (is_null_uuid(&entry.prop.uuid)) in populate_files()
349 if (test_file(db, entry.file_number)) { in populate_files()
351 entry.file_number); in populate_files()
352 memset(&entry, 0, sizeof(entry)); in populate_files()
353 res = write_ent(db, idx, &entry); in populate_files()
359 res = set_file(db, entry.file_number); in populate_files()
412 ta->entry.file_number = i; in tee_tadb_ta_create()
413 ta->entry.prop = *property; in tee_tadb_ta_create()
415 res = crypto_rng_read(ta->entry.iv, sizeof(ta->entry.iv)); in tee_tadb_ta_create()
419 res = crypto_rng_read(ta->entry.key, sizeof(ta->entry.key)); in tee_tadb_ta_create()
423 res = ta_operation_open(OPTEE_RPC_FS_CREATE, ta->entry.file_number, in tee_tadb_ta_create()
428 res = tadb_authenc_init(TEE_MODE_ENCRYPT, &ta->entry, &ta->ctx); in tee_tadb_ta_create()
485 ta_operation_remove(ta->entry.file_number); in tee_tadb_ta_close_and_delete()
488 clear_file(ta->db, ta->entry.file_number); in tee_tadb_ta_close_and_delete()
509 struct tadb_entry entry; in find_ent() local
511 res = read_ent(db, idx, &entry); in find_ent()
518 if (!memcmp(&entry.prop.uuid, uuid, sizeof(*uuid))) { in find_ent()
520 *entry_ret = entry; in find_ent()
547 size_t sz = sizeof(ta->entry.tag); in tee_tadb_ta_close_and_commit()
553 ta->entry.tag, &sz); in tee_tadb_ta_close_and_commit()
567 res = find_ent(ta->db, &ta->entry.prop.uuid, &idx, &old_ent); in tee_tadb_ta_close_and_commit()
575 res = write_ent(ta->db, idx, &ta->entry); in tee_tadb_ta_close_and_commit()
601 struct tadb_entry entry; in tee_tadb_ta_delete() local
613 res = find_ent(db, uuid, &idx, &entry); in tee_tadb_ta_delete()
620 clear_file(db, entry.file_number); in tee_tadb_ta_delete()
628 ta_operation_remove(entry.file_number); in tee_tadb_ta_delete()
651 res = find_ent(ta->db, uuid, &idx, &ta->entry); in tee_tadb_ta_open()
656 res = ta_operation_open(OPTEE_RPC_FS_OPEN, ta->entry.file_number, in tee_tadb_ta_open()
661 res = tadb_authenc_init(TEE_MODE_DECRYPT, &ta->entry, &ta->ctx); in tee_tadb_ta_open()
678 return &ta->entry.prop; in tee_tadb_ta_get_property()
684 if (!tag || *tag_len < sizeof(ta->entry.tag)) { in tee_tadb_get_tag()
685 *tag_len = sizeof(ta->entry.tag); in tee_tadb_get_tag()
688 *tag_len = sizeof(ta->entry.tag); in tee_tadb_get_tag()
690 memcpy(tag, ta->entry.tag, sizeof(ta->entry.tag)); in tee_tadb_get_tag()
699 const size_t sz = ta->entry.prop.custom_size + ta->entry.prop.bin_size; in ta_load()
725 const size_t sz = ta->entry.prop.custom_size + ta->entry.prop.bin_size; in tee_tadb_ta_read()
766 ta->entry.tag, TADB_TAG_SIZE); in tee_tadb_ta_read()