Home
last modified time | relevance | path

Searched refs:shdr (Results 1 – 13 of 13) sorted by relevance

/optee_os/core/crypto/
A Dsigned_hdr.c16 struct shdr *shdr_alloc_and_copy(const struct shdr *img, size_t img_size) in shdr_alloc_and_copy()
19 struct shdr *shdr; in shdr_alloc_and_copy() local
33 shdr = malloc(shdr_size); in shdr_alloc_and_copy()
34 if (!shdr) in shdr_alloc_and_copy()
36 memcpy(shdr, img, shdr_size); in shdr_alloc_and_copy()
40 free(shdr); in shdr_alloc_and_copy()
44 return shdr; in shdr_alloc_and_copy()
47 TEE_Result shdr_verify_signature(const struct shdr *shdr) in shdr_verify_signature() argument
79 res = crypto_acipher_rsassa_verify(shdr->algo, &key, shdr->hash_size, in shdr_verify_signature()
80 SHDR_GET_HASH(shdr), shdr->hash_size, in shdr_verify_signature()
[all …]
/optee_os/out/arm/export-ta_arm64/host_include/
A Dsigned_hdr.h33 struct shdr { struct
52 static inline size_t shdr_get_size(const struct shdr *shdr) in shdr_get_size() argument
54 size_t s = sizeof(*shdr); in shdr_get_size()
56 if (ADD_OVERFLOW(s, shdr->hash_size, &s) || in shdr_get_size()
57 ADD_OVERFLOW(s, shdr->sig_size, &s)) in shdr_get_size()
64 #define SHDR_GET_HASH(x) (uint8_t *)(((struct shdr *)(x)) + 1)
133 struct shdr *shdr_alloc_and_copy(const struct shdr *img, size_t img_size);
136 static inline void shdr_free(struct shdr *shdr) in shdr_free() argument
138 free(shdr); in shdr_free()
149 TEE_Result shdr_verify_signature(const struct shdr *shdr);
/optee_os/core/include/
A Dsigned_hdr.h33 struct shdr { struct
52 static inline size_t shdr_get_size(const struct shdr *shdr) in shdr_get_size() argument
54 size_t s = sizeof(*shdr); in shdr_get_size()
56 if (ADD_OVERFLOW(s, shdr->hash_size, &s) || in shdr_get_size()
57 ADD_OVERFLOW(s, shdr->sig_size, &s)) in shdr_get_size()
64 #define SHDR_GET_HASH(x) (uint8_t *)(((struct shdr *)(x)) + 1)
133 struct shdr *shdr_alloc_and_copy(const struct shdr *img, size_t img_size);
136 static inline void shdr_free(struct shdr *shdr) in shdr_free() argument
138 free(shdr); in shdr_free()
149 TEE_Result shdr_verify_signature(const struct shdr *shdr);
/optee_os/out/arm/export-ta_arm32/host_include/
A Dsigned_hdr.h33 struct shdr { struct
52 static inline size_t shdr_get_size(const struct shdr *shdr) in shdr_get_size() argument
54 size_t s = sizeof(*shdr); in shdr_get_size()
56 if (ADD_OVERFLOW(s, shdr->hash_size, &s) || in shdr_get_size()
57 ADD_OVERFLOW(s, shdr->sig_size, &s)) in shdr_get_size()
64 #define SHDR_GET_HASH(x) (uint8_t *)(((struct shdr *)(x)) + 1)
133 struct shdr *shdr_alloc_and_copy(const struct shdr *img, size_t img_size);
136 static inline void shdr_free(struct shdr *shdr) in shdr_free() argument
138 free(shdr); in shdr_free()
149 TEE_Result shdr_verify_signature(const struct shdr *shdr);
/optee_os/core/pta/
A Dsecstor_ta_mgmt.c40 static TEE_Result install_ta(struct shdr *shdr, const uint8_t *nw, in install_ta() argument
52 if (shdr->img_type != SHDR_BOOTSTRAP_TA) in install_ta()
58 if (shdr->hash_size > buf_size) in install_ta()
70 TEE_DIGEST_HASH_TO_ALGO(shdr->algo)); in install_ta()
76 res = crypto_hash_update(hash_ctx, (uint8_t *)shdr, sizeof(*shdr)); in install_ta()
80 offs = SHDR_GET_SIZE(shdr); in install_ta()
121 if (consttime_memcmp(buf, SHDR_GET_HASH(shdr), shdr->hash_size)) { in install_ta()
143 struct shdr *shdr; in bootstrap() local
153 if (!shdr) in bootstrap()
156 res = shdr_verify_signature(shdr); in bootstrap()
[all …]
/optee_os/ldelf/
A Dta_elf_rel.c257 Elf32_Shdr *shdr = elf->shdr; in e32_relocate() local
289 shdr[sym_tab_idx].sh_addr); in e32_relocate()
310 shdr[str_tab_idx].sh_addr); in e32_relocate()
317 shdr[rel_sidx].sh_size, &sh_end)) in e32_relocate()
485 Elf64_Shdr *shdr = elf->shdr; in e64_relocate() local
517 shdr[sym_tab_idx].sh_addr); in e64_relocate()
538 shdr[str_tab_idx].sh_addr); in e64_relocate()
623 Elf32_Shdr *shdr = elf->shdr; in ta_elf_relocate() local
626 if (shdr[n].sh_type == SHT_REL) in ta_elf_relocate()
629 Elf64_Shdr *shdr = elf->shdr; in ta_elf_relocate() local
[all …]
A Dta_elf.c351 Elf32_Shdr *shdr = elf->shdr; in e32_save_symtab() local
352 size_t str_idx = shdr[tab_idx].sh_link; in e32_save_symtab()
375 Elf64_Shdr *shdr = elf->shdr; in e64_save_symtab() local
385 shdr[tab_idx].sh_size); in e64_save_symtab()
406 Elf32_Shdr *shdr = elf->shdr; in save_symtab() local
409 if (shdr[n].sh_type == SHT_DYNSYM) { in save_symtab()
415 Elf64_Shdr *shdr = elf->shdr; in save_symtab() local
418 if (shdr[n].sh_type == SHT_DYNSYM) { in save_symtab()
1056 elf->shdr = malloc(sz); in copy_section_headers()
1057 if (!elf->shdr) in copy_section_headers()
[all …]
A Dta_elf.h50 void *shdr; member
/optee_os/core/kernel/
A Dree_fs_ta.c63 struct shdr *shdr; /* Verified secure copy of @nw_ta's signed header */ member
131 struct shdr *shdr = NULL; in ree_fs_ta_open() local
134 struct shdr *ta = NULL; in ree_fs_ta_open()
153 if (!shdr) { in ree_fs_ta_open()
162 if (shdr->img_type != SHDR_TA && shdr->img_type != SHDR_BOOTSTRAP_TA && in ree_fs_ta_open()
179 res = crypto_hash_update(hash_ctx, (uint8_t *)shdr, sizeof(*shdr)); in ree_fs_ta_open()
279 handle->shdr = shdr; in ree_fs_ta_open()
291 shdr_free(shdr); in ree_fs_ta_open()
316 memcpy(tag, SHDR_GET_HASH(handle->shdr), handle->shdr->hash_size); in ree_fs_ta_get_tag()
334 if (memcmp(digest, SHDR_GET_HASH(h->shdr), h->shdr->hash_size)) in check_digest()
[all …]
/optee_os/scripts/
A Ddump_ta_header.py23 shdr = f.read(20)
25 sig_len) = struct.unpack('<IIIIHH', shdr)
A Dsign_encrypt.py223 shdr = struct.pack('<IIIIHH',
244 h.update(shdr)
256 f.write(shdr)
/optee_os/out/arm/export-ta_arm32/scripts/
A Dsign_encrypt.py223 shdr = struct.pack('<IIIIHH',
244 h.update(shdr)
256 f.write(shdr)
/optee_os/out/arm/export-ta_arm64/scripts/
A Dsign_encrypt.py223 shdr = struct.pack('<IIIIHH',
244 h.update(shdr)
256 f.write(shdr)

Completed in 29 milliseconds