/optee_os/core/crypto/ |
A D | signed_hdr.c | 16 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 D | signed_hdr.h | 33 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 D | signed_hdr.h | 33 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 D | signed_hdr.h | 33 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 D | secstor_ta_mgmt.c | 40 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 D | ta_elf_rel.c | 257 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 D | ta_elf.c | 351 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 D | ta_elf.h | 50 void *shdr; member
|
/optee_os/core/kernel/ |
A D | ree_fs_ta.c | 63 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 D | dump_ta_header.py | 23 shdr = f.read(20) 25 sig_len) = struct.unpack('<IIIIHH', shdr)
|
A D | sign_encrypt.py | 223 shdr = struct.pack('<IIIIHH', 244 h.update(shdr) 256 f.write(shdr)
|
/optee_os/out/arm/export-ta_arm32/scripts/ |
A D | sign_encrypt.py | 223 shdr = struct.pack('<IIIIHH', 244 h.update(shdr) 256 f.write(shdr)
|
/optee_os/out/arm/export-ta_arm64/scripts/ |
A D | sign_encrypt.py | 223 shdr = struct.pack('<IIIIHH', 244 h.update(shdr) 256 f.write(shdr)
|