mirror of
git://nv-tegra.nvidia.com/tegra/optee-src/nv-optee.git
synced 2025-12-22 09:22:04 +03:00
Updating prebuilts and/or headers
df74e654e27c07ba2b83fc80f46368c1aa63d713 - optee_src_build.sh d15f50688485e11293e0d0bd66d73655e79f7718 - nvcommon_build.sh 94631ac9bb0297e7d636c0b76fbb046abbb62df2 - optee/tegra234-optee.dts f17a52a204d42c6699bdc375e3aace6bcdcfdbf9 - optee/tegra194-optee.dts e7fe1d82e00a66f594a738016d2c3f0040ba065a - optee/optee_os/MAINTAINERS 8c2c72f00c2c6eef765a45d8b8eee4adca4b43a0 - optee/optee_os/CHANGELOG.md bf1387b548dae92223ef175a7d56e4f88d6cfe84 - optee/optee_os/Makefile 6bf9bd872a69d8c13e8dcac71fac8d094646251d - optee/optee_os/README.md 370d68b1c9485f254e7c701c31e3c74fd16cacd7 - optee/optee_os/LICENSE 3a608e255399bb5cf2302bb52e533d81c469ecce - optee/optee_os/LICENSE.NVIDIA 96558a7a79bf90ebde8720b0087c9c578efa981b - optee/optee_os/.checkpatch.conf 25ecfc13bc9b5205cb9db1ffb015fa973c8a754b - optee/optee_os/typedefs.checkpatch edc01ccf3e16f1a4bdb1908f57a4722d3bfa203a - optee/optee_os/scripts/checkpatch.sh c92fcf555467abe77b88cea98e805eaa6eca5462 - optee/optee_os/scripts/gen_ld_sects.py 24ab5b3587dac3d8b99136338a79a57b38027da9 - optee/optee_os/scripts/mem_usage.py 31f300bb6c5a381759d5e2a3b54e42039be66dd5 - optee/optee_os/scripts/sign_helper_kms.py ff71ab8e19870db30e4a8fba666168c645f37126 - optee/optee_os/scripts/tee_bin_parser.py f5129e67acb9e8d845d39e92497f7de01ae50522 - optee/optee_os/scripts/symbolize.py ab4324da2d6fb92edbcaa95bc23911ed63e4514d - optee/optee_os/scripts/arm32_sysreg.py cfc4d70e52ea54f55638942bf254588c218d311f - optee/optee_os/scripts/ts_bin_to_c.py e13049cc7ecc4774a0b40b42d6a72617f540db8d - optee/optee_os/scripts/bin_to_c.py 76a908634bfe89773fd70c57fd77d712c4bc89ee - optee/optee_os/scripts/sign_encrypt.py ffaf1fbbaa6d01cecaeae7d8ce75f8315240228d - optee/optee_os/scripts/pem_to_pub_c.py 08b1957d02a5f8fb853138fa4b3f2b8b04f8d847 - optee/optee_os/scripts/update_changelog.py e6692bdad99dbf466f146fe7169981ae542eb6cd - optee/optee_os/scripts/get_maintainer.py bf2d92432e259f18d97d2a955e3192aa3c98813f - optee/optee_os/scripts/checkpatch_inc.sh b1241b7d0c39f88fb4382637396901002f682b69 - optee/optee_os/scripts/gen_tee_bin.py f8bce245ce0b6610d39e02928e25307a5b6cc818 - optee/optee_os/scripts/print_tee_hash.py 570bf1d2a225e0124496bc57c287ff0991fd023a - optee/optee_os/scripts/gen_stmm_hex.py d302da149f2f0d0b11b9c365bf3add51a131b8a9 - optee/optee_os/scripts/gen_ldelf_hex.py c5d1a1d261c8bada5f949335bffe29a029d03e05 - optee/optee_os/ldelf/syscalls_a32.S 4b036af7eee80c9d1402b0b1dcd09cab729a7a9b - optee/optee_os/ldelf/pauth.c db3db1aeff618f5696eb16e7076b63464784267e - optee/optee_os/ldelf/syscalls_asm.S 7126b1fbc89ca63285473f1123be50f2547e8783 - optee/optee_os/ldelf/ta_elf_rel.c f38c4636b6798cab2823555649a59b72061b756b - optee/optee_os/ldelf/ldelf.ld.S cb079ab7bac5d488cf5375c1b028130bcb2c7997 - optee/optee_os/ldelf/sys.h d875d1a5979daa09b5b535d0a3f040c86a60f078 - optee/optee_os/ldelf/start_rv64.S 139e3f4826e35954af3c3bfe5112f11c1bd0db62 - optee/optee_os/ldelf/syscalls_rv.S 34de0a40ccfb6261b73bd7bad69bc8deae4d7b83 - optee/optee_os/ldelf/main.c 87d8438d725c689049dabad1a58459a5efaaef0a - optee/optee_os/ldelf/dl.c 6be295fcd01de4a3c85a70f622f14d21dd0f9e95 - optee/optee_os/ldelf/ta_elf.c f133be54ea11df978fa33a5afe3a2d8ed8c8f035 - optee/optee_os/ldelf/pauth.h 29a349fad517b13af907e7705113c3831dccd9e9 - optee/optee_os/ldelf/syscalls_a64.S b8dfc91cf5557585f6b8ca8bf02de131b81a8761 - optee/optee_os/ldelf/ta_elf.h 611d7981c55b4c62f5b13677c04a314e1a2f3218 - optee/optee_os/ldelf/dl.h 20655cc8868222c793eaf2045022fe254ae72f73 - optee/optee_os/ldelf/ftrace.c ecc193b3d2a051728bc5d4e5841c8bdc021b6d35 - optee/optee_os/ldelf/sys.c 9201638e87d7051478eaabddd7ca1d9054f35f5f - optee/optee_os/ldelf/tlsdesc_rel_a64.S 13ded24e6da6026069baf1c4dd3159b6410f5308 - optee/optee_os/ldelf/start_a64.S a270591f1efb8037df1d1369287b15f5f2964e0c - optee/optee_os/ldelf/start_a32.S af3868e37b5f97fafb0a1843478916e687050325 - optee/optee_os/ldelf/ftrace.h e753e305779ac38002c5db612439fd95d3e9a20d - optee/optee_os/ldelf/include/ldelf_syscalls.h 9d6a14f727a55f4691af8e78834e23c243a1be39 - optee/optee_os/ldelf/include/ldelf.h 73be8d9cc10ccf4ecc646ab51ec17b8bbb51177c - optee/optee_os/core/mm/fobj.c d8a0dde12ce3d5eec6373fbf9d3a5292b73a9f57 - optee/optee_os/core/mm/mobj.c c3f15722f779f9fa7c746d6926c361ad9acf253b - optee/optee_os/core/mm/tee_mm.c 448b224d13da51447f6e1b98759ee562d8214172 - optee/optee_os/core/mm/vm.c cda2e1ec5f1aa6988d7c008a9bdf0036834affbc - optee/optee_os/core/mm/core_mmu.c 4c81a53362b3a07b1dabb5a197f0e3ec26117bee - optee/optee_os/core/mm/file.c 22edc57cadee3b6787489b0d44956d4bbeec2ab6 - optee/optee_os/core/tests/ftmn_boot_tests.c fdcbba144185422b3358f9b1e37648325785bd3b - optee/optee_os/core/arch/riscv/mm/tlb_helpers_rv.S 2055966a05cfa317cfedd7b7fa61120de3887b6d - optee/optee_os/core/arch/riscv/kernel/arch_scall.c ff0583c210b0d08923058c5b88884af14a634d23 - optee/optee_os/core/arch/riscv/kernel/thread_rv.S de03d1758884a3e0e0f7ea910139d312790963d1 - optee/optee_os/core/arch/riscv/kernel/arch_scall_rv.S 0f43c49d2273009469484b2cc76a2b941e4d9d68 - optee/optee_os/core/arch/riscv/kernel/cache_helpers_rv.S ae816f807c281348a9c45477cf12d500dbedc2b4 - optee/optee_os/core/arch/riscv/kernel/abort.c 66cbb4c5aaec299ae2ada34564f853e51dda0c88 - optee/optee_os/core/arch/riscv/kernel/entry.S f28a3e13c2adddd945644d7e1c854918769a51db - optee/optee_os/core/arch/riscv/kernel/asm-defines.c 5cdff36d678ecaf259d131b235eaae03cd6ac555 - optee/optee_os/core/arch/riscv/kernel/sbi_console.c 30e9802c7448df47767d12a2646fefdc0d2b2f63 - optee/optee_os/core/arch/riscv/kernel/tee_time_rdtime.c 328d1c384a1fa2a526647211cd7cb002ed0e405f - optee/optee_os/core/arch/riscv/kernel/sbi.c 07c3499c0be1a28930978ace71005cfbed42ffe8 - optee/optee_os/core/arch/riscv/kernel/thread_arch.c 7f1c0c47cf8d4455d3bb56977982a34a008a7fbe - optee/optee_os/core/arch/riscv/kernel/spinlock.S 6c73b5fc6d37345ad9f610b7c2fedb763caa640c - optee/optee_os/core/arch/riscv/kernel/boot.c ef752dba0afbc3441defa0ce7f596275e4eacdf6 - optee/optee_os/core/arch/riscv/kernel/idle.c 651df224b31ff54d4fb317a17064937a491e94a0 - optee/optee_os/core/arch/riscv/kernel/kern.ld.S f955830a97a8a4231a0876fd8d1b2fc8bf3fabff - optee/optee_os/core/arch/riscv/include/riscv.h aaf4ec0db08de01b5e8012ce949710f9dcf0f993 - optee/optee_os/core/arch/riscv/include/encoding.h 38bc96a69aa9f591d848f9d2e8142862a8e2b624 - optee/optee_os/core/arch/riscv/include/riscv_macros.S 2e5b805bffc68fffc3c98a3a1b5c7868a2d175f9 - optee/optee_os/core/arch/riscv/include/sbi.h 50020758ad41a07b9fd0fc1986413e61fceea469 - optee/optee_os/core/arch/riscv/include/mm/core_mmu_arch.h f90a39605a177515f57172f8bfcac31468bec502 - optee/optee_os/core/arch/riscv/include/mm/generic_ram_layout.h 9b0914d8eab20042998f50ed711cf154e3a65901 - optee/optee_os/core/arch/riscv/include/kernel/time.h 73b1c65df1603ea0e0f934fb8bcf951c475ab1de - optee/optee_os/core/arch/riscv/include/kernel/thread_private_arch.h 0c4cbba16aac1f17267a36ecda588756cfd3277c - optee/optee_os/core/arch/riscv/include/kernel/clint.h 072f3b42da8ea82d534b28a5f3b298c6bcbfd9a9 - optee/optee_os/core/arch/riscv/include/kernel/tlb_helpers.h 1121c6b1cd7d9f9ada431b691b4fa06bc14c8bea - optee/optee_os/core/arch/riscv/include/kernel/misc_arch.h d52408d38337f5b9bd967661199d3207bc29ef62 - optee/optee_os/core/arch/riscv/include/kernel/tee_l2cc_mutex.h 826a1d5fe853d5d25e39ce6e66d577e479b11016 - optee/optee_os/core/arch/riscv/include/kernel/stmm_sp.h 8cc637a0b1fa21930752c33d1cc58d647bc81179 - optee/optee_os/core/arch/riscv/include/kernel/arch_scall.h b3be5129fb98824666e9dbe5734dd1f811ab97d4 - optee/optee_os/core/arch/riscv/include/kernel/cache_helpers_arch.h 9ff069cbffd055e8fc24029279eafec7c295b34a - optee/optee_os/core/arch/riscv/include/kernel/secure_partition.h a407be51b81a27f999cf225a9ddba777cbd7ac31 - optee/optee_os/core/arch/riscv/include/kernel/delay_arch.h 3c92f821bb1cb8889d1ff4a5c047a465faceaca8 - optee/optee_os/core/arch/riscv/include/kernel/thread_arch.h 25fbb2839f929c582b956f5d3efb8930b8001a21 - optee/optee_os/core/arch/riscv/plat-spike/platform_config.h 13929110b72beaf2860119c208b13d15c270a4e2 - optee/optee_os/core/arch/riscv/plat-spike/main.c f4d75a0309e2040dbb1ca13717a13dfa6be01e03 - optee/optee_os/core/arch/riscv/plat-spike/kern.ld.S 558db749b68778acc836e96fc170bc823ab0e441 - optee/optee_os/core/arch/riscv/plat-spike/drivers/htif.c 359b98fad7ce1225b5fb675394acb32df9e74380 - optee/optee_os/core/arch/riscv/plat-spike/drivers/htif.h 0e70c8d59484616ecdb0c1b5c5c9581fdc86ae24 - optee/optee_os/core/arch/riscv/plat-virt/platform_config.h fc3e11858f322992f6f271cdebedd8d4d22daa5c - optee/optee_os/core/arch/riscv/plat-virt/main.c a1a353aa32ebd77dd5c2966ff38e024d0e8938bb - optee/optee_os/core/arch/arm/plat-k3/platform_config.h 61851f968e6974914e4ece81f9769761fbdf4a86 - optee/optee_os/core/arch/arm/plat-k3/main.c 4cc70212f3fc61c9fd17876bbc6170b0548bcddf - optee/optee_os/core/arch/arm/plat-k3/drivers/sec_proxy.c 2020136e5c1ef325c92bc319ebb5f582d8d1b447 - optee/optee_os/core/arch/arm/plat-k3/drivers/sa2ul.h 96e780127fe944086f4e057b31baea9b2fa125e2 - optee/optee_os/core/arch/arm/plat-k3/drivers/sec_proxy.h a918fd9f66105e822efddf7848f7bdf38418656e - optee/optee_os/core/arch/arm/plat-k3/drivers/ti_sci_protocol.h 934412647964baa2217cd31f41cc1e96e1691313 - optee/optee_os/core/arch/arm/plat-k3/drivers/ti_sci.h cbad8ded2c71cdb2604713b866cbb2ef88fb879f - optee/optee_os/core/arch/arm/plat-k3/drivers/ti_sci.c 5b5e14b90101fd4c4b62a395517fa027a0d3cd61 - optee/optee_os/core/arch/arm/plat-k3/drivers/sa2ul_rng.c a72f2a95976d21b776dd99c722162a461e575190 - optee/optee_os/core/arch/arm/plat-k3/drivers/sa2ul.c e8c669f6cd515061ddc1fac878644149427040c8 - optee/optee_os/core/arch/arm/plat-rockchip/psci_rk322x.c 86e640e06414afd26ad833d31867572408fd251a - optee/optee_os/core/arch/arm/plat-rockchip/platform_config.h bdf9159293e4276febcee2971495ac1b293f9c05 - optee/optee_os/core/arch/arm/plat-rockchip/platform_px30.c 46a2594f3aa4681ffd83538ff397c8e3bf3974ca - optee/optee_os/core/arch/arm/plat-rockchip/grf.h de4933508c95b4cc044fec515f190d8ff6ebfdc0 - optee/optee_os/core/arch/arm/plat-rockchip/common.h 23bc0f69590154217ef6aa3bf2994644e95460ff - optee/optee_os/core/arch/arm/plat-rockchip/main.c 0a8ff2cde4d20336967135064473ce0e27a74ab8 - optee/optee_os/core/arch/arm/plat-rockchip/platform_rk3399.c 384be00889fd82aa785e7d07fa9f819c764557c4 - optee/optee_os/core/arch/arm/plat-rockchip/platform.h 55fa18d095461797359151b9c915092623f26367 - optee/optee_os/core/arch/arm/plat-rockchip/platform.c b74b363d6e2a566d4a03278aaacaf9391d505a44 - optee/optee_os/core/arch/arm/plat-rockchip/cru.h 1853ca66ab2f40919fcb69448e1b866eb2bc9e4b - optee/optee_os/core/arch/arm/plat-rockchip/core_pos_a32.S 24c8244ba3044caed1943ad05138413c6db6ab2e - optee/optee_os/core/arch/arm/plat-rockchip/platform_rk322x.c 971d879311868f34f4ebf712ba6de5f9f0ea6f35 - optee/optee_os/core/arch/arm/plat-rockchip/plat_init.S 1db073f2c2461a415ef38ec49964e57e0bbb91a1 - optee/optee_os/core/arch/arm/mm/mobj_dyn_shm.c fbf52bc1a50fae147acaeca0138d7dc640a88275 - optee/optee_os/core/arch/arm/mm/pgt_cache.c 97833bee07659a62e8ae1fd84785699502dd3027 - optee/optee_os/core/arch/arm/mm/core_mmu_v7.c 8e0dd71c8033f999a5bc20eea5e67308b91bcbf8 - optee/optee_os/core/arch/arm/mm/mobj_ffa.c e6f86e9d7f1972ae55f5ca9938620da5246c59b8 - optee/optee_os/core/arch/arm/mm/sp_mem.c dd9bfba08ae055c5ec8f97267c700a1526ff774c - optee/optee_os/core/arch/arm/mm/core_mmu.c 9007b3e86aaee64aababa1855ee5e8a53ad4b987 - optee/optee_os/core/arch/arm/mm/core_mmu_lpae.c 014f76e8da8e41ddcb44997962ae5ed43c0c5adc - optee/optee_os/core/arch/arm/mm/tee_pager.c 7b9a469836ce4379d91402d65fd684661f49b0ea - optee/optee_os/core/arch/arm/plat-vexpress/platform_config.h 178685f16c79b3f0dd48d1b8fb551d428ab67b68 - optee/optee_os/core/arch/arm/plat-vexpress/juno_core_pos_a32.S be2b439ddca86087d85c34efb54fc3e4cfbfc772 - optee/optee_os/core/arch/arm/plat-vexpress/main.c 390b45a60cc4219e64e58f0ca0ea2890dc31a351 - optee/optee_os/core/arch/arm/plat-vexpress/vendor_props.c cbbb4b7ba94d66daba35e4e8de0e1ea8f3975534 - optee/optee_os/core/arch/arm/plat-vexpress/juno_core_pos_a64.S 1e704fbe287361b0b3f5ce3637b260c8d1740c64 - optee/optee_os/core/arch/arm/plat-sam/platform_config.h d452ceba090437688ae1658171bcda10e43263b4 - optee/optee_os/core/arch/arm/plat-sam/tz_matrix.h e99e2242a257c7200f0fbe85c4e9d6524551effe - optee/optee_os/core/arch/arm/plat-sam/matrix.c 86f20052c0aa65ddfcab873b3b6141abfb4efcca - optee/optee_os/core/arch/arm/plat-sam/matrix.h c85debf71cacdc0e53e262424984cec5fece885f - optee/optee_os/core/arch/arm/plat-sam/sama5d2.h f04b1753cc27916946e5415343e2976328330716 - optee/optee_os/core/arch/arm/plat-sam/sam_sfr.c 23568f555834f144fec9951e708608b0fc1f3e72 - optee/optee_os/core/arch/arm/plat-sam/main.c 9e03ab42551128401c4786a75250b1db1cd4922d - optee/optee_os/core/arch/arm/plat-sam/sam_pl310.c 91fd5dd0e7ed91073e6858e4a603e2028166a440 - optee/optee_os/core/arch/arm/plat-sam/freq.c 05ae55b82f1b86db41cd5dec856b760b9cbac2db - optee/optee_os/core/arch/arm/plat-sam/sam_sfr.h 51975d5a6d4516cacb42fd70885043c1f8b6fbf1 - optee/optee_os/core/arch/arm/plat-sam/pm/psci.c e163a9a58cd5dacad7354b43af80bcc98377198f - optee/optee_os/core/arch/arm/plat-sam/nsec-service/smc_ids.h d71fe9727d8c848f74ebf421e52d41874966c63a - optee/optee_os/core/arch/arm/plat-sam/nsec-service/sm_platform_handler.c bfd010647330fd2fbafb08a6d68018496917c18f - optee/optee_os/core/arch/arm/plat-imx/mmdc.c 13e40fd4f55de4dc5467690339cf670d76621be0 - optee/optee_os/core/arch/arm/plat-imx/imx-common.c 584afcf20fad8029781743589f1d8b888d4d7edf - optee/optee_os/core/arch/arm/plat-imx/platform_config.h 6b46c0394b08058417bc2e944755e80f03294068 - optee/optee_os/core/arch/arm/plat-imx/imx-regs.h 52eae24d48e8e56160dd7b94e68bba26eb530dd8 - optee/optee_os/core/arch/arm/plat-imx/imx_pm.h 19f7be18a342945b17601d7b48c613ea1468eaa2 - optee/optee_os/core/arch/arm/plat-imx/a9_plat_init.S d9b0648c8e36c59fdae8fb59cf9f73a55b9bb1f3 - optee/optee_os/core/arch/arm/plat-imx/mmdc.h c35c8cbec5594f84ab070a6f2cf5699a257c9e97 - optee/optee_os/core/arch/arm/plat-imx/main.c adedaaade5c7177a170c74433b126fb1bd75463b - optee/optee_os/core/arch/arm/plat-imx/sm_platform_handler.c 9dd99c00f7ebbed992c4d8e608ab3716943036e9 - optee/optee_os/core/arch/arm/plat-imx/imx_pl310.c 764fa6e4d0b52fc075ffcb78ba6986ed14d1b58f - optee/optee_os/core/arch/arm/plat-imx/imx_pm_asm_defines.c 98e0fc14280969c4814e9bcf1d2d4421c60f5b2c - optee/optee_os/core/arch/arm/plat-imx/imx_src.c 576710aa6118eebca00bfa8024c4f48ad57b89ec - optee/optee_os/core/arch/arm/plat-imx/a7_plat_init.S fd1bb378da6d088df88b2239b006b4abb715d0c9 - optee/optee_os/core/arch/arm/plat-imx/imx.h 658c3b177340e2efe74ac7cfe5a0c688aeadf90d - optee/optee_os/core/arch/arm/plat-imx/imx_pl310.h 7a47d9b9d80c3ff0539ada4663d95c9e7bdac984 - optee/optee_os/core/arch/arm/plat-imx/tzc380.c 6c0a9e819b3e4b156c47a4761eef280bcfd0ab2f - optee/optee_os/core/arch/arm/plat-imx/config/imx6sll.h 2d95ab53312d29b23061b747e96c695708612d8d - optee/optee_os/core/arch/arm/plat-imx/config/imx6qdlsolo.h be59b37f3baf5d18ad949415e77e4c09a1a2ebb3 - optee/optee_os/core/arch/arm/plat-imx/config/imx6sl.h 93a6155f6f294fddb38ac1947f5dce49d68f71d5 - optee/optee_os/core/arch/arm/plat-imx/config/imx6sx.h fd5c0094f7478ca392710675be72762df5522ebc - optee/optee_os/core/arch/arm/plat-imx/pm/gpcv2.c 383f57d643594c46ec3f7a0b6342fb8d976e6566 - optee/optee_os/core/arch/arm/plat-imx/pm/imx7_suspend.c 68c57702c19d7b9cc0d9a7e5d39968c182cb2129 - optee/optee_os/core/arch/arm/plat-imx/pm/pm-imx7.c 8713d58f831e01a4cd24103e702ada984ed748b7 - optee/optee_os/core/arch/arm/plat-imx/pm/psci.c 245cf6f7ca67610e492c7b95b945f66d2b7829ee - optee/optee_os/core/arch/arm/plat-imx/pm/psci-cpuidle-imx7.S 640fb698681bfca764520cc693b288ff48625deb - optee/optee_os/core/arch/arm/plat-imx/pm/psci-suspend-imx7.S 034c5104ca928cc8bd7b6a3358cdcd84136211bc - optee/optee_os/core/arch/arm/plat-imx/pm/cpuidle-imx7d.c 0ab3222c89bd29af45b6838cb1126597ea378f7f - optee/optee_os/core/arch/arm/plat-imx/registers/imx8ulp.h 1fc0e208fd97087384233268cbda1cce852b796b - optee/optee_os/core/arch/arm/plat-imx/registers/imx7.h 46dc26d459e4a5adb2a904c7f6b4c5ef4546ab75 - optee/optee_os/core/arch/arm/plat-imx/registers/imx8m-crm.h 55f6aaaf23e460dbfd791e81c80dd5de5d3bfbfa - optee/optee_os/core/arch/arm/plat-imx/registers/imx8ulp-crm.h e9be4cf1ba19e2e02c3e7a89623e1c67e49737ee - optee/optee_os/core/arch/arm/plat-imx/registers/imx6.h b355b4bb04068d735c1faa8039e1ade0d88d60d2 - optee/optee_os/core/arch/arm/plat-imx/registers/imx6-crm.h f93579c365bf08fb597488903040c0b92041517d - optee/optee_os/core/arch/arm/plat-imx/registers/imx8q.h 3931a5db91c6b50993dba75c296966e3e9416994 - optee/optee_os/core/arch/arm/plat-imx/registers/imx7ulp-crm.h c418919325c1927ee3ba3fdc8043d323e630c7e1 - optee/optee_os/core/arch/arm/plat-imx/registers/imx8m.h e8e364071825472444c0223168929efe4a9385d2 - optee/optee_os/core/arch/arm/plat-imx/registers/imx93.h 1a557c230d0c95aeb775b8f02c4a5294b829132e - optee/optee_os/core/arch/arm/plat-imx/registers/imx7ulp.h 443dd0395348c2b831b9ea34e1d0df567e22dfa4 - optee/optee_os/core/arch/arm/plat-imx/registers/imx6-dcp.h 7df27071dbcbeb1f977a02e17445136fa22a3749 - optee/optee_os/core/arch/arm/plat-imx/registers/imx7-crm.h e7cc05f8f313444c45b38132967f4b1393085a94 - optee/optee_os/core/arch/arm/plat-hikey/platform_config.h fd0dd2e67f5f756333f60c8a6f150e5605c8259a - optee/optee_os/core/arch/arm/plat-hikey/main.c 9899b78e83cfa336552e36d0be06113de438bf15 - optee/optee_os/core/arch/arm/plat-hikey/hikey_peripherals.h 79b3882bc2b3c0bf0492d2dc0385354668138f7b - optee/optee_os/core/arch/arm/plat-hikey/spi_test.c 1ec6602a1f0bc43336d5045adcf92c45c39c4423 - optee/optee_os/core/arch/arm/plat-mediatek/platform_config.h 1afa2f2d04c2c6ba8be7c4d06ef97fefbb03fad3 - optee/optee_os/core/arch/arm/plat-mediatek/main.c b1b7de5b516440a686f80083730d8a139d7cad97 - optee/optee_os/core/arch/arm/plat-synquacer/synquacer_rng_pta.h 596136d3b40cd1cbae47d4ed48a5b4d246e08dfe - optee/optee_os/core/arch/arm/plat-synquacer/platform_config.h f7a4aebaabf328850a24fb10ee67d11494346bca - optee/optee_os/core/arch/arm/plat-synquacer/rng_pta.c 0ed37a1910492656246f85705f9b93df490f10eb - optee/optee_os/core/arch/arm/plat-synquacer/main.c 0b99d0c7135e7f0002ef7a51d63461307e66203b - optee/optee_os/core/arch/arm/plat-bcm/platform_config.h 92cb86eafac038fc02be252efc14c3e3316f27af - optee/optee_os/core/arch/arm/plat-bcm/crc32.h 3d4f18ba7a9634be9a46f900264cb0132fd65654 - optee/optee_os/core/arch/arm/plat-bcm/bcm_elog.h b867c067653be4032105afc77ee562740d8d241e - optee/optee_os/core/arch/arm/plat-bcm/main.c 435d5321e6d484c095ede7a5b320ec92fddb3025 - optee/optee_os/core/arch/arm/plat-bcm/bcm_elog.c db3ddcb5c48ff30c64e8b561ed5300400d67bca1 - optee/optee_os/core/arch/arm/plat-bcm/crc32.c 84db75f5c982cafdce7ebdb1f5080253cc0f15d7 - optee/optee_os/core/arch/arm/plat-stm32mp1/platform_config.h 105fcd115c8f37f13c3f1617c6e564dce1a1a50f - optee/optee_os/core/arch/arm/plat-stm32mp1/reset.S 02204c43ef491bc5768cc1dd754c14e96a79c402 - optee/optee_os/core/arch/arm/plat-stm32mp1/stm32_util.h 0347bb1185d401c31ba23382067c63801859b98a - optee/optee_os/core/arch/arm/plat-stm32mp1/shared_resources.c 41fc0d480726ccac287c2341b62956a102d2b134 - optee/optee_os/core/arch/arm/plat-stm32mp1/boot_api.h 374484f26498072118ccdcb034fe90dba4c5ba13 - optee/optee_os/core/arch/arm/plat-stm32mp1/main.c 085787300ce325b32fffae16ae2889f02e925f20 - optee/optee_os/core/arch/arm/plat-stm32mp1/scmi_server.c 4cd706376b2b8e9f29529251f6e8dd0f97b45a2d - optee/optee_os/core/arch/arm/plat-stm32mp1/link_dummies_paged.c 70226b5b77dd3722328a07eb44802b30f9c7926e - optee/optee_os/core/arch/arm/plat-stm32mp1/plat_tzc400.c a1238faa3df41c0c66412e3b032255e1cd4988eb - optee/optee_os/core/arch/arm/plat-stm32mp1/scripts/stm32image.py a3ac99fd762c9216188d37d084dd70008fbe1199 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_etzpc.h 61bf4808eef711cc1f7e49f85642e691865fbac5 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.h aba3134290522c123b965727423536367134df31 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pwr.c 36a643ca9888123735aee8f3a13fac3544304bdc - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pwr.h 5ce02d8d7ff756a903800fa1b2634052ba695738 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c d51b20c506376c9a4d0d94786e6de3d46e871540 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_syscfg.c 976f6cd43eb43bf7d8923851c1305a326bd1180a - optee/optee_os/core/arch/arm/plat-stm32mp1/pm/psci.c 536663cb01d75d67a4021fe8314c5ae79909dbd8 - optee/optee_os/core/arch/arm/plat-stm32mp1/nsec-service/stm32mp1_smc.h 4e92814caf4d208f3424697ce4a54cbceba75632 - optee/optee_os/core/arch/arm/plat-stm32mp1/nsec-service/stm32mp1_svc_setup.c d335d9bb50b2453d365ca88f3f18520fdd0a1086 - optee/optee_os/core/arch/arm/plat-stm32mp1/nsec-service/bsec_svc.c e7ec6cb3b0018db5664ccd87d3ab1529e5d5713e - optee/optee_os/core/arch/arm/plat-stm32mp1/nsec-service/bsec_svc.h 11ce785f6bdd56fdc8b32c6c2174a9b49b96b230 - optee/optee_os/core/arch/arm/plat-uniphier/platform_config.h 84c6815e58e7c13740a2e365505da1aa9d87a325 - optee/optee_os/core/arch/arm/plat-uniphier/main.c c043a9411306559a982b5d09ae419821ff026bd0 - optee/optee_os/core/arch/arm/plat-uniphier/kern.ld.S 012cc9cc5cd4d1213266d657558cd6c1fb998e1f - optee/optee_os/core/arch/arm/plat-hisilicon/platform_config.h bf4be1dd46e6278e5b9b8b6a40b710d90007d915 - optee/optee_os/core/arch/arm/plat-hisilicon/hi3519av100_plat_init.S 114f50b1c0140361479b38126c3cc1d0607a3f91 - optee/optee_os/core/arch/arm/plat-hisilicon/main.c 1e0932868e4fc72946b4b12a3650c383dcdd7a79 - optee/optee_os/core/arch/arm/plat-hisilicon/hi3519av100.h 92415c6775326559b08df1d2a9976b3e1ebb0a72 - optee/optee_os/core/arch/arm/plat-hisilicon/psci.c 43dcd40dee8c1bca63526b7590768c430e2b9eb4 - optee/optee_os/core/arch/arm/plat-corstone1000/platform_config.h a955b4ec9fb79d3fd9dcab27f3d88534ba669c6e - optee/optee_os/core/arch/arm/plat-corstone1000/main.c 9421c26b6ce38f1d5da0e2f431afc0cab732f0e6 - optee/optee_os/core/arch/arm/sm/std_smc.c 0fbfd45981f9512d688a49c32add4297540c689e - optee/optee_os/core/arch/arm/sm/pm_a32.S 615d9401894c37dec5e5ebe9bcdb678df854564e - optee/optee_os/core/arch/arm/sm/psci-helper.S d15ae1ce071edbfc8d4d4de7c944cb1d8712136e - optee/optee_os/core/arch/arm/sm/sm.c bbd1df35108340d6d4e6179926681fb794f8ce12 - optee/optee_os/core/arch/arm/sm/sm_private.h 8a9cd4bad5748dac76110944be1fb3442e98b2f6 - optee/optee_os/core/arch/arm/sm/psci.c 45960371e7a1224c4d067ff3c172952b7d616998 - optee/optee_os/core/arch/arm/sm/sm_a32.S 79b02c9017b471e73d8c11acc7f91278ec851f2b - optee/optee_os/core/arch/arm/sm/pm.c 2701a5021cec550314803b83b43e5a3fa6f6aadb - optee/optee_os/core/arch/arm/dts/stm32mp13xf.dtsi abbe0e5a7c63995c207b1995649e3a6ed6b4221a - optee/optee_os/core/arch/arm/dts/stm32mp15xc.dtsi c07147cb14bc871e069f3be8248fc2c79e311949 - optee/optee_os/core/arch/arm/dts/stm32mp15xxad-pinctrl.dtsi d23af59b64d5380f6f9c8ca37a1a5b1af3e9f93c - optee/optee_os/core/arch/arm/dts/at91-sama5d27_som1_ek.dts 9be7fd7b5c30eae1dc855f6bfca353c455dd812b - optee/optee_os/core/arch/arm/dts/stm32mp157c-dk2.dts 5c329735e2a8eb85255d6ddd7a56064d03034cb2 - optee/optee_os/core/arch/arm/dts/stm32mp151.dtsi 1985ea8670dc7c7937541f6b2da9c30c41ee000d - optee/optee_os/core/arch/arm/dts/at91-sama5d27_wlsom1.dtsi c8ec256ae55cb6c849aa51624b9974259884b159 - optee/optee_os/core/arch/arm/dts/at91-sama5d2_xplained.dts 2701a5021cec550314803b83b43e5a3fa6f6aadb - optee/optee_os/core/arch/arm/dts/stm32mp13xc.dtsi 0f41a6ee8e489bec0d79a976edb540945506d498 - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dhcor-som.dtsi 9df393dc1bdde2c8ab9deca10271f9135234a752 - optee/optee_os/core/arch/arm/dts/stm32mp13-pinctrl.dtsi c801e4c35f00786835f0cd63b71559a146086866 - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dhcor-io1v8.dtsi 41aa3da18dcb49b316aefc9ad5eed7dc2664dabc - optee/optee_os/core/arch/arm/dts/stm32mp157c-ev1.dts 794650f14bc79f9ccc2033efdc81da79623d351d - optee/optee_os/core/arch/arm/dts/stm32mp157c-ed1.dts 0cc38427ae1b225d88d000f9438b7cc34e883b30 - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dhcom-pdk2.dtsi 6510b2294cc4aeb2601cce6f17cffc6eee8c58dc - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dkx.dtsi 8fccbbae61ee6f2694b88563c096e640101dae55 - optee/optee_os/core/arch/arm/dts/sama5d2.dtsi ce82c06ac99261e680a62585d80c90e9dfe941fb - optee/optee_os/core/arch/arm/dts/stm32mp157c-dhcom-pdk2.dts 6ed7397e2751cabb21fc7e87b53983b9117d2e26 - optee/optee_os/core/arch/arm/dts/sama5d2-pinfunc.h e28863664f28385599bf66b2a690760e4c1bd63d - optee/optee_os/core/arch/arm/dts/stm32mp157a-dk1.dts 6c18e9690a909c9b4898d1d609cdf3874e22d19a - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dhcor-avenger96.dtsi 361479ac7684841706aca2fdb4c3d2c9f8e0e13e - optee/optee_os/core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi 94f010962fb67b20e43e2f44cb3f317f624d91e1 - optee/optee_os/core/arch/arm/dts/stm32mp135f-dk.dts d26bbcf985b7523a6af715be4feb22233be74ba5 - optee/optee_os/core/arch/arm/dts/stm32mp15xxaa-pinctrl.dtsi d7230a1568081b9a39b151bbe38f188691b2b84b - optee/optee_os/core/arch/arm/dts/fsl-lx2160a-rdb.dts b318d72ed3eee6e4bd7d8ecdb5b1eba8dfc31f89 - optee/optee_os/core/arch/arm/dts/stm32mp157.dtsi 9dea507c72c9eec09336578711a432b198478a56 - optee/optee_os/core/arch/arm/dts/at91-sama5d27_som1.dtsi d6dbda8b14af74b3a63db810c4c4ed53bfb097bc - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dhcom-som.dtsi 0c1276612681bf9f22517513242e678c22551542 - optee/optee_os/core/arch/arm/dts/stm32mp153.dtsi 194fd8067d397ca409c3380341a5de0277269382 - optee/optee_os/core/arch/arm/dts/stm32mp135.dtsi f8387a2601ba505a39c886a752ab25e6ece458de - optee/optee_os/core/arch/arm/dts/fsl-lx2160a.dtsi 8d99ad09575f0e8344e4caa6f4ac16f66108f22e - optee/optee_os/core/arch/arm/dts/stm32mp15-pinctrl.dtsi 676f90d7c25eb035af4475d83d6e355f07ac0634 - optee/optee_os/core/arch/arm/dts/embedded_dtb_test.dts 9f93f18baccbb7718af6c571e70dfecb3529b694 - optee/optee_os/core/arch/arm/dts/stm32mp15xxab-pinctrl.dtsi 23b592b2e03dead1636f2110cd64531ec92bf807 - optee/optee_os/core/arch/arm/dts/stm32mp133.dtsi ad3b5f3ede872c44e014eb6ca5a69329195968a6 - optee/optee_os/core/arch/arm/dts/at91-sama5d27_wlsom1_ek.dts e793accc60529af1c41651063de57ef9cd0a0b5e - optee/optee_os/core/arch/arm/dts/stm32mp157a-dhcor-avenger96.dts 62934ca38185da79af035ba4a82f62ae3a33f4ac - optee/optee_os/core/arch/arm/dts/hikey.dts 7098d09c9fd4f2accc2e23713ad9a3b676026ac2 - optee/optee_os/core/arch/arm/dts/dt_driver_test.dtsi 7c4d0d445cc32c31b4a4b2a2c01cd773605e3494 - optee/optee_os/core/arch/arm/dts/stm32mp131.dtsi fb4be0e25bdca79fcf443034897f81e669e42d88 - optee/optee_os/core/arch/arm/dts/fsl-lx2160a-qds.dts afc997b206bbdc6c60cd9f08308b7b53832eac0b - optee/optee_os/core/arch/arm/crypto/aes_modes_armv8a_ce_a64.S 933f5b3256795b2ffea6b7b93d75365f865599b3 - optee/optee_os/core/arch/arm/crypto/sha1_armv8a_ce_a32.S 09cb511f6b571c162ae284911b5af9c702dd5130 - optee/optee_os/core/arch/arm/crypto/aes_armv8a_ce.h 0cd13267dd6db52ed1ff3742dcb7adb15bdff8cd - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_ce.c 913da3b19e7cc7244ff858f2bace0bc38736fb06 - optee/optee_os/core/arch/arm/crypto/ghash-ce-core_a64.S fb5f716381766749999f0032bf39f39bf88af12e - optee/optee_os/core/arch/arm/crypto/aes_modes_armv8a_ce_a32.S 6e006d07e0e25f49c5af73e0e522f6f97963275c - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_aese_a64.S 47012ceb6af70d59a7666ca551814aa811efe9e8 - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_ce.h 1ab432ea10e0e0edf03b0ce17bb5277fea163578 - optee/optee_os/core/arch/arm/crypto/sha256_armv8a_ce.c 9c1f14fdc223c00af03fe8b922a520419b7fd0b9 - optee/optee_os/core/arch/arm/crypto/sha1_armv8a_ce.c cf714bfd8657a2fff8112b3b94d7e476d51e2e60 - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_ce_a64.S 2c3ba8b73e012b48da6c8ff12c635f8fa109e5a8 - optee/optee_os/core/arch/arm/crypto/aes_armv8a_ce.c f59a39b271b322f5bdd6baebdedb3ef701a78b02 - optee/optee_os/core/arch/arm/crypto/sha3_armv8a_ce_a64.S 0b84c15b4796a2a23a095ae2d6d037677510760a - optee/optee_os/core/arch/arm/crypto/sha256_armv8a_ce_a64.S 2da4cbb016071dacfbbd7c99799a27ad6d8c56a7 - optee/optee_os/core/arch/arm/crypto/sha512_armv8a_ce_a64.S d857b4b442486f2ac052ee687cb6d6f424843433 - optee/optee_os/core/arch/arm/crypto/sha512_armv8a_ce.c bb50a2e7fffd5945ce8214bf57ad9d55135b46c0 - optee/optee_os/core/arch/arm/crypto/sm3_armv8a_ce.c 45797af469d803907920fecce84f86fbe684a40c - optee/optee_os/core/arch/arm/crypto/sha3_armv8a_ce.c 02305ae36a17490cecdc906c0970e8625ea9e6a1 - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_neon.c cb5a3413393627c5fb4626c2315e2e12bf01abf1 - optee/optee_os/core/arch/arm/crypto/ghash-ce-core_a32.S 0c1913711dd52b93cfe5d2d476a3a050a5bae97d - optee/optee_os/core/arch/arm/crypto/aes-gcm-ce.c ad5becb659037cf49bdc0fccc768675b2ce55068 - optee/optee_os/core/arch/arm/crypto/sm3_armv8a_ce_a64.S f7d7763974a8359b3d84d7c848542872c9a1a1b4 - optee/optee_os/core/arch/arm/crypto/sm4_armv8a_neon.h ad9a80c4d43acd03ae5d27e14df6dfee3abc4e05 - optee/optee_os/core/arch/arm/crypto/sha256_armv8a_ce_a32.S 56e9da14883d74e8eca3a4c7737185590cf14c08 - optee/optee_os/core/arch/arm/crypto/sha1_armv8a_ce_a64.S f413d0ba2e04b6ef2802475a9132687b2f19237a - optee/optee_os/core/arch/arm/plat-ls/platform_config.h cc663051dbd6ba5fbd15bd4409b7ba732dcdc025 - optee/optee_os/core/arch/arm/plat-ls/main.c 095caecf26786efe69779aab593c67447f44b9c2 - optee/optee_os/core/arch/arm/plat-ls/plat_init.S 43ecf7e39e7a28c27b7b79a3615e3614939834bf - optee/optee_os/core/arch/arm/plat-sprd/platform_config.h 40b290a479f2ef757ef2505ac996b953a69ca654 - optee/optee_os/core/arch/arm/plat-sprd/console.c 259bdb7ec46936003362575b273afd3f3a9981a7 - optee/optee_os/core/arch/arm/plat-sprd/main.c 92467f9b57e8dd5b4962ccd05ea4929ab2dd6c4d - optee/optee_os/core/arch/arm/plat-rzn1/platform_config.h 1b82881f2b80531fc7743309c38c8e9370969ef1 - optee/optee_os/core/arch/arm/plat-rzn1/rzn1_tz.h c9a02f7b7f7b87ffbcb1b4817f13f0a9ce102e7a - optee/optee_os/core/arch/arm/plat-rzn1/rzn1_regauth.h 6a09760ea59ffdf2d2d519d19a27687600c51a08 - optee/optee_os/core/arch/arm/plat-rzn1/main.c 48ef8147e12f826d7e87c67d7c12e3932d317546 - optee/optee_os/core/arch/arm/plat-rzn1/sm_platform_handler.c 245d63c49ace44a4319be3f8b9882e520bf67448 - optee/optee_os/core/arch/arm/plat-rzn1/psci.c 776215d1f8598a5514e759d70ae400a8101f835a - optee/optee_os/core/arch/arm/plat-rzn1/a7_plat_init.S 176317554a2541fa4a9d6504dbe52227bdcb5083 - optee/optee_os/core/arch/arm/tee/cache.c df18a9464597e6dbc2844ec1e5d735db00c74f37 - optee/optee_os/core/arch/arm/tee/svc_cache.c 9b3b72c3d28cd1ef84a46454ad1d2d20550608d2 - optee/optee_os/core/arch/arm/tee/entry_fast.c ebfaf4c6f38995b655230d2d5e3981d0ab12f8b6 - optee/optee_os/core/arch/arm/plat-d06/platform_config.h af303d7bdec46d72f8dc191b59424ff83ab7e2ed - optee/optee_os/core/arch/arm/plat-d06/main.c ca3077b3f16c93f5d5350d4b21c08770138bc3af - optee/optee_os/core/arch/arm/plat-d06/core_pos_a64.S 8694a8f4be2551b1bf8f1abcb17284a8b202e5af - optee/optee_os/core/arch/arm/plat-zynq7k/platform_config.h e8a97315a58b289054e1f3fb5418cba746b5633e - optee/optee_os/core/arch/arm/plat-zynq7k/platform_smc.h 19b5c8130f55a17a4ee903fba47f5bbafe9ac918 - optee/optee_os/core/arch/arm/plat-zynq7k/main.c 55fee8bf238c661a2f59118cbea5d8fca29471f3 - optee/optee_os/core/arch/arm/plat-zynq7k/plat_init.S 94a132cb905aa39756cd3bd0c4cd0bb955893219 - optee/optee_os/core/arch/arm/plat-amlogic/platform_config.h 397906387ace258a7976d69aaba14ef9a4cde8c4 - optee/optee_os/core/arch/arm/plat-amlogic/main.c b1793c2149008cfc5c242a3fbbfcdfecfb082b4b - optee/optee_os/core/arch/arm/plat-amlogic/scripts/aml_bin2img.py eba718605aa45932a4b80632aa65d8cb35dc2b22 - optee/optee_os/core/arch/arm/plat-versal/platform_config.h d0493efb594dfef8ab3869060ea8de26d977ddc4 - optee/optee_os/core/arch/arm/plat-versal/main.c e2b43db2de0208697b4c88f2f0562d58a4b0b2fb - optee/optee_os/core/arch/arm/plat-d02/platform_config.h 9581f5fca967939ce5938afcc66f47c28a64b41a - optee/optee_os/core/arch/arm/plat-d02/main.c d4139567b62848e1c43b6759cd767e034e10db73 - optee/optee_os/core/arch/arm/plat-poplar/platform_config.h 2ce2abb04e66b937356a0863cb1bdfec5c66673a - optee/optee_os/core/arch/arm/plat-poplar/main.c 8fa033ec5237e06aef907c0f641f208388793c26 - optee/optee_os/core/arch/arm/plat-poplar/hi3798cv200.h 59bad93e3d397c859768a3a8f7e46ad98f2ba3d4 - optee/optee_os/core/arch/arm/kernel/arch_scall.c eafaba99cd9d60eacf4a3babbd16c0a6daa4c283 - optee/optee_os/core/arch/arm/kernel/thread_a32.S f9a92f478e19fbf1059649d6208b99ca6613b311 - optee/optee_os/core/arch/arm/kernel/cache_helpers_a64.S 44470d3e7b9cdbed041ae13408e647edc645aa74 - optee/optee_os/core/arch/arm/kernel/misc_a32.S 96fd19a3b4462b4a6bf63b89dd394fb644df9cb3 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc_a64.S 705b09bc40f35f83a32b350e673c59728258e250 - optee/optee_os/core/arch/arm/kernel/stmm_sp.c d347c9bafe24140b9717de8891d9659b01333e07 - optee/optee_os/core/arch/arm/kernel/arch_scall_a32.S c10de505f0de2bc6ced1f9349ecfb51f0c5d306b - optee/optee_os/core/arch/arm/kernel/virtualization.c af8d99e369132adac450a89f4b07fbbada85156d - optee/optee_os/core/arch/arm/kernel/misc_a64.S b4d64fa787d883488032c460e9bdd9219c8b7e6b - optee/optee_os/core/arch/arm/kernel/link_dummy.ld 09ae96d24a26b79da3b4d74657264ac8fa57e7ee - optee/optee_os/core/arch/arm/kernel/timer_a64.c 6253299ed089d1eccd655faf0ef4921a3b090d0c - optee/optee_os/core/arch/arm/kernel/abort.c 26f9cf452d8776f7612c50294f57057815bb3dc6 - optee/optee_os/core/arch/arm/kernel/thread_spmc_a64.S c98d9153adf3b0cfde1af189f873d59ff8b88af6 - optee/optee_os/core/arch/arm/kernel/link_dummies_init.c 8ebc782c56e8a49cbb1a1842f396de645f1f46a7 - optee/optee_os/core/arch/arm/kernel/cache_helpers_a32.S 6a5fe12b6846231d6aa70e92f7b4220683c41c24 - optee/optee_os/core/arch/arm/kernel/entry_a32.S cbc0913df63d07ee9b46ed402d9d9cfb57dc8f23 - optee/optee_os/core/arch/arm/kernel/thread_a64.S 333d53646d0a8f7c4b5f3f5cecece5725a8f0dde - optee/optee_os/core/arch/arm/kernel/asm-defines.c 63ea63ab5d506208970d6f5b8738ee82850aefe3 - optee/optee_os/core/arch/arm/kernel/unwind_arm32.c cff200d2106d26baf930f16e6caa8634adebbe08 - optee/optee_os/core/arch/arm/kernel/vfp_a64.S 056cac06f5cc8f43b14154ddbf1cd5d8c382ab74 - optee/optee_os/core/arch/arm/kernel/tlb_helpers_a64.S 000f63612d84b18bd33c3bb7a7ad17308e32b296 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc_a32.S cfe9209c0f08602f20df8752df4016c257305627 - optee/optee_os/core/arch/arm/kernel/vfp.c 9a79a97751b816a6976bd36948874edb22b17563 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc.c 23d2ba34a5f3de4b7c12134cd6ffcb8e4957e672 - optee/optee_os/core/arch/arm/kernel/tz_ssvce_pl310_a32.S 24e1db339b48a73b6aaafcfca9047c7855896faf - optee/optee_os/core/arch/arm/kernel/rpc_io_i2c.c c591321644c6fd32d600a9a797daf4cdc48647d2 - optee/optee_os/core/arch/arm/kernel/spin_lock_a64.S 9e422c03938a8b32edd015a653d5dac29880a5e2 - optee/optee_os/core/arch/arm/kernel/unwind_arm64.c e6509a63f63d52f3595d0f5b65346f6b569b8dcd - optee/optee_os/core/arch/arm/kernel/thread.c 79bd325bd306a65c018341c52386b41e92028f08 - optee/optee_os/core/arch/arm/kernel/thread_spmc_a32.S 5ca340af84791488b272c18d84af4e49b1c94f7e - optee/optee_os/core/arch/arm/kernel/tlb_helpers_a32.S 623bd09a42ef354ab3d4335998660c788d656cb0 - optee/optee_os/core/arch/arm/kernel/thread_spmc.c 4d98d1a3c20f4e424fd4140949c712f1769daf93 - optee/optee_os/core/arch/arm/kernel/tee_time_arm_cntpct.c b5ebdeae94cfe7fd7a32f0be15e8a28b230cd175 - optee/optee_os/core/arch/arm/kernel/tee_l2cc_mutex.c d6c09e6c39b889a25fcb82340f1725f9d0427d59 - optee/optee_os/core/arch/arm/kernel/arch_scall_a64.S 6ab260ed8b0c118bdef56c78beeaa3887daf4059 - optee/optee_os/core/arch/arm/kernel/boot.c 170f9fade8d4cfd3805f2aa2383b7f3d358507df - optee/optee_os/core/arch/arm/kernel/idle.c 99dbd4c6ced9d21fbf6db2c3e7c6755d8c6bce28 - optee/optee_os/core/arch/arm/kernel/vfp_a32.S 9d0bd8480809254b743bf3d766efe7c3cdc70034 - optee/optee_os/core/arch/arm/kernel/kern.ld.S 289f0d3d108c7e83aedd70c9b92133b7a036f000 - optee/optee_os/core/arch/arm/kernel/link_dummies_paged.c 599bd7fb683e3e1c0eddc71e66e5eb979e8e7c28 - optee/optee_os/core/arch/arm/kernel/spin_lock_a32.S da85ea618bd809353d036a244165f159f124bfa6 - optee/optee_os/core/arch/arm/kernel/entry_a64.S c5547aac70334a836d7a0d7a3711e972962679a3 - optee/optee_os/core/arch/arm/kernel/secure_partition.c a3d562edc0d696f64d77e9c96d86c9a88451b5a1 - optee/optee_os/core/arch/arm/kernel/vfp_private.h b1157e1c8f98a0bee2b0edcd3e766193dd29a126 - optee/optee_os/core/arch/arm/kernel/spmc_sp_handler.c 4eb9e4b6f2b6b8f595acf22a683d831fee0ef40f - optee/optee_os/core/arch/arm/kernel/unwind_private.h 784a5cea3b2741f04facdeaf7bfac0e093630875 - optee/optee_os/core/arch/arm/plat-stm/platform_config.h fd20baae7413cd701b88ba6dfeb2a294a9eeb452 - optee/optee_os/core/arch/arm/plat-stm/rng_support.c b6fdb7e3086bc494442508848064feb6c72f2ca3 - optee/optee_os/core/arch/arm/plat-stm/main.c bdd38a0220aac82b0aafa97e8f1993cb27e0ac1f - optee/optee_os/core/arch/arm/plat-stm/tz_a9init.S 4e93d8d25766b05b285896a4944c227f8b4da442 - optee/optee_os/core/arch/arm/plat-sunxi/platform_config.h 46ed9632901e137bb6316c0586d6982df7101499 - optee/optee_os/core/arch/arm/plat-sunxi/main.c eaa619f9de58ee047ca541b4c238b2afb5b83b6a - optee/optee_os/core/arch/arm/plat-sunxi/psci.c 2399244b8020942c1b3a3cb924194e8770560051 - optee/optee_os/core/arch/arm/plat-sunxi/plat_init.S 728f6a99ffec19cfff92195c3e68080f0dcfacbc - optee/optee_os/core/arch/arm/include/arm64.h c3a08b120460a25968597b72b59a0634e94dd49b - optee/optee_os/core/arch/arm/include/hafnium.h 55298b41d3e8800e2aeebd746e9e1371142fbd6e - optee/optee_os/core/arch/arm/include/smccc.h 6b7dc1082fa7e1b101e95c0588ea1b1224cfe5a8 - optee/optee_os/core/arch/arm/include/ffa.h ef7bffd960c06d3d1f3248123500188bfb08cd13 - optee/optee_os/core/arch/arm/include/pta_stmm.h 3ed813b9b977510b9907819fa2443a03eda8ca4b - optee/optee_os/core/arch/arm/include/optee_ffa.h b994483c8394f9eef531d2c379fd9ca5a1b60fed - optee/optee_os/core/arch/arm/include/arm32.h 7003b864c28695954a41184611e55102dc8e7500 - optee/optee_os/core/arch/arm/include/arm64_macros.S 81aefd662cc3b7d6278de360ede9cd9545c3f7b2 - optee/optee_os/core/arch/arm/include/arm.h ff294f026e09453cbd1ffb3cbc764befc573676c - optee/optee_os/core/arch/arm/include/arm32_macros.S 1cea08afcf4cab7bbff31ea3666c5360c4c03498 - optee/optee_os/core/arch/arm/include/arm32_macros_cortex_a9.S 6bb78d1526e06ec55a411f86926c1feb69fbdff8 - optee/optee_os/core/arch/arm/include/mm/core_mmu_arch.h ffc908df97e9fd07da49d5df02ac4da1bb8b6d13 - optee/optee_os/core/arch/arm/include/mm/generic_ram_layout.h c0f44a85d8dc7ed7ee51a4395e3456f05265a0c1 - optee/optee_os/core/arch/arm/include/sm/psci.h 1570da79c88e5ce844afe3665b7835f325fd5594 - optee/optee_os/core/arch/arm/include/sm/teesmc_opteed.h abb9582e539a959b54458d29c0351dcc9b3a6e0c - optee/optee_os/core/arch/arm/include/sm/pm.h cabb67de891151838399c123a02c367be10dd244 - optee/optee_os/core/arch/arm/include/sm/optee_smc.h 7f4e2bd9aea7292a7cb66e4be4ee5e118c3d5c3d - optee/optee_os/core/arch/arm/include/sm/teesmc_opteed_macros.h ce5b9f00424203fbd6eace4a72a28b9f82658bb1 - optee/optee_os/core/arch/arm/include/sm/sm.h 51ee5fce8f3aa7306e4e111ebf920128f72ce1d8 - optee/optee_os/core/arch/arm/include/sm/std_smc.h 5a07f5963ad453f3de5e43330199b116240912f4 - optee/optee_os/core/arch/arm/include/crypto/ghash-ce-core.h 71f59143dc113e32eafbaf32749a68b80304cd37 - optee/optee_os/core/arch/arm/include/tee/entry_fast.h 1713fc8bf0923bc7dfbe82b8a445b10d9848bdc2 - optee/optee_os/core/arch/arm/include/scmi/scmi_server.h d567e405f7457e2a5a572391254b503cfc11712e - optee/optee_os/core/arch/arm/include/kernel/thread_private_arch.h 109240ea4c259327060af80955d32015e628c786 - optee/optee_os/core/arch/arm/include/kernel/tz_ssvce_pl310.h 0777b5e2b4ca54beddbbf59fed4ea20936487e3c - optee/optee_os/core/arch/arm/include/kernel/tlb_helpers.h 03a55634fef67a071aa1f0f3cd89ba24743675b0 - optee/optee_os/core/arch/arm/include/kernel/misc_arch.h 72a3f7bc0e57ea00dce12cbb73e41a20f90fbfdc - optee/optee_os/core/arch/arm/include/kernel/thread_spmc.h 37af9222c63c149803c61dab6a9f91a50be335d0 - optee/optee_os/core/arch/arm/include/kernel/tz_proc_def.h 9284944a0055f114d23e121c972c412ae97b7f7e - optee/optee_os/core/arch/arm/include/kernel/tee_l2cc_mutex.h b95d779051d2b0e70152491dc1046ef721584d7a - optee/optee_os/core/arch/arm/include/kernel/stmm_sp.h 2360143179a1f2cfd4a3cbbbc03448bb6790d698 - optee/optee_os/core/arch/arm/include/kernel/arch_scall.h 59802332e69d96bb3641667a395d02f3c2fcd82f - optee/optee_os/core/arch/arm/include/kernel/cache_helpers_arch.h 0607a5b2b01b53cceee3b47ccee320d2fb27bda9 - optee/optee_os/core/arch/arm/include/kernel/vfp.h b65be7335b7bf4f535466fc90543e45ecf9f8733 - optee/optee_os/core/arch/arm/include/kernel/secure_partition.h b956d886be34a123153e72af01e2f4f4cbfc2dcf - optee/optee_os/core/arch/arm/include/kernel/delay_arch.h 84b9ebb0e017dd1d8594f810924e78a79a73aa09 - optee/optee_os/core/arch/arm/include/kernel/tz_ssvce_def.h 38b584ff94d19eb4ee5a09924512512856c7946a - optee/optee_os/core/arch/arm/include/kernel/spmc_sp_handler.h 9e791243466051df2420efe6b2a0b1c5354fc679 - optee/optee_os/core/arch/arm/include/kernel/thread_arch.h dd54ce3d620f2b22180ef201aeecf74b5b4480ad - optee/optee_os/core/arch/arm/plat-rzg/platform_config.h d3d7fc01ca1db9ed9c42923fc3abf988ee8f35e0 - optee/optee_os/core/arch/arm/plat-rzg/main.c b3d21a1017a2f66d52d2f6da7f671715aba08021 - optee/optee_os/core/arch/arm/plat-rpi3/platform_config.h 84b7b56e93417a949b15de5348e3b01f21ccd448 - optee/optee_os/core/arch/arm/plat-rpi3/main.c 49dbe1b862ab1676a3186ddc9f6c7650820902d7 - optee/optee_os/core/arch/arm/plat-totalcompute/platform_config.h 8c7bb877e78282e8229e60073e1b5416c9a0d122 - optee/optee_os/core/arch/arm/plat-totalcompute/main.c 00e4e12466db95649e17c7dce132fd03e23b837c - optee/optee_os/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts 8cf15d5f8508083811e9df9e81f5de5d6f6861fa - optee/optee_os/core/arch/arm/plat-zynqmp/platform_config.h 22c8392cd3c7d3efdbe4ab3b68a650710be862b1 - optee/optee_os/core/arch/arm/plat-zynqmp/main.c acb5b7a67e6e3a2c8309d3b5cd972a643437c4ad - optee/optee_os/core/arch/arm/plat-marvell/platform_config.h 1789c7a402691f5c378f2108a0ffddac22926472 - optee/optee_os/core/arch/arm/plat-marvell/main.c 382e9ecd3c29e2e17e189e59fd3427c1c682e199 - optee/optee_os/core/arch/arm/plat-marvell/armada7k8k/hal_sec_perf.c 5277b6c495f09f7293c54198cbee638bbfdb0254 - optee/optee_os/core/arch/arm/plat-marvell/otx2/core_pos.S 4ff87aa9e6aeaf3d88e17943ead649009d0b0fb2 - optee/optee_os/core/arch/arm/plat-marvell/armada3700/hal_sec_perf.c e5ec049ffef670a29b7cade4d9d9f96abef549f6 - optee/optee_os/core/arch/arm/plat-rcar/platform_config.h 4e0482b88d52f8a7d6adf974d0e5015f13872f65 - optee/optee_os/core/arch/arm/plat-rcar/hw_rng.c 40b8edfff755528bf204681a8f80de74a95a6673 - optee/optee_os/core/arch/arm/plat-rcar/romapi.c b713d037582ce7c9f21402a91665b067ed931ff7 - optee/optee_os/core/arch/arm/plat-rcar/rcar.h 8e4974b5fef12aa6421a66df3916ac232029a809 - optee/optee_os/core/arch/arm/plat-rcar/main.c 9ca9f50ac43c9276ee67375c8e915f0827e349d9 - optee/optee_os/core/arch/arm/plat-rcar/core_pos_a64.S f8a2662937d568146b977cdedf2e268e5b1f6b6e - optee/optee_os/core/arch/arm/plat-rcar/romapi.h 15d328d6ef35c2f6a4c4f5a69f4eb2a571802c1c - optee/optee_os/core/arch/arm/plat-rcar/romapi_call.S d838c4f3e30ef56f81d51a7b6ef1a31df3657c31 - optee/optee_os/core/arch/arm/plat-aspeed/platform_config.h 82e665e55b85c8f52413d062164e161349d25bbd - optee/optee_os/core/arch/arm/plat-aspeed/platform_ast2600.c 6631e40f0ad62f389ac0fc0c59e142b9313bb246 - optee/optee_os/core/arch/arm/plat-aspeed/core_pos_a32.S 4b7308420adcb67b60e528f1beab6c68377d6e2a - optee/optee_os/core/arch/arm/plat-tegra/platform_config.h c19a206b427ed76090247d074c9b81a0c6dadfc4 - optee/optee_os/core/arch/arm/plat-tegra/main.c 1046d8e53fbfdcc9ffd8a63a012cccfb40cafacf - optee/optee_os/core/arch/arm/plat-tegra/tegra_common.h 798efa99d464a96c2b70639a3c25ba14f618c29b - optee/optee_os/core/arch/arm/plat-tegra/README.tegra_secure_storage 608a97cee50965f940169862e6754dd17612fadf - optee/optee_os/core/arch/arm/plat-ti/api_monitor_index_a15.h f185f9e1ea859d9f4233cffc8c78fcbe72e4c090 - optee/optee_os/core/arch/arm/plat-ti/platform_config.h 2a0bf39e0ef3f1dfa764058f0142b54a53a92006 - optee/optee_os/core/arch/arm/plat-ti/api_monitor_index_a9.h ee95c68b68df1476e39ee0a9d3d4f3f1053168e8 - optee/optee_os/core/arch/arm/plat-ti/a9_plat_init.S 233c224aabab101937a19dca5c2de23d699eea8b - optee/optee_os/core/arch/arm/plat-ti/main.c 537927d745de820a0b09ef12a56515a53e68bcef - optee/optee_os/core/arch/arm/plat-ti/sm_platform_handler_a15.c c3c107d238f7f96e38416cbd2ce783cb5c5231be - optee/optee_os/core/arch/arm/plat-ti/ti_pl310.c ec14532de7ea2afbf4bb14220372faf052e0d77c - optee/optee_os/core/arch/arm/plat-ti/sm_platform_handler_a9.c 5222bea7254df96932e51593a9aec12808fe2584 - optee/optee_os/core/crypto/crypto.c 6ee664faf892cf6eb54780694431dbc599714a4c - optee/optee_os/core/crypto/aes-gcm-sw.c 5e7555e339aca88d6573eef4844fe96171e073ef - optee/optee_os/core/crypto/sm4.c e68ca1aeee7c839ed6427892eba453b827fe73a5 - optee/optee_os/core/crypto/sm4-ecb.c 057545a9e027cdd9daa7be1500acbb767b134a5a - optee/optee_os/core/crypto/rng_hw.c 82c796645d5446d81b6013ad6338920da67f8ee6 - optee/optee_os/core/crypto/sm4.h 3c8f23a338eea10aca5682c64d8a12902fc433f5 - optee/optee_os/core/crypto/sm2-kdf.c 5a46f6fc2ccfeff927d3588c22e667102497a4ce - optee/optee_os/core/crypto/aes-gcm-ghash-tbl.c be1aa6aee3798fdc77ebc0a6b37bf5a80fc3baee - optee/optee_os/core/crypto/sm4-ctr.c 35204fa717049aa26af2abef06d5466dd22b09a0 - optee/optee_os/core/crypto/sm3-hash.c 2bfc17f9e38fa5fd9c637a5cd1ddcce6300ced48 - optee/optee_os/core/crypto/rng_fortuna.c f5e19ab8d6191ffddbd796f4b194c1b9fcab79b9 - optee/optee_os/core/crypto/sm3-hmac.c ed4f8a199dfc091202a84e729efc08be8166e573 - optee/optee_os/core/crypto/sm3.h 2e625c76a0a14b6b74d7b3be0b8af4e28516d53a - optee/optee_os/core/crypto/aes-gcm.c ec9b32fd9bc56871bc638975a31eb271543b4753 - optee/optee_os/core/crypto/cbc-mac.c e73ae6d522f149d7ffc117d3f026bd44fcd262c0 - optee/optee_os/core/crypto/aes-cts.c 8a9f6567ac8b3d0894830f0876d17d71e94435e4 - optee/optee_os/core/crypto/sm3.c a730ddd73aac7bf7e2f4530cb84b4139920cc30e - optee/optee_os/core/crypto/sm4_accel.c 4a9aec205bda6db9f341b00e62940610c4e3e728 - optee/optee_os/core/crypto/signed_hdr.c 7b6658854eec61d103f730922493a99440ca594d - optee/optee_os/core/crypto/sm4-cbc.c 5e36787d311129f8c3649eed00a7bc54de3dc471 - optee/optee_os/core/crypto/sm4-xts.c 8f90f483de2c041395379c1d91a3cd1739dbd6b8 - optee/optee_os/core/drivers/pl011.c e0f77456c7a5e485619186caeaf812b3dc8eb572 - optee/optee_os/core/drivers/stm32_etzpc.c e241e2600db481b9c897bc48b71104c3aaa5bbbf - optee/optee_os/core/drivers/bcm_hwrng.c 45fe58e31faea84f641347c7bd70e426567d781b - optee/optee_os/core/drivers/serial8250_uart.c f2395342fb43346befc286959fa01114b0ff28e2 - optee/optee_os/core/drivers/versal_mbox.c a4098254e952201f7b1f513d7bfa85c753805466 - optee/optee_os/core/drivers/atmel_tcb.c 514313602dfb100842f336c91efef495a658b3a9 - optee/optee_os/core/drivers/stih_asc.c 61fd12b4c0e6e8d4afffed71c182286581de4837 - optee/optee_os/core/drivers/ns16550.c 8457979f3ce7a5ad5eff7c23b2887fe3d61a29d7 - optee/optee_os/core/drivers/xiphera_trng.c 0dde4c0ccc9de1c9506849f158f4d0bfe08c7716 - optee/optee_os/core/drivers/atmel_rstc.c 5f7af6748259588f30732bd198cada68ea449968 - optee/optee_os/core/drivers/versal_nvm.c 20036824317b2f8dbae5d8cdb283f557e3c303c2 - optee/optee_os/core/drivers/gic.c 99907094047bf316222d7f0af9b7b043693a92fd - optee/optee_os/core/drivers/imx_uart.c 32c848c3a2f49db8076d0ef95094acec87a733f4 - optee/optee_os/core/drivers/stm32_gpio.c 9f608bd36d7697b68b44c50cf8070bcfa4c872c0 - optee/optee_os/core/drivers/imx_rngb.c 2ace80614760dbbe872200c0405c3e28fe6a5880 - optee/optee_os/core/drivers/cdns_uart.c 8294666cb76a8dde2dc2f1155586de082381312b - optee/optee_os/core/drivers/hi16xx_uart.c c527277e48632898dea03473e67ca39837e75ed6 - optee/optee_os/core/drivers/atmel_wdt.c 9203d1e334c03870efbb1296fc2b9151c8971267 - optee/optee_os/core/drivers/imx_sc_api.c 5df98204d9e9768c88e295bfa8d2d03829a8bf4e - optee/optee_os/core/drivers/stm32_iwdg.c d89b4120ce4c2335a04d1f4aaf73b8e188140fba - optee/optee_os/core/drivers/ls_i2c.c f8a2cf16ad82a5a58a932430f4155678097f4ef4 - optee/optee_os/core/drivers/ls_sec_mon.c 1f8114767f04f10575e9d516120b9e8004560045 - optee/optee_os/core/drivers/zynqmp_csudma.c e26dcea60a7bdcf95acd06bb25f806e8b4d3d9ff - optee/optee_os/core/drivers/bcm_gpio.c 89ce33aaddb1581c98d889695b695d3f91d1abac - optee/optee_os/core/drivers/stm32_shared_io.c 2897acd81f2d1a3996adb59bd9dec1f0000f919c - optee/optee_os/core/drivers/versal_puf.c 336c2f714f6f3c8267473f821b95e998a63e3cd1 - optee/optee_os/core/drivers/versal_sha3_384.c 8ee4e7f2733f1ef421e3756f06c95acbcd347f3a - optee/optee_os/core/drivers/dra7_rng.c 06bb93003d3938898dfe3d7c010a1c6e586904b9 - optee/optee_os/core/drivers/imx_csu.c 56729058749c51344648a227f7c1d01e42fc1074 - optee/optee_os/core/drivers/sp805_wdt.c 90ef3f7cef8ca0b5ea51d6514433067919d92331 - optee/optee_os/core/drivers/versal_trng.c 04ff6a848f0dd5e16fb7fd76e95ce39785601df1 - optee/optee_os/core/drivers/mvebu_uart.c 6d0051bd667e06cafa0f116b864e5dcf5fa33e8a - optee/optee_os/core/drivers/stm32_bsec.c 1a1293e8adb1512031e4d88e30e903190c5e1313 - optee/optee_os/core/drivers/stpmic1.c 5bd6ae3906b725a1aa8d858e722579faf7b67c40 - optee/optee_os/core/drivers/stm32mp15_huk.c 09898d9b6b3ce2ff6bfaca61a6b13f0b9cd4efab - optee/optee_os/core/drivers/tzc400.c 29302475f05ea928763d589f7149ac31fb251bc6 - optee/optee_os/core/drivers/zynqmp_csu_puf.c 54a609280735c84a28f8d94cc34c03b2316634fe - optee/optee_os/core/drivers/versal_huk.c ca1d9008dba817311983779a55983721de2934b1 - optee/optee_os/core/drivers/atmel_saic.c 2a6d458de7f3a2a8cb965dba5a4ca10f43a80590 - optee/optee_os/core/drivers/imx_ele.c ea929d989338338849fbef43e268bf7a5cc2b79f - optee/optee_os/core/drivers/ls_sfp.c d727565a02416f45a77d93a9d363380f5f38ad79 - optee/optee_os/core/drivers/imx_scu.c a2703ae9f0253d154cc43d443d13e3a182189d68 - optee/optee_os/core/drivers/ls_gpio.c 0cdb9912f3a35cdd9d52951d5f489087f96d327b - optee/optee_os/core/drivers/amlogic_uart.c 285a03d5b9f6657a5a74f219b40e639aac379b41 - optee/optee_os/core/drivers/zynqmp_csu_aes.c 47509d9c897d567527308698b101326d495b6f43 - optee/optee_os/core/drivers/versal_pm.c 033052ada215ccb3f67e6643ef12c4b5665f0448 - optee/optee_os/core/drivers/atmel_shdwc_a32.S 418074ffc87f92ed37f80669e102b0253d4ee809 - optee/optee_os/core/drivers/versal_gpio.c 72c106642fd5baba523177b44cceb0e2dd268bb5 - optee/optee_os/core/drivers/zynqmp_pm.c 15006081e89bc8300728779c6253899a10614a9b - optee/optee_os/core/drivers/imx_caam.c 8d04ceb536a6bf4d80820154070d8c7c642edb42 - optee/optee_os/core/drivers/sprd_uart.c 488329789386ed718c577ec619a4315c61bfad80 - optee/optee_os/core/drivers/imx_i2c.c 52c9fd38c2174bf6f84138c477cbee17c48cbded - optee/optee_os/core/drivers/bcm_sotp.c 9a6399d3b9a2944a5cfebf5b6c67e29dc97474e5 - optee/optee_os/core/drivers/pl022_spi.c a89150d72a6f70cd6f3b353a068286f44896bb15 - optee/optee_os/core/drivers/smccc_trng.c 948cecf6b04d477d3c372bc0c5f60955101cebdf - optee/optee_os/core/drivers/imx_snvs.c 1427572daefd0b1d7949a5bf943320c3ce4b9733 - optee/optee_os/core/drivers/imx_ocotp.c 990afc221925acee24e98912d3ed7b0ee1af523f - optee/optee_os/core/drivers/atmel_rtc.c 42b41e7d6dba7a7d9a97f8a296aa72adc0a42be5 - optee/optee_os/core/drivers/lpc_uart.c ce40785f0b0ea3723ad09029522fe31e030e844c - optee/optee_os/core/drivers/stm32_uart.c 5b608ade5b6d8d262288fdc49165d0e0fb72f72b - optee/optee_os/core/drivers/imx_lpuart.c b44d33205ab5012349af7f1b4b06f026b1546f32 - optee/optee_os/core/drivers/atmel_piobu.c 23eed3a3d72852b8eda78fe73dfa5b7f7e5cb44d - optee/optee_os/core/drivers/zynqmp_huk.c 5e6a71e4a41dcf21ee3c8baaff79ae2274c6c5f0 - optee/optee_os/core/drivers/atmel_trng.c cfe1327aad5f492ff8e56e386fa5081ddf52163c - optee/optee_os/core/drivers/ls_dspi.c c96f731961fc579a4966cae12e597d72c1ed06f3 - optee/optee_os/core/drivers/atmel_uart.c 3d3d4af031ac66f9ce00f6553ce09e3556648825 - optee/optee_os/core/drivers/atmel_shdwc.c f709e939aa07ae260dd8d822762ef4e35442d96b - optee/optee_os/core/drivers/stm32_i2c.c ba938d917edc42fd1e53f93a707cc9ff5ff45686 - optee/optee_os/core/drivers/scif.c 342f4d81b439bab50c12c3fb029b495683d4cae4 - optee/optee_os/core/drivers/imx_wdog.c 8c9bd89348d37d78be7efd291fc5f9279a62093d - optee/optee_os/core/drivers/cbmem_console.c 9fbe74cf959bf2b80b39c4cf5ff6d4cc0ed64759 - optee/optee_os/core/drivers/tegra_combined_uart.c 5e0cb642d735a12ab5988ae85b3a92aa9ffef6f3 - optee/optee_os/core/drivers/hi16xx_rng.c a9e721b1faeb4865248d3c188b56278116a3185f - optee/optee_os/core/drivers/pl061_gpio.c 380dc2101277f2f474462baa5fcd9e75b84de26d - optee/optee_os/core/drivers/hfic.c 445c04d3c6c114e8ec7bc1ad63a137c0880cec74 - optee/optee_os/core/drivers/stm32_rng.c 707867f2731e424b641a7ec3409ee954fb610f37 - optee/optee_os/core/drivers/tzc380.c 9c0fffe583ce8197aac49fa87c158bec166776ec - optee/optee_os/core/drivers/stm32_tamp.c fbee23ad24545aea0bd9fd6ae6b67e9acc2ef16f - optee/optee_os/core/drivers/scmi-msg/base.h 93be063666a6a98dd1fa8f45bba0c3ca91136171 - optee/optee_os/core/drivers/scmi-msg/voltage_domain.h ac6217df4e25acd1b996d379ee7dc022ea03e8a8 - optee/optee_os/core/drivers/scmi-msg/shm_msg.c 1420d3d8ef64053f5b6cbf009539fd6ddddf6e95 - optee/optee_os/core/drivers/scmi-msg/common.h 6bd5b105161e0e51561bae3c976f9f6e87c4f7cb - optee/optee_os/core/drivers/scmi-msg/smt.c b6dc570c20e25ebbb69c815e65c4e3a77f6cf00d - optee/optee_os/core/drivers/scmi-msg/reset_domain.h a5fb58a50b0ccc0dde34d6fa91b0b03c5e0ca554 - optee/optee_os/core/drivers/scmi-msg/voltage_domain.c 189d1a32fdc699c67e4da64ae26380a2b3facd66 - optee/optee_os/core/drivers/scmi-msg/clock.h 15a98472af569d660b8ba57d3e4515f74ad49743 - optee/optee_os/core/drivers/scmi-msg/clock.c 13ed9520d3f452a3b5919a38066b702cc2f31c5b - optee/optee_os/core/drivers/scmi-msg/reset_domain.c 33be09787080f4627f5fdc10d7378880994ded05 - optee/optee_os/core/drivers/scmi-msg/entry.c cf9d967498746a73d9d033a11d89d20a95631dc6 - optee/optee_os/core/drivers/scmi-msg/base.c cac2399fb0ad43f3819d37590fd2003b3032c550 - optee/optee_os/core/drivers/clk/clk-stm32mp15.c a27d2bdf0f8ea5a83d19a186c35a2a73678b4a41 - optee/optee_os/core/drivers/clk/clk_dt.c c8f48d30481a1983d8c5991574a486ed83ebef49 - optee/optee_os/core/drivers/clk/clk-stm32-core.h 489775781cf7e044f1fcb8ae91603dbe93719b5f - optee/optee_os/core/drivers/clk/clk-stm32-core.c d1e1be84172c7598f0ad0f44f8cf0c3098e6da2a - optee/optee_os/core/drivers/clk/clk.c e8b58becff76b0a467f5e772157d6c0a5994b8b6 - optee/optee_os/core/drivers/clk/clk-stm32mp13.c 98169c49a2b31260fbbbbe0a0394251d9b62cc4f - optee/optee_os/core/drivers/clk/fixed_clk.c 18acdc71569e2a780d0476642f03bc85218be532 - optee/optee_os/core/drivers/clk/sam/at91_plldiv.c 530a8ac463371dd1e9b7fa1c1ca9e30c7958808b - optee/optee_os/core/drivers/clk/sam/at91_system.c e90a1c0ffe8e8d869859768ddc4f978630f52990 - optee/optee_os/core/drivers/clk/sam/at91_pll.c c01c18400e840f1e7f911c70a8c24034e5b1683d - optee/optee_os/core/drivers/clk/sam/at91_clk.h 83d717ffdc6556064facb9e09df34abe6ea88ad6 - optee/optee_os/core/drivers/clk/sam/at91_generated.c 9254662590d96a635dd41164bcf9c0bf2e3d37c1 - optee/optee_os/core/drivers/clk/sam/at91_pmc.h 1050ecd58ec5f9140571e29544df45407324d89c - optee/optee_os/core/drivers/clk/sam/at91_audio_pll.c d24e2fc27571f5703eab7cd4f047097d88badd50 - optee/optee_os/core/drivers/clk/sam/at91_master.c 25e39dd6ad71ca3d8a60a03850e2cbeae18124a2 - optee/optee_os/core/drivers/clk/sam/sama5d2_clk.c 09d3398f4208842a4fe083227c808cfc2add46b6 - optee/optee_os/core/drivers/clk/sam/at91_pmc.c 13078eaf7868f4a2a4dcd703d8eadc76630f1b3d - optee/optee_os/core/drivers/clk/sam/at91_usb.c 1cf0a55892076fb8587178bf570a91ba7a2ba82a - optee/optee_os/core/drivers/clk/sam/at91_main.c 81082b7a678856f1ac9a91da0e5a4600cfbd853f - optee/optee_os/core/drivers/clk/sam/at91_sckc.c 48f146dde6d5ca943dbc1c3d3e909da6c816cb42 - optee/optee_os/core/drivers/clk/sam/at91_peripheral.c 1ad7203186a86ea2d38ddba1ce87469d1e139a94 - optee/optee_os/core/drivers/clk/sam/at91_utmi.c 152f3551f54e3ee176d8a09bd21b8692d3d34ae0 - optee/optee_os/core/drivers/clk/sam/at91_h32mx.c c99eceb036f865d8c6c2df48b7dd402af247fd34 - optee/optee_os/core/drivers/clk/sam/at91_programmable.c 3cc6160c3ae52400111c85d3c4ce08d787630856 - optee/optee_os/core/drivers/clk/sam/at91_i2s_mux.c 0d6b0a14fd3b05ba3c8c21eb1a895e8e3ba465e4 - optee/optee_os/core/drivers/imx/dcp/dcp.c 34825682d3731dc9ea51680257ae795e76a288f2 - optee/optee_os/core/drivers/imx/dcp/dcp_huk.c 590ea022b10a9c7283c5ffc2433de61c90148fb2 - optee/optee_os/core/drivers/imx/dcp/dcp_utils.c 2b2febd277aeda9813289b22b87000c559b8e4d8 - optee/optee_os/core/drivers/imx/dcp/include/local.h 2086f64aaa2a6e6c7903ab74de13c177b978297d - optee/optee_os/core/drivers/imx/dcp/include/dcp_utils.h 04647d26da9ca3ed1c605d85f2e47ef0622718ac - optee/optee_os/core/drivers/imx/mu/imx_mu_platform.h b88af5fadc01a2b51585e2d02ec338e77a314d41 - optee/optee_os/core/drivers/imx/mu/imx_mu_8q.c 082b0667861563360b7c1e69c17d6e4f6721d7f7 - optee/optee_os/core/drivers/imx/mu/imx_mu_8ulp.c ff98f09ac7d7e546907420f56e3219c2ca02504f - optee/optee_os/core/drivers/imx/mu/imx_mu.c b1b96d68d4bf3e82a538f91afea8b87b5c0f43f6 - optee/optee_os/core/drivers/rtc/rtc.c e2ede389a1c5a24403439cd397bc8a69fc16ac0d - optee/optee_os/core/drivers/crypto/se050/session.c 3238acd7dd2e169621bbe8ab9e9f93372f6b111b - optee/optee_os/core/drivers/crypto/se050/adaptors/utils/scp_config.c 6e42bccb8cc7140adefd2baee2a8f2b2c9757348 - optee/optee_os/core/drivers/crypto/se050/adaptors/utils/utils.c ad754aaaf0b0850065a9e68027ee82642a44e817 - optee/optee_os/core/drivers/crypto/se050/adaptors/utils/info.c 4732906bb4ca33cb409bd901b0c94c24a26055a4 - optee/optee_os/core/drivers/crypto/se050/adaptors/include/se050_user_apis.h 215eeb31aae8342063f2c7eeded5fcb3979691da - optee/optee_os/core/drivers/crypto/se050/adaptors/include/se050_apdu_apis.h ceb2e995fdceecea2d1bb9a5610a21f958a520e2 - optee/optee_os/core/drivers/crypto/se050/adaptors/include/se050_sss_apis.h 374c26b225f2311ce209fecac1317c2566d76f5b - optee/optee_os/core/drivers/crypto/se050/adaptors/include/se050.h 08160ebfd7c03896165877326736450c0d5524ae - optee/optee_os/core/drivers/crypto/se050/adaptors/include/se050_utils.h fe046635d5ea4979e83d3bab636fa885d6ea42b8 - optee/optee_os/core/drivers/crypto/se050/adaptors/apis/user.c 938beed49b7219bc5de5f01b93c9a51b0fdb40f3 - optee/optee_os/core/drivers/crypto/se050/adaptors/apis/apdu.c 95e8665d3b38e2efdd05f50abd94fe9c48a3d2d7 - optee/optee_os/core/drivers/crypto/se050/adaptors/apis/sss.c 05b8cb927ce8c6dc6b2c3391b71366cf1b9dfc89 - optee/optee_os/core/drivers/crypto/se050/glue/user.c 75e0506e1992b38a38a83d6805b15b095924a783 - optee/optee_os/core/drivers/crypto/se050/glue/i2c.c a73abf5d66f2a00e0357ab9c0deaddb53066be52 - optee/optee_os/core/drivers/crypto/se050/glue/i2c_stm32.c 64681be01124b403991ca09721e4e6c6e023b72e - optee/optee_os/core/drivers/crypto/se050/glue/i2c_imx.c bc9e0c1bff88a8c8a8b844d676d9ac9d76658357 - optee/optee_os/core/drivers/crypto/se050/glue/include/i2c_native.h ad85ac6e521999bc864eeb2cb25141446897db07 - optee/optee_os/core/drivers/crypto/se050/core/ecc.c acd04d6ec81f1e8fcd19581e8e7d194f372b861d - optee/optee_os/core/drivers/crypto/se050/core/ctr.c 54cf708e2d7e054324c1de7b52356234447a555f - optee/optee_os/core/drivers/crypto/se050/core/rsa.c ddc645a154efbbe06890e01fc9d2e8456eba3849 - optee/optee_os/core/drivers/crypto/se050/core/apdu.c a9660506e78ca0a2ec416668e5f142dc5b0198c8 - optee/optee_os/core/drivers/crypto/se050/core/die_id.c ee63e46c72d0cdd406a4eff3afc3de61bfc5867e - optee/optee_os/core/drivers/crypto/se050/core/scp03.c 683291b35269db2584defc67cad6d2006d59b805 - optee/optee_os/core/drivers/crypto/se050/core/rng.c 2bfc19e0e0e85d9305249130e474588e60b28f37 - optee/optee_os/core/drivers/crypto/se050/core/cipher.c 82381f16e979c73561a13cc26b1b69fcf01e470a - optee/optee_os/core/drivers/crypto/se050/core/storage.c 77ac6992ffdbc505fd3b8113c9335ea835c5f6c1 - optee/optee_os/core/drivers/crypto/se050/core/include/se050_cipher_algorithms.h 96d553c170bdeb1a217af81953ee6ccc6704d2b7 - optee/optee_os/core/drivers/crypto/stm32/authenc.c 06f4d05c0b8dff1db83d75e507975331028c073c - optee/optee_os/core/drivers/crypto/stm32/common.h f77e2cd5cbc8e1df18178a112fe9b5d5f26d1feb - optee/optee_os/core/drivers/crypto/stm32/cipher.c 601b922f3c15a1c4d5abb05d995f5735c1e356b9 - optee/optee_os/core/drivers/crypto/stm32/stm32_cryp.h 0ac0dd86b4ea75cbb4c4a484ef80d598a4e1c214 - optee/optee_os/core/drivers/crypto/stm32/stm32_cryp.c 7a1b972e1faf39f6c1c11e018fadf7690c0812e2 - optee/optee_os/core/drivers/crypto/versal/ecc.c 098e2cd056d7c0109c48e1c0fe7fa13577cdd79e - optee/optee_os/core/drivers/crypto/versal/authenc.c 0c3d0695339eaa6535604758e28d42e1177c52cd - optee/optee_os/core/drivers/crypto/versal/rsa.c 828360f1fe0d8cb9892dd9b467df8cf52e119eea - optee/optee_os/core/drivers/crypto/versal/ipi.c a7d7f00d8287e6bad7ec81709ec0463d5f483dcb - optee/optee_os/core/drivers/crypto/versal/include/ipi.h bb297b79a3f0cc6cb59b1a18f8d19242c9fc12b7 - optee/optee_os/core/drivers/crypto/crypto_api/drvcrypt.c 8ddc0db04f5251ffd3c0beb7d3947298685d5cf4 - optee/optee_os/core/drivers/crypto/crypto_api/cipher/cipher.c e867ba1d32e367e1e498b6fd909c71127118cb1b - optee/optee_os/core/drivers/crypto/crypto_api/hash/hash.c 5e52cbf60af910c8238cdc945b75c611ab59ad08 - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_mac.h b70e470e5e716917b0983224109234da6d526139 - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_asn1_oid.h 87afd69b37267a86f8bf7b3ddbc405754070bbd0 - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_acipher.h 4ce630f92142f1498cc8d9085650c1c0a691d53e - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt.h 622acb83b02d0d5e1f8cc107df2871c1d99220b5 - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_math.h 208419d7c303ed2af4a123d73612ffc734f88acb - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_cipher.h ccc63fa2a34f969b16948eb42489b17fba61d352 - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_hash.h f8f01711239d5a9fc6ece9f19e40d2f805b04c3a - optee/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_authenc.h a6e4483d1fd80f6f7f23a89a9e1ead0fbfcf65d9 - optee/optee_os/core/drivers/crypto/crypto_api/mac/mac.c 46947c70982d23fe999c5a70666a676833b13725 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/ecc.c 7ac822e6fdd1cdb08537631b7e8a3a823a0af57e - optee/optee_os/core/drivers/crypto/crypto_api/acipher/rsa.c 28add33c1c1a025afa5b36e5712026f17bbc9906 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/rsamgf.c 44b952198a07c95768b173ec708d14ea89702579 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/dh.c 979dd11c468df335b342654f7263949e51d1535a - optee/optee_os/core/drivers/crypto/crypto_api/acipher/dsa.c 38819ea8744620f296d47e0b1cab78567242c9fc - optee/optee_os/core/drivers/crypto/crypto_api/acipher/rsassa.c d235d21c1de200d48e91b12063eb2f8f1caf0881 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/local.h 3502395b082081a4c3f6e68c5f0774a90715d7bd - optee/optee_os/core/drivers/crypto/crypto_api/math/modulus.c 30d67ef67cd36d0794f2055d1705d14905f3ab0b - optee/optee_os/core/drivers/crypto/crypto_api/authenc/authenc.c 5104681db824caa455d34ffcb91e6bad1b8afad7 - optee/optee_os/core/drivers/crypto/crypto_api/oid/hash_oid.c e1c98e3cd50456380895acb8ca60b8a7622d18e6 - optee/optee_os/core/drivers/crypto/caam/caam_jr.c 5abf9725310659d557245e78b391f46a589f065a - optee/optee_os/core/drivers/crypto/caam/caam_pwr.c e50b088ae52c3e7016bce9511e39b1adfa3f0b4a - optee/optee_os/core/drivers/crypto/caam/caam_desc.c d5eb08887d58acfbb2e4bcda329360d893542698 - optee/optee_os/core/drivers/crypto/caam/caam_rng.c 6c30a2cf57a18929413f7684818e9304122d6f7b - optee/optee_os/core/drivers/crypto/caam/caam_ctrl.c 0f4455a2b7723d3cc63f4f0d0623d29b0363b39a - optee/optee_os/core/drivers/crypto/caam/utils/utils_status.c 7c483d7465e733ab3503e26d161daafaa25755be - optee/optee_os/core/drivers/crypto/caam/utils/utils_sgt_v2.c a34c25f439fb74912fddf47fac4b0295ba1effa6 - optee/optee_os/core/drivers/crypto/caam/utils/utils_sgt_v1.c 06d77bc7f344869783912b109cd485ef4e8590ad - optee/optee_os/core/drivers/crypto/caam/utils/utils_mem.c 130800ee65979019cc2117d690340aaa75cd92a9 - optee/optee_os/core/drivers/crypto/caam/utils/utils_sgt.c 5d02c1b842f54635bbb53a03214ed2f577c3c5fc - optee/optee_os/core/drivers/crypto/caam/utils/utils_dmaobj.c dc70d7f20e3b0430b6dd2fe0dd0261c929d3db6a - optee/optee_os/core/drivers/crypto/caam/utils/utils_delay.c 981c3652730c78df0fa0ab1841ce939ae699d9f9 - optee/optee_os/core/drivers/crypto/caam/cipher/caam_cipher.c 764e2643f5c29164046e1b31a10f8446246827dc - optee/optee_os/core/drivers/crypto/caam/cipher/caam_cipher_mac.c 149c2203a9171fda3be98cdeace47e7be4d8c8aa - optee/optee_os/core/drivers/crypto/caam/cipher/caam_cipher_xts.c b1050722e24889ba59c987cb274897949dcd39a7 - optee/optee_os/core/drivers/crypto/caam/cipher/local.h eb43fbde76dd94674bb94f9d314b9c0246403ac0 - optee/optee_os/core/drivers/crypto/caam/blob/caam_blob.c 59ec0c7059f65e67d8cde311155d4f1e67a49718 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/hal_cfg.c d375b61195f07cb019b6c1c76272b00409fd8626 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/hal_clk.c 38aeeeb79c278658c50da69fcb72b23ff70336ae - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/hal_rng.c 37d6f6801f8b77cfaa1e789b65d9bc5e1b44bdbe - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/hal_jr.c b2e468ca406a0ecd02357d0d17e4018a6c68bd49 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/hal_ctrl.c aa940d1d85879826ef54d8a93ceac16d8134c9f9 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8q/registers/ctrl_regs.h ae43fe99412d31c2f21f732a6798cda49fa12d3d - optee/optee_os/core/drivers/crypto/caam/hal/imx_8m/hal_clk.c fdb4775e9056e6c476ffae9721aee7a2c72a56ce - optee/optee_os/core/drivers/crypto/caam/hal/imx_8m/hal_jr.c b438abbdc31d4fba647e29cb04348c3fe1a2bc5c - optee/optee_os/core/drivers/crypto/caam/hal/imx_8m/hal_ctrl.c 0901279b007af3228bc982ccf06934c1d9fe6796 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8m/registers/ctrl_regs.h 044fc74646036cc6edface5539cace597bd88854 - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_cfg.c 56e2dab762555ca397562646cd9baed2266557c3 - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_rng.c 9e09a7307c115a9661cac5d5c5a1792502220bfa - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_jr.c 75e141d842a44be2fc54fc9aa3d6233d43786cf8 - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_cfg_dt.c b9b5aa7dd5bb89200b350e92c937684405b8abe7 - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_ctrl.c e7c18e488182d4bf3c8c821885db52c980fb5f7a - optee/optee_os/core/drivers/crypto/caam/hal/common/registers/version_regs.h 53b9f1b589e80b574aadd27d61ab737db2d5a9fd - optee/optee_os/core/drivers/crypto/caam/hal/common/registers/rng_regs.h 5d8a12ee896ae3c8e60ef64f2bc85b31aef2d9c7 - optee/optee_os/core/drivers/crypto/caam/hal/common/registers/jr_regs.h a8796a5f28445049f810dd2b2cf6bd4700d39090 - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/hal_clk_mx7.c dc2680e783f647bce21513453573f8f426d9ae8d - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/hal_clk_mx6.c fdb4bbc22ae4a6acae04a6b7205f78f74e7847ba - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/hal_clk_mx7ulp.c 08fa37b12c023eb7169ed6b3c069ecde04fb9ed1 - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/hal_jr.c 08ea1bfa1f790800d596ee9616bae2ec31390970 - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/hal_ctrl.c fee09baaa8fd82c62ecca9d059220329bb51e466 - optee/optee_os/core/drivers/crypto/caam/hal/imx_6_7/registers/ctrl_regs.h 7bbd78ddb18f062b0ee9521f445979c6acb2ee1e - optee/optee_os/core/drivers/crypto/caam/hal/imx_8ulp/hal_clk.c a70a4c8d70b51affd3d9132d1923186a531b7f4b - optee/optee_os/core/drivers/crypto/caam/hal/imx_8ulp/hal_jr.c 72df54a7f3d911d758cad690990fec5962c2ceb4 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8ulp/hal_ctrl.c dc66e73bb6be55941cae77b073fdaab8d4badfc5 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8ulp/registers/ctrl_regs.h ad05613f64dba65f1576f358f3d0ad0182e393f3 - optee/optee_os/core/drivers/crypto/caam/hal/ls/hal_clk.c 13a69ec0385f79f1b8ad1c9de90b79c0a2c82365 - optee/optee_os/core/drivers/crypto/caam/hal/ls/hal_jr.c 63e5eb66976364a49eabd3680df526f36f7c51cc - optee/optee_os/core/drivers/crypto/caam/hal/ls/hal_ctrl.c db232940b3c2f122c53b11e6dec5e70c5ec347d8 - optee/optee_os/core/drivers/crypto/caam/hal/ls/registers/ctrl_regs.h 731f10c0a7fe34860f0d1d21271b01a8a378b1a9 - optee/optee_os/core/drivers/crypto/caam/hash/caam_hash.c d8824580f4b1889d9a23ddd2047c3b102b9e7a17 - optee/optee_os/core/drivers/crypto/caam/hash/local.h 9dec343ffefc374f9d58367446ae2c277213ddd1 - optee/optee_os/core/drivers/crypto/caam/hash/caam_hash_mac.c bf2aef86b551be9c94f477b1372400abf9f59015 - optee/optee_os/core/drivers/crypto/caam/mp/caam_mp.c 42cc84af73a8980ed1e51aac57b7ac2bfe8ea567 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_cfg.h c396344d76de6f758e9164a0658037d2e37cc128 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_ctrl.h d23a06ce5206f043b33f8ee8d4e6bfd62d8bb981 - optee/optee_os/core/drivers/crypto/caam/include/caam_types.h ee68dcf290038d3ebad07beabb3517b5860bc3f5 - optee/optee_os/core/drivers/crypto/caam/include/caam_utils_delay.h 912d6553b392b20581d016f9eba91479662d6062 - optee/optee_os/core/drivers/crypto/caam/include/caam_blob.h f60708cc4c84df857fc20cdef0710a388ecd56f8 - optee/optee_os/core/drivers/crypto/caam/include/caam_io.h aedd672ed034e8265f35ebab812a5af4135e94d2 - optee/optee_os/core/drivers/crypto/caam/include/caam_rng.h 898dd496c1a8f25b592f261d9d13a74d3873ff7e - optee/optee_os/core/drivers/crypto/caam/include/caam_pwr.h 547857b357f6594d407d46fcab2f93fa7074d3cd - optee/optee_os/core/drivers/crypto/caam/include/caam_common.h 2ffbbb6180a3ba5fcc49f2958836e6391a2c7375 - optee/optee_os/core/drivers/crypto/caam/include/caam_hash.h ab44fa3086f2ca8ca281d8763ba59777b975a36b - optee/optee_os/core/drivers/crypto/caam/include/caam_desc_defines.h 7be3b8463755df707782bdaee0ed26c692c0f32b - optee/optee_os/core/drivers/crypto/caam/include/caam_jr_status.h a7a136dc1c5717e89fecc502f4095a9779b501bd - optee/optee_os/core/drivers/crypto/caam/include/caam_trace.h 2f780d7215aa1c23b998dfe17edabba1d0f4b1f9 - optee/optee_os/core/drivers/crypto/caam/include/caam_acipher.h 7c8acb595959705bbf481d1ffcdda173637dccbf - optee/optee_os/core/drivers/crypto/caam/include/caam_mp.h eb20c569c7f68eb8f8a1eb16eb82c24a8ac4cd9b - optee/optee_os/core/drivers/crypto/caam/include/caam_jr.h 3a804ad72278dc57b300a9df498d00db63fcefb6 - optee/optee_os/core/drivers/crypto/caam/include/caam_utils_dmaobj.h 0d6de8f72472e2554ab7666852ac52a37175465f - optee/optee_os/core/drivers/crypto/caam/include/caam_utils_sgt.h 3cefd9acd10d65bb6c61f2e0aec31f43e48f6abb - optee/optee_os/core/drivers/crypto/caam/include/caam_utils_mem.h 3ecf5ab643e7f3b2c6be73330969a5795d9bdc91 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_rng.h dcc86d041d08d62d6fe7acb03e2380804af1118b - optee/optee_os/core/drivers/crypto/caam/include/caam_cipher.h 21e39b796944181921ccaee48afdda1cf8ce8f83 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_jr.h 97d9212dd201d4169891e6f997efd5f8ddc5e761 - optee/optee_os/core/drivers/crypto/caam/include/caam_desc_helper.h 74a055714e2db637adc0291d19cea1c02974e030 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_clk.h dfa82d15074fd452691032b408318d2d1a7aec79 - optee/optee_os/core/drivers/crypto/caam/include/caam_utils_status.h 631d3ce5a38c82b07ae1a14ee6b6cb5ef95d32ba - optee/optee_os/core/drivers/crypto/caam/include/caam_status.h cfa13823918f625810c9958b6499358d179c8960 - optee/optee_os/core/drivers/crypto/caam/include/caam_desc_ccb_defines.h 86a25c32839f837b88bfe27425e26e7e19cf539b - optee/optee_os/core/drivers/crypto/caam/acipher/caam_prime_dsa.c cf64c3301a86696cbee97860cf765d5e34201d6b - optee/optee_os/core/drivers/crypto/caam/acipher/caam_dh.c 7b9390d54de54fa7f6778b6a73a75799cb97fe1f - optee/optee_os/core/drivers/crypto/caam/acipher/caam_math.c 804d375b59635219ecb0c4299c9e76ba786aaf67 - optee/optee_os/core/drivers/crypto/caam/acipher/caam_ecc.c 237af92d1c928b929d3fa6ba1d315e2c2fcdfb99 - optee/optee_os/core/drivers/crypto/caam/acipher/caam_dsa.c d1a64f1df7575f96b575be706a12850ac65679df - optee/optee_os/core/drivers/crypto/caam/acipher/caam_prime_rsa.c f677ba67d639efb7e1d7aebdc1a4b96eca37fa2f - optee/optee_os/core/drivers/crypto/caam/acipher/local.h 6e7f0ea0e73e8e81ba1d5d68c82bbe0ed635e645 - optee/optee_os/core/drivers/crypto/caam/acipher/caam_rsa.c 2702c09d55cbed00cd7326d5d6e35b12126fbe96 - optee/optee_os/core/drivers/crypto/aspeed/crypto_ast2600.c 0167f0613b4286349c7403ea6c9a7dfe0a322533 - optee/optee_os/core/drivers/crypto/aspeed/hace_ast2600.c ecc8a0a2fa12870fc85783fb7f60d717f6bf40d5 - optee/optee_os/core/drivers/crypto/aspeed/hace_ast2600.h 86b14f8200d61eabffb946fd45954dcfac30aaa0 - optee/optee_os/core/drivers/rstctrl/stm32_rstctrl.c 6ea97a6c89fdbbb425562f878dd045fd6f626046 - optee/optee_os/core/drivers/rstctrl/rstctrl.c 399fa3fd4b68a0c3ca446add566a9e832be98b0a - optee/optee_os/core/drivers/pm/sam/at91_pm.c 92ac150fcb4f3fbb4d74e1307ae620bf0202b800 - optee/optee_os/core/drivers/pm/sam/pm_suspend.S 2932a82f88cd223444a2033a5f5062b6ebdfaaf6 - optee/optee_os/core/drivers/pm/sam/pm-defines.c 2e32e7c1e67c58880615aa62d62335f62174b937 - optee/optee_os/core/drivers/pm/sam/at91_pm.h 4af2105f9cb20e8151aae7f9f5b9343f9c80cc2e - optee/optee_os/core/drivers/pm/sam/pm_resume.S 49865544561297dc1688131470c0baaa35112a86 - optee/optee_os/core/drivers/bnxt/bnxt.c a7009131f76447718645c703ed1373bd329a4528 - optee/optee_os/core/drivers/bnxt/bnxt_fw.c 7651789fc830ed002efb38c51f34bda32a3e8e46 - optee/optee_os/core/drivers/bnxt/bnxt_images.c eaf0dd04206e96958dd712422ba4074ba614a6b5 - optee/optee_os/core/drivers/tegra/t234/tegra_fuse.c 01aeb814d645694dbb3a7b6cba73a8dbdb00b2c5 - optee/optee_os/core/drivers/tegra/t234/tegra_rpmb.c a718ebfe121008337695ef87878037c2484b3aec - optee/optee_os/core/drivers/tegra/t234/tegra_se_aes_rng.c d0c05c35bf7b3a14be8f22ef4a1aadbe280144bb - optee/optee_os/core/drivers/tegra/t234/include/tegra_se_ccc_errno.h 8d24d3ea306d62a7b45f1c29f17840741197790d - optee/optee_os/core/drivers/tegra/t234/include/tegra_se_ccc.h 17ddfcb103fb3b6272fb935b6ffcf6c9277d809e - optee/optee_os/core/drivers/tegra/common/tegra_driver_se.c db6b2d8179fcbc42da79480d5ee5d0ee046b8459 - optee/optee_os/core/drivers/tegra/common/tegra_driver_rng1.c 35b07964703e174bb7f7a9f27cee4b91714cdbd5 - optee/optee_os/core/drivers/tegra/common/tegra_driver_fuse.c 32ad38d98650ec84007d8cdb4403018429dc15d6 - optee/optee_os/core/drivers/tegra/common/tegra_driver_clear_keyslots.c d4654766a46d1186e241c2e252b6d38ac9f71355 - optee/optee_os/core/drivers/tegra/common/tegra_driver_common.c e858eda88f3475db60107c22c48bc8d6ed3a7376 - optee/optee_os/core/drivers/tegra/common/tegra_driver_srv_intf.c 9d22d8ce9d81f74a8b3ac51470f60e7d72cf6000 - optee/optee_os/core/drivers/tegra/common/include/tegra_driver_srv_intf.h 423d81cfccb43c9bab466aa03a25b2c86171822b - optee/optee_os/core/drivers/tegra/common/include/tegra_driver_fuse.h 542a320020446e6712e8518616780ed091faf0de - optee/optee_os/core/drivers/tegra/common/include/tegra_driver_rng1.h 352d6c58d195d5c44b8e06c006e713fe506dc77e - optee/optee_os/core/drivers/tegra/common/include/tegra_driver_common.h 7def8f5aebb2ff74cb2cb235598b76028947c523 - optee/optee_os/core/drivers/tegra/common/include/tegra_driver_se.h c67e3cfb2ca9a5fa42769943cc7e64cd190651af - optee/optee_os/core/drivers/tegra/t194/tegra_se_aes.c 59b8fddcab1c4118b35c29a98d2e68efe471715a - optee/optee_os/core/drivers/tegra/t194/tegra_rpmb.c 3b96618ecaf4ddecb14a6af70d8f80d32724299d - optee/optee_os/core/drivers/tegra/t194/tegra_se_mgnt.c 953bf57f233bd74754d5258a5f6314cf7f1630c5 - optee/optee_os/core/drivers/tegra/t194/fuse.c e09c85691a66c623638973ebd587a1986680786d - optee/optee_os/core/drivers/tegra/t194/tegra_se_rng1.c 88ee29ff327c35524c79fd85e9c71ffff90df695 - optee/optee_os/core/drivers/tegra/t194/include/tegra_se_mgnt.h 2b1700dd12edcb736b9a5686f7fc95244f99a3e3 - optee/optee_os/core/drivers/wdt/watchdog_sm.c 11ae5906c65655bea1e0310e78fe9a2cd6f87709 - optee/optee_os/core/drivers/wdt/watchdog.c 7da841080f45a989a835a1fec30f6aa50d847b10 - optee/optee_os/core/drivers/i2c/i2c.c 6487ae2b83e597215d95fe540fcc7732890e0476 - optee/optee_os/core/drivers/i2c/atmel_i2c.c 3c93fa1fbf115515f5e1313b315ae7219e5bbe3f - optee/optee_os/core/tee/tee_time_generic.c 4d1fd828c84228949b6c57be1bf8ea7308f9cd67 - optee/optee_os/core/tee/tee_svc_cryp.c a00d48ecd6498ccba17eb691531f55e5e28eee49 - optee/optee_os/core/tee/tee_fs_rpc.c 2e7ad7afbede1e2a3987b894d9873b465df96cae - optee/optee_os/core/tee/tee_cryp_utl.c de0fd7c15631ce6187f89853a49fb30885602259 - optee/optee_os/core/tee/entry_std.c a1202328842c81639257318e2047a9e13b1802c0 - optee/optee_os/core/tee/uuid.c 6e9cf712089a20c55658ccfb34bce7115bdbe8f0 - optee/optee_os/core/tee/tee_svc.c ecb2d26f414109ce193325dc9c4aa0f51e6e81a9 - optee/optee_os/core/tee/tee_nvme_rpmb_fs.c 08651bd34dfb58168c78b29130516a563e1ab641 - optee/optee_os/core/tee/tee_svc_storage.c 36310dbe4c631f1eeb23f3ff8426f6ac27c1411c - optee/optee_os/core/tee/fs_dirfile.c 3de9da311b1fe8b3b7083179e376833293549ba3 - optee/optee_os/core/tee/tee_ree_fs.c 6e4a71bdec69aaedf5d9b1ac47e4297b4818ffef - optee/optee_os/core/tee/tee_obj.c ac18ee9e1ba6fb05ab7f2ca924c0936970c93d76 - optee/optee_os/core/tee/tee_fs_key_manager.c cb0c0c8fbcc1c033fbb259e50dfe3965e52013cc - optee/optee_os/core/tee/tee_rpmb_fs.c 7d9ae05cceeb683b0462d33c6def015ac53f4ed0 - optee/optee_os/core/tee/fs_htree.c fc58bf53b6b42bf286bd64683b86c6d31dc3a517 - optee/optee_os/core/tee/tee_cryp_concat_kdf.c 5922ca2dabf34fd3e6e67f6771d4c9a81cdcf5d5 - optee/optee_os/core/tee/tadb.c 4ca9c10d9b17380efab8d45d2de31948c98a16e5 - optee/optee_os/core/tee/tee_ta_enc_manager.c 7cf451d55302cfc19cc672245872a7bc06438f79 - optee/optee_os/core/tee/socket.c 3c86c49eae08e6e289fdc93ba24b2a7cb49f1b11 - optee/optee_os/core/tee/tee_pobj.c 0113d24cd422be94cfe071e76abab0409c9d69cc - optee/optee_os/core/tee/tee_supp_plugin_rpc.c a2028063632c8857bed15d993063a7fd353ee9c0 - optee/optee_os/core/tee/tee_cryp_hkdf.c dd81c49e2b9da8f822e7246d08cecde9f28fc2a7 - optee/optee_os/core/tee/tee_cryp_pbkdf2.c 7aeef825f355d2436dc4fd47d92ca857decaa195 - optee/optee_os/core/kernel/spin_lock_debug.c 9323261c4542f4f78ce0668852a81df361a9953e - optee/optee_os/core/kernel/initcall.c 7d0ada42e3e9e9fd9e14c60a53e62fc5c0a5a023 - optee/optee_os/core/kernel/ldelf_syscalls.c 94e2c0c379ce289434664a0320006df2fbae034b - optee/optee_os/core/kernel/msg_param.c 0a7dbadbb9b02d2767cbb75fdaaa8f36c95853a5 - optee/optee_os/core/kernel/tee_ta_manager.c 95db84ed2db1edad93dd163e910a57e8a493e1af - optee/optee_os/core/kernel/ubsan.c ad3214582c294d2157bf0094e356be8877650aa9 - optee/optee_os/core/kernel/console.c 103d74f02824b46e307830b5f0b2a5e0685c68d6 - optee/optee_os/core/kernel/dt_driver.c 5507bde30082bac9d1a101094c3f7cde4e04e1ff - optee/optee_os/core/kernel/wait_queue.c 59ff0a3736635fe8ceca714aa629bcfc9cd518f0 - optee/optee_os/core/kernel/dt.c 1beba0db1ff1f826641fd640ce1927e68758f838 - optee/optee_os/core/kernel/early_ta.c 3fc5e9e411b1ae45c0e4cae4b8a6bb864f0af29a - optee/optee_os/core/kernel/mutex.c e935ef062cf6f49e0a970956b28f70243e48b06d - optee/optee_os/core/kernel/trace_ext.c 1790af643118a654c31b61378ea1bf4510484835 - optee/optee_os/core/kernel/embedded_ts.c af2e20cbb543df6547a140deb039888cf8560fe4 - optee/optee_os/core/kernel/asan.c 4be3395d930addfce9c97be3cee349556b9b9b6e - optee/optee_os/core/kernel/ree_fs_ta.c 9975d02cd73795987cd451389809dfce9a902e9b - optee/optee_os/core/kernel/user_mode_ctx.c 93b8d5e48af159d7ca5fa174b79d935f05dbaa8b - optee/optee_os/core/kernel/tee_time_ree.c 4931d22ebf9d5389b6bb8c59af1c129a4940e031 - optee/optee_os/core/kernel/interrupt.c 601f8df7890b8b38b123509a94b8f05bb40105ca - optee/optee_os/core/kernel/scall.c 02448f355229caa2a32a4411c3198eb084395320 - optee/optee_os/core/kernel/lockdep.c 3e9c3ee98dbe0f91714a5f2df5f1d5efc3e8d831 - optee/optee_os/core/kernel/notif.c f854d339faf497fd0d027dac4594eb6c84548129 - optee/optee_os/core/kernel/user_ta.c 34c3fe34974039ae46f116dd60ce4b21a9fc901b - optee/optee_os/core/kernel/tee_time.c 7be1928ee7e34f7f47f52b99bce43e0024f06a44 - optee/optee_os/core/kernel/assert.c 907f7e88942ef24b0c59476c762dfeb7b3b2375e - optee/optee_os/core/kernel/tpm.c 221e610e4adbc3cd9e97867d9d1ae548a818fdfd - optee/optee_os/core/kernel/ts_manager.c 2a6a7890436dd84f6d5cd90ba647014156d06967 - optee/optee_os/core/kernel/thread.c c5144935485fc83d941a9c80668ace38c73633fc - optee/optee_os/core/kernel/huk_subkey.c f5d7654e570bb5bec7e4a93e3e08a88601cdb56c - optee/optee_os/core/kernel/user_access.c f4b199a80f0476f43f34060f72493f81a289748e - optee/optee_os/core/kernel/otp_stubs.c a1ef5afe68f55b5660aae6406acd31080c5af73a - optee/optee_os/core/kernel/tee_misc.c 813e8ed14c578b5b735b29cae3bbb42af9f03a58 - optee/optee_os/core/kernel/handle.c 3f891a5b83a8c9f2a82a468d79ea21efb2399b10 - optee/optee_os/core/kernel/panic.c 8abe5fcfb8a632e1c77c0e0f92bbc0414f1e2857 - optee/optee_os/core/kernel/mutex_lockdep.c 6ba41c747462a65ec025b7f099e70c4f0fb04cc1 - optee/optee_os/core/kernel/ldelf_loader.c 1962b8040874d00636c9541f532f3ee5b2ef4f16 - optee/optee_os/core/kernel/scattered_array.c 21449d26573f5cefed595f37780b901b7b937304 - optee/optee_os/core/kernel/mutex_lockdep.h 484e911f8c30e048b696a55ca84ec1b45d0a6839 - optee/optee_os/core/kernel/pseudo_ta.c de1675480ef4043349e0bc3875749598f8092a54 - optee/optee_os/core/kernel/show_conf.c e0f7be46eb2d862733bba0c834997c6d4203d425 - optee/optee_os/core/kernel/pm.c 54e613f652bc14d6ba8684814fe8dae398c800b9 - optee/optee_os/core/kernel/delay.c e3cfba43bda2276f238dec15e574a1d5b70bc7e2 - optee/optee_os/core/kernel/dt_driver_test.c 309c59c03e9e9577dff0819b23e420d73280278b - optee/optee_os/core/kernel/refcount.c c017d6ad6fee751242776e60c631fe9d1ffbb42f - optee/optee_os/core/kernel/secstor_ta.c a45b57d0b4aadf1d209b8ab2ef53b359fef4a276 - optee/optee_os/core/include/gen-asm-defines.h fe35bcb23450f547f7b098c1dc83a86e94884a96 - optee/optee_os/core/include/rng_support.h 5130acc35038686b8e096d0af60300156bb1fd91 - optee/optee_os/core/include/initcall.h 418f28494fe899852d688a2c61470ea0b87ea139 - optee/optee_os/core/include/console.h 0fe00321b7624b03757e3175805922dd46ccb50a - optee/optee_os/core/include/keep.h c41e2bca18dd7445ca83d477da79e00e5b1f6046 - optee/optee_os/core/include/io.h 129133eb0ba4e4b73eaf1d84710e580b22e10009 - optee/optee_os/core/include/spi.h 76a3a307fcae8ca4315d47c57222dfdbf7db3af7 - optee/optee_os/core/include/bench.h 8caab014052baad250b6a2fdfd50f4b5b4020264 - optee/optee_os/core/include/signed_hdr.h a368caa21683937ca27d5854e743a1d5359cd46d - optee/optee_os/core/include/ta_pub_key.h 6cd050c7ddd4d5c1022f00bf74e621a0a04818df - optee/optee_os/core/include/scattered_array.h fa6b95e58563f8332731f989e0d1bca1fffbbac4 - optee/optee_os/core/include/optee_rpc_cmd.h 5748d7d2f9ad14c08033135fa29ea471cf6fd1e4 - optee/optee_os/core/include/gpio.h 4baa40de63545ddbcfb6dc86b9cedfcd4359a44c - optee/optee_os/core/include/optee_msg.h c97a01f7bba80935fcbf2dafe9e946d43c247e1b - optee/optee_os/core/include/mm/sp_mem.h 30b8bfeb037aa430b36a9d62a9d906834dcf8903 - optee/optee_os/core/include/mm/fobj.h 33fa0dc8e82a82e1ef188ba26a539792cfe3767c - optee/optee_os/core/include/mm/mobj.h 985a54afd09d327768ec4d1e05e94e7bfa7355ca - optee/optee_os/core/include/mm/tee_mmu_types.h a6c2241b6f11dd5ebe72620c9997e5783bada425 - optee/optee_os/core/include/mm/pgt_cache.h 3813eb3d7bca8b05bf4d8df687119a55c902d925 - optee/optee_os/core/include/mm/tee_mm.h 2657238352e3ca4c25aedc808f05e904ff697330 - optee/optee_os/core/include/mm/tee_pager.h 493b72f34c04bd89c57c5ead3a53240b0d6ba642 - optee/optee_os/core/include/mm/vm.h 1af89b4c6e2cc87501b23b0f12e2365c613a6996 - optee/optee_os/core/include/mm/core_memprot.h 80ac097aa1c99ae9da69fca47169085d49b572a2 - optee/optee_os/core/include/mm/core_mmu.h 3ab7ecf667fa906a144379998f686f44c83c2394 - optee/optee_os/core/include/mm/file.h ccc329ed438598e8306a1a164a17d28a7b30ca79 - optee/optee_os/core/include/dt-bindings/clock/at91.h c82fd3d48caa51f67f6bb71f5637c491c8869afb - optee/optee_os/core/include/dt-bindings/clock/stm32mp1-clks.h 700be76cdd56cf4beca99964e8bef7679ca119a4 - optee/optee_os/core/include/dt-bindings/clock/stm32mp13-clksrc.h 6ee67bde9c0ae2dd9f7b6db105f90afd017ac1dc - optee/optee_os/core/include/dt-bindings/clock/stm32mp13-clks.h 1e7ab5294d740390ffb703e0912f612c043e1ce3 - optee/optee_os/core/include/dt-bindings/dma/at91.h 23149233a025ca8a0b84821b398694bbf0bfdf4e - optee/optee_os/core/include/dt-bindings/iio/adc/at91-sama5d2_adc.h b07457cf8179a2129c3e2cbdf8afc8cfd94f6875 - optee/optee_os/core/include/dt-bindings/regulator/st,stm32mp13-regulator.h 51c769451ca1c189b2b01b45473d6fb93157a4f2 - optee/optee_os/core/include/dt-bindings/regulator/st,stm32mp15-regulator.h 19bb520476cff77efd84b0106f690c4dd972bd63 - optee/optee_os/core/include/dt-bindings/regulator/active-semi,8945a-regulator.h 75e3b85cfb7663af28a4aeabd71f5d9171713d1b - optee/optee_os/core/include/dt-bindings/reset/stm32mp13-resets.h 6f7d303afc4981c5aaf8ae4eedae611976aa5b7e - optee/optee_os/core/include/dt-bindings/reset/stm32mp1-resets.h dcd9135e8790bfdbf7e925e8e5c9d421b5e89041 - optee/optee_os/core/include/dt-bindings/pinctrl/stm32-pinfunc.h 736b382bd5ae6f63e95b0ec473a146ffe182294e - optee/optee_os/core/include/dt-bindings/gpio/atmel,piobu.h f0ee73ec026d62a1125c4410ba4a0a72b924d09f - optee/optee_os/core/include/dt-bindings/gpio/gpio.h 8bbae85d2c9ec2416cc28a15f3d8e79d19c9847c - optee/optee_os/core/include/dt-bindings/interrupt-controller/arm-gic.h c09a35772e7498a4ece6515946754488ec651860 - optee/optee_os/core/include/dt-bindings/interrupt-controller/irq.h 3d11a04568b27618db9569d34ed229c92f24f7cc - optee/optee_os/core/include/dt-bindings/mfd/st,stpmic1.h dd5621d99484ecb0900f61801adab7e10d37f0f1 - optee/optee_os/core/include/dt-bindings/mfd/atmel-flexcom.h bb5104c1046fab4b7b59c7c5a4b7bcc11bc975d1 - optee/optee_os/core/include/crypto/sm2-kdf.h fb2b7a8d8b1e4d72673e7746b2209b7ce0705ab6 - optee/optee_os/core/include/crypto/crypto_se.h eef0ead7045789d8587d0a0a470491a3138a9c3b - optee/optee_os/core/include/crypto/internal_aes-gcm.h 3c37642b6f4bfefdcae5a1697faef8aa2b82b756 - optee/optee_os/core/include/crypto/crypto_accel.h a725d527edaf0a1dc858a9c5ba4740dde46a647a - optee/optee_os/core/include/crypto/crypto_impl.h 868a62eff03e1a25a10d061392adece3469e1cf5 - optee/optee_os/core/include/crypto/crypto.h 573aef790439e7f8668bf6d5be663c9504f9273a - optee/optee_os/core/include/drivers/tzc380.h 4bee46ff90df0433979e547ff28194293739570b - optee/optee_os/core/include/drivers/stih_asc.h ba280c416a5feaf1576cfdb84a7f4c6c10f95bd1 - optee/optee_os/core/include/drivers/imx_wdog.h 631cc4ec89ffe0c7e2eb61ef0c441a265c1cff11 - optee/optee_os/core/include/drivers/versal_pm.h 209a9de5a95c149ed87d06209a00416aca6bdf59 - optee/optee_os/core/include/drivers/versal_puf.h 04f9993ffd5c2f798953978835626f7d91793c27 - optee/optee_os/core/include/drivers/zynqmp_pm.h d9e6e80aa5d27c1fcf9c1edc4895e62394b0d4d4 - optee/optee_os/core/include/drivers/versal_nvm.h 6d429cc510e8a7657953b5312b459f26e03494d8 - optee/optee_os/core/include/drivers/imx_snvs.h a30ec174c1201d5297ef6ee8356cea3f0fbcf512 - optee/optee_os/core/include/drivers/rstctrl.h 9c339b4eecb10745f1cd1a5edb6c60a9d5854b19 - optee/optee_os/core/include/drivers/sp805_wdt.h cca1719ab46702da66faa45ee2e674cbf56e0936 - optee/optee_os/core/include/drivers/zynqmp_csu_puf.h 8b6ce4ad485b93603cb3a306654cd097e40508f9 - optee/optee_os/core/include/drivers/wdt.h 648ece0e1c404051cf7840a3caa294b090ac0947 - optee/optee_os/core/include/drivers/pl061_gpio.h 0eaea95f747c036c18d965a634e304c3819d6a00 - optee/optee_os/core/include/drivers/atmel_rstc.h 96e732bccb33868cd127943ce6fb12f5c9f68487 - optee/optee_os/core/include/drivers/ns16550.h 807fef6f8992f0fea2edc92c55deb829eb8e8be4 - optee/optee_os/core/include/drivers/versal_gpio.h 6267fd81bf3990311590c922d90fc4cecd83ea5b - optee/optee_os/core/include/drivers/hi16xx_uart.h 82d4883130bac9ae57b009986c8a8cf82f34f53b - optee/optee_os/core/include/drivers/stm32mp_dt_bindings.h 90f5cecf44f1353954b9f509e72380c23dae5481 - optee/optee_os/core/include/drivers/zynqmp_csu_aes.h 3eab3b939280e8984b98283ca0325b82ae90fa88 - optee/optee_os/core/include/drivers/serial8250_uart.h 2e3c9c2926bbbc02de43b280cb53d39b021200df - optee/optee_os/core/include/drivers/clk_dt.h 0858c735ecd0b0f69511c80da83b88cb428ae108 - optee/optee_os/core/include/drivers/versal_sha3_384.h 9fecf61927af88057778f180eaa3f37588e42a69 - optee/optee_os/core/include/drivers/serial.h a989968154cdc25bcf61e8bf07f8586a30eb61a4 - optee/optee_os/core/include/drivers/stm32_i2c.h fae1d97a03ad4920ce240b22f5fe477866b1ce74 - optee/optee_os/core/include/drivers/stm32_uart.h f6c06a7e3d38d67183bbde4814b1b4fc68226fda - optee/optee_os/core/include/drivers/stm32_shared_io.h fa33f522c3cb38d765763701719a079010068a81 - optee/optee_os/core/include/drivers/atmel_uart.h d5dfc765162bdef02e9e02dd12d30d08eeadb409 - optee/optee_os/core/include/drivers/hfic.h d4025e0f4dc505c8928a4b46ce1d39a18d4b7786 - optee/optee_os/core/include/drivers/atmel_saic.h 21f16be3e12698442b37c7fbd4b2cf9b5e1eb2da - optee/optee_os/core/include/drivers/mvebu_uart.h d2608b476c0a3e6772cbc28ea1b2b555091784fc - optee/optee_os/core/include/drivers/atmel_rtc.h 17e4e2d1b983087461bfcc4bbfbd70e8b3ae1dac - optee/optee_os/core/include/drivers/ls_sfp.h 850d68c54c252aaad1b085a02dd9755cdafbf8d1 - optee/optee_os/core/include/drivers/pl011.h 5a5250f891c8e3fd01fe97da71d746ab170d70f8 - optee/optee_os/core/include/drivers/zynqmp_efuse.h f79ce31669141d007d3d46c0510c83271a074888 - optee/optee_os/core/include/drivers/zynqmp_huk.h 967a082f3664b603f92282dc6fbeab8b6b48a5fe - optee/optee_os/core/include/drivers/stm32_bsec.h 7ec39bbfed1d291fab370eb45582e3387233babd - optee/optee_os/core/include/drivers/rtc.h f4a11c9f29e893a7d4398704cf87f9025181fafc - optee/optee_os/core/include/drivers/lpc_uart.h d3f5bdbf1140a7acc6783fb34bf37bb7bf908822 - optee/optee_os/core/include/drivers/stm32_gpio.h 6f702cd255c663f52ccc829b19c4b0922c5a424a - optee/optee_os/core/include/drivers/scmi-msg.h 7f3ef46e25244f20b8ad05b4953dc9bdc01db532 - optee/optee_os/core/include/drivers/stm32mp13_rcc.h ed0702ba8e49ca5d2b8fde5b754911bdd2120b71 - optee/optee_os/core/include/drivers/imx_i2c.h c17bb19360d4833803c17e03dcbeeb35f1ea9db4 - optee/optee_os/core/include/drivers/bcm_sotp.h d6e344ad9b81930944052a2aa7439fea4f98e7a3 - optee/optee_os/core/include/drivers/imx_sc_api.h bc7cd62a50be3ff1fe02b16ac03930cd0dfcd250 - optee/optee_os/core/include/drivers/i2c.h e6b7e53a5566ba0e35f80a7ef10778c3e94a322c - optee/optee_os/core/include/drivers/stm32_etzpc.h 91b6d3c752a3d89e785356b8589c47726ff68d98 - optee/optee_os/core/include/drivers/zynqmp_csudma.h 270363e25fe0225609b0ffe1465e58e30181cd29 - optee/optee_os/core/include/drivers/amlogic_uart.h e2313ad621f3429650c5a66e403ac36467a63d00 - optee/optee_os/core/include/drivers/scif.h 85176c6d326f482d19d97007de5c3ec8d04b620b - optee/optee_os/core/include/drivers/gic.h fdec23a82da4b29851ee791c9f774fbcd9a3ef53 - optee/optee_os/core/include/drivers/stpmic1.h 6110fa3ecbd1bb7185abcee753303ad1090d1aca - optee/optee_os/core/include/drivers/ls_i2c.h 6c1691ca8fd41135a8d571021414095918e1ddae - optee/optee_os/core/include/drivers/stpmic1_regulator.h b0bd034bd589dd4037f5d2c08c927680967378fe - optee/optee_os/core/include/drivers/bcm_hwrng.h 03e62f840c1787e03eeef8e2651241d857e9db43 - optee/optee_os/core/include/drivers/bcm_gpio.h 58ddebbef8bd6c594d871fb476d88a5f9831153d - optee/optee_os/core/include/drivers/ls_sec_mon.h ccf8b37d1e3c2b88218a2f4a5527a5351e578154 - optee/optee_os/core/include/drivers/stm32_iwdg.h 13f6bae233237743e412afcd68f284c9ed5dbaa0 - optee/optee_os/core/include/drivers/clk.h 15c9e1f1141527fddac70ab4b2c014fc7d6bc9fe - optee/optee_os/core/include/drivers/sprd_uart.h 0052e6343728b9d0478a53e48d52e63fdf849444 - optee/optee_os/core/include/drivers/pl022_spi.h ffdb782c56f2fad968e061ada29b9f9fbf53b964 - optee/optee_os/core/include/drivers/caam_extension.h 5ff0b0a51178c901092daedd19fb97ba89033676 - optee/optee_os/core/include/drivers/imx_uart.h 0d14069df1c50f642343da9b04da98feaaa60fed - optee/optee_os/core/include/drivers/cbmem_console.h aa9e92efc98f9e0aa945c7a89dbc24edeccf22a8 - optee/optee_os/core/include/drivers/cdns_uart.h b1d5544ff4f3ab0503a7b7403cafc67a0893bc29 - optee/optee_os/core/include/drivers/tzc400.h 6afdb461835883d1f14f1359a5c3400225542c53 - optee/optee_os/core/include/drivers/ls_gpio.h 406ff8e0cfe26a1e6e63621ffa9ac1176426c376 - optee/optee_os/core/include/drivers/tegra_combined_uart.h d23e095f310bc590363cdcd5017e718a87f5d987 - optee/optee_os/core/include/drivers/imx_ocotp.h abea729d88bd897be58ed6c9534b6d37cf914d57 - optee/optee_os/core/include/drivers/zynqmp_csu.h b86965bb5304387c459eeff497e0bd9b83c5ddf4 - optee/optee_os/core/include/drivers/ls_dspi.h 20aa80be5a165588b6d87d778ae56cb924f4f8dd - optee/optee_os/core/include/drivers/scmi.h 54f6572933ae458e1115bd8d43337c0955900239 - optee/optee_os/core/include/drivers/atmel_shdwc.h bbd9f402bd751cfe638fb2585b52d940de3cd704 - optee/optee_os/core/include/drivers/stm32_tamp.h 01e3e3b8a4910f25dfdfdd865b70e885b8eb5151 - optee/optee_os/core/include/drivers/versal_mbox.h 5a4750980a258bf284a226cd8646a4d9a4f20486 - optee/optee_os/core/include/drivers/imx_mu.h 70c182404c24a9fa1b059962400b894e241bb626 - optee/optee_os/core/include/drivers/stm32mp1_rcc.h f15cc62ed1de06587145c0fb453cb291930709a5 - optee/optee_os/core/include/drivers/bcm/bnxt.h ab510c035d99dbaa743189d33aad9ea7118657ee - optee/optee_os/core/include/drivers/imx/dcp.h 33ea27d3d7b5742a187f56005a3c9ef39258ca2a - optee/optee_os/core/include/drivers/pm/sam/atmel_pm.h 6d6fe341171b0aff38656211fbd1e2080b8784a0 - optee/optee_os/core/include/drivers/tegra/tegra_fuse.h 9caf071db678be64cccc5729f716abe5d1b44353 - optee/optee_os/core/include/drivers/tegra/tegra_se_kdf.h 4a198e834d4cbdca4a981db0189327d923feca02 - optee/optee_os/core/include/drivers/tegra/tegra_se_keyslot.h 85b2be535e1d7a67ad7dcc13cbef547e8a1fdc22 - optee/optee_os/core/include/drivers/tegra/tegra_se_aes.h c43a36c90b5dc3d59157a90b64bc67387c6eeb80 - optee/optee_os/core/include/drivers/tegra/tegra_se_rng.h 077a260e86e358ef193c8be4014a2e153f873680 - optee/optee_os/core/include/drivers/sam/at91_ddr.h b08482914acc95186b72c3958214552a60f2cecf - optee/optee_os/core/include/tee/tee_supp_plugin_rpc.h 56b607a2dea23df516e984c6fc8fcd88f15d5d40 - optee/optee_os/core/include/tee/cache.h 442eb415369cd5a3b0ce0122ade4dad47a62e645 - optee/optee_os/core/include/tee/svc_cache.h 6251efcc663e5b7b2d2e3909adaabba03fb68f05 - optee/optee_os/core/include/tee/tee_fs_key_manager.h 657ef3fdd6eee0127813cbbc0b30f96b020ddad7 - optee/optee_os/core/include/tee/fs_htree.h ae129424808a418e6bac7c413d61d8e68b77f1a5 - optee/optee_os/core/include/tee/tee_fs_rpc.h abea67617b2ab0ac70350ff3fe67b738eaa3645d - optee/optee_os/core/include/tee/uuid.h 261ffac302a6e4dfc609d264ab8a2f5c8f611cd6 - optee/optee_os/core/include/tee/entry_std.h 985b521fdf5c6b861009db340a64b69916629c81 - optee/optee_os/core/include/tee/tee_obj.h 9c9452532e8c96703b27a5fa32a17686296b03aa - optee/optee_os/core/include/tee/tee_cryp_utl.h c3d0c51429849d97786fb4e47f9a1903d00f27f3 - optee/optee_os/core/include/tee/tee_ta_enc_manager.h 75b991d9820ed21b0e6aaae7716292815e436105 - optee/optee_os/core/include/tee/fs_dirfile.h 83624d48c6657bc88f152412c4b188cb45c321c4 - optee/optee_os/core/include/tee/tee_svc.h fd483467f8bbbd73a4715c099b3cef4143fd9fa2 - optee/optee_os/core/include/tee/tee_svc_storage.h 49a43384e80403de5b68e7c51b49d0ab2cb72c20 - optee/optee_os/core/include/tee/tadb.h 4d806cb789bea5d77548fff5db9fd2efaba6e6c1 - optee/optee_os/core/include/tee/tee_cryp_concat_kdf.h 751b511848af0dffbda5a13f33e56b5edce71560 - optee/optee_os/core/include/tee/tee_cryp_pbkdf2.h 904e71454435133456b0c322cf904d5c59bdf624 - optee/optee_os/core/include/tee/tee_cryp_hkdf.h 282d054a700343402b5ffbf55003e16a0e40d567 - optee/optee_os/core/include/tee/tee_fs.h 736098ff42612ea5b4b62eb75748c077b386bad0 - optee/optee_os/core/include/tee/tee_svc_cryp.h 5d5bc9425b1ee3986b607bda1c87fe7358ac446e - optee/optee_os/core/include/tee/tee_pobj.h 13d33b2eec5bee8db2ab00fdf9d382e998437f6e - optee/optee_os/core/include/kernel/tee_common_otp.h a3920a6899bce55bcd3fa5d64f5bb7ca1e8b76e4 - optee/optee_os/core/include/kernel/time_source.h 7de5f721ad13121bcf2d0de7f6a9ea4143dd9f86 - optee/optee_os/core/include/kernel/user_ta.h c39885dc2548b8d6723071bcc766bb513e3ef78b - optee/optee_os/core/include/kernel/user_mode_ctx.h 079022f97400edf9b24bc33342d83d5a29904660 - optee/optee_os/core/include/kernel/pm.h 343ecd6ccd2cab4352a674c9ab3a15b1c1ba21c0 - optee/optee_os/core/include/kernel/misc.h 6a70452c8b44c8e2c5cd9b2882d9b5b2523e6d6f - optee/optee_os/core/include/kernel/ts_store.h 0e119d6c1c012d0e897cd92f4d1e69edb103d332 - optee/optee_os/core/include/kernel/trace_ta.h c1f5708a89345bd1d1e59c0998656cb1b410984d - optee/optee_os/core/include/kernel/cache_helpers.h f8c3e09feb3eb6829317622723491376e16ad403 - optee/optee_os/core/include/kernel/ldelf_loader.h 4b118e15613afc9762f5fffac4cf75718a1e2365 - optee/optee_os/core/include/kernel/embedded_ts.h 5981e9060b7c5809d07b6470818fbc8106b6ba1c - optee/optee_os/core/include/kernel/timer.h 03869d1183dcc5a128c46283d613b819c265b46f - optee/optee_os/core/include/kernel/user_access.h 156f0676f16613690d53954d8970a207696ad998 - optee/optee_os/core/include/kernel/boot.h 08718b75d19035055180740c78363d96b950f76f - optee/optee_os/core/include/kernel/scall.h 43d7208ecc74a9e5dae1a0f3a0952edbd3f50444 - optee/optee_os/core/include/kernel/dt_driver.h 1f01922d333b66cb291425b1df13da258ce3c63a - optee/optee_os/core/include/kernel/ldelf_syscalls.h 590c3ba3b3785bd1b70f32788080caa459b55454 - optee/optee_os/core/include/kernel/tpm.h 50ad6b5029b19a50602abf8eb47e8e9899f1c5b6 - optee/optee_os/core/include/kernel/mutex.h ea06c194fd6a73003ffa0e05277da5d7e959ad86 - optee/optee_os/core/include/kernel/dt.h 3c866070d82642a38f13295e6f77062550edf5ad - optee/optee_os/core/include/kernel/msg_param.h bd8e3321c7ecc34efa571fc5e86b54d71cb6528c - optee/optee_os/core/include/kernel/thread.h ad2a242f3d2159af1fbab6dd61510bffc9c4ab5b - optee/optee_os/core/include/kernel/wait_queue.h 625040376d7bc280e4dffbe23e77e046dbf40e2d - optee/optee_os/core/include/kernel/asan.h e4719588b0cc670eee34fbf59d8d50f39cdbdc45 - optee/optee_os/core/include/kernel/thread_private.h 20b6809c10b27e0f3f68a37fb3e63acdbb2ed77c - optee/optee_os/core/include/kernel/early_ta.h c2ecc11bbd7e8f0f5790187e95cf6e75d3de949f - optee/optee_os/core/include/kernel/delay.h dec752b6f205f5aaebb155fc59b0b0dfb271fb92 - optee/optee_os/core/include/kernel/ts_manager.h 008387623d8bffb1af193f51ceef6a0e1ee50d27 - optee/optee_os/core/include/kernel/huk_subkey.h 2557d4fe44597586a3ba561a107751dcc6371950 - optee/optee_os/core/include/kernel/user_mode_ctx_struct.h 7beb0d03bbf670fec4501a0f47399d2688f320ea - optee/optee_os/core/include/kernel/tee_common.h 7a061ef229094709080ea9495ad8bc590c005d4d - optee/optee_os/core/include/kernel/tee_ta_manager.h 583639447d8f7259b6621ac01705f412b6077543 - optee/optee_os/core/include/kernel/tee_misc.h 9580dfe1f16580758041e227e65811d04ca384b6 - optee/optee_os/core/include/kernel/lockdep.h 0f7eb297ee9d4dbf0e98871bec56c6dc261ba775 - optee/optee_os/core/include/kernel/abort.h 794f29e2701b79021aa45108e202b7dd5b569624 - optee/optee_os/core/include/kernel/chip_services.h 475dea2eb1f1a4e0e1d015e9237c945140be9040 - optee/optee_os/core/include/kernel/virtualization.h c7f3799e8db3911f324d4cb4892e433edaab0059 - optee/optee_os/core/include/kernel/unwind.h 9edd15d57bd1a295e7318d5910137712e72bf085 - optee/optee_os/core/include/kernel/linker.h 4b1ffaeb0730cb0bfc64e8e63c6bf3191816c516 - optee/optee_os/core/include/kernel/rpc_io_i2c.h 67fe768ec9472c46198b28bd25d0ba5672840d37 - optee/optee_os/core/include/kernel/tee_time.h 224aab4a1ea0d969da205086d9438a0975c6c8bd - optee/optee_os/core/include/kernel/interrupt.h 42bbd277b0848f680a125342d00ce386bd6eb605 - optee/optee_os/core/include/kernel/spinlock.h 340dc639cdcc2c5510554711d03b760103b790d5 - optee/optee_os/core/include/kernel/handle.h f2ab69b044d5bcce9b58ca8ccb79b83d50b5fb70 - optee/optee_os/core/include/kernel/notif.h 3e8149ef20283bc5089ca8714a3a698349e96d37 - optee/optee_os/core/include/kernel/pseudo_ta.h ff1ad215df335bbc1bf5a8365c96c64746e4388d - optee/optee_os/core/include/kernel/refcount.h 843ea779e8ef15af5a338c3845356280d56bbff2 - optee/optee_os/core/include/kernel/panic.h ed2772a8c2274cf02551a2a21cfbc33a7d81c2dd - optee/optee_os/core/lib/libfdt/fdt_rw.c a6759c569917866b44961c88629ae4f3f07ea686 - optee/optee_os/core/lib/libfdt/README.license 966e9a4b174cc33c3ba6126614b919ca0bfd09e4 - optee/optee_os/core/lib/libfdt/fdt_overlay.c 78de4be67ce92f5b90ff1ab89c2ba46a1a34da7d - optee/optee_os/core/lib/libfdt/fdt_ro.c 5ac5dba57124ad85911a67c10cf941f08ae861bd - optee/optee_os/core/lib/libfdt/libfdt_internal.h 0da7a6ee0118d32ca78e772cbf5a81f0cd62af9a - optee/optee_os/core/lib/libfdt/fdt.c 1c8f13cf72490970da6d19a7a3d3c06f18770f07 - optee/optee_os/core/lib/libfdt/fdt_wip.c e01b7a0052b837a4650f2c9ac75ad38c40edc583 - optee/optee_os/core/lib/libfdt/fdt_empty_tree.c e5657b776e8466d0d7c9578591d9c2ef45ef2799 - optee/optee_os/core/lib/libfdt/fdt_strerror.c 55fc5d2ffcba07e29948822d0b12e4bf5546b8b8 - optee/optee_os/core/lib/libfdt/fdt_addresses.c fd3af5baadbf42cca01d1a438cc826ae85a21f97 - optee/optee_os/core/lib/libfdt/fdt_sw.c c90d25bb7b217171ad9437ee0bc8d4e0c5c7f4d3 - optee/optee_os/core/lib/libfdt/include/libfdt_env.h 7cf2619336867b335fe8f3c919607242477ccfa0 - optee/optee_os/core/lib/libfdt/include/libfdt.h 265155048eb725a03c49a45a27f322ca6f3dfe6b - optee/optee_os/core/lib/libfdt/include/fdt.h edf93d4bfb11950ac75aade2faf0bf05d0aaff47 - optee/optee_os/core/lib/zlib/zutil.h 8770ab43c9050b824c646f6e6cee8b3c0628cbda - optee/optee_os/core/lib/zlib/inffixed.h 47e5da9b88163c7194af9b7b6a17fb46ca08b009 - optee/optee_os/core/lib/zlib/inflate.h 36c4f51e48f8320621c5739dd2ee69ef0d973a21 - optee/optee_os/core/lib/zlib/gzguts.h 00b226f75f6beab393031f6893b2868c707d0d0c - optee/optee_os/core/lib/zlib/inftrees.c 8139ab5dd86e53ccbde7ba4e78200db4cd79f9a9 - optee/optee_os/core/lib/zlib/inftrees.h 1e0b1438feffed910661d48b2b793a5f7c308f06 - optee/optee_os/core/lib/zlib/zutil.c eb37e780cdfe0dbafb29c0fa8629125c6e19bd6a - optee/optee_os/core/lib/zlib/adler32.c 206b2054814df6c3f42f29c045d584c6a25c462f - optee/optee_os/core/lib/zlib/inflate.c 5121bcf9ae9f1eb58b39c4debbc5931e5be16434 - optee/optee_os/core/lib/zlib/inffast.c 341003df806d2bcfcbd194fc3f9da99919b918a9 - optee/optee_os/core/lib/zlib/inffast.h 4192c931405d13fabed42ec8725255502d35fbcc - optee/optee_os/core/lib/zlib/zlib.h ce569e81ab26f5eb8d922b18be6561af7876c4e8 - optee/optee_os/core/lib/zlib/zconf.h 79b1451ee0197c749cd4f07450ed2d374f1c3cee - optee/optee_os/core/lib/scmi-server/scmi_server.c 619aa8e61beb89b2df060ca24485432e8269b5fd - optee/optee_os/core/lib/scmi-server/include/optee_scmi.h 36ca35680a4370d4f993961371d80d2e7b777458 - optee/optee_os/core/lib/libtomcrypt/acipher_helpers.h ef50fbda210143489722c5c073b049220aee69ce - optee/optee_os/core/lib/libtomcrypt/cbc.c 2449139582c992c16e854441a9adf477c7b7cbd9 - optee/optee_os/core/lib/libtomcrypt/gcm.c 518d56bb8519843ed52fc2ba83bc4fb568576c65 - optee/optee_os/core/lib/libtomcrypt/ecc.c a001afe7f955e43839c5e0d73be3db5db77d94d3 - optee/optee_os/core/lib/libtomcrypt/ecb.c 9197499a951acd6f4952270e28672de2d04696ca - optee/optee_os/core/lib/libtomcrypt/ctr.c bd085d21425692efa0737d43fe957bf83da73e8c - optee/optee_os/core/lib/libtomcrypt/des2_key.h 3ff597cbe112f20a809342d56622442a8a427ef0 - optee/optee_os/core/lib/libtomcrypt/rsa.c bc5761862d3f2bdc223bbd894e1edffc89db0614 - optee/optee_os/core/lib/libtomcrypt/aes.c ac9a9648fe065d77e8a07c0f153c16784b90b675 - optee/optee_os/core/lib/libtomcrypt/cmac.c a53dd03d8ef444dc1ee628dd000ca066984be89d - optee/optee_os/core/lib/libtomcrypt/sha256_accel.c b1d9c45ed1f78bc67c1bf788fd2478f835b86f80 - optee/optee_os/core/lib/libtomcrypt/aes_accel.c d406e89a395c613f397920c807ff31640f85073c - optee/optee_os/core/lib/libtomcrypt/x25519.c 466eb4dd083c77261b455c56dfb3036243b0992e - optee/optee_os/core/lib/libtomcrypt/sha1_accel.c f2db1584836afadf8108bc4068ada599727f3a85 - optee/optee_os/core/lib/libtomcrypt/sm2-pke.c 2fc6c08d346f75feec7f1c1633ccf1ddc1ac7736 - optee/optee_os/core/lib/libtomcrypt/hmac.c 1f8c0a64e4cf8b1399017599666898c92a705a3f - optee/optee_os/core/lib/libtomcrypt/dh.c 181064609b067d38f551f69dcacc2d7a6ee4c249 - optee/optee_os/core/lib/libtomcrypt/sm2-dsa.c a2ecdde9b88869f00656b532502bf2e1c9c778bf - optee/optee_os/core/lib/libtomcrypt/shake.c 6d7a529ebaf23ae4f3fb74ea1d5774041d190880 - optee/optee_os/core/lib/libtomcrypt/dsa.c 72b382fc200ec2a39395f48c821d263bb827cd3c - optee/optee_os/core/lib/libtomcrypt/sha512_accel.c bf7cfd733029fd500704f55382b02cd8fba1b84e - optee/optee_os/core/lib/libtomcrypt/hash.c 627ba519b1c58c51f6ba86d4c3efcf948e497db9 - optee/optee_os/core/lib/libtomcrypt/sm2-kep.c 4c84ceade0de9502fa8805960179c1dddbff19f6 - optee/optee_os/core/lib/libtomcrypt/tomcrypt.c 422469b123ee31fdd517259a2ff73fe03da28d95 - optee/optee_os/core/lib/libtomcrypt/ed25519.c d71f169898b1d8fda6a85945b52a67c6499afaa3 - optee/optee_os/core/lib/libtomcrypt/mpi_desc.c 191319cf67c91dac0437c501694f9973ada49045 - optee/optee_os/core/lib/libtomcrypt/xts.c f38de7925c7043b9c008b228fe88f291f90fe671 - optee/optee_os/core/lib/libtomcrypt/sha3_accel.c 99aa558ed75d6462b266bdab24faa189c03b4563 - optee/optee_os/core/lib/libtomcrypt/ccm.c 999e42770e9ee014be2004a0f9ce41d08a2002ac - optee/optee_os/core/lib/libtomcrypt/include/tomcrypt_mp.h 5c28c3c8b5fdb83a197148d44816e8b005affa3e - optee/optee_os/core/lib/libtomcrypt/include/tomcrypt_init.h c991e82af32c3fd33d4ca7f63a43c46aaa3a8af5 - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd320.c bbb1244d51ea6efa2a0d6fd5ff5d1a6b507eb3cb - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd128.c c4e009d4708e3b97b2d83467411f582076ec374b - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha1.c 699622196fe40d368c4aa87afa335085d2d7cbd8 - optee/optee_os/core/lib/libtomcrypt/src/hashes/md2.c a24770ddff20aa047ca6e50ed3b40f67fb229213 - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd256.c 3c19181cce8bd461cc6a736ec3f3940ec737bcdd - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd160.c 82aa1b04a2ce5276fd516e96169dc1b0c2432bb6 - optee/optee_os/core/lib/libtomcrypt/src/hashes/md5.c f0e38b2df179903a5c62a5d1223c27d9468f2b55 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha3_test.c f7476e6db75e35d781ab4d7ac8fbbb76133f2158 - optee/optee_os/core/lib/libtomcrypt/src/hashes/blake2s.c 17750b4d62fad12b1ae16ef01a8ffa2cac05fe1a - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha3.c 1767c79b4e8637fd2636ed3e5d54dcd37cebae04 - optee/optee_os/core/lib/libtomcrypt/src/hashes/tiger.c 50f0d32cf7879499990c4ec792546db1e812dfaf - optee/optee_os/core/lib/libtomcrypt/src/hashes/md4.c 436cc2c14c7f7f513d234253ebce325da3441faf - optee/optee_os/core/lib/libtomcrypt/src/hashes/blake2b.c d4fe8714b77fd3ad07260899bc8b5307e2d44e68 - optee/optee_os/core/lib/libtomcrypt/src/hashes/whirl/whirltab.c 5c4268acde331fa5dfc75643f9edc2c04189e29c - optee/optee_os/core/lib/libtomcrypt/src/hashes/whirl/whirl.c 63de08d2a37229f4bc2e4138db49d71e7f5786d0 - optee/optee_os/core/lib/libtomcrypt/src/hashes/chc/chc.c 3b7138b66d581516a8dd7568842636ce576e8f33 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512_224.c 18123fb06342b70d7c8af10d2c72fd07b75e1d2c - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha384.c 91834258fd0a291b0c2e8b5a43b6bd8f7278bca6 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512_256.c 3d396867f33dd56b9cb7f66e66c902badeee4bfc - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha224.c 3ff874c5735dc5e5d895621a56ed2a379f35f3fa - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512.c f25a1dad013d500b85f3eef3b3570f30a88b8937 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha256.c 123f4981edadc5f102d34b0ba1b5a187c185bba8 - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_file.c 0143b2df7c00d23cf21ee3f0a263e80cfb42788e - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_memory.c 01fc3d71a3f1525612e644839c7a707c1e5a1af5 - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_filehandle.c 06ac2272160baaf80405c2bc2d9ef9a5295548b4 - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_memory_multi.c b1696e891350ceb540ac60bc6d4fc5601ae109b1 - optee/optee_os/core/lib/libtomcrypt/src/prngs/chacha20.c 91b049316fd473eb33d4807d7b5aaa9a00844a82 - optee/optee_os/core/lib/libtomcrypt/src/prngs/rc4.c 9931d364f7feeae167aaad25aabc387977444f87 - optee/optee_os/core/lib/libtomcrypt/src/prngs/rng_get_bytes.c 94ca15102c5937a658d63a00e39be8d7ce0a25fe - optee/optee_os/core/lib/libtomcrypt/src/prngs/rng_make_prng.c e618ce5c3d8409cf47b68ba9621e64262846a123 - optee/optee_os/core/lib/libtomcrypt/src/prngs/sprng.c 65bdd642447c1d4dfc26f0f35958f0e1f9dbf51b - optee/optee_os/core/lib/libtomcrypt/src/prngs/yarrow.c 4b6959d31d2cd9d600c17adca9edd2b7fbb70bb8 - optee/optee_os/core/lib/libtomcrypt/src/prngs/fortuna.c 0175635dc4f43317153da8fa639515156755da5c - optee/optee_os/core/lib/libtomcrypt/src/prngs/sober128.c 51e23c33fc2f379b97fdbb9128414859204e00a4 - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk.c cc60780ba62cc198b8657fb2994150ebdbd9aabd - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk_test.c 15c26663221b68b94b5e2f66b93c1b4468d6b956 - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk_memory.c 43f7927b89b648f1b642bbe96a30329482a96706 - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_stream_memory.c e554ce2b664e1b21e037000eab5b05a464e2f913 - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_test.c 0370402bb2b440618f27fff3e9a7d3e2219a348e - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_stream.c 7c4f40cf2659b91a59b92ee79867fc47b44affe1 - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128tab.c ff214c34d15c197a91a236c37775d89e959c1bec - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_test.c 18ce9329f7f80ff15e4e96615479074600a7ec87 - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_stream_memory.c d6981e9defa0ed7bd29fdde4dff9567394bf672e - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_stream.c 421494432d61682c13c00cb14769af324f4694e7 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_done.c 0ecad8f59cf056ac38226599bdef384c2e52c733 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_setup.c a1c69b888c2662b3db2c4343318cfed05ce1a262 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_test.c 2f7b628448c81541c1e80e9cd8cd61e1489736f8 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_ivctr32.c 408fed5f27e4bb531ec7c18c4ea4b85e1b3e25b4 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_keystream.c 95e2d29cf4201f1cc469997b0aef539883229f02 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_crypt.c 76550dd06cbcff27a2d8ac4d8f8ef0428da2a4ba - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_memory.c 19529a1c91610536d1f56e09d8f7f0c1c44ed1fb - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_ivctr64.c 1e3ea925d7df004fe7994bcedc4d5e0d9551c09d - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_keystream.c d7ddc63403a0836fcb998d8a80e1d253aad3fac4 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_ivctr64.c 51497c0e6a261a2ebe26056565149049e7154e05 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_setup.c c086c739c64705448b06feec7107cd47dedf997e - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_memory.c bfa49e2602c5cdee29bb880f6558844a31175fc9 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_test.c a4f8195e9e117c1053f0272b7b26bc835bdc5337 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_done.c 5d403e317c9deb62133d017412250702a48683d9 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_crypt.c b8a013b428ced9671422b507d6833d25312bd823 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_test.c e8f1fb8eb2b962abfef86027594a70a50023e9d9 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_memory.c c1487e9b5be5b8d3a2662a6e37a477cf5c86bb8f - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_setup.c 21ad37425084eb46c5dd6d7917ce29b0758fe98e - optee/optee_os/core/lib/libtomcrypt/src/stream/rabbit/rabbit.c 4aca9bfe042afdad9b57f2241c99597911fcb7a8 - optee/optee_os/core/lib/libtomcrypt/src/stream/rabbit/rabbit_memory.c 41b01b20223d2bb66ac8f419cf6f8435c9867f86 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_encrypt.c 2e8ea32ff629fd7635676de6611f85ef9285eee6 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_decrypt.c f9f61c74b98bf0afefdd73ff10efad3fafc465b2 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_getiv.c cf8ba7e0b9c7428652d258729d7790277015c181 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_start.c ad7cdbcaef35b7db424ce95e64bf87baf2f4164a - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_setiv.c 06cbb137bfc9d209674f552805083aeb3ae1516e - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_test_mode.c 2140195d11a6c4c204d39ed215e9600018bd23cf - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_done.c 85a32e2be465b69f7a4132892ad684cbcd8ea293 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_test.c 3dea7eb14320987637e14b812e161c7efa873b76 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_mult_x.c 336fd44e027effb81725392b176eb6fe5112e371 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_done.c 769fbede217b0ef928a9b5939e849a6efd2d0e01 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_init.c 75a66324c9304c63a62bc2a97fbc8ea51df97255 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_encrypt.c a2a2185a5cbe8319ecd9e65dbb720317d63814ad - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_decrypt.c 4a3b1b9453c09f7842de157e91770af0c0ed7415 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_decrypt.c e6d6ea2e6d96293a8daf46f6c0748936ccc3527b - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_encrypt.c 747a817bfdd38ce834a9198f1e176c1fe227b3bd - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_setiv.c f07be7c3adc027be7917e3d412fe07dcd829fb1e - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_done.c f3d6327ce4ffdabcd4e94091f0c4d616198e8f04 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_getiv.c 9e461ccf05f3b82c258302f4a3eb873038978a89 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_start.c 4ec1b143f43bb9aac8d870e9bad201ea008c17c3 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_start.c eb172f92954aa6843672b7d7bc9707f7448bc1c4 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_getiv.c 6cb5287688b6eee249f4ccc152104c13fc0579f1 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_encrypt.c 2301f47f63701715e30b0a1d5a7bcf2ff97644ff - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_done.c 207351014a29ed0dce3fcaa0898b5c563262e0e1 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_decrypt.c f5dfcba990f115b494ccd95e958582ca983bfb31 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_setiv.c 3a750d0cc44888f039a609e54a400af43310abcd - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_decrypt.c 7d9c7698b787a53e3bd28940cdd444746994860b - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_encrypt.c 56f1ea6d8684edf6bbfc6e96fec03f21f3ec7879 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_done.c a5a54f70612eca541d03a7a560aba8cdff0b4df3 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_getiv.c d6eb82ef3d2185e358f7226af8bb34ffff297694 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_setiv.c ca7bed22fee4c69c65394f0811f17e8a4a3b3ea9 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_start.c 2997b2353ddb192f89b3ec278ad91cdc8d7f2b62 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_setiv.c ee5c9c1fd94d09694078522a5a470058f1aa78ea - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_decrypt.c c9abd410a11d44eb94910ab6d95bafc4e75fcbe7 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_getiv.c 0303400a05e16078ca1944029c36280472d79869 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_test.c cf2740b0fb974b94f1cc08890920c5e95f703310 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_done.c 265e8429da2df62461fd0b313a0120c58034bd0b - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_start.c b03f3351e97f9628fb7921eda85ae3f0b0534156 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_encrypt.c 6186f3e377626cce35518099044023ede1954ee7 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_start.c 7cbf93842dddca33e61a035f80d15e15d1e0c609 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_test.c 89d10d95e8d542d75a69d8f580d6ba6448096006 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_setiv.c ad10e437f618657cf5b5e3ffc20fb6c5219a6db8 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_process.c 6343e513ad46501c7b3c7dc039c8b246ea927590 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_getiv.c 89b75f314fad2f247f3c02a8d043c69822182beb - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_decrypt.c 6166a8f10c3d96dd48d974f0c420288c79faaeed - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_done.c 3e8b2b92ce4faeef2ac7282bb0e58253ed01bc41 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_encrypt.c 2f93fc0a9e1afdf93c263f75675e15d9aae63cf6 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_encrypt.c 4a0d52f29c5da69ba1248de543b53f80f00f0358 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_done.c a1361518be72e5f0a2c22cf2e99afc5155c64421 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_start.c a0941ac3c7a39107c7f3049a9ce6b7cc3d120c58 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_decrypt.c 7b1c5747593a58fdf9669888bd86df7718579054 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_memory.c cf505805e8a15d2a7e342491371d6f38a799f8e3 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_mult_h.c f162118759bca19c0f87c3807df85b6373ae5644 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_add_iv.c d071d7e805d688ccaaf2b3f8c3b7bc5d68bbba1e - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_process.c 60ead8187339abc082c6fb5cfa8ca4a07d5bd3d1 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_mult_h_arm_ce.c 3f6fff56e90836bbb49e7e0f2ea08ef20a25dcc7 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_init.c 792b2c41264e5daf5d14ec67d327f8bfd079d994 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_reset.c 38d9de8caef78490c170d9f138c49db6374e6a02 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_done.c 9dd030615b3a2c6b70c7e24dc125673f88550909 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_gf_mult.c 6799d4d2d91f4e12e8d866fd920ae847eb66d5e6 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_add_aad.c 19aceaaa2254b78b3210d81efdb82d2909a5edbe - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_test.c 650667de1f0e3d2308872cf4537ae49498239261 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_last.c 9b663e83c3004ebe1725ad851bde5f946c0e6150 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c 4dd6870aa2c7606e90a94d802fa383dd8515b825 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt.c 487cb958837ebcf06f92ef604fb17b4a495bbd64 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_test.c 7d45e3754a326d8386f2e536d6baa81554378581 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_verify_memory.c 7c091098e78cd1fb572b8b2e843ac04d30099719 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_add_aad.c ce658863c830e150ad4cc3c3bf741b91dfa68c6c - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_last.c 5f19a3d36e36aa4d6fd83ace3219f06916e307a9 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_done.c 946301da12005f65f7f0a5d5cd79114186db81e7 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_init.c df0f2138b4cb5a037739e226490a0d08bd268048 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt.c 5de251abffe4c5d5eea6c9deb2b5a3dd7c128147 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_int_xor_blocks.c d3aff516bc303de0bedf794c42305bb770b41629 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_int_ntz.c 5fd053c692f154fa517d1a66afac3bf88a666dc1 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_done_decrypt.c 83f9d3b22b6bd8960fde8524bcd094d2fd1bad6b - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_test.c 4c0669699a2b11b52aacda4fd2c617d5695da4c1 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_shift_xor.c 069dc6544fea4923f5ffc9ed6cb508d1e3be4b16 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/s_ocb_done.c fb2baeda2808e719b2543a5bf4e92e86c5a8475f - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_encrypt_authenticate_memory.c 87188dae93ef2263dd1baa4207faf5551bf57bff - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_decrypt.c 93e89b145ff46fcae1c653ee70c2061ac539e737 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_done_encrypt.c 16d4c4b33c5e68749766312b86e074433514c453 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_ntz.c af7e5ec699439a45de3f29a72e6779709ebce7ac - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_encrypt.c 727b4d190bb993d395c276fdc4b6772e7507af6f - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_decrypt_verify_memory.c 9874e24493855b4ccab70b0ff538125c23e3515b - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_init.c a1a4e685352d4984fd5d49522bcd50c4492ea66c - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_init.c 2d89b89d0738d4db5b761d40f9cd02510f413933 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_test.c 0af7bc735a8720e5b936a261204b1aa73a0943f5 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_memory.c 5cc80740578579a16d394fdd144d7d71daabfa35 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_add_aad.c 559a51a7d6a1d21918f5908f788bb294acf88bee - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_decrypt.c 00df47ac677f1c073e872b02d89d034defae3198 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c 9de6e2171df8c3c6a974888bfde2f9333e56e12a - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_done.c 55555aa0f46d7b4575242255f0729e9da8593aff - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_encrypt.c 268ca7b0eb4a15158fd3f58ae75ddaa90a8f7eaa - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv.c 3199f0f705460b9182e1e9b543e800f7d26b305b - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_decrypt_verify_memory.c cf42e3ab0129e2962618a2b9b261e9ea20e0bcf2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_encrypt.c 8f82752538241e4f3c3f48ccdb5bf6fd41d7e889 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_decrypt.c f60e6c18f07779e8b066581926c51522a92069d6 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_done.c 782a71b6b10b0305491529ce9963ace0c26a38f6 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_test.c c5f08bda970ba7d30ff7bee44fda96f5e6515caf - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_init.c 633dfd755ba58507be81b2d70c2d483d28ca9597 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_encrypt_authenticate_memory.c 30473a74f19214129f69b8b067d6d2d5a87a7364 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_addheader.c f8f818328098018b9bc6836915dbfc34bafbf574 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_reset.c d4dca139aea0166092d5665e29064ddda8901842 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_process.c a91a5e3eaa7bcde10bc135c0f63feaf78724d5ca - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_memory.c 9eb480ccdf51a957a9391e17f2740e53048dd90a - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_add_aad.c e045e646861478e232fea83658bd42d37547f4fb - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_done.c 62851dedaffe4829a9e1d62149db76a1986abd9b - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_add_nonce.c f8665c5b620a773ad0a216d19c5abc141e016573 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_init.c 9a94ec21fc09797428df52cdd5e9fd31d0692885 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_test.c ff2dcdde770c5904024d8bd59763632a301e9790 - optee/optee_os/core/lib/libtomcrypt/src/misc/burn_stack.c 746776871c1d225104237b1021e530a23d5c1fd0 - optee/optee_os/core/lib/libtomcrypt/src/misc/compare_testvector.c ad0c66e6a4431f567b49915d01f026888538f63e - optee/optee_os/core/lib/libtomcrypt/src/misc/error_to_string.c 6adfd2c5e4b416a65be0e9e7d0b6a24c1a3589d1 - optee/optee_os/core/lib/libtomcrypt/src/misc/adler32.c 5c187006ec54c463347d528d5671b8e92f9b762b - optee/optee_os/core/lib/libtomcrypt/src/misc/copy_or_zeromem.c f4059601bb534681d08bbf29b543f5bc37d29267 - optee/optee_os/core/lib/libtomcrypt/src/misc/zeromem.c 90dd180fc585755ec6db549d5d69653fe83ed6ab - optee/optee_os/core/lib/libtomcrypt/src/misc/mem_neq.c c129c049a7b7b18cdb44284f93430835d0001761 - optee/optee_os/core/lib/libtomcrypt/src/misc/crc32.c 4b83b978826b5dc7e68898bde8d396e51a73583e - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/pkcs12_kdf.c c2fe66c77a5e4ba8a09979753ec8fa3b1c9530ae - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/pkcs12_utf8_to_utf16.c d0feb5c364be991806af64380cd3a6e5d7062ab3 - optee/optee_os/core/lib/libtomcrypt/src/misc/bcrypt/bcrypt.c 1d1ff4347844de6a3d1d111125194a55c55cf30e - optee/optee_os/core/lib/libtomcrypt/src/misc/padding/padding_pad.c 3c3c7ed1c6223f40663fab3cc95afff608de638c - optee/optee_os/core/lib/libtomcrypt/src/misc/padding/padding_depad.c e0622cab6f654c9d78768c0037a71e91c7c904d8 - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes2.c 5e2328959d1d9fa3dfe651bc8390f56e97cfeeb9 - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes.c 8ea5fa890004eae1957192d67e017a2f68ad820f - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes1.c 779555900035522f3dacfa9d8dcb18c310e78d2e - optee/optee_os/core/lib/libtomcrypt/src/misc/hkdf/hkdf.c 78d7c916e74e8dba0076ccd8a784ef784d2a3473 - optee/optee_os/core/lib/libtomcrypt/src/misc/hkdf/hkdf_test.c abb752921991a5264ecf76f92d09589c9477d1d6 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_sizes.c 63d0675dee46f130dd505b9ef11305f66b51d5ef - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher.c 81f55ffa10b11eb901eb4a3e44acce81c2582f84 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash.c a98c18ecdba584f662232ca582bb88b502daee55 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_fsa.c d92b5cc31e60e6581ee77b6e9780353b967e8321 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt.c 0090a8c4b12094134c7e3fcdd6c82cd26327c271 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_prng.c 233015470408b5b2e38773c5b1127762f545a856 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_prng.c 5c81f4d8d18f6544665cf9385fabb100324f2323 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher_any.c 96342e249d7c747d11849bf1a4a2cfa99139134f - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_any.c c261fdd28c1198d33aeccd35a7728d324671e3b1 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_hash.c dd27864633e7f1746e256cc07e47437bbbb4bc97 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_prngs.c 1221efc9a518048e34fe881a93fe5c765524f34e - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_prng.c 26a169c33ea38516c1421f536f7bbeeb2983f01c - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c c22b0f36bb603c5a4cc0e043d1fc84ed5615c82a - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_cipher_descriptor.c 6809767adc93fcb15bd91fdd9e99a6264937a6ef - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_ciphers.c 18b723be741bf36e94966af24f7f0da9fa256f26 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_constants.c 23eb56683e5cb3b2a6203532f2261e1146584ee2 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_cipher_is_valid.c 9e47537140b5988fba0847120d3e311f83085ac8 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_hash_descriptor.c 34b218af0b0d226b125bb51da3c2016bcde2eb62 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_inits.c 70ff3cb0ee05909a347b56392e40b79171d1d3ce - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_cipher.c 07ad1815506e2a82911ec0c3fbb9dbe66466efde - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_rng_descriptor.c f1821b4e1d8e159fc9eebb3c49abfe0f6eef8da9 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher_id.c d15ddf5b26ce2f13c726a540479ac62355bc4ab3 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_is_valid.c 80d8a64decdaeb241abf260380e42f406eb7e132 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_hash.c d4220e04397554fa19428f3ff33ebc5b80d93d7d - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_id.c 28e1308aa1d2f79105cf6aedb36a9ea1664e3567 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_descriptor.c 082f0d654b13f0b93cbe1d28f01726941f0bac78 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_hashes.c 994a86f2bda5d048c5755b0e7819184195f24ce9 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_cipher.c 474440e2037216fed3c26f124fd92a96e2bf51d8 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_argchk.c 209b907a121df459daa08c8ab473adaedc01f56b - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_ltc_mp_descriptor.c 20925129239360b39ed195a0d8b6b99d59b890f2 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_oid.c 4a0a598b182902b1813bb584ef6dd3ae446d0c70 - optee/optee_os/core/lib/libtomcrypt/src/misc/ssh/ssh_encode_sequence_multi.c 6b7496efa00caecdbe62a0a85ac0ac8b7a637d57 - optee/optee_os/core/lib/libtomcrypt/src/misc/ssh/ssh_decode_sequence_multi.c 1a73cc544c8c9a3bb0d77497a5a92900c5acef58 - optee/optee_os/core/lib/libtomcrypt/src/misc/base16/base16_encode.c e6d0978d88f10edcb4164e550bac09364d5a72e2 - optee/optee_os/core/lib/libtomcrypt/src/misc/base16/base16_decode.c 2e8f9163643ed6d0b41b646077f77fa7c179ffcc - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_1.c 4f6812ba75aa737fd7f24b4148cdf1b3a99e59e4 - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_test.c 11a7db8b0e76dc35b70e854992156d2f75f98688 - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_2.c f5d1d5c1f347ba72d7eecf6995812bd9b0443efc - optee/optee_os/core/lib/libtomcrypt/src/misc/base32/base32_decode.c c2fa3c8655b71dc36a48c5aa409c9ed586f9c8d0 - optee/optee_os/core/lib/libtomcrypt/src/misc/base32/base32_encode.c b4f980accf155a8df885c69266a8b2154992181a - optee/optee_os/core/lib/libtomcrypt/src/misc/base64/base64_decode.c eb9ee827d87cbf5ee6013ea99a318a0e5c477a57 - optee/optee_os/core/lib/libtomcrypt/src/misc/base64/base64_encode.c 9d2d04084cdc6c4c56cec3479af1ccb74619fe42 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc5.c 819970a30ad279c10add699d9bb08c1023039bbc - optee/optee_os/core/lib/libtomcrypt/src/ciphers/anubis.c 60505e6a888a893c8edf9d6065362453230d0d78 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/des.c 9748ebff9d560f59b42bb6c8c1dedc71dccbc225 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc2.c 02474538dadafba33694c8ecab5fc2e6d00a7281 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/khazad.c 06e4fcdd40cc84f756e818ffb70a63da8066c7a1 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/kasumi.c b0f8a843a280133fbab3d261ce7a7486c5f20bb2 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/cast5.c 48cdd948011ecd3e9298f56dce531d60ede7608d - optee/optee_os/core/lib/libtomcrypt/src/ciphers/idea.c 398a2df01e72511a00c4fd56ef10ba61c9e08ae4 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/kseed.c e28e47ef72883f05ef629df3d495fddfda0372f9 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/skipjack.c cfc7412e0fbe23e14536db6836f3da2102c02e06 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/xtea.c c870397dc946312c9c0304e8f132b1fe87eb18c3 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/tea.c 461cbf82c045454db297fe16c3c478c4cde8fadd - optee/optee_os/core/lib/libtomcrypt/src/ciphers/noekeon.c 840013cf542fd64a45cdea8afb965f8aa0e51df8 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/multi2.c 4e35739fffcd60f1f9971113810a08c7c7fb114e - optee/optee_os/core/lib/libtomcrypt/src/ciphers/camellia.c 0e87ea79442a67dec4fad902f2df7a827f1c233f - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc6.c 783f175a7e6e630e954aa409e43cc67a854e2921 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/blowfish.c d48e4087de75284fb9aa215069515ac90849dd5f - optee/optee_os/core/lib/libtomcrypt/src/ciphers/serpent.c 4d6e2810b820eb2b29529f2bb429d35841b3bdd5 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/aes/aes.c 48a4a60cd68d5143a1998139b830ee8fa7e56faf - optee/optee_os/core/lib/libtomcrypt/src/ciphers/aes/aes_tab.c f7eb0744775bb897d006417c91c5f5b4aac5dd92 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/safer.c 31702a5acb225e761e0a4cd0e4b4e0e31c5206e3 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/safer_tab.c 5f2865f98ba1100f2d497f84b78a20571393885b - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/saferp.c b6e57c2661c58975ca885c612932e68bfeb45d9e - optee/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/twofish_tab.c 4a6bb1fb9b2eed818cf6aebf8d6fc78f108db521 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/twofish.c 49b2782b96dbf7d798398be0b39ba922e5a21bf1 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_math.h 4cdf5186a0f57233bdeac68a7db9e2e488806fd7 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_custom.h ed9c10d0285b377accb1e2494f6286e154bed777 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_macros.h 23b6ced88dc0c3124f432f3017aba8b385df4866 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_hash.h 6e3431e86381584751e3fe17d1f783454fad2f52 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_misc.h 6603ac9ecc182ac6407d2a5bdd90f3baa4552f58 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_private.h 4e5b33b2454acbfaa9b2ab42a0a03fcabc598d30 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt.h 44976f48c4f37ff61e8b03ca839b1a65f273117f - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_pk.h 47a31bfd38f96720df80f298c98d96cb435b3ad3 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_cfg.h 660c8803aeecea2223f2075be243bfdf24187599 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_prng.h 2e713c6c463faaebb4e01472732e51d74aa5b185 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_arm_neon.h 941fea915f92af82307b36234f5ce179c0fd3025 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_argchk.h d86162251e3b48c30f090b3d893a17106c1b59d3 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_mac.h b024a3e54d8b78ef88bc56740995d089836bfc81 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_cipher.h c4d8079f35569279e5f30da5d4666d1a145c29e1 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_pkcs.h 406b6b0422373c9c2a3c3f85df960bd5fd4134d8 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ec25519_import_pkcs8.c 131a94c18f4c6d67111f71772ce64e30b214b7c6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ec25519_crypto_ctx.c bbaf6a67e160f4064a99efb50a56e264bcd9722d - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ec25519_export.c 344a33caba6182cfa38c93b69be392fdb85ac4c9 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c 7e7beaf2f29e72101e3ff7ff9cde8d32af8b6305 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_os2ip.c 9765d9c7ad353767665e26aa27114aed5064b9d5 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c f97b4369ca4a6cee89a277cd05e60345fcc88377 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c 7a444c752e2d4df2d1384ce8f9a56dff42a02347 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c 357e06818540426a6b09b30b6265482454ba9342 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c 2d5bca5df73d8684673df1d6ab38bae6f25cd304 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c 7bb1feddfc1ba6fcb69cb4ef537c5a0dfafb8d1e - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c f804f75c30cacbad97b14cac9f9603f27f4ee67f - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c fa6b0f40cef3e152cec36c4ccd8d895e10dc60ca - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_i2osp.c 67055fc35186b6aa83df93e46da7bcbbe92b1f5c - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_set.c 41df11b40913dcd9ec153132f10f527896611190 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_exptmod.c 94fb2295b17b0d88234119fb717d678ec352c9d1 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_get_size.c 47347830be6ee382ced26f00e0be055570804c49 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_sign_saltlen_get.c 9a424e42fb17d230990378f002faa44cd171738f - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_make_key.c 87a49a80c12d41e8594da7524050eba34e5f96f0 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import_x509.c 9f43d136949b104d186b32b4e272ab71212d140b - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c a47196953806fe0b060f66e17a9f5c26db46a788 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_key.c 38f5811d94e0c86e4215591ed40917dbde19a7f8 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c 01b964e18bfa23b2d17ae36580bb114f096fb07c - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c 979846f85b72946ff810edf5eafeca166d4283fd - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_sign_hash.c 9701778bd557f9eb30009b82a995c5e31167eff1 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_verify_hash.c 071f6f93d133ca61acdffd03ca03180bd812032b - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_export.c 32efc4a6c51bd46b2e5123cff17d55cc8560d582 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import.c 3c7f07f8405b9f895d89a3ea2090632df8c19cc8 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_make_key.c e428a8a7e8121639e668ea708f09f5a768e4d12e - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import_pkcs8.c 26547d5e1492512ed28376c853daeed24108f559 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import_raw.c 7fa48553c905b29d4a54176091d6fce2114399d4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_verify.c 3e1ac45da9df45134fb091ec1709d5464f79d2ef - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_sign.c bca50dcf7601a449f350e48f0db458f6e0377f15 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_export.c 8d59b1b306078e34f08e267a5aa226debdf7551d - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import_x509.c d06add7d54e686364cb1d56bc5c23a69c71597c3 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import.c 82232e2e87681ab9ba1ecb3a51e964671eeb710a - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_make_key.c d32c3211c9738e6edeec863035ebddca34d496fe - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_check_pubkey.c 952b34bccc6c1b05ad9de3bcddb1cca3b46b4e58 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_generate_key.c ec26e921ae1e3e3d36d45dc1e9485f2ce7793529 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_set.c e304ed0a492309f8b0055a4e147f87970fdf38bc - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_export.c fb90bf4aa59ee4d6f4371b1ed062a7efdf83462e - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_set_pg_dhparam.c 3f0628db016f76777bae6ec89728511a7cb6cfa5 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh.c 9c29bb5f9a40d49dc22a8b7c3f62c2fb6930eec9 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_shared_secret.c 2517e59c7961fc7b73ed472569df670355137213 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_export_key.c af78940c2ff22884837509d7ba94f767ac3af81e - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_import.c a1886213cc203cfe7e6ef49271838e7d967f53bd - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_free.c 3b82a4885c17b3d11eae9d1f870da34e6cae9f0f - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_set_pqg_dsaparam.c 4b2dbab5e2aa90bd324218ea5674fef8777f8473 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_export.c fa3c683b57ff8087a2fd90fb5c6accf72d63ffd8 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_verify_key.c 272952cb667172cf8fba5e852b5b8147d03f3534 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_make_key.c f547d958caecd824b0b17b1355530bcc788c20ca - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_shared_secret.c a55666907f63f401c00cfa793eac033bc2226339 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_sign_hash.c 5dc0463320e60a8062e4bb3b76301bfbb72227a5 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_import.c 0803f50e230a9797701852fd02cdc9821544fa74 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_encrypt_key.c b2e238370d7a369638a2b76d7c64b726f3eb53eb - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_decrypt_key.c 2893671ff36eba57509da1721ac9e5cf8567b6db - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_generate_pqg.c b6d3f3a6c24debd170f1ec62a74d682113250cff - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_free.c b0a3bbbaf6fb172cc402a25cfd4114abb554850c - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_generate_key.c bb5f98cabbead6be93d785dcc286f45498d5c0c9 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_set.c 7da5513cb4e6ebca0d19c35d74509deb172ebac6 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_verify_hash.c 0287f0fa69106c0067f42dcf123ce01e29d98031 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c 42aa854ffcb3552db4fb57796569ea830db3d9e1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_openssl.c 6b5a515a99122e80c6c6b9aa06a86e21ee73b3fa - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_oid_str.c bc4963f87689adb59ace0786a7b43d6a677b8512 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_pkcs8.c 280c3e6ecb5e86ef00f694afb173a251ce58babc - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_find_curve.c cf05860092837c42f574e893b097a13b3374da04 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c a5205a7b0f315b2ebe0a2ced975772f8a1057571 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_is_point_at_infinity.c b482130a4f79e28597bcb38ab42cff07c19787a6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_curve.c 8149696ce9b92edc4b72e701857542c66a19265d - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc.c 5b57ce74997f89ba8f1107d442aca33bb2dc01e4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import.c 4703d1e4bec1f70e5e1b17f15db6ee3a4046b47c - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_sizes.c b1285aa85f707bd46b815f2a877d32bd8573987d - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ansi_x963_export.c 1303993f215f0d4001ad7ac1dac13696058b33aa - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_key.c fe473b8190607030112719eb24493f1941c3e619 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_export_openssl.c 1860b05d1e6d84e49e6bde6665be70d81cc9c8a1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_size.c 450bf440ad3be5053c0d9c6d7926d5cdcd9714be - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_is_point.c bf20409e528c89116d228521a61e12ec29b6b8e5 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_make_key.c b51764d8bd42b7561f41b8a977e021f720d461f6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c c5c1644f8bcfb94a1e9dc96faf3657ba2ebb4266 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ssh_ecdsa_encode_name.c b818e0a65fbcb65e56211555e7979eb98ece81a0 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_export_point.c 1931064b040780af5b1dfe453878c4cffbec7c7d - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_sign_hash.c c3b19e86b94901366e718206c46cd3cc4432b417 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_decrypt_key.c c8932926feb1db7458a4121747277fbf302deca4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c 966e686fb8e1225167a2e3a7c6df50b0540fa9c6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_points.c f03fb73a557258c6ea41d3193cd6bd750a62245e - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_verify_hash.c 257ac82c33135561dfe7b5c7edecb5a2d0cdf7e1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_free.c 1fb03ce919d517f2cdd83c378d731a39ff656df8 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_recover_key.c 450616e20f9d56c11a1adb892a3645a93741b105 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_verify_key.c 015e8b1e8df2b67df5666581c49ed3b443a17ebd - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_export.c 3e64593819f63544e4b0a5e7d7aca57eb34eade6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ansi_x963_import.c fbe398aee3a10e7dcb094e86282410752aa1a8b7 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_curve_internal.c 1c00b1e26aaf1253c27c4f23b98535e45a041610 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_shared_secret.c 4204640f642d5ddb2df36d5eb318b13aed778172 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_map.c d8f5cf749289d6a9c685c94b34909b764e1d7689 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_x509.c 96db40ce102160544ab24dfd2a14926461815e18 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_key.c f527339cc3a30c2b3135771f132f79c94331a0d8 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_import_point.c df15dd31ef7691042508e5eb5a7963483113cfc1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_encrypt_key.c 1a11b95c51b4280fc073baaebd5f749bf0b623c0 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c 8c6f5460141c1ee2b6fe1887243f5ee6ab21da0e - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import_pkcs8.c a9ba477ca5b2713fbf6217fa2b25888a448773dc - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_shared_secret.c cbc194b08bb465a7b3cea249824712fda8857789 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import.c 9e8045a9b7b85a4fd345a8606dda5a4529102a84 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import_raw.c 812929f4e13a575e58aeceea8cd3c5db95ab2189 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_export.c 0672fb6756a04c5eec2b963d2b2e9798f5d94c5b - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_make_key.c f2e15ff205094f5a30ffd289282806adf3bfa02c - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import_x509.c ea6f9fec8d29d2a40e34eca954bf19601646c1fb - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_length_printable_string.c aafed90e2fb679630e5f4234ead1dbcc220b5ca8 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_decode_printable_string.c c9b6246d4dfd821f49c4cfb15b0b6bc3414d69bd - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_encode_printable_string.c ad22ad01c3f0cfb81fcc6eb155f0e48df5223102 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_decode_integer.c bdfcc0fc58006df5d8906f179fb339eeece8a99d - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_encode_integer.c cdc82def06cef9eb373fb549f277544af32d2d40 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_length_integer.c ca628b8ab6300f40be2d696eb9c06cec680f4e87 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/set/der_encode_setof.c 1292bcd4021db8959c6d5042550705be1b170daf - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/set/der_encode_set.c 28a82e82ca20ba6d4ef0d5d0da2afd9994aea550 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_decode_ia5_string.c 3fc70309a59d43216aa49ab5477df50823a97232 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c ddc24ebe07f30aff933f0dcacceca877f7a8c912 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_length_ia5_string.c 3ca43288d74863f2acf8e0553554f4110d572e56 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c c66a829d9f1a1a0e936357a82b563385c99b38f3 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/teletex_string/der_length_teletex_string.c 3547f3191ec66412dcb8347be374eca128c03c11 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_shrink.c 16be383d4118fcac43cee6cf8550a7b4027ace1e - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_ex.c aedf07da8f7d1b98991abe3e3e74d0760c207630 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_multi.c c5977a968d09b999595cf145d3429a62599ca661 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_free.c 36b1d4df09d77914a9621e323848927e19b9e482 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_length_sequence.c ca146db1227ca30261685565e96aad77b75b5577 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c a7b792db24f08ecaf3dc061773572acce6754633 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.c e597c83e6003b94ef2d3664d81d39ef668416724 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_ex.c 6dc60f80f7af76c0a1b5992f03ddea0435b439ec - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_decode_custom_type.c cdbe2378f68d5da22b7a94428334cb11343dd5ff - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_length_custom_type.c 8eedec47a421b47090137b1e2da8eb203fdef911 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_encode_custom_type.c 8412b0b3c04480ca5f376fefe953156f97d32d51 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c 769cca541575ba36865f25e1673640cad524581b - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c 8a688cc8917314414fb10e6bf7557ac9b22f42d6 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_length_object_identifier.c 24de714f216931c3f599fc8d1e2deb86c21b847d - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c 2da5ad73ec9c0ef261a7a06266369434fbeddc4f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_decode_raw_bit_string.c 9a3485d1bfab9d30eaf363de36eddaec1464396b - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c 291e2e946e23e0e29c802af28ecfb68aa74a3179 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_length_bit_string.c df1aa22c0a11a444fa3e307b084eb35b6d651a88 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_encode_raw_bit_string.c f65972e7e1e35ea9bf3c750f6d2fbd3c22de8df1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_length_boolean.c b85ec531d4f44b87eb3be27290a2aaddc246d62b - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_encode_boolean.c 2c41e8e870f523500c8fb60f9d88b90dd079c9ab - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c 715c09b19bbef0a9d89511be2ba47db3eb184457 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_length_utf8_string.c b64eaf809c7884f4963eabf55cbae2037d4aeb1f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_decode_utf8_string.c 424afeec6f07fd7906055c91c9951d455c69033c - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_encode_utf8_string.c f3830f9b7b3e4c414480974538e07a107e11eb09 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_length_octet_string.c 6040a83b18f15c48008263edc7586ab2682a2650 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_decode_octet_string.c e45dcd69212ceaa620d3a68584c8cc3d8d7d7abc - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_encode_octet_string.c 2e24598b6fabfaad933446c87bd5a064a275e144 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/der_decode_choice.c d82b04231f128724960a64f0099c8af38548d2d7 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_decode_asn1_length.c 61c080828e48973c7e450aca6d6e998b893001fa - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_asn1_maps.c 7a3773c30383a7999306b37627b17630b85eddf1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_decode_asn1_identifier.c 5ae066c005e04dc7f013a783713675e77547f565 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_length_asn1_length.c e9d1241660244c310419ea1378b9ae323a7ac61d - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_length_asn1_identifier.c 18ca4c581baeb6b0fc04572980c8ff2c540588f1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_encode_asn1_length.c 6d28b44c01e719209cf6726c110c6b0601e3ba50 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_encode_asn1_identifier.c 9d6bf8a3d490c881c022ec153b9dfd96d4798be1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_length_utctime.c 13994ec081d65c83c2a411ecce60211f79aa7f8a - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_encode_utctime.c 5c2277093dc1c4f2d6b877f924200805c950e697 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c 4ab4dd3b5bbbb87afcfc52966eb024bb4d0c8234 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c e50711035dcfcaa4d0c1fc32f433be0aa8d98689 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c 52132cd7a799e297b872a524bda661601b33e5a3 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c be4a439c97860d7aaf286c7ff16597491596101f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_decode_short_integer.c 3ed9c426a6a4649858e87dfe5a61277fc5aab712 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_length_short_integer.c f387f820036c9bddff6210310aafe78d14e6c4f6 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_encode_short_integer.c 5cff49720c80fe773da512a51dbaaac7ef7a8eb8 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/pkcs8/pkcs8_decode_flexi.c 0fcf9b8d13534b36c44fbab36118578551653494 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_decode_public_key_from_certificate.c 2e7715416f0b9b81765354e9b71ac389bc674bdb - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_encode_subject_public_key_info.c fde5cba0f1fbdcfa0af606a17b90c2ece77fdfee - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_decode_subject_public_key_info.c efb086030db7d8223ec9f72497920413fe5b9cb1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_get_oid.c d6404b3d1b805e9236eb4d91f784191692cb4f3b - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_oid_str.c 65c73948627beeb228b285cceb082340770d5dd1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_oid_cmp.c daee17f76d3539a02d8567dc943b2b3217098786 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_file.c 7314b670b2c1a382ba1017ccd3b3806fe451aad6 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_memory_multi.c 5e2fa3a8a8b8c0d38d74aa0bab4d4cc206166453 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_memory.c 2588957db97d4b727a20206702de592edae7afb9 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_init.c 3657dea6098b394ec68f7c996eb8c2525646dafb - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_done.c a081274e2f9dcc2ed96ec2a4db00ededed0ec9e8 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_test.c 5a792633cf4c62bb31894bcce5bb07e78763b88e - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_process.c 7ec5d863f61666d818632fd057c4fe9bc1a879f0 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_done.c de921bd15503ba513e2979be7113493b8c679ac9 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_init.c 78be422e4801b343c32f4a4574075488109af2e0 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_memory_multi.c 8fa264dc57c925de0f8f36ad8848c8b278694d5a - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_test.c 683da90e66dec7dfc447bac38e35dbee802d3b57 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_file.c 5c61eca352761007c4111cf83cabf66f712cb67c - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_process.c 9b028196ee6d1b9299d41bc2c6d66cacd1011ed3 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_memory.c fd77eaabb5a5ffddd12e2f91920bd8e657aaff2f - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_ntz.c 21ade96dad372a77d13f421cc9c1f8d2290e239c - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_memory.c 74a84dcfca09518e42ab725a717c8aedc0fb9f84 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_memory_multi.c 1336042d04c7dd5b0ee965be9d037bf654049339 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_test.c 0e00b9ac2e143fc27c3122a3f3d9bc87d8282076 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_process.c 539c06612340597abac186f272ceeec032082a08 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_shift_xor.c eb8f24748a3fbff1fabe0be3ce91f76ace71528b - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_init.c 0371334e645562a86984c83f6257967f26cf1464 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_done.c 4a8d8ec6fb7faf70d806473ae0d8a3d1c9d3cc5d - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_file.c 86f1332253c798f3fdfa01762ed1c64949a69794 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_test.c 6f1f256d9e8a6ee6660406b43866a0dd79fbd255 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_memory_multi.c 31e9ff14eef67741c7e79e9b1a4e478222f794b9 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_file.c f9cbe3b6dd912225eefc54f7dee30754e366cf62 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305.c 5300bb1eab429d1a602a848c46b9dbed916d1860 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_memory.c 224913f37550084d0b6a11c46a674e2560b9f6de - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_memory_multi.c 9bccb9e3b0ce1b901cd5e52d30d7b54b1e8c5674 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_file.c c2f957e54093361abef389519c1a79136dfb5124 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_init.c 278c6feea087176001778da10154df788711b864 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_test.c 149949542f34fe4521472a0d3740f4ac64b23050 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_process.c b27bb0657c7accb0df147f4bf193b12933a9d970 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_done.c c987048ee653d7b9e528924cd4ea2041d81ffbd3 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_memory.c 93f44519ebb2341e9ca27ec077a77a455641dba9 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_memory.c 13a4a399570926073872b210027dc5539d30d44e - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_memory.c 420e593df278e8c4bce349965dc185a1654e27b7 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_file.c 9bf71a86a4483d4e404521f696f591017b261b9e - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_test.c 208bbe5ced04c13eb0e1d3b24e76f5c81345cd04 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_memory_multi.c 7ef84ee8949eea9fb48ef217f1c8ff24f6adf1d7 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_test.c 196fd89dd21f7f943fca9702ed9616a27edc7221 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_memory_multi.c e853e7da65047812f5c09f5ed42bc85f5b2256db - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_file.c e29b12ee69c044ee575a389f95878c7498a62af9 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac.c 361ba0aee5e365c0c0cb186cb4aefdac17289943 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac.c 114da72cefd715009a772baebd50f69a3237da72 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_init.c 8151c66fd55cb82b2e4252f211a7d14de20599e1 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_test.c b8c88d3152a2d9384baf86c1ec61ebb26f13660f - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_done.c f86f622ff3761a9086d7779d77559eddf2774ece - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_memory.c a3529bef5d5ca05f194021b998a1d7ba5fdec700 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_process.c ac3fb83b5d619e067782a032452e215cc2ccc3b4 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_memory_multi.c bbf18f6d75557cfdbb5aec0cb00e3df605536d68 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_file.c bfdb58bcc629f18e9ee0daf89aaccb205454e950 - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican_memory.c 40dc7c58ad7c36c78900489dd9043971310b0824 - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican_test.c 23f68588e1e7259db12eff911680272b1742519d - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican.c 9974963705cf2ee6ede4a5f04102ba8237fe707e - optee/optee_os/core/lib/libtomcrypt/src/math/tfm_desc.c 0519f4dfb1ed6bcad6119da63132e2cb99a1ed77 - optee/optee_os/core/lib/libtomcrypt/src/math/ltm_desc.c 829f687603d1caba9543ddddb56af948b6a6369e - optee/optee_os/core/lib/libtomcrypt/src/math/multi.c 6eb1e1c16c036e2717dc3ab41e98acde07da53a8 - optee/optee_os/core/lib/libtomcrypt/src/math/rand_bn.c 2ca00d67d4090191db790a545cd86d609c5678eb - optee/optee_os/core/lib/libtomcrypt/src/math/gmp_desc.c 4107a71b931755873657a1db5c1d361d3baad0e5 - optee/optee_os/core/lib/libtomcrypt/src/math/radix_to_bin.c 64535e883ae11fec86629844a95e9c1d7f02a486 - optee/optee_os/core/lib/libtomcrypt/src/math/rand_prime.c 5a3aef9006609eab6327112f5508e2991e7a678e - optee/optee_os/core/lib/libtomcrypt/src/math/fp/ltc_ecc_fp_mulmod.c 8eb767695e5573271863a44feebb74683f2f7ff6 - optee/optee_os/core/pta/benchmark.c 6284c967a1103f26724ff4dfe45af409bfbbf948 - optee/optee_os/core/pta/secstor_ta_mgmt.c 35fdbb1aef5536f3741a6fd8413c617d3fc6ac1f - optee/optee_os/core/pta/scmi.c 1a3dee6c0209f34eb5cc01113ffa6b544f5cebf8 - optee/optee_os/core/pta/attestation.c 4e1b614df9067b7a1f2158f1d5111c1925483f9b - optee/optee_os/core/pta/apdu.c 5464c3291d0ccd05a1742d955c828fb6bff76cf7 - optee/optee_os/core/pta/system.c 4b7b26064a5527653817507ced6b5d36e09d75dd - optee/optee_os/core/pta/rtc.c 3ea15c610f4ecba8788d1055a06e13c3b6aeea5f - optee/optee_os/core/pta/scp03.c 14015171ba8ab23dce63f6011ecd0899f08137c1 - optee/optee_os/core/pta/hwrng.c 8217fd671d72116cf6419307db3308a18014e422 - optee/optee_os/core/pta/stats.c 6a748b8c571c2b207c9db79b56b491192bf22379 - optee/optee_os/core/pta/gprof.c 45844fe0a6df40bac193ad48ae86eef7eecbeb4a - optee/optee_os/core/pta/device.c 92265a3a661a4862d09043e5c3ed8787895b4d23 - optee/optee_os/core/pta/bcm/bnxt.c 5d347d3376095cbc05c1ae47cb6d4ac6f74ef5b5 - optee/optee_os/core/pta/bcm/sotp.c 9548805f4cdf2d64fe66f30a4518b5738878b0b9 - optee/optee_os/core/pta/bcm/gpio.c 1d96880636f5a98568edf08f68e5e4b38291da17 - optee/optee_os/core/pta/bcm/wdt.c c53ce6db2d7519d9bd08c02472fe525fbb768a6c - optee/optee_os/core/pta/bcm/elog.c 8accf96a33e318180c18fd79729c3476c4e4a567 - optee/optee_os/core/pta/bcm/hwrng.c f76d93f72808e78fe854329128254e40a8ae64ef - optee/optee_os/core/pta/imx/digprog.c 0b56b4c47bf29b408b9832b6a57ca5277c05a16e - optee/optee_os/core/pta/imx/manufacturing_protection.c 1141e0df408fb0977880fbd63e8a1575a2a81e8d - optee/optee_os/core/pta/imx/ocotp.c 1828d31f10e6236e1f4f6c98f71f34b61827f092 - optee/optee_os/core/pta/tests/misc.c 773d0fc2245c86d75271917a6eef93910cd5a5f2 - optee/optee_os/core/pta/tests/misc.h 598beefd2c0b1d1ed3caf79b7ee3f6fd4315b410 - optee/optee_os/core/pta/tests/mutex.c a27586aab31e93cb9ce669c13e202c989d6f3e00 - optee/optee_os/core/pta/tests/lockdep.c 64e6434dfd3be13b965104477ee440eec10fbaa2 - optee/optee_os/core/pta/tests/fs_htree.c 9d5f604852b526c4c03348962f3d622ead341452 - optee/optee_os/core/pta/tests/invoke.c 5334d9f03de114b60edb9b9b5e7037b10eea8c69 - optee/optee_os/core/pta/tests/aes_perf.c 5b825d9894d2ed56396b487aaa3d994d6860b837 - optee/optee_os/core/pta/k3/otp.c 9f086ff5817b522588e0b043af390b20bc659347 - optee/optee_os/core/pta/tegra/jetson_t234_decrypt_cpubl_payload.c 169bda07f69b89df46b79e7a085d3fc44595d2ec - optee/optee_os/core/pta/tegra/jetson_decrypt_cpubl_payload.h 2cbe5352d0e151803629138882b8b410cd377bef - optee/optee_os/core/pta/tegra/jetson_user_key_pta.c 186b949fc854bc97be7883a0f85300a6113bce2c - optee/optee_os/core/pta/tegra/jetson_t194_decrypt_cpubl_payload.c 83d3b7f9616db0d5e42b621f55691ec5d505b4dc - optee/optee_os/core/pta/stm32mp/bsec_pta.c be4c6a3071f47d6d836b24e210bc1d446aa9afcc - optee/optee_os/lib/libdl/dlfcn.c 902b546a61d836961ed0f5fe348b564b0583755a - optee/optee_os/lib/libdl/include/dlfcn.h 2ece28422760c949f999a648997f0e4f232ccf24 - optee/optee_os/lib/libmbedtls/mbedtls/SECURITY.md 69a1029c5445fbf82397087777714675c6aed1e5 - optee/optee_os/lib/libmbedtls/mbedtls/ChangeLog 34cd5767e5498e0e9fbc3ea30953dbb7a30cc6f6 - optee/optee_os/lib/libmbedtls/mbedtls/BUGS.md e2ad0770f50a3b483b020e4015860e4802e3b9ab - optee/optee_os/lib/libmbedtls/mbedtls/SUPPORT.md 9c4135419c10fb8160ed25ba74f2e655dd524114 - optee/optee_os/lib/libmbedtls/mbedtls/README.md 2b8b815229aa8a61e483fb4ba0588b8b6c491890 - optee/optee_os/lib/libmbedtls/mbedtls/LICENSE acf6955c96e7b062fb476682cca44221182ce556 - optee/optee_os/lib/libmbedtls/mbedtls/CONTRIBUTING.md c5c0de3138dcf3adf8478d316468a72d544a833b - optee/optee_os/lib/libmbedtls/mbedtls/library/check_crypto_config.h 83fcbb151b339ff236e86dce0b26c7f4a24f4ca3 - optee/optee_os/lib/libmbedtls/mbedtls/library/debug.c f48433f7b983f2e4bc0dd945c94ad7da76d5f4df - optee/optee_os/lib/libmbedtls/mbedtls/library/threading.c 1e1202a1a70b33fc56dfc5e187c17011edb30e3d - optee/optee_os/lib/libmbedtls/mbedtls/library/pkparse.c f8f18a16efdfd7aaa581fc625d16b1c3e55ce4c1 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_ciphersuites.c 315ee16fbc23682b7e4d5757716b16f5cd02bc4c - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs5.c 1b8905fce80fe974d94b8c622fe8f1c9ffac330d - optee/optee_os/lib/libmbedtls/mbedtls/library/chacha20.c 559b9e2bea2960c9394c7f3d6c3ce853a86da592 - optee/optee_os/lib/libmbedtls/mbedtls/library/bignum.c bdedcce806f7e967428c250acae28d2acefae2a0 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_srv.c 29af5c956f2a788693c3f61103071b8bed4ec090 - optee/optee_os/lib/libmbedtls/mbedtls/library/net_sockets.c 322993cbc8151f3520b8022f9f95ff9a3c20a182 - optee/optee_os/lib/libmbedtls/mbedtls/library/platform_util.c 21c1eb3144519a4d6b901bc7c4710d2e46ead2e5 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_csr.c f5b2d834025f50f1f657e75b119ffb5eca0ce04d - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_msg.c 63f97dee98c3e121f09f1a92ce5a4db660b69055 - optee/optee_os/lib/libmbedtls/mbedtls/library/arc4.c 8c4d1ea180d89beaf123ffa211485ec970338882 - optee/optee_os/lib/libmbedtls/mbedtls/library/sha1.c 27337042477fbc35ca34acdb6ed9d142ac8fad20 - optee/optee_os/lib/libmbedtls/mbedtls/library/gcm.c e2802f6140845c3bf4498eaf768e5f76af606817 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_ticket.c c518169e89e4a6a9741c048118a20187a9b5c9d5 - optee/optee_os/lib/libmbedtls/mbedtls/library/oid.c efe4b23e8a0c98b570563531ddb3284914370a94 - optee/optee_os/lib/libmbedtls/mbedtls/library/constant_time_invasive.h e4f22fee91436d0c50a565246c300a07adda1ed7 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecdh.c 260858d5b01b92f1a8f1bcbd987cd005e93a120f - optee/optee_os/lib/libmbedtls/mbedtls/library/constant_time.c a89fcca6031d01abe7a86696de3b42bb4a839986 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_tls.c efc6fd614fa60d6706cc4d36d961646d92edc8e1 - optee/optee_os/lib/libmbedtls/mbedtls/library/rsa.c 271f6cfabb363b38f50d995deedbe2a97ee17223 - optee/optee_os/lib/libmbedtls/mbedtls/library/aes.c 4935912b62ab72b3f50e5eaf29df7d5ce2b9e01b - optee/optee_os/lib/libmbedtls/mbedtls/library/md2.c fac77be2fd3e8b7fe8fbc68b56e8107eb47cab72 - optee/optee_os/lib/libmbedtls/mbedtls/library/aesni.c 453e24f27239b9150880e9edbafc1096ef2df104 - optee/optee_os/lib/libmbedtls/mbedtls/library/aria.c c274b5a7e841aa574404844167c3f0c3d14c4397 - optee/optee_os/lib/libmbedtls/mbedtls/library/timing.c 71b284a0544487e2958b45a953b397c5d5edd41b - optee/optee_os/lib/libmbedtls/mbedtls/library/ctr_drbg.c 3ba0ae44b8c9142c37d6b3eec1bb283353c29b1f - optee/optee_os/lib/libmbedtls/mbedtls/library/des.c 9413a59ef6b7123ce68204057686900330e067b2 - optee/optee_os/lib/libmbedtls/mbedtls/library/entropy_poll.c b6f08f5eec4486713b955968cd08783799e79c70 - optee/optee_os/lib/libmbedtls/mbedtls/library/cmac.c 6c8836c3ee0092aa55203d6b340e2a88ab1ad9bd - optee/optee_os/lib/libmbedtls/mbedtls/library/entropy.c 9ca35438a2848ad8bdbf3810fe6b660abc0b6cb9 - optee/optee_os/lib/libmbedtls/mbedtls/library/ripemd160.c 38089efff8e763ca84f68899aa27a12aee37d52e - optee/optee_os/lib/libmbedtls/mbedtls/library/version.c eef47ec15328369abecebd4a9c3bf1d7d5a061d7 - optee/optee_os/lib/libmbedtls/mbedtls/library/pk.c 622cef7a11f54b42f48a8a2acbe628943e1f037b - optee/optee_os/lib/libmbedtls/mbedtls/library/pkwrite.c 91bf49b8e21a175232f8f9ac0a27e7e29344e351 - optee/optee_os/lib/libmbedtls/mbedtls/library/pk_wrap.c 61082dbe6e7a14d79f82c525f5bb500235b37448 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecdsa.c a4fd9926ce0bf5211b4b61e2e83574f522a10eec - optee/optee_os/lib/libmbedtls/mbedtls/library/md5.c fc5fa6471e433ad425b79bfbdd938becb5cbe10b - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_crt.c 9ddeb707be554648d86dbf8b3bd105cebf911eb6 - optee/optee_os/lib/libmbedtls/mbedtls/library/hmac_drbg.c adcbba8a5604dfc87c5fe2315b816fa96c5f7d7e - optee/optee_os/lib/libmbedtls/mbedtls/library/chachapoly.c f85c4897537e66e26f7b00502beb5f1b8b98460b - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_cookie.c b255f5117b8d7c51edf2e480ea74bf97759e7a08 - optee/optee_os/lib/libmbedtls/mbedtls/library/rsa_internal.c b12c4de77452103680a51e14ebc8262beaaa1945 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_tls13_keys.c 6f78ed043b58503736206088d7114d6640a7e699 - optee/optee_os/lib/libmbedtls/mbedtls/library/padlock.c 18c9db10ef79e7521984a3ca7f367808e1ec1694 - optee/optee_os/lib/libmbedtls/mbedtls/library/md.c c31f931b210d449cd6e0418ee3f64599bbf66148 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509write_csr.c fa87c2cb698c3f1d4814e062984c0e3a18dc3389 - optee/optee_os/lib/libmbedtls/mbedtls/library/common.h c52c9609c2c6a156b85487c6c29dd205aca6489c - optee/optee_os/lib/libmbedtls/mbedtls/library/asn1write.c f23224aa8aa469d56af749fea346db46e7f42400 - optee/optee_os/lib/libmbedtls/mbedtls/library/asn1parse.c 2c0509b66770248ba1f87c8701d23ebafb826fef - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_tls13_keys.h ff2f47eab3d90d25a4a3feca4c9c97d29e5b8837 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecp.c 5cb4e9ad752529bb18f635e12f2e7a4653ceae0b - optee/optee_os/lib/libmbedtls/mbedtls/library/poly1305.c 2a5883a66ffb4f0bf72035d66cd93a1da1212a50 - optee/optee_os/lib/libmbedtls/mbedtls/library/xtea.c 6ccacdbcb3d6683215a378812ac9c07a95d15b52 - optee/optee_os/lib/libmbedtls/mbedtls/library/platform.c eff5827f73dc11e94f0cdb521b69c886b6d977bf - optee/optee_os/lib/libmbedtls/mbedtls/library/havege.c 6bc1bb1090d17c6661707282b09e6eb1a829b41c - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs12.c ddc711088ca1bbfb07baefe70610dba57b3ed987 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecp_curves.c 5d28c38c58ee292a7fad605958ca7bb50a68e7a4 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecp_invasive.h fa172fc71f540bbfc7442d35fc4e6bb8d66c32a0 - optee/optee_os/lib/libmbedtls/mbedtls/library/hkdf.c a852ceb607571260156072fa6312d959950c6d85 - optee/optee_os/lib/libmbedtls/mbedtls/library/memory_buffer_alloc.c 1b7eea33bb1515eb89b6cdd0a39214ca1233187e - optee/optee_os/lib/libmbedtls/mbedtls/library/x509write_crt.c b1e5a79d68a7a1ec7f0275df720f96ef736ab374 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_create.c a6b69690f3cd334d2902f9ee2bf9cf96549e0c89 - optee/optee_os/lib/libmbedtls/mbedtls/library/ecjpake.c 96e03b56195a5d547890a933bf2586653d4bbfdc - optee/optee_os/lib/libmbedtls/mbedtls/library/cipher.c da2586312dc78f3baed16f9321ff36678be19a73 - optee/optee_os/lib/libmbedtls/mbedtls/library/constant_time_internal.h d2fb6454dfe04574a6194efbeff38a1b67b3d0f0 - optee/optee_os/lib/libmbedtls/mbedtls/library/md4.c fc8e38cb560a03ad03584ddd456fd0b0402e3b07 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_cli.c 1ec5e59dd3a1462a5fd643e8bb24f38deaf554a4 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_crl.c 2def7447401b608adce999138281423a3102b8af - optee/optee_os/lib/libmbedtls/mbedtls/library/error.c 75f272323fdb02057934dffc82b676c20a1a34e9 - optee/optee_os/lib/libmbedtls/mbedtls/library/sha512.c 8fed6dfadaaf2677ddc9e6da823396b060bcca16 - optee/optee_os/lib/libmbedtls/mbedtls/library/nist_kw.c 142ac144081804afe7d4e8fc50cff380303e0b02 - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs11.c bc1b782ddea9e8c505bac2d0674df882749dd9b0 - optee/optee_os/lib/libmbedtls/mbedtls/library/camellia.c 9947e648b9c9cd3133a8d7a283afe20fc0142362 - optee/optee_os/lib/libmbedtls/mbedtls/library/certs.c 8cc3416707d175080cb571ca699249b993481ee0 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_cache.c 581c1aabeaadfff8296d06359503afeea30bb8fa - optee/optee_os/lib/libmbedtls/mbedtls/library/base64.c 0e792d29724a824da680ae05d8fcfffb924ea6ef - optee/optee_os/lib/libmbedtls/mbedtls/library/blowfish.c 39ec52f39c7a19416093db88d93a2d0850b6471a - optee/optee_os/lib/libmbedtls/mbedtls/library/cipher_wrap.c 132e8598402370bf01ad8f97a2fd020c89e3649e - optee/optee_os/lib/libmbedtls/mbedtls/library/dhm.c 9033f80cc2775bdf8642698f000b1f14c17c2531 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509.c 8e110f23ff047d8ad91cf150b21dda15a8c51fd8 - optee/optee_os/lib/libmbedtls/mbedtls/library/ccm.c ebc9d7694d77dc95c9a26e172b1778334df73a71 - optee/optee_os/lib/libmbedtls/mbedtls/library/pem.c e246ca77d621222a8aa12f52a8984410aea9785b - optee/optee_os/lib/libmbedtls/mbedtls/library/version_features.c b908bc4417b8167c769fda2487b88a62b987ed0f - optee/optee_os/lib/libmbedtls/mbedtls/library/sha256.c f7f70eab033df0e2aa8f73f3e56e4ecf01967b46 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_crt.h 7a8fd1f6b729f3ad210ea034763ec05999fc1499 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecdsa.h c5fc28af127a0a2ec0b26b5a10db2916e8f46537 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/rsa.h 2297980e8e469ca536cb0d8f6953f27288d83afd - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/dhm.h c3786d1c03cc2779e4b50925d85b988380615922 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/entropy.h fdab353d59e781049e2839fe8c0bd9fe5c7376f9 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pk_internal.h da3320bde8f57af08bff72700a80d8f95d96b6c6 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pkcs12.h 73e972973c69f84a622ac147a84ea7b15f4a526f - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/padlock.h ba12324cbba3f3db8cc8241a119702ff0abe8026 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ctr_drbg.h 35916f94391efa0b5cbebe9b8e50842832671015 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_cookie.h 82385e900e1d154fbde1b7048606ab6d682b07ea - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pkcs5.h 3cd46cd245df5c87b55bb5efc77dc6f5142657f0 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/aria.h 24d59951a54278751304dc0abc30bc19d34a04f8 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/asn1write.h 88ed65ff99b7a98bdc81116adf4b3cf3b93c3698 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/config.h 0a7d606dfa4d654a551d1b0a2ca188e7b08c17be - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/memory_buffer_alloc.h aaf629ff227c300525b34bfb14b4169d1e0da989 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md4.h 3ff671bde0767ebc75fe6252c3fec712c4c70332 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha256.h d876bd7b141720bb5c553f5c74e806e65ed34068 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/xtea.h f68ba04bf10e7ae5460af4cd3a0a0aeef75e1b1c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/entropy_poll.h 86fd1279228501f3a8124e575516862cae64f274 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/chachapoly.h 2f556b5bb16c79df9985b5515f4efd98b8e9d36e - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/arc4.h e510c5c9d18bb20e5a0db4b7feafd16978ea97e7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/check_config.h 1fd549849be8d4b4e5f2df80e9e0521b3f77af66 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/cipher_internal.h fd9c07978180a4ddaf4dc878c64425b6fff60d58 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/debug.h 3421e523a4eb7a40b760ae0fef477c206fe1c0a1 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/havege.h 05e40045faab7912fe526f549ed02e8e728accc9 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/hkdf.h 2e912771a4bb2c76b64a5e33e8e4cf959bda360a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/base64.h 988814b4760d2244e329efc2f5a695a90b06b98a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/aes.h 0050c84a3902d0103eef8e3790304a672ad80651 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_csr.h 81184c66cf49b3a5fddf6f414045dacbba683c94 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/poly1305.h d112a7ee17bef0546621b7cb32492e267fe14e62 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_crl.h 382613af5b38ad8b21776442aa78c648f076ef3d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/asn1.h 61ef986ba7df9eb5e9af42d4350290efd2c6cc20 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pk.h 6946d05f02bae8db69c2d8fe537bf1fd4e93c6c7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/rsa_internal.h 86ee6f8982ebee49fcbb54593bcfc4608ea03022 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/des.h f02f5e69a9c8edafcaccd9257271628e5d451069 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md.h 42ef4ce799699bc086a6cecaee5e5f1248b52b89 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/blowfish.h 695db14013c2730f69e207f528656845bc4d98fb - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md2.h 3c23e8d56fc0fc5ca288a6b23d7d1e72689fce30 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecdh.h a182f69d5e8305d19faf1b88f3c6443f0c998d38 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/bn_mul.h 7105549c051d678722d5b3c4b5a6eab6664ffe39 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md5.h bf8042d59b2ba674077ef56511948fb2057bcb92 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ccm.h 9559b189986fa0cc09ddf64b2af4cb427195b47b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecjpake.h 3d4c418e2a25efd04b957f4a184e17a1173175d9 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecp.h 87dbe26bb03c986fcbb4adb6484e23669e3e8fe4 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha1.h ef6dc18a06fe96400c6fc925e0eb3805631ff930 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/timing.h 879fc92ce266212bd186509f7c9639b64b914388 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_ticket.h 6dcc94a51079bacc8ac9dd2f8cc2d886baaa5e53 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/psa_util.h b4b7b0fd5cb9db5e05afea5ace2811809ecd17ff - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/compat-1.3.h 97a63ba6760938a6a84ce283a36ba5e193958bf7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform.h d1d0f5c6aab7d5cbd9ea97e6e9b6dad1ab961341 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/constant_time.h 3be0e79f3eccb1145cadb7d9d57fdb2bd6b5056f - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/error.h 7ba60fe8dbf1a8014980df4d02edd15edf1d8376 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/chacha20.h 7c1598cb9035f535cb60545302c735df638672ef - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform_util.h e8934d06b86a0d71bb8e3a8e061b2aa7ddc811d5 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ripemd160.h f1bf57f612067bf2e4df95ff7a4135368a8fda50 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pem.h 8391f7564988437ecbcbe07aa53684b8f883f4fe - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl.h 5d75d5424716ad4ad724d932ad1e2a0f4816d19b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md_internal.h b5bd802a71034f41daaa5d0f3cbad9840adaddb8 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/bignum.h 8e7f7f04a47bd1833a9b06fada69ab68beb1f29e - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/certs.h 587c56d3cde1593fd3344eaaa7a85ad96468054f - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_ciphersuites.h ffcc5d17de9dc2b0f1abf9dd48f99cc8597c8d01 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/net_sockets.h 6a23d17bd6e89b823200ec15a2e1aa1a6eeb75ee - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecp_internal.h 831d497ea55442be6258d188b7106ae6b407275d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/camellia.h 58d14a3da288383e17a50162b7ee8676aa39e30b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/aesni.h 8e69d040c9f7f246f2ed05821a0c12b8b479fba2 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_cache.h 2ea32a77038f43ab89a11a66e8ebe28467d2aef7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/version.h 33753b5d5cad4c1743fd00279037e092bb447b06 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/cipher.h 4cbcf3ca5862d0d701a55325388bc7dc46e97011 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509.h b29c34b6cc5f246b5f4770f0ff8e740a3ba995da - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha512.h 64fba94be26b0bc251bdc4dbbc123b9c6d47ba27 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/hmac_drbg.h 303d2fa577d2570f5862b2f24ed080db63839e3d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_internal.h 5499103f9e51faf154bddc54e08336587fcd23e8 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/cmac.h b9adc12e4a406da08cf6736975a560b5a2cf63ca - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pkcs11.h 25a8519a8e435600c9e9f0e4fb73628e8c26308c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/net.h 8f5a31b8baa24df22d43316bd594a9ee90d9b485 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/nist_kw.h 3516e070c31eabeb823c760af684046cfbc8ca57 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/gcm.h bab8fdc0f1df4dad69f3ec9e718c9a40081c486e - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/threading.h 83b0ba9cd31fa8443be607606a5ed2ae11f69b1a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform_time.h f9dc451695e690dbe1efad8f404eec60095d44e8 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/oid.h 0ce5c274e6c19b4f0b153fa0ab9c55ea8622d82a - optee/optee_os/lib/libmbedtls/core/bignum.c c5faad859e41c84415cee53c68129957632a203e - optee/optee_os/lib/libmbedtls/core/mbed_helpers.h 17b0020bb8d91bb229a17505c5830912086d7dcc - optee/optee_os/lib/libmbedtls/core/ecc.c 98b5b0189cbb8c50b0e303790d23dbf9681647cc - optee/optee_os/lib/libmbedtls/core/sm2-dsa.h b68da531ca86368d8d211961616d067dca104cf2 - optee/optee_os/lib/libmbedtls/core/aes_cbc.c 9eac1bef00d42cb5d29355da4ff216ab65029708 - optee/optee_os/lib/libmbedtls/core/des3_ecb.c 201268ac06f2c70661d14ec18b1290902998eb64 - optee/optee_os/lib/libmbedtls/core/rsa.c e9ad5e77639fed16cb29a614b7ded9aafd47232f - optee/optee_os/lib/libmbedtls/core/aes.c 44c09d4b791e9fc7eb12c3090186b990a05f4484 - optee/optee_os/lib/libmbedtls/core/cmac.c 4be86702d2f54b1d3c9fa62c47c1c16e8f9a5210 - optee/optee_os/lib/libmbedtls/core/sm2-pke.h a86c6c8bf63ea21ef2492f49cbc071f2f23a1d35 - optee/optee_os/lib/libmbedtls/core/mbed_helpers.c 3a1838593a7cbf67a1966456b9e4e441e14368ea - optee/optee_os/lib/libmbedtls/core/aes_ecb.c 3eb60b38bd9b87944a242c659ad68d8aaa8e220f - optee/optee_os/lib/libmbedtls/core/aes_ctr.c bc4a14352a35d7f28ca65fda6e4625eaad768ef2 - optee/optee_os/lib/libmbedtls/core/sm2-pke.c bc890bd3de1fadc56b5b900e0d3f378f35e60250 - optee/optee_os/lib/libmbedtls/core/hmac.c 9f8f69d3262f16988e954e72c755c3e4706bde9d - optee/optee_os/lib/libmbedtls/core/dh.c 1e3080bd5db0189b057a3f4fa1d45dae9ce59c72 - optee/optee_os/lib/libmbedtls/core/des_ecb.c 95257f1b9669bd55e715296a5db0520dfef94dfa - optee/optee_os/lib/libmbedtls/core/des3_cbc.c 89b5b1b09c6141ce6cae83b42b24106dbf5d19d7 - optee/optee_os/lib/libmbedtls/core/sm2-dsa.c 4a3549fe50b6596fa95703bdad942578f79ff095 - optee/optee_os/lib/libmbedtls/core/des_cbc.c 314159d576fa3458bb67bf9f6ab24f9852fcc617 - optee/optee_os/lib/libmbedtls/core/hash.c 7cf5fb5fdbffcf6f9ad1ffefde20cb30eb66d58f - optee/optee_os/lib/libmbedtls/core/sm2-kep.c 27d0d017d652207089357343fefde8822d574a56 - optee/optee_os/lib/libmbedtls/core/tomcrypt.c af0ca4eb18666ddc7ea8c06659fc1253a3d96416 - optee/optee_os/lib/libmbedtls/include/mbedtls_config_uta.h 82d195f6948af776b75bb8bcc34cb945ab8eb1fe - optee/optee_os/lib/libmbedtls/include/mbedtls_config_kernel.h 61a92d97bc038e1636f35968f5a75f708383e065 - optee/optee_os/lib/libmbedtls/include/aes_alt.h 51ba88c458d47c0829585e30ed93e07a7f5ee183 - optee/optee_os/lib/libutils/ext/mempool.c 47c2201804ad35107c694730f37c017ee288ee01 - optee/optee_os/lib/libutils/ext/fault_mitigation.c 8d6b22214c57ad89d47fbf50c9d2a28ec11c2951 - optee/optee_os/lib/libutils/ext/snprintk.c 9fd93f109631c93c98f7d21f4b2bc03867d03097 - optee/optee_os/lib/libutils/ext/trace.c ce50432f4d5515d5ce9fb398b5098b9c0ec12c38 - optee/optee_os/lib/libutils/ext/pthread_stubs.c 53a0650d0e1a37aefbb511bb3f422ca162180c36 - optee/optee_os/lib/libutils/ext/strlcpy.c ffad6974fa755ea998a6801173ebf69647d8e204 - optee/optee_os/lib/libutils/ext/memzero_explicit.c 7a501727fe2d0e89ac822ec9ecfc06ac9387eb69 - optee/optee_os/lib/libutils/ext/strlcat.c 89ebb1873af1f851bc8fc67e813f81eb6a676a2c - optee/optee_os/lib/libutils/ext/consttime_memcmp.c eeaf7cbef43d983ce60db9ac8731767dc6bbf22b - optee/optee_os/lib/libutils/ext/nex_strdup.c ece984c44b615c403bcea03f8d97fec4569856f1 - optee/optee_os/lib/libutils/ext/arch/riscv/atomic_rv.S 527c3d07f4d854cb770425c1d1bb43d87d25a622 - optee/optee_os/lib/libutils/ext/arch/arm/aeabi_unwind.c 7249fff01b1ca0cec36cca67bec4a1395ee4224f - optee/optee_os/lib/libutils/ext/arch/arm/atomic_a32.S ff0eea4f25438d8836034710afb20c6ff62d9805 - optee/optee_os/lib/libutils/ext/arch/arm/atomic_a64.S 3c9419abbdb07dffd661757f2b8acbc0c49e971b - optee/optee_os/lib/libutils/ext/arch/arm/memtag.c c76559d831152142d5a0612b9a2ba8988ead0414 - optee/optee_os/lib/libutils/ext/arch/arm/auxval.c adf6c7b011707e03c48439a6a7de0b07e91d5e59 - optee/optee_os/lib/libutils/ext/arch/arm/mcount_a64.S fcd9b20bfb493ed1ef33987681cef3c072605105 - optee/optee_os/lib/libutils/ext/arch/arm/mcount_a32.S 0e9c096815b105d29d59a8cfadaaeb5e7a3b7998 - optee/optee_os/lib/libutils/ext/include/arm64_bti.S 296cc431c36cb1c06ef0965e569bb8f0028aaa86 - optee/optee_os/lib/libutils/ext/include/bitstring.h 0c4e420d80821bc2e9d1c85cb5488cdba9b2dfb0 - optee/optee_os/lib/libutils/ext/include/config.h dd93b7320673f243262308cadb21031730b3eb4d - optee/optee_os/lib/libutils/ext/include/asm.S e0f599207b28b33bf06b5e1c02b650d0e1a2d7c5 - optee/optee_os/lib/libutils/ext/include/trace_levels.h 603efb52be462838f3f8f8f5ddb20258ac30f353 - optee/optee_os/lib/libutils/ext/include/types_ext.h 82c8f1ff88d4550ef30a6295467a3c9a89a49f64 - optee/optee_os/lib/libutils/ext/include/fault_mitigation.h d4f08bbbde731d1464ddd75a103de8d6d5cdf013 - optee/optee_os/lib/libutils/ext/include/util.h 70ac170a6c79b30435a4b8fef9cf7e98ea61e9a9 - optee/optee_os/lib/libutils/ext/include/printk.h af2b6927c92cd80ffae87a12bf87645f43748dd8 - optee/optee_os/lib/libutils/ext/include/atomic.h d0fd7d83680885f9a71f56435b92b078f79e14df - optee/optee_os/lib/libutils/ext/include/mempool.h 80947d734f9aa0143f5cc2a9565cfe10081f306c - optee/optee_os/lib/libutils/ext/include/trace.h ce8e8d219a06d536dfb044bd004db98fd595d438 - optee/optee_os/lib/libutils/ext/include/stdlib_ext.h 183abaee8b69b529765cdd0e2523118f88c563a2 - optee/optee_os/lib/libutils/ext/include/compiler.h 6d52c01d26b5f87893d70ca173d1fd712d53f4a5 - optee/optee_os/lib/libutils/ext/include/confine_array_index.h 5d1943eba944ecd7ffb277b76460ab47a379f73f - optee/optee_os/lib/libutils/ext/include/memtag.h 93a77e57894a180ceb9cbf485c96b316b0223286 - optee/optee_os/lib/libutils/ext/include/string_ext.h b5e7d766670b001150bb9d2fb65a689a8c9f3ca0 - optee/optee_os/lib/libutils/ext/include/speculation_barrier.h 86bb497d1cf2b492514391182b51ce9f223003c1 - optee/optee_os/lib/libutils/ext/ftrace/ftrace.c d252604ab38468dc215d8fff7e20420e53adb60d - optee/optee_os/lib/libutils/ext/ftrace/ftrace.h fd0766e5127d24a75662d988de4c18f5686b3020 - optee/optee_os/lib/libutils/isoc/isalnum.c f3a4dd8bf719bba595428ad39e580b4bdb83c0f2 - optee/optee_os/lib/libutils/isoc/isprint.c 69389cffd2f2392d520b42fb8a877d88184eb7ce - optee/optee_os/lib/libutils/isoc/fputc.c 78241abd2dfcf669e50f78ed7af96d4ab11eee84 - optee/optee_os/lib/libutils/isoc/bget_malloc.c 3849e364a583d8e2a6b06c73b88cbff340651414 - optee/optee_os/lib/libutils/isoc/isdigit.c 07859d16a6f156a7b7d53976c3ea35d8c181c050 - optee/optee_os/lib/libutils/isoc/strdup.c 15d9b02b2f680e631dc3cb4acb612c5051534577 - optee/optee_os/lib/libutils/isoc/snprintf.c 44884a714f6031d8c9899eda446ab6bd902d63bc - optee/optee_os/lib/libutils/isoc/bget.doc afbd6bbf47f8aceef9ce91f60a65246aa8579e52 - optee/optee_os/lib/libutils/isoc/write.c adf5b4c7851eccb3ab23eaa51e2c67aaea646dba - optee/optee_os/lib/libutils/isoc/ispunct.c 3c0076665f570bb3894f7975c7af19546b24b949 - optee/optee_os/lib/libutils/isoc/stack_check.c cc419cf9b3049ca5a067f8efc8b87fb21d16cc17 - optee/optee_os/lib/libutils/isoc/bget.h aae0aea5aeb4c700916f3a0cb796958a066f2033 - optee/optee_os/lib/libutils/isoc/islower.c 9bef02b228d5d11a675a74e974644af7f91dc6ec - optee/optee_os/lib/libutils/isoc/iscntrl.c 465dccda5f6216b5156acdf8d97692de7a6bc618 - optee/optee_os/lib/libutils/isoc/tolower.c 3871de5c02c34257cb8c03aea71c406eca1389eb - optee/optee_os/lib/libutils/isoc/isupper.c bd92a4e902b8f071cb08e11be594c2cc03b13e0b - optee/optee_os/lib/libutils/isoc/qsort.c 3072e334c9965c360ee485346541f37b1cade0ce - optee/optee_os/lib/libutils/isoc/strndup.c d7303541082db306fa6b0447bd5aca62f4cb8169 - optee/optee_os/lib/libutils/isoc/bget.c 66446d12deb5b2f6768b0037c5cd7f6bda49c01a - optee/optee_os/lib/libutils/isoc/fwrite.c bdba22e240af00ccb765dec28ab938c5e3619bd3 - optee/optee_os/lib/libutils/isoc/isalpha.c 29a7857f6999a06d58d700ca9bd712c157595adc - optee/optee_os/lib/libutils/isoc/isxdigit.c e50bee77ddab437d58aec0c7d06ad8e70066d752 - optee/optee_os/lib/libutils/isoc/isgraph.c b2a87efad81c7fc35f3f17a1507b650945a64089 - optee/optee_os/lib/libutils/isoc/fputs.c 486e4ec67949ba32eb52d521355b28c032ea31d4 - optee/optee_os/lib/libutils/isoc/fp.c 08ed68e1c3fcaca243143f636c99d7b1c7c325bf - optee/optee_os/lib/libutils/isoc/sprintf.c fbbd10cc345ddfe50e1ca5ec8a2e936b5cfe396a - optee/optee_os/lib/libutils/isoc/toupper.c a426f426e3093d41ca84adcdf9eefd3d37354379 - optee/optee_os/lib/libutils/isoc/isspace.c 6054fbc2e1ca96c1f5291cab671fc90d7ce00fa5 - optee/optee_os/lib/libutils/isoc/newlib/memchr.c 2424e0252f73a9e6fea420e9f7f2967538d56444 - optee/optee_os/lib/libutils/isoc/newlib/_ansi.h 4536b43b4035e668869db96685c3e398be901a40 - optee/optee_os/lib/libutils/isoc/newlib/strtoul.c c62c5a7633896186fdfc21ab5992c569d0b93d28 - optee/optee_os/lib/libutils/isoc/newlib/strnlen.c afd073d96ce316d15f065f34576779bf31b11b4a - optee/optee_os/lib/libutils/isoc/newlib/strtok_r.c 5a9624425bf1040b1f7f44f5391b07f0f54eb969 - optee/optee_os/lib/libutils/isoc/newlib/strstr.c 3eaef3643d7bc2740a34226b2b66dca0fd662558 - optee/optee_os/lib/libutils/isoc/newlib/strrchr.c f4be3b2ac744128b112751c273f2850ec6277a45 - optee/optee_os/lib/libutils/isoc/newlib/abs.c 0800e9eb716a2e65ba7a95b2fbd873749abb41ec - optee/optee_os/lib/libutils/isoc/newlib/strcmp.c ffc219c3a21638f7e62d3b658ee6c4a3dad8e628 - optee/optee_os/lib/libutils/isoc/newlib/strncmp.c 5c1c0c4053502cfc23acb11a61aef64e6a9f7383 - optee/optee_os/lib/libutils/isoc/newlib/strcpy.c ca1b181d9d51ccd041f7a54adb83afacde6591b7 - optee/optee_os/lib/libutils/isoc/newlib/bcmp.c 108514868e87a312a98be4104fdfa5f0b689a956 - optee/optee_os/lib/libutils/isoc/newlib/memcmp.c 5f94025cb7d772e0b69eb04008405feb9ef86a0c - optee/optee_os/lib/libutils/isoc/newlib/strlen.c 811f31f56bd454989b15ad39bd9201411a4971f2 - optee/optee_os/lib/libutils/isoc/newlib/memset.c 5604c3647615806cbfd5068d684f1127272226c0 - optee/optee_os/lib/libutils/isoc/newlib/str-two-way.h b1d845daf20cc5443488f37fac3559c721bcfb45 - optee/optee_os/lib/libutils/isoc/newlib/memcpy.c e0298efe1346c7206253a9f0f174acc71479f134 - optee/optee_os/lib/libutils/isoc/newlib/strchr.c ad3617f14072481d06acd4c17903f9eaf3301223 - optee/optee_os/lib/libutils/isoc/newlib/memmove.c f78df3e9bb90074ab9ac143f5e62bed8c2557796 - optee/optee_os/lib/libutils/isoc/newlib/strncpy.c 646239269fb199ffdc49b9001bd8beeded3a1e32 - optee/optee_os/lib/libutils/isoc/arch/riscv/setjmp_rv.S 24bfedc4ffd1c78df045ab1c725bd811b0531bee - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S 0f25fedd6c6f397a39b1254cce305242fe230e0b - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_shift.c 99b85b897d6a461c3fa3c1f9bd54fb771c45ae5c - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_softfloat.c 4d6df8e998067ae07c67580b5f7f261238c7cdb6 - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S 30211cfa366caf873a7801a7ac8e5828d0518b42 - optee/optee_os/lib/libutils/isoc/arch/arm/setjmp_a32.S 6a325e1881f32b8ca7c74367132e75f9318aff08 - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod.c dbc715c45b8998c5276e4a7f3dfc71bd81a03947 - optee/optee_os/lib/libutils/isoc/arch/arm/setjmp_a64.S c9a1019f6ff1967d8aa48f5b5e7fc42a42660937 - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod.c eea63204ff2fd371e116939e14a504bd9d17de4c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/README.html 0ef83486a7270a31dab5ced482dfaec14b9a5b4f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_ui64.c 920cf94c441178943a1442a168fb4649cfe755d2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normSubnormalF128Sig.c c841c237414b6697fc42f3a261082257cec7dbec - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_add.c 1843081e5eaa9f77ccd80c3cba04e650ceee756b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul128By32.c ea9e18329087b88e680a9b0e1dc3f73d78ffc97b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normSubnormalF128SigM.c 5bd19e6fff94dd11976e8f78f6ef8b9af01d33d2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_div.c e14e58254cc0fe0ce4710d073c7a4c41961df960 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_mulAdd.c 49a30ac92f2823400a43a7b0789def54eac5d67e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_mul.c 25ad3859febf3093e91de0392cb0d7c98d3e9dcd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_ui32.c 89e1c8f8d93bed98125ee2c0e27f4ad4b87f5f9e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_ui64.c 3e4e1cde87c7d37013c4665489e22a5e653b9e75 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_i32_r_minMag.c 60cccf04237a9a059b26075b3bc4742662905190 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_f64.c f3c0c6bf5032a3f329e5637aa49336a98dc365f1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_rem.c eed7248a2360c629c3dc0b39a7b019c718c1f8f8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_roundToInt.c 9c753ee79b20998c7b9c420d50cd9ca84b18a3f4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_le.c 2e201e03147cc253f93e31812b6cc1fa19c54acc - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftLeft128.c f7e21606f0f60046e7ed31a99520969bf3cff7c5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_subM.c 6772aca13808c91d5fbc62b23e65a9aba99df8ef - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addF128M.c 6b7125daba8bb60ca3e2db6c38bf5cbc5df906ea - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToUI32.c b28464c7ae4ca7eb7416555259cf21f36e3906ba - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul64To128M.c c32eb171afa353fe6d96c9fcc1b6bc9116ba3237 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_sub.c 136777686e7e2c7b3decdc75d9cb9e0f802b4dec - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_ui32_r_minMag.c 440066ddfc6cb2460e07a86d2552d5aa6978ca47 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_compare96M.c 6ab2cbbff35bbae58c14a90419c2dd153b667063 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addM.c 3f17bb81a05b30c928c6f3dcbd9d6c33f6dd808b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_eq.c 9cd0d76126fdd8add379caa20c766668256efb6e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_eq_signaling.c ef40011bbd21ac40df712f0f16dc844ee06aa453 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_add.c e6ad1063b924e4b96a1801d49b960b3d8534342e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_rem.c a5d1d8aa31fb5646e96d1f889729bd9eb7867e9a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_countLeadingZeros64.c 188a513a8b2102d97b435bddcaa70a13422fd36b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_ui32_r_minMag.c c9372c8b60f9e67962d30179a0595294d74953a2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_mulAdd.c 809dcde66eb6eff4e7af6a71ab240cdae5c11097 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam128Extra.c c62a95ceba02a10b8f43ebf0b1621e6a814f07ad - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToF128.c f79c163815f902511ac25f8f5a391149043a846b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_f64.c 68c9d3e3654c5107bd58185d3632d6e8c4b04687 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_approxRecip32_1.c 1d4036336aa49d6961f510e234caf45cba50d995 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_ui64_r_minMag.c 5d1495da9f0d75aa3f5fa75b43c5edbc95dc1ae9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_f64.c fab91920cf859d0f22562a98eea05a843806e70e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_ui32_r_minMag.c f1663c2acfcb26909b23e18b18c43a4aecee1908 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_extF80.c ed1a42257f7a11ddfb2896bb3db8fa6b6b799910 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_add.c 3e0d54c15411c2c997b29fa7132f305ba0986d0c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_ui64_r_minMag.c 47e7b19a3c969e8c6acf899992a2b3dc02ee894f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRight128.c a56defbdfcb63c086c83b3754d2848c2d67b561c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJamM.c fd6492962962b16aeabef92ff9542da4aae05f26 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToUI64.c bf60482d7a8c7573451dd9d358a4f59882b4ecd8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_sub.c 23659a34fd66f6a163767159d9191aece60e9833 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_f64.c c8fa83b76113c38831b0a21b4b6359fe6976b133 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_lt_quiet.c 7749e3a634b0f7cb154a734be194e52d612310c5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_sub128.c 60a64ea74aeaa87b706af4f0c880e551d68ee8f6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addMagsF32.c 0db18e1a005858944af9123bb29580ebac102bac - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_i64_r_minMag.c 14119b8fcb0828e0621f0d1c0b3130721abcf3a8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mulAddF32.c b4f539877d9b40f21099ed92d2e18a9f57f28566 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_eq.c cddf72a19a53f1cc1e2077dbf7e9269f0ba5cf16 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_rem.c cc614514257c6b0a721ebfbf2f2eb22e764e75e4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightM.c 60f8ae03f26507e95f988d859c2a779d957c4efa - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_extF80.c 8c11bd928370bc41568ae3c44ed648224268134b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackMToExtF80M.c ddf3732777273f55557aa33c85aaea98c3017a0d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToExtF80.c cc9936a7e89313dabf987a759166c6b627c5697f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_f128M.c fb78669ac8ebe25845bdac20fd3007ac6ed6e254 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_sqrt.c 74978af5148ccce4ca51465a934e52d8ff03fb9a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_f32.c e550bcef98e4bc5091eac085dd5972d58c2bab09 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul128To256M.c 6eb4a2a36946f25f5528e564a0391b709127224b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_eq.c 5adc627cc2a4ed39719943fac8c29517f3d39bbe - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_f32.c 03ee79d8d396bc6778c8bd477647f5e7b2035214 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_f32.c 7bed7a39e5684ce23986346806ce19c0a2d198a4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_i32.c d2e10d43888a0af127c80ebb29261c8c424b217e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_f128M.c 3d89aeb6e7880b1152564ff98fac17e80a4beab4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_mulAdd.c 3088c598cdb456e47e280fd0bc369fb0d5e6d2f9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_i64_r_minMag.c e4be027468e7ee598e8835dfe5c58692978be102 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addComplCarryM.c 672608ed7c1150531f5d4e2b3aa274de76f24f44 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_extF80.c 260bca4ccf486c140c36950f988253e30be3f9e2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_ui64_r_minMag.c 27897b3a3e2b0f5cfd67ca737c35af7cc360c3cf - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_ui64.c 32ee0bb66ee86e9f4d4f49c23487905e3e09715e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_rem.c 3314b591c37fbe10125dd1047b564db3968c7246 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_isSignalingNaN.c 6f034e453e9efaa8477ac48fed5ff48d6320f99a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_isNaNF128M.c 20cc97dd02d91a85b8d58ab1373f550058a5a4ce - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_f32.c e0f5d8c33a9db5f50d0fc16b09808a48a8b052b5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul128MTo256M.c 25066beb2f05f436d718c8073ec11ad550f53ef1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mulAddF64.c 345b454a7bf01265db26b15ff80f98692e81fc5f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_div.c 644f4fb69b6d67725a586cb47755d4472694dc54 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_sqrt.c 3c7d728ab8fa5d0e345c67d53f5335d672d8fd5a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_i32.c ff0afa5079cd15008d3d3386ac73d3b62a0c4d79 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_negXM.c 9a156cc904d7427a794de20f093bdff4a44cc12f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_sub1XM.c d7dec92efc7a7503386861fc8a67b770c78d50fd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_lt_quiet.c 467dcd8f83fcddef3d3402ebcc2c08822c68621e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_compare128M.c 5e4ff4edf1d3a006c61ca3098f1919088d42dd66 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_isSignalingNaN.c 2355160c0a3526eb32abd1d54fb01083a1fbe18a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_countLeadingZeros32.c 6ba3f71a3a306c79f58d469163b33f810aa8faa8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftNormSigF128M.c 623ab3fb8b679ac1b86f7c366eb192d128358f16 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam128.c c3d4d8448c3e622688342aa49d892b84716125a5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_eq128.c 8a4a364a4b4f144bc47fb5e28144cfe82dd3b585 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normSubnormalExtF80Sig.c c7030401c4589ebe4ca9df47cdf4473be706e9c8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_div.c 7edbff34e15aeda6b14e5e01fa34a2e4ec230d88 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_countLeadingZeros8.c 757e08593f768490c92840e212583a4ec63dbbf9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackToF64.c 3166b1b25c791f37186ac5ace33c6369720cd72d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_f32.c 39e684d513bd8e1bc18146fe5b6b41ca6abfb889 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_ui64_r_minMag.c a4bba6333e9a92cef62ff68ef528240c29173398 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_extF80.c d724729fe9aff2647d82d44cf7c98ef024550f4c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_ui32_r_minMag.c 28ed562132fa508b794485f84e37ffebf0f45c03 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_f128M.c 5547439bc882d6cb17257578b63ed5dea9e85ad3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_i32_r_minMag.c 4cc44bf1f32b533112fceaf74f2116052c251f45 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_lt.c d11f89d0268036c5e2190b2001b08b46df5a1496 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_mul.c 0ac05f3c78dd89e1084687237ede90311fc758d6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normSubnormalF64Sig.c a8cd508101d5d02ae58933c2b91b0638fe9ce308 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_extF80M.c d5a7b42551a9289e11b502dcd611101098d47502 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_f128M.c 02501e2df1729d1c331ab6288158859f5302a791 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_ui32.c f06279e2d0e5d4a308a35ce0eae73d18ff2b0ad1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_ui64_r_minMag.c f394231a827adbe842d2249d968ff138ad99c20b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normSubnormalF32Sig.c 7fbcbd3346af638125a977564bb94e3a4112db4c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_subMagsF64.c a6ea63bd09a37c67ab0db5c7378603bc343f7c4a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_lt_quiet.c 4cc27ddd980713ad95fd12a90c077df01999893f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_i32.c 06c8f4bcf358da5b2930df117ecc0f2324a59b3f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightExtendM.c 35820af43505df9a372d4e74e3f0550a3af9a249 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_eq.c 321d4491ee122d9ff20f50a5fd4708eec3a9bbc4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addCarryM.c e5c280ffda9fadc7cf51f4e49ba880138473c188 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_sqrt.c 2a8c469188ac72f1647a4e23121d6baab2f46881 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_i64_r_minMag.c 64b0e4b0e7bb5d8073e937068421026aa213bb57 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_isSignalingNaN.c 04b228218122ee8f024959ef831393289d417e7e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_extF80M.c 67a5f98ae9f74d18b7c83f145618185127a93260 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightJam128Extra.c b971ed0265436f05a8f8f5eb8653de23e49747f1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_f32.c 9fb6f1767a51f28d28e6af39ffaedc9883363298 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_i32_r_minMag.c 2fc25c51a836eb30d5a0215659d5fd8b4dbda2e8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_lt.c 359da64e36a5f411cf383e3fd0f83a248a1dd066 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_f64.c 9fbd0b33c76b78481c512902dc4d9a0d67f4f210 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_i32_r_minMag.c 3fef81240caee61991a4a7c3ffa8e6d6e2e8066b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_sub.c 2211257786a567ae6daea47fa4ddd31c0339d328 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_add256M.c 3155ae7f402b23659c4ff5e89bd77c5599ee23e0 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToI32.c 1e172d64c3dbd60e0e9ffcbcc7a0225702f04848 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackMToF128M.c 0020d431a9fe3314ba42c1dafe946fbd2ef7e606 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_f32.c 2679177fa989374186316764ed9a90c42e38edd7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_le_quiet.c 6504b9481457cfd6e39a69e7066fe09ffbbdb258 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_div.c a091e47127bd1311d2cd2b78353ee99ddfc54100 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftLeftM.c 6a29d35180197bb865f52b54695f07430e3e06db - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_mul.c a44f15f379846d39821c025d6b7afe2f94cb4411 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_sqrt.c 4dbe7ada2eae098c62ec673be2cb2452390c0a78 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_f128.c c50d86d027171a9f2481e8f7c1cb4308f1cf1d3a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_i64.c fc451ef01165565a1d593b0e2572eb8e37aa72a3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/softfloat_state.c 83db5e18b844bed794c0f1690aa2aa28ed93e4dd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_ui64.c f5755b53bfa3d4ada8ed3be7b2e264ca31c83e9b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_sqrt.c 58782db3382eb567580f7105c6c8d88dd1a6fc67 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_i64.c ea2befd81aa697654bc1baf2a7da10508ae8b9ce - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_roundToInt.c 61fb9da8313a688f608a43d8aa36ac9861c74c75 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addMagsF128.c b6e5c30069ee1bfdeb29301eb988d9b5ef1e6fd7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_remStepMBy32.c 57500b9bade8439c0c3f06cbb999f6ba13952ad9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_f64.c b37dddeca4634f2e81fadc1fe8c9ec9f9643c56c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_ui32.c e0d12d5167bae0c40dc2ee4e8eb79ccb7d7f8709 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToF32.c 1d30d31c5765c77e617b9969b778019b60c4b1bd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_i64.c bbb2e442ce63abe6d694eab84ce821e2ec210522 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_lt128.c c425d403c3b3dfaed940888bca06384b967e8e5e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_i64_r_minMag.c e6b71c319835a3d037818d3ca0d1468b2dd3c325 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_ui64.c 9611fba0e534169527d66900db62b107e96b8e2a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_roundToInt.c 625d048386528b1c63a19813ace77ab7484e1876 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_tryPropagateNaNF128M.c 61342ccf516ad5891a6f2eb1980d37329501ea4e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_le.c 62e6926f729011d5c3aa3af610ce0b916b919eb4 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_rem.c df4f91f5c1ef40d1eaec328ca6b879bf095951a7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_eq_signaling.c 2d988cd65efb881d8f5103b71c9f6b121121ef6d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_i32.c 4042678da076368eb21bb4ded888e17dd2109b55 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_f64.c 6e91b9e38753aa8aa2094b6b40b596796bd11b3d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_subMagsExtF80.c 01cd4ad4fff8805cc5bf43533b1576d7e170925b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_rem.c bbe0db256dda63763f1a09d9af66cfbfa51c69f6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_le.c a91c926882ae26c3a59dc8885fabc6e86ce9465e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightJamM.c 0fb28e0101aaab0bd33ae51a05e4b522cea887b3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_ui64.c c87f6f4eb78569c01e3fd0c6caed99232b37a378 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_extF80.c fb72828cc90ce8ac0bb436552fbd39bee0f11d35 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_f128M.c c42aa8ca5eb2a847874b705199b3033ae8fc00ee - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_le.c 0529a095355f150e35063942c7aec7276033842d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_add.c 80f53f88a6f924eaf40e9f79955bdfff87f72d14 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_i64.c 5728e535d2903cca9e9558dddf7a571e606a385e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_div.c 8fd3330c1a032cc7c4a7ad995996169ac7f0805d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_ui64_r_minMag.c 39eaa261c0332f55f617941b8bf51f30dfa288bb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_f128.c 6ee82c2c62f3442cc1c0b2e9ef6b0b85da32cf3c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_lt.c 876085f70200480ee30305fa6463d7c6504e7e77 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftLeftM.c 019af317356453e7119ac20be4c98c0a1c83f8af - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToI64.c e5f8702f5072f781a5b4ef72c7ec4db154d75965 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_invalidF128M.c 84791d4f50e8187197aeca69dbef6a333d167fc1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_f32.c 29d181916bd52d0effa525808e4e4564f56b5ed3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_subMagsF128.c 2cbd145a4e3465e12bfd47dc4a52fd75c4e0b427 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_i32_r_minMag.c 7aeebb299243e2d857eef25300233d709662a1be - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addMagsF64.c 7db7c6e3e7ed45f7c7ed16ea6935cc7fdba73da3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul64To128.c 6c279773b785568a5567bfe33f5a6082265b9efb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_eq.c 9e7235e0ad3872a7b6f005a0203e63508f11eaab - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_eq_signaling.c 622a359dab67eedd5448775dc3204d4f48039034 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_i64.c 1fb366479cad4034726000f4f22cdbcdcb95a4c0 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_roundToInt.c dd1f8b3669ce1b87360bd05963ce288acfd9f386 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mulAddF128.c a05a89d48fe8216f0fa0babd342a60249c72cef2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_eq_signaling.c 73622cf9aea053c968f1922c8a206030cab025a9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_f128.c 9cdcb1720d52c0b09ac2ab14aab047bfe940304a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_ui32_r_minMag.c 63a8a8dcae334e46b7fbc7ebc687e8d6c011fb7a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addMagsExtF80.c b8189771723e965a9e94712bfa8135b04f844af1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackMToI64.c 12d0070692fad1189770f55c41aab025bee462a7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_f128M.c e33d236ac36ab3726429718fa699498e908afb21 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_i64_r_minMag.c f81c603cb90e956ee8dde34149ac6bd684d4c70a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_lt_quiet.c 2af1a8917871bcc8c0560e709aa28418d004c97e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_i64_r_minMag.c 9783f22f581b7feca4f86660b538b214dd32b129 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam256M.c faf4056d360eb6faeccac416f54caa2a1a8bae9a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_i64.c 0fa1c7015b7c39efbe07d739a03f2a83b85745b8 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_compareNonnormExtF80M.c d0375fd187a2ec8138e6a29c04afb951176c31bb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam64Extra.c 6de7ad17814ec3532d2cc20927580d8cb52c44de - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mulAddF128M.c 5f3d886dc9c8533c8093c13f3b4242c66ba17e5a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_ui32_r_minMag.c 3ad627bba48b5bb63c11c5e86c0081d283f4a13c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackToExtF80.c 28af646437af4de6033b2176542a5d805636323e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam64.c 04822aab5f0c58ebdfca756670ddbddf4524258b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_add.c 97a45958e5ea33d1fed598272e527b7f72a9d8ee - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightM.c 71874d6de8e801c14005d5b1f68170c3c6c6baba - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_lt_quiet.c bc52a98da5add09bb146c15a8cc1e524e1e36989 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui64_to_f128.c 9b35552cd723623625c63511e14b0e559d678f4f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normExtF80SigM.c 4e4a329eebd8c7675a57c1b06f75ff4ac326b2e1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_tryPropagateNaNExtF80M.c 327934b641bc5a6a891fd19aab7b9f0363952a0c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_extF80M.c 1a1af8af29ddb0214656df304b31583e97bbe044 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_le_quiet.c acd11d468d7a20b0e4381a8b7168e186b7d49d4b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_le.c 5cd984d2fe4bfa79945c464d200d7b17d205b475 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackMToExtF80M.c 1aff280581ce3e0a033ebdb2257a5095804f4a18 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_isSignalingNaN.c 993bf55183ee975278a5e4c34e658f6f7bd3702e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_sub.c 7233f7a2c75705b0b4173168df45777f969cae96 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_eq_signaling.c bb4b86c5d78b77f1babf89d73c262ab3e47b6832 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_f128.c 0f29c869a8f46f705f24531b2826deabe579032f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i64_to_extF80M.c 97688d5996165455b0ead5c1973e36b6d096c21f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackMToUI64.c 71d3ef74fe02e7fe6891e4db41241c5b2e615643 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_extF80M.c db04e48a5c823e4f060cc56187b01cbb89ee1afc - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_mul.c 039cc691a2609fb90724786e7ed7be17b006803f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_i32_r_minMag.c dda54df5d890a969ba663a54ceae83c6492d7866 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_le_quiet.c f02ad3fb3c3e82d60532e677d475a578ecdf6a1d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_addExtF80M.c a473fd92baf36ab51a725b665f964a7a082f4eb3 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_le_quiet.c de37f2fef538ee89236273ac956585b2d58a15ab - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_mul64ByShifted32To128.c 70a0a4dddf509479def6ff905d493e6a50c1bacd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_sqrt.c 4802d692dda23c6bdb15e682f8895eaa2e02a824 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_lt.c a8129c9fa34f996b39adef2e0620dd63b5ab655e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_roundToInt.c 495735b890e1bebb53e4e2cef50ffda57a242662 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightJam64.c add3de1ad7693fb4a2a5453483938b93b287e275 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackToF32.c c5fd85ea4a5cf0a00edfc6cb66cf20b3e7100062 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_eq_signaling.c 890504face9da670bb9338c6587d893fd632819b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightJam128.c e9570bb5907e357489fdf310d629201fb63fe691 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_sub.c d5160582645bf346bf920e38f896596319da591b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_eq.c bf81966f25644611be0129d9ef8aaf0f5c6da21e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_ui32.c dd00b7472e373b2a72b05389fd8c595c9e688831 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_extF80.c 20b550200dc22a4995a52f7bb20f8177c851d08b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_le_quiet.c 1a5d352e9bacfa36ecd8ef231155053713acece0 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_mul.c ebd71c72d17dd55dc010988fcc223aeb9679ee6f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_mul.c c0e3f7568f5ce015eb6724ca13dcdebf3846138f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_to_i32.c 23a84b7f28ce5a2345b3d037ccc8f2707163d262 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_lt.c d586657c54173f413fa72807b84027e1beeb6234 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_approxRecipSqrt32_1.c d64953149b1077f8e6d0848e2fd5506136e6f2d6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_add.c 54fed28ecc0bb163f71b7d5f47c960063b16f0f0 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_i32.c 62cbafb0d4719707254e3021383d31fd007b3971 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_invalidExtF80M.c 082138b2e89a050296984be3e3d195746735edfa - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_roundPackToF64.c 33dedf42e83eb53f8ce20395143a01a73b412457 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_sub256M.c 3c754eb220ded3a7e9c82cb01c7ed8adc2144452 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_lt.c a04e210c7ba96d0c982f31acdc218a4a63b5326d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_div.c c04c45b92e29225e1d2e3decc3dfc108ae63b093 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_ui32.c 641b01960569783533397d0ed1cdbb00695a3578 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_subMagsF32.c d594421c568958d475a5939b2bc14c195493768f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_le_quiet.c f815fd87ebd1c160aa9ddb1c232c1de58da01072 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_to_ui32.c badda43bf474995d00db78fe6ae6b40268e9f90f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_f64.c 5aa2d29c4f2ecefdd83adab4927c2dba794a0a43 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_f128.c d688f7a888e0e7b33a166af94044edc80100754e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_le128.c 5158c6ca5efcc7ee5067415f6df5988c4b3645ed - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shiftRightJam32.c 73f1f3cdf7a70d4d02ddd5d73f8198482d373296 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_f128M.c d3cdaf7ed2016c9f9764a514ec05b2dd6f86fc85 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftRightJam64Extra.c 0d9fe463bfee7b28f85650d68588f7fb47358282 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_lt_quiet.c b390f4671e459aa98a5e6eba67989a524df502c6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackToF128.c 7c39994169fccf5700f2fe944d8b94d912a07723 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128_roundToInt.c 289aeaf52ea847d12eab9ab91e1b080ae5cc4774 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_mulAdd.c 684615f62d1f460768c6b9cf951bbe7d82b7aa4e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f64_to_extF80M.c 5bddd155904f96e1af61acc11b87973856d66810 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_sub.c 5d919ea71a15f028ff7b85cd73d9543cbe322b06 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_normRoundPackMToF128M.c 4189613b8730aaff62a01f6254b071b9fd3c8cb6 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f128M_to_f32.c 7a1740bacdd6fbf37b3e9ad6b304b772722041c2 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/i32_to_extF80M.c 513a918766d59060a56eb14f936404c5a807d54d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80_to_f64.c b33f24777a60c2b658a6463c17c19f932c67cefe - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_add128.c b48f6bd306c3509038d6c4d283bc189d517d3b4f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ui32_to_f128.c 0f3d7b35ae34828864a226e8b123484e88b8cd13 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/f32_to_extF80.c 016a9e65ca19c7f5d3561d54a3fcbddfb6a310ee - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/s_shortShiftLeft64To96M.c 73e3351f07e2c7c7d591555895c25042a56c82fd - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/extF80M_le.c 302b57e7a9ad056c7936806892309cb4de6ffc96 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNF128UI.c 868cee0046c6b1426f45136804fd662b030f263e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/f128M_isSignalingNaN.c 52fee0fd73c94d2e2f5a21a55f082e1963b1569b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_f128MToCommonNaN.c 67e0a5407af29f70e8a1cd10563b7aaec9ccbcdb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNExtF80UI.c 7c65ad2301cc6e79aa3392bdb9010a7ce81b0c38 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_f64UIToCommonNaN.c 94e7fa32804e73cff91d5bfa140aebbbb55fe6cb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNExtF80M.c f58e104619733d72884d1de3ce89eedacb671595 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/specialize.h b6b8b672735a45d7c495bf8af1fa94d1c8e6556c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToF128UI.c 52bc24f91ee7846596274fb2b29654539fd3fa00 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToF128M.c 35b37030a4086b22b7974082589b33ca07ccc8bb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToF32UI.c 7d5189099e205be2e0420013770668fb8b96e133 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_f128UIToCommonNaN.c 7e3b18d1139373153529a43d88c469da845d393b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToExtF80M.c 74a3e6c966c47167bebd7abdfb17797124ee9279 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNF32UI.c 1c390c99fc7405c9a44b4117383cce7de291c13e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_extF80MToCommonNaN.c 4a66a4eaba41707a706d22a724ff5853260d070c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/extF80M_isSignalingNaN.c 2c9f36c79b5d80fe13893b8c9b9f9c94273c1c95 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_f32UIToCommonNaN.c 70de120b27bf3bf6917bf2a9536aad6fe8536358 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToF64UI.c 784083a6783d1d5de48e4b5a95ccb43b8103bfff - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNF64UI.c 8c5a81c2b54db7d09ea4a08a43171c7f9ed3cbe7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_commonNaNToExtF80UI.c b0822433062f48471e106e268f79f079d1a1cd55 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_propagateNaNF128M.c d8fc85a2746e3c31e70de675027af01735ba105f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/s_extF80UIToCommonNaN.c 7dc9295fddc66cd74761fa03a90c65985b964c08 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/softfloat_raiseFlags.c cc1a5d99c9f6833e79108373c21162c7fb65a742 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNF128UI.c 868cee0046c6b1426f45136804fd662b030f263e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/f128M_isSignalingNaN.c 52fee0fd73c94d2e2f5a21a55f082e1963b1569b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_f128MToCommonNaN.c 67e0a5407af29f70e8a1cd10563b7aaec9ccbcdb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNExtF80UI.c 7c65ad2301cc6e79aa3392bdb9010a7ce81b0c38 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_f64UIToCommonNaN.c 94e7fa32804e73cff91d5bfa140aebbbb55fe6cb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNExtF80M.c ade8c323e356c3e70af2424ed9e2ca0ccabc68c5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/specialize.h b6b8b672735a45d7c495bf8af1fa94d1c8e6556c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToF128UI.c 52bc24f91ee7846596274fb2b29654539fd3fa00 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToF128M.c 35b37030a4086b22b7974082589b33ca07ccc8bb - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToF32UI.c 7d5189099e205be2e0420013770668fb8b96e133 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_f128UIToCommonNaN.c 7e3b18d1139373153529a43d88c469da845d393b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToExtF80M.c 5e2ab65ab8c5b830b547afdfac8b72c1a7b193f5 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNF32UI.c 1c390c99fc7405c9a44b4117383cce7de291c13e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_extF80MToCommonNaN.c 4a66a4eaba41707a706d22a724ff5853260d070c - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/extF80M_isSignalingNaN.c 2c9f36c79b5d80fe13893b8c9b9f9c94273c1c95 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_f32UIToCommonNaN.c 70de120b27bf3bf6917bf2a9536aad6fe8536358 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToF64UI.c 93bd291166335a88ca0721d5beaebd9599a2475e - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNF64UI.c 8c5a81c2b54db7d09ea4a08a43171c7f9ed3cbe7 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_commonNaNToExtF80UI.c 3b12a5a00c5ee315f9665165cc0160e7e4e7b946 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_propagateNaNF128M.c d8fc85a2746e3c31e70de675027af01735ba105f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/s_extF80UIToCommonNaN.c 7dc9295fddc66cd74761fa03a90c65985b964c08 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/8086/softfloat_raiseFlags.c 1afdc66c33767a868d162893776bf6d3ba9f1247 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/primitiveTypes.h 8450fc5ca89f94b128b1d1d4608903ffd0de498b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/internals.h 5ab0e0aaf3ae2f7637cf1c42709cdad267a20850 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/softfloat.h 0d0858bee5e0636c53a6f5b4a484f08b979495a9 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/primitives.h 3b6c666fa3fd1fcdb96504690f34db6740d85b2f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/softfloat_types.h 2b66ebd06a1b0c7e7626aceab2192011d72a70ab - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-x86_64-GCC/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-x86_64-GCC/platform.h 6be19d4409b8a6cafc0be14b9b5ffdf052c7b25b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win32-MinGW/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win32-MinGW/platform.h 6cbdecb56028446ec09651ef96ade55402b23a2d - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win64-MinGW-w64/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win64-MinGW-w64/platform.h fc40163df60fca883cf8105128b0e2044b4e5c95 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/template-FAST_INT64/Makefile 18484ed24a14a759985a39574bf4d1c56cfe1939 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/template-FAST_INT64/platform.h 19237050b884871548365d61622e85253f30ffd1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/template-not-FAST_INT64/Makefile 18484ed24a14a759985a39574bf4d1c56cfe1939 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/template-not-FAST_INT64/platform.h 140c840a66dc59f8b8460c7e18349faba5989be1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win32-SSE2-MinGW/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Win32-SSE2-MinGW/platform.h 140c840a66dc59f8b8460c7e18349faba5989be1 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-386-SSE2-GCC/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-386-SSE2-GCC/platform.h 6be19d4409b8a6cafc0be14b9b5ffdf052c7b25b - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-386-GCC/Makefile 39cb04a350a785c8fb1feeb91759b428750191ae - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/build/Linux-386-GCC/platform.h 90d2bc9a9afc3396f0a2271c1d79a76287c2516a - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/doc/SoftFloat-history.html 75e9aa350d3aae45b151a9bbe2f6e70ccad11c7f - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/doc/SoftFloat.html 9170d3167dcd72c685ebc6ca6250eee2eefd0c45 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/doc/SoftFloat-source.html cbaa68e47415bdb2b68ad13c2037e03cd231fd60 - optee/optee_os/lib/libutils/isoc/arch/arm/softfloat/arm32_include/platform.h f1ba2ffbb8b80c3d2c8baf5ad09f2d1883ccc95e - optee/optee_os/lib/libutils/isoc/include/wchar.h eb700f736fea47a51c03069d099ff492d566f45b - optee/optee_os/lib/libutils/isoc/include/time.h 15ec9c6af06bd04877ce230bac8bfa3ce26a23e9 - optee/optee_os/lib/libutils/isoc/include/unistd.h 9edc066dbedabb03c6479c2dfc962125c09207b5 - optee/optee_os/lib/libutils/isoc/include/memory.h b704c2144f4058cc83eff91c732a965487af7f2f - optee/optee_os/lib/libutils/isoc/include/signal.h 9978646994c635cccfd0082f5e183aa8817ee114 - optee/optee_os/lib/libutils/isoc/include/setjmp.h d107150611ad4db054a4c134a03cb4072e5b978f - optee/optee_os/lib/libutils/isoc/include/strings.h 5fbd70f4fe7a023e3b9c3c6997b0cc042bec58d8 - optee/optee_os/lib/libutils/isoc/include/inttypes.h 7146a287e1507a73b42aa6ae46d72881a5b318a8 - optee/optee_os/lib/libutils/isoc/include/stdlib.h 1b5da4e5962171c39a2b4762a169e12e50dd6641 - optee/optee_os/lib/libutils/isoc/include/stdio.h 0e27c8f74b3f066a60b8b79fe1951ecc76c12fb3 - optee/optee_os/lib/libutils/isoc/include/malloc.h 353c7b2a8c73f6458ed0e92d380fe01ff4dea900 - optee/optee_os/lib/libutils/isoc/include/assert.h e7fdba9acf2bc6ddc6d25cd852eeff72855d143d - optee/optee_os/lib/libutils/isoc/include/limits.h e83da5f07c33bc84bb291affe6480214bb4e6f9a - optee/optee_os/lib/libutils/isoc/include/ctype.h 44f78c63d935ad93ce68039331f214dcc699f6e1 - optee/optee_os/lib/libutils/isoc/include/stdint.h 8629e94b3bc7a9b628d559492f6859405e065233 - optee/optee_os/lib/libutils/isoc/include/string.h ea09b9213223627399f059ff48bc083ac9652a96 - optee/optee_os/lib/libutils/isoc/include/sys/queue.h f39fd14f91c4f1b1a6c2636a7abfaa0cad378a37 - optee/optee_os/lib/libutils/isoc/include/sys/types.h e646420d5133d287b223a251d711caef5077d8aa - optee/optee_os/lib/libutils/isoc/include/sys/cdefs.h cd3c2b81c2fa7237a975213bafcf7ac4e67ff177 - optee/optee_os/lib/libutee/tee_socket_private.h 6a2bd30d6d4442e50515c09a081afd22562e62a8 - optee/optee_os/lib/libutee/base64.h 2a8949363bf9be408cbddf09c072982132988ffc - optee/optee_os/lib/libutee/abort.c 4a67c07665addfbe2d7f5a4405dc1cb2b8a44f45 - optee/optee_os/lib/libutee/tee_api_arith_mpi.c 55c2020c1066f0e0ccee7396effb27bc63af0b5e - optee/optee_os/lib/libutee/tee_api_operations.c 8fa85961841aca5f32b051d7c2137dce6048c90a - optee/optee_os/lib/libutee/trace_ext.c 9389ec3691da465689f9ef3c7e4a843bdad07389 - optee/optee_os/lib/libutee/tee_tcpudp_socket.c b692cdf8031f1a5f56a40e3a331b86bf6ad0c81f - optee/optee_os/lib/libutee/tee_api.c 3cd93276aee5c3e854a28469d4249e285836e0cc - optee/optee_os/lib/libutee/tee_api_property.c 077681c818e3003b52065a80dbacbd498dff6b29 - optee/optee_os/lib/libutee/tee_api_private.h 61ba39ae5f3db7e446666d29227a87474f4a6117 - optee/optee_os/lib/libutee/tee_socket_pta.c 756eb32d34c8adc8518381acb1da0e71abfc07c9 - optee/optee_os/lib/libutee/assert.c b1398a9a37ee47f2718169316310a4a16c61166c - optee/optee_os/lib/libutee/tee_uuid_from_str.c dc820097b9daaecdbebb44d2745b59ab6c868b3c - optee/optee_os/lib/libutee/user_ta_entry_compat.c bc9153018927868009fb5a5e6df2a409ecb13f4c - optee/optee_os/lib/libutee/tee_system_pta.c 45c1ba4438be0ecfb4d4bca51534640836b8c995 - optee/optee_os/lib/libutee/tee_api_panic.c 505da116e55bfaee3c94a6db710ef70a860f9bf1 - optee/optee_os/lib/libutee/tcb.c b4d75c22cea319de57b7d095ce76316fa38d1506 - optee/optee_os/lib/libutee/base64.c 8b5165f5a04ab8a7602713559fe272670f5b5aab - optee/optee_os/lib/libutee/user_ta_entry.c de26a71b90cb412c9efc752727836f54fb1d95b9 - optee/optee_os/lib/libutee/tee_api_objects.c b2ceb3db7e2bb09feef1e3551cfe2f2000b8bc66 - optee/optee_os/lib/libutee/arch/riscv/utee_syscalls_rv.S 137080dcbc697e48f567709fe3fda2528f5d40fa - optee/optee_os/lib/libutee/arch/arm/utee_syscalls_a64.S b1ff8027d8f72d6043aefff12c169937335d77c2 - optee/optee_os/lib/libutee/arch/arm/utee_syscalls_a32.S a2170433362124e5401cea1cf6f4dafaca653856 - optee/optee_os/lib/libutee/arch/arm/gprof/gmon.h 2e2b03efa22c915b6ab0a59c54793e918ae83560 - optee/optee_os/lib/libutee/arch/arm/gprof/gprof_pta.h 16e0dc83cf08600fd769832ff1d21611782da066 - optee/optee_os/lib/libutee/arch/arm/gprof/gprof_pta.c 1a3e524ad810227480d10b0d8426c780c85328bb - optee/optee_os/lib/libutee/arch/arm/gprof/gprof.c be6fc3000484b65889ef0ddf1e7a926e364575a8 - optee/optee_os/lib/libutee/arch/arm/gprof/gmon_out.h 80eb8b37eb87886d40dc390c74bfae90f83ea208 - optee/optee_os/lib/libutee/include/pta_socket.h a990d751d99ca55773e11d46acf4794e93181cf6 - optee/optee_os/lib/libutee/include/pta_benchmark.h 1ee95d67db99aa4b7dab212672290e1dcf51e1e6 - optee/optee_os/lib/libutee/include/tee_api_types.h 7812d9a6cf27c9c8cb718a2a8824323576ccaf38 - optee/optee_os/lib/libutee/include/tee_api_compat.h 0311b7bfd98a444eeef7c7c89d4e942a84ea6787 - optee/optee_os/lib/libutee/include/tee_ta_api.h ce4bc2d3ed7f6c3ecb68a1f98a7f368f7369a286 - optee/optee_os/lib/libutee/include/utee_syscalls_asm.S 398b00b2fdfc1d0dd1987e95722a21a6de7413bc - optee/optee_os/lib/libutee/include/pta_device.h f5d83909e5071e2affc98fc56ac4b941e00ef03a - optee/optee_os/lib/libutee/include/pta_apdu.h d6494aea8b2d08af66c5b03901a962d4c23afa5c - optee/optee_os/lib/libutee/include/pta_secstor_ta_mgmt.h f4adab9015698b3a5ad156216c44340a86567794 - optee/optee_os/lib/libutee/include/link.h dfe89d4404a213f5751887db149a30135cd07f9a - optee/optee_os/lib/libutee/include/pta_scp03.h 793d80272b98715200cd83435c35de534049b96e - optee/optee_os/lib/libutee/include/__tee_isocket_defines.h bc735eb7fc5fe9fa8e31ddfe2f98dca62b95ec9e - optee/optee_os/lib/libutee/include/tee_arith_internal.h d6461788cfe9c7fa1812938fccf00428981ca21f - optee/optee_os/lib/libutee/include/pta_rtc.h 0914ffb8eea917ca32ddfd5e9d1e07b08242a132 - optee/optee_os/lib/libutee/include/elf64.h 5e23b121b492913159ac492c975bc689fe4fe9d5 - optee/optee_os/lib/libutee/include/utee_syscalls.h 47e7cf8af6ad09392aa45b94e88e4cc07e54520e - optee/optee_os/lib/libutee/include/tee_syscall_numbers.h aff5768a908441b37ad3a28350e0b0f6bf0007b0 - optee/optee_os/lib/libutee/include/tee_api_defines.h aa09af74960113ccd4fb8827d07e4b9140aacf8f - optee/optee_os/lib/libutee/include/arm_user_sysreg.h 1cb2546168ca45afe3e8ee0cd818c13e6019c425 - optee/optee_os/lib/libutee/include/elf_common.h 62fdcf80906b4877ba0a4d22e69a0c75e98e8b9b - optee/optee_os/lib/libutee/include/pta_imx_manufacturing_protection.h 34686e9ef3d016d68cb94ca12b860c89349b5eca - optee/optee_os/lib/libutee/include/__tee_tcpsocket_defines_extensions.h 9c2c1f4769d19646dfe1493dfaa1007b8c538af0 - optee/optee_os/lib/libutee/include/rng_pta_client.h 5d2f8542dbd85a819207cf9201d5c104d1f45799 - optee/optee_os/lib/libutee/include/arm64_user_sysreg.h 989a3f3ba297d8913c040b838c9cab1a5103308f - optee/optee_os/lib/libutee/include/pta_attestation.h 41b79406ff05bc4d3528fca688813e7f88e7d135 - optee/optee_os/lib/libutee/include/tee_isocket.h ebea83d32048f9808bd31f5e2dabc5c0314057bb - optee/optee_os/lib/libutee/include/__tee_ipsocket.h 376f36da862c7024aec13565c1d6af9518cf3f01 - optee/optee_os/lib/libutee/include/pta_jetson_user_key.h 8572ff4140b947a4e4a4b5752d8265fe1ea5b348 - optee/optee_os/lib/libutee/include/pta_scmi_client.h d1eb626d04bb19cbf07f7e9b1a69eaf8593b16ce - optee/optee_os/lib/libutee/include/utee_defines.h 083e406c1b8993f6c0226bf312fcd140b1bc2cc4 - optee/optee_os/lib/libutee/include/pta_imx_digprog.h 5a4c5c4386df019b937e53bdfca5e05bf5f10921 - optee/optee_os/lib/libutee/include/pta_invoke_tests.h faeceac8862bbe02c984a8839b1e1cae06319dba - optee/optee_os/lib/libutee/include/pta_rng.h 8981169f89ce2d195a17112b676bb8552d21ad4c - optee/optee_os/lib/libutee/include/tee_api.h f6b88edde49c7f79eebc0c3f861b6f19ff685fd1 - optee/optee_os/lib/libutee/include/tee_udpsocket.h 5ca4833e2188ae7c12e8b39f0448c7f3627571c7 - optee/optee_os/lib/libutee/include/__tee_tcpsocket_defines.h bfd21882753009a9bff306c49ea3d6ba0a27715d - optee/optee_os/lib/libutee/include/pta_stm32mp_bsec.h 0f06e417dc0b4434790db823616a67697a157404 - optee/optee_os/lib/libutee/include/__tee_udpsocket_defines.h ed871d9884b5e4c5c7801d8dfc5f77f30d79d4ec - optee/optee_os/lib/libutee/include/tee_tcpsocket.h 8ddaf3ec29e785a63a8b8ba266c13abdce68c125 - optee/optee_os/lib/libutee/include/elf32.h c603b51b2bfba8baa7cb2c4dfbaaa421d9461207 - optee/optee_os/lib/libutee/include/tee_api_defines_extensions.h 6cf7866d8d5f2388b28df78b419553de615ec055 - optee/optee_os/lib/libutee/include/user_ta_header.h 591d4ed947e32e0c72a95a7a2514221f1cf9490d - optee/optee_os/lib/libutee/include/pta_gprof.h e3514bd732b3d0be323aae77cdfcbfb736b42fdb - optee/optee_os/lib/libutee/include/tee_internal_api.h c4e212610ccdc55f55421917a843a5b8ddb567c2 - optee/optee_os/lib/libutee/include/pta_imx_ocotp.h 9155ede1378206e1762eb2696d1589cb2b620ee6 - optee/optee_os/lib/libutee/include/utee_types.h aa7d01574e3506e0ee2f42cdb251145908b75381 - optee/optee_os/lib/libutee/include/elf.h 5e08d24c95ed9a2dbbcf69ef3896898ad97abc8a - optee/optee_os/lib/libutee/include/tee_internal_api_extensions.h 24acf5f9664ccd81af1147a5e2f875e5a303d97a - optee/optee_os/lib/libutee/include/pta_system.h d84b15deba3ac3edfa192902098d7b012e19893c - optee/optee_os/lib/libutee/include/k3/otp_keywriting_ta.h 739a223e693f30815eb57c7b1bdae6bc5e2c8028 - optee/optee_os/lib/libunw/unwind_arm32.c a7b80ca6cb33642237a2a0ecfdc7ad3827cef4c7 - optee/optee_os/lib/libunw/unwind_arm64.c 62096636f7a228af8aad98afd445a8ce4e9ba81a - optee/optee_os/lib/libunw/include/unw/unwind.h d3c54bb6b126358f60fecee23a0d6064d3ad12e0 - optee/optee_os/prebuilt/t234/libcommon_crypto.a 4ec1a9b7d2f64d94ccdaa889afe2cba025e5b33b - optee/optee_os/keys/default_ta.pem 91c83678702ef358777559205b8c2c775789c87a - optee/optee_os/ta/user_ta_header.c 32f326f4c0f102b4ee4c9ba88d7d1760b803237c - optee/optee_os/ta/pkcs11/Makefile a6e947a9f3f7337320b8940c40d8441cb477073a - optee/optee_os/ta/pkcs11/scripts/verify-helpers.sh e766a0c478f5e52ce2ea56f842f8e012f68427af - optee/optee_os/ta/pkcs11/scripts/dump_ec_curve_params.sh 5329b77d3056c08cdeb14ecdea7b81110262fc24 - optee/optee_os/ta/pkcs11/include/pkcs11_ta.h b10094c63a4f11d5d590d53e1c73d6f587d0dfdb - optee/optee_os/ta/pkcs11/src/attributes.c b44775c01d993d49402ab222d398850976d8bbc9 - optee/optee_os/ta/pkcs11/src/object.c 4b7dbda490ed1c5ac55d3357b440a8f012c647d5 - optee/optee_os/ta/pkcs11/src/persistent_token.c 5f8de729864d1ad926d2f9ec4ef37e8ff38ceb70 - optee/optee_os/ta/pkcs11/src/serializer.c eb55922796647a3afae81a788f1ce67eaaaba09d - optee/optee_os/ta/pkcs11/src/sanitize_object.c 9ba0514e3a2e9581cf9564462df013a0494f745d - optee/optee_os/ta/pkcs11/src/pkcs11_attributes.c aee16d7bf1c5d2a0c39c6a5112cec71f528421b3 - optee/optee_os/ta/pkcs11/src/user_ta_header_defines.h 0e3dca0597af48781c952400ea4ecad857110eef - optee/optee_os/ta/pkcs11/src/serializer.h 9e799d40bc5157fad91180105d091bf81c2695ab - optee/optee_os/ta/pkcs11/src/processing_digest.c 26dc92427964930f69b616be7c77b90da4bcb8df - optee/optee_os/ta/pkcs11/src/object.h 2a2615470b5e9f0946dbf9e32ee11fe0b4dff621 - optee/optee_os/ta/pkcs11/src/pkcs11_token.c fb13a7d2381ef0bc40438bc32f4406ee2690d914 - optee/optee_os/ta/pkcs11/src/processing_aes.c 0aa2868227123053da7d9368bc3640a839d4e682 - optee/optee_os/ta/pkcs11/src/processing_rsa.c aaff008a064e973b8f57ec40853d5935a7fd36cd - optee/optee_os/ta/pkcs11/src/pkcs11_helpers.h a199684d2e257ba2568ad8c8d6788b9e4e8abcab - optee/optee_os/ta/pkcs11/src/token_capabilities.h c1bc93345d7db093a5ac9ce255a1f1b9b04f9b41 - optee/optee_os/ta/pkcs11/src/pkcs11_attributes.h 8d8b0a84e056fa008bf4be504cddf4b5f059389a - optee/optee_os/ta/pkcs11/src/handle.c f5f2eae047cb155a42ed528fb8b2f574970fe2a2 - optee/optee_os/ta/pkcs11/src/processing_symm.c 5cf92c8affd431f709ff970b2f42fab1b0a96ad2 - optee/optee_os/ta/pkcs11/src/processing_ec.c deec6a53392a9c38fca095c61a072b80ec426224 - optee/optee_os/ta/pkcs11/src/pkcs11_helpers.c 0ffa60c477bc8ee08f506cf0302096d0982314b1 - optee/optee_os/ta/pkcs11/src/pkcs11_token.h 03111d59e4b6c3a54517680ae126d3498a8d2b9e - optee/optee_os/ta/pkcs11/src/processing.c 406de9608e4061b2c61b5af8605bcd7f389e4bf3 - optee/optee_os/ta/pkcs11/src/handle.h 8a63bd474856b01d14303d306048e3981ddf19c4 - optee/optee_os/ta/pkcs11/src/entry.c 4ad6fb1144fae7c02fd7ef269c1a4af2c25ca38c - optee/optee_os/ta/pkcs11/src/token_capabilities.c f96d820c677acbc73e09670a4747a0c925f319d2 - optee/optee_os/ta/pkcs11/src/processing_asymm.c 84b21a00a4d1908760573381497ecc1584892ee3 - optee/optee_os/ta/pkcs11/src/processing.h 894d688c805cbbca2bde46ae5dfcf38092d7e8dd - optee/optee_os/ta/pkcs11/src/attributes.h 9d7de06484bf080c9fb9d2922ea6a4d808edce81 - optee/optee_os/ta/pkcs11/src/sanitize_object.h 353da6ac448fb9756cfa1b97c162df13d0174fac - optee/optee_os/ta/arch/riscv/ta.ld.S 44f007aca97998b425d27b7af67779c039d4d8d7 - optee/optee_os/ta/arch/arm/ta_entry_a32.S a5b56b622eb2fde139565fba51a74c5de3806afe - optee/optee_os/ta/arch/arm/ta.ld.S 78100b9031d82bc62fe38e0650f780d2c18f2f5b - optee/optee_os/ta/avb/user_ta_header_defines.h cc0a07d6f59b29a9ec0e01f5ca6a378b3d445248 - optee/optee_os/ta/avb/Makefile 49328831e03037ff1c84c1721fb97905781904e0 - optee/optee_os/ta/avb/entry.c 04d61d12d0b618ec98f1f36f7aac7e7f6a0bada7 - optee/optee_os/ta/avb/include/ta_avb.h b28af208dabadef396024e4007f36154699e975b - optee/optee_os/ta/trusted_keys/user_ta_header_defines.h 50fac4ba9aede25524155ad8cd8cdd905f195a87 - optee/optee_os/ta/trusted_keys/entry.c 8ff25744520aea7259967d34911798667d2cf6fd - optee/optee_os/ta/trusted_keys/include/trusted_keys.h bf52776d687b57bc5e886b2f4e7a0f7ece62b0b7 - optee/samples/Makefile b2def2faca96323618fae5d302c50260bccb869e - optee/samples/LICENSE 22d6ec718c65f0f1fab50d6a32d64857f975eb83 - optee/samples/hwkey-agent/Makefile d641b8218d5f3af3869eb24210d632d9accc789e - optee/samples/hwkey-agent/README b2def2faca96323618fae5d302c50260bccb869e - optee/samples/hwkey-agent/LICENSE d8d2851c68cdbcc9138bf2542d445f73ab2ebe44 - optee/samples/hwkey-agent/host/Makefile 59f6594fdd5e77aaf03788a08a39999ffd8b86e5 - optee/samples/hwkey-agent/host/hwkey_agent_ca.c 3e73868f9048110e8fce23a71343f5d0db256281 - optee/samples/hwkey-agent/host/tool/gen_ekb/example.sh 04735615008d1c575afd724156b78c21d77766ea - optee/samples/hwkey-agent/host/tool/gen_ekb/README e000cd877e89200d16afabb3f5778d4ce0bc072b - optee/samples/hwkey-agent/host/tool/gen_ekb/gen_ekb.py 65d0125074f02769fd68a3b9db5c1f440a076ec6 - optee/samples/hwkey-agent/ta/hwkey_agent_ta.c 01a5ebf5ecbf58a06002ad10b902e18d78d452d8 - optee/samples/hwkey-agent/ta/user_ta_header_defines.h 5054796c29272096d67dbf4fa7453f9bfa3ad280 - optee/samples/hwkey-agent/ta/Makefile f1652fd24c49bf7be742b2e2081280bcd33d2ddd - optee/samples/hwkey-agent/ta/include/hwkey_agent_ta.h 85cb555a484a3191da2b234f4c2121addebc83a5 - optee/samples/luks-srv/Makefile 6fb1ad386475e975804bd789938f171a0e634bf9 - optee/samples/luks-srv/README b2def2faca96323618fae5d302c50260bccb869e - optee/samples/luks-srv/LICENSE ba0f3f4839fe17b652aa8a9e18d0f5fe602f4662 - optee/samples/luks-srv/host/Makefile 8577e960a7ba6fea952165100b467fd6b4fb1902 - optee/samples/luks-srv/host/luks_srv_ca.c 6d3ac3cebb74c4f088accfac2d48654ea788769b - optee/samples/luks-srv/host/tool/gen_luks_passphrase/example.sh 42761539497633e52d70529a0c963678c1e2b9e8 - optee/samples/luks-srv/host/tool/gen_luks_passphrase/README ea3aeef7e946314ca0a3dc1f6b2c64099963b8e8 - optee/samples/luks-srv/host/tool/gen_luks_passphrase/gen_luks_passphrase.py 9198ad9d0108d1f0c5411e43cfcdbbb011dc6ddd - optee/samples/luks-srv/ta/user_ta_header_defines.h 7dcf0c69657674d5c8d84f037993856ccdabf784 - optee/samples/luks-srv/ta/luks_srv_ta.c fa3f0583c33f15560475d2899643217e9b8bdedd - optee/samples/luks-srv/ta/Makefile 80db8ae67e3a08227b8feeb7c71d80c97e620988 - optee/samples/luks-srv/ta/include/luks_srv_ta.h 21ee084c6b208974935df6b5626f27e4cbb8e053 - optee/optee_client/Makefile 1be3a93bb56c46ee4d4693b47ddd7c4c5487ffd3 - optee/optee_client/README.md a7d910ff308216f427e9a4776d72cfe84e2915ad - optee/optee_client/LICENSE c9b3bb5ab0a3d0252ed93cfc3578e3991ee2b994 - optee/optee_client/typedefs.checkpatch c9c46f6d84c395db9e62599d15980f06cf993db7 - optee/optee_client/libckteec/Makefile f25fe667d7155f39694414e63dac8d54adb5e264 - optee/optee_client/libckteec/include/pkcs11_ta.h 7d66a5a9955374f577b36eda3684c254841edbda - optee/optee_client/libckteec/include/ck_debug.h cbd1cf1d939303ee17050057c176ddb7498b1598 - optee/optee_client/libckteec/include/pkcs11.h 53de33af06e51fb21fe2f24c2c0665a45baeb3b8 - optee/optee_client/libckteec/src/ck_helpers.h a4b2b6fc00af2b337386db3fc110f54709a248bb - optee/optee_client/libckteec/src/serializer.c 28f837a80c95ceb3f72437386993f46469f861e9 - optee/optee_client/libckteec/src/serialize_ck.h 4a7c34adbc6006ef9230bb1919ca520891b9823a - optee/optee_client/libckteec/src/invoke_ta.c e640a280681f076f112beee518ea1adff965c818 - optee/optee_client/libckteec/src/local_utils.h 0db1379449cb2cdae53a7b480a402e8c43457431 - optee/optee_client/libckteec/src/serializer.h a36127385f3d497598291e167cfc4147e48861ed - optee/optee_client/libckteec/src/pkcs11_processing.h af95d0df955aaa2ab03f767ed5368a2d461eb337 - optee/optee_client/libckteec/src/pkcs11_token.c 48b8562a4200b00fe6382797789d8e694186c620 - optee/optee_client/libckteec/src/invoke_ta.h 04e59fc9b03985ed9c71fb751bcf60dc050aa517 - optee/optee_client/libckteec/src/ck_helpers.c f88324eb36dec1f8579a56f5e446475ced59b52d - optee/optee_client/libckteec/src/ck_debug.c ff70441ef0fe6caa58fb618ff6343691f6a5440f - optee/optee_client/libckteec/src/serialize_ck.c 178b53aac43cdfc719b04be256672168226a3e4e - optee/optee_client/libckteec/src/pkcs11_processing.c 3d1d16bc8a998c7382d0e5deb177e421613cbdb9 - optee/optee_client/libckteec/src/pkcs11_token.h 145e33a2859354e90473957df5bdd430b63f437c - optee/optee_client/libckteec/src/pkcs11_api.c d6e6c51b13d0f6f61ae51ff3da8b8f51b3ac433e - optee/optee_client/scripts/checkpatch_inc.sh 668dfffd684890e7dd9bedbfd635db0df9af35d8 - optee/optee_client/public/teec_trace.h 5009e68a037662f4c9aa73a569a2ffa76983dd05 - optee/optee_client/public/tee_client_api.h 43da45835976c93e70ec5ad1ed02b891a0dbe000 - optee/optee_client/public/tee_plugin_method.h 08cc148a2aa7668b539ec815dcfcd4ba6ee64ca1 - optee/optee_client/public/tee_bench.h c6e011ef6751f07449bffe9fd19006a15b8624b5 - optee/optee_client/public/tee_client_api_extensions.h c2eeeb99eea300a1748db00f9803a548f2282c49 - optee/optee_client/libteeacl/Makefile ee867d9d7bddd079e18e86b614ddb0951d3a79ce - optee/optee_client/libteeacl/include/teeacl.h d44856b3c2e641d34dc08c44aa14df8111f0f2a0 - optee/optee_client/libteeacl/src/tee_uuid.c 3842833a20a863d971c8d33f5e101ccc77e88c62 - optee/optee_client/libteeacl/src/group.c 0ddc947d4bafad6f4a3d62517c539706e25b6cd0 - optee/optee_client/libteec/Makefile 65b3d16f29fb30f1241ad61acff018a0dc2e6f88 - optee/optee_client/libteec/libteec.pc.in 6f319e289afeaa66b6058c8f2397e66d4bd79b70 - optee/optee_client/libteec/include/teec_benchmark.h 15278a332dd772f0c91e486e562d10ba1b9cb6df - optee/optee_client/libteec/include/linux/tee.h 67f6aec80cb155ca0bb850b4b38b6cf0042917c8 - optee/optee_client/libteec/src/teec_benchmark.c d842563e16728b8e4b8e70f1fd7522598235d843 - optee/optee_client/libteec/src/teec_trace.c 72b02b7343819ffef928481f93f3d02afeb55b88 - optee/optee_client/libteec/src/tee_client_api.c 162069bdee10a33e7ff8e9680386d51bd7eaffff - optee/optee_client/libseteec/Makefile 2219ff4dd85f1c6a0ee11024a1834c7d17124a79 - optee/optee_client/libseteec/include/se_tee.h f5d83909e5071e2affc98fc56ac4b941e00ef03a - optee/optee_client/libseteec/src/pta_apdu.h dfe89d4404a213f5751887db149a30135cd07f9a - optee/optee_client/libseteec/src/pta_scp03.h eb52a5aa690916e1cdb6e9d58fd746762ac03bbc - optee/optee_client/libseteec/src/se.c 874f552974cb3d5f17a63dd2ba50582a28e2d28e - optee/optee_client/ci/Dockerfile.ubuntu 2a0b9b82ad279a7127d4fb8fa2c4c4bb0bbfb62e - optee/optee_client/ci/Dockerfile.debian 02f2418592552d63eb73b6480b2b59962b800f2a - optee/optee_client/tee-supplicant/Makefile 8fbfe192d68bdb1e126598cb730e7c11f511960d - optee/optee_client/tee-supplicant/src/hmac_sha2.h f24b5d7b4681f11f33d735e96c6193f040d61420 - optee/optee_client/tee-supplicant/src/rpmb.c 120c38c9db67c7f01f10865b26742c3d2ae3aabe - optee/optee_client/tee-supplicant/src/teec_ta_load.h f5b0fdcf3343c38ff2495f438044546952d538e2 - optee/optee_client/tee-supplicant/src/tee_supp_fs.c 5387e1fcf4e95d497b72ee814d729c4c90adb740 - optee/optee_client/tee-supplicant/src/plugin.h 07af4053379b51e5d33dda8ac2eda2181ae23a02 - optee/optee_client/tee-supplicant/src/nvme_rpmb.c eb428488f05ca6049614557e2a89abbe531b1e24 - optee/optee_client/tee-supplicant/src/sha2.c 2b4e00ad1b9e0f3a5e7c2efbef6591de41a0e409 - optee/optee_client/tee-supplicant/src/sha2.h ad3a9ab261d5a20d083f5cefdfb13c93c3222cd9 - optee/optee_client/tee-supplicant/src/teec_ta_load.c a80eb6caf9c8732d74f0fc4c329a4222995ec6c8 - optee/optee_client/tee-supplicant/src/__tee_isocket_defines.h f04b1790f669de1573516dc81fe3f4eefcb59c1f - optee/optee_client/tee-supplicant/src/rpmb.h f17cf7d08bb300eb71cf0b2ca503f505c269e761 - optee/optee_client/tee-supplicant/src/tee_socket.h da6b261a72fe9cce7fef5e8d85d300790dd5b158 - optee/optee_client/tee-supplicant/src/tee_supplicant.c efbb5dce35c8d8f138142500a0d6ca7df0a01dd4 - optee/optee_client/tee-supplicant/src/tee_supplicant.h ea069507eb088c8be58fd316e1182d94fdcfffb6 - optee/optee_client/tee-supplicant/src/optee_msg_supplicant.h 593518d07f2abcdc15942f188796aaa0bb12d4c6 - optee/optee_client/tee-supplicant/src/__tee_tcpsocket_defines_extensions.h 946a1750a3bd2cb7ee8a0934d7df7849d1649aee - optee/optee_client/tee-supplicant/src/__tee_ipsocket.h 1f145b8b2fe3882017290f627f46dfc328a7c144 - optee/optee_client/tee-supplicant/src/handle.c 4a38f4ea1eea116c78d27b03a2cbfb92f8ea3a97 - optee/optee_client/tee-supplicant/src/tee_supp_fs.h 721aca20ceeacd1648d0f7204c85f69b282fe101 - optee/optee_client/tee-supplicant/src/__tee_tcpsocket_defines.h 945a945fa92b85f4b7003123e4ef27a588bdc2bd - optee/optee_client/tee-supplicant/src/hmac_sha2.c b81a505561be6982f3eea681e266827c8236583c - optee/optee_client/tee-supplicant/src/__tee_udpsocket_defines.h 9763ee4354d75e34559e80fe8dda7bb158c4c5d0 - optee/optee_client/tee-supplicant/src/handle.h f1107acfa97784e2a91a1a393dd6198fc4a4a222 - optee/optee_client/tee-supplicant/src/prof.h 2eeff0bb8ad1aaf5594e87a9faa9b9bffa63ee8f - optee/optee_client/tee-supplicant/src/plugin.c a5f3a0cb9e4309400c0c22dc574de3c8eef67a65 - optee/optee_client/tee-supplicant/src/nvme_rpmb.h a16a80d873293f74d73baf53721eb5019ded25cf - optee/optee_client/tee-supplicant/src/tee_socket.c bed7d31fece3711cc20a9418d51d24ef7fe3391b - optee/optee_client/tee-supplicant/src/prof.c 1764bfc2b32f604e3b3b7d735ce13aebfbd84d74 - optee/optee_test/Makefile 30a64b524a40d63d6e6f97698875a98100706c59 - optee/optee_test/LICENSE.md 1677c508f843daf45fcf3a1e8c23dacf24f2f222 - optee/optee_test/README.md 9f9d1e370fe395412ffa6a5bc7d21a13586d1551 - optee/optee_test/typedefs.checkpatch d178f675a81f53b7e725d270b25fadc6b064d6f8 - optee/optee_test/scripts/checkpatch.sh 5d1d72def657b4edb305b87edbff271b1a4e0c81 - optee/optee_test/scripts/rsp_to_gcm_test.py 72d26f74f4c2afb8675278b599c37c055eeeee59 - optee/optee_test/scripts/file_to_c.py c035f30f1e5286ab496634f87b76fca573244cec - optee/optee_test/host/supp_plugin/test_supp_plugin.c c6f2d858387614cd7e1ba883db5977638bbcfd55 - optee/optee_test/host/supp_plugin/Makefile fa35e416cf42119ff66e1a064a4d5db8c785118e - optee/optee_test/host/supp_plugin/include/test_supp_plugin.h 2ede51c8890d3520381c8cbef3b37e41fba5ae38 - optee/optee_test/host/openssl/include/openssl/ecdsa.h 0b02b031e6e3e70e62bf1b49e9c2e1cecfcfc53e - optee/optee_test/host/openssl/include/openssl/rsa.h d957c5aee3bd2927a6600aa410806835df0afa64 - optee/optee_test/host/openssl/include/openssl/pqueue.h 4b807b363eb139b490d51878492a987b9f0fbadf - optee/optee_test/host/openssl/include/openssl/pkcs12.h 09b47f0d80884577cc93c8a315e2f257f866f71e - optee/optee_test/host/openssl/include/openssl/whrlpool.h b31cf4d26ccbefd0c519bd475ea515f8cad8be06 - optee/optee_test/host/openssl/include/openssl/comp.h 36fbc7d4b2c4a903cce70e18132610a96a7f605f - optee/optee_test/host/openssl/include/openssl/krb5_asn.h 521646326a376805c0087b4ac4e587e312e48a86 - optee/optee_test/host/openssl/include/openssl/rc2.h 6e2539151422b3aa13de79253cd6ca1c9a51ee0f - optee/optee_test/host/openssl/include/openssl/md4.h aeca6068019b931b7d13625ebd103d216bca02dd - optee/optee_test/host/openssl/include/openssl/asn1_mac.h f67566f6be946527f9fd7377f6d0497fe8b46311 - optee/optee_test/host/openssl/include/openssl/lhash.h 007afd8fc88d891a1e00f03bc5a8d4a91d1efb30 - optee/optee_test/host/openssl/include/openssl/dh.h 2b2d1d499c5edf35ef3f9ac62bececf383d41ac8 - optee/optee_test/host/openssl/include/openssl/ebcdic.h 7a76095422e2ee1f5fb153ba7c0c2ef9433ea6b8 - optee/optee_test/host/openssl/include/openssl/rc4.h 8f83d8e48dcc303c8728abdc98037de8201324cd - optee/optee_test/host/openssl/include/openssl/hmac.h 0aa379746d3f24d0b687810aaaf0713ac8d86cac - optee/optee_test/host/openssl/include/openssl/cast.h 2048939555964c40f69cdefc57dcea55871b5e21 - optee/optee_test/host/openssl/include/openssl/mdc2.h 5dbab49158bcb4a23e2a0bf815685b7af61f2deb - optee/optee_test/host/openssl/include/openssl/aes.h d71fa389c798ef55aeb8e8b585fc1162e31bdcc2 - optee/optee_test/host/openssl/include/openssl/opensslv.h b57a6862b5e685a8307d9223bb7503a7d455beed - optee/optee_test/host/openssl/include/openssl/e_os2.h 833548d5315aae6cb83981ec70013ca82d8ba523 - optee/optee_test/host/openssl/include/openssl/stack.h f2d2c1d8957a3a90515fad312be14bd33b7457ae - optee/optee_test/host/openssl/include/openssl/ocsp.h 3990fba87a08e52c857f2d84c339515db4d5961b - optee/optee_test/host/openssl/include/openssl/ossl_typ.h 4617f3f1b34e51a83332ce79f96b7d21ee8850b8 - optee/optee_test/host/openssl/include/openssl/rand.h 1ac129425f344b32376a91e54598a3dfa0f5fd5e - optee/optee_test/host/openssl/include/openssl/pkcs7.h 81b3cbbc6aec76fe305933bb36fbe6cccc40060a - optee/optee_test/host/openssl/include/openssl/asn1.h 37a6ce9452aba6d49d2187b0b511cdc7fbc74f79 - optee/optee_test/host/openssl/include/openssl/des.h b363b25219a1c9eacee176d89341d73f1c48fc2c - optee/optee_test/host/openssl/include/openssl/bn.h 2ace7c1f67fc524df92ae2ae2664d1c801133683 - optee/optee_test/host/openssl/include/openssl/symhacks.h fb15a076c1eb0858fe09e6810ad86e3a8991a9ce - optee/optee_test/host/openssl/include/openssl/x509v3.h 9f1ac5a09d7973c8cd30e0298ac1d1be1a0d6886 - optee/optee_test/host/openssl/include/openssl/blowfish.h 4b7d9942149c0c6118f6cfd9c003f90d588296b3 - optee/optee_test/host/openssl/include/openssl/conf.h d18c728f023f12638001d15986c50433e663a09c - optee/optee_test/host/openssl/include/openssl/pem2.h 7eeea32830643e2f0f4d15395206df2be5df49c4 - optee/optee_test/host/openssl/include/openssl/ecdh.h dcfb707bab9b356d55f13464fd8d7e11a3bdea22 - optee/optee_test/host/openssl/include/openssl/md5.h 84e95faa34c5a831ee71a5f5dcbb646201b3ebb9 - optee/optee_test/host/openssl/include/openssl/des_old.h b6b3c01be13efb980c8906da0393538b4c3719c7 - optee/optee_test/host/openssl/include/openssl/seed.h 7244a5772f23284c8bd43229143a1593bb09f056 - optee/optee_test/host/openssl/include/openssl/sha.h 91b236bcae76db131199e0e286ac95943640a75c - optee/optee_test/host/openssl/include/openssl/bio.h eae391c729397d3c5ad18e6910ce855e200507bb - optee/optee_test/host/openssl/include/openssl/opensslconf.h eac535357ab50226b3107ae08f15db1a440545b7 - optee/optee_test/host/openssl/include/openssl/srtp.h 7a4605500282f7f93bf6a9d81906d951840f0b02 - optee/optee_test/host/openssl/include/openssl/ui.h f23cbec4815cddcfe918ef1922900963069b9e41 - optee/optee_test/host/openssl/include/openssl/cms.h e9da708e470b8d2252e9b09393e5c4580b1f4bb6 - optee/optee_test/host/openssl/include/openssl/ripemd.h 91fd336279423d8e0ccfcd3fe23df9b480034889 - optee/optee_test/host/openssl/include/openssl/x509_vfy.h 54dd565d744fbcfa3e38942843caa0ecc019a910 - optee/optee_test/host/openssl/include/openssl/ssl2.h 3871fe3539f575999166622f5f3295fb9b9ae673 - optee/optee_test/host/openssl/include/openssl/buffer.h e2ba178670ae93680fb28a3b57fff7f6917355e1 - optee/optee_test/host/openssl/include/openssl/kssl.h 2c6c8cda8629b0d3dda1efc8f1a5ebd445e91955 - optee/optee_test/host/openssl/include/openssl/engine.h f2463bfe32222c40ede22c3029699bf0a72ebcc5 - optee/optee_test/host/openssl/include/openssl/ec.h 2f638be4aded9c65a4b26ba81b30866b9dd161de - optee/optee_test/host/openssl/include/openssl/pem.h 8950cfbc3480ab12e4820970075260196620fe62 - optee/optee_test/host/openssl/include/openssl/ssl.h 6d1f831d4539dda2a411e59d8a6b796f3182de46 - optee/optee_test/host/openssl/include/openssl/modes.h 5e329424d948cbb1c0d9dd3ebb4186628f2187a8 - optee/optee_test/host/openssl/include/openssl/ts.h 348d7310a404d8ea1ebb6643a5ce6f0825ab9cdd - optee/optee_test/host/openssl/include/openssl/conf_api.h 3983b476f0abceec9b60bb53eebdfe56fad3a5fa - optee/optee_test/host/openssl/include/openssl/idea.h c8c527ee5e92b3a1ecffcec43a430403632a3add - optee/optee_test/host/openssl/include/openssl/camellia.h fa9bfab1d6d9e91f5277755673e3cb5b03705e91 - optee/optee_test/host/openssl/include/openssl/dtls1.h 9e6782cd54849b4c6bbdac9bac3bac212a8cec90 - optee/optee_test/host/openssl/include/openssl/obj_mac.h 5ae3cd2824e759e5db6b4db2e8c1822522106ede - optee/optee_test/host/openssl/include/openssl/ssl23.h 23ea4c0c2a08169c3b483dbfc029ad2ca6ffef06 - optee/optee_test/host/openssl/include/openssl/ssl3.h 44533c0a69f2f7b36d3cb7f4b5988f6cdde1ddf1 - optee/optee_test/host/openssl/include/openssl/x509.h 91d7ca042ccce5880c8e269596f308ae0b9ea926 - optee/optee_test/host/openssl/include/openssl/evp.h b41be35897beb8a5a5e4335933691bb60a0866ea - optee/optee_test/host/openssl/include/openssl/srp.h 71d0dc5dcf2d6f948006266274599e59df948640 - optee/optee_test/host/openssl/include/openssl/cmac.h a5f237896f32dc70faa6ee3dc24759a9db5aff2c - optee/optee_test/host/openssl/include/openssl/crypto.h c60c090361a630efae68bdd14760bb2e6562fe41 - optee/optee_test/host/openssl/include/openssl/ui_compat.h 6d98c86e1e6c3cda9df339540539b819f9ee038f - optee/optee_test/host/openssl/include/openssl/tls1.h ead277c7cf2b9d4210347bbe980c0ea419cd8ad5 - optee/optee_test/host/openssl/include/openssl/txt_db.h 1afa8c4dffa42c03657b47d7d6a317c0d09fafc6 - optee/optee_test/host/openssl/include/openssl/dsa.h 3a84c50fc7a71ea781a04dcd3d1915a83c0193c6 - optee/optee_test/host/openssl/include/openssl/safestack.h 95a13ac793b2a71b4ae39c72da0f18012db54268 - optee/optee_test/host/openssl/include/openssl/dso.h 385087b8e5f37ef32cbbf8af02de4f24acab85df - optee/optee_test/host/openssl/include/openssl/asn1t.h 8a674b7fa0641dff8c2b55e565149cdb3d208fb8 - optee/optee_test/host/openssl/include/openssl/objects.h dc45fa098993e12071562269ab765bf9160fa670 - optee/optee_test/host/openssl/include/openssl/err.h 386831d0bd03bc34d096121a9412f212a82507e7 - optee/optee_test/host/openssl/lib/aarch64/libcrypto.a 2f90ea6f809369b37a3d482750a9616ae008aa5c - optee/optee_test/host/openssl/lib/arm/libcrypto.a d9f2461c2a9d755472e666b2c5b60fe21ae7f431 - optee/optee_test/host/xtest/regression_8100.c 4e533d0531c352071ee236302dab1c2fed2068d6 - optee/optee_test/host/xtest/install_ta.h 80a9b9f4795682feb072795a92f15c630eefa57d - optee/optee_test/host/xtest/sdp_basic.h 4ed1b27140db56a58e598a1d47e2eee729363f6c - optee/optee_test/host/xtest/xtest_test.c 032a232dd66725d849cb168cfb5ed48cc19a2023 - optee/optee_test/host/xtest/xtest_test.h 01ce700dbb77213e51c372e4e6dc61082d7da4fe - optee/optee_test/host/xtest/regression_8000.c 12ca0aa8361d1e3bdbf54e11e288ca087745ce14 - optee/optee_test/host/xtest/benchmark_1000.c 3203c2511c56b80cf0757ce40aff2627e1589f54 - optee/optee_test/host/xtest/regression_5000.c e1fb4f35907beabaf3b0dbe646b45d64d4aa5d03 - optee/optee_test/host/xtest/stats.h 47d40cdaa11a5c163ebe1b3f530bc7706b43fefd - optee/optee_test/host/xtest/hash_perf.c 4f006a99a3d317def8f48cbcd1450ab4132eda31 - optee/optee_test/host/xtest/regression_1000.c 1c0d518167dbd004a55feb971308505c53869a40 - optee/optee_test/host/xtest/sock_server.h 68d3a5e5deb31ba074b1848cf8e1ab7b3ee6606a - optee/optee_test/host/xtest/regression_4100.c d300a7ef8b1675a42dbf548bc666f0a25b52f241 - optee/optee_test/host/xtest/regression_4000.c 34252d1d1af13adc2316a7646dd79af124e5f2c0 - optee/optee_test/host/xtest/Makefile 6c62f544374fa83651ea1885eee47d0811ed10a9 - optee/optee_test/host/xtest/sdp_basic.c 6074430df45012584a40484c4ed72373bcbbe599 - optee/optee_test/host/xtest/benchmark_2000.c 175414663dc68fd21ab80cf3420337256d7570c4 - optee/optee_test/host/xtest/xtest_uuid_helpers.c fcc29faa1a7c09980dd59d6d420b3c4c944fa09d - optee/optee_test/host/xtest/xtest_main.c ee2eb88f341b89c3f0408931d30d5bbf17dd5b1b - optee/optee_test/host/xtest/ffa_spmc_1000.c 14686c51c1e1fc99b03e351c11aed2874aee799d - optee/optee_test/host/xtest/install_ta.c 4cc77b90af91e615a64ae04893fdffa7939db84c - optee/optee_test/host/xtest/LICENSE 5943cfc12866b99e42e14fd92203ed1767ab893a - optee/optee_test/host/xtest/stats.c 4b76e6786bed1ae8da806d21ac567198a5bebdd8 - optee/optee_test/host/xtest/rand_stream.h aba50362fcc1ac3ba6d33e204435ca7a84cfb20e - optee/optee_test/host/xtest/regression_4000_data.h f3517bebcb21463533c4004d029833eaf5cde12f - optee/optee_test/host/xtest/xtest_uuid_helpers.h 16276b9d01ba73bf3bb21cb41ff264f3d0126d20 - optee/optee_test/host/xtest/sock_server.c a611cff7cdaf3b04d87eef15c299048990ec3ea1 - optee/optee_test/host/xtest/xtest_helpers.h 2396216346fc9cde6fa94372e0bb7a14d0bc4fc1 - optee/optee_test/host/xtest/pkcs11_1000.c 9f00cd47e998059a38459f0c6eb06c7b4662bf83 - optee/optee_test/host/xtest/regression_6000.c d5fc61a73a10975c5945aa67296797824b64b8b4 - optee/optee_test/host/xtest/rand_stream.c 52b11c0af213c40771048607e3da5eb5943e0d98 - optee/optee_test/host/xtest/regression_2000.c 9f2e5d4fab27dc73f38eb0289cd64269900bf3e7 - optee/optee_test/host/xtest/aes_perf.c d4e67633393e1eafbf02639e218f430a71cb978d - optee/optee_test/host/xtest/xtest_helpers.c bb316ac26e30020622adeecd07ddf9139e9202c2 - optee/optee_test/host/xtest/crypto_common.h e6ac80b711f1a44d2eb77e1c618fe7f3270205be - optee/optee_test/host/xtest/nist/186-2ecdsatestvectors.h a8012c439058a9ab645990d2efcd10447bc34324 - optee/optee_test/host/xtest/nist/ecccdhtestvectors.h 99f104f79f66a659ea913d475077f7503b8a1c51 - optee/optee_test/host/xtest/nist/186-3dsatestvectors.h dd01f2d86e9e0e0a15aab712c3828f76e4c6e2fc - optee/optee_test/host/xtest/adbg/include/adbg.h cf415448a59978f2a427eddeb129a7080f5b5dbf - optee/optee_test/host/xtest/adbg/src/adbg_expect.c f465eee2e09e054182205ae7c53f7253604401b9 - optee/optee_test/host/xtest/adbg/src/adbg_run.c fd1a3702bdc602b4b70535b00d38b9443e275607 - optee/optee_test/host/xtest/adbg/src/adbg_int.h bef73e2c136bf2a04bc8cf33b2052afac83535c1 - optee/optee_test/host/xtest/adbg/src/adbg_case.c e62cdf03f6bf82c09ca10f285a951c1018bbe70d - optee/optee_test/host/xtest/adbg/src/adbg_log.c 877fc553d7b1b08364cb1189bf4cdc3b6cf3c0e6 - optee/optee_test/host/xtest/adbg/src/security_utils_hex.c 4f57fda84526a6b64ecc3eccc008e18b97fc3523 - optee/optee_test/host/xtest/adbg/src/security_utils_hex.h 825ea0288d353fbf26dd5cb0e56be8db4e7bf245 - optee/optee_test/host/xtest/adbg/src/adbg_enum.c 35ce411007e4e624913b8da87f51325be763d65d - optee/optee_test/host/xtest/gp/prepare_suite.sh 78e225e2b8581d7bd917bf1c007f4fee5b1d088b - optee/optee_test/host/xtest/gp/TEE_Crypto_API.xsl 488980fe7c4d8999c8466da403ef5b2811727e7d - optee/optee_test/host/xtest/gp/TEE_TimeArithm_API.xsl d00562756b00f6607632030c58bbd3576f7c13aa - optee/optee_test/host/xtest/gp/TEE_Internal_API.xsl 39dbed853b87d4a916b95de14d5e23a8f434bfb2 - optee/optee_test/host/xtest/gp/TEE.xsl baf0c6e02b9300a37bd4409628cea730d71faa5f - optee/optee_test/host/xtest/gp/TEE_DataStorage_API.xsl c6196ca75d7d48f6e14cc561eefaa9f320adc598 - optee/optee_test/host/xtest/gp/include/xml_datastorage_api.h 93a968118f5345200d7a4d9d78443ada60e64227 - optee/optee_test/host/xtest/gp/include/xml_crypto_api.h 438135b73e49aaad9e34b6863f5bc922f1013b64 - optee/optee_test/host/xtest/gp/include/xml_common_api.h 9d3445c797b4be4516d15baa3e11c682dd8b4918 - optee/optee_test/host/xtest/gp/include/xml_internal_api.h 1af3df59426284098690de7d43586a5e4fd37db9 - optee/optee_test/host/xtest/gp/include/xml_timearithm_api.h 7b0cf45da16221e265fbd01221f541b851cb9e21 - optee/optee_test/host/xtest/gp/include/xml_client_api.h 5bdbfb7c09b73b8ee3f012bb4c05c5655a2e426c - optee/optee_test/host/xtest/gp/patches/0012-TTA_TCF-remove-TEE_MemMove-from-CmdTEEGetPropertyAsX.patch 146a6228e298272ab7e73778962df356d9198311 - optee/optee_test/host/xtest/gp/patches/0010-TEE_DataStorage_API.xml.patch 496f8635c2c0110849cb7e095423e036dae754ec - optee/optee_test/host/xtest/gp/patches/0014-Pass-upper-32-bits-of-TEE_PropSetHandle-in-value.b.patch 705d65243c1e46af9f9642bb84f45b2daeff957f - optee/optee_test/host/xtest/gp/patches/0008-TEE.xml.patch 4f9aca322840391a171d320f3e9d5976b257fa41 - optee/optee_test/host/xtest/gp/patches/0006-TTA_TCF-fix-CmdTEEGetPropertyA-_withoutEnum.patch 0c86f63bc803a23617fb13ba1479108edaf5dac5 - optee/optee_test/host/xtest/gp/patches/0009-TEE_Internal_API.xml.patch cbc872e82c403faa84376db8efc78150338e2693 - optee/optee_test/host/xtest/gp/patches/0004-TTA_Arithmetical-patch.patch c834f47f97dd115566b874fa7e4a6d40d064d939 - optee/optee_test/host/xtest/gp/patches/0013-Disable-Invoke_GetTAPersistentTimeNotSet_and_SetTAPe.patch 163d266dd45cad8536da0f2e1f5c625fc45e2e52 - optee/optee_test/host/xtest/gp/patches/0005-GP_defs.h-enable-debug-prints.patch f0098e4814dc81f9ecae74036f354210e6c33a50 - optee/optee_test/host/xtest/gp/patches/0003-TTA_TCF-patch.patch 4436ae2a8726be665c4adbc30899d7dbcf721afd - optee/optee_test/host/xtest/gp/patches/0002-TTAs-add-files-needed-to-compile.patch 34223b3e49b6b18b8bf88abf784fac10a0648a10 - optee/optee_test/host/xtest/gp/patches/0015-Enable-compatibility-with-TEE-Internal-Core-API-v1.1.patch 93fe519236e63a82aec4fa2e267aa9c10a9cf3e2 - optee/optee_test/host/xtest/gp/patches/0007-TTAs-revert-to-v1.1-types.patch cc1ccad0b05569188be42a4e6fad9069b9b44d05 - optee/optee_test/host/xtest/gp/patches/0011-TEE_Crypto_API.xml.patch aa6291df45558c38403e3272c86920d0441aace1 - optee/optee_test/host/xtest/include/uapi/linux/arm_ffa_user.h ca513a618e76b7425f4f1350e90c7b74d4778eac - optee/optee_test/cert/my.crt 4c8bd2753f58de91b618d71902216b93834e1b18 - optee/optee_test/cert/ca.key 1f75eacaea5baa5f8ecd35d3c8df7e746c3f73a9 - optee/optee_test/cert/mid.srl 5870a0a431a6e7fd1fb251ada8f25d58c79a762a - optee/optee_test/cert/mid.csr f11ba7468488761597018fef555faaa8dcf0049f - optee/optee_test/cert/ca.crt cf7626a2e6fdd3e5cd2455117e6ff59e38cc3a99 - optee/optee_test/cert/mid.key c858311b53e86391299c5bc0c30a39801b3893a3 - optee/optee_test/cert/mid.ext 6f108292e83a3a3555b56add6fba6bfc75bb1d03 - optee/optee_test/cert/my.key 89bb7582daae987e60e094aebfd5b2b073e9ac62 - optee/optee_test/cert/my.conf 93503a34df30013f6f47e50cde65662d3e5d3a8c - optee/optee_test/cert/mid.conf 6b932b1ab7b3565ddb4557b31b13ff823577f997 - optee/optee_test/cert/my.csr 9162a5682d5d26b3df6021cc646498709aadc3e9 - optee/optee_test/cert/ca.srl c1c1370410a6251da1f2a65d4bb6799b6695ae46 - optee/optee_test/cert/mid.crt d9a4193c1df764fc72c7e49efeeb550f84c6dcb0 - optee/optee_test/ta/identity_subkey2.bin 8890459880f4ef0eb20f8a28b727540e789f07a3 - optee/optee_test/ta/identity_subkey2.pem 5d45a78f116ff6a6a5ce6227b1dd705d86a1a640 - optee/optee_test/ta/mid_level_subkey.pem 787a4239906f6e69dc5f12f7eb194950ab92fbdd - optee/optee_test/ta/Makefile 2f0deec19c000366d2fd6d627f9b4363213eef7a - optee/optee_test/ta/mid_level_subkey.bin 494d296fe7e6b7bc0f500a343c6a33cf9f0b05a3 - optee/optee_test/ta/top_level_subkey.bin 525fc4d0105b2261ed118a2d96d2cbf71cba2432 - optee/optee_test/ta/top_level_subkey.pem c16239ae81d65b85bdbf88f1ec1695ce06a10c24 - optee/optee_test/ta/aes_perf/ta_entry.c 571347fdcd744e2ab03261542891ebb469e61c85 - optee/optee_test/ta/aes_perf/Makefile 7fbb1b605782db00da42f6acd94c45b8535df785 - optee/optee_test/ta/aes_perf/ta_aes_perf.c 837e306e61195565be0391ea2ee9c24557c82908 - optee/optee_test/ta/aes_perf/include/user_ta_header_defines.h 3367296a9f889d9d13d77d03830ca17f9c6786db - optee/optee_test/ta/aes_perf/include/ta_aes_perf_priv.h 24d404e8f61876d1768f09f4d5f698c2fba3fddd - optee/optee_test/ta/aes_perf/include/ta_aes_perf.h dfa325b63f0b17c8ef3c8e1e055e4f8dc2135812 - optee/optee_test/ta/storage_benchmark/benchmark.c 126f0a0f43f2045ed64ac151420ff2750039cae6 - optee/optee_test/ta/storage_benchmark/ta_entry.c a7891e77ba72a13303bee70e3469d5b66c4dd0ff - optee/optee_test/ta/storage_benchmark/Makefile 350b57d8d13e85db59890347995fb8b25902941d - optee/optee_test/ta/storage_benchmark/include/storage_benchmark.h e69f771764df6d0ccfead0a6b563545f3f43b159 - optee/optee_test/ta/storage_benchmark/include/user_ta_header_defines.h 44317f3ee1e0f27bc5889d02e634bcddc250334a - optee/optee_test/ta/storage_benchmark/include/ta_storage_benchmark.h 63727dbe77411a56de4384f2647ac604df1bb77e - optee/optee_test/ta/sims_keepalive/ta_entry.c 3e93b929b783566f5933da6daf3bf178b60f0ac9 - optee/optee_test/ta/sims_keepalive/Makefile 17584ab846d09d2e11a0c62ee9c12f7eb00a89f2 - optee/optee_test/ta/sims_keepalive/ta_sims_keepalive.c 8b0caca8445e731ff595dca61af1768b26fc70df - optee/optee_test/ta/sims_keepalive/include/user_ta_header_defines.h 1b55cdb55165cb46dd80757553d9aab34a61dcd3 - optee/optee_test/ta/sims_keepalive/include/ta_sims_keepalive_test.h 3762c8d8188b6fd5c0e0216aa0dfbc1a81c33bd4 - optee/optee_test/ta/sdp_basic/Makefile 03a7ec19dd525347d073d1ef9887d1c32e2ec843 - optee/optee_test/ta/sdp_basic/ta_sdp_basic.c a0178fe3ab1e1cd9204c5868dfb36eed00a7d800 - optee/optee_test/ta/sdp_basic/include/ta_sdp_basic.h 9123b67fb31c5aa32dc2d54b9a1d2dcff27b3996 - optee/optee_test/ta/sdp_basic/include/user_ta_header_defines.h b33588442f2691e00ae34677fee3503279ec4251 - optee/optee_test/ta/concurrent/ta_entry.c 403faf3efbd2a187981acd30a58067dcb43d4d2f - optee/optee_test/ta/concurrent/Makefile b203b24b6fb092d32555949aece3d104a945d314 - optee/optee_test/ta/concurrent/include/user_ta_header_defines.h 81d9fc2603da64f6aca629d4c1f6152ce40f4299 - optee/optee_test/ta/concurrent/include/ta_concurrent.h 3231e66bc961e72de9759c2d801cf7e081611183 - optee/optee_test/ta/large/ta_entry.c 5558acac0905fc8f55ec7451c6cafff4654c532c - optee/optee_test/ta/large/Makefile 78c0f90194587f8ec4696ed9937eab82bd2d6102 - optee/optee_test/ta/large/include/ta_large.h 04b692b46b7c145c2fe975bb20250626d9e5680e - optee/optee_test/ta/large/include/user_ta_header_defines.h b0992bc9d242a926b54b8162b36f7f219c278624 - optee/optee_test/ta/os_test_lib/os_test_lib.c 192ebe9f6d76a6b9d3938a69c72663ef7b627fff - optee/optee_test/ta/os_test_lib/Makefile e0089857c48d5c57869ad4d411a71a2a3ba33f80 - optee/optee_test/ta/os_test_lib/os_test_lib_cxx.cpp e868bceb0a3e38d9c81f3fece9efc1ced6e9b1b9 - optee/optee_test/ta/os_test_lib/include/os_test_lib.h fd20f8c7b48682f3cb154209d193c38ef5fa8afa - optee/optee_test/ta/storage2/ta_entry.c 3777dde2c0aee5f993ddf5f6e2899d578554736d - optee/optee_test/ta/storage2/Makefile b5ccb3b112baffad3e3afb89d72d7cc8a922ce1c - optee/optee_test/ta/storage2/storage.c 1c8f590037f4f9235325a760a6e10589ac820492 - optee/optee_test/ta/storage2/include/user_ta_header_defines.h 8ace73b1298eb7b4679a5f6a93533d147c6165f0 - optee/optee_test/ta/storage2/include/storage.h 739bf20897d248851d4e26908cc4a58f70ff9e98 - optee/optee_test/ta/os_test/ta_entry.c c845f1bef062d33dd7e59d0647155b05ef5ed6ac - optee/optee_test/ta/os_test/attestation.c a4ae385c460bad98c3f1bb74e4cd6d78a3d1c569 - optee/optee_test/ta/os_test/cxx_tests.cpp 0821f97bb6d0e672f229f163d91a44db3b3cfc21 - optee/optee_test/ta/os_test/pauth_a64.S 0455da7d426f2d9c91e8d1f0ceedcbcdc25b7e63 - optee/optee_test/ta/os_test/cxx_tests.h efba276afd39d7103c04a55a36060b6da949183b - optee/optee_test/ta/os_test/os_test.c 81b48e32f421e3809c799370e7d5a84be82e4007 - optee/optee_test/ta/os_test/test_float_subj.c e00637d3dc4e177f4693a591711c655a84f82c6e - optee/optee_test/ta/os_test/Makefile 30c95077d893a72f6dd6f25698b9e3c4c90c7173 - optee/optee_test/ta/os_test/ta_arm_pauth.c f99ecd7a7d1466b6ae095553f19b144a3b5e05a6 - optee/optee_test/ta/os_test/cxx_tests_c.c 4b24fec7bb0779f54df830b2accd4589c58ee714 - optee/optee_test/ta/os_test/test_float_subj.h 7c34f62620b2c3cf1e435dc2f06b5bc695a0ffca - optee/optee_test/ta/os_test/init.c 9f19100db2cc1610f815fafd087f583d78880d0d - optee/optee_test/ta/os_test/include/ta_os_test.h c250edae8e50b81ddc7f2d82b74533be8ce36484 - optee/optee_test/ta/os_test/include/user_ta_header_defines.h 9a31e7f47747984b55fcfd8f87f8c3eda3903943 - optee/optee_test/ta/os_test/include/tb_asserts.h 263c19c932534cb04ff5681cf3331201d72711ec - optee/optee_test/ta/os_test/include/tb_macros.h ef669e3a5af86a9d7433680efe47e7475ebae840 - optee/optee_test/ta/os_test/include/testframework.h dfa926eae1baeaa723c73c36a5a87108a941f0a8 - optee/optee_test/ta/os_test/include/os_test.h c0f2b4917d2e7e2c64767ce20c51277d030da95e - optee/optee_test/ta/os_test/include/init.h 615513981a90fabad2bd36d67b4ece7b3e63bfe6 - optee/optee_test/ta/supp_plugin/ta_entry.c e3deb7bd3c13099679c0218b2daabc17547fb2aa - optee/optee_test/ta/supp_plugin/Makefile 97d8481ac3b8dd32d148d69acc3da07308fb759a - optee/optee_test/ta/supp_plugin/include/user_ta_header_defines.h a6d7b87593d95249d1adf41e1ed2855be8557092 - optee/optee_test/ta/supp_plugin/include/ta_supp_plugin.h f041af378514b0adb83e13683c439bdfda633a38 - optee/optee_test/ta/tpm_log_test/ta_entry.c 159ab9161f614e0e78c7ed8ad589b1da7dc49313 - optee/optee_test/ta/tpm_log_test/Makefile 05d9586c179dfa463023108f57186c397f67b168 - optee/optee_test/ta/tpm_log_test/include/ta_tpm_log.h 15979122b263375291e30ed248816c707e51aa9d - optee/optee_test/ta/tpm_log_test/include/user_ta_header_defines.h 071de3ab826aea3082b54036a436e42d20e5e829 - optee/optee_test/ta/tpm_log_test/include/ta_tpm_log_test.h 63727dbe77411a56de4384f2647ac604df1bb77e - optee/optee_test/ta/miss/ta_entry.c 6902d41cad5e1a7fdd792070ee6fe09543fd0a36 - optee/optee_test/ta/miss/Makefile 17584ab846d09d2e11a0c62ee9c12f7eb00a89f2 - optee/optee_test/ta/miss/ta_miss.c 7577f16d52d892d26d2aba97100c391696f1b4e0 - optee/optee_test/ta/miss/include/user_ta_header_defines.h e8cc80687d4a1d454c124c0288798e280142a723 - optee/optee_test/ta/miss/include/ta_miss_test.h 246ca7646c82ccb61f14a0b439ec943d8850f0dd - optee/optee_test/ta/storage/ta_entry.c a29dec4b78281324f1e479a7648b636feef1d163 - optee/optee_test/ta/storage/Makefile 9fdefd261cbb4dfe3fcdfb05749fd3acaa8383bb - optee/optee_test/ta/storage/storage.c cbcf995c4fce7f48869248f9f3bf912195d4873e - optee/optee_test/ta/storage/include/user_ta_header_defines.h b958d8b7c770808b61bfb420a9d39473b275e4c4 - optee/optee_test/ta/storage/include/storage.h 96b12ede29af7df11c0b54a3d3924599f9ad0de4 - optee/optee_test/ta/enc_fs/include/enc_fs_key_manager_test.h e1b35b65fffd182965ab59d513da17f3bc2cb637 - optee/optee_test/ta/socket/ta_entry.c dfc1e1eb35732695271ed55f42d20a4f3d65dd85 - optee/optee_test/ta/socket/Makefile 7caf8e51e601aad92bfa2080fd1d462af34a690f - optee/optee_test/ta/socket/include/user_ta_header_defines.h 60c71c4fd9746b52eff3180768cadfb42246ad63 - optee/optee_test/ta/socket/include/ta_socket.h a2d1207a964e7c839176e0c9beb333de1aa5114d - optee/optee_test/ta/sims/ta_entry.c b27b844ff53c4ce9ea4b37becfc73759661121c9 - optee/optee_test/ta/sims/ta_sims.c 62093428f73279ad6337e6b83de79cdc9638aa07 - optee/optee_test/ta/sims/Makefile d89af8095b36e083626767c864548995a05f5be0 - optee/optee_test/ta/sims/include/user_ta_header_defines.h 11789923a6ea66b45d579f62db7b637f475896b5 - optee/optee_test/ta/sims/include/ta_sims_test.h 3c47004c9fc79085a49889e5e0a2f74eb9672619 - optee/optee_test/ta/sims/include/ta_sims.h 3a18196418d2722e402a8427f7c603fbb0001208 - optee/optee_test/ta/hash_perf/ta_entry.c c55f5d16d5adcee00938fe1809a49f80f8b4466c - optee/optee_test/ta/hash_perf/Makefile fe7cfa7b09ca126fe985f184990efd82c5364016 - optee/optee_test/ta/hash_perf/ta_hash_perf.c 9e4cddd8c6ca6c49ccf2a9c071940659a8404666 - optee/optee_test/ta/hash_perf/include/user_ta_header_defines.h 30630325b3b69827882db59d7c22880109f1aed7 - optee/optee_test/ta/hash_perf/include/ta_hash_perf.h 3ab83f366683236b9a32ce8c776846709795c9fd - optee/optee_test/ta/hash_perf/include/ta_hash_perf_priv.h 0205269ec12a07945fa15e1f01beacd396129c02 - optee/optee_test/ta/crypt/ta_entry.c a35bf9387750436613dd75a04109a0ac26abb4ad - optee/optee_test/ta/crypt/mbedtls_taf.c 2f8d16642c23418d96eae0799cdbb319adae9bd2 - optee/optee_test/ta/crypt/aes_taf.c 6d536756fbdc5623379b5c8c68b3383c6c3c7535 - optee/optee_test/ta/crypt/aes_impl.c 707f95e800674bd769a22f4b05b0f86bde9bdda0 - optee/optee_test/ta/crypt/Makefile f22bc5e3e7d42fae8b515ed89e6d52e14853097d - optee/optee_test/ta/crypt/arith_taf.c cda695cd368148125b67d4b5049b4b5e44f19d4d - optee/optee_test/ta/crypt/sha2_taf.c 71541fecba370d8d5d888ff889cc55a649e0f6e3 - optee/optee_test/ta/crypt/handle.c 0f5728bb87da64faea76a4d60859ffc6ee7cfb0e - optee/optee_test/ta/crypt/seed_rng_taf.c 62f575dd691dc4df07cd85b6aaf381bb1fa129df - optee/optee_test/ta/crypt/handle.h ae237aa24606ab8442252be914264ebc32acb3f1 - optee/optee_test/ta/crypt/derive_key_taf.c 89299c5c290be38d0509309892bd9bf67946a552 - optee/optee_test/ta/crypt/sha2_impl.c 08792d69cd8404668362c47a42015e3ed15a03e2 - optee/optee_test/ta/crypt/cryp_taf.c 98b131e0650e8848c202b367de6afd9713234b23 - optee/optee_test/ta/crypt/include/cryp_taf.h 81c28b5d39b57c60583003aa3b19d4e9355be3e8 - optee/optee_test/ta/crypt/include/aes_taf.h 65726ede28ff3980980f0786f73da00bf00f7adf - optee/optee_test/ta/crypt/include/aes_impl.h e39b6697e3f099db9e9210630f403279d821b01d - optee/optee_test/ta/crypt/include/user_ta_header_defines.h f922975017d8e69cf55d924ad3475f48207c778c - optee/optee_test/ta/crypt/include/sha2_taf.h dedb18c14d2c13ecb2666beff2d43a1c6f2b1f4c - optee/optee_test/ta/crypt/include/derive_key_taf.h bece95c11da1deff583de5cccb73aeb047b13bb3 - optee/optee_test/ta/crypt/include/seed_rng_taf.h 971b7e4384dfd449056d2d98600938baaa13b45c - optee/optee_test/ta/crypt/include/arith_taf.h 751a9eda488bdee96dd4666819f86792eb94e63c - optee/optee_test/ta/crypt/include/mbedtls_taf.h 59bb92661052957ededa8bf444418db0f792e5df - optee/optee_test/ta/crypt/include/sha2_impl.h d6094f43aff3a5e99b1b4916e6f0616f4b506c4e - optee/optee_test/ta/crypt/include/ta_crypt.h 34655a75cdbf9b1cf1a0f475a835630aa77d76ad - optee/optee_test/ta/os_test_lib_dl/os_test_lib_dl.c 0b8f95e1cc815a73f1913f8b1cd1199b86afd777 - optee/optee_test/ta/os_test_lib_dl/Makefile 9d8c78ff226d9cd3e8f8be315142adc0bdc791d5 - optee/optee_test/ta/os_test_lib_dl/os_test_lib_dl_cxx.cpp 36e93c9c976420202d3962d3af744a06481e4bda - optee/optee_test/ta/os_test_lib_dl/include/os_test_lib_dl.h 28e50e4d884a51351b0454dcf8971ea8619becb2 - optee/optee_test/ta/rpc_test/ta_entry.c db39d7c16208c8b18547c18b524c4d4d8d8533a6 - optee/optee_test/ta/rpc_test/Makefile 515cd2121fffeb7e284eb41a47cd39f68e8caee3 - optee/optee_test/ta/rpc_test/ta_rpc.c bb5b31def49e12cb5ca13946631064fdab7f3ce1 - optee/optee_test/ta/rpc_test/include/user_ta_header_defines.h daf6f0380173f9c72cb5ab411c7e145635102403 - optee/optee_test/ta/rpc_test/include/ta_rpc.h 5a06508a48d77c9bc4d4483f2c1064bc11547f17 - optee/optee_test/ta/rpc_test/include/ta_rpc_test.h 729fae7d04cb0ca43a757f92763e4accc4b12b47 - optee/optee_test/ta/include/ta_storage.h e98d28dd7d955c5f1430b86d1f9fa9a293f2c6a5 - optee/optee_test/ta/subkey1/ta_entry.c ab190ed1cbd92987955bd1b18cf1125760e00235 - optee/optee_test/ta/subkey1/Makefile fccce5046748bb0a2c4bf866d2ee4099789327e9 - optee/optee_test/ta/subkey1/include/ta_subkey1.h 3ef18fee5ed3f12595bcae5cd670e9b614bddccb - optee/optee_test/ta/subkey1/include/user_ta_header_defines.h 327bcd861d17179ed6eec837ae40d93f6d4d5171 - optee/optee_test/ta/create_fail_test/ta_entry.c 969daad84d451c2beaaeb0205d361045b135c899 - optee/optee_test/ta/create_fail_test/Makefile 28f22d74fc72b507d9530a7788812714f4ccd2be - optee/optee_test/ta/create_fail_test/include/user_ta_header_defines.h f8ff5608bd441c5bb14ba4e0d1ac825036c0be26 - optee/optee_test/ta/create_fail_test/include/ta_create_fail_test.h c5741796e6b99090e6fd99dc03a6bbcfe6871028 - optee/optee_test/ta/concurrent_large/ta_entry.c 305e7a10ae0489f83dfe773f06b47ad314bb9771 - optee/optee_test/ta/concurrent_large/Makefile 51f374f9df753de95e0ee8a082c29395bed8625a - optee/optee_test/ta/concurrent_large/include/ta_concurrent_large.h 6fc98a616100591a9ba17fe01d8cd7f30c449420 - optee/optee_test/ta/concurrent_large/include/user_ta_header_defines.h 3484bf8a9bd48d0fd2c66b682574dcbd80ae59e7 - optee/optee_test/ta/subkey2/ta_entry.c 56e682b335cbdbb4b053f31838a28d596ea0dbf5 - optee/optee_test/ta/subkey2/Makefile d1217850bdabdc5c5f402556a4dd76a32af19d03 - optee/optee_test/ta/subkey2/include/user_ta_header_defines.h 786d2761de772f9af4885b058126e8596a16e194 - optee/optee_test/ta/subkey2/include/ta_subkey2.h 9752d870fbaca8ae7c1554096be6f228b5a0efaf - optee/optee_test/ta/bti_test/ta_entry.c 19e490a77411c75a67b54eb0684edc9dc35f7192 - optee/optee_test/ta/bti_test/Makefile 02a75c4818fde432ee44ba7d161b5c27851a796b - optee/optee_test/ta/bti_test/bti_stubs_a64.S a59733e35df2f166b33f45d74ffcad1404144624 - optee/optee_test/ta/bti_test/ta_arm_bti.c 7f829607eda29dcb8ef45bfba360ed98db860871 - optee/optee_test/ta/bti_test/include/ta_arm_bti_priv.h 3d48258f0e002fce82e638e430b603a76c11d113 - optee/optee_test/ta/bti_test/include/user_ta_header_defines.h a6569f27e231e4466e5b7f08f63a13626cf26810 - optee/optee_test/ta/bti_test/include/ta_arm_bti.h Change-Id: Icb2675cfb16e05a69d4805505d2324ad63cc6bc0
This commit is contained in:
2899
commitFile.txt
Normal file
2899
commitFile.txt
Normal file
File diff suppressed because it is too large
Load Diff
58
nvcommon_build.sh
Executable file
58
nvcommon_build.sh
Executable file
@@ -0,0 +1,58 @@
|
|||||||
|
# SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||||
|
#
|
||||||
|
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||||
|
# property and proprietary rights in and to this material, related
|
||||||
|
# documentation and any modifications thereto. Any use, reproduction,
|
||||||
|
# disclosure or distribution of this material and related documentation
|
||||||
|
# without an express license agreement from NVIDIA CORPORATION or
|
||||||
|
# its affiliates is strictly prohibited.
|
||||||
|
|
||||||
|
# shellcheck disable=SC2148
|
||||||
|
|
||||||
|
# Function to check if variable is defined.
|
||||||
|
function check_vars {
|
||||||
|
# shellcheck disable=SC2124
|
||||||
|
variables=${@}
|
||||||
|
for variable in ${variables} ; do
|
||||||
|
if [ -z "${!variable}" ]; then
|
||||||
|
echo "Error: Env variable ${variable} is not set!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to check build environment
|
||||||
|
function check_env_common {
|
||||||
|
if [ "${IS_CROSS_COMPILATION}" -eq 1 ]; then
|
||||||
|
check_vars "CROSS_COMPILE_AARCH64_PATH"
|
||||||
|
CROSS_COMPILE_AARCH64="${CROSS_COMPILE_AARCH64:-${CROSS_COMPILE_AARCH64_PATH}/bin/aarch64-buildroot-linux-gnu-}"
|
||||||
|
if [ ! -f "${CROSS_COMPILE_AARCH64}gcc" ]; then
|
||||||
|
echo "Error: Path ${CROSS_COMPILE_AARCH64}gcc does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# shellcheck disable=SC2046,SC2235
|
||||||
|
if [ "${MAKE_BIN}" != "make" ] && \
|
||||||
|
( [ ! -f "${MAKE_BIN}" ] || \
|
||||||
|
[ ! -f $(basename "${MAKE_BIN}") ] ); then
|
||||||
|
echo "Error: ${MAKE_BIN} does not exist !!"
|
||||||
|
# shellcheck disable=SC2140
|
||||||
|
echo "Set MAKE_BIN env variable to "make" binary"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
NPROC=$(nproc)
|
||||||
|
MAKE_BIN="${MAKE_BIN:-make}"
|
||||||
|
BUILD_DIR="${BUILD_DIR:-$(pwd)/build_nv_sources}"
|
||||||
|
|
||||||
|
MACHINE=$(uname -m)
|
||||||
|
|
||||||
|
IS_CROSS_COMPILATION=0
|
||||||
|
if [[ "${MACHINE}" =~ "x86" ]]; then
|
||||||
|
IS_CROSS_COMPILATION=1
|
||||||
|
fi
|
||||||
|
check_env_common
|
||||||
139
optee/atf_and_optee_README.txt
Normal file
139
optee/atf_and_optee_README.txt
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
**********************************************************************
|
||||||
|
NVIDIA Jetson Linux (L4T) OP-TEE Package
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Introduction
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
This package contains the necessary files and instructions to build a
|
||||||
|
trusted OS image based on ATF and OP-TEE for these Jetson devices:
|
||||||
|
- Jetson Xavier NX
|
||||||
|
- Jetson AGX Xavier series
|
||||||
|
- Jetson AGX Orin series
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Prerequisites
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Please refer to the link below to install build prerequisites, e.g.
|
||||||
|
python3-pycryptodome and python3-pyelftools, in your build machine.
|
||||||
|
|
||||||
|
https://optee.readthedocs.io/en/latest/building/prerequisites.html
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
The python cryptography issue
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
When building OP-TEE sources, you may see a python error in sign_encrypt.py like:
|
||||||
|
"TypeError: public_key() missing 1 required positional argument: 'backend'"
|
||||||
|
|
||||||
|
This is because the "cryptography" python package in your build system is too old.
|
||||||
|
Running the following commands can fix the issue:
|
||||||
|
|
||||||
|
sudo apt remove python3-cryptography
|
||||||
|
pip3 install cryptography
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Placeholders used in this document
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
This document uses a placeholder, "<platform>", to indicate Jetson platforms.
|
||||||
|
Its possible values are:
|
||||||
|
- 194
|
||||||
|
- 234
|
||||||
|
Choose the platform value according to your Jetson board to build different
|
||||||
|
trusted OS images and DTBs.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Toolchain
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Download the toolchain from Jetson release page according to your L4T version:
|
||||||
|
|
||||||
|
https://developer.nvidia.com/embedded/jetson-linux-archive
|
||||||
|
|
||||||
|
Set environment variable CROSS_COMPILE_AARCH64_PATH to point to the aarch64
|
||||||
|
toolchain. For example, if the aarch64 toolchain directory is
|
||||||
|
/toolchain/aarch64--glibc--stable-2022.03-1/, then set
|
||||||
|
the CROSS_COMPILE_AARCH64_PATH with the command below.
|
||||||
|
|
||||||
|
export CROSS_COMPILE_AARCH64_PATH=/toolchain/aarch64--glibc--stable-2022.03-1
|
||||||
|
|
||||||
|
Then set environment variable CROSS_COMPILE_AARCH64 with the command
|
||||||
|
below.
|
||||||
|
|
||||||
|
export CROSS_COMPILE_AARCH64=/toolchain/aarch64--glibc--stable-2022.03-1/bin/aarch64-buildroot-linux-gnu-
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
UEFI StMM image
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
A UEFI StMM image is required when building OP-TEE. The image is usually at:
|
||||||
|
|
||||||
|
For the Jetson AGX Xavier series and the Jetson Xavier NX:
|
||||||
|
<Linux_for_Tegra>/bootloader/standalonemm_optee_t194.bin
|
||||||
|
|
||||||
|
For the Jetson AGX Orin series:
|
||||||
|
<Linux_for_Tegra>/bootloader/standalonemm_optee_t234.bin
|
||||||
|
|
||||||
|
Set the environment variable "UEFI_STMM_PATH" to let the OP-TEE build script
|
||||||
|
know where the image is:
|
||||||
|
|
||||||
|
export UEFI_STMM_PATH=<StMM image path>
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Building the OP-TEE source code
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Execute this command to build the OP-TEE source package:
|
||||||
|
|
||||||
|
./optee_src_build.sh -p t<platform>
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Building the OP-TEE dtb
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Execute this command to build OP-TEE dtb:
|
||||||
|
|
||||||
|
dtc -I dts -O dtb -o ./optee/tegra<platform>-optee.dtb ./optee/tegra<platform>-optee.dts
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Building the ATF source code with OP-TEE SPD
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
1. Extract the ATF source package.
|
||||||
|
mkdir atf_build
|
||||||
|
tar -I lbzip2 -C atf_build -xpf atf_src.tbz2
|
||||||
|
|
||||||
|
2. Build the ATF source code:
|
||||||
|
cd atf_build/arm-trusted-firmware
|
||||||
|
make BUILD_BASE=./build \
|
||||||
|
CROSS_COMPILE="${CROSS_COMPILE_AARCH64}" \
|
||||||
|
DEBUG=0 LOG_LEVEL=20 PLAT=tegra SPD=opteed TARGET_SOC=t<platform> V=0
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Generating the tos.img with ATF and OP-TEE images
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
1. Get gen_tos_part_img.py. It's usually in the directory
|
||||||
|
<Linux_for_Tegra>/nv_tegra/tos-scripts/ of BSP package.
|
||||||
|
|
||||||
|
2. Generate the tos.img with the commands:
|
||||||
|
./gen_tos_part_img.py \
|
||||||
|
--monitor ./atf_build/arm-trusted-firmware/build/tegra/t<platform>/release/bl31.bin \
|
||||||
|
--os ./optee/build/t<platform>/core/tee-raw.bin \
|
||||||
|
--dtb ./optee/tegra<platform>-optee.dtb \
|
||||||
|
--tostype optee \
|
||||||
|
./tos.img
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Verifying the Image
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
To verify the image:
|
||||||
|
1. Replace the default TOS image file with the newly generated TOS
|
||||||
|
image. The default TOS image file is located at:
|
||||||
|
<Linux_for_Tegra>/bootloader/tos-optee_t<platform>.img
|
||||||
|
|
||||||
|
2. Perform either of these tasks:
|
||||||
|
- Flash the system as normal.
|
||||||
|
This is useful for flashing a new system or replacing the
|
||||||
|
entire operating system.
|
||||||
|
- Re-flash the TOS image using these partition flash commands:
|
||||||
|
sudo ./flash.sh -k <TOS partition name> <your_board_conf_file> mmcblk0p1
|
||||||
|
ex:
|
||||||
|
sudo ./flash.sh -k secure-os jetson-xavier-nx-devkit mmcblk0p1
|
||||||
|
sudo ./flash.sh -k A_secure-os jetson-agx-orin-devkit mmcblk0p1
|
||||||
|
|
||||||
|
3. Copy all the files under ./optee/install/t<platform> to the target.
|
||||||
51
optee/optee_client/.github/workflows/ci.yml
vendored
Normal file
51
optee/optee_client/.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: CI
|
||||||
|
on: [push, pull_request]
|
||||||
|
permissions:
|
||||||
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
jobs:
|
||||||
|
debian:
|
||||||
|
name: build (Debian)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: jforissier/optee_client_ci_debian
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: arm64 with make
|
||||||
|
run: make -j O=out-make-aarch64 CROSS_COMPILE=aarch64-linux-gnu-
|
||||||
|
- name: armhf with make
|
||||||
|
run: make -j O=out-make-armhf CROSS_COMPILE=arm-linux-gnueabihf-
|
||||||
|
- name: arm64 with cmake
|
||||||
|
run: |
|
||||||
|
set -e -v
|
||||||
|
mkdir out-cmake-aarch64 && cd out-cmake-aarch64
|
||||||
|
PKG_CONFIG=aarch64-linux-gnu-pkg-config cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc
|
||||||
|
make -j
|
||||||
|
- name: armhf with cmake
|
||||||
|
run: |
|
||||||
|
set -e -v
|
||||||
|
mkdir out-cmake-armhf && cd out-cmake-armhf
|
||||||
|
PKG_CONFIG=arm-linux-gnueabihf-pkg-config cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc
|
||||||
|
make -j
|
||||||
|
ubuntu:
|
||||||
|
name: build (Ubuntu)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: jforissier/optee_client_ci_ubuntu
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: arm64 with make
|
||||||
|
run: make -j O=out-make-aarch64 CROSS_COMPILE=aarch64-linux-gnu-
|
||||||
|
- name: armhf with make
|
||||||
|
run: make -j O=out-make-armhf CROSS_COMPILE=arm-linux-gnueabihf-
|
||||||
|
- name: arm64 with cmake
|
||||||
|
run: |
|
||||||
|
set -e -v
|
||||||
|
mkdir out-cmake-aarch64 && cd out-cmake-aarch64
|
||||||
|
PKG_CONFIG=aarch64-linux-gnu-pkg-config cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc
|
||||||
|
make -j
|
||||||
|
- name: armhf with cmake
|
||||||
|
run: |
|
||||||
|
set -e -v
|
||||||
|
mkdir out-cmake-armhf && cd out-cmake-armhf
|
||||||
|
PKG_CONFIG=arm-linux-gnueabihf-pkg-config cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc
|
||||||
|
make -j
|
||||||
27
optee/optee_client/.github/workflows/stales.yml
vendored
Normal file
27
optee/optee_client/.github/workflows/stales.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: 'Close stale issues and pull requests with no recent activity'
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "15 00 * * *"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v4.1.0
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
stale-issue-message: 'This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.'
|
||||||
|
stale-pr-message: 'This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.'
|
||||||
|
stale-issue-label: Stale
|
||||||
|
stale-pr-label: Stale
|
||||||
|
exempt-issue-labels: bug,enhancement
|
||||||
|
exempt-pr-labels: bug,enhancement
|
||||||
|
days-before-stale: 30
|
||||||
|
days-before-close: 5
|
||||||
|
remove-stale-when-updated: true
|
||||||
|
remove-issue-stale-when-updated: true
|
||||||
|
remove-pr-stale-when-updated: true
|
||||||
107
optee/optee_client/Android.mk
Normal file
107
optee/optee_client/Android.mk
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
################################################################################
|
||||||
|
# Android optee-client, libckteec and optee-supplicant makefile #
|
||||||
|
################################################################################
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
# 3 (debug) is too noisy
|
||||||
|
CFG_TEE_CLIENT_LOG_LEVEL ?= 2
|
||||||
|
CFG_TEE_SUPP_LOG_LEVEL ?= 2
|
||||||
|
|
||||||
|
# Define Android-specific configuration before including config.mk
|
||||||
|
CFG_TEE_CLIENT_LOAD_PATH ?= /vendor/lib
|
||||||
|
TEEC_TEST_LOAD_PATH ?= /data/vendor/tee
|
||||||
|
CFG_TEE_FS_PARENT_PATH ?= /data/vendor/tee
|
||||||
|
CFG_TEE_SUPP_PLUGINS ?= y
|
||||||
|
ifneq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),)
|
||||||
|
CFG_TEE_PLUGIN_LOAD_PATH ?= /vendor/lib64/tee-supplicant/plugins/
|
||||||
|
else
|
||||||
|
CFG_TEE_PLUGIN_LOAD_PATH ?= /vendor/lib/tee-supplicant/plugins/
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(info CFG_TEE_PLUGIN_LOAD_PATH = ${CFG_TEE_PLUGIN_LOAD_PATH})
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Include optee-client common config and flags #
|
||||||
|
################################################################################
|
||||||
|
include $(LOCAL_PATH)/config.mk
|
||||||
|
include $(LOCAL_PATH)/android_flags.mk
|
||||||
|
|
||||||
|
optee_CFLAGS = $(CFLAGS)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build libteec.so - TEE (Trusted Execution Environment) shared library #
|
||||||
|
################################################################################
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_CFLAGS += $(optee_CFLAGS)
|
||||||
|
|
||||||
|
ifneq ($(CFG_TEE_CLIENT_LOG_FILE),)
|
||||||
|
LOCAL_CFLAGS += -DTEEC_LOG_FILE=\"$(CFG_TEE_CLIENT_LOG_FILE)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -DDEBUGLEVEL_$(CFG_TEE_CLIENT_LOG_LEVEL)
|
||||||
|
LOCAL_CFLAGS += -DBINARY_PREFIX=\"TEEC\"
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := libteec/src/tee_client_api.c \
|
||||||
|
libteec/src/teec_trace.c
|
||||||
|
ifeq ($(CFG_TEE_BENCHMARK),y)
|
||||||
|
LOCAL_CFLAGS += -DCFG_TEE_BENCHMARK
|
||||||
|
LOCAL_SRC_FILES += teec_benchmark.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/public \
|
||||||
|
$(LOCAL_PATH)/libteec/include \
|
||||||
|
|
||||||
|
LOCAL_PRELINK_MODULE := false
|
||||||
|
LOCAL_MODULE := libteec
|
||||||
|
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
|
||||||
|
# Build the 32-bit and 64-bit versions.
|
||||||
|
LOCAL_MULTILIB := both
|
||||||
|
LOCAL_MODULE_TARGET_ARCH := arm arm64
|
||||||
|
|
||||||
|
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/public
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build libckteec.so #
|
||||||
|
################################################################################
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += $(optee_CFLAGS)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := libckteec/src/pkcs11_api.c \
|
||||||
|
libckteec/src/ck_debug.c \
|
||||||
|
libckteec/src/ck_helpers.c \
|
||||||
|
libckteec/src/invoke_ta.c \
|
||||||
|
libckteec/src/pkcs11_processing.c \
|
||||||
|
libckteec/src/pkcs11_token.c \
|
||||||
|
libckteec/src/serializer.c \
|
||||||
|
libckteec/src/serialize_ck.c
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/public \
|
||||||
|
$(LOCAL_PATH)/libckteec/include
|
||||||
|
|
||||||
|
LOCAL_SHARED_LIBRARIES := libteec
|
||||||
|
|
||||||
|
LOCAL_PRELINK_MODULE := false
|
||||||
|
LOCAL_MODULE := libckteec
|
||||||
|
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
|
||||||
|
# Build the 32-bit and 64-bit versions.
|
||||||
|
LOCAL_MULTILIB := both
|
||||||
|
LOCAL_MODULE_TARGET_ARCH := arm arm64
|
||||||
|
|
||||||
|
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/libckteec/include
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build TEE Supplicant #
|
||||||
|
################################################################################
|
||||||
|
include $(LOCAL_PATH)/tee-supplicant/tee_supplicant_android.mk
|
||||||
50
optee/optee_client/CMakeLists.txt
Normal file
50
optee/optee_client/CMakeLists.txt
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
cmake_minimum_required (VERSION 3.4)
|
||||||
|
project (optee_client C)
|
||||||
|
|
||||||
|
# https://cmake.org/Wiki/CMake_Useful_Variables
|
||||||
|
set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
|
||||||
|
|
||||||
|
option (CFG_WERROR "Build with -Werror" TRUE)
|
||||||
|
option (WITH_TEEACL "Build libteeacl" TRUE)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Compiler flags:
|
||||||
|
# We want to use the same flags in the entire optee_client git
|
||||||
|
################################################################################
|
||||||
|
add_compile_options (
|
||||||
|
-Wall -Wbad-function-cast -Wcast-align
|
||||||
|
-Werror-implicit-function-declaration -Wextra
|
||||||
|
-Wfloat-equal -Wformat-nonliteral -Wformat-security
|
||||||
|
-Wformat=2 -Winit-self -Wmissing-declarations
|
||||||
|
-Wmissing-format-attribute -Wmissing-include-dirs
|
||||||
|
-Wmissing-noreturn -Wmissing-prototypes -Wnested-externs
|
||||||
|
-Wpointer-arith -Wshadow -Wstrict-prototypes
|
||||||
|
-Wswitch-default -Wwrite-strings -fPIC
|
||||||
|
)
|
||||||
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
add_compile_options(
|
||||||
|
-Wunsafe-loop-optimizations
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(CFG_WERROR)
|
||||||
|
add_compile_options(-Werror)
|
||||||
|
endif(CFG_WERROR)
|
||||||
|
|
||||||
|
find_program(CCACHE_FOUND ccache)
|
||||||
|
if(CCACHE_FOUND)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||||
|
endif(CCACHE_FOUND)
|
||||||
|
|
||||||
|
add_subdirectory (libteec)
|
||||||
|
add_subdirectory (tee-supplicant)
|
||||||
|
add_subdirectory (public)
|
||||||
|
add_subdirectory (libckteec)
|
||||||
|
if(WITH_TEEACL)
|
||||||
|
find_package (PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(uuid REQUIRED IMPORTED_TARGET uuid)
|
||||||
|
add_subdirectory (libteeacl)
|
||||||
|
endif(WITH_TEEACL)
|
||||||
|
add_subdirectory (libseteec)
|
||||||
3
optee/optee_client/CMakeToolchain.txt
Normal file
3
optee/optee_client/CMakeToolchain.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
set (CMAKE_SYSTEM_NAME Linux)
|
||||||
|
|
||||||
|
set (CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
27
optee/optee_client/LICENSE
Normal file
27
optee/optee_client/LICENSE
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
Unless it has its own copyright/license embedded in its body, each source file
|
||||||
|
is subject to the following license terms:
|
||||||
|
|
||||||
|
Copyright (c) 2015, Linaro Limited
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
173
optee/optee_client/Makefile
Normal file
173
optee/optee_client/Makefile
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
# Public variables are stored in config.mk
|
||||||
|
include ./config.mk
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# Set Internal Variables #
|
||||||
|
# May be modified to match your setup #
|
||||||
|
#########################################################################
|
||||||
|
ifneq ($(V),1)
|
||||||
|
VPREFIX := @
|
||||||
|
endif
|
||||||
|
export VPREFIX
|
||||||
|
|
||||||
|
EXPORT_DIR ?= $(O)/export
|
||||||
|
DESTDIR ?= $(EXPORT_DIR)
|
||||||
|
SBINDIR ?= /usr/sbin
|
||||||
|
LIBDIR ?= /usr/lib
|
||||||
|
INCLUDEDIR ?= /usr/include
|
||||||
|
sbindir ?= $(SBINDIR)
|
||||||
|
libdir ?= $(LIBDIR)
|
||||||
|
includedir ?= $(INCLUDEDIR)
|
||||||
|
|
||||||
|
WITH_TEEACL ?= 1
|
||||||
|
|
||||||
|
.PHONY: all build build-libteec build-libckteec build-libseteec \
|
||||||
|
build-libteeacl install copy_export clean cscope \
|
||||||
|
clean-cscope \
|
||||||
|
checkpatch-pre-req checkpatch-modified-patch checkpatch-modified-file \
|
||||||
|
checkpatch-last-commit-patch checkpatch-last-commit-file \
|
||||||
|
checkpatch-base-commit-patch checkpatch-base-commit-file \
|
||||||
|
checkpatch-all-files distclean
|
||||||
|
|
||||||
|
all: build install
|
||||||
|
|
||||||
|
build-libteec:
|
||||||
|
@echo "Building libteec.so"
|
||||||
|
@$(MAKE) --directory=libteec --no-print-directory --no-builtin-variables \
|
||||||
|
CFG_TEE_BENCHMARK=$(CFG_TEE_BENCHMARK) CFG_TEE_CLIENT_LOG_LEVEL=$(CFG_TEE_CLIENT_LOG_LEVEL)
|
||||||
|
|
||||||
|
build-tee-supplicant: build-libteec
|
||||||
|
@echo "Building tee-supplicant"
|
||||||
|
$(MAKE) --directory=tee-supplicant --no-print-directory --no-builtin-variables CFG_TEE_SUPP_LOG_LEVEL=$(CFG_TEE_SUPP_LOG_LEVEL)
|
||||||
|
|
||||||
|
build: build-libteec build-tee-supplicant build-libckteec build-libseteec \
|
||||||
|
# Disable libteeacl:
|
||||||
|
# build-libteeacl
|
||||||
|
|
||||||
|
build-libckteec: build-libteec
|
||||||
|
@echo "Building libckteec.so"
|
||||||
|
@$(MAKE) --directory=libckteec --no-print-directory --no-builtin-variables
|
||||||
|
|
||||||
|
build-libseteec: build-libteec
|
||||||
|
@echo "Building libseteec.so"
|
||||||
|
@$(MAKE) --directory=libseteec --no-print-directory --no-builtin-variables
|
||||||
|
|
||||||
|
build-libteeacl:
|
||||||
|
@echo "Building libteeacl.so"
|
||||||
|
@$(MAKE) --directory=libteeacl --no-print-directory --no-builtin-variables
|
||||||
|
|
||||||
|
install: copy_export
|
||||||
|
|
||||||
|
clean: clean-libteec clean-tee-supplicant clean-cscope clean-libckteec \
|
||||||
|
clean-libseteec \
|
||||||
|
# Disable libteeacl:
|
||||||
|
# clean-libteeacl
|
||||||
|
|
||||||
|
clean-libteec:
|
||||||
|
@$(MAKE) --directory=libteec --no-print-directory clean
|
||||||
|
|
||||||
|
clean-tee-supplicant:
|
||||||
|
@$(MAKE) --directory=tee-supplicant --no-print-directory clean
|
||||||
|
|
||||||
|
clean-libckteec:
|
||||||
|
@$(MAKE) --directory=libckteec --no-print-directory clean
|
||||||
|
|
||||||
|
clean-libseteec:
|
||||||
|
@$(MAKE) --directory=libseteec --no-print-directory clean
|
||||||
|
|
||||||
|
clean-libteeacl:
|
||||||
|
@$(MAKE) --directory=libteeacl --no-print-directory clean
|
||||||
|
|
||||||
|
cscope:
|
||||||
|
@echo " CSCOPE"
|
||||||
|
${VPREFIX}find ${CURDIR} -name "*.[chsS]" > cscope.files
|
||||||
|
${VPREFIX}cscope -b -q -k
|
||||||
|
|
||||||
|
clean-cscope:
|
||||||
|
${VPREFIX}rm -f cscope.*
|
||||||
|
|
||||||
|
# Various checkpatch targets. The ones ending with "patch" only considers the
|
||||||
|
# patch, whilst the ones ending with "file" checks the complete file.
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | Target commit | File/Patch | Comment |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-modified-patch | Patch | Check local modifications |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-modified-file | File | Check Local modifications |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-last-commit-patch | Patch | Check against HEAD^ |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-last-commit-file | File | Check against HEAD^ |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-base-commit-patch | Patch | Against specic commit |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-base-commit-file | File | Against specic commit |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
# | checkpatch-all-files | File | Check all tracked files |
|
||||||
|
# +-------------------------------+------------+----------------------------+
|
||||||
|
CHECKPATCH_IGNORE ?= --ignore NEW_TYPEDEFS --no-signoff
|
||||||
|
CHECKPATCH_STRICT ?= --strict
|
||||||
|
CHECKPATCH_ARGS ?= $(CHECKPATCH_IGNORE) $(CHECKPATCH_STRICT) --no-tree --terse
|
||||||
|
CHECKPATCH_PATCH_ARGS := $(CHECKPATCH_ARGS) --patch
|
||||||
|
CHECKPATCH_FILE_ARGS := $(CHECKPATCH_ARGS) --file --no-patch
|
||||||
|
|
||||||
|
checkpatch-pre-req:
|
||||||
|
@echo " CHECKPATCH"
|
||||||
|
ifndef CHECKPATCH
|
||||||
|
$(error "Environment variable CHECKPATCH must point to Linux kernels checkpatch script")
|
||||||
|
else
|
||||||
|
ifeq (,$(wildcard ${CHECKPATCH}))
|
||||||
|
$(error "CHECKPATCH points to the incorrect file")
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
checkpatch-modified-patch: checkpatch-pre-req
|
||||||
|
${VPREFIX}git diff | ${CHECKPATCH} $(CHECKPATCH_PATCH_ARGS) - || true
|
||||||
|
|
||||||
|
checkpatch-modified-file: checkpatch-pre-req
|
||||||
|
${VPREFIX}${CHECKPATCH} $(CHECKPATCH_FILE_ARGS) $(shell git diff --name-only)
|
||||||
|
|
||||||
|
|
||||||
|
checkpatch-last-commit-patch: checkpatch-pre-req
|
||||||
|
${VPREFIX}git diff HEAD^ | ${CHECKPATCH} $(CHECKPATCH_PATCH_ARGS) - || true
|
||||||
|
|
||||||
|
checkpatch-last-commit-file: checkpatch-pre-req
|
||||||
|
${VPREFIX}${CHECKPATCH} $(CHECKPATCH_FILE_ARGS) $(shell git diff --name-only HEAD^)
|
||||||
|
|
||||||
|
|
||||||
|
checkpatch-base-commit-patch: checkpatch-pre-req
|
||||||
|
ifndef BASE_COMMIT
|
||||||
|
$(error "Environment variable BASE_COMMIT must contain a valid commit")
|
||||||
|
endif
|
||||||
|
${VPREFIX}git diff $(BASE_COMMIT) | ${CHECKPATCH} $(CHECKPATCH_PATCH_ARGS) - || true
|
||||||
|
|
||||||
|
checkpatch-base-commit-file: checkpatch-pre-req
|
||||||
|
ifndef BASE_COMMIT
|
||||||
|
$(error "Environment variable BASE_COMMIT must contain a valid commit")
|
||||||
|
endif
|
||||||
|
${VPREFIX}${CHECKPATCH} $(CHECKPATCH_FILE_ARGS) $(shell git diff --name-only ${BASE_COMMIT})
|
||||||
|
|
||||||
|
checkpatch-all-files: checkpatch-pre-req
|
||||||
|
${VPREFIX}${CHECKPATCH} $(CHECKPATCH_FILE_ARGS) $(shell git ls-files)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
copy_export: build
|
||||||
|
mkdir -p $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
|
||||||
|
cp config.mk $(DESTDIR)/$(includedir)/optee_client_config.mk
|
||||||
|
cp -d ${O}/libteec/libteec.so* $(DESTDIR)$(libdir)
|
||||||
|
cp -d ${O}/libteec/libteec.a $(DESTDIR)$(libdir)
|
||||||
|
cp ${O}/tee-supplicant/tee-supplicant $(DESTDIR)$(sbindir)
|
||||||
|
cp public/*.h $(DESTDIR)$(includedir)
|
||||||
|
cp libckteec/include/*.h $(DESTDIR)$(includedir)
|
||||||
|
cp -d ${O}/libckteec/libckteec.so* $(DESTDIR)$(libdir)
|
||||||
|
cp -d ${O}/libckteec/libckteec.a $(DESTDIR)$(libdir)
|
||||||
|
ifeq ($(WITH_TEEACL),1)
|
||||||
|
# Disable libteeacl:
|
||||||
|
# cp libteeacl/include/*.h $(DESTDIR)$(includedir)
|
||||||
|
# cp -d ${O}/libteeacl/libteeacl.so* $(DESTDIR)$(libdir)
|
||||||
|
# cp -d ${O}/libteeacl/libteeacl.a $(DESTDIR)$(libdir)
|
||||||
|
endif
|
||||||
|
cp libseteec/include/*.h $(DESTDIR)$(includedir)
|
||||||
|
cp -d ${O}/libseteec/libseteec.so* $(DESTDIR)$(libdir)
|
||||||
|
cp -d ${O}/libseteec/libseteec.a $(DESTDIR)$(libdir)
|
||||||
10
optee/optee_client/README.md
Normal file
10
optee/optee_client/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# OP-TEE Client API
|
||||||
|
This git contains source code for the non-secure side implementation of the
|
||||||
|
OP-TEE project making up the client library and tee-supplicant.
|
||||||
|
|
||||||
|
All official OP-TEE documentation has moved to http://optee.readthedocs.io. The
|
||||||
|
information that used to be here in this git can be found under [optee_client].
|
||||||
|
|
||||||
|
// OP-TEE core maintainers
|
||||||
|
|
||||||
|
[optee_client]: https://optee.readthedocs.io/en/latest/building/gits/optee_client.html
|
||||||
27
optee/optee_client/android_flags.mk
Normal file
27
optee/optee_client/android_flags.mk
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#########################################################################
|
||||||
|
# COMMON COMPILATION FLAGS #
|
||||||
|
#########################################################################
|
||||||
|
CFLAGS := -Wall -Wbad-function-cast -Wcast-align \
|
||||||
|
-Werror-implicit-function-declaration -Wextra \
|
||||||
|
-Wfloat-equal -Wformat-nonliteral -Wformat-security \
|
||||||
|
-Wformat=2 -Winit-self -Wmissing-declarations \
|
||||||
|
-Wmissing-format-attribute -Wmissing-include-dirs \
|
||||||
|
-Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
|
||||||
|
-Wpointer-arith -Wshadow -Wstrict-prototypes \
|
||||||
|
-Wswitch-default \
|
||||||
|
-Wwrite-strings
|
||||||
|
ifeq ($(CFG_WERROR),y)
|
||||||
|
CFLAGS += -Werror
|
||||||
|
endif
|
||||||
|
CFLAGS += -c -fPIC
|
||||||
|
|
||||||
|
DEBUG ?= 0
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CFLAGS += -DDEBUG -O0 -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
RM := rm -rf
|
||||||
|
|
||||||
|
define rmdir
|
||||||
|
if [ -d "$(1)" ] ; then rmdir --ignore-fail-on-non-empty $(1) ; fi
|
||||||
|
endef
|
||||||
21
optee/optee_client/ci/Dockerfile.debian
Normal file
21
optee/optee_client/ci/Dockerfile.debian
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Dockerfile for CI image used in ../.github/workflows/ci.yml
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
MAINTAINER Jerome Forissier <jerome.forissier@linaro.org>
|
||||||
|
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
|
RUN dpkg --add-architecture armhf
|
||||||
|
RUN dpkg --add-architecture arm64
|
||||||
|
|
||||||
|
RUN apt update
|
||||||
|
RUN apt upgrade -y
|
||||||
|
RUN apt install -y \
|
||||||
|
cmake \
|
||||||
|
dpkg-dev \
|
||||||
|
gcc-aarch64-linux-gnu \
|
||||||
|
gcc-arm-linux-gnueabihf \
|
||||||
|
make \
|
||||||
|
pkg-config \
|
||||||
|
uuid-dev:armhf \
|
||||||
|
uuid-dev:arm64
|
||||||
30
optee/optee_client/ci/Dockerfile.ubuntu
Normal file
30
optee/optee_client/ci/Dockerfile.ubuntu
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Dockerfile for CI image used in ../.github/workflows/ci.yml
|
||||||
|
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
MAINTAINER Jerome Forissier <jerome.forissier@linaro.org>
|
||||||
|
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
|
RUN dpkg --add-architecture armhf
|
||||||
|
RUN dpkg --add-architecture arm64
|
||||||
|
|
||||||
|
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse' > /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse' >> /etc/apt/sources.list
|
||||||
|
|
||||||
|
RUN apt update
|
||||||
|
RUN apt upgrade -y
|
||||||
|
RUN apt install -y \
|
||||||
|
cmake \
|
||||||
|
dpkg-dev \
|
||||||
|
gcc-aarch64-linux-gnu \
|
||||||
|
gcc-arm-linux-gnueabihf \
|
||||||
|
make \
|
||||||
|
pkg-config \
|
||||||
|
uuid-dev:armhf \
|
||||||
|
uuid-dev:arm64
|
||||||
79
optee/optee_client/config.mk
Normal file
79
optee/optee_client/config.mk
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
#########################################################################
|
||||||
|
# Public variables #
|
||||||
|
# Developers may override these values when calling the makefile, #
|
||||||
|
# as for example #
|
||||||
|
# CFG_TEE_CLIENT_LOG_LEVEL=1 make #
|
||||||
|
# Note: #
|
||||||
|
# Please do not use export to declare the variables, so that to avoid #
|
||||||
|
# compiling problem for android platform #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# CFG_TEE_CLIENT_LOG_LEVEL
|
||||||
|
# Client (User Non Secure) log level
|
||||||
|
# Supported values: 0 (no traces) to 4 (all traces)
|
||||||
|
CFG_TEE_CLIENT_LOG_LEVEL?=1
|
||||||
|
|
||||||
|
# CFG_TEE_SUPP_LOG_LEVEL
|
||||||
|
# Supplicant log level
|
||||||
|
# Supported values: 0 (no traces) to 4 (all traces)
|
||||||
|
CFG_TEE_SUPP_LOG_LEVEL?=1
|
||||||
|
|
||||||
|
# CFG_TEE_FS_PARENT_PATH
|
||||||
|
# Path to folder that will contain TEE filesystem.
|
||||||
|
# This folder can be created with the required permission in an init
|
||||||
|
# script during boot, else it will be created by the tee-supplicant on
|
||||||
|
# first REE FS access.
|
||||||
|
CFG_TEE_FS_PARENT_PATH ?= /data/tee
|
||||||
|
|
||||||
|
# CFG_TEE_CLIENT_LOG_FILE
|
||||||
|
# The location of the client log file when logging to file is enabled.
|
||||||
|
CFG_TEE_CLIENT_LOG_FILE ?= $(CFG_TEE_FS_PARENT_PATH)/teec.log
|
||||||
|
|
||||||
|
# CFG_TEE_CLIENT_LOAD_PATH
|
||||||
|
# Colon-separated list of paths where tee-supplicant loads TAs from.
|
||||||
|
# For example: CFG_TEE_CLIENT_LOAD_PATH ?= /lib:/vendor/lib
|
||||||
|
# Note that the TA files are typically in a sub-directory (see the
|
||||||
|
# --ta-dir option).
|
||||||
|
CFG_TEE_CLIENT_LOAD_PATH ?= /lib
|
||||||
|
|
||||||
|
# CFG_TEE_SUPP_PLUGINS
|
||||||
|
# Enable (y) or disable (n) TEE supplicant plugin support
|
||||||
|
CFG_TEE_SUPP_PLUGINS ?= y
|
||||||
|
|
||||||
|
# CFG_TEE_PLUGIN_LOAD_PATH
|
||||||
|
# The location of the user plugins
|
||||||
|
CFG_TEE_PLUGIN_LOAD_PATH ?= /usr/lib/tee-supplicant/plugins/
|
||||||
|
|
||||||
|
# CFG_TA_TEST_PATH
|
||||||
|
# Enable the tee test path. When enabled, the supplicant will try
|
||||||
|
# loading from a debug path before the regular path. This allows test
|
||||||
|
# such as 1008.5 that test loading of corrupt TAs.
|
||||||
|
CFG_TA_TEST_PATH ?= n
|
||||||
|
|
||||||
|
# CFG_GP_SOCKETS
|
||||||
|
# Enable Global Platform Sockets support
|
||||||
|
CFG_GP_SOCKETS ?= y
|
||||||
|
|
||||||
|
# CFG_TA_GPROF_SUPPORT
|
||||||
|
# Enable dumping gprof data, not used unless secure world decides
|
||||||
|
# to dump something
|
||||||
|
CFG_TA_GPROF_SUPPORT ?= y
|
||||||
|
|
||||||
|
# CFG_FTRACE_SUPPORT
|
||||||
|
# Enable dumping ftrace data, not used unless secure world decides
|
||||||
|
# to dump something
|
||||||
|
CFG_FTRACE_SUPPORT ?= y
|
||||||
|
|
||||||
|
# Default output directory.
|
||||||
|
# May be absolute, or relative to the optee_client source directory.
|
||||||
|
O ?= out
|
||||||
|
|
||||||
|
# To be used instead of $(O) in sub-directories
|
||||||
|
OO := $(if $(filter /%,$(O)),$(O),$(CURDIR)/../$(O))
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# Private Values #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# Check that settings are coherent.
|
||||||
|
|
||||||
37
optee/optee_client/flags.mk
Normal file
37
optee/optee_client/flags.mk
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#########################################################################
|
||||||
|
# COMMON COMPILATION FLAGS #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
CROSS_COMPILE ?= arm-linux-gnueabihf-
|
||||||
|
CC ?= $(CROSS_COMPILE)gcc
|
||||||
|
AR ?= $(CROSS_COMPILE)ar
|
||||||
|
PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
|
||||||
|
|
||||||
|
C_COMPILER=$(shell readlink -f $$(which $(CC)))
|
||||||
|
|
||||||
|
override CFLAGS += -Wall -Wbad-function-cast -Wcast-align \
|
||||||
|
-Werror-implicit-function-declaration -Wextra \
|
||||||
|
-Wfloat-equal -Wformat-nonliteral -Wformat-security \
|
||||||
|
-Wformat=2 -Winit-self -Wmissing-declarations \
|
||||||
|
-Wmissing-format-attribute -Wmissing-include-dirs \
|
||||||
|
-Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
|
||||||
|
-Wpointer-arith -Wshadow -Wstrict-prototypes \
|
||||||
|
-Wswitch-default -Wwrite-strings -D_FILE_OFFSET_BITS=64
|
||||||
|
ifneq (,$(findstring gcc,$(C_COMPILER)))
|
||||||
|
override CFLAGS += -Wunsafe-loop-optimizations
|
||||||
|
endif
|
||||||
|
ifeq ($(CFG_WERROR),y)
|
||||||
|
override CFLAGS += -Werror
|
||||||
|
endif
|
||||||
|
override CFLAGS += -c -fPIC
|
||||||
|
|
||||||
|
DEBUG ?= 0
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
override CFLAGS += -DDEBUG -O0 -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
RM := rm -f
|
||||||
|
|
||||||
|
define rmdir
|
||||||
|
if [ -d "$(1)" ] ; then rmdir --ignore-fail-on-non-empty $(1) ; fi
|
||||||
|
endef
|
||||||
77
optee/optee_client/libckteec/CMakeLists.txt
Normal file
77
optee/optee_client/libckteec/CMakeLists.txt
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
project(ckteec
|
||||||
|
VERSION 0.1.0
|
||||||
|
LANGUAGES C)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Packages
|
||||||
|
################################################################################
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
if(NOT THREADS_FOUND)
|
||||||
|
message(FATAL_ERROR "Threads not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source files
|
||||||
|
################################################################################
|
||||||
|
set (SRC
|
||||||
|
src/pkcs11_api.c
|
||||||
|
src/ck_debug.c
|
||||||
|
src/ck_helpers.c
|
||||||
|
src/invoke_ta.c
|
||||||
|
src/pkcs11_processing.c
|
||||||
|
src/pkcs11_token.c
|
||||||
|
src/serializer.c
|
||||||
|
src/serialize_ck.c
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built library
|
||||||
|
################################################################################
|
||||||
|
add_library (ckteec ${SRC})
|
||||||
|
|
||||||
|
set_target_properties (ckteec PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Flags always set
|
||||||
|
################################################################################
|
||||||
|
target_compile_definitions (ckteec
|
||||||
|
PRIVATE -D_GNU_SOURCE
|
||||||
|
PRIVATE -DBINARY_PREFIX="LT"
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Optional flags
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(ckteec
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
PRIVATE src
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(teec
|
||||||
|
PUBLIC include
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries (ckteec
|
||||||
|
PRIVATE pthread
|
||||||
|
PRIVATE teec
|
||||||
|
PRIVATE m
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
install (TARGETS ckteec
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(include)
|
||||||
78
optee/optee_client/libckteec/Makefile
Normal file
78
optee/optee_client/libckteec/Makefile
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
include ../flags.mk
|
||||||
|
include ../config.mk
|
||||||
|
|
||||||
|
OUT_DIR := $(OO)/libckteec
|
||||||
|
|
||||||
|
.PHONY: all libckteec clean
|
||||||
|
|
||||||
|
all: libckteec
|
||||||
|
install: libckteec
|
||||||
|
|
||||||
|
LIB_NAME := libckteec
|
||||||
|
MAJOR_VERSION := 0
|
||||||
|
MINOR_VERSION := 1
|
||||||
|
PATCH_VERSION := 0
|
||||||
|
|
||||||
|
LIB_MAJOR := $(LIB_NAME).so.$(MAJOR_VERSION)
|
||||||
|
LIB_MAJ_MIN := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||||
|
LIB_MAJ_MIN_PAT := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
|
||||||
|
LIBCKTEEC_SO_LIBRARY := $(LIB_MAJ_MIN_PAT)
|
||||||
|
LIBCKTEEC_AR_LIBRARY := $(LIB_NAME).a
|
||||||
|
|
||||||
|
LIBCKTEEC_SRC_DIR := src
|
||||||
|
|
||||||
|
LIBCKTEEC_SRCS = pkcs11_api.c
|
||||||
|
LIBCKTEEC_SRCS += ck_debug.c
|
||||||
|
LIBCKTEEC_SRCS += ck_helpers.c
|
||||||
|
LIBCKTEEC_SRCS += invoke_ta.c
|
||||||
|
LIBCKTEEC_SRCS += pkcs11_processing.c
|
||||||
|
LIBCKTEEC_SRCS += pkcs11_token.c
|
||||||
|
LIBCKTEEC_SRCS += serializer.c
|
||||||
|
LIBCKTEEC_SRCS += serialize_ck.c
|
||||||
|
|
||||||
|
LIBCKTEEC_INCLUDES = ${CURDIR}/include
|
||||||
|
LIBCKTEEC_INCLUDES += ${CURDIR}/../public
|
||||||
|
|
||||||
|
LIBCKTEEC_CFLAGS := $(addprefix -I, $(LIBCKTEEC_INCLUDES)) \
|
||||||
|
$(CFLAGS) -D_GNU_SOURCE -fPIC
|
||||||
|
|
||||||
|
LIBCKTEEC_LFLAGS := $(LDFLAGS) -L$(OUT_DIR)/../libteec -lteec
|
||||||
|
|
||||||
|
LIBCKTEEC_OBJ_DIR := $(OUT_DIR)
|
||||||
|
LIBCKTEEC_OBJS := $(patsubst %.c,$(LIBCKTEEC_OBJ_DIR)/%.o, $(LIBCKTEEC_SRCS))
|
||||||
|
|
||||||
|
$(LIBCKTEEC_OBJ_DIR)/%.o: ${LIBCKTEEC_SRC_DIR}/%.c
|
||||||
|
$(VPREFIX)mkdir -p $(LIBCKTEEC_OBJ_DIR)
|
||||||
|
@echo " CC $<"
|
||||||
|
$(VPREFIX)$(CC) $(LIBCKTEEC_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
libckteec: $(OUT_DIR)/$(LIBCKTEEC_SO_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBCKTEEC_SO_LIBRARY): $(LIBCKTEEC_OBJS)
|
||||||
|
@echo " LINK $@"
|
||||||
|
$(VPREFIX)$(CC) -shared -Wl,-soname,$(LIB_MAJOR) -o $@ $+ $(LIBCKTEEC_LFLAGS)
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
libckteec: $(OUT_DIR)/$(LIBCKTEEC_AR_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBCKTEEC_AR_LIBRARY): $(LIBCKTEEC_OBJS)
|
||||||
|
@echo " AR $@"
|
||||||
|
$(VPREFIX)$(AR) rcs $@ $+
|
||||||
|
|
||||||
|
libckteec:
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN_PAT) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME).so
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Cleaning up configuration
|
||||||
|
################################################################################
|
||||||
|
clean:
|
||||||
|
$(RM) $(LIBCKTEEC_OBJS)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN_PAT)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBCKTEEC_SO_LIBRARY)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBCKTEEC_AR_LIBRARY)
|
||||||
|
$(call rmdir,$(OUT_DIR))
|
||||||
|
|
||||||
12
optee/optee_client/libckteec/include/CMakeLists.txt
Normal file
12
optee/optee_client/libckteec/include/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
project (libckteec-headers C)
|
||||||
|
|
||||||
|
FILE(GLOB INSTALL_HEADERS "*.h")
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} INTERFACE)
|
||||||
|
target_include_directories(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:{CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
)
|
||||||
|
|
||||||
|
install (FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
41
optee/optee_client/libckteec/include/ck_debug.h
Normal file
41
optee/optee_client/libckteec/include/ck_debug.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_CK_DEBUG_H
|
||||||
|
#define LIBCKTEEC_CK_DEBUG_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
|
||||||
|
/* Return a pointer to a string buffer of "CKR_xxx\0" return value ID */
|
||||||
|
const char *ckr2str(CK_RV id);
|
||||||
|
|
||||||
|
/* ckm2str - Return string buffer of "CKM_xxx\0" for a mechanism ID */
|
||||||
|
const char *ckm2str(CK_MECHANISM_TYPE id);
|
||||||
|
|
||||||
|
/* slot_ckf2str - Return string buffer of "CKF_xxx\0" for a slot flag */
|
||||||
|
const char *slot_ckf2str(CK_ULONG flag);
|
||||||
|
|
||||||
|
/* token_ckf2str - Return string buffer "CKF_xxx\0" for a token flag */
|
||||||
|
const char *token_ckf2str(CK_ULONG flag);
|
||||||
|
|
||||||
|
/* mecha_ckf2str - Return string buffer "CKF_xxx\0" for a mechanism flag */
|
||||||
|
const char *mecha_ckf2str(CK_ULONG flag);
|
||||||
|
|
||||||
|
/* session_ckf2str - Return string buffer "CKF_xxx\0" for a session flag */
|
||||||
|
const char *session_ckf2str(CK_ULONG flag);
|
||||||
|
|
||||||
|
/* session_cks2str - Return string buffer "CKS_xxx\0" for a session state */
|
||||||
|
const char *session_cks2str(CK_ULONG flag);
|
||||||
|
|
||||||
|
/* Return a pointer to a string buffer of "CKA_xxx\0" attribute ID */
|
||||||
|
const char *cka2str(CK_ATTRIBUTE_TYPE id);
|
||||||
|
|
||||||
|
/* Return a pointer to a string buffer of "CKO_xxx\0" object class ID */
|
||||||
|
const char *cko2str(CK_OBJECT_CLASS id);
|
||||||
|
|
||||||
|
/* Return a pointer to a string buffer of "CKK_xxx\0" key type ID */
|
||||||
|
const char *ckk2str(CK_KEY_TYPE id);
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_CK_DEBUG_H*/
|
||||||
1248
optee/optee_client/libckteec/include/pkcs11.h
Normal file
1248
optee/optee_client/libckteec/include/pkcs11.h
Normal file
File diff suppressed because it is too large
Load Diff
1332
optee/optee_client/libckteec/include/pkcs11_ta.h
Normal file
1332
optee/optee_client/libckteec/include/pkcs11_ta.h
Normal file
File diff suppressed because it is too large
Load Diff
460
optee/optee_client/libckteec/src/ck_debug.c
Normal file
460
optee/optee_client/libckteec/src/ck_debug.c
Normal file
@@ -0,0 +1,460 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ck_debug.h>
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "local_utils.h"
|
||||||
|
|
||||||
|
#define CK2STR_ENTRY(id) case id: return #id
|
||||||
|
|
||||||
|
const char *ckr2str(CK_RV id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
CK2STR_ENTRY(CKR_OK);
|
||||||
|
CK2STR_ENTRY(CKR_CANCEL);
|
||||||
|
CK2STR_ENTRY(CKR_HOST_MEMORY);
|
||||||
|
CK2STR_ENTRY(CKR_SLOT_ID_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_GENERAL_ERROR);
|
||||||
|
CK2STR_ENTRY(CKR_FUNCTION_FAILED);
|
||||||
|
CK2STR_ENTRY(CKR_ARGUMENTS_BAD);
|
||||||
|
CK2STR_ENTRY(CKR_NO_EVENT);
|
||||||
|
CK2STR_ENTRY(CKR_NEED_TO_CREATE_THREADS);
|
||||||
|
CK2STR_ENTRY(CKR_CANT_LOCK);
|
||||||
|
CK2STR_ENTRY(CKR_ATTRIBUTE_READ_ONLY);
|
||||||
|
CK2STR_ENTRY(CKR_ATTRIBUTE_SENSITIVE);
|
||||||
|
CK2STR_ENTRY(CKR_ATTRIBUTE_TYPE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_ATTRIBUTE_VALUE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_ACTION_PROHIBITED);
|
||||||
|
CK2STR_ENTRY(CKR_DATA_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_DATA_LEN_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_DEVICE_ERROR);
|
||||||
|
CK2STR_ENTRY(CKR_DEVICE_MEMORY);
|
||||||
|
CK2STR_ENTRY(CKR_DEVICE_REMOVED);
|
||||||
|
CK2STR_ENTRY(CKR_ENCRYPTED_DATA_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_ENCRYPTED_DATA_LEN_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_FUNCTION_CANCELED);
|
||||||
|
CK2STR_ENTRY(CKR_FUNCTION_NOT_PARALLEL);
|
||||||
|
CK2STR_ENTRY(CKR_FUNCTION_NOT_SUPPORTED);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_HANDLE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_SIZE_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_TYPE_INCONSISTENT);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_NOT_NEEDED);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_CHANGED);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_NEEDED);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_INDIGESTIBLE);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_FUNCTION_NOT_PERMITTED);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_NOT_WRAPPABLE);
|
||||||
|
CK2STR_ENTRY(CKR_KEY_UNEXTRACTABLE);
|
||||||
|
CK2STR_ENTRY(CKR_MECHANISM_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_MECHANISM_PARAM_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_OBJECT_HANDLE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_OPERATION_ACTIVE);
|
||||||
|
CK2STR_ENTRY(CKR_OPERATION_NOT_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_INCORRECT);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_LEN_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_EXPIRED);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_LOCKED);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_CLOSED);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_COUNT);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_HANDLE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_PARALLEL_NOT_SUPPORTED);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_READ_ONLY);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_EXISTS);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_READ_ONLY_EXISTS);
|
||||||
|
CK2STR_ENTRY(CKR_SESSION_READ_WRITE_SO_EXISTS);
|
||||||
|
CK2STR_ENTRY(CKR_SIGNATURE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_SIGNATURE_LEN_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_TEMPLATE_INCOMPLETE);
|
||||||
|
CK2STR_ENTRY(CKR_TEMPLATE_INCONSISTENT);
|
||||||
|
CK2STR_ENTRY(CKR_TOKEN_NOT_PRESENT);
|
||||||
|
CK2STR_ENTRY(CKR_TOKEN_NOT_RECOGNIZED);
|
||||||
|
CK2STR_ENTRY(CKR_TOKEN_WRITE_PROTECTED);
|
||||||
|
CK2STR_ENTRY(CKR_UNWRAPPING_KEY_HANDLE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_UNWRAPPING_KEY_SIZE_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT);
|
||||||
|
CK2STR_ENTRY(CKR_USER_ALREADY_LOGGED_IN);
|
||||||
|
CK2STR_ENTRY(CKR_USER_NOT_LOGGED_IN);
|
||||||
|
CK2STR_ENTRY(CKR_USER_PIN_NOT_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKR_USER_TYPE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_USER_ANOTHER_ALREADY_LOGGED_IN);
|
||||||
|
CK2STR_ENTRY(CKR_USER_TOO_MANY_TYPES);
|
||||||
|
CK2STR_ENTRY(CKR_WRAPPED_KEY_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_WRAPPED_KEY_LEN_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_WRAPPING_KEY_HANDLE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_WRAPPING_KEY_SIZE_RANGE);
|
||||||
|
CK2STR_ENTRY(CKR_WRAPPING_KEY_TYPE_INCONSISTENT);
|
||||||
|
CK2STR_ENTRY(CKR_RANDOM_SEED_NOT_SUPPORTED);
|
||||||
|
CK2STR_ENTRY(CKR_RANDOM_NO_RNG);
|
||||||
|
CK2STR_ENTRY(CKR_DOMAIN_PARAMS_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_CURVE_NOT_SUPPORTED);
|
||||||
|
CK2STR_ENTRY(CKR_BUFFER_TOO_SMALL);
|
||||||
|
CK2STR_ENTRY(CKR_SAVED_STATE_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_INFORMATION_SENSITIVE);
|
||||||
|
CK2STR_ENTRY(CKR_STATE_UNSAVEABLE);
|
||||||
|
CK2STR_ENTRY(CKR_CRYPTOKI_NOT_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKR_CRYPTOKI_ALREADY_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKR_MUTEX_BAD);
|
||||||
|
CK2STR_ENTRY(CKR_MUTEX_NOT_LOCKED);
|
||||||
|
CK2STR_ENTRY(CKR_NEW_PIN_MODE);
|
||||||
|
CK2STR_ENTRY(CKR_NEXT_OTP);
|
||||||
|
CK2STR_ENTRY(CKR_EXCEEDED_MAX_ITERATIONS);
|
||||||
|
CK2STR_ENTRY(CKR_FIPS_SELF_TEST_FAILED);
|
||||||
|
CK2STR_ENTRY(CKR_LIBRARY_LOAD_FAILED);
|
||||||
|
CK2STR_ENTRY(CKR_PIN_TOO_WEAK);
|
||||||
|
CK2STR_ENTRY(CKR_PUBLIC_KEY_INVALID);
|
||||||
|
CK2STR_ENTRY(CKR_FUNCTION_REJECTED);
|
||||||
|
default:
|
||||||
|
if (id & CKR_VENDOR_DEFINED)
|
||||||
|
return "Vendor defined";
|
||||||
|
else
|
||||||
|
return "Unknown ID";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *ckm2str(CK_MECHANISM_TYPE id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
CK2STR_ENTRY(CKM_RSA_PKCS_KEY_PAIR_GEN);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_9796);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_X_509);
|
||||||
|
CK2STR_ENTRY(CKM_MD5_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA1_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_PKCS_OAEP);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA1_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224_RSA_PKCS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224_RSA_PKCS_PSS);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_224);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_224_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_224_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_224_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_256);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_256_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_256_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_256_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_MD5);
|
||||||
|
CK2STR_ENTRY(CKM_MD5_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_MD5_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA_1);
|
||||||
|
CK2STR_ENTRY(CKM_SHA_1_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA_1_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_HMAC);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_HMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_HOTP_KEY_GEN);
|
||||||
|
CK2STR_ENTRY(CKM_HOTP);
|
||||||
|
CK2STR_ENTRY(CKM_GENERIC_SECRET_KEY_GEN);
|
||||||
|
CK2STR_ENTRY(CKM_SHA1_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_SHA256_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_SHA384_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_SHA512_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_SHA224_KEY_DERIVATION);
|
||||||
|
CK2STR_ENTRY(CKM_EC_KEY_PAIR_GEN);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA_SHA1);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA_SHA224);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA_SHA256);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA_SHA384);
|
||||||
|
CK2STR_ENTRY(CKM_ECDSA_SHA512);
|
||||||
|
CK2STR_ENTRY(CKM_ECDH1_DERIVE);
|
||||||
|
CK2STR_ENTRY(CKM_ECDH1_COFACTOR_DERIVE);
|
||||||
|
CK2STR_ENTRY(CKM_ECMQV_DERIVE);
|
||||||
|
CK2STR_ENTRY(CKM_ECDH_AES_KEY_WRAP);
|
||||||
|
CK2STR_ENTRY(CKM_RSA_AES_KEY_WRAP);
|
||||||
|
CK2STR_ENTRY(CKM_AES_KEY_GEN);
|
||||||
|
CK2STR_ENTRY(CKM_AES_ECB);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CBC);
|
||||||
|
CK2STR_ENTRY(CKM_AES_MAC);
|
||||||
|
CK2STR_ENTRY(CKM_AES_MAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CBC_PAD);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CTR);
|
||||||
|
CK2STR_ENTRY(CKM_AES_GCM);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CCM);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CTS);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CMAC);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CMAC_GENERAL);
|
||||||
|
CK2STR_ENTRY(CKM_AES_XCBC_MAC);
|
||||||
|
CK2STR_ENTRY(CKM_AES_XCBC_MAC_96);
|
||||||
|
CK2STR_ENTRY(CKM_AES_GMAC);
|
||||||
|
CK2STR_ENTRY(CKM_DES3_ECB_ENCRYPT_DATA);
|
||||||
|
CK2STR_ENTRY(CKM_DES3_CBC_ENCRYPT_DATA);
|
||||||
|
CK2STR_ENTRY(CKM_AES_ECB_ENCRYPT_DATA);
|
||||||
|
CK2STR_ENTRY(CKM_AES_CBC_ENCRYPT_DATA);
|
||||||
|
CK2STR_ENTRY(CKM_AES_KEY_WRAP);
|
||||||
|
CK2STR_ENTRY(CKM_AES_KEY_WRAP_PAD);
|
||||||
|
default:
|
||||||
|
if (id & CKM_VENDOR_DEFINED)
|
||||||
|
return "Vendor defined";
|
||||||
|
else
|
||||||
|
return "Unknown ID";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *slot_ckf2str(CK_ULONG flag)
|
||||||
|
{
|
||||||
|
switch (flag) {
|
||||||
|
CK2STR_ENTRY(CKF_TOKEN_PRESENT);
|
||||||
|
CK2STR_ENTRY(CKF_REMOVABLE_DEVICE);
|
||||||
|
CK2STR_ENTRY(CKF_HW_SLOT);
|
||||||
|
default:
|
||||||
|
return "Unknown flag";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *token_ckf2str(CK_ULONG flag)
|
||||||
|
{
|
||||||
|
switch (flag) {
|
||||||
|
CK2STR_ENTRY(CKF_RNG);
|
||||||
|
CK2STR_ENTRY(CKF_WRITE_PROTECTED);
|
||||||
|
CK2STR_ENTRY(CKF_LOGIN_REQUIRED);
|
||||||
|
CK2STR_ENTRY(CKF_USER_PIN_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKF_RESTORE_KEY_NOT_NEEDED);
|
||||||
|
CK2STR_ENTRY(CKF_CLOCK_ON_TOKEN);
|
||||||
|
CK2STR_ENTRY(CKF_PROTECTED_AUTHENTICATION_PATH);
|
||||||
|
CK2STR_ENTRY(CKF_DUAL_CRYPTO_OPERATIONS);
|
||||||
|
CK2STR_ENTRY(CKF_TOKEN_INITIALIZED);
|
||||||
|
CK2STR_ENTRY(CKF_SECONDARY_AUTHENTICATION);
|
||||||
|
CK2STR_ENTRY(CKF_USER_PIN_COUNT_LOW);
|
||||||
|
CK2STR_ENTRY(CKF_USER_PIN_FINAL_TRY);
|
||||||
|
CK2STR_ENTRY(CKF_USER_PIN_LOCKED);
|
||||||
|
CK2STR_ENTRY(CKF_USER_PIN_TO_BE_CHANGED);
|
||||||
|
CK2STR_ENTRY(CKF_SO_PIN_COUNT_LOW);
|
||||||
|
CK2STR_ENTRY(CKF_SO_PIN_FINAL_TRY);
|
||||||
|
CK2STR_ENTRY(CKF_SO_PIN_LOCKED);
|
||||||
|
CK2STR_ENTRY(CKF_SO_PIN_TO_BE_CHANGED);
|
||||||
|
CK2STR_ENTRY(CKF_ERROR_STATE);
|
||||||
|
default:
|
||||||
|
return "Unknown flag";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *mecha_ckf2str(CK_ULONG flag)
|
||||||
|
{
|
||||||
|
switch (flag) {
|
||||||
|
CK2STR_ENTRY(CKF_HW);
|
||||||
|
CK2STR_ENTRY(CKF_ENCRYPT);
|
||||||
|
CK2STR_ENTRY(CKF_DECRYPT);
|
||||||
|
CK2STR_ENTRY(CKF_DIGEST);
|
||||||
|
CK2STR_ENTRY(CKF_SIGN);
|
||||||
|
CK2STR_ENTRY(CKF_SIGN_RECOVER);
|
||||||
|
CK2STR_ENTRY(CKF_VERIFY);
|
||||||
|
CK2STR_ENTRY(CKF_VERIFY_RECOVER);
|
||||||
|
CK2STR_ENTRY(CKF_GENERATE);
|
||||||
|
CK2STR_ENTRY(CKF_GENERATE_KEY_PAIR);
|
||||||
|
CK2STR_ENTRY(CKF_WRAP);
|
||||||
|
CK2STR_ENTRY(CKF_UNWRAP);
|
||||||
|
CK2STR_ENTRY(CKF_DERIVE);
|
||||||
|
CK2STR_ENTRY(CKF_EC_F_P);
|
||||||
|
CK2STR_ENTRY(CKF_EC_F_2M);
|
||||||
|
CK2STR_ENTRY(CKF_EC_ECPARAMETERS);
|
||||||
|
CK2STR_ENTRY(CKF_EC_NAMEDCURVE);
|
||||||
|
CK2STR_ENTRY(CKF_EC_UNCOMPRESS);
|
||||||
|
CK2STR_ENTRY(CKF_EC_COMPRESS);
|
||||||
|
CK2STR_ENTRY(CKF_EXTENSION);
|
||||||
|
default:
|
||||||
|
return "Unknown flag";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *session_ckf2str(CK_ULONG flag)
|
||||||
|
{
|
||||||
|
switch (flag) {
|
||||||
|
CK2STR_ENTRY(CKF_RW_SESSION);
|
||||||
|
CK2STR_ENTRY(CKF_SERIAL_SESSION);
|
||||||
|
default:
|
||||||
|
return "Unknown flag";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *session_cks2str(CK_ULONG flag)
|
||||||
|
{
|
||||||
|
switch (flag) {
|
||||||
|
CK2STR_ENTRY(CKS_RO_PUBLIC_SESSION);
|
||||||
|
CK2STR_ENTRY(CKS_RO_USER_FUNCTIONS);
|
||||||
|
CK2STR_ENTRY(CKS_RW_PUBLIC_SESSION);
|
||||||
|
CK2STR_ENTRY(CKS_RW_USER_FUNCTIONS);
|
||||||
|
CK2STR_ENTRY(CKS_RW_SO_FUNCTIONS);
|
||||||
|
default:
|
||||||
|
return "Unknown flag";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *cka2str(CK_ATTRIBUTE_TYPE id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
/* Standard CK attributes */
|
||||||
|
CK2STR_ENTRY(CKA_CLASS);
|
||||||
|
CK2STR_ENTRY(CKA_TOKEN);
|
||||||
|
CK2STR_ENTRY(CKA_PRIVATE);
|
||||||
|
CK2STR_ENTRY(CKA_LABEL);
|
||||||
|
CK2STR_ENTRY(CKA_APPLICATION);
|
||||||
|
CK2STR_ENTRY(CKA_VALUE);
|
||||||
|
CK2STR_ENTRY(CKA_OBJECT_ID);
|
||||||
|
CK2STR_ENTRY(CKA_CERTIFICATE_TYPE);
|
||||||
|
CK2STR_ENTRY(CKA_ISSUER);
|
||||||
|
CK2STR_ENTRY(CKA_SERIAL_NUMBER);
|
||||||
|
CK2STR_ENTRY(CKA_AC_ISSUER);
|
||||||
|
CK2STR_ENTRY(CKA_OWNER);
|
||||||
|
CK2STR_ENTRY(CKA_ATTR_TYPES);
|
||||||
|
CK2STR_ENTRY(CKA_TRUSTED);
|
||||||
|
CK2STR_ENTRY(CKA_CERTIFICATE_CATEGORY);
|
||||||
|
CK2STR_ENTRY(CKA_JAVA_MIDP_SECURITY_DOMAIN);
|
||||||
|
CK2STR_ENTRY(CKA_URL);
|
||||||
|
CK2STR_ENTRY(CKA_HASH_OF_SUBJECT_PUBLIC_KEY);
|
||||||
|
CK2STR_ENTRY(CKA_HASH_OF_ISSUER_PUBLIC_KEY);
|
||||||
|
CK2STR_ENTRY(CKA_NAME_HASH_ALGORITHM);
|
||||||
|
CK2STR_ENTRY(CKA_CHECK_VALUE);
|
||||||
|
CK2STR_ENTRY(CKA_KEY_TYPE);
|
||||||
|
CK2STR_ENTRY(CKA_SUBJECT);
|
||||||
|
CK2STR_ENTRY(CKA_ID);
|
||||||
|
CK2STR_ENTRY(CKA_SENSITIVE);
|
||||||
|
CK2STR_ENTRY(CKA_ENCRYPT);
|
||||||
|
CK2STR_ENTRY(CKA_DECRYPT);
|
||||||
|
CK2STR_ENTRY(CKA_WRAP);
|
||||||
|
CK2STR_ENTRY(CKA_UNWRAP);
|
||||||
|
CK2STR_ENTRY(CKA_SIGN);
|
||||||
|
CK2STR_ENTRY(CKA_SIGN_RECOVER);
|
||||||
|
CK2STR_ENTRY(CKA_VERIFY);
|
||||||
|
CK2STR_ENTRY(CKA_VERIFY_RECOVER);
|
||||||
|
CK2STR_ENTRY(CKA_DERIVE);
|
||||||
|
CK2STR_ENTRY(CKA_START_DATE);
|
||||||
|
CK2STR_ENTRY(CKA_END_DATE);
|
||||||
|
CK2STR_ENTRY(CKA_MODULUS);
|
||||||
|
CK2STR_ENTRY(CKA_MODULUS_BITS);
|
||||||
|
CK2STR_ENTRY(CKA_PUBLIC_EXPONENT);
|
||||||
|
CK2STR_ENTRY(CKA_PRIVATE_EXPONENT);
|
||||||
|
CK2STR_ENTRY(CKA_PRIME_1);
|
||||||
|
CK2STR_ENTRY(CKA_PRIME_2);
|
||||||
|
CK2STR_ENTRY(CKA_EXPONENT_1);
|
||||||
|
CK2STR_ENTRY(CKA_EXPONENT_2);
|
||||||
|
CK2STR_ENTRY(CKA_COEFFICIENT);
|
||||||
|
CK2STR_ENTRY(CKA_PUBLIC_KEY_INFO);
|
||||||
|
CK2STR_ENTRY(CKA_PRIME);
|
||||||
|
CK2STR_ENTRY(CKA_SUBPRIME);
|
||||||
|
CK2STR_ENTRY(CKA_BASE);
|
||||||
|
CK2STR_ENTRY(CKA_PRIME_BITS);
|
||||||
|
CK2STR_ENTRY(CKA_SUBPRIME_BITS);
|
||||||
|
CK2STR_ENTRY(CKA_VALUE_BITS);
|
||||||
|
CK2STR_ENTRY(CKA_VALUE_LEN);
|
||||||
|
CK2STR_ENTRY(CKA_EXTRACTABLE);
|
||||||
|
CK2STR_ENTRY(CKA_LOCAL);
|
||||||
|
CK2STR_ENTRY(CKA_NEVER_EXTRACTABLE);
|
||||||
|
CK2STR_ENTRY(CKA_ALWAYS_SENSITIVE);
|
||||||
|
CK2STR_ENTRY(CKA_KEY_GEN_MECHANISM);
|
||||||
|
CK2STR_ENTRY(CKA_MODIFIABLE);
|
||||||
|
CK2STR_ENTRY(CKA_COPYABLE);
|
||||||
|
CK2STR_ENTRY(CKA_DESTROYABLE);
|
||||||
|
CK2STR_ENTRY(CKA_EC_PARAMS);
|
||||||
|
CK2STR_ENTRY(CKA_EC_POINT);
|
||||||
|
CK2STR_ENTRY(CKA_ALWAYS_AUTHENTICATE);
|
||||||
|
CK2STR_ENTRY(CKA_WRAP_WITH_TRUSTED);
|
||||||
|
CK2STR_ENTRY(CKA_WRAP_TEMPLATE);
|
||||||
|
CK2STR_ENTRY(CKA_UNWRAP_TEMPLATE);
|
||||||
|
CK2STR_ENTRY(CKA_DERIVE_TEMPLATE);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_FORMAT);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_LENGTH);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_TIME_INTERVAL);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_USER_FRIENDLY_MODE);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_CHALLENGE_REQUIREMENT);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_TIME_REQUIREMENT);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_COUNTER_REQUIREMENT);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_PIN_REQUIREMENT);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_COUNTER);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_TIME);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_USER_IDENTIFIER);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_SERVICE_IDENTIFIER);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_SERVICE_LOGO);
|
||||||
|
CK2STR_ENTRY(CKA_OTP_SERVICE_LOGO_TYPE);
|
||||||
|
CK2STR_ENTRY(CKA_GOSTR3410_PARAMS);
|
||||||
|
CK2STR_ENTRY(CKA_GOSTR3411_PARAMS);
|
||||||
|
CK2STR_ENTRY(CKA_GOST28147_PARAMS);
|
||||||
|
CK2STR_ENTRY(CKA_HW_FEATURE_TYPE);
|
||||||
|
CK2STR_ENTRY(CKA_RESET_ON_INIT);
|
||||||
|
CK2STR_ENTRY(CKA_HAS_RESET);
|
||||||
|
CK2STR_ENTRY(CKA_PIXEL_X);
|
||||||
|
CK2STR_ENTRY(CKA_PIXEL_Y);
|
||||||
|
CK2STR_ENTRY(CKA_RESOLUTION);
|
||||||
|
CK2STR_ENTRY(CKA_CHAR_ROWS);
|
||||||
|
CK2STR_ENTRY(CKA_CHAR_COLUMNS);
|
||||||
|
CK2STR_ENTRY(CKA_COLOR);
|
||||||
|
CK2STR_ENTRY(CKA_BITS_PER_PIXEL);
|
||||||
|
CK2STR_ENTRY(CKA_CHAR_SETS);
|
||||||
|
CK2STR_ENTRY(CKA_ENCODING_METHODS);
|
||||||
|
CK2STR_ENTRY(CKA_MIME_TYPES);
|
||||||
|
CK2STR_ENTRY(CKA_MECHANISM_TYPE);
|
||||||
|
CK2STR_ENTRY(CKA_REQUIRED_CMS_ATTRIBUTES);
|
||||||
|
CK2STR_ENTRY(CKA_DEFAULT_CMS_ATTRIBUTES);
|
||||||
|
CK2STR_ENTRY(CKA_SUPPORTED_CMS_ATTRIBUTES);
|
||||||
|
CK2STR_ENTRY(CKA_ALLOWED_MECHANISMS);
|
||||||
|
CK2STR_ENTRY(CKA_VENDOR_DEFINED);
|
||||||
|
default:
|
||||||
|
if (id & CKA_VENDOR_DEFINED)
|
||||||
|
return "Vendor defined";
|
||||||
|
else
|
||||||
|
return "Unknown ID";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *cko2str(CK_OBJECT_CLASS id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
CK2STR_ENTRY(CKO_DATA);
|
||||||
|
CK2STR_ENTRY(CKO_CERTIFICATE);
|
||||||
|
CK2STR_ENTRY(CKO_PUBLIC_KEY);
|
||||||
|
CK2STR_ENTRY(CKO_PRIVATE_KEY);
|
||||||
|
CK2STR_ENTRY(CKO_SECRET_KEY);
|
||||||
|
CK2STR_ENTRY(CKO_HW_FEATURE);
|
||||||
|
CK2STR_ENTRY(CKO_DOMAIN_PARAMETERS);
|
||||||
|
CK2STR_ENTRY(CKO_MECHANISM);
|
||||||
|
CK2STR_ENTRY(CKO_OTP_KEY);
|
||||||
|
CK2STR_ENTRY(CKO_VENDOR_DEFINED);
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *ckk2str(CK_KEY_TYPE id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
CK2STR_ENTRY(CKK_RSA);
|
||||||
|
CK2STR_ENTRY(CKK_DSA);
|
||||||
|
CK2STR_ENTRY(CKK_DH);
|
||||||
|
CK2STR_ENTRY(CKK_ECDSA);
|
||||||
|
CK2STR_ENTRY(CKK_GENERIC_SECRET);
|
||||||
|
CK2STR_ENTRY(CKK_DES3);
|
||||||
|
CK2STR_ENTRY(CKK_AES);
|
||||||
|
CK2STR_ENTRY(CKK_HOTP);
|
||||||
|
CK2STR_ENTRY(CKK_MD5_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_SHA_1_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_SHA256_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_SHA384_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_SHA512_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_SHA224_HMAC);
|
||||||
|
CK2STR_ENTRY(CKK_VENDOR_DEFINED);
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
29
optee/optee_client/libckteec/src/ck_helpers.c
Normal file
29
optee/optee_client/libckteec/src/ck_helpers.c
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ck_debug.h>
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
#include "ck_helpers.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
void ckteec_assert_expected_rv(const char *function, CK_RV rv,
|
||||||
|
const CK_RV *expected_rv, size_t expected_count)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
for (n = 0; n < expected_count; n++)
|
||||||
|
if (rv == expected_rv[n])
|
||||||
|
return;
|
||||||
|
|
||||||
|
fprintf(stderr, "libckteec: %s: unexpected return value 0x%lx (%s)\n",
|
||||||
|
function, rv, ckr2str(rv));
|
||||||
|
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
29
optee/optee_client/libckteec/src/ck_helpers.h
Normal file
29
optee/optee_client/libckteec/src/ck_helpers.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_CK_HELPERS_H
|
||||||
|
#define LIBCKTEEC_CK_HELPERS_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
#include "local_utils.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define ASSERT_CK_RV(_rv, ...) \
|
||||||
|
do { \
|
||||||
|
const CK_RV ref[] = { __VA_ARGS__ }; \
|
||||||
|
size_t count = ARRAY_SIZE(ref); \
|
||||||
|
\
|
||||||
|
ckteec_assert_expected_rv(__func__, (_rv), ref, count); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
void ckteec_assert_expected_rv(const char *function, CK_RV rv,
|
||||||
|
const CK_RV *expected_rv, size_t expected_count);
|
||||||
|
#else
|
||||||
|
#define ASSERT_CK_RV(_rv, ...) (void)0
|
||||||
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_CK_HELPERS_H*/
|
||||||
360
optee/optee_client/libckteec/src/invoke_ta.c
Normal file
360
optee/optee_client/libckteec/src/invoke_ta.c
Normal file
@@ -0,0 +1,360 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* BINARY_PREFIX is expected by teec_trace.h */
|
||||||
|
#ifndef BINARY_PREFIX
|
||||||
|
#define BINARY_PREFIX "ckteec"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "ck_helpers.h"
|
||||||
|
#include "invoke_ta.h"
|
||||||
|
#include "local_utils.h"
|
||||||
|
|
||||||
|
struct ta_context {
|
||||||
|
pthread_mutex_t init_mutex;
|
||||||
|
bool initiated;
|
||||||
|
TEEC_Context context;
|
||||||
|
TEEC_Session session;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ta_context ta_ctx = {
|
||||||
|
.init_mutex = PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
};
|
||||||
|
|
||||||
|
bool ckteec_invoke_initiated(void)
|
||||||
|
{
|
||||||
|
return ta_ctx.initiated;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_SharedMemory *ckteec_alloc_shm(size_t size, enum ckteec_shm_dir dir)
|
||||||
|
{
|
||||||
|
TEEC_SharedMemory *shm = NULL;
|
||||||
|
|
||||||
|
switch (dir) {
|
||||||
|
case CKTEEC_SHM_IN:
|
||||||
|
case CKTEEC_SHM_OUT:
|
||||||
|
case CKTEEC_SHM_INOUT:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm = calloc(1, sizeof(TEEC_SharedMemory));
|
||||||
|
if (!shm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
shm->size = size;
|
||||||
|
|
||||||
|
if (dir == CKTEEC_SHM_IN || dir == CKTEEC_SHM_INOUT)
|
||||||
|
shm->flags |= TEEC_MEM_INPUT;
|
||||||
|
if (dir == CKTEEC_SHM_OUT || dir == CKTEEC_SHM_INOUT)
|
||||||
|
shm->flags |= TEEC_MEM_OUTPUT;
|
||||||
|
|
||||||
|
if (TEEC_AllocateSharedMemory(&ta_ctx.context, shm)) {
|
||||||
|
free(shm);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return shm;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_SharedMemory *ckteec_register_shm(void *buffer, size_t size,
|
||||||
|
enum ckteec_shm_dir dir)
|
||||||
|
{
|
||||||
|
TEEC_SharedMemory *shm = NULL;
|
||||||
|
|
||||||
|
switch (dir) {
|
||||||
|
case CKTEEC_SHM_IN:
|
||||||
|
case CKTEEC_SHM_OUT:
|
||||||
|
case CKTEEC_SHM_INOUT:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm = calloc(1, sizeof(TEEC_SharedMemory));
|
||||||
|
if (!shm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
shm->buffer = buffer;
|
||||||
|
shm->size = size;
|
||||||
|
|
||||||
|
if (dir == CKTEEC_SHM_IN || dir == CKTEEC_SHM_INOUT)
|
||||||
|
shm->flags |= TEEC_MEM_INPUT;
|
||||||
|
if (dir == CKTEEC_SHM_OUT || dir == CKTEEC_SHM_INOUT)
|
||||||
|
shm->flags |= TEEC_MEM_OUTPUT;
|
||||||
|
|
||||||
|
if (TEEC_RegisterSharedMemory(&ta_ctx.context, shm)) {
|
||||||
|
free(shm);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return shm;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ckteec_free_shm(TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
TEEC_ReleaseSharedMemory(shm);
|
||||||
|
free(shm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool is_output_shm(TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
return shm && (shm->flags & TEEC_MEM_OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV ckteec_invoke_ta(unsigned long cmd, TEEC_SharedMemory *ctrl,
|
||||||
|
TEEC_SharedMemory *io1,
|
||||||
|
TEEC_SharedMemory *io2, size_t *out2_size,
|
||||||
|
TEEC_SharedMemory *io3, size_t *out3_size)
|
||||||
|
{
|
||||||
|
uint32_t command = (uint32_t)cmd;
|
||||||
|
TEEC_Operation op;
|
||||||
|
uint32_t origin = 0;
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint32_t ta_rc = PKCS11_CKR_GENERAL_ERROR;
|
||||||
|
|
||||||
|
if ((is_output_shm(io2) && !out2_size) ||
|
||||||
|
(is_output_shm(io3) && !out3_size))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
memset(&op, 0, sizeof(op));
|
||||||
|
|
||||||
|
if (ctrl && !(ctrl->flags & TEEC_MEM_INPUT &&
|
||||||
|
ctrl->flags & TEEC_MEM_OUTPUT))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
if (ctrl) {
|
||||||
|
op.paramTypes |= TEEC_PARAM_TYPES(TEEC_MEMREF_WHOLE, 0, 0, 0);
|
||||||
|
op.params[0].memref.parent = ctrl;
|
||||||
|
} else {
|
||||||
|
/* TA mandates param#0 as in/out memref for output status */
|
||||||
|
op.paramTypes |= TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INOUT,
|
||||||
|
0, 0, 0);
|
||||||
|
op.params[0].tmpref.buffer = &ta_rc;
|
||||||
|
op.params[0].tmpref.size = sizeof(ta_rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (io1) {
|
||||||
|
op.paramTypes |= TEEC_PARAM_TYPES(0, TEEC_MEMREF_WHOLE, 0, 0);
|
||||||
|
op.params[1].memref.parent = io1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (io2) {
|
||||||
|
op.paramTypes |= TEEC_PARAM_TYPES(0, 0, TEEC_MEMREF_WHOLE, 0);
|
||||||
|
op.params[2].memref.parent = io2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (io3) {
|
||||||
|
op.paramTypes |= TEEC_PARAM_TYPES(0, 0, 0, TEEC_MEMREF_WHOLE);
|
||||||
|
op.params[3].memref.parent = io3;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = TEEC_InvokeCommand(&ta_ctx.session, command, &op, &origin);
|
||||||
|
switch (res) {
|
||||||
|
case TEEC_SUCCESS:
|
||||||
|
/* Get PKCS11 TA return value from ctrl buffer */
|
||||||
|
if (ctrl) {
|
||||||
|
if (op.params[0].memref.size == sizeof(ta_rc))
|
||||||
|
memcpy(&ta_rc, ctrl->buffer, sizeof(ta_rc));
|
||||||
|
} else {
|
||||||
|
if (op.params[0].tmpref.size != sizeof(ta_rc))
|
||||||
|
ta_rc = PKCS11_CKR_GENERAL_ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TEEC_ERROR_SHORT_BUFFER:
|
||||||
|
ta_rc = CKR_BUFFER_TOO_SMALL;
|
||||||
|
break;
|
||||||
|
case TEEC_ERROR_OUT_OF_MEMORY:
|
||||||
|
return CKR_DEVICE_MEMORY;
|
||||||
|
default:
|
||||||
|
return CKR_GENERAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ta_rc == CKR_OK || ta_rc == CKR_BUFFER_TOO_SMALL) {
|
||||||
|
if (is_output_shm(io2))
|
||||||
|
*out2_size = op.params[2].memref.size;
|
||||||
|
if (is_output_shm(io3))
|
||||||
|
*out3_size = op.params[3].memref.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ta_rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV ping_ta(void)
|
||||||
|
{
|
||||||
|
TEEC_Operation op = { 0 };
|
||||||
|
uint32_t origin = 0;
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
uint32_t ta_version[3] = { 0 };
|
||||||
|
uint32_t status = 0;
|
||||||
|
|
||||||
|
memset(&op, 0, sizeof(op));
|
||||||
|
op.params[0].tmpref.buffer = &status;
|
||||||
|
op.params[0].tmpref.size = sizeof(status);
|
||||||
|
op.params[2].tmpref.buffer = ta_version;
|
||||||
|
op.params[2].tmpref.size = sizeof(ta_version);
|
||||||
|
op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INOUT, TEEC_NONE,
|
||||||
|
TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
|
||||||
|
|
||||||
|
res = TEEC_InvokeCommand(&ta_ctx.session, PKCS11_CMD_PING, &op,
|
||||||
|
&origin);
|
||||||
|
|
||||||
|
if (res != TEEC_SUCCESS ||
|
||||||
|
origin != TEEC_ORIGIN_TRUSTED_APP ||
|
||||||
|
op.params[0].tmpref.size != sizeof(status) ||
|
||||||
|
status != PKCS11_CKR_OK)
|
||||||
|
return CKR_DEVICE_ERROR;
|
||||||
|
|
||||||
|
if (ta_version[0] != PKCS11_TA_VERSION_MAJOR &&
|
||||||
|
ta_version[1] > PKCS11_TA_VERSION_MINOR) {
|
||||||
|
EMSG("PKCS11 TA version mismatch: %"PRIu32".%"PRIu32".%"PRIu32,
|
||||||
|
ta_version[0], ta_version[1], ta_version[2]);
|
||||||
|
|
||||||
|
return CKR_DEVICE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
DMSG("PKCS11 TA version %"PRIu32".%"PRIu32".%"PRIu32,
|
||||||
|
ta_version[0], ta_version[1], ta_version[2]);
|
||||||
|
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV ckteec_invoke_init(void)
|
||||||
|
{
|
||||||
|
TEEC_UUID uuid = PKCS11_TA_UUID;
|
||||||
|
uint32_t origin = 0;
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
CK_RV rv = CKR_CRYPTOKI_ALREADY_INITIALIZED;
|
||||||
|
const char *login_type_env = NULL;
|
||||||
|
const char *login_gid_env = NULL;
|
||||||
|
uint32_t login_method = TEEC_LOGIN_PUBLIC;
|
||||||
|
void *login_data = NULL;
|
||||||
|
gid_t login_gid = 0;
|
||||||
|
unsigned long tmpconv = 0;
|
||||||
|
char *endp = NULL;
|
||||||
|
int e = 0;
|
||||||
|
|
||||||
|
login_type_env = getenv("CKTEEC_LOGIN_TYPE");
|
||||||
|
|
||||||
|
if (login_type_env) {
|
||||||
|
if (strcmp(login_type_env, "public") == 0) {
|
||||||
|
login_method = TEEC_LOGIN_PUBLIC;
|
||||||
|
} else if (strcmp(login_type_env, "user") == 0) {
|
||||||
|
login_method = TEEC_LOGIN_USER;
|
||||||
|
} else if (strcmp(login_type_env, "group") == 0) {
|
||||||
|
login_gid_env = getenv("CKTEEC_LOGIN_GID");
|
||||||
|
if (!login_gid_env || !strlen(login_gid_env)) {
|
||||||
|
EMSG("missing CKTEEC_LOGIN_GID");
|
||||||
|
rv = CKR_ARGUMENTS_BAD;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
login_method = TEEC_LOGIN_GROUP;
|
||||||
|
tmpconv = strtoul(login_gid_env, &endp, 10);
|
||||||
|
if (errno == ERANGE || tmpconv > (gid_t)-1 ||
|
||||||
|
(login_gid_env + strlen(login_gid_env) != endp)) {
|
||||||
|
EMSG("failed to convert CKTEEC_LOGIN_GID");
|
||||||
|
rv = CKR_ARGUMENTS_BAD;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
login_gid = (gid_t)tmpconv;
|
||||||
|
login_data = &login_gid;
|
||||||
|
} else {
|
||||||
|
EMSG("invalid value for CKTEEC_LOGIN_TYPE");
|
||||||
|
rv = CKR_ARGUMENTS_BAD;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
e = pthread_mutex_lock(&ta_ctx.init_mutex);
|
||||||
|
if (e)
|
||||||
|
return CKR_CANT_LOCK;
|
||||||
|
|
||||||
|
if (ta_ctx.initiated) {
|
||||||
|
rv = CKR_CRYPTOKI_ALREADY_INITIALIZED;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = TEEC_InitializeContext(NULL, &ta_ctx.context);
|
||||||
|
if (res != TEEC_SUCCESS) {
|
||||||
|
EMSG("TEEC init context failed\n");
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = TEEC_OpenSession(&ta_ctx.context, &ta_ctx.session, &uuid,
|
||||||
|
login_method, login_data, NULL, &origin);
|
||||||
|
if (res != TEEC_SUCCESS) {
|
||||||
|
EMSG("TEEC open session failed %x from %d\n", res, origin);
|
||||||
|
TEEC_FinalizeContext(&ta_ctx.context);
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ping_ta();
|
||||||
|
|
||||||
|
if (rv == CKR_OK) {
|
||||||
|
ta_ctx.initiated = true;
|
||||||
|
} else {
|
||||||
|
TEEC_CloseSession(&ta_ctx.session);
|
||||||
|
TEEC_FinalizeContext(&ta_ctx.context);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
e = pthread_mutex_unlock(&ta_ctx.init_mutex);
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_unlock: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV ckteec_invoke_terminate(void)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_CRYPTOKI_NOT_INITIALIZED;
|
||||||
|
int e = 0;
|
||||||
|
|
||||||
|
e = pthread_mutex_lock(&ta_ctx.init_mutex);
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_lock: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ta_ctx.initiated)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
ta_ctx.initiated = false;
|
||||||
|
TEEC_CloseSession(&ta_ctx.session);
|
||||||
|
TEEC_FinalizeContext(&ta_ctx.context);
|
||||||
|
|
||||||
|
rv = CKR_OK;
|
||||||
|
|
||||||
|
out:
|
||||||
|
e = pthread_mutex_unlock(&ta_ctx.init_mutex);
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_unlock: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
103
optee/optee_client/libckteec/src/invoke_ta.h
Normal file
103
optee/optee_client/libckteec/src/invoke_ta.h
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 20187-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_INVOKE_TA_H
|
||||||
|
#define LIBCKTEEC_INVOKE_TA_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
enum ckteec_shm_dir {
|
||||||
|
CKTEEC_SHM_IN,
|
||||||
|
CKTEEC_SHM_OUT,
|
||||||
|
CKTEEC_SHM_INOUT,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ckteec_alloc_shm - Allocate memory in the TEE SHM (in, out or in/out)
|
||||||
|
*
|
||||||
|
* @size - Allocated size in byte
|
||||||
|
* @dir - Data direction used for the shared memory
|
||||||
|
*
|
||||||
|
* Return a shm reference or NULL on failure.
|
||||||
|
*/
|
||||||
|
TEEC_SharedMemory *ckteec_alloc_shm(size_t size, enum ckteec_shm_dir dir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ckteec_register_shm - Register memory as shared in the TEE SHM
|
||||||
|
*
|
||||||
|
* @buffer - Base address of buffer to register
|
||||||
|
* @size - Allocated size in byte
|
||||||
|
* @dir - Data direction used for the shared memory
|
||||||
|
*
|
||||||
|
* Return a shm reference or NULL on failure.
|
||||||
|
*/
|
||||||
|
TEEC_SharedMemory *ckteec_register_shm(void *buffer, size_t size,
|
||||||
|
enum ckteec_shm_dir dir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ckteec_free_shm - Release allocated or registered emory in the TEE SHM
|
||||||
|
*
|
||||||
|
* @shm - memory reference
|
||||||
|
*/
|
||||||
|
void ckteec_free_shm(TEEC_SharedMemory *shm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ckteec_invoke_ta - Invoke PKCS11 TA for a target request through the TEE
|
||||||
|
*
|
||||||
|
* @cmd - PKCS11 TA command ID
|
||||||
|
* @ctrl - shared memory with serialized request input arguments or NULL
|
||||||
|
* @io1 - In memory buffer argument #1 for the command or NULL
|
||||||
|
* @io2 - In and/or out memory buffer argument #2 for the command or NULL
|
||||||
|
* @out2_size - Reference to @io2 output buffer size or NULL if not applicable
|
||||||
|
* @io3 - In and/or out memory buffer argument #3 for the command or NULL
|
||||||
|
* @out3_size - Reference to @io3 output buffer size or NULL if not applicable
|
||||||
|
*
|
||||||
|
* Return a CR_RV compliant return value
|
||||||
|
*/
|
||||||
|
CK_RV ckteec_invoke_ta(unsigned long cmd, TEEC_SharedMemory *ctrl,
|
||||||
|
TEEC_SharedMemory *io1,
|
||||||
|
TEEC_SharedMemory *io2, size_t *out2_size,
|
||||||
|
TEEC_SharedMemory *io3, size_t *out3_size);
|
||||||
|
|
||||||
|
static inline CK_RV ckteec_invoke_ctrl(unsigned long cmd,
|
||||||
|
TEEC_SharedMemory *ctrl)
|
||||||
|
{
|
||||||
|
return ckteec_invoke_ta(cmd, ctrl, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline CK_RV ckteec_invoke_ctrl_in(unsigned long cmd,
|
||||||
|
TEEC_SharedMemory *ctrl,
|
||||||
|
TEEC_SharedMemory *io1)
|
||||||
|
{
|
||||||
|
return ckteec_invoke_ta(cmd, ctrl, io1, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline CK_RV ckteec_invoke_ctrl_out(unsigned long cmd,
|
||||||
|
TEEC_SharedMemory *ctrl,
|
||||||
|
TEEC_SharedMemory *io2,
|
||||||
|
size_t *out_sz)
|
||||||
|
{
|
||||||
|
return ckteec_invoke_ta(cmd, ctrl, NULL, io2, out_sz, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ckteec_invoke_init - Initialize TEE session with the PKCS11 TA
|
||||||
|
*
|
||||||
|
* Return a CR_RV compliant return value
|
||||||
|
*/
|
||||||
|
CK_RV ckteec_invoke_init(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ckteec_invoke_terminate - Release all allocated invocation resources
|
||||||
|
*
|
||||||
|
* Return a CR_RV compliant return value
|
||||||
|
*/
|
||||||
|
CK_RV ckteec_invoke_terminate(void);
|
||||||
|
|
||||||
|
/* Return true if and only if the PKCS11 TA invocation context is initiated */
|
||||||
|
bool ckteec_invoke_initiated(void);
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_INVOKE_TA_H*/
|
||||||
16
optee/optee_client/libckteec/src/local_utils.h
Normal file
16
optee/optee_client/libckteec/src/local_utils.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_LOCAL_UTILS_H
|
||||||
|
#define LIBCKTEEC_LOCAL_UTILS_H
|
||||||
|
|
||||||
|
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
|
||||||
|
|
||||||
|
#define COMPILE_TIME_ASSERT(x) \
|
||||||
|
do { \
|
||||||
|
switch (0) { case 0: case ((x) ? 1: 0) : default : break; } \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_LOCAL_UTILS_H*/
|
||||||
1473
optee/optee_client/libckteec/src/pkcs11_api.c
Normal file
1473
optee/optee_client/libckteec/src/pkcs11_api.c
Normal file
File diff suppressed because it is too large
Load Diff
1705
optee/optee_client/libckteec/src/pkcs11_processing.c
Normal file
1705
optee/optee_client/libckteec/src/pkcs11_processing.c
Normal file
File diff suppressed because it is too large
Load Diff
139
optee/optee_client/libckteec/src/pkcs11_processing.h
Normal file
139
optee/optee_client/libckteec/src/pkcs11_processing.h
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2018, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_PKCS11_PROCESSING_H
|
||||||
|
#define LIBCKTEEC_PKCS11_PROCESSING_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
|
||||||
|
CK_RV ck_create_object(CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count, CK_OBJECT_HANDLE_PTR phObject);
|
||||||
|
|
||||||
|
CK_RV ck_destroy_object(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE obj);
|
||||||
|
|
||||||
|
CK_RV ck_encdecrypt_init(CK_SESSION_HANDLE session,
|
||||||
|
CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_OBJECT_HANDLE key,
|
||||||
|
int decrypt);
|
||||||
|
|
||||||
|
CK_RV ck_encdecrypt_update(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len,
|
||||||
|
CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len,
|
||||||
|
int decrypt);
|
||||||
|
|
||||||
|
CK_RV ck_encdecrypt_oneshot(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len,
|
||||||
|
CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len,
|
||||||
|
int decrypt);
|
||||||
|
|
||||||
|
CK_RV ck_encdecrypt_final(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len,
|
||||||
|
int decrypt);
|
||||||
|
|
||||||
|
CK_RV ck_digest_init(CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism);
|
||||||
|
|
||||||
|
CK_RV ck_digest_key(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key);
|
||||||
|
|
||||||
|
CK_RV ck_digest_update(CK_SESSION_HANDLE session, CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len);
|
||||||
|
|
||||||
|
CK_RV ck_digest_oneshot(CK_SESSION_HANDLE session, CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len, CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len);
|
||||||
|
|
||||||
|
CK_RV ck_digest_final(CK_SESSION_HANDLE session, CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len);
|
||||||
|
|
||||||
|
CK_RV ck_signverify_init(CK_SESSION_HANDLE session,
|
||||||
|
CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_OBJECT_HANDLE key,
|
||||||
|
int sign);
|
||||||
|
|
||||||
|
CK_RV ck_signverify_update(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len,
|
||||||
|
int sign);
|
||||||
|
|
||||||
|
CK_RV ck_signverify_oneshot(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR in,
|
||||||
|
CK_ULONG in_len,
|
||||||
|
CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len,
|
||||||
|
int sign);
|
||||||
|
|
||||||
|
CK_RV ck_signverify_final(CK_SESSION_HANDLE session,
|
||||||
|
CK_BYTE_PTR out,
|
||||||
|
CK_ULONG_PTR out_len,
|
||||||
|
int sign);
|
||||||
|
|
||||||
|
CK_RV ck_generate_key(CK_SESSION_HANDLE session,
|
||||||
|
CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count,
|
||||||
|
CK_OBJECT_HANDLE_PTR handle);
|
||||||
|
|
||||||
|
CK_RV ck_find_objects_init(CK_SESSION_HANDLE session,
|
||||||
|
CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count);
|
||||||
|
|
||||||
|
CK_RV ck_find_objects(CK_SESSION_HANDLE session,
|
||||||
|
CK_OBJECT_HANDLE_PTR obj,
|
||||||
|
CK_ULONG max_count,
|
||||||
|
CK_ULONG_PTR count);
|
||||||
|
|
||||||
|
CK_RV ck_find_objects_final(CK_SESSION_HANDLE session);
|
||||||
|
|
||||||
|
CK_RV ck_get_object_size(CK_SESSION_HANDLE session,
|
||||||
|
CK_OBJECT_HANDLE obj,
|
||||||
|
CK_ULONG_PTR p_size);
|
||||||
|
|
||||||
|
CK_RV ck_get_attribute_value(CK_SESSION_HANDLE session,
|
||||||
|
CK_OBJECT_HANDLE obj,
|
||||||
|
CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count);
|
||||||
|
|
||||||
|
CK_RV ck_set_attribute_value(CK_SESSION_HANDLE session,
|
||||||
|
CK_OBJECT_HANDLE obj,
|
||||||
|
CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count);
|
||||||
|
|
||||||
|
CK_RV ck_copy_object(CK_SESSION_HANDLE session,
|
||||||
|
CK_OBJECT_HANDLE obj,
|
||||||
|
CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count,
|
||||||
|
CK_OBJECT_HANDLE_PTR handle);
|
||||||
|
|
||||||
|
CK_RV ck_derive_key(CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count, CK_OBJECT_HANDLE_PTR handle);
|
||||||
|
|
||||||
|
CK_RV ck_release_active_processing(CK_SESSION_HANDLE session,
|
||||||
|
enum pkcs11_ta_cmd command);
|
||||||
|
|
||||||
|
CK_RV ck_generate_key_pair(CK_SESSION_HANDLE session,
|
||||||
|
CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_ATTRIBUTE_PTR pub_attribs,
|
||||||
|
CK_ULONG pub_count,
|
||||||
|
CK_ATTRIBUTE_PTR priv_attribs,
|
||||||
|
CK_ULONG priv_count,
|
||||||
|
CK_OBJECT_HANDLE_PTR pub_key,
|
||||||
|
CK_OBJECT_HANDLE_PTR priv_key);
|
||||||
|
|
||||||
|
CK_RV ck_wrap_key(CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key,
|
||||||
|
CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len);
|
||||||
|
|
||||||
|
CK_RV ck_unwrap_key(CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism,
|
||||||
|
CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key,
|
||||||
|
CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR attribs,
|
||||||
|
CK_ULONG count, CK_OBJECT_HANDLE_PTR handle);
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_PKCS11_PROCESSING_H*/
|
||||||
841
optee/optee_client/libckteec/src/pkcs11_token.c
Normal file
841
optee/optee_client/libckteec/src/pkcs11_token.c
Normal file
@@ -0,0 +1,841 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ck_debug.h>
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ck_helpers.h"
|
||||||
|
#include "invoke_ta.h"
|
||||||
|
#include "local_utils.h"
|
||||||
|
#include "pkcs11_token.h"
|
||||||
|
|
||||||
|
#define PKCS11_LIB_MANUFACTURER "Linaro"
|
||||||
|
#define PKCS11_LIB_DESCRIPTION "OP-TEE PKCS11 Cryptoki library"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_get_info - Get local information for C_GetInfo
|
||||||
|
*/
|
||||||
|
CK_RV ck_get_info(CK_INFO_PTR info)
|
||||||
|
{
|
||||||
|
const CK_INFO lib_info = {
|
||||||
|
.cryptokiVersion = {
|
||||||
|
CK_PKCS11_VERSION_MAJOR,
|
||||||
|
CK_PKCS11_VERSION_MINOR,
|
||||||
|
},
|
||||||
|
.manufacturerID = PKCS11_LIB_MANUFACTURER,
|
||||||
|
.flags = 0, /* must be zero per the PKCS#11 2.40 */
|
||||||
|
.libraryDescription = PKCS11_LIB_DESCRIPTION,
|
||||||
|
.libraryVersion = {
|
||||||
|
PKCS11_TA_VERSION_MAJOR,
|
||||||
|
PKCS11_TA_VERSION_MINOR
|
||||||
|
},
|
||||||
|
};
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
*info = lib_info;
|
||||||
|
|
||||||
|
/* Pad strings with blank characters */
|
||||||
|
n = strnlen((char *)info->manufacturerID,
|
||||||
|
sizeof(info->manufacturerID));
|
||||||
|
memset(&info->manufacturerID[n], ' ',
|
||||||
|
sizeof(info->manufacturerID) - n);
|
||||||
|
|
||||||
|
n = strnlen((char *)info->libraryDescription,
|
||||||
|
sizeof(info->libraryDescription));
|
||||||
|
memset(&info->libraryDescription[n], ' ',
|
||||||
|
sizeof(info->libraryDescription) - n);
|
||||||
|
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_slot_get_list - Wrap C_GetSlotList into PKCS11_CMD_SLOT_LIST
|
||||||
|
*/
|
||||||
|
CK_RV ck_slot_get_list(CK_BBOOL present,
|
||||||
|
CK_SLOT_ID_PTR slots, CK_ULONG_PTR count)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *shm = NULL;
|
||||||
|
uint32_t *slot_ids = NULL;
|
||||||
|
size_t client_count = 0;
|
||||||
|
size_t size = 0;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
/* Discard @present: all slots reported by TA are present */
|
||||||
|
(void)present;
|
||||||
|
|
||||||
|
if (!count)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* As per spec, if @slots is NULL, "The contents of *pulCount on
|
||||||
|
* entry to C_GetSlotList has no meaning in this case (...)"
|
||||||
|
*/
|
||||||
|
if (slots)
|
||||||
|
client_count = *count;
|
||||||
|
|
||||||
|
size = client_count * sizeof(*slot_ids);
|
||||||
|
|
||||||
|
shm = ckteec_alloc_shm(size, CKTEEC_SHM_OUT);
|
||||||
|
if (!shm)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ta(PKCS11_CMD_SLOT_LIST, NULL,
|
||||||
|
NULL, shm, &size, NULL, NULL);
|
||||||
|
|
||||||
|
if (rv == CKR_OK || rv == CKR_BUFFER_TOO_SMALL)
|
||||||
|
*count = size / sizeof(*slot_ids);
|
||||||
|
|
||||||
|
if (!slots && rv == CKR_BUFFER_TOO_SMALL)
|
||||||
|
rv = CKR_OK;
|
||||||
|
if (!slots || rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
slot_ids = shm->buffer;
|
||||||
|
for (n = 0; n < *count; n++)
|
||||||
|
slots[n] = slot_ids[n];
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(shm);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_slot_get_info - Wrap C_GetSlotInfo into PKCS11_CMD_SLOT_INFO
|
||||||
|
*/
|
||||||
|
CK_RV ck_slot_get_info(CK_SLOT_ID slot, CK_SLOT_INFO_PTR info)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
struct pkcs11_slot_info *ta_info = NULL;
|
||||||
|
size_t out_size = 0;
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &slot_id, sizeof(slot_id));
|
||||||
|
|
||||||
|
out = ckteec_alloc_shm(sizeof(*ta_info), CKTEEC_SHM_OUT);
|
||||||
|
if (!out) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_SLOT_INFO, ctrl, out, &out_size);
|
||||||
|
if (rv != CKR_OK || out_size != out->size) {
|
||||||
|
if (rv == CKR_OK)
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ta_info = out->buffer;
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->slotDescription) ==
|
||||||
|
sizeof(ta_info->slot_description));
|
||||||
|
memcpy(info->slotDescription, ta_info->slot_description,
|
||||||
|
sizeof(info->slotDescription));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->manufacturerID) ==
|
||||||
|
sizeof(ta_info->manufacturer_id));
|
||||||
|
memcpy(info->manufacturerID, ta_info->manufacturer_id,
|
||||||
|
sizeof(info->manufacturerID));
|
||||||
|
|
||||||
|
info->flags = ta_info->flags;
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->hardwareVersion) ==
|
||||||
|
sizeof(ta_info->hardware_version));
|
||||||
|
memcpy(&info->hardwareVersion, ta_info->hardware_version,
|
||||||
|
sizeof(info->hardwareVersion));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->firmwareVersion) ==
|
||||||
|
sizeof(ta_info->firmware_version));
|
||||||
|
memcpy(&info->firmwareVersion, ta_info->firmware_version,
|
||||||
|
sizeof(info->firmwareVersion));
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_token_get_info - Wrap C_GetTokenInfo into PKCS11_CMD_TOKEN_INFO
|
||||||
|
*/
|
||||||
|
CK_RV ck_token_get_info(CK_SLOT_ID slot, CK_TOKEN_INFO_PTR info)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out_shm = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
struct pkcs11_token_info *ta_info = NULL;
|
||||||
|
size_t out_size = 0;
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &slot_id, sizeof(slot_id));
|
||||||
|
|
||||||
|
out_shm = ckteec_alloc_shm(sizeof(*ta_info), CKTEEC_SHM_OUT);
|
||||||
|
if (!out_shm) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_TOKEN_INFO, ctrl,
|
||||||
|
out_shm, &out_size);
|
||||||
|
if (rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (out_size != out_shm->size) {
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ta_info = out_shm->buffer;
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->label) == sizeof(ta_info->label));
|
||||||
|
memcpy(info->label, ta_info->label, sizeof(info->label));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->manufacturerID) ==
|
||||||
|
sizeof(ta_info->manufacturer_id));
|
||||||
|
memcpy(info->manufacturerID, ta_info->manufacturer_id,
|
||||||
|
sizeof(info->manufacturerID));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->model) == sizeof(ta_info->model));
|
||||||
|
memcpy(info->model, ta_info->model, sizeof(info->model));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->serialNumber) ==
|
||||||
|
sizeof(ta_info->serial_number));
|
||||||
|
memcpy(info->serialNumber, ta_info->serial_number,
|
||||||
|
sizeof(info->serialNumber));
|
||||||
|
|
||||||
|
info->flags = ta_info->flags;
|
||||||
|
info->ulMaxSessionCount = ta_info->max_session_count;
|
||||||
|
info->ulSessionCount = ta_info->session_count;
|
||||||
|
info->ulMaxRwSessionCount = ta_info->max_rw_session_count;
|
||||||
|
info->ulRwSessionCount = ta_info->rw_session_count;
|
||||||
|
info->ulMaxPinLen = ta_info->max_pin_len;
|
||||||
|
info->ulMinPinLen = ta_info->min_pin_len;
|
||||||
|
info->ulTotalPublicMemory = ta_info->total_public_memory;
|
||||||
|
info->ulFreePublicMemory = ta_info->free_public_memory;
|
||||||
|
info->ulTotalPrivateMemory = ta_info->total_private_memory;
|
||||||
|
info->ulFreePrivateMemory = ta_info->free_private_memory;
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->hardwareVersion) ==
|
||||||
|
sizeof(ta_info->hardware_version));
|
||||||
|
memcpy(&info->hardwareVersion, ta_info->hardware_version,
|
||||||
|
sizeof(info->hardwareVersion));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->firmwareVersion) ==
|
||||||
|
sizeof(ta_info->firmware_version));
|
||||||
|
memcpy(&info->firmwareVersion, ta_info->firmware_version,
|
||||||
|
sizeof(info->firmwareVersion));
|
||||||
|
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(info->utcTime) == sizeof(ta_info->utc_time));
|
||||||
|
memcpy(&info->utcTime, ta_info->utc_time, sizeof(info->utcTime));
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out_shm);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_token_mechanism_ids - Wrap C_GetMechanismList
|
||||||
|
*/
|
||||||
|
CK_RV ck_token_mechanism_ids(CK_SLOT_ID slot,
|
||||||
|
CK_MECHANISM_TYPE_PTR mechanisms,
|
||||||
|
CK_ULONG_PTR count)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
uint32_t *mecha_ids = NULL;
|
||||||
|
size_t out_size = 0;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (!count)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* As per spec, if @mechanism is NULL, "The contents of *pulCount on
|
||||||
|
* entry to C_GetMechanismList has no meaning in this case (...)"
|
||||||
|
*/
|
||||||
|
if (mechanisms)
|
||||||
|
out_size = *count * sizeof(*mecha_ids);
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &slot_id, sizeof(slot_id));
|
||||||
|
|
||||||
|
out = ckteec_alloc_shm(out_size, CKTEEC_SHM_OUT);
|
||||||
|
if (!out) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_MECHANISM_IDS,
|
||||||
|
ctrl, out, &out_size);
|
||||||
|
|
||||||
|
if (rv == CKR_OK || rv == CKR_BUFFER_TOO_SMALL)
|
||||||
|
*count = out_size / sizeof(*mecha_ids);
|
||||||
|
|
||||||
|
if (!mechanisms && rv == CKR_BUFFER_TOO_SMALL)
|
||||||
|
rv = CKR_OK;
|
||||||
|
if (!mechanisms || rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
mecha_ids = out->buffer;
|
||||||
|
for (n = 0; n < *count; n++)
|
||||||
|
mechanisms[n] = mecha_ids[n];
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_token_mechanism_info - Wrap C_GetMechanismInfo into command MECHANISM_INFO
|
||||||
|
*/
|
||||||
|
CK_RV ck_token_mechanism_info(CK_SLOT_ID slot, CK_MECHANISM_TYPE type,
|
||||||
|
CK_MECHANISM_INFO_PTR info)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
uint32_t mecha_type = type;
|
||||||
|
struct pkcs11_mechanism_info *ta_info = NULL;
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t out_size = 0;
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(mecha_type),
|
||||||
|
CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf = ctrl->buffer;
|
||||||
|
|
||||||
|
memcpy(buf, &slot_id, sizeof(slot_id));
|
||||||
|
buf += sizeof(slot_id);
|
||||||
|
|
||||||
|
memcpy(buf, &mecha_type, sizeof(mecha_type));
|
||||||
|
|
||||||
|
out = ckteec_alloc_shm(sizeof(*ta_info), CKTEEC_SHM_OUT);
|
||||||
|
if (!out) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_MECHANISM_INFO,
|
||||||
|
ctrl, out, &out_size);
|
||||||
|
|
||||||
|
if (rv != CKR_OK || out_size != out->size) {
|
||||||
|
if (rv == CKR_OK)
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ta_info = out->buffer;
|
||||||
|
|
||||||
|
info->ulMinKeySize = ta_info->min_key_size;
|
||||||
|
info->ulMaxKeySize = ta_info->max_key_size;
|
||||||
|
info->flags = ta_info->flags;
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_open_session - Wrap C_OpenSession into PKCS11_CMD_OPEN_{RW|RO}_SESSION
|
||||||
|
*
|
||||||
|
* Note: cookie and callback are not utilized by libckteec and are silently
|
||||||
|
* sinked in to have better out-of-box compatibility with 3rd party libraries
|
||||||
|
* and applications which provides the callback.
|
||||||
|
*/
|
||||||
|
CK_RV ck_open_session(CK_SLOT_ID slot, CK_FLAGS flags, CK_VOID_PTR cookie,
|
||||||
|
CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
uint32_t u32_flags = flags;
|
||||||
|
uint32_t handle = 0;
|
||||||
|
size_t out_size = 0;
|
||||||
|
uint8_t *buf;
|
||||||
|
|
||||||
|
/* Ignore notify callback */
|
||||||
|
(void)cookie;
|
||||||
|
(void)callback;
|
||||||
|
|
||||||
|
if ((flags & ~(CKF_RW_SESSION | CKF_SERIAL_SESSION)) || !session)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [slot-id][flags] / [status] */
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(u32_flags),
|
||||||
|
CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
buf = (uint8_t *)ctrl->buffer;
|
||||||
|
memcpy(buf, &slot_id, sizeof(slot_id));
|
||||||
|
buf += sizeof(slot_id);
|
||||||
|
memcpy(buf, &u32_flags, sizeof(u32_flags));
|
||||||
|
|
||||||
|
/* Shm io2: (out) [session handle] */
|
||||||
|
out = ckteec_alloc_shm(sizeof(handle), CKTEEC_SHM_OUT);
|
||||||
|
if (!out) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_OPEN_SESSION,
|
||||||
|
ctrl, out, &out_size);
|
||||||
|
if (rv != CKR_OK || out_size != out->size) {
|
||||||
|
if (rv == CKR_OK)
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&handle, out->buffer, sizeof(handle));
|
||||||
|
*session = handle;
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_open_session - Wrap C_OpenSession into PKCS11_CMD_CLOSE_SESSION
|
||||||
|
*/
|
||||||
|
CK_RV ck_close_session(CK_SESSION_HANDLE session)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t session_handle = session;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [session-handle] / [status] */
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &session_handle, sizeof(session_handle));
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_SESSION, ctrl);
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_close_all_sessions - Wrap C_CloseAllSessions into TA command
|
||||||
|
*/
|
||||||
|
CK_RV ck_close_all_sessions(CK_SLOT_ID slot)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [slot-id] / [status] */
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &slot_id, sizeof(slot_id));
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_ALL_SESSIONS, ctrl);
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_get_session_info - Wrap C_GetSessionInfo into PKCS11_CMD_SESSION_INFO
|
||||||
|
*/
|
||||||
|
CK_RV ck_get_session_info(CK_SESSION_HANDLE session,
|
||||||
|
CK_SESSION_INFO_PTR info)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out = NULL;
|
||||||
|
uint32_t session_handle = session;
|
||||||
|
struct pkcs11_session_info *ta_info = NULL;
|
||||||
|
size_t out_size = 0;
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [session-handle] / [status] */
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memcpy(ctrl->buffer, &session_handle, sizeof(session_handle));
|
||||||
|
|
||||||
|
/* Shm io2: (out) [session info] */
|
||||||
|
out = ckteec_alloc_shm(sizeof(struct pkcs11_session_info),
|
||||||
|
CKTEEC_SHM_OUT);
|
||||||
|
if (!out) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_SESSION_INFO,
|
||||||
|
ctrl, out, &out_size);
|
||||||
|
|
||||||
|
if (rv != CKR_OK || out_size != out->size) {
|
||||||
|
if (rv == CKR_OK)
|
||||||
|
rv = CKR_DEVICE_ERROR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ta_info = (struct pkcs11_session_info *)out->buffer;
|
||||||
|
info->slotID = ta_info->slot_id;
|
||||||
|
info->state = ta_info->state;
|
||||||
|
info->flags = ta_info->flags;
|
||||||
|
info->ulDeviceError = ta_info->device_error;
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
ckteec_free_shm(out);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_init_token - Wrap C_InitToken into PKCS11_CMD_INIT_TOKEN
|
||||||
|
*/
|
||||||
|
CK_RV ck_init_token(CK_SLOT_ID slot, CK_UTF8CHAR_PTR pin,
|
||||||
|
CK_ULONG pin_len, CK_UTF8CHAR_PTR label)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t slot_id = slot;
|
||||||
|
uint32_t pkcs11_pin_len = pin_len;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
if (!pin && pin_len)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
if (!label)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [slot-id][pin_len][label][pin] / [status] */
|
||||||
|
ctrl_size = sizeof(slot_id) + sizeof(pkcs11_pin_len) +
|
||||||
|
32 * sizeof(uint8_t) + pkcs11_pin_len;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
buf = ctrl->buffer;
|
||||||
|
|
||||||
|
memcpy(buf, &slot_id, sizeof(slot_id));
|
||||||
|
buf += sizeof(slot_id);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_pin_len, sizeof(pkcs11_pin_len));
|
||||||
|
buf += sizeof(pkcs11_pin_len);
|
||||||
|
|
||||||
|
memcpy(buf, label, 32 * sizeof(uint8_t));
|
||||||
|
buf += 32 * sizeof(uint8_t);
|
||||||
|
|
||||||
|
memcpy(buf, pin, pkcs11_pin_len);
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_TOKEN, ctrl);
|
||||||
|
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_init_pin - Wrap C_InitPIN into PKCS11_CMD_INIT_PIN
|
||||||
|
*/
|
||||||
|
CK_RV ck_init_pin(CK_SESSION_HANDLE session,
|
||||||
|
CK_UTF8CHAR_PTR pin, CK_ULONG pin_len)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t pkcs11_session = session;
|
||||||
|
uint32_t pkcs11_pin_len = pin_len;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
if (!pin && pin_len)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/* Shm io0: (in/out) ctrl = [session][pin_len][pin] / [status] */
|
||||||
|
ctrl_size = sizeof(pkcs11_session) + sizeof(pkcs11_pin_len) +
|
||||||
|
pkcs11_pin_len;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
buf = ctrl->buffer;
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_session, sizeof(pkcs11_session));
|
||||||
|
buf += sizeof(pkcs11_session);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_pin_len, sizeof(pkcs11_pin_len));
|
||||||
|
buf += sizeof(pkcs11_pin_len);
|
||||||
|
|
||||||
|
memcpy(buf, pin, pkcs11_pin_len);
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_PIN, ctrl);
|
||||||
|
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_set_pin - Wrap C_SetPIN into PKCS11_CMD_SET_PIN
|
||||||
|
*/
|
||||||
|
CK_RV ck_set_pin(CK_SESSION_HANDLE session,
|
||||||
|
CK_UTF8CHAR_PTR old, CK_ULONG old_len,
|
||||||
|
CK_UTF8CHAR_PTR new, CK_ULONG new_len)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t pkcs11_session = session;
|
||||||
|
uint32_t pkcs11_old_len = old_len;
|
||||||
|
uint32_t pkcs11_new_len = new_len;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
char *buf;
|
||||||
|
|
||||||
|
if ((!old && old_len) || (!new && new_len))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Shm io0: (in/out) ctrl
|
||||||
|
* (in) [session][old_pin_len][new_pin_len][old pin][new pin]
|
||||||
|
* (out) [status]
|
||||||
|
*/
|
||||||
|
ctrl_size = sizeof(pkcs11_session) + sizeof(pkcs11_old_len) +
|
||||||
|
sizeof(pkcs11_new_len) + pkcs11_old_len + pkcs11_new_len;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
buf = ctrl->buffer;
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_session, sizeof(pkcs11_session));
|
||||||
|
buf += sizeof(pkcs11_session);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_old_len, sizeof(pkcs11_old_len));
|
||||||
|
buf += sizeof(pkcs11_old_len);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_new_len, sizeof(pkcs11_new_len));
|
||||||
|
buf += sizeof(pkcs11_new_len);
|
||||||
|
|
||||||
|
memcpy(buf, old, pkcs11_old_len);
|
||||||
|
buf += pkcs11_old_len;
|
||||||
|
|
||||||
|
memcpy(buf, new, pkcs11_new_len);
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_SET_PIN, ctrl);
|
||||||
|
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_login - Wrap C_Login into PKCS11_CMD_LOGIN
|
||||||
|
*/
|
||||||
|
CK_RV ck_login(CK_SESSION_HANDLE session, CK_USER_TYPE user_type,
|
||||||
|
CK_UTF8CHAR_PTR pin, CK_ULONG pin_len)
|
||||||
|
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t pkcs11_session = session;
|
||||||
|
uint32_t pkcs11_user = user_type;
|
||||||
|
uint32_t pkcs11_pin_len = pin_len;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
if (!pin && pin_len)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
/* Shm io0: (i/o) ctrl = [session][user][pin length][pin] / [status] */
|
||||||
|
ctrl_size = sizeof(pkcs11_session) + sizeof(pkcs11_user) +
|
||||||
|
sizeof(pkcs11_pin_len) + pkcs11_pin_len;
|
||||||
|
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
buf = ctrl->buffer;
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_session, sizeof(pkcs11_session));
|
||||||
|
buf += sizeof(pkcs11_session);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_user, sizeof(pkcs11_user));
|
||||||
|
buf += sizeof(pkcs11_user);
|
||||||
|
|
||||||
|
memcpy(buf, &pkcs11_pin_len, sizeof(pkcs11_pin_len));
|
||||||
|
buf += sizeof(pkcs11_pin_len);
|
||||||
|
|
||||||
|
memcpy(buf, pin, pkcs11_pin_len);
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGIN, ctrl);
|
||||||
|
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ck_logout - Wrap C_Logout into PKCS11_CMD_LOGOUT
|
||||||
|
*/
|
||||||
|
CK_RV ck_logout(CK_SESSION_HANDLE session)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
uint32_t session_handle = session;
|
||||||
|
|
||||||
|
/* io0 = [session-handle] */
|
||||||
|
ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
memcpy(ctrl->buffer, &session_handle, sizeof(session_handle));
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGOUT, ctrl);
|
||||||
|
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV ck_seed_random(CK_SESSION_HANDLE session, CK_BYTE_PTR seed,
|
||||||
|
CK_ULONG length)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *in_shm = NULL;
|
||||||
|
uint32_t session_handle = session;
|
||||||
|
|
||||||
|
if (!seed && length)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
if (!seed)
|
||||||
|
return CKR_OK;
|
||||||
|
|
||||||
|
/* Shm io0: (i/o) [session-handle] / [status] */
|
||||||
|
ctrl_size = sizeof(session_handle);
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
memcpy(ctrl->buffer, &session_handle, sizeof(session_handle));
|
||||||
|
|
||||||
|
/* Shm io1: (in) [seed data] */
|
||||||
|
in_shm = ckteec_register_shm(seed, length, CKTEEC_SHM_IN);
|
||||||
|
if (!in_shm) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_in(PKCS11_CMD_SEED_RANDOM, ctrl, in_shm);
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(in_shm);
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV ck_generate_random(CK_SESSION_HANDLE session, CK_BYTE_PTR data,
|
||||||
|
CK_ULONG length)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
size_t ctrl_size = 0;
|
||||||
|
TEEC_SharedMemory *ctrl = NULL;
|
||||||
|
TEEC_SharedMemory *out_shm = NULL;
|
||||||
|
uint32_t session_handle = session;
|
||||||
|
size_t out_size = 0;
|
||||||
|
|
||||||
|
if (!data && length)
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
if (!data)
|
||||||
|
return CKR_OK;
|
||||||
|
|
||||||
|
/* Shm io0: (i/o) [session-handle] / [status] */
|
||||||
|
ctrl_size = sizeof(session_handle);
|
||||||
|
ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT);
|
||||||
|
if (!ctrl)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
memcpy(ctrl->buffer, &session_handle, sizeof(session_handle));
|
||||||
|
|
||||||
|
/* Shm io2: (out) [generated random] */
|
||||||
|
out_shm = ckteec_register_shm(data, length, CKTEEC_SHM_OUT);
|
||||||
|
if (!out_shm) {
|
||||||
|
rv = CKR_HOST_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = ckteec_invoke_ctrl_out(PKCS11_CMD_GENERATE_RANDOM, ctrl, out_shm,
|
||||||
|
&out_size);
|
||||||
|
|
||||||
|
out:
|
||||||
|
ckteec_free_shm(out_shm);
|
||||||
|
ckteec_free_shm(ctrl);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
59
optee/optee_client/libckteec/src/pkcs11_token.h
Normal file
59
optee/optee_client/libckteec/src/pkcs11_token.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCKTEEC_PKCS11_TOKEN_H
|
||||||
|
#define LIBCKTEEC_PKCS11_TOKEN_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
|
||||||
|
#include "invoke_ta.h"
|
||||||
|
|
||||||
|
CK_RV ck_get_info(CK_INFO_PTR info);
|
||||||
|
|
||||||
|
CK_RV ck_slot_get_list(CK_BBOOL present,
|
||||||
|
CK_SLOT_ID_PTR slots, CK_ULONG_PTR count);
|
||||||
|
|
||||||
|
CK_RV ck_slot_get_info(CK_SLOT_ID slot, CK_SLOT_INFO_PTR info);
|
||||||
|
|
||||||
|
CK_RV ck_token_get_info(CK_SLOT_ID slot, CK_TOKEN_INFO_PTR info);
|
||||||
|
|
||||||
|
CK_RV ck_token_mechanism_ids(CK_SLOT_ID slot,
|
||||||
|
CK_MECHANISM_TYPE_PTR mechanisms,
|
||||||
|
CK_ULONG_PTR count);
|
||||||
|
|
||||||
|
CK_RV ck_token_mechanism_info(CK_SLOT_ID slot, CK_MECHANISM_TYPE type,
|
||||||
|
CK_MECHANISM_INFO_PTR info);
|
||||||
|
|
||||||
|
CK_RV ck_open_session(CK_SLOT_ID slot, CK_FLAGS flags, CK_VOID_PTR cookie,
|
||||||
|
CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session);
|
||||||
|
|
||||||
|
CK_RV ck_close_session(CK_SESSION_HANDLE session);
|
||||||
|
|
||||||
|
CK_RV ck_close_all_sessions(CK_SLOT_ID slot);
|
||||||
|
|
||||||
|
CK_RV ck_get_session_info(CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info);
|
||||||
|
|
||||||
|
CK_RV ck_init_token(CK_SLOT_ID slot, CK_UTF8CHAR_PTR pin,
|
||||||
|
CK_ULONG pin_len, CK_UTF8CHAR_PTR label);
|
||||||
|
|
||||||
|
CK_RV ck_init_pin(CK_SESSION_HANDLE session,
|
||||||
|
CK_UTF8CHAR_PTR pin, CK_ULONG pin_len);
|
||||||
|
|
||||||
|
CK_RV ck_set_pin(CK_SESSION_HANDLE session,
|
||||||
|
CK_UTF8CHAR_PTR old, CK_ULONG old_len,
|
||||||
|
CK_UTF8CHAR_PTR new, CK_ULONG new_len);
|
||||||
|
|
||||||
|
CK_RV ck_login(CK_SESSION_HANDLE session, CK_USER_TYPE user_type,
|
||||||
|
CK_UTF8CHAR_PTR pin, CK_ULONG pin_len);
|
||||||
|
|
||||||
|
CK_RV ck_logout(CK_SESSION_HANDLE session);
|
||||||
|
|
||||||
|
CK_RV ck_seed_random(CK_SESSION_HANDLE session, CK_BYTE_PTR seed,
|
||||||
|
CK_ULONG length);
|
||||||
|
|
||||||
|
CK_RV ck_generate_random(CK_SESSION_HANDLE session, CK_BYTE_PTR data,
|
||||||
|
CK_ULONG length);
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_PKCS11_TOKEN_H*/
|
||||||
791
optee/optee_client/libckteec/src/serialize_ck.c
Normal file
791
optee/optee_client/libckteec/src/serialize_ck.c
Normal file
@@ -0,0 +1,791 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ck_debug.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ck_helpers.h"
|
||||||
|
#include "local_utils.h"
|
||||||
|
#include "serializer.h"
|
||||||
|
#include "serialize_ck.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Serialization and de-serialization logic
|
||||||
|
*
|
||||||
|
* Cryptoki API works in a way that user application uses memory references
|
||||||
|
* in object attributes description. TA can be invoked with only a small set
|
||||||
|
* of possible references to caller memory. Thus a Cryptoki object, made of
|
||||||
|
* data and pointers to data, is reassembled into a byte array where each
|
||||||
|
* attribute info (ID, value size, value) is appended with byte alignment. This
|
||||||
|
* so-called serialized object can be passed through the TA API.
|
||||||
|
*
|
||||||
|
* Initial entry to PKCS11 TA uses serialize_ck_attributes(). When TA
|
||||||
|
* returns with updated serialized data to be passed back to caller, we call
|
||||||
|
* deserialize_ck_attributes().
|
||||||
|
*
|
||||||
|
* Special handling is performed for CK_ULONG passing which may be either 32
|
||||||
|
* bits or 64 bits depending on target device architecture. In TA interface
|
||||||
|
* this is handled as unsigned 32 bit data type.
|
||||||
|
*
|
||||||
|
* When user application is querying attributes in example with
|
||||||
|
* C_GetAttributeValue() user may allocate larger value buffers. During entry
|
||||||
|
* to TA shared buffer is allocated in serialize_ck_attributes() based on
|
||||||
|
* caller's arguments. For each attribute TA verifies if value fits in
|
||||||
|
* the buffer and if it does, value is returned. Value size in buffer is
|
||||||
|
* updated to indicate real size of the value. When call is returned back to
|
||||||
|
* REE deserialize_ck_attributes() is invoked and then both input arguments and
|
||||||
|
* serialization buffer are used to return values to caller. Provided input
|
||||||
|
* arguments from caller are used to determine serialization buffer structure
|
||||||
|
* and then actual values and value sizes are then decoded from serialization
|
||||||
|
* buffer and returned to caller in caller's allocated memory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Generic way of serializing CK keys, certificates, mechanism parameters, ...
|
||||||
|
* In cryptoki 2.40 parameters are almost all packaged as structure below:
|
||||||
|
*/
|
||||||
|
struct ck_ref {
|
||||||
|
CK_ULONG id;
|
||||||
|
CK_BYTE_PTR ptr;
|
||||||
|
CK_ULONG len;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is for attributes that contains data memory indirections.
|
||||||
|
* In other words, an attributes that defines a list of attributes.
|
||||||
|
* They are identified from the attribute type CKA_...
|
||||||
|
*
|
||||||
|
* @obj - ref used to track the serial object being created
|
||||||
|
* @attribute - pointer to a structure aligned of the CK_ATTRIBUTE struct
|
||||||
|
*/
|
||||||
|
static CK_RV serialize_indirect_attribute(struct serializer *obj,
|
||||||
|
CK_ATTRIBUTE_PTR attribute)
|
||||||
|
{
|
||||||
|
CK_ATTRIBUTE_PTR attr = NULL;
|
||||||
|
CK_ULONG count = 0;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
struct serializer obj2 = { 0 };
|
||||||
|
|
||||||
|
switch (attribute->type) {
|
||||||
|
/* These are serialized each separately */
|
||||||
|
case CKA_DERIVE_TEMPLATE:
|
||||||
|
case CKA_WRAP_TEMPLATE:
|
||||||
|
case CKA_UNWRAP_TEMPLATE:
|
||||||
|
count = attribute->ulValueLen / sizeof(CK_ATTRIBUTE);
|
||||||
|
attr = (CK_ATTRIBUTE_PTR)attribute->pValue;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return CKR_NO_EVENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a serialized object for the content */
|
||||||
|
rv = serialize_ck_attributes(&obj2, attr, count);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Append the created serialized object into target object:
|
||||||
|
* [attrib-id][byte-size][attributes-data]
|
||||||
|
*/
|
||||||
|
rv = serialize_32b(obj, attribute->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj2.size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_buffer(obj, obj2.buffer, obj2.size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
obj->item_count++;
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV deserialize_indirect_attribute(struct pkcs11_attribute_head *obj,
|
||||||
|
CK_ATTRIBUTE_PTR attribute)
|
||||||
|
{
|
||||||
|
CK_ULONG count = 0;
|
||||||
|
CK_ATTRIBUTE_PTR attr = NULL;
|
||||||
|
|
||||||
|
switch (attribute->type) {
|
||||||
|
/* These are serialized each separately */
|
||||||
|
case CKA_DERIVE_TEMPLATE:
|
||||||
|
case CKA_WRAP_TEMPLATE:
|
||||||
|
case CKA_UNWRAP_TEMPLATE:
|
||||||
|
count = attribute->ulValueLen / sizeof(CK_ATTRIBUTE);
|
||||||
|
attr = (CK_ATTRIBUTE_PTR)attribute->pValue;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return CKR_GENERAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return deserialize_ck_attributes(obj->data, attr, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ck_attr_is_ulong(CK_ATTRIBUTE_TYPE attribute_id)
|
||||||
|
{
|
||||||
|
switch (attribute_id) {
|
||||||
|
case CKA_CLASS:
|
||||||
|
case CKA_CERTIFICATE_TYPE:
|
||||||
|
case CKA_CERTIFICATE_CATEGORY:
|
||||||
|
case CKA_NAME_HASH_ALGORITHM:
|
||||||
|
case CKA_KEY_TYPE:
|
||||||
|
case CKA_HW_FEATURE_TYPE:
|
||||||
|
case CKA_MECHANISM_TYPE:
|
||||||
|
case CKA_KEY_GEN_MECHANISM:
|
||||||
|
case CKA_VALUE_LEN:
|
||||||
|
case CKA_MODULUS_BITS:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_ck_attribute(struct serializer *obj, CK_ATTRIBUTE *attr)
|
||||||
|
{
|
||||||
|
CK_MECHANISM_TYPE *type = NULL;
|
||||||
|
uint32_t pkcs11_size = 0;
|
||||||
|
uint32_t pkcs11_data32 = 0;
|
||||||
|
void *pkcs11_pdata = NULL;
|
||||||
|
uint32_t *mech_buf = NULL;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
unsigned int n = 0;
|
||||||
|
unsigned int m = 0;
|
||||||
|
|
||||||
|
if (attr->type == PKCS11_UNDEFINED_ID)
|
||||||
|
return CKR_ATTRIBUTE_TYPE_INVALID;
|
||||||
|
|
||||||
|
switch (attr->type) {
|
||||||
|
case CKA_DERIVE_TEMPLATE:
|
||||||
|
case CKA_WRAP_TEMPLATE:
|
||||||
|
case CKA_UNWRAP_TEMPLATE:
|
||||||
|
return serialize_indirect_attribute(obj, attr);
|
||||||
|
case CKA_ALLOWED_MECHANISMS:
|
||||||
|
n = attr->ulValueLen / sizeof(CK_ULONG);
|
||||||
|
pkcs11_size = n * sizeof(uint32_t);
|
||||||
|
mech_buf = malloc(pkcs11_size);
|
||||||
|
if (!mech_buf)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
type = attr->pValue;
|
||||||
|
for (m = 0; m < n; m++) {
|
||||||
|
mech_buf[m] = type[m];
|
||||||
|
if (mech_buf[m] == PKCS11_UNDEFINED_ID) {
|
||||||
|
rv = CKR_MECHANISM_INVALID;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pkcs11_pdata = mech_buf;
|
||||||
|
break;
|
||||||
|
/* Attributes which data value do not need conversion (aside ulong) */
|
||||||
|
default:
|
||||||
|
pkcs11_pdata = attr->pValue;
|
||||||
|
if (!attr->pValue) {
|
||||||
|
pkcs11_size = 0;
|
||||||
|
} else if (ck_attr_is_ulong(attr->type)) {
|
||||||
|
CK_ULONG ck_ulong = 0;
|
||||||
|
|
||||||
|
if (attr->ulValueLen < sizeof(CK_ULONG))
|
||||||
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
||||||
|
|
||||||
|
memcpy(&ck_ulong, attr->pValue, sizeof(ck_ulong));
|
||||||
|
pkcs11_data32 = ck_ulong;
|
||||||
|
pkcs11_pdata = &pkcs11_data32;
|
||||||
|
pkcs11_size = sizeof(uint32_t);
|
||||||
|
} else {
|
||||||
|
pkcs11_size = attr->ulValueLen;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, attr->type);
|
||||||
|
if (rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, pkcs11_size);
|
||||||
|
if (rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
rv = serialize_buffer(obj, pkcs11_pdata, pkcs11_size);
|
||||||
|
if (rv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
obj->item_count++;
|
||||||
|
out:
|
||||||
|
free(mech_buf);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* CK attribute reference arguments are list of attribute item */
|
||||||
|
CK_RV serialize_ck_attributes(struct serializer *obj,
|
||||||
|
CK_ATTRIBUTE_PTR attributes, CK_ULONG count)
|
||||||
|
{
|
||||||
|
CK_ULONG n = 0;
|
||||||
|
CK_RV rv = CKR_OK;
|
||||||
|
|
||||||
|
rv = init_serial_object(obj);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
for (n = 0; n < count; n++) {
|
||||||
|
rv = serialize_ck_attribute(obj, attributes + n);
|
||||||
|
if (rv)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rv)
|
||||||
|
release_serial_object(obj);
|
||||||
|
else
|
||||||
|
finalize_serial_object(obj);
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV deserialize_mecha_list(CK_MECHANISM_TYPE *dst, void *src,
|
||||||
|
size_t count)
|
||||||
|
{
|
||||||
|
char *ta_src = src;
|
||||||
|
size_t n = 0;
|
||||||
|
uint32_t mecha_id = 0;
|
||||||
|
|
||||||
|
for (n = 0; n < count; n++) {
|
||||||
|
memcpy(&mecha_id, ta_src + n * sizeof(mecha_id),
|
||||||
|
sizeof(mecha_id));
|
||||||
|
dst[n] = mecha_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV deserialize_ck_attribute(struct pkcs11_attribute_head *in,
|
||||||
|
uint8_t *data, CK_ATTRIBUTE_PTR out)
|
||||||
|
{
|
||||||
|
CK_ULONG ck_ulong = 0;
|
||||||
|
uint32_t pkcs11_data32 = 0;
|
||||||
|
CK_RV rv = CKR_OK;
|
||||||
|
|
||||||
|
out->type = in->id;
|
||||||
|
|
||||||
|
if (in->size == PKCS11_CK_UNAVAILABLE_INFORMATION) {
|
||||||
|
out->ulValueLen = CK_UNAVAILABLE_INFORMATION;
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!out->pValue && ck_attr_is_ulong(out->type)) {
|
||||||
|
out->ulValueLen = sizeof(CK_ULONG);
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (out->ulValueLen < in->size) {
|
||||||
|
out->ulValueLen = in->size;
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!out->pValue)
|
||||||
|
return CKR_OK;
|
||||||
|
|
||||||
|
/* Specific ulong encoded as 32bit in PKCS11 TA API */
|
||||||
|
if (ck_attr_is_ulong(out->type)) {
|
||||||
|
if (out->ulValueLen < sizeof(CK_ULONG))
|
||||||
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
||||||
|
|
||||||
|
memcpy(&pkcs11_data32, data, sizeof(uint32_t));
|
||||||
|
if (out->type == CKA_KEY_GEN_MECHANISM &&
|
||||||
|
pkcs11_data32 == PKCS11_CK_UNAVAILABLE_INFORMATION)
|
||||||
|
ck_ulong = CK_UNAVAILABLE_INFORMATION;
|
||||||
|
else
|
||||||
|
ck_ulong = pkcs11_data32;
|
||||||
|
|
||||||
|
memcpy(out->pValue, &ck_ulong, sizeof(CK_ULONG));
|
||||||
|
out->ulValueLen = sizeof(CK_ULONG);
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (out->type) {
|
||||||
|
case CKA_DERIVE_TEMPLATE:
|
||||||
|
case CKA_WRAP_TEMPLATE:
|
||||||
|
case CKA_UNWRAP_TEMPLATE:
|
||||||
|
rv = deserialize_indirect_attribute(in, out->pValue);
|
||||||
|
break;
|
||||||
|
case CKA_ALLOWED_MECHANISMS:
|
||||||
|
rv = deserialize_mecha_list(out->pValue, data,
|
||||||
|
in->size / sizeof(uint32_t));
|
||||||
|
out->ulValueLen = in->size / sizeof(uint32_t) *
|
||||||
|
sizeof(CK_ULONG);
|
||||||
|
break;
|
||||||
|
/* Attributes which data value do not need conversion (aside ulong) */
|
||||||
|
default:
|
||||||
|
memcpy(out->pValue, data, in->size);
|
||||||
|
out->ulValueLen = in->size;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV deserialize_ck_attributes(uint8_t *in, CK_ATTRIBUTE_PTR attributes,
|
||||||
|
CK_ULONG count)
|
||||||
|
{
|
||||||
|
CK_ATTRIBUTE_PTR cur_attr = attributes;
|
||||||
|
CK_ULONG n = 0;
|
||||||
|
CK_RV rv = CKR_OK;
|
||||||
|
uint8_t *curr_head = in;
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
|
curr_head += sizeof(struct pkcs11_object_head);
|
||||||
|
|
||||||
|
for (n = count; n > 0; n--, cur_attr++, curr_head += len) {
|
||||||
|
struct pkcs11_attribute_head *cli_ref = (void *)curr_head;
|
||||||
|
struct pkcs11_attribute_head cli_head = { 0 };
|
||||||
|
void *data_ptr = NULL;
|
||||||
|
|
||||||
|
/* Make copy if header so that is aligned properly. */
|
||||||
|
memcpy(&cli_head, cli_ref, sizeof(cli_head));
|
||||||
|
|
||||||
|
/* Get real data pointer from template data */
|
||||||
|
data_ptr = cli_ref->data;
|
||||||
|
|
||||||
|
len = sizeof(cli_head);
|
||||||
|
|
||||||
|
/* Advance by size provisioned in input serialized buffer */
|
||||||
|
if (cur_attr->pValue) {
|
||||||
|
if (ck_attr_is_ulong(cur_attr->type))
|
||||||
|
len += sizeof(uint32_t);
|
||||||
|
else
|
||||||
|
len += cur_attr->ulValueLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv = deserialize_ck_attribute(&cli_head, data_ptr, cur_attr);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Serialization of CK mechanism parameters
|
||||||
|
*
|
||||||
|
* Most mechanism have no parameters.
|
||||||
|
* Some mechanism have a single 32bit parameter.
|
||||||
|
* Some mechanism have a specific parameter structure which may contain
|
||||||
|
* indirected data (data referred by a buffer pointer).
|
||||||
|
*
|
||||||
|
* Below are each structure specific mechanisms parameters.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_aes_ctr(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_AES_CTR_PARAMS_PTR param = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
uint32_t size = 0;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
size = sizeof(uint32_t) + sizeof(param->cb);
|
||||||
|
rv = serialize_32b(obj, size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, param->ulCounterBits);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_buffer(obj, param->cb, sizeof(param->cb));
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_aes_iv(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
uint32_t iv_size = mecha->ulParameterLen;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, iv_size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, mecha->pParameter, mecha->ulParameterLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_key_deriv_str(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_KEY_DERIVATION_STRING_DATA_PTR param = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
uint32_t size = 0;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
size = sizeof(uint32_t) + param->ulLen;
|
||||||
|
rv = serialize_32b(obj, size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, param->ulLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, param->pData, param->ulLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_ecdh1_derive_param(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_ECDH1_DERIVE_PARAMS *params = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
size_t params_size = 3 * sizeof(uint32_t) + params->ulSharedDataLen +
|
||||||
|
params->ulPublicDataLen;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params_size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params->kdf);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params->ulSharedDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_buffer(obj, params->pSharedData,
|
||||||
|
params->ulSharedDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params->ulPublicDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, params->pPublicData,
|
||||||
|
params->ulPublicDataLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_aes_cbc_encrypt_data(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR param = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
uint32_t size = 0;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
size = sizeof(param->iv) + sizeof(uint32_t) + param->length;
|
||||||
|
rv = serialize_32b(obj, size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_buffer(obj, param->iv, sizeof(param->iv));
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, param->length);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, param->pData, param->length);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_rsa_pss_param(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_RSA_PKCS_PSS_PARAMS *params = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
uint32_t params_size = 3 * sizeof(uint32_t);
|
||||||
|
|
||||||
|
if (mecha->ulParameterLen != sizeof(*params))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params_size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->hashAlg);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->mgf);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_ck_ulong(obj, params->sLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_rsa_oaep_param(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_RSA_PKCS_OAEP_PARAMS *params = mecha->pParameter;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
size_t params_size = 4 * sizeof(uint32_t) + params->ulSourceDataLen;
|
||||||
|
|
||||||
|
if (mecha->ulParameterLen != sizeof(*params))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params_size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->hashAlg);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->mgf);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->source);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->ulSourceDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, params->pSourceData,
|
||||||
|
params->ulSourceDataLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_rsa_aes_key_wrap(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_RSA_AES_KEY_WRAP_PARAMS *params = mecha->pParameter;
|
||||||
|
CK_RSA_PKCS_OAEP_PARAMS *aes_params = params->pOAEPParams;
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
size_t params_size = 5 * sizeof(uint32_t) + aes_params->ulSourceDataLen;
|
||||||
|
|
||||||
|
if (mecha->ulParameterLen != sizeof(*params))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params_size);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, params->ulAESKeyBits);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, aes_params->hashAlg);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, aes_params->mgf);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, aes_params->source);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_ck_ulong(obj, aes_params->ulSourceDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, aes_params->pSourceData,
|
||||||
|
aes_params->ulSourceDataLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_eddsa(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
CK_EDDSA_PARAMS *params = mecha->pParameter;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, 2 * sizeof(uint32_t) + params->ulContextDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params->phFlag);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, params->ulContextDataLen);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, params->pContextData, params->ulContextDataLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CK_RV serialize_mecha_mac_general_param(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mecha)
|
||||||
|
{
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
CK_ULONG ck_data = 0;
|
||||||
|
|
||||||
|
if (mecha->ulParameterLen != sizeof(ck_data))
|
||||||
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
|
||||||
|
memcpy(&ck_data, mecha->pParameter, mecha->ulParameterLen);
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, sizeof(uint32_t));
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_ck_ulong(obj, ck_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* serialize_ck_mecha_params - serialize a mechanism type & params
|
||||||
|
*
|
||||||
|
* @obj - serializer used to track the serialization
|
||||||
|
* @mechanism - pointer of the in structure aligned CK_MECHANISM.
|
||||||
|
*
|
||||||
|
* Serialized content:
|
||||||
|
* [mechanism-type][mechanism-param-blob]
|
||||||
|
*
|
||||||
|
* [mechanism-param-blob] depends on mechanism type ID, see
|
||||||
|
* serialize_mecha_XXX().
|
||||||
|
*/
|
||||||
|
CK_RV serialize_ck_mecha_params(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mechanism)
|
||||||
|
{
|
||||||
|
CK_MECHANISM mecha = { 0 };
|
||||||
|
CK_RV rv = CKR_GENERAL_ERROR;
|
||||||
|
|
||||||
|
memset(obj, 0, sizeof(*obj));
|
||||||
|
|
||||||
|
obj->object = PKCS11_CKO_MECHANISM;
|
||||||
|
|
||||||
|
mecha = *mechanism;
|
||||||
|
obj->type = mecha.mechanism;
|
||||||
|
if (obj->type == PKCS11_UNDEFINED_ID)
|
||||||
|
return CKR_MECHANISM_INVALID;
|
||||||
|
|
||||||
|
switch (mecha.mechanism) {
|
||||||
|
case CKM_GENERIC_SECRET_KEY_GEN:
|
||||||
|
case CKM_AES_KEY_GEN:
|
||||||
|
case CKM_AES_ECB:
|
||||||
|
case CKM_AES_CMAC:
|
||||||
|
case CKM_MD5:
|
||||||
|
case CKM_SHA_1:
|
||||||
|
case CKM_SHA224:
|
||||||
|
case CKM_SHA256:
|
||||||
|
case CKM_SHA384:
|
||||||
|
case CKM_SHA512:
|
||||||
|
case CKM_MD5_HMAC:
|
||||||
|
case CKM_SHA_1_HMAC:
|
||||||
|
case CKM_SHA224_HMAC:
|
||||||
|
case CKM_SHA256_HMAC:
|
||||||
|
case CKM_SHA384_HMAC:
|
||||||
|
case CKM_SHA512_HMAC:
|
||||||
|
case CKM_EC_KEY_PAIR_GEN:
|
||||||
|
case CKM_EC_EDWARDS_KEY_PAIR_GEN:
|
||||||
|
case CKM_ECDSA:
|
||||||
|
case CKM_ECDSA_SHA1:
|
||||||
|
case CKM_ECDSA_SHA224:
|
||||||
|
case CKM_ECDSA_SHA256:
|
||||||
|
case CKM_ECDSA_SHA384:
|
||||||
|
case CKM_ECDSA_SHA512:
|
||||||
|
case CKM_RSA_PKCS_KEY_PAIR_GEN:
|
||||||
|
case CKM_RSA_PKCS:
|
||||||
|
case CKM_MD5_RSA_PKCS:
|
||||||
|
case CKM_SHA1_RSA_PKCS:
|
||||||
|
case CKM_SHA224_RSA_PKCS:
|
||||||
|
case CKM_SHA256_RSA_PKCS:
|
||||||
|
case CKM_SHA384_RSA_PKCS:
|
||||||
|
case CKM_SHA512_RSA_PKCS:
|
||||||
|
/* No parameter expected, size shall be 0 */
|
||||||
|
if (mechanism->ulParameterLen)
|
||||||
|
return CKR_MECHANISM_PARAM_INVALID;
|
||||||
|
|
||||||
|
rv = serialize_32b(obj, obj->type);
|
||||||
|
if (rv)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
return serialize_32b(obj, 0);
|
||||||
|
|
||||||
|
case CKM_EDDSA:
|
||||||
|
return serialize_mecha_eddsa(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_AES_CBC:
|
||||||
|
case CKM_AES_CBC_PAD:
|
||||||
|
case CKM_AES_CTS:
|
||||||
|
return serialize_mecha_aes_iv(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_AES_CTR:
|
||||||
|
return serialize_mecha_aes_ctr(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_AES_ECB_ENCRYPT_DATA:
|
||||||
|
return serialize_mecha_key_deriv_str(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_AES_CBC_ENCRYPT_DATA:
|
||||||
|
return serialize_mecha_aes_cbc_encrypt_data(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_ECDH1_DERIVE:
|
||||||
|
case CKM_ECDH1_COFACTOR_DERIVE:
|
||||||
|
return serialize_mecha_ecdh1_derive_param(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_RSA_PKCS_PSS:
|
||||||
|
case CKM_SHA1_RSA_PKCS_PSS:
|
||||||
|
case CKM_SHA256_RSA_PKCS_PSS:
|
||||||
|
case CKM_SHA384_RSA_PKCS_PSS:
|
||||||
|
case CKM_SHA512_RSA_PKCS_PSS:
|
||||||
|
case CKM_SHA224_RSA_PKCS_PSS:
|
||||||
|
return serialize_mecha_rsa_pss_param(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_RSA_PKCS_OAEP:
|
||||||
|
return serialize_mecha_rsa_oaep_param(obj, &mecha);
|
||||||
|
|
||||||
|
case CKM_AES_CMAC_GENERAL:
|
||||||
|
case CKM_MD5_HMAC_GENERAL:
|
||||||
|
case CKM_SHA_1_HMAC_GENERAL:
|
||||||
|
case CKM_SHA224_HMAC_GENERAL:
|
||||||
|
case CKM_SHA256_HMAC_GENERAL:
|
||||||
|
case CKM_SHA384_HMAC_GENERAL:
|
||||||
|
case CKM_SHA512_HMAC_GENERAL:
|
||||||
|
return serialize_mecha_mac_general_param(obj, &mecha);
|
||||||
|
case CKM_RSA_AES_KEY_WRAP:
|
||||||
|
return serialize_mecha_rsa_aes_key_wrap(obj, &mecha);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return CKR_MECHANISM_INVALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
23
optee/optee_client/libckteec/src/serialize_ck.h
Normal file
23
optee/optee_client/libckteec/src/serialize_ck.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
#ifndef LIBCKTEEC_SERIALIZE_CK_H
|
||||||
|
#define LIBCKTEEC_SERIALIZE_CK_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
|
||||||
|
#include "serializer.h"
|
||||||
|
|
||||||
|
/* Create (and allocate) a serial object for CK_ATTRIBUTE array */
|
||||||
|
CK_RV serialize_ck_attributes(struct serializer *obj,
|
||||||
|
CK_ATTRIBUTE_PTR attributes, CK_ULONG count);
|
||||||
|
|
||||||
|
/* Convert PKCS11 TA attributes back to CK_ATTRIBUTE array */
|
||||||
|
CK_RV deserialize_ck_attributes(uint8_t *in,
|
||||||
|
CK_ATTRIBUTE_PTR attributes, CK_ULONG count);
|
||||||
|
|
||||||
|
/* Create (and allocate) a serial object for CK_MECHANISM array */
|
||||||
|
CK_RV serialize_ck_mecha_params(struct serializer *obj,
|
||||||
|
CK_MECHANISM_PTR mechanisms);
|
||||||
|
#endif /*LIBCKTEEC_SERIALIZE_CK_H*/
|
||||||
76
optee/optee_client/libckteec/src/serializer.c
Normal file
76
optee/optee_client/libckteec/src/serializer.c
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ck_helpers.h"
|
||||||
|
#include "local_utils.h"
|
||||||
|
#include "serializer.h"
|
||||||
|
|
||||||
|
CK_RV init_serial_object(struct serializer *obj)
|
||||||
|
{
|
||||||
|
struct pkcs11_object_head head = { 0 };
|
||||||
|
|
||||||
|
memset(obj, 0, sizeof(*obj));
|
||||||
|
|
||||||
|
return serialize_buffer(obj, &head, sizeof(head));
|
||||||
|
}
|
||||||
|
|
||||||
|
void finalize_serial_object(struct serializer *obj)
|
||||||
|
{
|
||||||
|
struct pkcs11_object_head head = { 0 };
|
||||||
|
|
||||||
|
head.attrs_size = obj->size - sizeof(head);
|
||||||
|
head.attrs_count = obj->item_count;
|
||||||
|
memcpy(obj->buffer, &head, sizeof(head));
|
||||||
|
}
|
||||||
|
|
||||||
|
void release_serial_object(struct serializer *obj)
|
||||||
|
{
|
||||||
|
free(obj->buffer);
|
||||||
|
obj->buffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* serialize - append data in a serialized buffer
|
||||||
|
*
|
||||||
|
* Serialize data in provided buffer.
|
||||||
|
* Ensure 64byte alignment of appended data in the buffer.
|
||||||
|
*/
|
||||||
|
static CK_RV serialize(char **bstart, size_t *blen, void *data, size_t len)
|
||||||
|
{
|
||||||
|
size_t nlen = *blen + len;
|
||||||
|
char *buf = realloc(*bstart, nlen);
|
||||||
|
|
||||||
|
if (!buf)
|
||||||
|
return CKR_HOST_MEMORY;
|
||||||
|
|
||||||
|
memcpy(buf + *blen, data, len);
|
||||||
|
|
||||||
|
*blen = nlen;
|
||||||
|
*bstart = buf;
|
||||||
|
|
||||||
|
return CKR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV serialize_buffer(struct serializer *obj, void *data, size_t size)
|
||||||
|
{
|
||||||
|
return serialize(&obj->buffer, &obj->size, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV serialize_32b(struct serializer *obj, uint32_t data)
|
||||||
|
{
|
||||||
|
return serialize_buffer(obj, &data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
CK_RV serialize_ck_ulong(struct serializer *obj, CK_ULONG data)
|
||||||
|
{
|
||||||
|
uint32_t data32 = data;
|
||||||
|
|
||||||
|
return serialize_buffer(obj, &data32, sizeof(data32));
|
||||||
|
}
|
||||||
34
optee/optee_client/libckteec/src/serializer.h
Normal file
34
optee/optee_client/libckteec/src/serializer.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2020, Linaro Limited
|
||||||
|
*/
|
||||||
|
#ifndef LIBCKTEEC_SERIALIZER_H
|
||||||
|
#define LIBCKTEEC_SERIALIZER_H
|
||||||
|
|
||||||
|
#include <pkcs11.h>
|
||||||
|
#include <pkcs11_ta.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Struct used to create the buffer storing the serialized data.
|
||||||
|
* Contains some fields to help parsing content (type/boolprops).
|
||||||
|
*/
|
||||||
|
struct serializer {
|
||||||
|
char *buffer; /* serial buffer base address */
|
||||||
|
size_t size; /* serial buffer current byte size */
|
||||||
|
size_t item_count; /* number of items in entry table */
|
||||||
|
uint32_t object;
|
||||||
|
uint32_t type;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Init/finalize/release a serializer object */
|
||||||
|
CK_RV init_serial_object(struct serializer *obj);
|
||||||
|
void finalize_serial_object(struct serializer *obj);
|
||||||
|
void release_serial_object(struct serializer *obj);
|
||||||
|
|
||||||
|
CK_RV serialize_buffer(struct serializer *obj, void *data, size_t size);
|
||||||
|
CK_RV serialize_32b(struct serializer *obj, uint32_t data);
|
||||||
|
CK_RV serialize_ck_ulong(struct serializer *obj, CK_ULONG data);
|
||||||
|
|
||||||
|
#endif /*LIBCKTEEC_SERIALIZER_H*/
|
||||||
65
optee/optee_client/libseteec/CMakeLists.txt
Normal file
65
optee/optee_client/libseteec/CMakeLists.txt
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
project(seteec
|
||||||
|
VERSION 0.1.0
|
||||||
|
LANGUAGES C)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Packages
|
||||||
|
################################################################################
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
if(NOT THREADS_FOUND)
|
||||||
|
message(FATAL_ERROR "Threads not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source files
|
||||||
|
################################################################################
|
||||||
|
set (SRC
|
||||||
|
src/se.c
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built library
|
||||||
|
################################################################################
|
||||||
|
add_library (seteec ${SRC})
|
||||||
|
|
||||||
|
set_target_properties (seteec PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Flags always set
|
||||||
|
################################################################################
|
||||||
|
target_compile_definitions (seteec
|
||||||
|
PRIVATE -D_GNU_SOURCE
|
||||||
|
PRIVATE -DBINARY_PREFIX="LT"
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Optional flags
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(seteec
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
PRIVATE src
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries (seteec
|
||||||
|
PRIVATE pthread
|
||||||
|
PRIVATE teec
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
install (TARGETS seteec
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(include)
|
||||||
71
optee/optee_client/libseteec/Makefile
Normal file
71
optee/optee_client/libseteec/Makefile
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
include ../flags.mk
|
||||||
|
include ../config.mk
|
||||||
|
|
||||||
|
OUT_DIR := $(OO)/libseteec
|
||||||
|
|
||||||
|
.PHONY: all libseteec clean
|
||||||
|
|
||||||
|
all: libseteec
|
||||||
|
install: libseteec
|
||||||
|
|
||||||
|
LIB_NAME := libseteec
|
||||||
|
MAJOR_VERSION := 0
|
||||||
|
MINOR_VERSION := 1
|
||||||
|
PATCH_VERSION := 0
|
||||||
|
|
||||||
|
LIB_MAJOR := $(LIB_NAME).so.$(MAJOR_VERSION)
|
||||||
|
LIB_MAJ_MIN := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||||
|
LIB_MAJ_MIN_PAT := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
|
||||||
|
LIBSETEEC_SO_LIBRARY := $(LIB_MAJ_MIN_PAT)
|
||||||
|
LIBSETEEC_AR_LIBRARY := $(LIB_NAME).a
|
||||||
|
|
||||||
|
LIBSETEEC_SRC_DIR := src
|
||||||
|
|
||||||
|
LIBSETEEC_SRCS = se.c
|
||||||
|
|
||||||
|
LIBSETEEC_INCLUDES = ${CURDIR}/include
|
||||||
|
LIBSETEEC_INCLUDES += ${CURDIR}/../public
|
||||||
|
|
||||||
|
LIBSETEEC_CFLAGS := $(addprefix -I, $(LIBSETEEC_INCLUDES)) \
|
||||||
|
$(CFLAGS) -D_GNU_SOURCE -fPIC
|
||||||
|
|
||||||
|
LIBSETEEC_LFLAGS := $(LDFLAGS) -L$(OUT_DIR)/../libteec -lteec -lpthread
|
||||||
|
|
||||||
|
LIBSETEEC_OBJ_DIR := $(OUT_DIR)
|
||||||
|
LIBSETEEC_OBJS := $(patsubst %.c,$(LIBSETEEC_OBJ_DIR)/%.o, $(LIBSETEEC_SRCS))
|
||||||
|
|
||||||
|
$(LIBSETEEC_OBJ_DIR)/%.o: ${LIBSETEEC_SRC_DIR}/%.c
|
||||||
|
$(VPREFIX)mkdir -p $(LIBSETEEC_OBJ_DIR)
|
||||||
|
@echo " CC $<"
|
||||||
|
$(VPREFIX)$(CC) $(LIBSETEEC_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
libseteec: $(OUT_DIR)/$(LIBSETEEC_SO_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBSETEEC_SO_LIBRARY): $(LIBSETEEC_OBJS)
|
||||||
|
@echo " LINK $@"
|
||||||
|
$(VPREFIX)$(CC) -shared -Wl,-soname,$(LIB_MAJOR) -o $@ $+ $(LIBSETEEC_LFLAGS)
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
libseteec: $(OUT_DIR)/$(LIBSETEEC_AR_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBSETEEC_AR_LIBRARY): $(LIBSETEEC_OBJS)
|
||||||
|
@echo " AR $@"
|
||||||
|
$(VPREFIX)$(AR) rcs $@ $+
|
||||||
|
|
||||||
|
libseteec:
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN_PAT) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME).so
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Cleaning up configuration
|
||||||
|
################################################################################
|
||||||
|
clean:
|
||||||
|
$(RM) $(LIBSETEEC_OBJS)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN_PAT)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBSETEEC_SO_LIBRARY)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBSETEEC_AR_LIBRARY)
|
||||||
|
$(call rmdir,$(OUT_DIR))
|
||||||
|
|
||||||
7
optee/optee_client/libseteec/include/CMakeLists.txt
Normal file
7
optee/optee_client/libseteec/include/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
project (libseteec-headers C)
|
||||||
|
|
||||||
|
FILE(GLOB INSTALL_HEADERS "*.h")
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} INTERFACE)
|
||||||
|
|
||||||
|
install (FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
90
optee/optee_client/libseteec/include/se_tee.h
Normal file
90
optee/optee_client/libseteec/include/se_tee.h
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021, Foundries.io
|
||||||
|
* Jorge Ramirez-Ortiz <jorge@foundries.io>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SE_TEE_H
|
||||||
|
#define SE_TEE_H
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned long SE_ULONG;
|
||||||
|
typedef SE_ULONG SE_RV;
|
||||||
|
|
||||||
|
/* Values for type SR_RV */
|
||||||
|
#define SER_OK 0x0000
|
||||||
|
#define SER_CANT_OPEN_SESSION 0x0001
|
||||||
|
#define SER_ERROR_GENERIC 0x0002
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Type identifier for the APDU message as described by Smart Card Standard ISO7816-4
|
||||||
|
* about ADPU message bodies decoding convention:
|
||||||
|
*
|
||||||
|
* https://cardwerk.com/smart-card-standard-iso7816-4-section-5-basic-organizations/#chap5_3_2
|
||||||
|
*/
|
||||||
|
enum se_apdu_type {
|
||||||
|
SE_APDU_NO_HINT,
|
||||||
|
SE_APDU_CASE_1,
|
||||||
|
SE_APDU_CASE_2,
|
||||||
|
SE_APDU_CASE_2E,
|
||||||
|
SE_APDU_CASE_3,
|
||||||
|
SE_APDU_CASE_3E,
|
||||||
|
SE_APDU_CASE_4,
|
||||||
|
SE_APDU_CASE_4E,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* se_apdu_request() - Send an APDU message and get response.
|
||||||
|
*
|
||||||
|
* @param type Type of the APDU command.
|
||||||
|
* @param hdr Pointer to APDU message header.
|
||||||
|
* @param hdr_len Byte length of message header @hdr.
|
||||||
|
* @param src Pointer to APDU message payload.
|
||||||
|
* @param src_len Byte length of message payload @src.
|
||||||
|
* @param dst Pointer to APDU message reponse buffer.
|
||||||
|
* @param dst_len Byte length of reponse buffer @dst.
|
||||||
|
*
|
||||||
|
* @return SER_CANT_OPEN_SESSION Error opening the TEE session.
|
||||||
|
* @return SER_ERROR_GENERIC Error unspecified.
|
||||||
|
* @return SER_OK On success.
|
||||||
|
*/
|
||||||
|
SE_RV se_apdu_request(enum se_apdu_type type,
|
||||||
|
unsigned char *hdr, size_t hdr_len,
|
||||||
|
unsigned char *src, size_t src_len,
|
||||||
|
unsigned char *dst, size_t *dst_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* se_scp03_enable() - Enable the SCP03 protocol using the keys active in the
|
||||||
|
* Secure Element.
|
||||||
|
*
|
||||||
|
* Enables the SCP03 session with the Secure Element.
|
||||||
|
*
|
||||||
|
* @return SER_CANT_OPEN_SESSION Error opening the TEE session.
|
||||||
|
* @return SER_ERROR_GENERIC Error unspecified.
|
||||||
|
* @return SER_OK On success.
|
||||||
|
*/
|
||||||
|
SE_RV se_scp03_enable(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* se_scp03_rotate_keys_and_enable() - Attempt to replace the active SCP03 keys
|
||||||
|
* and enable the SCP03 session.
|
||||||
|
*
|
||||||
|
* Generates secure keys for the board and writes them in the Secure Element non
|
||||||
|
* volatile memory. Then re-enables the session.
|
||||||
|
*
|
||||||
|
* @return SER_CANT_OPEN_SESSION Error opening the TEE session.
|
||||||
|
* @return SER_ERROR_GENERIC Error unspecified.
|
||||||
|
* @return SER_OK On success.
|
||||||
|
*/
|
||||||
|
SE_RV se_scp03_rotate_keys_and_enable(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*SE_TEE_H*/
|
||||||
47
optee/optee_client/libseteec/src/pta_apdu.h
Normal file
47
optee/optee_client/libseteec/src/pta_apdu.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021, Foundries Limited
|
||||||
|
* Author: Jorge Ramirez <jorge@foundries.io>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PTA_APDU_H
|
||||||
|
#define __PTA_APDU_H
|
||||||
|
|
||||||
|
#define PTA_APDU_UUID { 0x3f3eb880, 0x3639, 0x11ec, \
|
||||||
|
{ 0x9b, 0x9d, 0x0f, 0x3f, 0xc9, 0x46, 0x8f, 0x50 } }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ADPU based communication with the Secure Element
|
||||||
|
*
|
||||||
|
* [in] value[0].a Use APDU TXRX hints: PTA_APDU_TXRX_CASE_*
|
||||||
|
* [in] memref[1].buffer APDU header.
|
||||||
|
* [in] memref[1].size APDU header length.
|
||||||
|
* [in] memref[2].buffer request (APDU raw frame).
|
||||||
|
* [in] memref[2].size request length.
|
||||||
|
* [out] memref[3].buffer response (APDU raw frame).
|
||||||
|
* [out] memref[3].size response length.
|
||||||
|
*
|
||||||
|
* Result:
|
||||||
|
* TEE_SUCCESS - Invoke command success
|
||||||
|
* TEE_ERROR_BAD_PARAMETERS - Incorrect input param
|
||||||
|
* TEE_ERROR_NOT_IMPLEMENTED - Invoke command not implemented
|
||||||
|
* TEE_ERROR_GENERIC - Invoke command failure
|
||||||
|
*/
|
||||||
|
#define PTA_CMD_TXRX_APDU_RAW_FRAME 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Type identifier for the APDU message as described by Smart Card Standard
|
||||||
|
* ISO7816-4 about ADPU message bodies decoding convention:
|
||||||
|
*
|
||||||
|
* https://cardwerk.com/smart-card-standard-iso7816-4-section-5-basic-organizations/#chap5_3_2
|
||||||
|
*/
|
||||||
|
#define PTA_APDU_TXRX_CASE_NO_HINT 0
|
||||||
|
#define PTA_APDU_TXRX_CASE_1 1
|
||||||
|
#define PTA_APDU_TXRX_CASE_2 2
|
||||||
|
#define PTA_APDU_TXRX_CASE_2E 3
|
||||||
|
#define PTA_APDU_TXRX_CASE_3 4
|
||||||
|
#define PTA_APDU_TXRX_CASE_3E 5
|
||||||
|
#define PTA_APDU_TXRX_CASE_4 6
|
||||||
|
#define PTA_APDU_TXRX_CASE_4E 7
|
||||||
|
|
||||||
|
#endif /* __PTA_APDU_H */
|
||||||
31
optee/optee_client/libseteec/src/pta_scp03.h
Normal file
31
optee/optee_client/libseteec/src/pta_scp03.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020, Foundries Limited
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PTA_SCP03_H
|
||||||
|
#define __PTA_SCP03_H
|
||||||
|
|
||||||
|
#define PTA_SCP03_UUID { 0xbe0e5821, 0xe718, 0x4f77, \
|
||||||
|
{ 0xab, 0x3e, 0x8e, 0x6c, 0x73, 0xa9, 0xc7, 0x35 } }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable SCP03 support on the SE
|
||||||
|
*
|
||||||
|
* [in] value[0].a Use session keys PTA_SCP03_SESSION_*
|
||||||
|
*
|
||||||
|
* Result:
|
||||||
|
* TEE_SUCCESS - Invoke command success
|
||||||
|
* TEE_ERROR_BAD_PARAMETERS - Incorrect input param
|
||||||
|
* TEE_ERROR_NOT_IMPLEMENTED - Invoke command not implemented
|
||||||
|
* TEE_ERROR_GENERIC - Invoke command failure
|
||||||
|
*/
|
||||||
|
#define PTA_CMD_ENABLE_SCP03 0
|
||||||
|
|
||||||
|
/* Enable the session using the current keys in the Secure Element */
|
||||||
|
#define PTA_SCP03_SESSION_CURRENT_KEYS 0
|
||||||
|
|
||||||
|
/* Enable the session after replacing the current keys in the Secure Element */
|
||||||
|
#define PTA_SCP03_SESSION_ROTATE_KEYS 1
|
||||||
|
|
||||||
|
#endif /* __PTA_SCP03_H */
|
||||||
149
optee/optee_client/libseteec/src/se.c
Normal file
149
optee/optee_client/libseteec/src/se.c
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021, Foundries.io Ltd
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BINARY_PREFIX
|
||||||
|
#define BINARY_PREFIX "seteec"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <se_tee.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
|
||||||
|
#include "pta_apdu.h"
|
||||||
|
#include "pta_scp03.h"
|
||||||
|
|
||||||
|
struct ta_context {
|
||||||
|
pthread_mutex_t lock;
|
||||||
|
TEEC_Context context;
|
||||||
|
TEEC_Session session;
|
||||||
|
TEEC_UUID uuid;
|
||||||
|
bool open;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ta_context apdu_ta_ctx = {
|
||||||
|
.lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
.uuid = PTA_APDU_UUID,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct ta_context scp03_ta_ctx = {
|
||||||
|
.lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
.uuid = PTA_SCP03_UUID,
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool open_session(struct ta_context *ctx)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
|
||||||
|
if (pthread_mutex_lock(&ctx->lock))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!ctx->open) {
|
||||||
|
res = TEEC_InitializeContext(NULL, &ctx->context);
|
||||||
|
if (!res) {
|
||||||
|
res = TEEC_OpenSession(&ctx->context, &ctx->session,
|
||||||
|
&ctx->uuid, TEEC_LOGIN_PUBLIC,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
if (!res)
|
||||||
|
ctx->open = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return !pthread_mutex_unlock(&ctx->lock) && !res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static SE_RV do_scp03(uint32_t cmd)
|
||||||
|
{
|
||||||
|
TEEC_Operation op = { 0 };
|
||||||
|
|
||||||
|
if (!open_session(&scp03_ta_ctx))
|
||||||
|
return SER_CANT_OPEN_SESSION;
|
||||||
|
|
||||||
|
op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, 0, 0, 0);
|
||||||
|
op.params[0].value.a = cmd;
|
||||||
|
|
||||||
|
if (TEEC_InvokeCommand(&scp03_ta_ctx.session,
|
||||||
|
PTA_CMD_ENABLE_SCP03, &op, NULL))
|
||||||
|
return SER_ERROR_GENERIC;
|
||||||
|
|
||||||
|
return SER_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
SE_RV se_scp03_enable(void)
|
||||||
|
{
|
||||||
|
return do_scp03(PTA_SCP03_SESSION_CURRENT_KEYS);
|
||||||
|
}
|
||||||
|
|
||||||
|
SE_RV se_scp03_rotate_keys_and_enable(void)
|
||||||
|
{
|
||||||
|
return do_scp03(PTA_SCP03_SESSION_ROTATE_KEYS);
|
||||||
|
}
|
||||||
|
|
||||||
|
SE_RV se_apdu_request(enum se_apdu_type apdu_type,
|
||||||
|
unsigned char *hdr, size_t hdr_len,
|
||||||
|
unsigned char *src, size_t src_len,
|
||||||
|
unsigned char *dst, size_t *dst_len)
|
||||||
|
{
|
||||||
|
uint32_t type = PTA_APDU_TXRX_CASE_NO_HINT;
|
||||||
|
TEEC_Operation op = { 0 };
|
||||||
|
|
||||||
|
switch (apdu_type) {
|
||||||
|
case SE_APDU_NO_HINT:
|
||||||
|
type = PTA_APDU_TXRX_CASE_NO_HINT;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_1:
|
||||||
|
type = PTA_APDU_TXRX_CASE_1;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_2:
|
||||||
|
type = PTA_APDU_TXRX_CASE_2;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_2E:
|
||||||
|
type = PTA_APDU_TXRX_CASE_2E;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_3:
|
||||||
|
type = PTA_APDU_TXRX_CASE_3;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_3E:
|
||||||
|
type = PTA_APDU_TXRX_CASE_3E;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_4:
|
||||||
|
type = PTA_APDU_TXRX_CASE_4;
|
||||||
|
break;
|
||||||
|
case SE_APDU_CASE_4E:
|
||||||
|
type = PTA_APDU_TXRX_CASE_4E;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return SER_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!open_session(&apdu_ta_ctx))
|
||||||
|
return SER_CANT_OPEN_SESSION;
|
||||||
|
|
||||||
|
op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
|
||||||
|
TEEC_MEMREF_TEMP_INPUT,
|
||||||
|
TEEC_MEMREF_TEMP_INPUT,
|
||||||
|
TEEC_MEMREF_TEMP_OUTPUT);
|
||||||
|
op.params[0].value.a = type;
|
||||||
|
op.params[1].tmpref.buffer = hdr;
|
||||||
|
op.params[1].tmpref.size = hdr_len;
|
||||||
|
op.params[2].tmpref.buffer = src;
|
||||||
|
op.params[2].tmpref.size = src_len;
|
||||||
|
op.params[3].tmpref.buffer = dst;
|
||||||
|
op.params[3].tmpref.size = *dst_len;
|
||||||
|
|
||||||
|
if (TEEC_InvokeCommand(&apdu_ta_ctx.session,
|
||||||
|
PTA_CMD_TXRX_APDU_RAW_FRAME, &op, NULL))
|
||||||
|
return SER_ERROR_GENERIC;
|
||||||
|
|
||||||
|
*dst_len = op.params[3].tmpref.size;
|
||||||
|
|
||||||
|
return SER_OK;
|
||||||
|
}
|
||||||
53
optee/optee_client/libteeacl/CMakeLists.txt
Normal file
53
optee/optee_client/libteeacl/CMakeLists.txt
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
project(teeacl
|
||||||
|
VERSION 0.1.0
|
||||||
|
LANGUAGES C
|
||||||
|
)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source files
|
||||||
|
################################################################################
|
||||||
|
set(SRC
|
||||||
|
src/group.c
|
||||||
|
src/tee_uuid.c
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built library
|
||||||
|
################################################################################
|
||||||
|
add_library(teeacl ${SRC})
|
||||||
|
|
||||||
|
set_target_properties(teeacl PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Flags always set
|
||||||
|
################################################################################
|
||||||
|
target_compile_definitions(teeacl
|
||||||
|
PRIVATE -D_GNU_SOURCE
|
||||||
|
PRIVATE -DBINARY_PREFIX="LT"
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(teeacl PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(teeacl
|
||||||
|
PUBLIC PkgConfig::uuid
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
install(TARGETS teeacl
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||||
77
optee/optee_client/libteeacl/Makefile
Normal file
77
optee/optee_client/libteeacl/Makefile
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
include ../flags.mk
|
||||||
|
include ../config.mk
|
||||||
|
|
||||||
|
OUT_DIR := $(OO)/libteeacl
|
||||||
|
|
||||||
|
.PHONY: all libteeacl check-libuuid clean
|
||||||
|
|
||||||
|
all: libteeacl
|
||||||
|
install: libteeacl
|
||||||
|
|
||||||
|
LIB_NAME := libteeacl
|
||||||
|
MAJOR_VERSION := 0
|
||||||
|
MINOR_VERSION := 1
|
||||||
|
PATCH_VERSION := 0
|
||||||
|
|
||||||
|
LIB_MAJOR := $(LIB_NAME).so.$(MAJOR_VERSION)
|
||||||
|
LIB_MAJ_MIN := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||||
|
LIB_MAJ_MIN_PAT := $(LIB_NAME).so.$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
|
||||||
|
LIBTEEACL_SO_LIBRARY := $(LIB_MAJ_MIN_PAT)
|
||||||
|
LIBTEEACL_AR_LIBRARY := $(LIB_NAME).a
|
||||||
|
|
||||||
|
LIBTEEACL_SRC_DIR := src
|
||||||
|
|
||||||
|
LIBTEEACL_SRCS = group.c
|
||||||
|
LIBTEEACL_SRCS += tee_uuid.c
|
||||||
|
|
||||||
|
LIBTEEACL_INCLUDES = ${CURDIR}/include
|
||||||
|
|
||||||
|
LIBTEEACL_CFLAGS := $(addprefix -I, $(LIBTEEACL_INCLUDES)) \
|
||||||
|
$(shell $(PKG_CONFIG) --cflags uuid) \
|
||||||
|
$(CFLAGS) -D_GNU_SOURCE -fPIC
|
||||||
|
|
||||||
|
LIBTEEACL_LFLAGS := $(LDFLAGS) $(shell $(PKG_CONFIG) --libs uuid)
|
||||||
|
|
||||||
|
LIBTEEACL_OBJ_DIR := $(OUT_DIR)
|
||||||
|
LIBTEEACL_OBJS := $(patsubst %.c,$(LIBTEEACL_OBJ_DIR)/%.o, $(LIBTEEACL_SRCS))
|
||||||
|
|
||||||
|
$(LIBTEEACL_OBJ_DIR)/%.o: ${LIBTEEACL_SRC_DIR}/%.c
|
||||||
|
$(VPREFIX)mkdir -p $(LIBTEEACL_OBJ_DIR)
|
||||||
|
@echo " CC $<"
|
||||||
|
$(VPREFIX)$(CC) $(LIBTEEACL_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
libteeacl: check-libuuid
|
||||||
|
|
||||||
|
check-libuuid:
|
||||||
|
@echo " Finding uuid.pc"
|
||||||
|
$(VPREFIX)$(PKG_CONFIG) --atleast-version=2.34 uuid
|
||||||
|
|
||||||
|
libteeacl: $(OUT_DIR)/$(LIBTEEACL_SO_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBTEEACL_SO_LIBRARY): $(LIBTEEACL_OBJS)
|
||||||
|
@echo " LINK $@"
|
||||||
|
$(VPREFIX)$(CC) -shared -Wl,-soname,$(LIBTEEACL_SO_LIBRARY) -o $@ $+ $(LIBTEEACL_LFLAGS)
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
libteeacl: $(OUT_DIR)/$(LIBTEEACL_AR_LIBRARY)
|
||||||
|
|
||||||
|
$(OUT_DIR)/$(LIBTEEACL_AR_LIBRARY): $(LIBTEEACL_OBJS)
|
||||||
|
@echo " AR $@"
|
||||||
|
$(VPREFIX)$(AR) rcs $@ $+
|
||||||
|
|
||||||
|
libteeacl:
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN_PAT) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME).so
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Cleaning up configuration
|
||||||
|
################################################################################
|
||||||
|
clean:
|
||||||
|
$(RM) $(LIBTEEACL_OBJS)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN_PAT)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBTEEACL_SO_LIBRARY)
|
||||||
|
$(RM) $(OUT_DIR)/$(LIBTEEACL_AR_LIBRARY)
|
||||||
|
$(call rmdir,$(OUT_DIR))
|
||||||
99
optee/optee_client/libteeacl/include/teeacl.h
Normal file
99
optee/optee_client/libteeacl/include/teeacl.h
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Vaisala Oyj.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definitions for configuring and using Access Control List (ACL)
|
||||||
|
* based login methods.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TEEACL_H
|
||||||
|
#define TEEACL_H
|
||||||
|
|
||||||
|
#include <grp.h>
|
||||||
|
#include <uuid.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// TEE Client UUID name space identifier (UUIDv4)
|
||||||
|
// same as `tee_client_uuid_ns` in linux kernel drivers/tee/tee_core.c
|
||||||
|
#define KERNEL_NAMESPACE "58ac9ca0-2086-4683-a1b8-ec4bc08e01b6"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* len UUID = 36 characters
|
||||||
|
*
|
||||||
|
* Prefixes:
|
||||||
|
* public
|
||||||
|
* user:
|
||||||
|
* group:
|
||||||
|
*
|
||||||
|
* + '\0' character totals 43, roundup.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Required length for UUID char buffers
|
||||||
|
*/
|
||||||
|
#define TEEACL_L_UUID 48
|
||||||
|
|
||||||
|
/**
|
||||||
|
* teeacl_gid_from_name - Try to resolve gid_t for a given `group_name`.
|
||||||
|
*
|
||||||
|
* If a matching group is found, zero is returned and `gid_out` will be set to
|
||||||
|
* the found value.
|
||||||
|
* If no group is found, -ENOENT is returned.
|
||||||
|
* If memory allocation fails, -ENOMEM is returned.
|
||||||
|
* For other failures, errno is returned.
|
||||||
|
*
|
||||||
|
* @param gid_out Ptr to gid result. Will be set to group id if a matching
|
||||||
|
* group is found.
|
||||||
|
* @param group_name Name of group to resolve.
|
||||||
|
* @return 0 if a matching group is found, see detailed description for other
|
||||||
|
* cases.
|
||||||
|
*/
|
||||||
|
int teeacl_gid_from_name(gid_t *gid_out, const char *group_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* teeacl_group_acl_uuid() - Encode a group login ACL string to the
|
||||||
|
* provided uuid_buf
|
||||||
|
*
|
||||||
|
* @param uuid_buf A buffer of length TEEACL_L_UUID.
|
||||||
|
* @param group Group id to encode for login.
|
||||||
|
* @return 0 on success, otherwise a negative number is returned in case of failure.
|
||||||
|
*/
|
||||||
|
int teeacl_group_acl_uuid(char uuid_buf[TEEACL_L_UUID], gid_t group);
|
||||||
|
/**
|
||||||
|
* The possible return values of the *_user_is_member_of functions.
|
||||||
|
*/
|
||||||
|
enum rv_groupmember {
|
||||||
|
NOT_MEMBER,
|
||||||
|
IS_MEMBER,
|
||||||
|
E_MEMORY, /**< Failed to allocate memory. */
|
||||||
|
E_GROUPLIST /**< Failed to read group listing. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* teeacl_current_user_is_member_of() - Check if the effective user ID of
|
||||||
|
* the process is a member in `group`.
|
||||||
|
*
|
||||||
|
* @param group Group id to check membership of.
|
||||||
|
* @return enum rv_groupmember form result.
|
||||||
|
*/
|
||||||
|
enum rv_groupmember teeacl_current_user_is_member_of(gid_t group);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* teeacl_user_is_member_of() - Check if `user` is a member in `group`.
|
||||||
|
*
|
||||||
|
* @param user Username string.
|
||||||
|
* @param group Group id to check membership of.
|
||||||
|
* @return enum rv_groupmember form result.
|
||||||
|
*/
|
||||||
|
enum rv_groupmember teeacl_user_is_member_of(const char *user, gid_t group);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* TEEACL_H */
|
||||||
98
optee/optee_client/libteeacl/src/group.c
Normal file
98
optee/optee_client/libteeacl/src/group.c
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Vaisala Oyj.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <teeacl.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <grp.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
static long teeacl_getgr_r_size_max(void)
|
||||||
|
{
|
||||||
|
long s = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||||
|
|
||||||
|
if (s == -1)
|
||||||
|
return 1024;
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
|
||||||
|
int teeacl_gid_from_name(gid_t *gid_out, const char *group_name)
|
||||||
|
{
|
||||||
|
struct group grp = { 0 };
|
||||||
|
char *buffer = NULL;
|
||||||
|
struct group *result = NULL;
|
||||||
|
size_t b_size = 0;
|
||||||
|
int rv = 0;
|
||||||
|
|
||||||
|
b_size = teeacl_getgr_r_size_max();
|
||||||
|
buffer = calloc(1, b_size);
|
||||||
|
if (!buffer)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
rv = getgrnam_r(group_name, &grp, buffer, b_size, &result);
|
||||||
|
|
||||||
|
free(buffer);
|
||||||
|
if (!result) {
|
||||||
|
if (rv == 0)
|
||||||
|
return -ENOENT;
|
||||||
|
else
|
||||||
|
return rv;
|
||||||
|
} else {
|
||||||
|
*gid_out = grp.gr_gid;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum rv_groupmember teeacl_current_user_is_member_of(gid_t group)
|
||||||
|
{
|
||||||
|
char username[L_cuserid] = { 0 };
|
||||||
|
|
||||||
|
cuserid(username);
|
||||||
|
return teeacl_user_is_member_of(username, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum rv_groupmember teeacl_user_is_member_of(const char *user, gid_t group)
|
||||||
|
{
|
||||||
|
enum rv_groupmember result = E_MEMORY;
|
||||||
|
int ret = 0;
|
||||||
|
int i = 0;
|
||||||
|
int grouplistsize = 8; /* initial guess */
|
||||||
|
gid_t *p_groups = NULL;
|
||||||
|
gid_t *groups = calloc(grouplistsize, sizeof(gid_t));
|
||||||
|
|
||||||
|
if (!groups)
|
||||||
|
return E_MEMORY;
|
||||||
|
ret = getgrouplist(user, group, groups, &grouplistsize);
|
||||||
|
|
||||||
|
if (ret == -1) {
|
||||||
|
p_groups = groups;
|
||||||
|
|
||||||
|
/* we use realloc, since uClibc does not implement reallocarray */
|
||||||
|
groups = realloc(groups, grouplistsize * sizeof(gid_t));
|
||||||
|
if (!groups) {
|
||||||
|
free(p_groups);
|
||||||
|
return E_MEMORY;
|
||||||
|
}
|
||||||
|
ret = getgrouplist(user, group, groups, &grouplistsize);
|
||||||
|
if (ret == -1) {
|
||||||
|
result = E_GROUPLIST;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < grouplistsize; ++i) {
|
||||||
|
if (group == groups[i]) {
|
||||||
|
result = IS_MEMBER;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = NOT_MEMBER;
|
||||||
|
out:
|
||||||
|
free(groups);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
35
optee/optee_client/libteeacl/src/tee_uuid.c
Normal file
35
optee/optee_client/libteeacl/src/tee_uuid.c
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Vaisala Oyj.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <teeacl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <uuid.h>
|
||||||
|
|
||||||
|
int teeacl_group_acl_uuid(char uuid_buf[TEEACL_L_UUID], gid_t group)
|
||||||
|
{
|
||||||
|
uuid_t g_uuid = { 0 };
|
||||||
|
uuid_t k_uuid = { 0 };
|
||||||
|
char gid_buf[TEEACL_L_UUID] = { 0 };
|
||||||
|
size_t gid_buf_len = 0;
|
||||||
|
uint gstr_len = 6;
|
||||||
|
int rv = snprintf(gid_buf, TEEACL_L_UUID, "gid=%x", group);
|
||||||
|
|
||||||
|
if (rv < 0)
|
||||||
|
return rv;
|
||||||
|
if (rv >= TEEACL_L_UUID)
|
||||||
|
return -1;
|
||||||
|
rv = uuid_parse(KERNEL_NAMESPACE, k_uuid);
|
||||||
|
if (rv < 0)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
gid_buf_len = strnlen(gid_buf, TEEACL_L_UUID);
|
||||||
|
|
||||||
|
uuid_generate_sha1(g_uuid, k_uuid, gid_buf, gid_buf_len);
|
||||||
|
|
||||||
|
memcpy(uuid_buf, "group:", gstr_len);
|
||||||
|
uuid_unparse(g_uuid, uuid_buf + gstr_len);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
78
optee/optee_client/libteec/CMakeLists.txt
Normal file
78
optee/optee_client/libteec/CMakeLists.txt
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
project(libteec
|
||||||
|
VERSION 1.0.0
|
||||||
|
LANGUAGES C)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Packages
|
||||||
|
################################################################################
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
if(NOT THREADS_FOUND)
|
||||||
|
message(FATAL_ERROR "Threads not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Configuration flags always included
|
||||||
|
################################################################################
|
||||||
|
option (CFG_TEE_BENCHMARK "Build with benchmark support" OFF)
|
||||||
|
|
||||||
|
set (CFG_TEE_CLIENT_LOG_LEVEL "1" CACHE STRING "libteec log level")
|
||||||
|
set (CFG_TEE_CLIENT_LOG_FILE "/data/tee/teec.log" CACHE STRING "Location of libteec log")
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source files
|
||||||
|
################################################################################
|
||||||
|
set (SRC
|
||||||
|
src/tee_client_api.c
|
||||||
|
src/teec_trace.c
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CFG_TEE_BENCHMARK)
|
||||||
|
set (SRC ${SRC} src/teec_benchmark.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built library
|
||||||
|
################################################################################
|
||||||
|
add_library (teec ${SRC})
|
||||||
|
|
||||||
|
set(libteectgt teec)
|
||||||
|
configure_file(libteec.pc.in libteec.pc @ONLY)
|
||||||
|
|
||||||
|
set_target_properties (teec PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Flags always set
|
||||||
|
################################################################################
|
||||||
|
target_compile_definitions (teec
|
||||||
|
PRIVATE -D_GNU_SOURCE
|
||||||
|
PRIVATE -DDEBUGLEVEL_${CFG_TEE_CLIENT_LOG_LEVEL}
|
||||||
|
PRIVATE -DTEEC_LOG_FILE="${CFG_TEE_CLIENT_LOG_FILE}"
|
||||||
|
PRIVATE -DBINARY_PREFIX="LT"
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Optional flags
|
||||||
|
################################################################################
|
||||||
|
if (CFG_TEE_BENCHMARK)
|
||||||
|
target_compile_definitions (teec PRIVATE -DCFG_TEE_BENCHMARK)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(teec PUBLIC include)
|
||||||
|
|
||||||
|
target_link_libraries (teec
|
||||||
|
PUBLIC ${CMAKE_THREAD_LIBS_INIT} # this is pthreads
|
||||||
|
PRIVATE optee-client-headers)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
# FIXME: This should in someway harmonize with CFG_TEE_CLIENT_LOAD_PATH
|
||||||
|
# FIXME: Should we change this to /usr/local/lib?
|
||||||
|
install (TARGETS teec LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
70
optee/optee_client/libteec/Makefile
Normal file
70
optee/optee_client/libteec/Makefile
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
include ../flags.mk
|
||||||
|
include ../config.mk
|
||||||
|
|
||||||
|
OUT_DIR := $(OO)/libteec
|
||||||
|
|
||||||
|
.PHONY: all libteec clean
|
||||||
|
|
||||||
|
all: libteec
|
||||||
|
################################################################################
|
||||||
|
# Teec configuration
|
||||||
|
################################################################################
|
||||||
|
MAJOR_VERSION := 1
|
||||||
|
MINOR_VERSION := 0
|
||||||
|
PATCH_VERSION := 0
|
||||||
|
LIB_NAME := libteec.so
|
||||||
|
LIB_MAJOR := $(LIB_NAME).$(MAJOR_VERSION)
|
||||||
|
LIB_MAJ_MIN := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||||
|
LIB_MAJ_MIN_P := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
|
||||||
|
|
||||||
|
TEEC_SRCS := tee_client_api.c \
|
||||||
|
teec_trace.c
|
||||||
|
ifeq ($(CFG_TEE_BENCHMARK),y)
|
||||||
|
TEEC_SRCS += teec_benchmark.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEEC_SRC_DIR := src
|
||||||
|
TEEC_OBJ_DIR := $(OUT_DIR)
|
||||||
|
TEEC_OBJS := $(patsubst %.c,$(TEEC_OBJ_DIR)/%.o, $(TEEC_SRCS))
|
||||||
|
TEEC_INCLUDES := \
|
||||||
|
${CURDIR}/include \
|
||||||
|
${CURDIR}/../public \
|
||||||
|
|
||||||
|
TEEC_CFLAGS := $(addprefix -I, $(TEEC_INCLUDES)) $(CFLAGS) -D_GNU_SOURCE \
|
||||||
|
-DDEBUGLEVEL_$(CFG_TEE_CLIENT_LOG_LEVEL) \
|
||||||
|
-DBINARY_PREFIX=\"TEEC\"
|
||||||
|
|
||||||
|
ifeq ($(CFG_TEE_BENCHMARK),y)
|
||||||
|
TEEC_CFLAGS += -DCFG_TEE_BENCHMARK
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEEC_LFLAGS := $(LDFLAGS) -lpthread
|
||||||
|
TEEC_LIBRARY := $(OUT_DIR)/$(LIB_MAJ_MIN_P)
|
||||||
|
|
||||||
|
libteec: $(TEEC_LIBRARY) $(OUT_DIR)/libteec.a
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN_P) $(OUT_DIR)/$(LIB_MAJOR)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJ_MIN_P) $(OUT_DIR)/$(LIB_MAJ_MIN)
|
||||||
|
$(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME)
|
||||||
|
|
||||||
|
$(TEEC_LIBRARY): $(TEEC_OBJS)
|
||||||
|
@echo " LINK $@"
|
||||||
|
$(VPREFIX)$(CC) -shared -Wl,-soname,$(LIB_MAJOR) -o $@ $+ $(TEEC_LFLAGS)
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
$(OUT_DIR)/libteec.a: $(TEEC_OBJS)
|
||||||
|
@echo " AR $@"
|
||||||
|
$(VPREFIX)$(AR) rcs $@ $+
|
||||||
|
|
||||||
|
$(TEEC_OBJ_DIR)/%.o: ${TEEC_SRC_DIR}/%.c
|
||||||
|
$(VPREFIX)mkdir -p $(TEEC_OBJ_DIR)
|
||||||
|
@echo " CC $<"
|
||||||
|
$(VPREFIX)$(CC) $(TEEC_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Cleaning up configuration
|
||||||
|
################################################################################
|
||||||
|
clean:
|
||||||
|
$(RM) $(TEEC_OBJS) $(TEEC_LIBRARY) $(OUT_DIR)/$(LIB_MAJOR) \
|
||||||
|
$(OUT_DIR)/$(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_NAME)
|
||||||
|
$(RM) $(OUT_DIR)/libteec.a
|
||||||
|
$(call rmdir,$(OUT_DIR))
|
||||||
417
optee/optee_client/libteec/include/linux/tee.h
Normal file
417
optee/optee_client/libteec/include/linux/tee.h
Normal file
@@ -0,0 +1,417 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015-2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __TEE_H
|
||||||
|
#define __TEE_H
|
||||||
|
|
||||||
|
#include <linux/ioctl.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file describes the API provided by a TEE driver to user space.
|
||||||
|
*
|
||||||
|
* Each TEE driver defines a TEE specific protocol which is used for the
|
||||||
|
* data passed back and forth using TEE_IOC_CMD.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Helpers to make the ioctl defines */
|
||||||
|
#define TEE_IOC_MAGIC 0xa4
|
||||||
|
#define TEE_IOC_BASE 0
|
||||||
|
|
||||||
|
/* Flags relating to shared memory */
|
||||||
|
#define TEE_IOCTL_SHM_MAPPED 0x1 /* memory mapped in normal world */
|
||||||
|
#define TEE_IOCTL_SHM_DMA_BUF 0x2 /* dma-buf handle on shared memory */
|
||||||
|
|
||||||
|
#define TEE_MAX_ARG_SIZE 1024
|
||||||
|
|
||||||
|
#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
|
||||||
|
#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
|
||||||
|
#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
|
||||||
|
#define TEE_GEN_CAP_MEMREF_NULL (1 << 3) /* Support NULL MemRef */
|
||||||
|
|
||||||
|
#define TEE_MEMREF_NULL ((__u64)-1) /* NULL MemRef Buffer */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TEE Implementation ID
|
||||||
|
*/
|
||||||
|
#define TEE_IMPL_ID_OPTEE 1
|
||||||
|
#define TEE_IMPL_ID_AMDTEE 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* OP-TEE specific capabilities
|
||||||
|
*/
|
||||||
|
#define TEE_OPTEE_CAP_TZ (1 << 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_version_data - TEE version
|
||||||
|
* @impl_id: [out] TEE implementation id
|
||||||
|
* @impl_caps: [out] Implementation specific capabilities
|
||||||
|
* @gen_caps: [out] Generic capabilities, defined by TEE_GEN_CAPS_* above
|
||||||
|
*
|
||||||
|
* Identifies the TEE implementation, @impl_id is one of TEE_IMPL_ID_* above.
|
||||||
|
* @impl_caps is implementation specific, for example TEE_OPTEE_CAP_*
|
||||||
|
* is valid when @impl_id == TEE_IMPL_ID_OPTEE.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_version_data {
|
||||||
|
__u32 impl_id;
|
||||||
|
__u32 impl_caps;
|
||||||
|
__u32 gen_caps;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_VERSION - query version of TEE
|
||||||
|
*
|
||||||
|
* Takes a tee_ioctl_version_data struct and returns with the TEE version
|
||||||
|
* data filled in.
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_VERSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 0, \
|
||||||
|
struct tee_ioctl_version_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_shm_alloc_data - Shared memory allocate argument
|
||||||
|
* @size: [in/out] Size of shared memory to allocate
|
||||||
|
* @flags: [in/out] Flags to/from allocation.
|
||||||
|
* @id: [out] Identifier of the shared memory
|
||||||
|
*
|
||||||
|
* The flags field should currently be zero as input. Updated by the call
|
||||||
|
* with actual flags as defined by TEE_IOCTL_SHM_* above.
|
||||||
|
* This structure is used as argument for TEE_IOC_SHM_ALLOC below.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_shm_alloc_data {
|
||||||
|
__u64 size;
|
||||||
|
__u32 flags;
|
||||||
|
__s32 id;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_SHM_ALLOC - allocate shared memory
|
||||||
|
*
|
||||||
|
* Allocates shared memory between the user space process and secure OS.
|
||||||
|
*
|
||||||
|
* Returns a file descriptor on success or < 0 on failure
|
||||||
|
*
|
||||||
|
* The returned file descriptor is used to map the shared memory into user
|
||||||
|
* space. The shared memory is freed when the descriptor is closed and the
|
||||||
|
* memory is unmapped.
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_SHM_ALLOC _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 1, \
|
||||||
|
struct tee_ioctl_shm_alloc_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_shm_register_fd_data - Shared memory registering argument
|
||||||
|
* @fd: [in] file descriptor identifying the shared memory
|
||||||
|
* @size: [out] Size of shared memory to allocate
|
||||||
|
* @flags: [in] Flags to/from allocation.
|
||||||
|
* @id: [out] Identifier of the shared memory
|
||||||
|
*
|
||||||
|
* The flags field should currently be zero as input. Updated by the call
|
||||||
|
* with actual flags as defined by TEE_IOCTL_SHM_* above.
|
||||||
|
* This structure is used as argument for TEE_IOC_SHM_ALLOC below.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_shm_register_fd_data {
|
||||||
|
__s64 fd;
|
||||||
|
__u64 size;
|
||||||
|
__u32 flags;
|
||||||
|
__s32 id;
|
||||||
|
} __aligned(8);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Attributes for struct tee_ioctl_param, selects field in the union
|
||||||
|
*/
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_NONE 0 /* parameter not used */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These defines value parameters (struct tee_ioctl_param_value)
|
||||||
|
*/
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT 1
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT 2
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT 3 /* input and output */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These defines shared memory reference parameters (struct
|
||||||
|
* tee_ioctl_param_memref)
|
||||||
|
*/
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT 5
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT 6
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7 /* input and output */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mask for the type part of the attribute, leaves room for more types
|
||||||
|
*/
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_TYPE_MASK 0xff
|
||||||
|
|
||||||
|
/* Meta parameter carrying extra information about the message. */
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_META 0x100
|
||||||
|
|
||||||
|
/* Mask of all known attr bits */
|
||||||
|
#define TEE_IOCTL_PARAM_ATTR_MASK \
|
||||||
|
(TEE_IOCTL_PARAM_ATTR_TYPE_MASK | TEE_IOCTL_PARAM_ATTR_META)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Matches TEEC_LOGIN_* in GP TEE Client API
|
||||||
|
* Are only defined for GP compliant TEEs
|
||||||
|
*/
|
||||||
|
#define TEE_IOCTL_LOGIN_PUBLIC 0
|
||||||
|
#define TEE_IOCTL_LOGIN_USER 1
|
||||||
|
#define TEE_IOCTL_LOGIN_GROUP 2
|
||||||
|
#define TEE_IOCTL_LOGIN_APPLICATION 4
|
||||||
|
#define TEE_IOCTL_LOGIN_USER_APPLICATION 5
|
||||||
|
#define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_param - parameter
|
||||||
|
* @attr: attributes
|
||||||
|
* @a: if a memref, offset into the shared memory object, else a value parameter
|
||||||
|
* @b: if a memref, size of the buffer, else a value parameter
|
||||||
|
* @c: if a memref, shared memory identifier, else a value parameter
|
||||||
|
*
|
||||||
|
* @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref or value is used in
|
||||||
|
* the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value and
|
||||||
|
* TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref. TEE_PARAM_ATTR_TYPE_NONE
|
||||||
|
* indicates that none of the members are used.
|
||||||
|
*
|
||||||
|
* Shared memory is allocated with TEE_IOC_SHM_ALLOC which returns an
|
||||||
|
* identifier representing the shared memory object. A memref can reference
|
||||||
|
* a part of a shared memory by specifying an offset (@a) and size (@b) of
|
||||||
|
* the object. To supply the entire shared memory object set the offset
|
||||||
|
* (@a) to 0 and size (@b) to the previously returned size of the object.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_param {
|
||||||
|
__u64 attr;
|
||||||
|
__u64 a;
|
||||||
|
__u64 b;
|
||||||
|
__u64 c;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TEE_IOCTL_UUID_LEN 16
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_open_session_arg - Open session argument
|
||||||
|
* @uuid: [in] UUID of the Trusted Application
|
||||||
|
* @clnt_uuid: [in] UUID of client
|
||||||
|
* @clnt_login: [in] Login class of client, TEE_IOCTL_LOGIN_* above
|
||||||
|
* @cancel_id: [in] Cancellation id, a unique value to identify this request
|
||||||
|
* @session: [out] Session id
|
||||||
|
* @ret: [out] return value
|
||||||
|
* @ret_origin [out] origin of the return value
|
||||||
|
* @num_params [in] number of parameters following this struct
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_open_session_arg {
|
||||||
|
__u8 uuid[TEE_IOCTL_UUID_LEN];
|
||||||
|
__u8 clnt_uuid[TEE_IOCTL_UUID_LEN];
|
||||||
|
__u32 clnt_login;
|
||||||
|
__u32 cancel_id;
|
||||||
|
__u32 session;
|
||||||
|
__u32 ret;
|
||||||
|
__u32 ret_origin;
|
||||||
|
__u32 num_params;
|
||||||
|
/* num_params tells the actual number of element in params */
|
||||||
|
struct tee_ioctl_param params[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_OPEN_SESSION - opens a session to a Trusted Application
|
||||||
|
*
|
||||||
|
* Takes a struct tee_ioctl_buf_data which contains a struct
|
||||||
|
* tee_ioctl_open_session_arg followed by any array of struct
|
||||||
|
* tee_ioctl_param
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_OPEN_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 2, \
|
||||||
|
struct tee_ioctl_buf_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_invoke_func_arg - Invokes a function in a Trusted
|
||||||
|
* Application
|
||||||
|
* @func: [in] Trusted Application function, specific to the TA
|
||||||
|
* @session: [in] Session id
|
||||||
|
* @cancel_id: [in] Cancellation id, a unique value to identify this request
|
||||||
|
* @ret: [out] return value
|
||||||
|
* @ret_origin [out] origin of the return value
|
||||||
|
* @num_params [in] number of parameters following this struct
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_invoke_arg {
|
||||||
|
__u32 func;
|
||||||
|
__u32 session;
|
||||||
|
__u32 cancel_id;
|
||||||
|
__u32 ret;
|
||||||
|
__u32 ret_origin;
|
||||||
|
__u32 num_params;
|
||||||
|
/* num_params tells the actual number of element in params */
|
||||||
|
struct tee_ioctl_param params[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_INVOKE - Invokes a function in a Trusted Application
|
||||||
|
*
|
||||||
|
* Takes a struct tee_ioctl_buf_data which contains a struct
|
||||||
|
* tee_invoke_func_arg followed by any array of struct tee_param
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_INVOKE _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 3, \
|
||||||
|
struct tee_ioctl_buf_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_cancel_arg - Cancels an open session or invoke ioctl
|
||||||
|
* @cancel_id: [in] Cancellation id, a unique value to identify this request
|
||||||
|
* @session: [in] Session id, if the session is opened, else set to 0
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_cancel_arg {
|
||||||
|
__u32 cancel_id;
|
||||||
|
__u32 session;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_CANCEL - Cancels an open session or invoke
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_CANCEL _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 4, \
|
||||||
|
struct tee_ioctl_cancel_arg)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_close_session_arg - Closes an open session
|
||||||
|
* @session: [in] Session id
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_close_session_arg {
|
||||||
|
__u32 session;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_CLOSE_SESSION - Closes a session
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_CLOSE_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 5, \
|
||||||
|
struct tee_ioctl_close_session_arg)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_iocl_supp_recv_arg - Receive a request for a supplicant function
|
||||||
|
* @func: [in] supplicant function
|
||||||
|
* @num_params [in/out] number of parameters following this struct
|
||||||
|
*
|
||||||
|
* @num_params is the number of params that tee-supplicant has room to
|
||||||
|
* receive when input, @num_params is the number of actual params
|
||||||
|
* tee-supplicant receives when output.
|
||||||
|
*/
|
||||||
|
struct tee_iocl_supp_recv_arg {
|
||||||
|
__u32 func;
|
||||||
|
__u32 num_params;
|
||||||
|
/* num_params tells the actual number of element in params */
|
||||||
|
struct tee_ioctl_param params[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_SUPPL_RECV - Receive a request for a supplicant function
|
||||||
|
*
|
||||||
|
* Takes a struct tee_ioctl_buf_data which contains a struct
|
||||||
|
* tee_iocl_supp_recv_arg followed by any array of struct tee_param
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_SUPPL_RECV _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 6, \
|
||||||
|
struct tee_ioctl_buf_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_iocl_supp_send_arg - Send a response to a received request
|
||||||
|
* @ret: [out] return value
|
||||||
|
* @num_params [in] number of parameters following this struct
|
||||||
|
*/
|
||||||
|
struct tee_iocl_supp_send_arg {
|
||||||
|
__u32 ret;
|
||||||
|
__u32 num_params;
|
||||||
|
/* num_params tells the actual number of element in params */
|
||||||
|
struct tee_ioctl_param params[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_SUPPL_SEND - Receive a request for a supplicant function
|
||||||
|
*
|
||||||
|
* Takes a struct tee_ioctl_buf_data which contains a struct
|
||||||
|
* tee_iocl_supp_send_arg followed by any array of struct tee_param
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
|
||||||
|
struct tee_ioctl_buf_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_shm_register_data - Shared memory register argument
|
||||||
|
* @addr: [in] Start address of shared memory to register
|
||||||
|
* @length: [in/out] Length of shared memory to register
|
||||||
|
* @flags: [in/out] Flags to/from registration.
|
||||||
|
* @id: [out] Identifier of the shared memory
|
||||||
|
*
|
||||||
|
* The flags field should currently be zero as input. Updated by the call
|
||||||
|
* with actual flags as defined by TEE_IOCTL_SHM_* above.
|
||||||
|
* This structure is used as argument for TEE_IOC_SHM_REGISTER below.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_shm_register_data {
|
||||||
|
__u64 addr;
|
||||||
|
__u64 length;
|
||||||
|
__u32 flags;
|
||||||
|
__s32 id;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_SHM_REGISTER_FD - register a shared memory from a file descriptor
|
||||||
|
*
|
||||||
|
* Returns a file descriptor on success or < 0 on failure
|
||||||
|
*
|
||||||
|
* The returned file descriptor refers to the shared memory object in kernel
|
||||||
|
* land. The shared memory is freed when the descriptor is closed.
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_SHM_REGISTER_FD _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \
|
||||||
|
struct tee_ioctl_shm_register_fd_data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tee_ioctl_buf_data - Variable sized buffer
|
||||||
|
* @buf_ptr: [in] A __user pointer to a buffer
|
||||||
|
* @buf_len: [in] Length of the buffer above
|
||||||
|
*
|
||||||
|
* Used as argument for TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
|
||||||
|
* TEE_IOC_SUPPL_RECV, and TEE_IOC_SUPPL_SEND below.
|
||||||
|
*/
|
||||||
|
struct tee_ioctl_buf_data {
|
||||||
|
__u64 buf_ptr;
|
||||||
|
__u64 buf_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEE_IOC_SHM_REGISTER - Register shared memory argument
|
||||||
|
*
|
||||||
|
* Registers shared memory between the user space process and secure OS.
|
||||||
|
*
|
||||||
|
* Returns a file descriptor on success or < 0 on failure
|
||||||
|
*
|
||||||
|
* The shared memory is unregisterred when the descriptor is closed.
|
||||||
|
*/
|
||||||
|
#define TEE_IOC_SHM_REGISTER _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \
|
||||||
|
struct tee_ioctl_shm_register_data)
|
||||||
|
/*
|
||||||
|
* Five syscalls are used when communicating with the TEE driver.
|
||||||
|
* open(): opens the device associated with the driver
|
||||||
|
* ioctl(): as described above operating on the file descriptor from open()
|
||||||
|
* close(): two cases
|
||||||
|
* - closes the device file descriptor
|
||||||
|
* - closes a file descriptor connected to allocated shared memory
|
||||||
|
* mmap(): maps shared memory into user space using information from struct
|
||||||
|
* tee_ioctl_shm_alloc_data
|
||||||
|
* munmap(): unmaps previously shared memory
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /*__TEE_H*/
|
||||||
37
optee/optee_client/libteec/include/teec_benchmark.h
Normal file
37
optee/optee_client/libteec/include/teec_benchmark.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __TEEC_BENCHMARK_H
|
||||||
|
#define __TEEC_BENCHMARK_H
|
||||||
|
|
||||||
|
#ifdef CFG_TEE_BENCHMARK
|
||||||
|
void bm_timestamp(void);
|
||||||
|
#else
|
||||||
|
static inline void bm_timestamp(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __TEEC_BENCHMARK_H */
|
||||||
21
optee/optee_client/libteec/libteec.pc.in
Normal file
21
optee/optee_client/libteec/libteec.pc.in
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# this template is filled-in by CMake `configure_file(... @ONLY)`
|
||||||
|
# the `@....@` are filled in by CMake configure_file(),
|
||||||
|
# from variables set in your CMakeLists.txt or by CMake itself
|
||||||
|
#
|
||||||
|
# Good tutoral for understanding .pc files:
|
||||||
|
# https://people.freedesktop.org/~dbn/pkg-config-guide.html
|
||||||
|
|
||||||
|
prefix="@CMAKE_INSTALL_PREFIX@"
|
||||||
|
exec_prefix="${prefix}"
|
||||||
|
libdir="${prefix}/lib"
|
||||||
|
includedir="${prefix}/include"
|
||||||
|
|
||||||
|
Name: @PROJECT_NAME@
|
||||||
|
Description: @CMAKE_PROJECT_DESCRIPTION@
|
||||||
|
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
|
||||||
|
Version: @PROJECT_VERSION@
|
||||||
|
Requires: @pc_req_public@
|
||||||
|
Requires.private: @pc_req_private@
|
||||||
|
Cflags: -I"${includedir}"
|
||||||
|
Libs: -L"${libdir}" -l@libteectgt@
|
||||||
|
Libs.private: -L"${libdir}" -l@libteectgt@ @pc_libs_private@
|
||||||
958
optee/optee_client/libteec/src/tee_client_api.c
Normal file
958
optee/optee_client/libteec/src/tee_client_api.c
Normal file
@@ -0,0 +1,958 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015-2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api_extensions.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
#include "teec_benchmark.h"
|
||||||
|
|
||||||
|
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
||||||
|
/* How many device sequence numbers will be tried before giving up */
|
||||||
|
#define TEEC_MAX_DEV_SEQ 10
|
||||||
|
|
||||||
|
/* Helpers to access memref parts of a struct tee_ioctl_param */
|
||||||
|
#define MEMREF_SHM_ID(p) ((p)->c)
|
||||||
|
#define MEMREF_SHM_OFFS(p) ((p)->a)
|
||||||
|
#define MEMREF_SIZE(p) ((p)->b)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Internal flags of TEEC_SharedMemory::internal.flags
|
||||||
|
*/
|
||||||
|
#define SHM_FLAG_BUFFER_ALLOCED (1u << 0)
|
||||||
|
#define SHM_FLAG_SHADOW_BUFFER_ALLOCED (1u << 1)
|
||||||
|
|
||||||
|
static pthread_mutex_t teec_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
static void teec_mutex_lock(pthread_mutex_t *mu)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(mu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_mutex_unlock(pthread_mutex_t *mu)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(mu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *teec_paged_aligned_alloc(size_t sz)
|
||||||
|
{
|
||||||
|
void *p = NULL;
|
||||||
|
|
||||||
|
if (!posix_memalign(&p, sysconf(_SC_PAGESIZE), sz))
|
||||||
|
return p;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int teec_open_dev(const char *devname, const char *capabilities,
|
||||||
|
uint32_t *gen_caps)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
struct tee_ioctl_version_data vers;
|
||||||
|
|
||||||
|
memset(&vers, 0, sizeof(vers));
|
||||||
|
|
||||||
|
fd = open(devname, O_RDWR);
|
||||||
|
if (fd < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (ioctl(fd, TEE_IOC_VERSION, &vers)) {
|
||||||
|
EMSG("TEE_IOC_VERSION failed");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We can only handle GP TEEs */
|
||||||
|
if (!(vers.gen_caps & TEE_GEN_CAP_GP))
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if (capabilities) {
|
||||||
|
if (strcmp(capabilities, "optee-tz") == 0) {
|
||||||
|
if (vers.impl_id != TEE_IMPL_ID_OPTEE)
|
||||||
|
goto err;
|
||||||
|
if (!(vers.impl_caps & TEE_OPTEE_CAP_TZ))
|
||||||
|
goto err;
|
||||||
|
} else {
|
||||||
|
/* Unrecognized capability requested */
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*gen_caps = vers.gen_caps;
|
||||||
|
return fd;
|
||||||
|
err:
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int teec_shm_alloc(int fd, size_t size, int *id)
|
||||||
|
{
|
||||||
|
int shm_fd = 0;
|
||||||
|
struct tee_ioctl_shm_alloc_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
data.size = size;
|
||||||
|
shm_fd = ioctl(fd, TEE_IOC_SHM_ALLOC, &data);
|
||||||
|
if (shm_fd < 0)
|
||||||
|
return -1;
|
||||||
|
*id = data.id;
|
||||||
|
return shm_fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int teec_shm_register(int fd, void *buf, size_t size, int *id)
|
||||||
|
{
|
||||||
|
int shm_fd = 0;
|
||||||
|
struct tee_ioctl_shm_register_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
data.addr = (uintptr_t)buf;
|
||||||
|
data.length = size;
|
||||||
|
shm_fd = ioctl(fd, TEE_IOC_SHM_REGISTER, &data);
|
||||||
|
if (shm_fd < 0)
|
||||||
|
return -1;
|
||||||
|
*id = data.id;
|
||||||
|
return shm_fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *ctx)
|
||||||
|
{
|
||||||
|
char devname[PATH_MAX] = { 0 };
|
||||||
|
int fd = 0;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (!ctx)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
for (n = 0; n < TEEC_MAX_DEV_SEQ; n++) {
|
||||||
|
uint32_t gen_caps = 0;
|
||||||
|
|
||||||
|
snprintf(devname, sizeof(devname), "/dev/tee%zu", n);
|
||||||
|
fd = teec_open_dev(devname, name, &gen_caps);
|
||||||
|
if (fd >= 0) {
|
||||||
|
ctx->fd = fd;
|
||||||
|
ctx->reg_mem = gen_caps & TEE_GEN_CAP_REG_MEM;
|
||||||
|
ctx->memref_null = gen_caps & TEE_GEN_CAP_MEMREF_NULL;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEEC_FinalizeContext(TEEC_Context *ctx)
|
||||||
|
{
|
||||||
|
if (ctx)
|
||||||
|
close(ctx->fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static TEEC_Result teec_pre_process_tmpref(TEEC_Context *ctx,
|
||||||
|
uint32_t param_type, TEEC_TempMemoryReference *tmpref,
|
||||||
|
struct tee_ioctl_param *param,
|
||||||
|
TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
|
||||||
|
switch (param_type) {
|
||||||
|
case TEEC_MEMREF_TEMP_INPUT:
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
|
||||||
|
shm->flags = TEEC_MEM_INPUT;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_TEMP_OUTPUT:
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT;
|
||||||
|
shm->flags = TEEC_MEM_OUTPUT;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_TEMP_INOUT:
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT;
|
||||||
|
shm->flags = TEEC_MEM_INPUT | TEEC_MEM_OUTPUT;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
shm->size = tmpref->size;
|
||||||
|
|
||||||
|
if (!tmpref->buffer) {
|
||||||
|
if (tmpref->size)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (ctx->memref_null) {
|
||||||
|
/* Null pointer, indicate no shared memory attached */
|
||||||
|
MEMREF_SHM_ID(param) = TEE_MEMREF_NULL;
|
||||||
|
shm->id = -1;
|
||||||
|
} else {
|
||||||
|
res = TEEC_AllocateSharedMemory(ctx, shm);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
MEMREF_SHM_ID(param) = shm->id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
shm->buffer = tmpref->buffer;
|
||||||
|
res = TEEC_RegisterSharedMemory(ctx, shm);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
if (shm->shadow_buffer)
|
||||||
|
memcpy(shm->shadow_buffer, tmpref->buffer,
|
||||||
|
tmpref->size);
|
||||||
|
|
||||||
|
MEMREF_SHM_ID(param) = shm->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
MEMREF_SIZE(param) = tmpref->size;
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result teec_pre_process_whole(
|
||||||
|
TEEC_RegisteredMemoryReference *memref,
|
||||||
|
struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
const uint32_t inout = TEEC_MEM_INPUT | TEEC_MEM_OUTPUT;
|
||||||
|
uint32_t flags = memref->parent->flags & inout;
|
||||||
|
TEEC_SharedMemory *shm = NULL;
|
||||||
|
|
||||||
|
if (flags == inout)
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT;
|
||||||
|
else if (flags & TEEC_MEM_INPUT)
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
|
||||||
|
else if (flags & TEEC_MEM_OUTPUT)
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT;
|
||||||
|
else
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
shm = memref->parent;
|
||||||
|
/*
|
||||||
|
* We're using a shadow buffer in this reference, copy the real buffer
|
||||||
|
* into the shadow buffer if needed. We'll copy it back once we've
|
||||||
|
* returned from the call to secure world.
|
||||||
|
*/
|
||||||
|
if (shm->shadow_buffer && (flags & TEEC_MEM_INPUT))
|
||||||
|
memcpy(shm->shadow_buffer, shm->buffer, shm->size);
|
||||||
|
|
||||||
|
MEMREF_SHM_ID(param) = shm->id;
|
||||||
|
MEMREF_SIZE(param) = shm->size;
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result teec_pre_process_partial(uint32_t param_type,
|
||||||
|
TEEC_RegisteredMemoryReference *memref,
|
||||||
|
struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
uint32_t req_shm_flags = 0;
|
||||||
|
TEEC_SharedMemory *shm = NULL;
|
||||||
|
|
||||||
|
switch (param_type) {
|
||||||
|
case TEEC_MEMREF_PARTIAL_INPUT:
|
||||||
|
req_shm_flags = TEEC_MEM_INPUT;
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_PARTIAL_OUTPUT:
|
||||||
|
req_shm_flags = TEEC_MEM_OUTPUT;
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_PARTIAL_INOUT:
|
||||||
|
req_shm_flags = TEEC_MEM_OUTPUT | TEEC_MEM_INPUT;
|
||||||
|
param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm = memref->parent;
|
||||||
|
|
||||||
|
if ((shm->flags & req_shm_flags) != req_shm_flags)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if ((memref->offset + memref->size < memref->offset) ||
|
||||||
|
(memref->offset + memref->size > shm->size))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We're using a shadow buffer in this reference, copy the real buffer
|
||||||
|
* into the shadow buffer if needed. We'll copy it back once we've
|
||||||
|
* returned from the call to secure world.
|
||||||
|
*/
|
||||||
|
if (shm->shadow_buffer && param_type != TEEC_MEMREF_PARTIAL_OUTPUT)
|
||||||
|
memcpy((char *)shm->shadow_buffer + memref->offset,
|
||||||
|
(char *)shm->buffer + memref->offset, memref->size);
|
||||||
|
|
||||||
|
MEMREF_SHM_ID(param) = shm->id;
|
||||||
|
MEMREF_SHM_OFFS(param) = memref->offset;
|
||||||
|
MEMREF_SIZE(param) = memref->size;
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result teec_pre_process_operation(TEEC_Context *ctx,
|
||||||
|
TEEC_Operation *operation,
|
||||||
|
struct tee_ioctl_param *params,
|
||||||
|
TEEC_SharedMemory *shms)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
memset(shms, 0, sizeof(TEEC_SharedMemory) *
|
||||||
|
TEEC_CONFIG_PAYLOAD_REF_COUNT);
|
||||||
|
|
||||||
|
for (n = 0; n < TEEC_CONFIG_PAYLOAD_REF_COUNT; n++)
|
||||||
|
shms[n].id = -1;
|
||||||
|
|
||||||
|
if (!operation) {
|
||||||
|
memset(params, 0, sizeof(struct tee_ioctl_param) *
|
||||||
|
TEEC_CONFIG_PAYLOAD_REF_COUNT);
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (n = 0; n < TEEC_CONFIG_PAYLOAD_REF_COUNT; n++) {
|
||||||
|
uint32_t param_type = 0;
|
||||||
|
|
||||||
|
param_type = TEEC_PARAM_TYPE_GET(operation->paramTypes, n);
|
||||||
|
switch (param_type) {
|
||||||
|
case TEEC_NONE:
|
||||||
|
params[n].attr = param_type;
|
||||||
|
break;
|
||||||
|
case TEEC_VALUE_INPUT:
|
||||||
|
case TEEC_VALUE_OUTPUT:
|
||||||
|
case TEEC_VALUE_INOUT:
|
||||||
|
params[n].attr = param_type;
|
||||||
|
params[n].a = operation->params[n].value.a;
|
||||||
|
params[n].b = operation->params[n].value.b;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_TEMP_INPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_OUTPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_INOUT:
|
||||||
|
res = teec_pre_process_tmpref(ctx, param_type,
|
||||||
|
&operation->params[n].tmpref, params + n,
|
||||||
|
shms + n);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_WHOLE:
|
||||||
|
res = teec_pre_process_whole(
|
||||||
|
&operation->params[n].memref,
|
||||||
|
params + n);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_PARTIAL_INPUT:
|
||||||
|
case TEEC_MEMREF_PARTIAL_OUTPUT:
|
||||||
|
case TEEC_MEMREF_PARTIAL_INOUT:
|
||||||
|
res = teec_pre_process_partial(param_type,
|
||||||
|
&operation->params[n].memref, params + n);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_post_process_tmpref(uint32_t param_type,
|
||||||
|
TEEC_TempMemoryReference *tmpref,
|
||||||
|
struct tee_ioctl_param *param,
|
||||||
|
TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
if (param_type != TEEC_MEMREF_TEMP_INPUT) {
|
||||||
|
if (tmpref->buffer && shm->shadow_buffer)
|
||||||
|
memcpy(tmpref->buffer, shm->shadow_buffer,
|
||||||
|
MIN(MEMREF_SIZE(param), tmpref->size));
|
||||||
|
|
||||||
|
tmpref->size = MEMREF_SIZE(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_post_process_whole(TEEC_RegisteredMemoryReference *memref,
|
||||||
|
struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
TEEC_SharedMemory *shm = memref->parent;
|
||||||
|
|
||||||
|
if (shm->flags & TEEC_MEM_OUTPUT) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We're using a shadow buffer in this reference, copy back
|
||||||
|
* the shadow buffer into the real buffer now that we've
|
||||||
|
* returned from secure world.
|
||||||
|
*/
|
||||||
|
if (shm->shadow_buffer && MEMREF_SIZE(param) <= shm->size)
|
||||||
|
memcpy(shm->buffer, shm->shadow_buffer,
|
||||||
|
MEMREF_SIZE(param));
|
||||||
|
|
||||||
|
memref->size = MEMREF_SIZE(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_post_process_partial(uint32_t param_type,
|
||||||
|
TEEC_RegisteredMemoryReference *memref,
|
||||||
|
struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
if (param_type != TEEC_MEMREF_PARTIAL_INPUT) {
|
||||||
|
TEEC_SharedMemory *shm = memref->parent;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We're using a shadow buffer in this reference, copy back
|
||||||
|
* the shadow buffer into the real buffer now that we've
|
||||||
|
* returned from secure world.
|
||||||
|
*/
|
||||||
|
if (shm->shadow_buffer && MEMREF_SIZE(param) <= memref->size)
|
||||||
|
memcpy((char *)shm->buffer + memref->offset,
|
||||||
|
(char *)shm->shadow_buffer + memref->offset,
|
||||||
|
MEMREF_SIZE(param));
|
||||||
|
|
||||||
|
memref->size = MEMREF_SIZE(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_post_process_operation(TEEC_Operation *operation,
|
||||||
|
struct tee_ioctl_param *params,
|
||||||
|
TEEC_SharedMemory *shms)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (!operation)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (n = 0; n < TEEC_CONFIG_PAYLOAD_REF_COUNT; n++) {
|
||||||
|
uint32_t param_type = 0;
|
||||||
|
|
||||||
|
param_type = TEEC_PARAM_TYPE_GET(operation->paramTypes, n);
|
||||||
|
switch (param_type) {
|
||||||
|
case TEEC_VALUE_INPUT:
|
||||||
|
break;
|
||||||
|
case TEEC_VALUE_OUTPUT:
|
||||||
|
case TEEC_VALUE_INOUT:
|
||||||
|
operation->params[n].value.a = params[n].a;
|
||||||
|
operation->params[n].value.b = params[n].b;
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_TEMP_INPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_OUTPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_INOUT:
|
||||||
|
teec_post_process_tmpref(param_type,
|
||||||
|
&operation->params[n].tmpref, params + n,
|
||||||
|
shms + n);
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_WHOLE:
|
||||||
|
teec_post_process_whole(&operation->params[n].memref,
|
||||||
|
params + n);
|
||||||
|
break;
|
||||||
|
case TEEC_MEMREF_PARTIAL_INPUT:
|
||||||
|
case TEEC_MEMREF_PARTIAL_OUTPUT:
|
||||||
|
case TEEC_MEMREF_PARTIAL_INOUT:
|
||||||
|
teec_post_process_partial(param_type,
|
||||||
|
&operation->params[n].memref, params + n);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void teec_free_temp_refs(TEEC_Operation *operation,
|
||||||
|
TEEC_SharedMemory *shms)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (!operation)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (n = 0; n < TEEC_CONFIG_PAYLOAD_REF_COUNT; n++) {
|
||||||
|
switch (TEEC_PARAM_TYPE_GET(operation->paramTypes, n)) {
|
||||||
|
case TEEC_MEMREF_TEMP_INPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_OUTPUT:
|
||||||
|
case TEEC_MEMREF_TEMP_INOUT:
|
||||||
|
TEEC_ReleaseSharedMemory(shms + n);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ioctl_errno_to_res(int err)
|
||||||
|
{
|
||||||
|
switch (err) {
|
||||||
|
case ENOMEM:
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
case EINVAL:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void uuid_to_octets(uint8_t d[TEE_IOCTL_UUID_LEN], const TEEC_UUID *s)
|
||||||
|
{
|
||||||
|
d[0] = s->timeLow >> 24;
|
||||||
|
d[1] = s->timeLow >> 16;
|
||||||
|
d[2] = s->timeLow >> 8;
|
||||||
|
d[3] = s->timeLow;
|
||||||
|
d[4] = s->timeMid >> 8;
|
||||||
|
d[5] = s->timeMid;
|
||||||
|
d[6] = s->timeHiAndVersion >> 8;
|
||||||
|
d[7] = s->timeHiAndVersion;
|
||||||
|
memcpy(d + 8, s->clockSeqAndNode, sizeof(s->clockSeqAndNode));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setup_client_data(struct tee_ioctl_open_session_arg *arg,
|
||||||
|
uint32_t connection_method,
|
||||||
|
const void *connection_data)
|
||||||
|
{
|
||||||
|
arg->clnt_login = connection_method;
|
||||||
|
|
||||||
|
switch (connection_method) {
|
||||||
|
case TEE_IOCTL_LOGIN_PUBLIC:
|
||||||
|
/* No connection data to pass */
|
||||||
|
break;
|
||||||
|
case TEE_IOCTL_LOGIN_USER:
|
||||||
|
/* Kernel auto-fills UID and forms client UUID */
|
||||||
|
break;
|
||||||
|
case TEE_IOCTL_LOGIN_GROUP:
|
||||||
|
/*
|
||||||
|
* Connection data for group login is uint32_t and rest of
|
||||||
|
* clnt_uuid is set as zero.
|
||||||
|
*
|
||||||
|
* Kernel verifies group membership and then forms client UUID.
|
||||||
|
*/
|
||||||
|
memcpy(arg->clnt_uuid, connection_data, sizeof(gid_t));
|
||||||
|
break;
|
||||||
|
case TEE_IOCTL_LOGIN_APPLICATION:
|
||||||
|
/*
|
||||||
|
* Kernel auto-fills application identifier and forms client
|
||||||
|
* UUID.
|
||||||
|
*/
|
||||||
|
break;
|
||||||
|
case TEE_IOCTL_LOGIN_USER_APPLICATION:
|
||||||
|
/*
|
||||||
|
* Kernel auto-fills application identifier, UID and forms
|
||||||
|
* client UUID.
|
||||||
|
*/
|
||||||
|
break;
|
||||||
|
case TEE_IOCTL_LOGIN_GROUP_APPLICATION:
|
||||||
|
/*
|
||||||
|
* Connection data for group login is uint32_t rest of
|
||||||
|
* clnt_uuid is set as zero.
|
||||||
|
*
|
||||||
|
* Kernel verifies group membership, auto-fills application
|
||||||
|
* identifier and then forms client UUID.
|
||||||
|
*/
|
||||||
|
memcpy(arg->clnt_uuid, connection_data, sizeof(gid_t));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/*
|
||||||
|
* Unknown login method, don't pass any connection data as we
|
||||||
|
* don't know size.
|
||||||
|
*/
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_OpenSession(TEEC_Context *ctx, TEEC_Session *session,
|
||||||
|
const TEEC_UUID *destination,
|
||||||
|
uint32_t connection_method, const void *connection_data,
|
||||||
|
TEEC_Operation *operation, uint32_t *ret_origin)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_open_session_arg *arg = NULL;
|
||||||
|
struct tee_ioctl_param *params = NULL;
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint32_t eorig = 0;
|
||||||
|
int rc = 0;
|
||||||
|
const size_t arg_size = sizeof(struct tee_ioctl_open_session_arg) +
|
||||||
|
TEEC_CONFIG_PAYLOAD_REF_COUNT *
|
||||||
|
sizeof(struct tee_ioctl_param);
|
||||||
|
union {
|
||||||
|
struct tee_ioctl_open_session_arg arg;
|
||||||
|
uint8_t data[arg_size];
|
||||||
|
} buf;
|
||||||
|
struct tee_ioctl_buf_data buf_data;
|
||||||
|
TEEC_SharedMemory shm[TEEC_CONFIG_PAYLOAD_REF_COUNT];
|
||||||
|
|
||||||
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
memset(&shm, 0, sizeof(shm));
|
||||||
|
memset(&buf_data, 0, sizeof(buf_data));
|
||||||
|
|
||||||
|
if (!ctx || !session) {
|
||||||
|
eorig = TEEC_ORIGIN_API;
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf_data.buf_ptr = (uintptr_t)&buf;
|
||||||
|
buf_data.buf_len = sizeof(buf);
|
||||||
|
|
||||||
|
arg = &buf.arg;
|
||||||
|
arg->num_params = TEEC_CONFIG_PAYLOAD_REF_COUNT;
|
||||||
|
params = (struct tee_ioctl_param *)(arg + 1);
|
||||||
|
|
||||||
|
uuid_to_octets(arg->uuid, destination);
|
||||||
|
|
||||||
|
setup_client_data(arg, connection_method, connection_data);
|
||||||
|
|
||||||
|
res = teec_pre_process_operation(ctx, operation, params, shm);
|
||||||
|
if (res != TEEC_SUCCESS) {
|
||||||
|
eorig = TEEC_ORIGIN_API;
|
||||||
|
goto out_free_temp_refs;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = ioctl(ctx->fd, TEE_IOC_OPEN_SESSION, &buf_data);
|
||||||
|
if (rc) {
|
||||||
|
EMSG("TEE_IOC_OPEN_SESSION failed");
|
||||||
|
eorig = TEEC_ORIGIN_COMMS;
|
||||||
|
res = ioctl_errno_to_res(errno);
|
||||||
|
goto out_free_temp_refs;
|
||||||
|
}
|
||||||
|
res = arg->ret;
|
||||||
|
eorig = arg->ret_origin;
|
||||||
|
if (res == TEEC_SUCCESS) {
|
||||||
|
session->ctx = ctx;
|
||||||
|
session->session_id = arg->session;
|
||||||
|
}
|
||||||
|
teec_post_process_operation(operation, params, shm);
|
||||||
|
|
||||||
|
out_free_temp_refs:
|
||||||
|
teec_free_temp_refs(operation, shm);
|
||||||
|
out:
|
||||||
|
if (ret_origin)
|
||||||
|
*ret_origin = eorig;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEEC_CloseSession(TEEC_Session *session)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_close_session_arg arg;
|
||||||
|
|
||||||
|
memset(&arg, 0, sizeof(arg));
|
||||||
|
|
||||||
|
if (!session)
|
||||||
|
return;
|
||||||
|
|
||||||
|
arg.session = session->session_id;
|
||||||
|
if (ioctl(session->ctx->fd, TEE_IOC_CLOSE_SESSION, &arg))
|
||||||
|
EMSG("Failed to close session 0x%x", session->session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint32_t cmd_id,
|
||||||
|
TEEC_Operation *operation, uint32_t *error_origin)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_invoke_arg *arg = NULL;
|
||||||
|
struct tee_ioctl_param *params = NULL;
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint32_t eorig = 0;
|
||||||
|
int rc = 0;
|
||||||
|
const size_t arg_size = sizeof(struct tee_ioctl_invoke_arg) +
|
||||||
|
TEEC_CONFIG_PAYLOAD_REF_COUNT *
|
||||||
|
sizeof(struct tee_ioctl_param);
|
||||||
|
union {
|
||||||
|
struct tee_ioctl_invoke_arg arg;
|
||||||
|
uint8_t data[arg_size];
|
||||||
|
} buf;
|
||||||
|
struct tee_ioctl_buf_data buf_data;
|
||||||
|
TEEC_SharedMemory shm[TEEC_CONFIG_PAYLOAD_REF_COUNT];
|
||||||
|
|
||||||
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
memset(&buf_data, 0, sizeof(buf_data));
|
||||||
|
memset(&shm, 0, sizeof(shm));
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
eorig = TEEC_ORIGIN_API;
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
bm_timestamp();
|
||||||
|
|
||||||
|
buf_data.buf_ptr = (uintptr_t)&buf;
|
||||||
|
buf_data.buf_len = sizeof(buf);
|
||||||
|
|
||||||
|
arg = &buf.arg;
|
||||||
|
arg->num_params = TEEC_CONFIG_PAYLOAD_REF_COUNT;
|
||||||
|
params = (struct tee_ioctl_param *)(arg + 1);
|
||||||
|
|
||||||
|
arg->session = session->session_id;
|
||||||
|
arg->func = cmd_id;
|
||||||
|
|
||||||
|
if (operation) {
|
||||||
|
teec_mutex_lock(&teec_mutex);
|
||||||
|
operation->session = session;
|
||||||
|
teec_mutex_unlock(&teec_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
res = teec_pre_process_operation(session->ctx, operation, params, shm);
|
||||||
|
if (res != TEEC_SUCCESS) {
|
||||||
|
eorig = TEEC_ORIGIN_API;
|
||||||
|
goto out_free_temp_refs;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = ioctl(session->ctx->fd, TEE_IOC_INVOKE, &buf_data);
|
||||||
|
if (rc) {
|
||||||
|
EMSG("TEE_IOC_INVOKE failed");
|
||||||
|
eorig = TEEC_ORIGIN_COMMS;
|
||||||
|
res = ioctl_errno_to_res(errno);
|
||||||
|
goto out_free_temp_refs;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = arg->ret;
|
||||||
|
eorig = arg->ret_origin;
|
||||||
|
teec_post_process_operation(operation, params, shm);
|
||||||
|
|
||||||
|
bm_timestamp();
|
||||||
|
|
||||||
|
out_free_temp_refs:
|
||||||
|
teec_free_temp_refs(operation, shm);
|
||||||
|
out:
|
||||||
|
if (error_origin)
|
||||||
|
*error_origin = eorig;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEEC_RequestCancellation(TEEC_Operation *operation)
|
||||||
|
{
|
||||||
|
TEEC_Session *session = NULL;
|
||||||
|
struct tee_ioctl_cancel_arg arg;
|
||||||
|
|
||||||
|
memset(&arg, 0, sizeof(arg));
|
||||||
|
|
||||||
|
if (!operation)
|
||||||
|
return;
|
||||||
|
|
||||||
|
teec_mutex_lock(&teec_mutex);
|
||||||
|
session = operation->session;
|
||||||
|
teec_mutex_unlock(&teec_mutex);
|
||||||
|
|
||||||
|
if (!session)
|
||||||
|
return;
|
||||||
|
|
||||||
|
arg.session = session->session_id;
|
||||||
|
arg.cancel_id = 0;
|
||||||
|
|
||||||
|
if (ioctl(session->ctx->fd, TEE_IOC_CANCEL, &arg))
|
||||||
|
EMSG("TEE_IOC_CANCEL: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_RegisterSharedMemory(TEEC_Context *ctx, TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
int fd = 0;
|
||||||
|
size_t s = 0;
|
||||||
|
|
||||||
|
if (!ctx || !shm)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!shm->flags || (shm->flags & ~(TEEC_MEM_INPUT | TEEC_MEM_OUTPUT)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!shm->buffer)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
s = shm->size;
|
||||||
|
if (!s)
|
||||||
|
s = 8;
|
||||||
|
if (ctx->reg_mem) {
|
||||||
|
fd = teec_shm_register(ctx->fd, shm->buffer, s, &shm->id);
|
||||||
|
if (fd >= 0) {
|
||||||
|
shm->registered_fd = fd;
|
||||||
|
shm->shadow_buffer = NULL;
|
||||||
|
shm->internal.flags = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we're here TEE_IOC_SHM_REGISTER failed, probably
|
||||||
|
* because some read-only memory was supplied and the Linux
|
||||||
|
* kernel doesn't like that at the moment.
|
||||||
|
*
|
||||||
|
* The error could also have some other origin. In any case
|
||||||
|
* we're not making matters worse by trying to allocate and
|
||||||
|
* register a shadow buffer before giving up.
|
||||||
|
*/
|
||||||
|
shm->shadow_buffer = teec_paged_aligned_alloc(s);
|
||||||
|
if (!shm->shadow_buffer)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
fd = teec_shm_register(ctx->fd, shm->shadow_buffer, s,
|
||||||
|
&shm->id);
|
||||||
|
if (fd >= 0) {
|
||||||
|
shm->registered_fd = fd;
|
||||||
|
shm->internal.flags = SHM_FLAG_SHADOW_BUFFER_ALLOCED;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errno == ENOMEM)
|
||||||
|
res = TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
else
|
||||||
|
res = TEEC_ERROR_GENERIC;
|
||||||
|
free(shm->shadow_buffer);
|
||||||
|
shm->shadow_buffer = NULL;
|
||||||
|
return res;
|
||||||
|
} else {
|
||||||
|
fd = teec_shm_alloc(ctx->fd, s, &shm->id);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
shm->shadow_buffer = mmap(NULL, s, PROT_READ | PROT_WRITE,
|
||||||
|
MAP_SHARED, fd, 0);
|
||||||
|
close(fd);
|
||||||
|
if (shm->shadow_buffer == (void *)MAP_FAILED) {
|
||||||
|
shm->id = -1;
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
shm->registered_fd = -1;
|
||||||
|
shm->internal.flags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
shm->alloced_size = s;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_RegisterSharedMemoryFileDescriptor(TEEC_Context *ctx,
|
||||||
|
TEEC_SharedMemory *shm,
|
||||||
|
int fd)
|
||||||
|
{
|
||||||
|
int rfd = 0;
|
||||||
|
struct tee_ioctl_shm_register_fd_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
if (!ctx || !shm || fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!shm->flags || (shm->flags & ~(TEEC_MEM_INPUT | TEEC_MEM_OUTPUT)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
data.fd = fd;
|
||||||
|
rfd = ioctl(ctx->fd, TEE_IOC_SHM_REGISTER_FD, &data);
|
||||||
|
if (rfd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
shm->buffer = NULL;
|
||||||
|
shm->shadow_buffer = NULL;
|
||||||
|
shm->registered_fd = rfd;
|
||||||
|
shm->id = data.id;
|
||||||
|
shm->size = data.size;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *ctx, TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
size_t s = 0;
|
||||||
|
|
||||||
|
if (!ctx || !shm)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!shm->flags || (shm->flags & ~(TEEC_MEM_INPUT | TEEC_MEM_OUTPUT)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
s = shm->size;
|
||||||
|
if (!s)
|
||||||
|
s = 8;
|
||||||
|
|
||||||
|
if (ctx->reg_mem) {
|
||||||
|
shm->buffer = teec_paged_aligned_alloc(s);
|
||||||
|
if (!shm->buffer)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
fd = teec_shm_register(ctx->fd, shm->buffer, s, &shm->id);
|
||||||
|
if (fd < 0) {
|
||||||
|
free(shm->buffer);
|
||||||
|
shm->buffer = NULL;
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
shm->registered_fd = fd;
|
||||||
|
} else {
|
||||||
|
fd = teec_shm_alloc(ctx->fd, s, &shm->id);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
shm->buffer = mmap(NULL, s, PROT_READ | PROT_WRITE,
|
||||||
|
MAP_SHARED, fd, 0);
|
||||||
|
close(fd);
|
||||||
|
if (shm->buffer == (void *)MAP_FAILED) {
|
||||||
|
shm->id = -1;
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
shm->registered_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm->shadow_buffer = NULL;
|
||||||
|
shm->alloced_size = s;
|
||||||
|
shm->internal.flags = SHM_FLAG_BUFFER_ALLOCED;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
if (!shm || shm->id == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (shm->shadow_buffer) {
|
||||||
|
if (shm->registered_fd >= 0) {
|
||||||
|
if (shm->internal.flags &
|
||||||
|
SHM_FLAG_SHADOW_BUFFER_ALLOCED)
|
||||||
|
free(shm->shadow_buffer);
|
||||||
|
close(shm->registered_fd);
|
||||||
|
} else {
|
||||||
|
munmap(shm->shadow_buffer, shm->alloced_size);
|
||||||
|
}
|
||||||
|
} else if (shm->buffer) {
|
||||||
|
if (shm->registered_fd >= 0) {
|
||||||
|
if (shm->internal.flags & SHM_FLAG_BUFFER_ALLOCED)
|
||||||
|
free(shm->buffer);
|
||||||
|
close(shm->registered_fd);
|
||||||
|
} else {
|
||||||
|
munmap(shm->buffer, shm->alloced_size);
|
||||||
|
}
|
||||||
|
} else if (shm->registered_fd >= 0) {
|
||||||
|
close(shm->registered_fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
shm->id = -1;
|
||||||
|
shm->shadow_buffer = NULL;
|
||||||
|
shm->buffer = NULL;
|
||||||
|
shm->registered_fd = -1;
|
||||||
|
shm->internal.flags = 0;
|
||||||
|
}
|
||||||
221
optee/optee_client/libteec/src/teec_benchmark.c
Normal file
221
optee/optee_client/libteec/src/teec_benchmark.c
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#include <err.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <sched.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <tee_bench.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "teec_benchmark.h"
|
||||||
|
|
||||||
|
struct tee_ts_global *bench_ts_global;
|
||||||
|
static const TEEC_UUID pta_benchmark_uuid = PTA_BENCHMARK_UUID;
|
||||||
|
|
||||||
|
static TEEC_Context bench_ctx;
|
||||||
|
static TEEC_Session bench_sess;
|
||||||
|
|
||||||
|
static pthread_mutex_t teec_bench_mu = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
/* Cycle counter */
|
||||||
|
static inline uint64_t read_ccounter(void)
|
||||||
|
{
|
||||||
|
uint64_t ccounter = 0;
|
||||||
|
#ifdef __aarch64__
|
||||||
|
asm volatile("mrs %0, PMCCNTR_EL0" : "=r"(ccounter));
|
||||||
|
#else
|
||||||
|
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(ccounter));
|
||||||
|
#endif
|
||||||
|
return ccounter * TEE_BENCH_DIVIDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result benchmark_pta_open(void)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint32_t ret_orig = 0;
|
||||||
|
|
||||||
|
res = TEEC_InitializeContext(NULL, &bench_ctx);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
res = TEEC_OpenSession(&bench_ctx, &bench_sess,
|
||||||
|
&pta_benchmark_uuid,
|
||||||
|
TEEC_LOGIN_PUBLIC, NULL, NULL, &ret_orig);
|
||||||
|
if (res != TEEC_SUCCESS) {
|
||||||
|
TEEC_FinalizeContext(&bench_ctx);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void benchmark_pta_close(void)
|
||||||
|
{
|
||||||
|
TEEC_CloseSession(&bench_sess);
|
||||||
|
TEEC_FinalizeContext(&bench_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result benchmark_get_bench_buf_paddr(uint64_t *paddr_ts_buf,
|
||||||
|
uint64_t *size)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint32_t ret_orig = 0;
|
||||||
|
TEEC_Operation op;
|
||||||
|
|
||||||
|
memset(&op, 0, sizeof(op));
|
||||||
|
|
||||||
|
res = benchmark_pta_open();
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_OUTPUT, TEEC_NONE,
|
||||||
|
TEEC_NONE, TEEC_NONE);
|
||||||
|
|
||||||
|
res = TEEC_InvokeCommand(&bench_sess, BENCHMARK_CMD_GET_MEMREF,
|
||||||
|
&op, &ret_orig);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
*paddr_ts_buf = op.params[0].value.a;
|
||||||
|
*size = op.params[0].value.b;
|
||||||
|
|
||||||
|
benchmark_pta_close();
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *mmap_paddr(intptr_t paddr, uint64_t size)
|
||||||
|
{
|
||||||
|
int devmem = 0;
|
||||||
|
off_t offset = 0;
|
||||||
|
off_t page_addr = 0;
|
||||||
|
intptr_t *hw_addr = NULL;
|
||||||
|
|
||||||
|
devmem = open("/dev/mem", O_RDWR);
|
||||||
|
if (!devmem)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
offset = (off_t)paddr % getpagesize();
|
||||||
|
page_addr = (off_t)(paddr - offset);
|
||||||
|
|
||||||
|
hw_addr = (intptr_t *)mmap(0, size + offset, PROT_READ|PROT_WRITE,
|
||||||
|
MAP_SHARED, devmem, page_addr);
|
||||||
|
if (hw_addr == MAP_FAILED) {
|
||||||
|
close(devmem);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(devmem);
|
||||||
|
return (hw_addr + offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check if we are in benchmark mode */
|
||||||
|
static bool benchmark_check_mode(void)
|
||||||
|
{
|
||||||
|
uint64_t ts_buf_raw = 0;
|
||||||
|
uint64_t ts_buf_size = 0;
|
||||||
|
bool res = true;
|
||||||
|
|
||||||
|
if (!bench_ts_global) {
|
||||||
|
/* receive buffer from Benchmark PTA and register it */
|
||||||
|
benchmark_get_bench_buf_paddr(&ts_buf_raw, &ts_buf_size);
|
||||||
|
if (ts_buf_raw && ts_buf_size) {
|
||||||
|
bench_ts_global = mmap_paddr(ts_buf_raw, ts_buf_size);
|
||||||
|
res = (bench_ts_global) ? true : false;
|
||||||
|
} else {
|
||||||
|
res = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Adding timestamp to buffer */
|
||||||
|
void bm_timestamp(void)
|
||||||
|
{
|
||||||
|
struct tee_ts_cpu_buf *cpu_buf = NULL;
|
||||||
|
uint64_t ts_i = 0;
|
||||||
|
void *ret_addr = NULL;
|
||||||
|
uint32_t cur_cpu = 0;
|
||||||
|
int ret = 0;
|
||||||
|
cpu_set_t cpu_set_old;
|
||||||
|
cpu_set_t cpu_set_tmp;
|
||||||
|
struct tee_time_st ts_data;
|
||||||
|
|
||||||
|
memset(&cpu_set_old, 0, sizeof(cpu_set_old));
|
||||||
|
memset(&cpu_set_tmp, 0, sizeof(cpu_set_tmp));
|
||||||
|
memset(&ts_data, 0, sizeof(ts_data));
|
||||||
|
|
||||||
|
if (pthread_mutex_trylock(&teec_bench_mu))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!benchmark_check_mode())
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
CPU_ZERO(&cpu_set_old);
|
||||||
|
ret = sched_getaffinity(0, sizeof(cpu_set_old), &cpu_set_old);
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
/* stick to the same core while putting timestamp */
|
||||||
|
cur_cpu = sched_getcpu();
|
||||||
|
CPU_ZERO(&cpu_set_tmp);
|
||||||
|
CPU_SET(cur_cpu, &cpu_set_tmp);
|
||||||
|
ret = sched_setaffinity(0, sizeof(cpu_set_tmp), &cpu_set_tmp);
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
/* fill timestamp data */
|
||||||
|
if (cur_cpu >= bench_ts_global->cores) {
|
||||||
|
ret = sched_setaffinity(0, sizeof(cpu_set_old), &cpu_set_old);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret_addr = __builtin_return_address(0);
|
||||||
|
|
||||||
|
cpu_buf = &bench_ts_global->cpu_buf[cur_cpu];
|
||||||
|
ts_i = __sync_fetch_and_add(&cpu_buf->head, 1);
|
||||||
|
ts_data.cnt = read_ccounter();
|
||||||
|
ts_data.addr = (uintptr_t)ret_addr;
|
||||||
|
ts_data.src = TEE_BENCH_CLIENT;
|
||||||
|
cpu_buf->stamps[ts_i & TEE_BENCH_MAX_MASK] = ts_data;
|
||||||
|
|
||||||
|
/* set back affinity mask */
|
||||||
|
sched_setaffinity(0, sizeof(cpu_set_old), &cpu_set_old);
|
||||||
|
|
||||||
|
error:
|
||||||
|
pthread_mutex_unlock(&teec_bench_mu);
|
||||||
|
}
|
||||||
|
|
||||||
141
optee/optee_client/libteec/src/teec_trace.c
Normal file
141
optee/optee_client/libteec/src/teec_trace.c
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "teec_trace.h"
|
||||||
|
|
||||||
|
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The length of the prefix is 37, for example it looks like this:
|
||||||
|
* P = Prefix
|
||||||
|
* M = Message
|
||||||
|
* F = Function name
|
||||||
|
* L = Line number
|
||||||
|
* PPPP: MMMMM [FFFFFFFFFFFFFFF : LLLLL]
|
||||||
|
*/
|
||||||
|
#define MAX_PRINT_SIZE 256
|
||||||
|
|
||||||
|
#ifdef TEEC_LOG_FILE
|
||||||
|
static void log_to_file(const char *buffer)
|
||||||
|
{
|
||||||
|
FILE *log_file = fopen(TEEC_LOG_FILE, "a");
|
||||||
|
|
||||||
|
if (log_file != NULL) {
|
||||||
|
fprintf(log_file, "%s", buffer);
|
||||||
|
fclose(log_file);
|
||||||
|
log_file = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define log_to_file(buffer)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const char * const trace_level_strings[] = {
|
||||||
|
"", "ERR", "INF", "DBG", "FLW"
|
||||||
|
};
|
||||||
|
|
||||||
|
void _dprintf(const char *function, int line, int level, const char *prefix,
|
||||||
|
const char *fmt, ...)
|
||||||
|
{
|
||||||
|
char msg[MAX_PRINT_SIZE];
|
||||||
|
int n = 0;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
if (function) {
|
||||||
|
int thread_id = syscall(SYS_gettid);
|
||||||
|
|
||||||
|
n = snprintf(msg, sizeof(msg), "%s [%d] %s:%s:%d: ",
|
||||||
|
trace_level_strings[level], thread_id, prefix,
|
||||||
|
function, line);
|
||||||
|
if (n < 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((size_t)n < sizeof(msg)) {
|
||||||
|
va_start(ap, fmt);
|
||||||
|
n = vsnprintf(msg + n, sizeof(msg) - n, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
if (n < 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stdout, "%s", msg);
|
||||||
|
log_to_file(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (defined(DEBUGLEVEL_3) || defined(DEBUGLEVEL_true) || defined(DEBUGLEVEL_4))
|
||||||
|
void dump_buffer(const char *bname, const uint8_t *buffer, size_t blen)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "#### %s\n", bname);
|
||||||
|
|
||||||
|
while (blen > 0) {
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
for (n = 0; n < 16; n++) {
|
||||||
|
if (n < blen)
|
||||||
|
fprintf(stderr, "%02x ", (int)buffer[n]);
|
||||||
|
else
|
||||||
|
fprintf(stderr, " ");
|
||||||
|
|
||||||
|
if (n == 7)
|
||||||
|
fprintf(stderr, " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, " |");
|
||||||
|
|
||||||
|
for (n = 0; n < 16; n++) {
|
||||||
|
if (n < blen) {
|
||||||
|
if (isprint(buffer[n]))
|
||||||
|
fprintf(stderr, "%c", (int)buffer[n]);
|
||||||
|
else
|
||||||
|
fprintf(stderr, ".");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "|\n");
|
||||||
|
|
||||||
|
blen -= MIN(blen, 16);
|
||||||
|
buffer += 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void dump_buffer(const char *bname, const uint8_t *buffer, size_t blen)
|
||||||
|
{
|
||||||
|
(void)bname;
|
||||||
|
(void)buffer;
|
||||||
|
(void)blen;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
25
optee/optee_client/public/CMakeLists.txt
Normal file
25
optee/optee_client/public/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
project (optee-client-headers C)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Header files to be exported
|
||||||
|
################################################################################
|
||||||
|
FILE(GLOB INSTALL_HEADERS "*.h")
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built library
|
||||||
|
################################################################################
|
||||||
|
add_library(${PROJECT_NAME} INTERFACE)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(
|
||||||
|
teec
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:{CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
install (FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
77
optee/optee_client/public/tee_bench.h
Normal file
77
optee/optee_client/public/tee_bench.h
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TEE_BENCH_H
|
||||||
|
#define TEE_BENCH_H
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#define PTA_BENCHMARK_UUID \
|
||||||
|
{ 0x0b9a63b0, 0xb4c6, 0x4c85, \
|
||||||
|
{ 0xa2, 0x84, 0xa2, 0x28, 0xef, 0x54, 0x7b, 0x4e } }
|
||||||
|
|
||||||
|
#define BENCHMARK_CMD(id) (0xFA190000 | ((id) & 0xFFFF))
|
||||||
|
#define BENCHMARK_CMD_REGISTER_MEMREF BENCHMARK_CMD(1)
|
||||||
|
#define BENCHMARK_CMD_GET_MEMREF BENCHMARK_CMD(2)
|
||||||
|
#define BENCHMARK_CMD_UNREGISTER BENCHMARK_CMD(3)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cycle count divider is enabled (in PMCR),
|
||||||
|
* CCNT value is incremented every 64th clock cycle
|
||||||
|
*/
|
||||||
|
#define TEE_BENCH_DIVIDER 64
|
||||||
|
/* max amount of timestamps per buffer */
|
||||||
|
#define TEE_BENCH_MAX_STAMPS 32
|
||||||
|
#define TEE_BENCH_MAX_MASK (TEE_BENCH_MAX_STAMPS - 1)
|
||||||
|
|
||||||
|
/* OP-TEE susbsystems ids */
|
||||||
|
#define TEE_BENCH_CLIENT 0x10000000
|
||||||
|
#define TEE_BENCH_KMOD 0x20000000
|
||||||
|
#define TEE_BENCH_CORE 0x30000000
|
||||||
|
#define TEE_BENCH_UTEE 0x40000000
|
||||||
|
#define TEE_BENCH_DUMB_TA 0xF0000001
|
||||||
|
|
||||||
|
/* storing timestamp */
|
||||||
|
struct tee_time_st {
|
||||||
|
uint64_t cnt; /* stores value from CNTPCT register */
|
||||||
|
uint64_t addr; /* stores value from program counter register */
|
||||||
|
uint64_t src; /* OP-TEE subsystem id */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* per-cpu circular buffer for timestamps */
|
||||||
|
struct tee_ts_cpu_buf {
|
||||||
|
uint64_t head;
|
||||||
|
uint64_t tail;
|
||||||
|
struct tee_time_st stamps[TEE_BENCH_MAX_STAMPS];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* memory layout for shared memory, where timestamps will be stored */
|
||||||
|
struct tee_ts_global {
|
||||||
|
uint64_t cores;
|
||||||
|
struct tee_ts_cpu_buf cpu_buf[];
|
||||||
|
};
|
||||||
|
#endif /* TEE_BENCH_H */
|
||||||
555
optee/optee_client/public/tee_client_api.h
Normal file
555
optee/optee_client/public/tee_client_api.h
Normal file
@@ -0,0 +1,555 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2015, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef TEE_CLIENT_API_H
|
||||||
|
#define TEE_CLIENT_API_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the number of available memory references in an open session or
|
||||||
|
* invoke command operation payload.
|
||||||
|
*/
|
||||||
|
#define TEEC_CONFIG_PAYLOAD_REF_COUNT 4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the maximum size of a single shared memory block, in bytes, of both
|
||||||
|
* API allocated and API registered memory. There is no good value to put here
|
||||||
|
* (limits depend on specific config used), so this define does not provide any
|
||||||
|
* restriction in this implementation.
|
||||||
|
*/
|
||||||
|
#define TEEC_CONFIG_SHAREDMEM_MAX_SIZE ULONG_MAX
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag constants indicating the type of parameters encoded inside the
|
||||||
|
* operation payload (TEEC_Operation), Type is uint32_t.
|
||||||
|
*
|
||||||
|
* TEEC_NONE The Parameter is not used
|
||||||
|
*
|
||||||
|
* TEEC_VALUE_INPUT The Parameter is a TEEC_Value tagged as input.
|
||||||
|
*
|
||||||
|
* TEEC_VALUE_OUTPUT The Parameter is a TEEC_Value tagged as output.
|
||||||
|
*
|
||||||
|
* TEEC_VALUE_INOUT The Parameter is a TEEC_Value tagged as both as
|
||||||
|
* input and output, i.e., for which both the
|
||||||
|
* behaviors of TEEC_VALUE_INPUT and
|
||||||
|
* TEEC_VALUE_OUTPUT apply.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_TEMP_INPUT The Parameter is a TEEC_TempMemoryReference
|
||||||
|
* describing a region of memory which needs to be
|
||||||
|
* temporarily registered for the duration of the
|
||||||
|
* Operation and is tagged as input.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_TEMP_OUTPUT Same as TEEC_MEMREF_TEMP_INPUT, but the Memory
|
||||||
|
* Reference is tagged as output. The
|
||||||
|
* Implementation may update the size field to
|
||||||
|
* reflect the required output size in some use
|
||||||
|
* cases.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_TEMP_INOUT A Temporary Memory Reference tagged as both
|
||||||
|
* input and output, i.e., for which both the
|
||||||
|
* behaviors of TEEC_MEMREF_TEMP_INPUT and
|
||||||
|
* TEEC_MEMREF_TEMP_OUTPUT apply.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_WHOLE The Parameter is a Registered Memory Reference
|
||||||
|
* that refers to the entirety of its parent Shared
|
||||||
|
* Memory block. The parameter structure is a
|
||||||
|
* TEEC_MemoryReference. In this structure, the
|
||||||
|
* Implementation MUST read only the parent field
|
||||||
|
* and MAY update the size field when the operation
|
||||||
|
* completes.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_PARTIAL_INPUT A Registered Memory Reference structure that
|
||||||
|
* refers to a partial region of its parent Shared
|
||||||
|
* Memory block and is tagged as input.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_PARTIAL_OUTPUT Registered Memory Reference structure that
|
||||||
|
* refers to a partial region of its parent Shared
|
||||||
|
* Memory block and is tagged as output.
|
||||||
|
*
|
||||||
|
* TEEC_MEMREF_PARTIAL_INOUT The Registered Memory Reference structure that
|
||||||
|
* refers to a partial region of its parent Shared
|
||||||
|
* Memory block and is tagged as both input and
|
||||||
|
* output, i.e., for which both the behaviors of
|
||||||
|
* TEEC_MEMREF_PARTIAL_INPUT and
|
||||||
|
* TEEC_MEMREF_PARTIAL_OUTPUT apply.
|
||||||
|
*/
|
||||||
|
#define TEEC_NONE 0x00000000
|
||||||
|
#define TEEC_VALUE_INPUT 0x00000001
|
||||||
|
#define TEEC_VALUE_OUTPUT 0x00000002
|
||||||
|
#define TEEC_VALUE_INOUT 0x00000003
|
||||||
|
#define TEEC_MEMREF_TEMP_INPUT 0x00000005
|
||||||
|
#define TEEC_MEMREF_TEMP_OUTPUT 0x00000006
|
||||||
|
#define TEEC_MEMREF_TEMP_INOUT 0x00000007
|
||||||
|
#define TEEC_MEMREF_WHOLE 0x0000000C
|
||||||
|
#define TEEC_MEMREF_PARTIAL_INPUT 0x0000000D
|
||||||
|
#define TEEC_MEMREF_PARTIAL_OUTPUT 0x0000000E
|
||||||
|
#define TEEC_MEMREF_PARTIAL_INOUT 0x0000000F
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag constants indicating the data transfer direction of memory in
|
||||||
|
* TEEC_Parameter. TEEC_MEM_INPUT signifies data transfer direction from the
|
||||||
|
* client application to the TEE. TEEC_MEM_OUTPUT signifies data transfer
|
||||||
|
* direction from the TEE to the client application. Type is uint32_t.
|
||||||
|
*
|
||||||
|
* TEEC_MEM_INPUT The Shared Memory can carry data from the client
|
||||||
|
* application to the Trusted Application.
|
||||||
|
* TEEC_MEM_OUTPUT The Shared Memory can carry data from the Trusted
|
||||||
|
* Application to the client application.
|
||||||
|
*/
|
||||||
|
#define TEEC_MEM_INPUT 0x00000001
|
||||||
|
#define TEEC_MEM_OUTPUT 0x00000002
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return values. Type is TEEC_Result
|
||||||
|
*
|
||||||
|
* TEEC_SUCCESS The operation was successful.
|
||||||
|
* TEEC_ERROR_GENERIC Non-specific cause.
|
||||||
|
* TEEC_ERROR_ACCESS_DENIED Access privileges are not sufficient.
|
||||||
|
* TEEC_ERROR_CANCEL The operation was canceled.
|
||||||
|
* TEEC_ERROR_ACCESS_CONFLICT Concurrent accesses caused conflict.
|
||||||
|
* TEEC_ERROR_EXCESS_DATA Too much data for the requested operation was
|
||||||
|
* passed.
|
||||||
|
* TEEC_ERROR_BAD_FORMAT Input data was of invalid format.
|
||||||
|
* TEEC_ERROR_BAD_PARAMETERS Input parameters were invalid.
|
||||||
|
* TEEC_ERROR_BAD_STATE Operation is not valid in the current state.
|
||||||
|
* TEEC_ERROR_ITEM_NOT_FOUND The requested data item is not found.
|
||||||
|
* TEEC_ERROR_NOT_IMPLEMENTED The requested operation should exist but is not
|
||||||
|
* yet implemented.
|
||||||
|
* TEEC_ERROR_NOT_SUPPORTED The requested operation is valid but is not
|
||||||
|
* supported in this implementation.
|
||||||
|
* TEEC_ERROR_NO_DATA Expected data was missing.
|
||||||
|
* TEEC_ERROR_OUT_OF_MEMORY System ran out of resources.
|
||||||
|
* TEEC_ERROR_BUSY The system is busy working on something else.
|
||||||
|
* TEEC_ERROR_COMMUNICATION Communication with a remote party failed.
|
||||||
|
* TEEC_ERROR_SECURITY A security fault was detected.
|
||||||
|
* TEEC_ERROR_SHORT_BUFFER The supplied buffer is too short for the
|
||||||
|
* generated output.
|
||||||
|
* TEEC_ERROR_TARGET_DEAD Trusted Application has panicked
|
||||||
|
* during the operation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standard defined error codes.
|
||||||
|
*/
|
||||||
|
#define TEEC_SUCCESS 0x00000000
|
||||||
|
#define TEEC_ERROR_STORAGE_NOT_AVAILABLE 0xF0100003
|
||||||
|
#define TEEC_ERROR_GENERIC 0xFFFF0000
|
||||||
|
#define TEEC_ERROR_ACCESS_DENIED 0xFFFF0001
|
||||||
|
#define TEEC_ERROR_CANCEL 0xFFFF0002
|
||||||
|
#define TEEC_ERROR_ACCESS_CONFLICT 0xFFFF0003
|
||||||
|
#define TEEC_ERROR_EXCESS_DATA 0xFFFF0004
|
||||||
|
#define TEEC_ERROR_BAD_FORMAT 0xFFFF0005
|
||||||
|
#define TEEC_ERROR_BAD_PARAMETERS 0xFFFF0006
|
||||||
|
#define TEEC_ERROR_BAD_STATE 0xFFFF0007
|
||||||
|
#define TEEC_ERROR_ITEM_NOT_FOUND 0xFFFF0008
|
||||||
|
#define TEEC_ERROR_NOT_IMPLEMENTED 0xFFFF0009
|
||||||
|
#define TEEC_ERROR_NOT_SUPPORTED 0xFFFF000A
|
||||||
|
#define TEEC_ERROR_NO_DATA 0xFFFF000B
|
||||||
|
#define TEEC_ERROR_OUT_OF_MEMORY 0xFFFF000C
|
||||||
|
#define TEEC_ERROR_BUSY 0xFFFF000D
|
||||||
|
#define TEEC_ERROR_COMMUNICATION 0xFFFF000E
|
||||||
|
#define TEEC_ERROR_SECURITY 0xFFFF000F
|
||||||
|
#define TEEC_ERROR_SHORT_BUFFER 0xFFFF0010
|
||||||
|
#define TEEC_ERROR_EXTERNAL_CANCEL 0xFFFF0011
|
||||||
|
#define TEEC_ERROR_TARGET_DEAD 0xFFFF3024
|
||||||
|
#define TEEC_ERROR_STORAGE_NO_SPACE 0xFFFF3041
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function error origins, of type TEEC_ErrorOrigin. These indicate where in
|
||||||
|
* the software stack a particular return value originates from.
|
||||||
|
*
|
||||||
|
* TEEC_ORIGIN_API The error originated within the TEE Client API
|
||||||
|
* implementation.
|
||||||
|
* TEEC_ORIGIN_COMMS The error originated within the underlying
|
||||||
|
* communications stack linking the rich OS with
|
||||||
|
* the TEE.
|
||||||
|
* TEEC_ORIGIN_TEE The error originated within the common TEE code.
|
||||||
|
* TEEC_ORIGIN_TRUSTED_APP The error originated within the Trusted Application
|
||||||
|
* code.
|
||||||
|
*/
|
||||||
|
#define TEEC_ORIGIN_API 0x00000001
|
||||||
|
#define TEEC_ORIGIN_COMMS 0x00000002
|
||||||
|
#define TEEC_ORIGIN_TEE 0x00000003
|
||||||
|
#define TEEC_ORIGIN_TRUSTED_APP 0x00000004
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Session login methods, for use in TEEC_OpenSession() as parameter
|
||||||
|
* connectionMethod. Type is uint32_t.
|
||||||
|
*
|
||||||
|
* TEEC_LOGIN_PUBLIC No login data is provided.
|
||||||
|
* TEEC_LOGIN_USER Login data about the user running the Client
|
||||||
|
* Application process is provided.
|
||||||
|
* TEEC_LOGIN_GROUP Login data about the group running the Client
|
||||||
|
* Application process is provided.
|
||||||
|
* TEEC_LOGIN_APPLICATION Login data about the running Client Application
|
||||||
|
* itself is provided.
|
||||||
|
* TEEC_LOGIN_USER_APPLICATION Login data about the user and the running
|
||||||
|
* Client Application itself is provided.
|
||||||
|
* TEEC_LOGIN_GROUP_APPLICATION Login data about the group and the running
|
||||||
|
* Client Application itself is provided.
|
||||||
|
*/
|
||||||
|
#define TEEC_LOGIN_PUBLIC 0x00000000
|
||||||
|
#define TEEC_LOGIN_USER 0x00000001
|
||||||
|
#define TEEC_LOGIN_GROUP 0x00000002
|
||||||
|
#define TEEC_LOGIN_APPLICATION 0x00000004
|
||||||
|
#define TEEC_LOGIN_USER_APPLICATION 0x00000005
|
||||||
|
#define TEEC_LOGIN_GROUP_APPLICATION 0x00000006
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encode the paramTypes according to the supplied types.
|
||||||
|
*
|
||||||
|
* @param p0 The first param type.
|
||||||
|
* @param p1 The second param type.
|
||||||
|
* @param p2 The third param type.
|
||||||
|
* @param p3 The fourth param type.
|
||||||
|
*/
|
||||||
|
#define TEEC_PARAM_TYPES(p0, p1, p2, p3) \
|
||||||
|
((p0) | ((p1) << 4) | ((p2) << 8) | ((p3) << 12))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the i_th param type from the paramType.
|
||||||
|
*
|
||||||
|
* @param p The paramType.
|
||||||
|
* @param i The i-th parameter to get the type for.
|
||||||
|
*/
|
||||||
|
#define TEEC_PARAM_TYPE_GET(p, i) (((p) >> (i * 4)) & 0xF)
|
||||||
|
|
||||||
|
typedef uint32_t TEEC_Result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_Context - Represents a connection between a client application
|
||||||
|
* and a TEE.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
/* Implementation defined */
|
||||||
|
int fd;
|
||||||
|
bool reg_mem;
|
||||||
|
bool memref_null;
|
||||||
|
} TEEC_Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This type contains a Universally Unique Resource Identifier (UUID) type as
|
||||||
|
* defined in RFC4122. These UUID values are used to identify Trusted
|
||||||
|
* Applications.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint32_t timeLow;
|
||||||
|
uint16_t timeMid;
|
||||||
|
uint16_t timeHiAndVersion;
|
||||||
|
uint8_t clockSeqAndNode[8];
|
||||||
|
} TEEC_UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_SharedMemory - Memory to transfer data between a client
|
||||||
|
* application and trusted code.
|
||||||
|
*
|
||||||
|
* @param buffer The memory buffer which is to be, or has been, shared
|
||||||
|
* with the TEE.
|
||||||
|
* @param size The size, in bytes, of the memory buffer.
|
||||||
|
* @param flags Bit-vector which holds properties of buffer.
|
||||||
|
* The bit-vector can contain either or both of the
|
||||||
|
* TEEC_MEM_INPUT and TEEC_MEM_OUTPUT flags.
|
||||||
|
*
|
||||||
|
* A shared memory block is a region of memory allocated in the context of the
|
||||||
|
* client application memory space that can be used to transfer data between
|
||||||
|
* that client application and a trusted application. The user of this struct
|
||||||
|
* is responsible to populate the buffer pointer.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
void *buffer;
|
||||||
|
size_t size;
|
||||||
|
uint32_t flags;
|
||||||
|
/*
|
||||||
|
* Implementation-Defined
|
||||||
|
*/
|
||||||
|
int id;
|
||||||
|
size_t alloced_size;
|
||||||
|
void *shadow_buffer;
|
||||||
|
int registered_fd;
|
||||||
|
union {
|
||||||
|
bool dummy;
|
||||||
|
uint8_t flags;
|
||||||
|
} internal;
|
||||||
|
} TEEC_SharedMemory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_TempMemoryReference - Temporary memory to transfer data between
|
||||||
|
* a client application and trusted code, only used for the duration of the
|
||||||
|
* operation.
|
||||||
|
*
|
||||||
|
* @param buffer The memory buffer which is to be, or has been shared with
|
||||||
|
* the TEE.
|
||||||
|
* @param size The size, in bytes, of the memory buffer.
|
||||||
|
*
|
||||||
|
* A memory buffer that is registered temporarily for the duration of the
|
||||||
|
* operation to be called.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
void *buffer;
|
||||||
|
size_t size;
|
||||||
|
} TEEC_TempMemoryReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_RegisteredMemoryReference - use a pre-registered or
|
||||||
|
* pre-allocated shared memory block of memory to transfer data between
|
||||||
|
* a client application and trusted code.
|
||||||
|
*
|
||||||
|
* @param parent Points to a shared memory structure. The memory reference
|
||||||
|
* may utilize the whole shared memory or only a part of it.
|
||||||
|
* Must not be NULL
|
||||||
|
*
|
||||||
|
* @param size The size, in bytes, of the memory buffer.
|
||||||
|
*
|
||||||
|
* @param offset The offset, in bytes, of the referenced memory region from
|
||||||
|
* the start of the shared memory block.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
TEEC_SharedMemory *parent;
|
||||||
|
size_t size;
|
||||||
|
size_t offset;
|
||||||
|
} TEEC_RegisteredMemoryReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_Value - Small raw data container
|
||||||
|
*
|
||||||
|
* Instead of allocating a shared memory buffer this structure can be used
|
||||||
|
* to pass small raw data between a client application and trusted code.
|
||||||
|
*
|
||||||
|
* @param a The first integer value.
|
||||||
|
*
|
||||||
|
* @param b The second value.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint32_t a;
|
||||||
|
uint32_t b;
|
||||||
|
} TEEC_Value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* union TEEC_Parameter - Memory container to be used when passing data between
|
||||||
|
* client application and trusted code.
|
||||||
|
*
|
||||||
|
* Either the client uses a shared memory reference, parts of it or a small raw
|
||||||
|
* data container.
|
||||||
|
*
|
||||||
|
* @param tmpref A temporary memory reference only valid for the duration
|
||||||
|
* of the operation.
|
||||||
|
*
|
||||||
|
* @param memref The entire shared memory or parts of it.
|
||||||
|
*
|
||||||
|
* @param value The small raw data container to use
|
||||||
|
*/
|
||||||
|
typedef union {
|
||||||
|
TEEC_TempMemoryReference tmpref;
|
||||||
|
TEEC_RegisteredMemoryReference memref;
|
||||||
|
TEEC_Value value;
|
||||||
|
} TEEC_Parameter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_Session - Represents a connection between a client application
|
||||||
|
* and a trusted application.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
/* Implementation defined */
|
||||||
|
TEEC_Context *ctx;
|
||||||
|
uint32_t session_id;
|
||||||
|
} TEEC_Session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct TEEC_Operation - Holds information and memory references used in
|
||||||
|
* TEEC_InvokeCommand().
|
||||||
|
*
|
||||||
|
* @param started Client must initialize to zero if it needs to cancel
|
||||||
|
* an operation about to be performed.
|
||||||
|
* @param paramTypes Type of data passed. Use TEEC_PARAM_TYPES macro to
|
||||||
|
* create the correct flags.
|
||||||
|
* 0 means TEEC_NONE is passed for all params.
|
||||||
|
* @param params Array of parameters of type TEEC_Parameter.
|
||||||
|
* @param session Internal pointer to the last session used by
|
||||||
|
* TEEC_InvokeCommand with this operation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint32_t started;
|
||||||
|
uint32_t paramTypes;
|
||||||
|
TEEC_Parameter params[TEEC_CONFIG_PAYLOAD_REF_COUNT];
|
||||||
|
/* Implementation-Defined */
|
||||||
|
TEEC_Session *session;
|
||||||
|
} TEEC_Operation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_InitializeContext() - Initializes a context holding connection
|
||||||
|
* information on the specific TEE, designated by the name string.
|
||||||
|
|
||||||
|
* @param name A zero-terminated string identifying the TEE to connect to.
|
||||||
|
* If name is set to NULL, the default TEE is connected to. NULL
|
||||||
|
* is the only supported value in this version of the API
|
||||||
|
* implementation.
|
||||||
|
*
|
||||||
|
* @param context The context structure which is to be initialized.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS The initialization was successful.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_FinalizeContext() - Destroys a context holding connection information
|
||||||
|
* on the specific TEE.
|
||||||
|
*
|
||||||
|
* This function destroys an initialized TEE context, closing the connection
|
||||||
|
* between the client application and the TEE. This function must only be
|
||||||
|
* called when all sessions related to this TEE context have been closed and
|
||||||
|
* all shared memory blocks have been released.
|
||||||
|
*
|
||||||
|
* @param context The context to be destroyed.
|
||||||
|
*/
|
||||||
|
void TEEC_FinalizeContext(TEEC_Context *context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_OpenSession() - Opens a new session with the specified trusted
|
||||||
|
* application.
|
||||||
|
*
|
||||||
|
* @param context The initialized TEE context structure in which
|
||||||
|
* scope to open the session.
|
||||||
|
* @param session The session to initialize.
|
||||||
|
* @param destination A structure identifying the trusted application
|
||||||
|
* with which to open a session.
|
||||||
|
*
|
||||||
|
* @param connectionMethod The connection method to use.
|
||||||
|
* @param connectionData Any data necessary to connect with the chosen
|
||||||
|
* connection method. Not supported, should be set to
|
||||||
|
* NULL.
|
||||||
|
* @param operation An operation structure to use in the session. May
|
||||||
|
* be set to NULL to signify no operation structure
|
||||||
|
* needed.
|
||||||
|
*
|
||||||
|
* @param returnOrigin A parameter which will hold the error origin if
|
||||||
|
* this function returns any value other than
|
||||||
|
* TEEC_SUCCESS.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS OpenSession successfully opened a new session.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_OpenSession(TEEC_Context *context,
|
||||||
|
TEEC_Session *session,
|
||||||
|
const TEEC_UUID *destination,
|
||||||
|
uint32_t connectionMethod,
|
||||||
|
const void *connectionData,
|
||||||
|
TEEC_Operation *operation,
|
||||||
|
uint32_t *returnOrigin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_CloseSession() - Closes the session which has been opened with the
|
||||||
|
* specific trusted application.
|
||||||
|
*
|
||||||
|
* @param session The opened session to close.
|
||||||
|
*/
|
||||||
|
void TEEC_CloseSession(TEEC_Session *session);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_InvokeCommand() - Executes a command in the specified trusted
|
||||||
|
* application.
|
||||||
|
*
|
||||||
|
* @param session A handle to an open connection to the trusted
|
||||||
|
* application.
|
||||||
|
* @param commandID Identifier of the command in the trusted application
|
||||||
|
* to invoke.
|
||||||
|
* @param operation An operation structure to use in the invoke command.
|
||||||
|
* May be set to NULL to signify no operation structure
|
||||||
|
* needed.
|
||||||
|
* @param returnOrigin A parameter which will hold the error origin if this
|
||||||
|
* function returns any value other than TEEC_SUCCESS.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS OpenSession successfully opened a new session.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_InvokeCommand(TEEC_Session *session,
|
||||||
|
uint32_t commandID,
|
||||||
|
TEEC_Operation *operation,
|
||||||
|
uint32_t *returnOrigin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_RegisterSharedMemory() - Register a block of existing memory as a
|
||||||
|
* shared block within the scope of the specified context.
|
||||||
|
*
|
||||||
|
* @param context The initialized TEE context structure in which scope to
|
||||||
|
* open the session.
|
||||||
|
* @param sharedMem pointer to the shared memory structure to register.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS The registration was successful.
|
||||||
|
* @return TEEC_ERROR_OUT_OF_MEMORY Memory exhaustion.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context,
|
||||||
|
TEEC_SharedMemory *sharedMem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_AllocateSharedMemory() - Allocate shared memory for TEE.
|
||||||
|
*
|
||||||
|
* @param context The initialized TEE context structure in which scope to
|
||||||
|
* open the session.
|
||||||
|
* @param sharedMem Pointer to the allocated shared memory.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS The registration was successful.
|
||||||
|
* @return TEEC_ERROR_OUT_OF_MEMORY Memory exhaustion.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context,
|
||||||
|
TEEC_SharedMemory *sharedMem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_ReleaseSharedMemory() - Free or deregister the shared memory.
|
||||||
|
*
|
||||||
|
* @param sharedMem Pointer to the shared memory to be freed.
|
||||||
|
*/
|
||||||
|
void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMemory);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_RequestCancellation() - Request the cancellation of a pending open
|
||||||
|
* session or command invocation.
|
||||||
|
*
|
||||||
|
* @param operation Pointer to an operation previously passed to open session
|
||||||
|
* or invoke.
|
||||||
|
*/
|
||||||
|
void TEEC_RequestCancellation(TEEC_Operation *operation);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
57
optee/optee_client/public/tee_client_api_extensions.h
Normal file
57
optee/optee_client/public/tee_client_api_extensions.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef TEE_CLIENT_API_EXTENSIONS_H
|
||||||
|
#define TEE_CLIENT_API_EXTENSIONS_H
|
||||||
|
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEEC_RegisterMemoryFileDescriptor() - Register a block of existing memory as
|
||||||
|
* a shared block within the scope of the specified context.
|
||||||
|
*
|
||||||
|
* @param context The initialized TEE context structure in which scope to
|
||||||
|
* open the session.
|
||||||
|
* @param sharedMem pointer to the shared memory structure to register.
|
||||||
|
* @param fd file descriptor of the target memory.
|
||||||
|
*
|
||||||
|
* @return TEEC_SUCCESS The registration was successful.
|
||||||
|
* @return TEEC_ERROR_OUT_OF_MEMORY Memory exhaustion.
|
||||||
|
* @return TEEC_Result Something failed.
|
||||||
|
*/
|
||||||
|
TEEC_Result TEEC_RegisterSharedMemoryFileDescriptor(TEEC_Context *context,
|
||||||
|
TEEC_SharedMemory *sharedMem,
|
||||||
|
int fd);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* TEE_CLIENT_API_EXTENSIONS_H */
|
||||||
20
optee/optee_client/public/tee_plugin_method.h
Normal file
20
optee/optee_client/public/tee_plugin_method.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Open Mobile Platform LLC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TEE_PLUGIN_METHOD_H
|
||||||
|
#define TEE_PLUGIN_METHOD_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
struct plugin_method {
|
||||||
|
const char *name; /* short friendly name of the plugin */
|
||||||
|
TEEC_UUID uuid;
|
||||||
|
TEEC_Result (*init)(void);
|
||||||
|
TEEC_Result (*invoke)(unsigned int cmd, unsigned int sub_cmd,
|
||||||
|
void *data, size_t in_len, size_t *out_len);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* TEE_PLUGIN_METHOD_H */
|
||||||
147
optee/optee_client/public/teec_trace.h
Normal file
147
optee/optee_client/public/teec_trace.h
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef TEEC_TRACE_H
|
||||||
|
#define TEEC_TRACE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef BINARY_PREFIX
|
||||||
|
#error "BINARY_PREFIX not defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Trace levels.
|
||||||
|
*
|
||||||
|
* ERROR is used when some kind of error has happened, this is most likely the
|
||||||
|
* print you will use most of the time when you report some kind of error.
|
||||||
|
*
|
||||||
|
* INFO is used when you want to print some 'normal' text to the user.
|
||||||
|
* This is the default level.
|
||||||
|
*
|
||||||
|
* DEBUG is used to print extra information to enter deeply in the module.
|
||||||
|
*
|
||||||
|
* FLOW is used to print the execution flox, typically the in/out of functions.
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
|
||||||
|
#define TRACE_ERROR 1
|
||||||
|
#define TRACE_INFO 2
|
||||||
|
#define TRACE_DEBUG 3
|
||||||
|
#define TRACE_FLOW 4
|
||||||
|
|
||||||
|
#if defined(DEBUGLEVEL_0) && !defined(DEBUGLEVEL)
|
||||||
|
#define DEBUGLEVEL TRACE_ERROR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DEBUGLEVEL_1) && !defined(DEBUGLEVEL)
|
||||||
|
#define DEBUGLEVEL TRACE_ERROR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DEBUGLEVEL_2) && !defined(DEBUGLEVEL)
|
||||||
|
#define DEBUGLEVEL TRACE_INFO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DEBUGLEVEL_3) && !defined(DEBUGLEVEL)
|
||||||
|
#define DEBUGLEVEL TRACE_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DEBUGLEVEL_4) && !defined(DEBUGLEVEL)
|
||||||
|
#define DEBUGLEVEL TRACE_FLOW
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DEBUGLEVEL
|
||||||
|
/* Default debug level. */
|
||||||
|
#define DEBUGLEVEL TRACE_INFO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This define make sure that parameters are checked in the same manner as it
|
||||||
|
* is done in the normal printf function.
|
||||||
|
*/
|
||||||
|
#define __PRINTFLIKE(__fmt, __varargs) __attribute__\
|
||||||
|
((__format__(__printf__, __fmt, __varargs)))
|
||||||
|
|
||||||
|
void _dprintf(const char *function, int line, int level, const char *prefix,
|
||||||
|
const char *fmt, ...) __PRINTFLIKE(5, 6);
|
||||||
|
|
||||||
|
#define dprintf(level, x...) do { \
|
||||||
|
if ((level) <= DEBUGLEVEL) { \
|
||||||
|
_dprintf(__func__, __LINE__, level, \
|
||||||
|
BINARY_PREFIX, x); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define EMSG(fmt, ...) dprintf(TRACE_ERROR, fmt "\n", ##__VA_ARGS__)
|
||||||
|
#define IMSG(fmt, ...) dprintf(TRACE_INFO, fmt "\n", ##__VA_ARGS__)
|
||||||
|
#define DMSG(fmt, ...) dprintf(TRACE_DEBUG, fmt "\n", ##__VA_ARGS__)
|
||||||
|
#define FMSG(fmt, ...) dprintf(TRACE_FLOW, fmt "\n", ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define INMSG(fmt, ...) FMSG("> " fmt, ##__VA_ARGS__)
|
||||||
|
#define OUTMSG(fmt, ...) FMSG("< " fmt, ##__VA_ARGS__)
|
||||||
|
#define OUTRMSG(r) \
|
||||||
|
do { \
|
||||||
|
if (r) \
|
||||||
|
EMSG("Function returns with [%d]", r); \
|
||||||
|
OUTMSG("r=[%d]", r); \
|
||||||
|
return r; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define dprintf_raw(level, x...) do { \
|
||||||
|
if ((level) <= DEBUGLEVEL) \
|
||||||
|
_dprintf(0, 0, (level), BINARY_PREFIX, x); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define EMSG_RAW(fmt, ...) dprintf_raw(TRACE_ERROR, fmt, ##__VA_ARGS__)
|
||||||
|
#define IMSG_RAW(fmt, ...) dprintf_raw(TRACE_INFO, fmt, ##__VA_ARGS__)
|
||||||
|
#define DMSG_RAW(fmt, ...) dprintf_raw(TRACE_DEBUG, fmt, ##__VA_ARGS__)
|
||||||
|
#define FMSG_RAW(fmt, ...) dprintf_raw(TRACE_FLOW, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This function will hex and ascii dump a buffer.
|
||||||
|
*
|
||||||
|
* Note that this function will only print if debug flag
|
||||||
|
* DEBUGLEVEL is INFO or FLOOD.
|
||||||
|
*
|
||||||
|
* @param bname Information string describing the buffer.
|
||||||
|
* @param buffer Pointer to the buffer.
|
||||||
|
* @param blen Length of the buffer.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
void dump_buffer(const char *bname, const uint8_t *buffer, size_t blen);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
49
optee/optee_client/scripts/checkpatch_inc.sh
Normal file
49
optee/optee_client/scripts/checkpatch_inc.sh
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
|
CHECKPATCH="${CHECKPATCH:-checkpatch.pl}"
|
||||||
|
# checkpatch.pl will ignore the following paths
|
||||||
|
CHECKPATCH_IGNORE=$(echo )
|
||||||
|
_CP_EXCL=$(for p in $CHECKPATCH_IGNORE; do echo ":(exclude)$p" ; done)
|
||||||
|
|
||||||
|
function _checkpatch() {
|
||||||
|
# Use --typedefsfile if supported by the checkpatch tool
|
||||||
|
typedefs_opt="--typedefsfile typedefs.checkpatch"
|
||||||
|
$CHECKPATCH --help 2>&1 | grep -q -- --typedefsfile || \
|
||||||
|
typedefs_opt="";
|
||||||
|
# Ignore NOT_UNIFIED_DIFF in case patch has no diff
|
||||||
|
# (e.g., all paths filtered out)
|
||||||
|
$CHECKPATCH --quiet --ignore FILE_PATH_CHANGES \
|
||||||
|
--ignore GERRIT_CHANGE_ID \
|
||||||
|
--ignore NOT_UNIFIED_DIFF \
|
||||||
|
--ignore CAMELCASE \
|
||||||
|
--ignore PREFER_KERNEL_TYPES \
|
||||||
|
--ignore CONCATENATED_STRING \
|
||||||
|
--no-tree \
|
||||||
|
--strict \
|
||||||
|
$typedefs_opt \
|
||||||
|
-
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkpatch() {
|
||||||
|
git show --oneline --no-patch $1
|
||||||
|
# The first git 'format-patch' shows the commit message
|
||||||
|
# The second one produces the diff (might be empty if _CP_EXCL
|
||||||
|
# filters out all diffs)
|
||||||
|
(git format-patch $1^..$1 --stdout | sed -n '/^diff --git/q;p'; \
|
||||||
|
git format-patch $1^..$1 --stdout -- $_CP_EXCL . | \
|
||||||
|
sed -n '/^diff --git/,$p') | _checkpatch
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkstaging() {
|
||||||
|
git diff --cached -- . $_CP_EXCL | _checkpatch
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkworking() {
|
||||||
|
git diff -- . $_CP_EXCL | _checkpatch
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkdiff() {
|
||||||
|
git diff $1...$2 -- . $_CP_EXCL | _checkpatch
|
||||||
|
}
|
||||||
|
|
||||||
119
optee/optee_client/tee-supplicant/CMakeLists.txt
Normal file
119
optee/optee_client/tee-supplicant/CMakeLists.txt
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
project (tee-supplicant C)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Configuration flags always included
|
||||||
|
################################################################################
|
||||||
|
option (CFG_TA_TEST_PATH "Enable tee-supplicant to load from test/debug path" OFF)
|
||||||
|
option (RPMB_EMU "Enable tee-supplicant to emulate RPMB" ON)
|
||||||
|
option (CFG_TA_GPROF_SUPPORT "Enable tee-supplicant support for TAs instrumented with gprof" ON)
|
||||||
|
option (CFG_FTRACE_SUPPORT "Enable tee-supplicant support for TAs instrumented with ftrace" ON)
|
||||||
|
option (CFG_TEE_SUPP_PLUGINS "Enable tee-supplicant plugin support" ON)
|
||||||
|
|
||||||
|
set (CFG_TEE_SUPP_LOG_LEVEL "1" CACHE STRING "tee-supplicant log level")
|
||||||
|
# FIXME: Question is, is this really needed? Should just use defaults from # GNUInstallDirs?
|
||||||
|
set (CFG_TEE_CLIENT_LOAD_PATH "/lib" CACHE STRING "Colon-separated list of paths where to look for TAs (see also --ta-dir)")
|
||||||
|
set (CFG_TEE_FS_PARENT_PATH "/data/tee" CACHE STRING "Location of TEE filesystem (secure storage)")
|
||||||
|
# FIXME: Why do we have if defined(CFG_GP_SOCKETS) && CFG_GP_SOCKETS == 1 in the c-file?
|
||||||
|
set (CFG_GP_SOCKETS "1" CACHE STRING "Enable GlobalPlatform Socket API support")
|
||||||
|
set (CFG_TEE_PLUGIN_LOAD_PATH "/usr/lib/tee-supplicant/plugins/" CACHE STRING "tee-supplicant's plugins path")
|
||||||
|
|
||||||
|
if (CFG_TEE_SUPP_PLUGINS)
|
||||||
|
set (CMAKE_INSTALL_RPATH "${CFG_TEE_PLUGIN_LOAD_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source files
|
||||||
|
################################################################################
|
||||||
|
set (SRC
|
||||||
|
src/handle.c
|
||||||
|
src/hmac_sha2.c
|
||||||
|
src/rpmb.c
|
||||||
|
src/nvme_rpmb.c
|
||||||
|
src/sha2.c
|
||||||
|
src/tee_supp_fs.c
|
||||||
|
src/tee_supplicant.c
|
||||||
|
src/teec_ta_load.c
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CFG_GP_SOCKETS)
|
||||||
|
set (SRC ${SRC} src/tee_socket.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_TA_GPROF_SUPPORT OR CFG_FTRACE_SUPPORT)
|
||||||
|
set (SRC ${SRC} src/prof.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_TEE_SUPP_PLUGINS)
|
||||||
|
set (SRC ${SRC} src/plugin.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Built binary
|
||||||
|
################################################################################
|
||||||
|
add_executable (${PROJECT_NAME} ${SRC})
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Flags always set
|
||||||
|
################################################################################
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DDEBUGLEVEL_${CFG_TEE_SUPP_LOG_LEVEL}
|
||||||
|
PRIVATE -DTEEC_LOAD_PATH="${CFG_TEE_CLIENT_LOAD_PATH}"
|
||||||
|
PRIVATE -DTEE_FS_PARENT_PATH="${CFG_TEE_FS_PARENT_PATH}"
|
||||||
|
PRIVATE -DBINARY_PREFIX="TSUP"
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Optional flags
|
||||||
|
################################################################################
|
||||||
|
if (CFG_GP_SOCKETS)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DCFG_GP_SOCKETS=${CFG_GP_SOCKETS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_TA_TEST_PATH)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DCFG_TA_TEST_PATH=${CFG_TA_TEST_PATH})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (RPMB_EMU)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DRPMB_EMU=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_TA_GPROF_SUPPORT)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DCFG_TA_GPROF_SUPPORT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_FTRACE_SUPPORT)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DCFG_FTRACE_SUPPORT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CFG_TEE_SUPP_PLUGINS)
|
||||||
|
target_compile_definitions (${PROJECT_NAME}
|
||||||
|
PRIVATE -DTEE_SUPP_PLUGINS
|
||||||
|
PRIVATE -DTEE_PLUGIN_LOAD_PATH="${CFG_TEE_PLUGIN_LOAD_PATH}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Public and private header and library dependencies
|
||||||
|
################################################################################
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
||||||
|
|
||||||
|
target_link_libraries (${PROJECT_NAME}
|
||||||
|
PRIVATE teec
|
||||||
|
PRIVATE optee-client-headers
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CFG_TEE_SUPP_PLUGINS)
|
||||||
|
target_link_libraries (${PROJECT_NAME}
|
||||||
|
PRIVATE dl
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install targets
|
||||||
|
################################################################################
|
||||||
|
install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
||||||
107
optee/optee_client/tee-supplicant/Makefile
Normal file
107
optee/optee_client/tee-supplicant/Makefile
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
include ../flags.mk
|
||||||
|
include ../config.mk
|
||||||
|
|
||||||
|
OUT_DIR := $(OO)/tee-supplicant
|
||||||
|
|
||||||
|
# Emulate RPMB ioctl's by default
|
||||||
|
RPMB_EMU ?= 1
|
||||||
|
|
||||||
|
.PHONY: all tee-supplicant clean
|
||||||
|
|
||||||
|
all: tee-supplicant
|
||||||
|
################################################################################
|
||||||
|
# Teec configuration
|
||||||
|
################################################################################
|
||||||
|
PACKAGE_NAME := tee-supplicant
|
||||||
|
|
||||||
|
TEES_SRCS := tee_supplicant.c \
|
||||||
|
teec_ta_load.c \
|
||||||
|
tee_supp_fs.c \
|
||||||
|
rpmb.c \
|
||||||
|
nvme_rpmb.c \
|
||||||
|
handle.c
|
||||||
|
|
||||||
|
ifeq ($(CFG_GP_SOCKETS),y)
|
||||||
|
TEES_SRCS += tee_socket.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(RPMB_EMU),1)
|
||||||
|
TEES_SRCS += sha2.c hmac_sha2.c
|
||||||
|
endif
|
||||||
|
ifneq (,$(filter y,$(CFG_TA_GPROF_SUPPORT) $(CFG_FTRACE_SUPPORT)))
|
||||||
|
TEES_SRCS += prof.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_TEE_SUPP_PLUGINS),y)
|
||||||
|
TEES_SRCS += plugin.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEES_SRC_DIR := src
|
||||||
|
TEES_OBJ_DIR := $(OUT_DIR)
|
||||||
|
TEES_OBJS := $(patsubst %.c,$(TEES_OBJ_DIR)/%.o, $(TEES_SRCS))
|
||||||
|
TEES_INCLUDES := ${CURDIR}/../libteec/include \
|
||||||
|
${CURDIR}/src \
|
||||||
|
${CURDIR}/../public \
|
||||||
|
|
||||||
|
TEES_CFLAGS := $(addprefix -I, $(TEES_INCLUDES)) $(CFLAGS) \
|
||||||
|
-DDEBUGLEVEL_$(CFG_TEE_SUPP_LOG_LEVEL) \
|
||||||
|
-DBINARY_PREFIX=\"TEES\" \
|
||||||
|
-DTEE_FS_PARENT_PATH=\"$(CFG_TEE_FS_PARENT_PATH)\" \
|
||||||
|
-DTEEC_LOAD_PATH=\"$(CFG_TEE_CLIENT_LOAD_PATH)\" \
|
||||||
|
|
||||||
|
ifeq ($(CFG_GP_SOCKETS),y)
|
||||||
|
TEES_CFLAGS += -DCFG_GP_SOCKETS=1
|
||||||
|
endif
|
||||||
|
ifeq ($(RPMB_EMU),1)
|
||||||
|
TEES_CFLAGS += -DRPMB_EMU=1
|
||||||
|
endif
|
||||||
|
ifeq ($(CFG_TA_TEST_PATH),y)
|
||||||
|
TEES_CFLAGS += -DCFG_TA_TEST_PATH=1
|
||||||
|
endif
|
||||||
|
TEES_FILE := $(OUT_DIR)/$(PACKAGE_NAME)
|
||||||
|
TEES_LFLAGS := $(LDFLAGS) -L$(OUT_DIR)/../libteec -lteec
|
||||||
|
|
||||||
|
ifeq ($(CFG_TA_GPROF_SUPPORT),y)
|
||||||
|
TEES_CFLAGS += -DCFG_TA_GPROF_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_FTRACE_SUPPORT),y)
|
||||||
|
TEES_CFLAGS += -DCFG_FTRACE_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEES_CFLAGS += -fstack-protector-strong
|
||||||
|
|
||||||
|
ifeq ($(CFG_TEE_SUPP_PLUGINS),y)
|
||||||
|
TEES_CFLAGS += -DTEE_SUPP_PLUGINS \
|
||||||
|
-DTEE_PLUGIN_LOAD_PATH=\"$(CFG_TEE_PLUGIN_LOAD_PATH)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEES_LFLAGS += -lpthread
|
||||||
|
# Needed to get clock_gettime() for for glibc versions before 2.17
|
||||||
|
TEES_LFLAGS += -lrt
|
||||||
|
|
||||||
|
ifeq ($(CFG_TEE_SUPP_PLUGINS),y)
|
||||||
|
# Needed to dynamically load user plugins
|
||||||
|
TEES_LFLAGS += -ldl
|
||||||
|
# Needed for dlopen()
|
||||||
|
TEES_LFLAGS += -Wl,-rpath=$(CFG_TEE_PLUGIN_LOAD_PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tee-supplicant: $(TEES_FILE)
|
||||||
|
|
||||||
|
$(TEES_FILE): $(TEES_OBJS)
|
||||||
|
@echo " LINK $@"
|
||||||
|
$(VPREFIX)$(CC) -o $@ $+ $(TEES_LFLAGS)
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
$(TEES_OBJ_DIR)/%.o: $(TEES_SRC_DIR)/%.c
|
||||||
|
$(VPREFIX)mkdir -p $(dir $@)
|
||||||
|
@echo " CC $<"
|
||||||
|
$(VPREFIX)$(CC) $(TEES_CFLAGS) $(TEES_CFLAGS_$(notdir $<)) -c $< -o $@
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Cleaning up configuration
|
||||||
|
################################################################################
|
||||||
|
clean:
|
||||||
|
$(RM) $(TEES_OBJS) $(TEES_FILE)
|
||||||
|
$(call rmdir,$(OUT_DIR))
|
||||||
37
optee/optee_client/tee-supplicant/src/__tee_ipsocket.h
Normal file
37
optee/optee_client/tee-supplicant/src/__tee_ipsocket.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ____TEE_IPSOCKET_H
|
||||||
|
#define ____TEE_IPSOCKET_H
|
||||||
|
|
||||||
|
typedef enum TEE_ipSocket_ipVersion_e {
|
||||||
|
TEE_IP_VERSION_DC = 0, /* don’t care */
|
||||||
|
TEE_IP_VERSION_4 = 1,
|
||||||
|
TEE_IP_VERSION_6 = 2
|
||||||
|
} TEE_ipSocket_ipVersion;
|
||||||
|
|
||||||
|
#endif /*____TEE_IPSOCKET_H*/
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef ____TEE_ISOCKET_DEFINES_H
|
||||||
|
#define ____TEE_ISOCKET_DEFINES_H
|
||||||
|
|
||||||
|
#define TEE_ISOCKET_VERSION 0x01000000
|
||||||
|
|
||||||
|
#define TEE_ISOCKET_ERROR_PROTOCOL 0xF1007001
|
||||||
|
#define TEE_ISOCKET_ERROR_REMOTE_CLOSED 0xF1007002
|
||||||
|
#define TEE_ISOCKET_ERROR_TIMEOUT 0xF1007003
|
||||||
|
#define TEE_ISOCKET_ERROR_OUT_OF_RESOURCES 0xF1007004
|
||||||
|
#define TEE_ISOCKET_ERROR_LARGE_BUFFER 0xF1007005
|
||||||
|
#define TEE_ISOCKET_WARNING_PROTOCOL 0xF1007006
|
||||||
|
#define TEE_ISOCKET_ERROR_HOSTNAME 0xF1007007
|
||||||
|
|
||||||
|
#endif /*____TEE_ISOCKET_DEFINES_H*/
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ____TEE_TCPSOCKET_DEFINES_H
|
||||||
|
#define ____TEE_TCPSOCKET_DEFINES_H
|
||||||
|
|
||||||
|
/* Protocol identifier */
|
||||||
|
#define TEE_ISOCKET_PROTOCOLID_TCP 0x65
|
||||||
|
|
||||||
|
/* Instance specific errors */
|
||||||
|
#define TEE_ISOCKET_TCP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1010002
|
||||||
|
|
||||||
|
#endif /*____TEE_TCPSOCKET_DEFINES_H*/
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H
|
||||||
|
#define ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H
|
||||||
|
|
||||||
|
/* Instance and implementation specific ioctl functions */
|
||||||
|
#define TEE_TCP_SET_RECVBUF 0x65f00000
|
||||||
|
#define TEE_TCP_SET_SENDBUF 0x65f00001
|
||||||
|
|
||||||
|
#endif /*____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H*/
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ____TEE_UDPSOCKET_DEFINES_H
|
||||||
|
#define ____TEE_UDPSOCKET_DEFINES_H
|
||||||
|
|
||||||
|
/* Protocol identifier */
|
||||||
|
#define TEE_ISOCKET_PROTOCOLID_UDP 0x66
|
||||||
|
|
||||||
|
/* Instance specific errors */
|
||||||
|
#define TEE_ISOCKET_UDP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1020002
|
||||||
|
|
||||||
|
/* Instance specific ioctl functions */
|
||||||
|
#define TEE_UDP_CHANGEADDR 0x66000001
|
||||||
|
#define TEE_UDP_CHANGEPORT 0x66000002
|
||||||
|
|
||||||
|
#endif /*____TEE_UDPSOCKET_DEFINES_H*/
|
||||||
175
optee/optee_client/tee-supplicant/src/handle.c
Normal file
175
optee/optee_client/tee-supplicant/src/handle.c
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "handle.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define the initial capacity of the database. It should be a low number
|
||||||
|
* multiple of 2 since some databases a likely to only use a few handles.
|
||||||
|
* Since the algorithm is to doubles up when growing it shouldn't cause a
|
||||||
|
* noticable overhead on large databases.
|
||||||
|
*/
|
||||||
|
#define HANDLE_DB_INITIAL_MAX_PTRS 4
|
||||||
|
|
||||||
|
static void mutex_lock(struct handle_db *db)
|
||||||
|
{
|
||||||
|
if (db->mu)
|
||||||
|
pthread_mutex_lock(db->mu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mutex_unlock(struct handle_db *db)
|
||||||
|
{
|
||||||
|
if (db->mu)
|
||||||
|
pthread_mutex_unlock(db->mu);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void handle_db_set_mutex(struct handle_db *db, pthread_mutex_t *mu)
|
||||||
|
{
|
||||||
|
db->mu = mu;
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_db_destroy(struct handle_db *db)
|
||||||
|
{
|
||||||
|
if (db) {
|
||||||
|
mutex_lock(db);
|
||||||
|
free(db->ptrs);
|
||||||
|
db->ptrs = NULL;
|
||||||
|
db->max_ptrs = 0;
|
||||||
|
mutex_unlock(db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int handle_get(struct handle_db *db, void *ptr)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
void *p = NULL;
|
||||||
|
size_t new_max_ptrs = 0;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
if (!db || !ptr)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
mutex_lock(db);
|
||||||
|
|
||||||
|
/* Try to find an empty location */
|
||||||
|
for (n = 0; n < db->max_ptrs; n++) {
|
||||||
|
if (!db->ptrs[n]) {
|
||||||
|
db->ptrs[n] = ptr;
|
||||||
|
ret = n;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No location available, grow the ptrs array */
|
||||||
|
if (db->max_ptrs)
|
||||||
|
new_max_ptrs = db->max_ptrs * 2;
|
||||||
|
else
|
||||||
|
new_max_ptrs = HANDLE_DB_INITIAL_MAX_PTRS;
|
||||||
|
p = realloc(db->ptrs, new_max_ptrs * sizeof(void *));
|
||||||
|
if (!p) {
|
||||||
|
ret = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
db->ptrs = p;
|
||||||
|
memset(db->ptrs + db->max_ptrs, 0,
|
||||||
|
(new_max_ptrs - db->max_ptrs) * sizeof(void *));
|
||||||
|
db->max_ptrs = new_max_ptrs;
|
||||||
|
|
||||||
|
/* Since n stopped at db->max_ptrs there is an empty location there */
|
||||||
|
db->ptrs[n] = ptr;
|
||||||
|
ret = n;
|
||||||
|
|
||||||
|
out:
|
||||||
|
mutex_unlock(db);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *handle_put(struct handle_db *db, int handle)
|
||||||
|
{
|
||||||
|
void *p = NULL;
|
||||||
|
|
||||||
|
if (!db || handle < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
mutex_lock(db);
|
||||||
|
|
||||||
|
if ((size_t)handle >= db->max_ptrs) {
|
||||||
|
p = NULL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = db->ptrs[handle];
|
||||||
|
db->ptrs[handle] = NULL;
|
||||||
|
|
||||||
|
out:
|
||||||
|
mutex_unlock(db);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *handle_lookup(struct handle_db *db, int handle)
|
||||||
|
{
|
||||||
|
void *p = NULL;
|
||||||
|
|
||||||
|
if (!db || handle < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
mutex_lock(db);
|
||||||
|
|
||||||
|
if ((size_t)handle >= db->max_ptrs) {
|
||||||
|
p = NULL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = db->ptrs[handle];
|
||||||
|
|
||||||
|
out:
|
||||||
|
mutex_unlock(db);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_foreach_put(struct handle_db *db,
|
||||||
|
void (*cb)(int handle, void *ptr, void *arg),
|
||||||
|
void *arg)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (!db || !cb)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mutex_lock(db);
|
||||||
|
|
||||||
|
for (n = 0; n < db->max_ptrs; n++) {
|
||||||
|
if (db->ptrs[n]) {
|
||||||
|
cb(n, db->ptrs[n], arg);
|
||||||
|
db->ptrs[n] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_unlock(db);
|
||||||
|
}
|
||||||
82
optee/optee_client/tee-supplicant/src/handle.h
Normal file
82
optee/optee_client/tee-supplicant/src/handle.h
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef HANDLE_H
|
||||||
|
#define HANDLE_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
struct handle_db {
|
||||||
|
void **ptrs;
|
||||||
|
size_t max_ptrs;
|
||||||
|
pthread_mutex_t *mu;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define HANDLE_DB_INITIALIZER { NULL, 0, NULL }
|
||||||
|
#define HANDLE_DB_INITIALIZER_WITH_MUTEX(mu) { NULL, 0, (mu) }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Assigns a mutex for the database. If mu != NULL the mutex will be
|
||||||
|
* acquired before each access to the database and released when
|
||||||
|
* the operation is done.
|
||||||
|
*/
|
||||||
|
void handle_db_set_mutex(struct handle_db *db, pthread_mutex_t *mu);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Frees all internal data structures of the database, but does not free
|
||||||
|
* the db pointer. The database is safe to reuse after it's destroyed, it
|
||||||
|
* just be empty again. The assigned mutex is also preserved.
|
||||||
|
*/
|
||||||
|
void handle_db_destroy(struct handle_db *db);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocates a new handle and assigns the supplied pointer to it,
|
||||||
|
* ptr must not be NULL.
|
||||||
|
* The function returns
|
||||||
|
* >= 0 on success and
|
||||||
|
* -1 on failure
|
||||||
|
*/
|
||||||
|
int handle_get(struct handle_db *db, void *ptr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Deallocates a handle. Returns the assiciated pointer of the handle
|
||||||
|
* the the handle was valid or NULL if it's invalid.
|
||||||
|
*/
|
||||||
|
void *handle_put(struct handle_db *db, int handle);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the assiciated pointer of the handle if the handle is a valid
|
||||||
|
* handle.
|
||||||
|
* Returns NULL on failure.
|
||||||
|
*/
|
||||||
|
void *handle_lookup(struct handle_db *db, int handle);
|
||||||
|
|
||||||
|
void handle_foreach_put(struct handle_db *db,
|
||||||
|
void (*cb)(int handle, void *ptr, void *arg),
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
#endif /*HANDLE_H*/
|
||||||
126
optee/optee_client/tee-supplicant/src/hmac_sha2.c
Normal file
126
optee/optee_client/tee-supplicant/src/hmac_sha2.c
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
/*
|
||||||
|
* HMAC-SHA-224/256/384/512 implementation
|
||||||
|
* Last update: 06/15/2005
|
||||||
|
* Issue date: 06/15/2005
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 Olivier Gay <olivier.gay@a3.epfl.ch>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "hmac_sha2.h"
|
||||||
|
|
||||||
|
/* HMAC-SHA-256 functions */
|
||||||
|
|
||||||
|
void hmac_sha256_init(hmac_sha256_ctx *ctx, const unsigned char *key,
|
||||||
|
unsigned int key_size)
|
||||||
|
{
|
||||||
|
unsigned int fill = 0;
|
||||||
|
unsigned int num = 0;
|
||||||
|
const unsigned char *key_used = NULL;
|
||||||
|
unsigned char key_temp[SHA256_DIGEST_SIZE] = { 0 };
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (key_size == SHA256_BLOCK_SIZE) {
|
||||||
|
key_used = key;
|
||||||
|
num = SHA256_BLOCK_SIZE;
|
||||||
|
} else {
|
||||||
|
if (key_size > SHA256_BLOCK_SIZE){
|
||||||
|
num = SHA256_DIGEST_SIZE;
|
||||||
|
sha256(key, key_size, key_temp);
|
||||||
|
key_used = key_temp;
|
||||||
|
} else { /* key_size > SHA256_BLOCK_SIZE */
|
||||||
|
key_used = key;
|
||||||
|
num = key_size;
|
||||||
|
}
|
||||||
|
fill = SHA256_BLOCK_SIZE - num;
|
||||||
|
|
||||||
|
memset(ctx->block_ipad + num, 0x36, fill);
|
||||||
|
memset(ctx->block_opad + num, 0x5c, fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < (int) num; i++) {
|
||||||
|
ctx->block_ipad[i] = key_used[i] ^ 0x36;
|
||||||
|
ctx->block_opad[i] = key_used[i] ^ 0x5c;
|
||||||
|
}
|
||||||
|
|
||||||
|
sha256_init(&ctx->ctx_inside);
|
||||||
|
sha256_update(&ctx->ctx_inside, ctx->block_ipad, SHA256_BLOCK_SIZE);
|
||||||
|
|
||||||
|
sha256_init(&ctx->ctx_outside);
|
||||||
|
sha256_update(&ctx->ctx_outside, ctx->block_opad,
|
||||||
|
SHA256_BLOCK_SIZE);
|
||||||
|
|
||||||
|
/* for hmac_reinit */
|
||||||
|
memcpy(&ctx->ctx_inside_reinit, &ctx->ctx_inside,
|
||||||
|
sizeof(sha256_ctx));
|
||||||
|
memcpy(&ctx->ctx_outside_reinit, &ctx->ctx_outside,
|
||||||
|
sizeof(sha256_ctx));
|
||||||
|
}
|
||||||
|
|
||||||
|
void hmac_sha256_reinit(hmac_sha256_ctx *ctx)
|
||||||
|
{
|
||||||
|
memcpy(&ctx->ctx_inside, &ctx->ctx_inside_reinit,
|
||||||
|
sizeof(sha256_ctx));
|
||||||
|
memcpy(&ctx->ctx_outside, &ctx->ctx_outside_reinit,
|
||||||
|
sizeof(sha256_ctx));
|
||||||
|
}
|
||||||
|
|
||||||
|
void hmac_sha256_update(hmac_sha256_ctx *ctx, const unsigned char *message,
|
||||||
|
unsigned int message_len)
|
||||||
|
{
|
||||||
|
sha256_update(&ctx->ctx_inside, message, message_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||||
|
unsigned int mac_size)
|
||||||
|
{
|
||||||
|
unsigned char digest_inside[SHA256_DIGEST_SIZE] = { 0 };
|
||||||
|
unsigned char mac_temp[SHA256_DIGEST_SIZE] = { 0 };
|
||||||
|
|
||||||
|
sha256_final(&ctx->ctx_inside, digest_inside);
|
||||||
|
sha256_update(&ctx->ctx_outside, digest_inside, SHA256_DIGEST_SIZE);
|
||||||
|
sha256_final(&ctx->ctx_outside, mac_temp);
|
||||||
|
memcpy(mac, mac_temp, mac_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hmac_sha256(const unsigned char *key, unsigned int key_size,
|
||||||
|
const unsigned char *message, unsigned int message_len,
|
||||||
|
unsigned char *mac, unsigned mac_size)
|
||||||
|
{
|
||||||
|
hmac_sha256_ctx ctx;
|
||||||
|
|
||||||
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
|
|
||||||
|
hmac_sha256_init(&ctx, key, key_size);
|
||||||
|
hmac_sha256_update(&ctx, message, message_len);
|
||||||
|
hmac_sha256_final(&ctx, mac, mac_size);
|
||||||
|
}
|
||||||
74
optee/optee_client/tee-supplicant/src/hmac_sha2.h
Normal file
74
optee/optee_client/tee-supplicant/src/hmac_sha2.h
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* HMAC-SHA-224/256/384/512 implementation
|
||||||
|
* Last update: 06/15/2005
|
||||||
|
* Issue date: 06/15/2005
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 Olivier Gay <olivier.gay@a3.epfl.ch>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HMAC_SHA2_H
|
||||||
|
#define HMAC_SHA2_H
|
||||||
|
|
||||||
|
#include "sha2.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
sha256_ctx ctx_inside;
|
||||||
|
sha256_ctx ctx_outside;
|
||||||
|
|
||||||
|
/* for hmac_reinit */
|
||||||
|
sha256_ctx ctx_inside_reinit;
|
||||||
|
sha256_ctx ctx_outside_reinit;
|
||||||
|
|
||||||
|
unsigned char block_ipad[SHA256_BLOCK_SIZE];
|
||||||
|
unsigned char block_opad[SHA256_BLOCK_SIZE];
|
||||||
|
} hmac_sha256_ctx;
|
||||||
|
|
||||||
|
void hmac_sha256_init(hmac_sha256_ctx *ctx, const unsigned char *key,
|
||||||
|
unsigned int key_size);
|
||||||
|
void hmac_sha256_reinit(hmac_sha256_ctx *ctx);
|
||||||
|
void hmac_sha256_update(hmac_sha256_ctx *ctx, const unsigned char *message,
|
||||||
|
unsigned int message_len);
|
||||||
|
void hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||||
|
unsigned int mac_size);
|
||||||
|
void hmac_sha256(const unsigned char *key, unsigned int key_size,
|
||||||
|
const unsigned char *message, unsigned int message_len,
|
||||||
|
unsigned char *mac, unsigned mac_size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !HMAC_SHA2_H */
|
||||||
|
|
||||||
596
optee/optee_client/tee-supplicant/src/nvme_rpmb.c
Normal file
596
optee/optee_client/tee-supplicant/src/nvme_rpmb.c
Normal file
@@ -0,0 +1,596 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <nvme_rpmb.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
struct nvme_psd_31{
|
||||||
|
uint16_t mp;
|
||||||
|
uint8_t rsvd2;
|
||||||
|
uint8_t flags;
|
||||||
|
uint32_t enlat;
|
||||||
|
uint32_t exlat;
|
||||||
|
uint8_t rrt;
|
||||||
|
uint8_t rrl;
|
||||||
|
uint8_t rwt;
|
||||||
|
uint8_t rwl;
|
||||||
|
uint16_t idlp;
|
||||||
|
uint8_t ips;
|
||||||
|
uint8_t rsvd19;
|
||||||
|
uint16_t actp;
|
||||||
|
uint8_t apws;
|
||||||
|
uint8_t rsvd23[9];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nvme_identify_controller {
|
||||||
|
uint16_t vid;
|
||||||
|
uint16_t ssvid;
|
||||||
|
char sn[20];
|
||||||
|
char mn[40];
|
||||||
|
char fr[8];
|
||||||
|
uint8_t rab;
|
||||||
|
uint8_t ieee[3];
|
||||||
|
uint8_t cmic;
|
||||||
|
uint8_t mdts;
|
||||||
|
uint16_t cntlid;
|
||||||
|
uint32_t ver;
|
||||||
|
uint32_t rtd3r;
|
||||||
|
uint32_t rtd3e;
|
||||||
|
uint32_t oaes;
|
||||||
|
uint32_t ctratt;
|
||||||
|
uint16_t rrls;
|
||||||
|
uint8_t rsvd102[9];
|
||||||
|
uint8_t cntrltype;
|
||||||
|
uint8_t fguid[16];
|
||||||
|
uint16_t crdt1;
|
||||||
|
uint16_t crdt2;
|
||||||
|
uint16_t crdt3;
|
||||||
|
uint8_t rsvd134[119];
|
||||||
|
uint8_t nvmsr;
|
||||||
|
uint8_t vwci;
|
||||||
|
uint8_t mec;
|
||||||
|
uint16_t oacs;
|
||||||
|
uint8_t acl;
|
||||||
|
uint8_t aerl;
|
||||||
|
uint8_t frmw;
|
||||||
|
uint8_t lpa;
|
||||||
|
uint8_t elpe;
|
||||||
|
uint8_t npss;
|
||||||
|
uint8_t avscc;
|
||||||
|
uint8_t apsta;
|
||||||
|
uint16_t wctemp;
|
||||||
|
uint16_t cctemp;
|
||||||
|
uint16_t mtfa;
|
||||||
|
uint32_t hmpre;
|
||||||
|
uint32_t hmmin;
|
||||||
|
uint8_t tnvmcap[16];
|
||||||
|
uint8_t unvmcap[16];
|
||||||
|
uint32_t rpmbs;
|
||||||
|
uint16_t edstt;
|
||||||
|
uint8_t dsto;
|
||||||
|
uint8_t fwug;
|
||||||
|
uint16_t kas;
|
||||||
|
uint16_t hctma;
|
||||||
|
uint16_t mntmt;
|
||||||
|
uint16_t mxtmt;
|
||||||
|
uint32_t sanicap;
|
||||||
|
uint32_t hmminds;
|
||||||
|
uint16_t hmmaxd;
|
||||||
|
uint16_t nsetidmax;
|
||||||
|
uint16_t endgidmax;
|
||||||
|
uint8_t anatt;
|
||||||
|
uint8_t anacap;
|
||||||
|
uint32_t anagrpmax;
|
||||||
|
uint32_t nanagrpid;
|
||||||
|
uint32_t pels;
|
||||||
|
uint16_t domainid;
|
||||||
|
uint8_t rsvd358[10];
|
||||||
|
uint8_t megcap[16];
|
||||||
|
uint8_t rsvd384[128];
|
||||||
|
uint8_t sqes;
|
||||||
|
uint8_t cqes;
|
||||||
|
uint16_t maxcmd;
|
||||||
|
uint32_t nn;
|
||||||
|
uint16_t oncs;
|
||||||
|
uint16_t fuses;
|
||||||
|
uint8_t fna;
|
||||||
|
uint8_t vwc;
|
||||||
|
uint16_t awun;
|
||||||
|
uint16_t awupf;
|
||||||
|
uint8_t icsvscc;
|
||||||
|
uint8_t nwpc;
|
||||||
|
uint16_t acwu;
|
||||||
|
uint16_t ocfs;
|
||||||
|
uint32_t sgls;
|
||||||
|
uint32_t mnan;
|
||||||
|
uint8_t maxdna[16];
|
||||||
|
uint32_t maxcna;
|
||||||
|
uint8_t rsvd564[204];
|
||||||
|
char subnqn[256];
|
||||||
|
uint8_t rsvd1024[768];
|
||||||
|
uint32_t ioccsz;
|
||||||
|
uint32_t iorcsz;
|
||||||
|
uint16_t icdoff;
|
||||||
|
uint8_t fcatt;
|
||||||
|
uint8_t msdbd;
|
||||||
|
uint16_t ofcs;
|
||||||
|
uint8_t dctype;
|
||||||
|
uint8_t rsvd1807[241];
|
||||||
|
struct nvme_psd_31 psd[32];
|
||||||
|
uint8_t vs[1024];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* identify command */
|
||||||
|
#define NVME_IDENTIFY_CDW10_CNTID_SHIFT 16
|
||||||
|
#define NVME_IDENTIFY_CDW10_CNS_SHIFT 0
|
||||||
|
#define NVME_IDENTIFY_CDW11_CNSSPECID_SHIFT 0
|
||||||
|
#define NVME_IDENTIFY_CDW11_CSI_SHIFT 24
|
||||||
|
#define NVME_IDENTIFY_CDW14_UUID_SHIFT 0
|
||||||
|
#define NVME_IDENTIFY_CDW10_CNTID_MASK 0xffff
|
||||||
|
#define NVME_IDENTIFY_CDW10_CNS_MASK 0xff
|
||||||
|
#define NVME_IDENTIFY_CDW11_CNSSPECID_MASK 0xffff
|
||||||
|
#define NVME_IDENTIFY_CDW11_CSI_MASK 0xff
|
||||||
|
#define NVME_IDENTIFY_CDW14_UUID_MASK 0x7f
|
||||||
|
|
||||||
|
#define NVME_IDENTIFY_CNS_CTRL 0x01
|
||||||
|
#define NVME_CSI_NVM 0x0
|
||||||
|
#define NVME_NSID_NONE 0x0
|
||||||
|
#define NVME_CNTLID_NONE 0x0
|
||||||
|
#define NVME_CNSSPECID_NONE 0x0
|
||||||
|
#define NVME_UUID_NONE 0x0
|
||||||
|
|
||||||
|
#define NVME_DEV_SN_LENGTH 20
|
||||||
|
|
||||||
|
/* security comamnd */
|
||||||
|
#define NVME_SECURITY_NSSF_SHIFT 0
|
||||||
|
#define NVME_SECURITY_SPSP0_SHIFT 8
|
||||||
|
#define NVME_SECURITY_SPSP1_SHIFT 16
|
||||||
|
#define NVME_SECURITY_SECP_SHIFT 24
|
||||||
|
#define NVME_SECURITY_NSSF_MASK 0xff
|
||||||
|
#define NVME_SECURITY_SPSP0_MASK 0xff
|
||||||
|
#define NVME_SECURITY_SPSP1_MASK 0xff
|
||||||
|
#define NVME_SECURITY_SECP_MASK 0xff
|
||||||
|
|
||||||
|
#define NVME_RPMB_SECP 0xEA
|
||||||
|
#define NVME_RPMB_SPSP0 0x01
|
||||||
|
#define NVME_RPMB_SPSP1 0x00
|
||||||
|
|
||||||
|
/* NVMe admin opcodes */
|
||||||
|
#define NVME_ADMIN_IDENTIFY 0x06
|
||||||
|
#define NVME_ADMIN_SECURITY_SEND 0x81
|
||||||
|
#define NVME_ADMIN_SECURITY_RECV 0x82
|
||||||
|
|
||||||
|
#define NVME_IDENTIFY_DATA_SIZE 4096
|
||||||
|
|
||||||
|
/* default timeout */
|
||||||
|
#define NVME_DEFAULT_IOCTL_TIMEOUT 0
|
||||||
|
|
||||||
|
/* Request */
|
||||||
|
struct nvme_rpmb_req {
|
||||||
|
uint16_t cmd;
|
||||||
|
#define NVME_RPMB_CMD_DATA_REQ 0x00
|
||||||
|
#define NVME_RPMB_CMD_GET_RPMBS_INFO 0x01
|
||||||
|
uint16_t dev_id;
|
||||||
|
/* Optional data frames (rpmb_data_frame) follow */
|
||||||
|
};
|
||||||
|
#define NVME_RPMB_REQ_DATA(req) ((void *)((struct nvme_rpmb_req *)(req) + 1))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This structure is shared with OP-TEE and the NVMe ioctl layer.
|
||||||
|
* It is the "data frame for RPMB access" defined by NVMe spec,
|
||||||
|
* minus the start and stop bits.
|
||||||
|
*/
|
||||||
|
struct nvme_rpmb_data_frame {
|
||||||
|
uint8_t stuff_bytes[191];
|
||||||
|
uint8_t key_mac[32];
|
||||||
|
uint8_t target;
|
||||||
|
uint8_t nonce[16];
|
||||||
|
uint32_t write_counter;
|
||||||
|
uint32_t address;
|
||||||
|
uint32_t block_count;
|
||||||
|
uint16_t op_result;
|
||||||
|
#define NVME_RPMB_RESULT_OK 0x00
|
||||||
|
#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
|
||||||
|
#define NVME_RPMB_RESULT_AUTH_FAILURE 0x02
|
||||||
|
#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
|
||||||
|
#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
|
||||||
|
#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
|
||||||
|
#define NVME_RPMB_RESULT_READ_FAILURE 0x06
|
||||||
|
#define NVME_RPMB_RESULT_AUTH_KEY_NOT_PROGRAMMED 0x07
|
||||||
|
#define NVME_RPMB_RESULT_INVALID_DEV_CONFIG_BLOCK 0x08
|
||||||
|
#define NVME_RPMB_RESULT_MASK 0x3F
|
||||||
|
#define NVME_RPMB_RESULT_WR_CNT_EXPIRED 0x80
|
||||||
|
uint16_t msg_type;
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM 0x0001
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_WRITE_COUNTER_READ 0x0002
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE 0x0003
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_AUTH_DATA_READ 0x0004
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_RESULT_READ 0x0005
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_AUTH_DCB_WRITE 0x0006
|
||||||
|
#define NVME_RPMB_MSG_TYPE_REQ_AUTH_DCB_READ 0x0007
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_AUTH_KEY_PROGRAM 0x0100
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_WRITE_COUNTER_VAL_READ 0x0200
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_AUTH_DATA_WRITE 0x0300
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_AUTH_DATA_READ 0x0400
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_RESULT_READ 0x0500
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_AUTH_DCB_WRITE 0x0600
|
||||||
|
#define NVME_RPMB_MSG_TYPE_RESP_AUTH_DCB_READ 0x0700
|
||||||
|
uint8_t data[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ioctl() interface
|
||||||
|
* Comes from: uapi/linux/nvme_ioctl.h
|
||||||
|
*/
|
||||||
|
struct nvme_passthru_cmd {
|
||||||
|
__u8 opcode;
|
||||||
|
__u8 flags;
|
||||||
|
__u16 rsvd1;
|
||||||
|
__u32 nsid;
|
||||||
|
__u32 cdw2;
|
||||||
|
__u32 cdw3;
|
||||||
|
__u64 metadata;
|
||||||
|
__u64 addr;
|
||||||
|
__u32 metadata_len;
|
||||||
|
__u32 data_len;
|
||||||
|
__u32 cdw10;
|
||||||
|
__u32 cdw11;
|
||||||
|
__u32 cdw12;
|
||||||
|
__u32 cdw13;
|
||||||
|
__u32 cdw14;
|
||||||
|
__u32 cdw15;
|
||||||
|
__u32 timeout_ms;
|
||||||
|
__u32 result;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define nvme_admin_cmd nvme_passthru_cmd
|
||||||
|
|
||||||
|
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
|
||||||
|
|
||||||
|
static pthread_mutex_t nvme_rpmb_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
struct nvme_dev_info {
|
||||||
|
unsigned int rpmbs;
|
||||||
|
char sn[NVME_DEV_SN_LENGTH + 1];
|
||||||
|
};
|
||||||
|
|
||||||
|
static TEEC_Result nvme_identify_command(int fd, struct nvme_identify_controller *id)
|
||||||
|
{
|
||||||
|
uint32_t cdw10 = (((NVME_CNTLID_NONE << NVME_IDENTIFY_CDW10_CNTID_SHIFT))
|
||||||
|
& NVME_IDENTIFY_CDW10_CNTID_MASK)
|
||||||
|
| (((NVME_IDENTIFY_CNS_CTRL << NVME_IDENTIFY_CDW10_CNS_SHIFT))
|
||||||
|
& NVME_IDENTIFY_CDW10_CNS_MASK);
|
||||||
|
uint32_t cdw11 = (((NVME_CNSSPECID_NONE << NVME_IDENTIFY_CDW11_CNSSPECID_SHIFT))
|
||||||
|
& NVME_IDENTIFY_CDW11_CNSSPECID_MASK)
|
||||||
|
| (((NVME_CSI_NVM << NVME_IDENTIFY_CDW11_CSI_SHIFT))
|
||||||
|
& NVME_IDENTIFY_CDW11_CSI_MASK);
|
||||||
|
uint32_t cdw14 = (NVME_UUID_NONE << NVME_IDENTIFY_CDW14_UUID_SHIFT)
|
||||||
|
& NVME_IDENTIFY_CDW14_UUID_MASK;
|
||||||
|
|
||||||
|
struct nvme_passthru_cmd cmd = {
|
||||||
|
.opcode = NVME_ADMIN_IDENTIFY,
|
||||||
|
.nsid = NVME_NSID_NONE,
|
||||||
|
.addr = (uint64_t)(uintptr_t)id,
|
||||||
|
.data_len = NVME_IDENTIFY_DATA_SIZE,
|
||||||
|
.cdw10 = cdw10,
|
||||||
|
.cdw11 = cdw11,
|
||||||
|
.cdw14 = cdw14,
|
||||||
|
.timeout_ms = NVME_DEFAULT_IOCTL_TIMEOUT,
|
||||||
|
};
|
||||||
|
|
||||||
|
int err = ioctl(fd, NVME_IOCTL_ADMIN_CMD, cmd);
|
||||||
|
if (err != 0) {
|
||||||
|
EMSG("Failed to get get nvme rpmb support info\n");
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result nvme_security_command(int fd, uint8_t opcode, uint32_t nsid,
|
||||||
|
uint32_t cdw10, uint32_t cdw11, void *data, uint32_t data_len) {
|
||||||
|
struct nvme_passthru_cmd cmd = {
|
||||||
|
.opcode = opcode,
|
||||||
|
.nsid = nsid,
|
||||||
|
.cdw10 = cdw10,
|
||||||
|
.cdw11 = cdw11,
|
||||||
|
.data_len = data_len,
|
||||||
|
.addr = (uint64_t)(uintptr_t)data,
|
||||||
|
.timeout_ms = NVME_DEFAULT_IOCTL_TIMEOUT,
|
||||||
|
};
|
||||||
|
|
||||||
|
int err = ioctl(fd, NVME_IOCTL_ADMIN_CMD, cmd);
|
||||||
|
if (err != 0) {
|
||||||
|
EMSG("Failed to send nvme security command with err = %d\n", err);
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result nvme_security_send(int fd, uint32_t nsid,
|
||||||
|
uint32_t cdw10, uint32_t cdw11, void *data, uint32_t data_len)
|
||||||
|
{
|
||||||
|
return nvme_security_command(fd, NVME_ADMIN_SECURITY_SEND,
|
||||||
|
nsid, cdw10, cdw11, data, data_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result nvme_security_receive(int fd, uint32_t nsid,
|
||||||
|
uint32_t cdw10, uint32_t cdw11, void *data, uint32_t data_len)
|
||||||
|
{
|
||||||
|
return nvme_security_command(fd, NVME_ADMIN_SECURITY_RECV,
|
||||||
|
nsid, cdw10, cdw11, data, data_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result rpmb_read_request(int fd,
|
||||||
|
struct nvme_rpmb_data_frame *req, size_t req_size,
|
||||||
|
struct nvme_rpmb_data_frame *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint8_t nssf = req->target;
|
||||||
|
uint8_t spsp0 = NVME_RPMB_SPSP0;
|
||||||
|
uint8_t spsp1 = NVME_RPMB_SPSP1;
|
||||||
|
uint8_t secp = NVME_RPMB_SECP;
|
||||||
|
uint32_t cdw10;
|
||||||
|
uint32_t cdw11;
|
||||||
|
|
||||||
|
cdw10 = (((nssf & NVME_SECURITY_NSSF_MASK) << NVME_SECURITY_NSSF_SHIFT)
|
||||||
|
| ((spsp0 & NVME_SECURITY_SPSP0_MASK) << NVME_SECURITY_SPSP0_SHIFT)
|
||||||
|
| ((spsp1 & NVME_SECURITY_SPSP1_MASK) << NVME_SECURITY_SPSP1_SHIFT)
|
||||||
|
| ((secp & NVME_SECURITY_SECP_MASK) << NVME_SECURITY_SECP_SHIFT));
|
||||||
|
cdw11 = req_size;
|
||||||
|
|
||||||
|
res = nvme_security_send(fd, 0, cdw10, cdw11, (void *)req, (uint32_t)req_size);
|
||||||
|
if (res) {
|
||||||
|
EMSG("Send security cmd error with res = 0x%08x\n", res);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
cdw11 = rsp_size;
|
||||||
|
res = nvme_security_receive(fd, 0, cdw10, cdw11, (void *)rsp, (uint32_t)rsp_size);
|
||||||
|
if (res) {
|
||||||
|
EMSG("Receive security cmd error with res = 0x%08x\n", res);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_out:
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result rpmb_write_request(int fd,
|
||||||
|
struct nvme_rpmb_data_frame *req, size_t req_size,
|
||||||
|
struct nvme_rpmb_data_frame *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint8_t nssf = req->target;
|
||||||
|
uint8_t spsp0 = NVME_RPMB_SPSP0;
|
||||||
|
uint8_t spsp1 = NVME_RPMB_SPSP1;
|
||||||
|
uint8_t secp = NVME_RPMB_SECP;
|
||||||
|
uint32_t cdw10;
|
||||||
|
uint32_t cdw11;
|
||||||
|
|
||||||
|
cdw10 = (((nssf & NVME_SECURITY_NSSF_MASK) << NVME_SECURITY_NSSF_SHIFT)
|
||||||
|
| ((spsp0 & NVME_SECURITY_SPSP0_MASK) << NVME_SECURITY_SPSP0_SHIFT)
|
||||||
|
| ((spsp1 & NVME_SECURITY_SPSP1_MASK) << NVME_SECURITY_SPSP1_SHIFT)
|
||||||
|
| ((secp & NVME_SECURITY_SECP_MASK) << NVME_SECURITY_SECP_SHIFT));
|
||||||
|
cdw11 = req_size;
|
||||||
|
|
||||||
|
res = nvme_security_send(fd, 0, cdw10, cdw11, (void *)req, (uint32_t)req_size);
|
||||||
|
if (res) {
|
||||||
|
EMSG("send security cmd error with res = 0x%08x\n", res);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(rsp, 0, sizeof(struct nvme_rpmb_data_frame));
|
||||||
|
rsp->target = req->target;
|
||||||
|
rsp->msg_type = NVME_RPMB_MSG_TYPE_REQ_RESULT_READ;
|
||||||
|
cdw11 = rsp_size;
|
||||||
|
res = nvme_security_send(fd, 0, cdw10, cdw11, (void *)rsp, (uint32_t)rsp_size);
|
||||||
|
if (res) {
|
||||||
|
EMSG("send security cmd error with res = 0x%08x\n", res);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(rsp, 0, rsp_size);
|
||||||
|
res = nvme_security_receive(fd, 0, cdw10, cdw11, (void *)rsp, (uint32_t)rsp_size);
|
||||||
|
if (res || rsp->op_result != 0) {
|
||||||
|
EMSG("receive security cmd error with res = 0x%08x\n", res);
|
||||||
|
goto error_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_out:
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Open and/or return file descriptor to RPMB partition of device dev_id */
|
||||||
|
static int open_nvme_rpmb_fd(uint16_t dev_id)
|
||||||
|
{
|
||||||
|
static int id;
|
||||||
|
static int fd = -1;
|
||||||
|
char path[PATH_MAX] = { 0 };
|
||||||
|
|
||||||
|
DMSG("dev_id = %u", dev_id);
|
||||||
|
if (fd < 0) {
|
||||||
|
snprintf(path, sizeof(path), "/dev/nvme%u", dev_id);
|
||||||
|
fd = open(path, O_RDWR);
|
||||||
|
if (fd < 0) {
|
||||||
|
EMSG("Could not open %s (%s)", path, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
id = dev_id;
|
||||||
|
}
|
||||||
|
if (id != dev_id) {
|
||||||
|
EMSG("Only one NVMe device is supported");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Open NVMe device dev_id */
|
||||||
|
static int nvme_fd(uint16_t dev_id)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
char path[PATH_MAX] = { 0 };
|
||||||
|
|
||||||
|
IMSG("NVMe dev_id = %u", dev_id);
|
||||||
|
snprintf(path, sizeof(path), "/dev/nvme%u", dev_id);
|
||||||
|
fd = open(path, O_RDONLY);
|
||||||
|
if (fd < 0)
|
||||||
|
EMSG("Could not open %s\n", path);
|
||||||
|
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void close_nvme_fd(int fd)
|
||||||
|
{
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result nvme_rpmb_get_rpmbs_info(uint16_t dev_id, struct nvme_dev_info *info)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
struct nvme_identify_controller id;
|
||||||
|
|
||||||
|
memset(info, 0, sizeof(struct nvme_dev_info));
|
||||||
|
|
||||||
|
fd = nvme_fd(dev_id);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
res = nvme_identify_command(fd, &id);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
memcpy(info->sn, id.sn, NVME_DEV_SN_LENGTH);
|
||||||
|
info->rpmbs = id.rpmbs;
|
||||||
|
|
||||||
|
out:
|
||||||
|
close_nvme_fd(fd);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result nvme_rpmb_data_req(int fd,
|
||||||
|
struct nvme_rpmb_data_frame *req, size_t req_size,
|
||||||
|
struct nvme_rpmb_data_frame *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
TEEC_Result res;
|
||||||
|
|
||||||
|
switch (req->msg_type) {
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM:
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE:
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_AUTH_DCB_WRITE:
|
||||||
|
res = rpmb_write_request(fd, req, req_size, rsp, rsp_size);
|
||||||
|
break;
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_WRITE_COUNTER_READ:
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_AUTH_DATA_READ:
|
||||||
|
case NVME_RPMB_MSG_TYPE_REQ_AUTH_DCB_READ:
|
||||||
|
res = rpmb_read_request(fd, req, req_size, rsp, rsp_size);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
EMSG("command 0x%08x not support\n", req->msg_type);
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* req is one struct rpmb_req followed by one struct nvme_rpmb_data_frame
|
||||||
|
* rsp is either one struct nvme_dev_info or one nvme_rpmb_data_frame
|
||||||
|
*/
|
||||||
|
static TEEC_Result nvme_rpmb_process_request_unlocked(
|
||||||
|
void *req, size_t req_size,
|
||||||
|
void *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
uint32_t res = TEEC_ERROR_GENERIC;
|
||||||
|
struct nvme_rpmb_req *sreq = req;
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (req_size < sizeof(struct nvme_rpmb_req))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
switch (sreq->cmd) {
|
||||||
|
case NVME_RPMB_CMD_DATA_REQ:
|
||||||
|
/*
|
||||||
|
* To ensure only one device can be used, we will not close the device
|
||||||
|
* after it is opened.
|
||||||
|
*/
|
||||||
|
fd = open_nvme_rpmb_fd(sreq->dev_id);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
res = nvme_rpmb_data_req(fd, NVME_RPMB_REQ_DATA(req),
|
||||||
|
req_size - sizeof(struct nvme_rpmb_req), rsp, rsp_size);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NVME_RPMB_CMD_GET_RPMBS_INFO:
|
||||||
|
if (req_size != sizeof(struct nvme_rpmb_req) ||
|
||||||
|
rsp_size != sizeof(struct nvme_dev_info)) {
|
||||||
|
EMSG("Invalid req/rsp size");
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
res = nvme_rpmb_get_rpmbs_info(sreq->dev_id, (struct nvme_dev_info *)rsp);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
EMSG("Unsupported RPMB command: %d", sreq->cmd);
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEEC_Result nvme_rpmb_process_request(void *req, size_t req_size,
|
||||||
|
void *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
uint32_t res = 0;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&nvme_rpmb_mutex);
|
||||||
|
res = nvme_rpmb_process_request_unlocked(req, req_size, rsp, rsp_size);
|
||||||
|
tee_supp_mutex_unlock(&nvme_rpmb_mutex);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
16
optee/optee_client/tee-supplicant/src/nvme_rpmb.h
Normal file
16
optee/optee_client/tee-supplicant/src/nvme_rpmb.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NVME_RPMB_H
|
||||||
|
#define NVME_RPMB_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
uint32_t nvme_rpmb_process_request(void *req, size_t req_size, void *rsp,
|
||||||
|
size_t rsp_size);
|
||||||
|
|
||||||
|
#endif /* NVME_RPMB_H */
|
||||||
307
optee/optee_client/tee-supplicant/src/optee_msg_supplicant.h
Normal file
307
optee/optee_client/tee-supplicant/src/optee_msg_supplicant.h
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __OPTEE_MSG_SUPPLICANT_H
|
||||||
|
#define __OPTEE_MSG_SUPPLICANT_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Load a TA into memory
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_LOAD_TA 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Replay Protected Memory Block access
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_RPMB 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File system access
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_FS 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define protocol for messages with .cmd == OPTEE_MSG_RPC_CMD_FS and first
|
||||||
|
* parameter has the attribute OPTEE_MSG_ATTR_TYPE_VALUE_INPUT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_OPEN
|
||||||
|
* [in] param[1].u.tmem a string holding the file name
|
||||||
|
* [out] param[2].u.value.a file descriptor of open file
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_OPEN 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_CREATE
|
||||||
|
* [in] param[1].u.tmem a string holding the file name
|
||||||
|
* [out] param[2].u.value.a file descriptor of open file
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_CREATE 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Close a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_CLOSE
|
||||||
|
* [in] param[0].u.value.b file descriptor of open file.
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_CLOSE 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read from a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_READ
|
||||||
|
* [in] param[0].u.value.b file descriptor of open file
|
||||||
|
* [in] param[0].u.value.c offset into file
|
||||||
|
* [out] param[1].u.tmem buffer to hold returned data
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_READ 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write to a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_WRITE
|
||||||
|
* [in] param[0].u.value.b file descriptor of open file
|
||||||
|
* [in] param[0].u.value.c offset into file
|
||||||
|
* [in] param[1].u.tmem buffer holding data to be written
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_WRITE 4
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Truncate a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_TRUNCATE
|
||||||
|
* [in] param[0].u.value.b file descriptor of open file
|
||||||
|
* [in] param[0].u.value.c length of file.
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_TRUNCATE 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_REMOVE
|
||||||
|
* [in] param[1].u.tmem a string holding the file name
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_REMOVE 6
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rename a file
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_RENAME
|
||||||
|
* [in] param[0].u.value.b true if existing target should be removed
|
||||||
|
* [in] param[1].u.tmem a string holding the old file name
|
||||||
|
* [in] param[2].u.tmem a string holding the new file name
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_RENAME 7
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Opens a directory for file listing
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_OPENDIR
|
||||||
|
* [in] param[1].u.tmem a string holding the name of the directory
|
||||||
|
* [out] param[2].u.value.a handle to open directory
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_OPENDIR 8
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Closes a directory handle
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_CLOSEDIR
|
||||||
|
* [in] param[0].u.value.b handle to open directory
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_CLOSEDIR 9
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read next file name of directory
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRF_READDIR
|
||||||
|
* [in] param[0].u.value.b handle to open directory
|
||||||
|
* [out] param[1].u.tmem a string holding the file name
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRF_READDIR 10
|
||||||
|
|
||||||
|
/*
|
||||||
|
* End of definitions for messages with .cmd == OPTEE_MSG_RPC_CMD_FS
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Command Ids 3, 4 and 5 of OPTEE_MSG_RPC_CMD_xxx macros are reserved for use
|
||||||
|
* by the kernel driver.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Shared memory allocation
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_SHM_ALLOC 6
|
||||||
|
#define OPTEE_MSG_RPC_CMD_SHM_FREE 7
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Was OPTEE_MSG_RPC_CMD_SQL_FS, which isn't supported any longer
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_SQL_FS_RESERVED 8
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPROF support management commands
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_GPROF 9
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Socket commands
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_SOCKET 10
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function tracing support management commands
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_FTRACE 11
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Plugin commands
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_PLUGIN 12
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NVMe Replay Protected Memory Block access
|
||||||
|
*/
|
||||||
|
#define OPTEE_MSG_RPC_CMD_NVME_RPMB 13
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define protocol for messages with .cmd == OPTEE_MSG_RPC_CMD_SOCKET
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define OPTEE_MRC_SOCKET_TIMEOUT_NONBLOCKING 0
|
||||||
|
#define OPTEE_MRC_SOCKET_TIMEOUT_BLOCKING 0xffffffff
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open socket
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_OPEN
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
* [in] param[1].u.value.a server port number
|
||||||
|
* [in] param[1].u.value.b protocol, TEE_ISOCKET_PROTOCOLID_*
|
||||||
|
* [in] param[1].u.value.c ip version TEE_IP_VERSION_* from tee_ipsocket.h
|
||||||
|
* [in] param[2].u.tmem server address
|
||||||
|
* [out] param[3].u.value.a socket handle (32-bit)
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_OPEN 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Close socket
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_CLOSE
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
* [in] param[0].u.value.c socket handle
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_CLOSE 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Close all sockets
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_CLOSE_ALL
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_CLOSE_ALL 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send data on socket
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_SEND
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
* [in] param[0].u.value.c socket handle
|
||||||
|
* [in] param[1].u.tmem buffer to transmit
|
||||||
|
* [in] param[2].u.value.a timeout ms or OPTEE_MRC_SOCKET_TIMEOUT_*
|
||||||
|
* [out] param[2].u.value.b number of transmitted bytes
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_SEND 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receive data on socket
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_RECV
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
* [in] param[0].u.value.c socket handle
|
||||||
|
* [out] param[1].u.tmem buffer to receive
|
||||||
|
* [in] param[2].u.value.a timeout ms or OPTEE_MRC_SOCKET_TIMEOUT_*
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_RECV 4
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Perform IOCTL on socket
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_MRC_SOCKET_IOCTL
|
||||||
|
* [in] param[0].u.value.b TA instance id
|
||||||
|
* [in] param[0].u.value.c socket handle
|
||||||
|
* [in/out] param[1].u.tmem buffer
|
||||||
|
* [in] param[2].u.value.a ioctl command
|
||||||
|
*/
|
||||||
|
#define OPTEE_MRC_SOCKET_IOCTL 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
* End of definitions for messages with .cmd == OPTEE_MSG_RPC_CMD_SOCKET
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define protocol for messages with .cmd == OPTEE_MSG_RPC_CMD_PLUGIN
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Invoke a tee-supplicant plugin.
|
||||||
|
*
|
||||||
|
* [in] param[0].u.value.a OPTEE_INVOKE_PLUGIN
|
||||||
|
* [in] param[0].u.value.b uuid.d1
|
||||||
|
* [in] param[0].u.value.c uuid.d2
|
||||||
|
* [in] param[1].u.value.a uuid.d3
|
||||||
|
* [in] param[1].u.value.b uuid.d4
|
||||||
|
* [in] param[1].u.value.c cmd for plugin
|
||||||
|
* [in] param[2].u.value.a sub_cmd for plugin
|
||||||
|
* [out] param[2].u.value.b length of the outbuf (param[3]),
|
||||||
|
* if out is needed.
|
||||||
|
* [in/out] param[3].u.tmem buffer holding data for plugin
|
||||||
|
*
|
||||||
|
* UUID serialized into octets:
|
||||||
|
* b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
|
||||||
|
* d1 | d2 | d3 | d4
|
||||||
|
*
|
||||||
|
* The endianness of words d1, d2, d3 and d4 from SWd is little-endian.
|
||||||
|
* d1 word contains [b3 b2 b1 b0]
|
||||||
|
* d2 word contains [b7 b6 b5 b4]
|
||||||
|
* d3 word contains [b11 b10 b9 b8]
|
||||||
|
* d4 word contains [b15 b14 b13 b12]
|
||||||
|
*/
|
||||||
|
#define OPTEE_INVOKE_PLUGIN 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* End of definitions for messages with .cmd == OPTEE_MSG_RPC_CMD_PLUGIN
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /*__OPTEE_MSG_SUPPLICANT_H*/
|
||||||
233
optee/optee_client/tee-supplicant/src/plugin.c
Normal file
233
optee/optee_client/tee-supplicant/src/plugin.c
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Open Mobile Platform LLC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <plugin.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
|
||||||
|
#include "optee_msg_supplicant.h"
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
/* internal possible returned values */
|
||||||
|
enum plugin_err {
|
||||||
|
PLUGIN_OK = 0,
|
||||||
|
PLUGIN_DL_OPEN_ERR = -1,
|
||||||
|
PLUGIN_DL_SYM_ERR = -2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct plugin *plugin_list_head;
|
||||||
|
|
||||||
|
/* returns 0, if u1 and u2 are equal */
|
||||||
|
static int uuid_cmp(TEEC_UUID *u1, TEEC_UUID *u2)
|
||||||
|
{
|
||||||
|
if (!memcmp(u1, u2, sizeof(TEEC_UUID)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void uuid_from_octets(TEEC_UUID *d, const uint8_t s[TEE_IOCTL_UUID_LEN])
|
||||||
|
{
|
||||||
|
d->timeLow = ((uint32_t)s[0] << 24) | ((uint32_t)s[1] << 16) |
|
||||||
|
((uint32_t)s[2] << 8) | s[3];
|
||||||
|
d->timeMid = ((uint32_t)s[4] << 8) | s[5];
|
||||||
|
d->timeHiAndVersion = ((uint32_t)s[6] << 8) | s[7];
|
||||||
|
memcpy(d->clockSeqAndNode, s + 8, sizeof(d->clockSeqAndNode));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void push_plugin(struct plugin *p)
|
||||||
|
{
|
||||||
|
p->next = plugin_list_head;
|
||||||
|
plugin_list_head = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct plugin *find_plugin(TEEC_UUID *u)
|
||||||
|
{
|
||||||
|
struct plugin *p = plugin_list_head;
|
||||||
|
|
||||||
|
while (p) {
|
||||||
|
if (!uuid_cmp(&p->method->uuid, u))
|
||||||
|
return p;
|
||||||
|
|
||||||
|
p = p->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum plugin_err load_plugin(const char *name, struct plugin *p)
|
||||||
|
{
|
||||||
|
void *handle = NULL;
|
||||||
|
struct plugin_method *m = NULL;
|
||||||
|
|
||||||
|
handle = dlopen(name, RTLD_LAZY);
|
||||||
|
if (!handle)
|
||||||
|
return PLUGIN_DL_OPEN_ERR;
|
||||||
|
|
||||||
|
m = (struct plugin_method *)dlsym(handle, "plugin_method");
|
||||||
|
if (!m || !m->name || !m->invoke) {
|
||||||
|
dlclose(handle);
|
||||||
|
return PLUGIN_DL_SYM_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
p->handle = handle;
|
||||||
|
p->method = m;
|
||||||
|
|
||||||
|
return PLUGIN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result plugin_invoke(TEEC_UUID *u, unsigned int cmd,
|
||||||
|
unsigned int sub_cmd, void *data,
|
||||||
|
size_t in_len, size_t *out_len)
|
||||||
|
{
|
||||||
|
struct plugin *p = NULL;
|
||||||
|
|
||||||
|
p = find_plugin(u);
|
||||||
|
if (!p)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
|
||||||
|
assert(p->method->invoke);
|
||||||
|
|
||||||
|
return p->method->invoke(cmd, sub_cmd, data, in_len, out_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result plugin_load_all(void)
|
||||||
|
{
|
||||||
|
DIR *dir = NULL;
|
||||||
|
enum plugin_err res = PLUGIN_OK;
|
||||||
|
TEEC_Result teec_res = TEEC_SUCCESS;
|
||||||
|
struct dirent *entry = NULL;
|
||||||
|
char path[PATH_MAX] = { 0 };
|
||||||
|
|
||||||
|
dir = opendir(supplicant_params.plugin_load_path);
|
||||||
|
|
||||||
|
if (!dir) {
|
||||||
|
IMSG("could not open directory %s", supplicant_params.plugin_load_path);
|
||||||
|
|
||||||
|
/* don't generate error if there is no the dir */
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((entry = readdir(dir))) {
|
||||||
|
struct plugin *p;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
if (!strcmp(entry->d_name, "..") || !strcmp(entry->d_name, "."))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
p = calloc(1, sizeof(struct plugin));
|
||||||
|
if (!p) {
|
||||||
|
EMSG("allocate mem for plugin <%s> failed",
|
||||||
|
entry->d_name);
|
||||||
|
closedir(dir);
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
r = snprintf(path, sizeof(path), "%s/%s",
|
||||||
|
supplicant_params.plugin_load_path, entry->d_name);
|
||||||
|
if (r < 0 || r >= (int)sizeof(path)) {
|
||||||
|
EMSG("assemble of full path for plugin <%s> failed",
|
||||||
|
entry->d_name);
|
||||||
|
closedir(dir);
|
||||||
|
return TEEC_ERROR_GENERIC ;
|
||||||
|
}
|
||||||
|
res = load_plugin(path, p);
|
||||||
|
switch (res) {
|
||||||
|
case PLUGIN_DL_OPEN_ERR:
|
||||||
|
EMSG("open plugin <%s> failed: %s",
|
||||||
|
entry->d_name, dlerror());
|
||||||
|
free(p);
|
||||||
|
continue;
|
||||||
|
case PLUGIN_DL_SYM_ERR:
|
||||||
|
EMSG("find 'plugin_method' sym in <%s> failed: %s",
|
||||||
|
entry->d_name, dlerror());
|
||||||
|
free(p);
|
||||||
|
continue;
|
||||||
|
default:
|
||||||
|
DMSG("loading the <%s> plugin were successful",
|
||||||
|
p->method->name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Init the plugin */
|
||||||
|
if (p->method->init) {
|
||||||
|
teec_res = p->method->init();
|
||||||
|
if (teec_res) {
|
||||||
|
EMSG("init the <%s> plugin failed with 0x%x",
|
||||||
|
p->method->name, teec_res);
|
||||||
|
free(p);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
push_plugin(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result plugin_process(size_t num_params, struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
unsigned int cmd = 0;
|
||||||
|
unsigned int sub_cmd = 0;
|
||||||
|
void *data = NULL;
|
||||||
|
uint32_t data_len = 0;
|
||||||
|
TEEC_UUID uuid = { };
|
||||||
|
uint32_t uuid_words[4] = { };
|
||||||
|
size_t outlen = 0;
|
||||||
|
TEEC_Result res = TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
|
||||||
|
if (num_params != 4 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT ||
|
||||||
|
(params[3].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
uuid_words[0] = params[0].b;
|
||||||
|
uuid_words[1] = params[0].c;
|
||||||
|
uuid_words[2] = params[1].a;
|
||||||
|
uuid_words[3] = params[1].b;
|
||||||
|
|
||||||
|
uuid_from_octets(&uuid, (const uint8_t *)uuid_words);
|
||||||
|
|
||||||
|
cmd = params[1].c;
|
||||||
|
sub_cmd = params[2].a;
|
||||||
|
|
||||||
|
data = tee_supp_param_to_va(params + 3);
|
||||||
|
data_len = MEMREF_SIZE(params + 3);
|
||||||
|
|
||||||
|
if (data_len && !data)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
switch (params[0].a) {
|
||||||
|
case OPTEE_INVOKE_PLUGIN:
|
||||||
|
res = plugin_invoke(&uuid, cmd, sub_cmd, data, data_len,
|
||||||
|
&outlen);
|
||||||
|
params[2].b = outlen;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
50
optee/optee_client/tee-supplicant/src/plugin.h
Normal file
50
optee/optee_client/tee-supplicant/src/plugin.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Open Mobile Platform LLC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PLUGIN_H
|
||||||
|
#define PLUGIN_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <tee_plugin_method.h>
|
||||||
|
|
||||||
|
struct tee_ioctl_param;
|
||||||
|
|
||||||
|
/* This structure describes one plugin for the supplicant */
|
||||||
|
struct plugin {
|
||||||
|
void *handle;
|
||||||
|
struct plugin_method *method; /* Implemented in the plugin */
|
||||||
|
struct plugin *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef TEE_SUPP_PLUGINS
|
||||||
|
/*
|
||||||
|
* Loads all shared objects from 'CFG_TEE_PLUGIN_LOAD_PATH'
|
||||||
|
* and binds all functions.
|
||||||
|
*
|
||||||
|
* @return 'TEEC_SUCCESS' if all plugins were successfully loaded.
|
||||||
|
*/
|
||||||
|
TEEC_Result plugin_load_all(void);
|
||||||
|
|
||||||
|
/* Plugin RPC handler */
|
||||||
|
TEEC_Result plugin_process(size_t num_params, struct tee_ioctl_param *params);
|
||||||
|
#else
|
||||||
|
static inline TEEC_Result plugin_load_all(void)
|
||||||
|
{
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline TEEC_Result plugin_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
(void)num_params;
|
||||||
|
(void)params;
|
||||||
|
|
||||||
|
return TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
#endif /*TEE_SUPP_PLUGINS*/
|
||||||
|
|
||||||
|
#endif /* PLUGIN_H */
|
||||||
|
|
||||||
137
optee/optee_client/tee-supplicant/src/prof.c
Normal file
137
optee/optee_client/tee-supplicant/src/prof.c
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include "prof.h"
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
TEEC_Result prof_process(size_t num_params, struct tee_ioctl_param *params,
|
||||||
|
const char *prefix)
|
||||||
|
{
|
||||||
|
char vers[5] = "";
|
||||||
|
char path[255] = { 0 };
|
||||||
|
size_t bufsize = 0;
|
||||||
|
TEEC_UUID *u = NULL;
|
||||||
|
int fd = -1;
|
||||||
|
void *buf = NULL;
|
||||||
|
int flags = 0;
|
||||||
|
int id = 0;
|
||||||
|
int st = 0;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
id = params[0].a;
|
||||||
|
|
||||||
|
if (MEMREF_SIZE(params + 1) != sizeof(TEEC_UUID))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
u = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!u)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 2);
|
||||||
|
if (!buf)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
bufsize = MEMREF_SIZE(params + 2);
|
||||||
|
|
||||||
|
if (id < 0 || id > 100)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
flags = O_APPEND | O_WRONLY;
|
||||||
|
if (!id) {
|
||||||
|
/* id == 0 means create file */
|
||||||
|
flags |= O_CREAT | O_EXCL;
|
||||||
|
id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (id > 1) {
|
||||||
|
/*
|
||||||
|
* id == 1 is file 0 (no suffix), id == 2 is file .1
|
||||||
|
* etc.
|
||||||
|
*/
|
||||||
|
if (id > 100)
|
||||||
|
id = 100; /* Avoid GCC truncation warning */
|
||||||
|
snprintf(vers, sizeof(vers), ".%d", id - 1);
|
||||||
|
}
|
||||||
|
n = snprintf(path, sizeof(path),
|
||||||
|
"/tmp/%s"
|
||||||
|
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
|
||||||
|
"%s.out",
|
||||||
|
prefix,
|
||||||
|
u->timeLow, u->timeMid, u->timeHiAndVersion,
|
||||||
|
u->clockSeqAndNode[0], u->clockSeqAndNode[1],
|
||||||
|
u->clockSeqAndNode[2], u->clockSeqAndNode[3],
|
||||||
|
u->clockSeqAndNode[4], u->clockSeqAndNode[5],
|
||||||
|
u->clockSeqAndNode[6], u->clockSeqAndNode[7],
|
||||||
|
vers);
|
||||||
|
if ((n < 0) || (n >= (int)sizeof(path)))
|
||||||
|
break;
|
||||||
|
fd = open(path, flags, 0644);
|
||||||
|
if (fd >= 0) {
|
||||||
|
do {
|
||||||
|
st = write(fd, buf, bufsize);
|
||||||
|
} while (st < 0 && errno == EINTR);
|
||||||
|
close(fd);
|
||||||
|
if (st < 0 || st != (int)bufsize)
|
||||||
|
break;
|
||||||
|
params[0].a = id;
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
if (errno != EEXIST)
|
||||||
|
break;
|
||||||
|
if (id++ == 100)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* An error occurred */
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
|
||||||
|
success:
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
54
optee/optee_client/tee-supplicant/src/prof.h
Normal file
54
optee/optee_client/tee-supplicant/src/prof.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PROF_H
|
||||||
|
#define PROF_H
|
||||||
|
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
struct tee_ioctl_param;
|
||||||
|
|
||||||
|
#if defined(CFG_TA_GPROF_SUPPORT) || defined(CFG_FTRACE_SUPPORT)
|
||||||
|
|
||||||
|
TEEC_Result prof_process(size_t num_params, struct tee_ioctl_param *params,
|
||||||
|
const char *prefix);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline TEEC_Result prof_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params,
|
||||||
|
const char *prefix)
|
||||||
|
{
|
||||||
|
(void)num_params;
|
||||||
|
(void)params;
|
||||||
|
(void)prefix;
|
||||||
|
|
||||||
|
return TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CFG_TA_GPROF_SUPPORT || CFG_FTRACE_SUPPORT */
|
||||||
|
#endif /* PROF_H */
|
||||||
989
optee/optee_client/tee-supplicant/src/rpmb.c
Normal file
989
optee/optee_client/tee-supplicant/src/rpmb.c
Normal file
@@ -0,0 +1,989 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/mmc/ioctl.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <rpmb.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifdef RPMB_EMU
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include "hmac_sha2.h"
|
||||||
|
#else
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request and response definitions must be in sync with the secure side
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Request */
|
||||||
|
struct rpmb_req {
|
||||||
|
uint16_t cmd;
|
||||||
|
#define RPMB_CMD_DATA_REQ 0x00
|
||||||
|
#define RPMB_CMD_GET_DEV_INFO 0x01
|
||||||
|
uint16_t dev_id;
|
||||||
|
uint16_t block_count;
|
||||||
|
/* Optional data frames (rpmb_data_frame) follow */
|
||||||
|
};
|
||||||
|
#define RPMB_REQ_DATA(req) ((void *)((struct rpmb_req *)(req) + 1))
|
||||||
|
|
||||||
|
#define RPMB_CID_SZ 16
|
||||||
|
|
||||||
|
/* Response to device info request */
|
||||||
|
struct rpmb_dev_info {
|
||||||
|
uint8_t cid[RPMB_CID_SZ];
|
||||||
|
uint8_t rpmb_size_mult; /* EXT CSD-slice 168: RPMB Size */
|
||||||
|
uint8_t rel_wr_sec_c; /* EXT CSD-slice 222: Reliable Write Sector */
|
||||||
|
/* Count */
|
||||||
|
uint8_t ret_code;
|
||||||
|
#define RPMB_CMD_GET_DEV_INFO_RET_OK 0x00
|
||||||
|
#define RPMB_CMD_GET_DEV_INFO_RET_ERROR 0x01
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This structure is shared with OP-TEE and the MMC ioctl layer.
|
||||||
|
* It is the "data frame for RPMB access" defined by JEDEC, minus the
|
||||||
|
* start and stop bits.
|
||||||
|
*/
|
||||||
|
struct rpmb_data_frame {
|
||||||
|
uint8_t stuff_bytes[196];
|
||||||
|
uint8_t key_mac[32];
|
||||||
|
uint8_t data[256];
|
||||||
|
uint8_t nonce[16];
|
||||||
|
uint32_t write_counter;
|
||||||
|
uint16_t address;
|
||||||
|
uint16_t block_count;
|
||||||
|
uint16_t op_result;
|
||||||
|
#define RPMB_RESULT_OK 0x00
|
||||||
|
#define RPMB_RESULT_GENERAL_FAILURE 0x01
|
||||||
|
#define RPMB_RESULT_AUTH_FAILURE 0x02
|
||||||
|
#define RPMB_RESULT_ADDRESS_FAILURE 0x04
|
||||||
|
#define RPMB_RESULT_AUTH_KEY_NOT_PROGRAMMED 0x07
|
||||||
|
uint16_t msg_type;
|
||||||
|
#define RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM 0x0001
|
||||||
|
#define RPMB_MSG_TYPE_REQ_WRITE_COUNTER_VAL_READ 0x0002
|
||||||
|
#define RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE 0x0003
|
||||||
|
#define RPMB_MSG_TYPE_REQ_AUTH_DATA_READ 0x0004
|
||||||
|
#define RPMB_MSG_TYPE_REQ_RESULT_READ 0x0005
|
||||||
|
#define RPMB_MSG_TYPE_RESP_AUTH_KEY_PROGRAM 0x0100
|
||||||
|
#define RPMB_MSG_TYPE_RESP_WRITE_COUNTER_VAL_READ 0x0200
|
||||||
|
#define RPMB_MSG_TYPE_RESP_AUTH_DATA_WRITE 0x0300
|
||||||
|
#define RPMB_MSG_TYPE_RESP_AUTH_DATA_READ 0x0400
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static pthread_mutex_t rpmb_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ioctl() interface
|
||||||
|
* Comes from: uapi/linux/major.h, linux/mmc/core.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MMC_BLOCK_MAJOR 179
|
||||||
|
|
||||||
|
/* mmc_ioc_cmd.opcode */
|
||||||
|
#define MMC_READ_MULTIPLE_BLOCK 18
|
||||||
|
#define MMC_WRITE_MULTIPLE_BLOCK 25
|
||||||
|
|
||||||
|
/* mmc_ioc_cmd.flags */
|
||||||
|
#define MMC_RSP_PRESENT (1 << 0)
|
||||||
|
#define MMC_RSP_136 (1 << 1) /* 136 bit response */
|
||||||
|
#define MMC_RSP_CRC (1 << 2) /* Expect valid CRC */
|
||||||
|
#define MMC_RSP_OPCODE (1 << 4) /* Response contains opcode */
|
||||||
|
|
||||||
|
#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
|
||||||
|
|
||||||
|
#define MMC_CMD_ADTC (1 << 5) /* Addressed data transfer command */
|
||||||
|
|
||||||
|
/* mmc_ioc_cmd.write_flag */
|
||||||
|
#define MMC_CMD23_ARG_REL_WR (1 << 31) /* CMD23 reliable write */
|
||||||
|
|
||||||
|
/* Maximum number of commands used in a multiple ioc command request */
|
||||||
|
#define RPMB_MAX_IOC_MULTI_CMDS 3
|
||||||
|
|
||||||
|
#ifndef RPMB_EMU
|
||||||
|
|
||||||
|
#define IOCTL(fd, request, ...) \
|
||||||
|
({ \
|
||||||
|
int ret; \
|
||||||
|
ret = ioctl((fd), (request), ##__VA_ARGS__); \
|
||||||
|
if (ret < 0) \
|
||||||
|
EMSG("ioctl ret=%d errno=%d", ret, errno); \
|
||||||
|
ret; \
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/* Open and/or return file descriptor to RPMB partition of device dev_id */
|
||||||
|
static int mmc_rpmb_fd(uint16_t dev_id)
|
||||||
|
{
|
||||||
|
static int id;
|
||||||
|
static int fd = -1;
|
||||||
|
char path[PATH_MAX] = { 0 };
|
||||||
|
|
||||||
|
DMSG("dev_id = %u", dev_id);
|
||||||
|
if (fd < 0) {
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
snprintf(path, sizeof(path), "/dev/mmcblk%urpmb", dev_id);
|
||||||
|
#else
|
||||||
|
snprintf(path, sizeof(path), "/dev/mmcblk%urpmb", dev_id);
|
||||||
|
#endif
|
||||||
|
fd = open(path, O_RDWR);
|
||||||
|
if (fd < 0) {
|
||||||
|
EMSG("Could not open %s (%s)", path, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
id = dev_id;
|
||||||
|
}
|
||||||
|
if (id != dev_id) {
|
||||||
|
EMSG("Only one MMC device is supported");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read @n bytes from @fd, takes care of short reads and EINTR.
|
||||||
|
* Adapted from “Advanced Programming In the UNIX Environment” by W. Richard
|
||||||
|
* Stevens and Stephen A. Rago, 2013, 3rd Edition, Addison-Wesley
|
||||||
|
* (EINTR handling was added)
|
||||||
|
*/
|
||||||
|
static ssize_t readn(int fd, void *ptr, size_t n)
|
||||||
|
{
|
||||||
|
size_t nleft = n;
|
||||||
|
ssize_t nread = 0;
|
||||||
|
uint8_t *p = ptr;
|
||||||
|
|
||||||
|
while (nleft > 0) {
|
||||||
|
if ((nread = read(fd, p, nleft)) < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
if (nleft == n)
|
||||||
|
return -1; /* error, nothing read, return -1 */
|
||||||
|
else
|
||||||
|
break; /* error, return amount read so far */
|
||||||
|
} else if (nread == 0) {
|
||||||
|
break; /* EOF */
|
||||||
|
}
|
||||||
|
nleft -= nread;
|
||||||
|
p += nread;
|
||||||
|
}
|
||||||
|
return n - nleft; /* return >= 0 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Size of CID printed in hexadecimal */
|
||||||
|
#define CID_STR_SZ (2 * RPMB_CID_SZ)
|
||||||
|
|
||||||
|
static TEEC_Result read_cid_str(uint16_t dev_id, char cid[CID_STR_SZ + 1])
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
char path[48] = { 0 };
|
||||||
|
int fd = 0;
|
||||||
|
int st = 0;
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path),
|
||||||
|
"/sys/class/mmc_host/mmc%u/mmc%u:0001/cid", dev_id, dev_id);
|
||||||
|
fd = open(path, O_RDONLY);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
st = readn(fd, cid, CID_STR_SZ);
|
||||||
|
if (st != CID_STR_SZ) {
|
||||||
|
EMSG("Read CID error");
|
||||||
|
if (errno)
|
||||||
|
EMSG("%s", strerror(errno));
|
||||||
|
res = TEEC_ERROR_NO_DATA;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
res = TEEC_SUCCESS;
|
||||||
|
out:
|
||||||
|
close(fd);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int hexchar2int(char c)
|
||||||
|
{
|
||||||
|
if (c >= '0' && c <= '9')
|
||||||
|
return c - '0';
|
||||||
|
if (c >= 'a' && c <= 'f')
|
||||||
|
return c - 'a' + 10;
|
||||||
|
if (c >= 'A' && c <= 'F')
|
||||||
|
return c - 'A' + 10;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int hexbyte2int(char *hex)
|
||||||
|
{
|
||||||
|
int v1 = hexchar2int(hex[0]);
|
||||||
|
int v2 = hexchar2int(hex[1]);
|
||||||
|
|
||||||
|
if (v1 < 0 || v2 < 0)
|
||||||
|
return -1;
|
||||||
|
return 16 * v1 + v2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Device Identification (CID) register is 16 bytes. It is read from sysfs. */
|
||||||
|
static TEEC_Result read_cid(uint16_t dev_id, uint8_t *cid)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
char cid_str[CID_STR_SZ + 1] = { };
|
||||||
|
int i = 0;
|
||||||
|
int v = 0;
|
||||||
|
|
||||||
|
res = read_cid_str(dev_id, cid_str);
|
||||||
|
if (res)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
for (i = 0; i < RPMB_CID_SZ; i++) {
|
||||||
|
v = hexbyte2int(cid_str + 2 * i);
|
||||||
|
if (v < 0) {
|
||||||
|
EMSG("Invalid CID string: %s", cid_str);
|
||||||
|
return TEEC_ERROR_NO_DATA;
|
||||||
|
}
|
||||||
|
cid[i] = v;
|
||||||
|
}
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_mmc_sysfs_hex(uint16_t dev_id, const char *file, uint8_t *value)
|
||||||
|
{
|
||||||
|
TEEC_Result status = TEEC_SUCCESS;
|
||||||
|
char path[255] = { 0 };
|
||||||
|
char buf[255] = { 0 };
|
||||||
|
char *endp = buf;
|
||||||
|
int fd = 0;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path), "/sys/class/mmc_host/mmc%u/mmc%u:0001/%s",
|
||||||
|
dev_id, dev_id, file);
|
||||||
|
|
||||||
|
fd = open(path, O_RDONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
EMSG("Could not open %s (%s)", path, strerror(errno));
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = readn(fd, buf, sizeof(buf));
|
||||||
|
if (ret < 0) {
|
||||||
|
EMSG("Read error (%s)", strerror(errno));
|
||||||
|
status = TEEC_ERROR_NO_DATA;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
*value = strtol(buf, &endp, 16);
|
||||||
|
if (errno || endp == buf)
|
||||||
|
status = TEEC_ERROR_GENERIC;
|
||||||
|
|
||||||
|
out:
|
||||||
|
close(fd);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_size_mult(uint16_t dev_id, uint8_t *value)
|
||||||
|
{
|
||||||
|
return read_mmc_sysfs_hex(dev_id, "raw_rpmb_size_mult", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_rel_wr_sec_c(uint16_t dev_id, uint8_t *value)
|
||||||
|
{
|
||||||
|
return read_mmc_sysfs_hex(dev_id, "rel_sectors", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* - If --rpmb-cid is given, find the eMMC RPMB device number with the specified
|
||||||
|
* CID, cache the number, copy it to @ndev_id and return true. If not found
|
||||||
|
* return false.
|
||||||
|
* - If --rpmb-cid is not given, copy @dev_id to @ndev_id and return true.
|
||||||
|
*/
|
||||||
|
static bool remap_rpmb_dev_id(uint16_t dev_id, uint16_t *ndev_id)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
static bool found = false;
|
||||||
|
static bool err = false;
|
||||||
|
static uint16_t id = 0;
|
||||||
|
char cid[CID_STR_SZ + 1] = { };
|
||||||
|
struct dirent *dent = NULL;
|
||||||
|
DIR *dir = NULL;
|
||||||
|
int num = 0;
|
||||||
|
|
||||||
|
if (err || found)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (!supplicant_params.rpmb_cid) {
|
||||||
|
id = dev_id;
|
||||||
|
found = true;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
dir = opendir("/sys/class/mmc_host");
|
||||||
|
if (!dir) {
|
||||||
|
EMSG("Could not open /sys/class/mmc_host (%s)",
|
||||||
|
strerror(errno));
|
||||||
|
err = true;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((dent = readdir(dir))) {
|
||||||
|
if (sscanf(dent->d_name, "%*[^0123456789]%d", &num) != 1)
|
||||||
|
continue;
|
||||||
|
if (num > UINT16_MAX) {
|
||||||
|
EMSG("Too many MMC devices");
|
||||||
|
err = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
id = (uint16_t)num;
|
||||||
|
res = read_cid_str(id, cid);
|
||||||
|
if (res)
|
||||||
|
continue;
|
||||||
|
if (strcmp(cid, supplicant_params.rpmb_cid))
|
||||||
|
continue;
|
||||||
|
IMSG("RPMB device %s is at /dev/mmcblk%urpmb\n", cid, id);
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
err = true;
|
||||||
|
out:
|
||||||
|
if (found)
|
||||||
|
*ndev_id = id;
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* RPMB_EMU */
|
||||||
|
|
||||||
|
#define IOCTL(fd, request, ...) ioctl_emu((fd), (request), ##__VA_ARGS__)
|
||||||
|
|
||||||
|
/* Emulated rel_wr_sec_c value (reliable write size, *256 bytes) */
|
||||||
|
#define EMU_RPMB_REL_WR_SEC_C 1
|
||||||
|
/* Emulated rpmb_size_mult value (RPMB size, *128 kB) */
|
||||||
|
#define EMU_RPMB_SIZE_MULT 2
|
||||||
|
|
||||||
|
#define EMU_RPMB_SIZE_BYTES (EMU_RPMB_SIZE_MULT * 128 * 1024)
|
||||||
|
|
||||||
|
/* Emulated eMMC device state */
|
||||||
|
struct rpmb_emu {
|
||||||
|
uint8_t buf[EMU_RPMB_SIZE_BYTES];
|
||||||
|
size_t size;
|
||||||
|
uint8_t key[32];
|
||||||
|
bool key_set;
|
||||||
|
uint8_t nonce[16];
|
||||||
|
uint32_t write_counter;
|
||||||
|
struct {
|
||||||
|
uint16_t msg_type;
|
||||||
|
uint16_t op_result;
|
||||||
|
uint16_t address;
|
||||||
|
} last_op;
|
||||||
|
};
|
||||||
|
static struct rpmb_emu rpmb_emu = {
|
||||||
|
.size = EMU_RPMB_SIZE_BYTES
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct rpmb_emu *mem_for_fd(int fd)
|
||||||
|
{
|
||||||
|
static int sfd = -1;
|
||||||
|
|
||||||
|
if (sfd == -1)
|
||||||
|
sfd = fd;
|
||||||
|
if (sfd != fd) {
|
||||||
|
EMSG("Emulating more than 1 RPMB partition is not supported");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return &rpmb_emu;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (DEBUGLEVEL >= TRACE_FLOW)
|
||||||
|
static void dump_blocks(size_t startblk, size_t numblk, uint8_t *ptr,
|
||||||
|
bool to_mmc)
|
||||||
|
{
|
||||||
|
char msg[100] = { 0 };
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < numblk; i++) {
|
||||||
|
snprintf(msg, sizeof(msg), "%s MMC block %zu",
|
||||||
|
to_mmc ? "Write" : "Read", startblk + i);
|
||||||
|
dump_buffer(msg, ptr, 256);
|
||||||
|
ptr += 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void dump_blocks(size_t startblk, size_t numblk, uint8_t *ptr,
|
||||||
|
bool to_mmc)
|
||||||
|
{
|
||||||
|
(void)startblk;
|
||||||
|
(void)numblk;
|
||||||
|
(void)ptr;
|
||||||
|
(void)to_mmc;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CUC(x) ((const unsigned char *)(x))
|
||||||
|
static void hmac_update_frm(hmac_sha256_ctx *ctx, struct rpmb_data_frame *frm)
|
||||||
|
{
|
||||||
|
hmac_sha256_update(ctx, CUC(frm->data), 256);
|
||||||
|
hmac_sha256_update(ctx, CUC(frm->nonce), 16);
|
||||||
|
hmac_sha256_update(ctx, CUC(&frm->write_counter), 4);
|
||||||
|
hmac_sha256_update(ctx, CUC(&frm->address), 2);
|
||||||
|
hmac_sha256_update(ctx, CUC(&frm->block_count), 2);
|
||||||
|
hmac_sha256_update(ctx, CUC(&frm->op_result), 2);
|
||||||
|
hmac_sha256_update(ctx, CUC(&frm->msg_type), 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool is_hmac_valid(struct rpmb_emu *mem, struct rpmb_data_frame *frm,
|
||||||
|
size_t nfrm)
|
||||||
|
{
|
||||||
|
uint8_t mac[32] = { 0 };
|
||||||
|
size_t i = 0;
|
||||||
|
hmac_sha256_ctx ctx;
|
||||||
|
|
||||||
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
|
|
||||||
|
if (!mem->key_set) {
|
||||||
|
EMSG("Cannot check MAC (key not set)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
hmac_sha256_init(&ctx, mem->key, sizeof(mem->key));
|
||||||
|
for (i = 0; i < nfrm; i++, frm++)
|
||||||
|
hmac_update_frm(&ctx, frm);
|
||||||
|
frm--;
|
||||||
|
hmac_sha256_final(&ctx, mac, 32);
|
||||||
|
|
||||||
|
if (memcmp(mac, frm->key_mac, 32)) {
|
||||||
|
EMSG("Invalid MAC");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t gen_msb1st_result(uint8_t byte)
|
||||||
|
{
|
||||||
|
return (uint16_t)byte << 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t compute_hmac(struct rpmb_emu *mem, struct rpmb_data_frame *frm,
|
||||||
|
size_t nfrm)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
hmac_sha256_ctx ctx;
|
||||||
|
|
||||||
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
|
|
||||||
|
if (!mem->key_set) {
|
||||||
|
EMSG("Cannot compute MAC (key not set)");
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_AUTH_KEY_NOT_PROGRAMMED);
|
||||||
|
}
|
||||||
|
|
||||||
|
hmac_sha256_init(&ctx, mem->key, sizeof(mem->key));
|
||||||
|
for (i = 0; i < nfrm; i++, frm++)
|
||||||
|
hmac_update_frm(&ctx, frm);
|
||||||
|
frm--;
|
||||||
|
hmac_sha256_final(&ctx, frm->key_mac, 32);
|
||||||
|
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t ioctl_emu_mem_transfer(struct rpmb_emu *mem,
|
||||||
|
struct rpmb_data_frame *frm,
|
||||||
|
size_t nfrm, int to_mmc)
|
||||||
|
{
|
||||||
|
size_t start = mem->last_op.address * 256;
|
||||||
|
size_t size = nfrm * 256;
|
||||||
|
size_t i = 0;
|
||||||
|
uint8_t *memptr = NULL;
|
||||||
|
|
||||||
|
if (start > mem->size || start + size > mem->size) {
|
||||||
|
EMSG("Transfer bounds exceeed emulated memory");
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_ADDRESS_FAILURE);
|
||||||
|
}
|
||||||
|
if (to_mmc && !is_hmac_valid(mem, frm, nfrm))
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_AUTH_FAILURE);
|
||||||
|
|
||||||
|
DMSG("Transferring %zu 256-byte data block%s %s MMC (block offset=%zu)",
|
||||||
|
nfrm, (nfrm > 1) ? "s" : "", to_mmc ? "to" : "from", start / 256);
|
||||||
|
for (i = 0; i < nfrm; i++) {
|
||||||
|
memptr = mem->buf + start + i * 256;
|
||||||
|
if (to_mmc) {
|
||||||
|
memcpy(memptr, frm[i].data, 256);
|
||||||
|
mem->write_counter++;
|
||||||
|
frm[i].write_counter = htonl(mem->write_counter);
|
||||||
|
frm[i].msg_type =
|
||||||
|
htons(RPMB_MSG_TYPE_RESP_AUTH_DATA_WRITE);
|
||||||
|
} else {
|
||||||
|
memcpy(frm[i].data, memptr, 256);
|
||||||
|
frm[i].msg_type =
|
||||||
|
htons(RPMB_MSG_TYPE_RESP_AUTH_DATA_READ);
|
||||||
|
frm[i].address = htons(mem->last_op.address);
|
||||||
|
frm[i].block_count = nfrm;
|
||||||
|
memcpy(frm[i].nonce, mem->nonce, 16);
|
||||||
|
}
|
||||||
|
frm[i].op_result = gen_msb1st_result(RPMB_RESULT_OK);
|
||||||
|
}
|
||||||
|
dump_blocks(mem->last_op.address, nfrm, mem->buf + start, to_mmc);
|
||||||
|
|
||||||
|
if (!to_mmc)
|
||||||
|
compute_hmac(mem, frm, nfrm);
|
||||||
|
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ioctl_emu_get_write_result(struct rpmb_emu *mem,
|
||||||
|
struct rpmb_data_frame *frm)
|
||||||
|
{
|
||||||
|
frm->msg_type = htons(RPMB_MSG_TYPE_RESP_AUTH_DATA_WRITE);
|
||||||
|
frm->op_result = mem->last_op.op_result;
|
||||||
|
frm->address = htons(mem->last_op.address);
|
||||||
|
frm->write_counter = htonl(mem->write_counter);
|
||||||
|
compute_hmac(mem, frm, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t ioctl_emu_setkey(struct rpmb_emu *mem,
|
||||||
|
struct rpmb_data_frame *frm)
|
||||||
|
{
|
||||||
|
if (mem->key_set) {
|
||||||
|
EMSG("Key already set");
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_GENERAL_FAILURE);
|
||||||
|
}
|
||||||
|
dump_buffer("Setting key", frm->key_mac, 32);
|
||||||
|
memcpy(mem->key, frm->key_mac, 32);
|
||||||
|
mem->key_set = true;
|
||||||
|
|
||||||
|
return gen_msb1st_result(RPMB_RESULT_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ioctl_emu_get_keyprog_result(struct rpmb_emu *mem,
|
||||||
|
struct rpmb_data_frame *frm)
|
||||||
|
{
|
||||||
|
frm->msg_type =
|
||||||
|
htons(RPMB_MSG_TYPE_RESP_AUTH_KEY_PROGRAM);
|
||||||
|
frm->op_result = mem->last_op.op_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ioctl_emu_read_ctr(struct rpmb_emu *mem,
|
||||||
|
struct rpmb_data_frame *frm)
|
||||||
|
{
|
||||||
|
DMSG("Reading counter");
|
||||||
|
frm->msg_type = htons(RPMB_MSG_TYPE_RESP_WRITE_COUNTER_VAL_READ);
|
||||||
|
frm->write_counter = htonl(mem->write_counter);
|
||||||
|
memcpy(frm->nonce, mem->nonce, 16);
|
||||||
|
frm->op_result = compute_hmac(mem, frm, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t read_cid(uint16_t dev_id, uint8_t *cid)
|
||||||
|
{
|
||||||
|
/* Taken from an actual eMMC chip */
|
||||||
|
static const uint8_t test_cid[] = {
|
||||||
|
/* MID (Manufacturer ID): Micron */
|
||||||
|
0xfe,
|
||||||
|
/* CBX (Device/BGA): BGA */
|
||||||
|
0x01,
|
||||||
|
/* OID (OEM/Application ID) */
|
||||||
|
0x4e,
|
||||||
|
/* PNM (Product name) "MMC04G" */
|
||||||
|
0x4d, 0x4d, 0x43, 0x30, 0x34, 0x47,
|
||||||
|
/* PRV (Product revision): 4.2 */
|
||||||
|
0x42,
|
||||||
|
/* PSN (Product serial number) */
|
||||||
|
0xc8, 0xf6, 0x55, 0x2a,
|
||||||
|
/*
|
||||||
|
* MDT (Manufacturing date):
|
||||||
|
* June, 2014
|
||||||
|
*/
|
||||||
|
0x61,
|
||||||
|
/* (CRC7 (0xA) << 1) | 0x1 */
|
||||||
|
0x15
|
||||||
|
};
|
||||||
|
|
||||||
|
(void)dev_id;
|
||||||
|
memcpy(cid, test_cid, sizeof(test_cid));
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A crude emulation of the MMC ioc commands we need for RPMB */
|
||||||
|
static int ioctl_emu_cmd(int fd, struct mmc_ioc_cmd *cmd)
|
||||||
|
{
|
||||||
|
struct rpmb_data_frame *frm = NULL;
|
||||||
|
uint16_t msg_type = 0;
|
||||||
|
struct rpmb_emu *mem = mem_for_fd(fd);
|
||||||
|
|
||||||
|
if (!mem)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
switch (cmd->opcode) {
|
||||||
|
case MMC_WRITE_MULTIPLE_BLOCK:
|
||||||
|
frm = (struct rpmb_data_frame *)(uintptr_t)cmd->data_ptr;
|
||||||
|
msg_type = ntohs(frm->msg_type);
|
||||||
|
|
||||||
|
switch (msg_type) {
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM:
|
||||||
|
mem->last_op.msg_type = msg_type;
|
||||||
|
mem->last_op.op_result = ioctl_emu_setkey(mem, frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE:
|
||||||
|
mem->last_op.msg_type = msg_type;
|
||||||
|
mem->last_op.address = ntohs(frm->address);
|
||||||
|
mem->last_op.op_result =
|
||||||
|
ioctl_emu_mem_transfer(mem, frm,
|
||||||
|
cmd->blocks, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_WRITE_COUNTER_VAL_READ:
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_READ:
|
||||||
|
memcpy(mem->nonce, frm->nonce, 16);
|
||||||
|
mem->last_op.msg_type = msg_type;
|
||||||
|
mem->last_op.address = ntohs(frm->address);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MMC_READ_MULTIPLE_BLOCK:
|
||||||
|
frm = (struct rpmb_data_frame *)(uintptr_t)cmd->data_ptr;
|
||||||
|
msg_type = ntohs(frm->msg_type);
|
||||||
|
|
||||||
|
switch (mem->last_op.msg_type) {
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM:
|
||||||
|
ioctl_emu_get_keyprog_result(mem, frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE:
|
||||||
|
ioctl_emu_get_write_result(mem, frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_WRITE_COUNTER_VAL_READ:
|
||||||
|
ioctl_emu_read_ctr(mem, frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_READ:
|
||||||
|
ioctl_emu_mem_transfer(mem, frm, cmd->blocks, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
EMSG("Unexpected");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
EMSG("Unsupported ioctl opcode 0x%08x", cmd->opcode);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ioctl_emu(int fd, unsigned long request, ...)
|
||||||
|
{
|
||||||
|
struct mmc_ioc_multi_cmd *mcmd = NULL;
|
||||||
|
struct mmc_ioc_cmd *cmd = NULL;
|
||||||
|
size_t i = 0;
|
||||||
|
int res = 0;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
if (request == MMC_IOC_CMD) {
|
||||||
|
va_start(ap, request);
|
||||||
|
cmd = va_arg(ap, struct mmc_ioc_cmd *);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
res = ioctl_emu_cmd(fd, cmd);
|
||||||
|
} else if (request == MMC_IOC_MULTI_CMD) {
|
||||||
|
va_start(ap, request);
|
||||||
|
mcmd = va_arg(ap, struct mmc_ioc_multi_cmd *);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
for (i = 0; i < mcmd->num_of_cmds; i++) {
|
||||||
|
res = ioctl_emu_cmd(fd, &mcmd->cmds[i]);
|
||||||
|
if (res)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EMSG("Unsupported ioctl: 0x%lx", request);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mmc_rpmb_fd(uint16_t dev_id)
|
||||||
|
{
|
||||||
|
(void)dev_id;
|
||||||
|
|
||||||
|
/* Any value != -1 will do in test mode */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_size_mult(uint16_t dev_id, uint8_t *value)
|
||||||
|
{
|
||||||
|
(void)dev_id;
|
||||||
|
|
||||||
|
*value = EMU_RPMB_SIZE_MULT;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_rel_wr_sec_c(uint16_t dev_id, uint8_t *value)
|
||||||
|
{
|
||||||
|
(void)dev_id;
|
||||||
|
|
||||||
|
*value = EMU_RPMB_REL_WR_SEC_C;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool remap_rpmb_dev_id(uint16_t dev_id, uint16_t *ndev_id)
|
||||||
|
{
|
||||||
|
*ndev_id = dev_id;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* RPMB_EMU */
|
||||||
|
|
||||||
|
static inline void set_mmc_io_cmd(struct mmc_ioc_cmd *cmd, unsigned int blocks,
|
||||||
|
__u32 opcode, int write_flag)
|
||||||
|
{
|
||||||
|
cmd->blksz = 512;
|
||||||
|
cmd->blocks = blocks;
|
||||||
|
cmd->flags = MMC_RSP_R1 | MMC_CMD_ADTC;
|
||||||
|
cmd->opcode = opcode;
|
||||||
|
cmd->write_flag = write_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t rpmb_data_req(int fd, struct rpmb_data_frame *req_frm,
|
||||||
|
size_t req_nfrm, struct rpmb_data_frame *rsp_frm,
|
||||||
|
size_t rsp_nfrm)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
int st = 0;
|
||||||
|
size_t i = 0;
|
||||||
|
uint16_t msg_type = ntohs(req_frm->msg_type);
|
||||||
|
struct mmc_ioc_multi_cmd *mcmd = NULL;
|
||||||
|
struct mmc_ioc_cmd *cmd = NULL;
|
||||||
|
|
||||||
|
for (i = 1; i < req_nfrm; i++) {
|
||||||
|
if (req_frm[i].msg_type != msg_type) {
|
||||||
|
EMSG("All request frames shall be of the same type");
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DMSG("Req: %zu frame(s) of type 0x%04x", req_nfrm, msg_type);
|
||||||
|
DMSG("Rsp: %zu frame(s)", rsp_nfrm);
|
||||||
|
|
||||||
|
mcmd = (struct mmc_ioc_multi_cmd *)
|
||||||
|
calloc(1, sizeof(struct mmc_ioc_multi_cmd) +
|
||||||
|
RPMB_MAX_IOC_MULTI_CMDS * sizeof(struct mmc_ioc_cmd));
|
||||||
|
if (!mcmd)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
switch(msg_type) {
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM:
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_WRITE:
|
||||||
|
if (rsp_nfrm != 1) {
|
||||||
|
EMSG("Expected only one response frame");
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
mcmd->num_of_cmds = 3;
|
||||||
|
|
||||||
|
/* Send write request frame(s) */
|
||||||
|
cmd = &mcmd->cmds[0];
|
||||||
|
set_mmc_io_cmd(cmd, req_nfrm, MMC_WRITE_MULTIPLE_BLOCK,
|
||||||
|
1 | MMC_CMD23_ARG_REL_WR);
|
||||||
|
/*
|
||||||
|
* Black magic: tested on a HiKey board with a HardKernel eMMC
|
||||||
|
* module. When postsleep values are zero, the kernel logs
|
||||||
|
* random errors: "mmc_blk_ioctl_cmd: Card Status=0x00000E00"
|
||||||
|
* and ioctl() fails.
|
||||||
|
*/
|
||||||
|
cmd->postsleep_min_us = 20000;
|
||||||
|
cmd->postsleep_max_us = 50000;
|
||||||
|
mmc_ioc_cmd_set_data((*cmd), (uintptr_t)req_frm);
|
||||||
|
|
||||||
|
/* Send result request frame */
|
||||||
|
cmd = &mcmd->cmds[1];
|
||||||
|
set_mmc_io_cmd(cmd, req_nfrm, MMC_WRITE_MULTIPLE_BLOCK, 1);
|
||||||
|
memset(rsp_frm, 0, 1);
|
||||||
|
rsp_frm->msg_type = htons(RPMB_MSG_TYPE_REQ_RESULT_READ);
|
||||||
|
mmc_ioc_cmd_set_data((*cmd), (uintptr_t)rsp_frm);
|
||||||
|
|
||||||
|
/* Read response frame */
|
||||||
|
cmd = &mcmd->cmds[2];
|
||||||
|
set_mmc_io_cmd(cmd, rsp_nfrm, MMC_READ_MULTIPLE_BLOCK, 0);
|
||||||
|
mmc_ioc_cmd_set_data((*cmd), (uintptr_t)rsp_frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_WRITE_COUNTER_VAL_READ:
|
||||||
|
if (rsp_nfrm != 1) {
|
||||||
|
EMSG("Expected only one response frame");
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
#if __GNUC__ > 6
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case RPMB_MSG_TYPE_REQ_AUTH_DATA_READ:
|
||||||
|
if (req_nfrm != 1) {
|
||||||
|
EMSG("Expected only one request frame");
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
mcmd->num_of_cmds = 2;
|
||||||
|
|
||||||
|
/* Send request frame */
|
||||||
|
cmd = &mcmd->cmds[0];
|
||||||
|
set_mmc_io_cmd(cmd, req_nfrm, MMC_WRITE_MULTIPLE_BLOCK, 1);
|
||||||
|
mmc_ioc_cmd_set_data((*cmd), (uintptr_t)req_frm);
|
||||||
|
|
||||||
|
/* Read response frames */
|
||||||
|
cmd = &mcmd->cmds[1];
|
||||||
|
set_mmc_io_cmd(cmd, rsp_nfrm, MMC_READ_MULTIPLE_BLOCK, 0);
|
||||||
|
mmc_ioc_cmd_set_data((*cmd), (uintptr_t)rsp_frm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
EMSG("Unsupported message type: %d", msg_type);
|
||||||
|
res = TEEC_ERROR_GENERIC;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
st = IOCTL(fd, MMC_IOC_MULTI_CMD, mcmd);
|
||||||
|
if (st < 0)
|
||||||
|
res = TEEC_ERROR_GENERIC;
|
||||||
|
|
||||||
|
out:
|
||||||
|
free(mcmd);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t rpmb_get_dev_info(uint16_t dev_id, struct rpmb_dev_info *info)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_SUCCESS;
|
||||||
|
uint8_t rpmb_size_mult = 0;
|
||||||
|
uint8_t rel_wr_sec_c = 0;
|
||||||
|
|
||||||
|
res = read_cid(dev_id, info->cid);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
res = read_size_mult(dev_id, &rpmb_size_mult);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
info->rpmb_size_mult = rpmb_size_mult;
|
||||||
|
|
||||||
|
res = read_rel_wr_sec_c(dev_id, &rel_wr_sec_c);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
info->rel_wr_sec_c = rel_wr_sec_c;
|
||||||
|
|
||||||
|
info->ret_code = RPMB_CMD_GET_DEV_INFO_RET_OK;
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* req is one struct rpmb_req followed by one or more struct rpmb_data_frame
|
||||||
|
* rsp is either one struct rpmb_dev_info or one or more struct rpmb_data_frame
|
||||||
|
*/
|
||||||
|
static uint32_t rpmb_process_request_unlocked(void *req, size_t req_size,
|
||||||
|
void *rsp, size_t rsp_size)
|
||||||
|
{
|
||||||
|
struct rpmb_req *sreq = req;
|
||||||
|
size_t req_nfrm = 0;
|
||||||
|
size_t rsp_nfrm = 0;
|
||||||
|
uint16_t dev_id = 0;
|
||||||
|
uint32_t res = 0;
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (req_size < sizeof(*sreq))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!remap_rpmb_dev_id(sreq->dev_id, &dev_id))
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
|
||||||
|
switch (sreq->cmd) {
|
||||||
|
case RPMB_CMD_DATA_REQ:
|
||||||
|
req_nfrm = (req_size - sizeof(struct rpmb_req)) / 512;
|
||||||
|
rsp_nfrm = rsp_size / 512;
|
||||||
|
fd = mmc_rpmb_fd(dev_id);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
res = rpmb_data_req(fd, RPMB_REQ_DATA(req), req_nfrm, rsp,
|
||||||
|
rsp_nfrm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RPMB_CMD_GET_DEV_INFO:
|
||||||
|
if (req_size != sizeof(struct rpmb_req) ||
|
||||||
|
rsp_size != sizeof(struct rpmb_dev_info)) {
|
||||||
|
EMSG("Invalid req/rsp size");
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
res = rpmb_get_dev_info(dev_id, (struct rpmb_dev_info *)rsp);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
EMSG("Unsupported RPMB command: %d", sreq->cmd);
|
||||||
|
res = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t rpmb_process_request(void *req, size_t req_size, void *rsp,
|
||||||
|
size_t rsp_size)
|
||||||
|
{
|
||||||
|
uint32_t res = 0;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&rpmb_mutex);
|
||||||
|
res = rpmb_process_request_unlocked(req, req_size, rsp, rsp_size);
|
||||||
|
tee_supp_mutex_unlock(&rpmb_mutex);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
37
optee/optee_client/tee-supplicant/src/rpmb.h
Normal file
37
optee/optee_client/tee-supplicant/src/rpmb.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RPMB_H
|
||||||
|
#define RPMB_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
uint32_t rpmb_process_request(void *req, size_t req_size, void *rsp,
|
||||||
|
size_t rsp_size);
|
||||||
|
|
||||||
|
#endif /* RPMB_H */
|
||||||
249
optee/optee_client/tee-supplicant/src/sha2.c
Normal file
249
optee/optee_client/tee-supplicant/src/sha2.c
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
/*
|
||||||
|
* FIPS 180-2 SHA-224/256/384/512 implementation
|
||||||
|
* Last update: 02/02/2007
|
||||||
|
* Issue date: 04/30/2005
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "sha2.h"
|
||||||
|
|
||||||
|
#define SHFR(x, n) (x >> n)
|
||||||
|
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
|
||||||
|
#define ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n)))
|
||||||
|
#define CH(x, y, z) ((x & y) ^ (~x & z))
|
||||||
|
#define MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
|
||||||
|
|
||||||
|
#define SHA256_F1(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
|
||||||
|
#define SHA256_F2(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
|
||||||
|
#define SHA256_F3(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHFR(x, 3))
|
||||||
|
#define SHA256_F4(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHFR(x, 10))
|
||||||
|
|
||||||
|
#define UNPACK32(x, str) \
|
||||||
|
{ \
|
||||||
|
*((str) + 3) = (uint8) ((x) ); \
|
||||||
|
*((str) + 2) = (uint8) ((x) >> 8); \
|
||||||
|
*((str) + 1) = (uint8) ((x) >> 16); \
|
||||||
|
*((str) + 0) = (uint8) ((x) >> 24); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PACK32(str, x) \
|
||||||
|
{ \
|
||||||
|
*(x) = ((uint32) *((str) + 3) ) \
|
||||||
|
| ((uint32) *((str) + 2) << 8) \
|
||||||
|
| ((uint32) *((str) + 1) << 16) \
|
||||||
|
| ((uint32) *((str) + 0) << 24); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define UNPACK64(x, str) \
|
||||||
|
{ \
|
||||||
|
*((str) + 7) = (uint8) ((x) ); \
|
||||||
|
*((str) + 6) = (uint8) ((x) >> 8); \
|
||||||
|
*((str) + 5) = (uint8) ((x) >> 16); \
|
||||||
|
*((str) + 4) = (uint8) ((x) >> 24); \
|
||||||
|
*((str) + 3) = (uint8) ((x) >> 32); \
|
||||||
|
*((str) + 2) = (uint8) ((x) >> 40); \
|
||||||
|
*((str) + 1) = (uint8) ((x) >> 48); \
|
||||||
|
*((str) + 0) = (uint8) ((x) >> 56); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PACK64(str, x) \
|
||||||
|
{ \
|
||||||
|
*(x) = ((uint64) *((str) + 7) ) \
|
||||||
|
| ((uint64) *((str) + 6) << 8) \
|
||||||
|
| ((uint64) *((str) + 5) << 16) \
|
||||||
|
| ((uint64) *((str) + 4) << 24) \
|
||||||
|
| ((uint64) *((str) + 3) << 32) \
|
||||||
|
| ((uint64) *((str) + 2) << 40) \
|
||||||
|
| ((uint64) *((str) + 1) << 48) \
|
||||||
|
| ((uint64) *((str) + 0) << 56); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SHA256_SCR(i) \
|
||||||
|
{ \
|
||||||
|
w[i] = SHA256_F4(w[i - 2]) + w[i - 7] \
|
||||||
|
+ SHA256_F3(w[i - 15]) + w[i - 16]; \
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 sha256_h0[8] =
|
||||||
|
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
||||||
|
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
|
||||||
|
|
||||||
|
uint32 sha256_k[64] =
|
||||||
|
{0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
||||||
|
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||||
|
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
||||||
|
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
||||||
|
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
|
||||||
|
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
||||||
|
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
|
||||||
|
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
||||||
|
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
||||||
|
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
||||||
|
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
|
||||||
|
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
||||||
|
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
|
||||||
|
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
||||||
|
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
||||||
|
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2};
|
||||||
|
|
||||||
|
/* SHA-256 functions */
|
||||||
|
|
||||||
|
static void sha256_transf(sha256_ctx *ctx, const unsigned char *message,
|
||||||
|
unsigned int block_nb)
|
||||||
|
{
|
||||||
|
uint32 w[64] = { 0 };
|
||||||
|
uint32 wv[8] = { 0 };
|
||||||
|
uint32 t1 = 0;
|
||||||
|
uint32 t2 = 0;
|
||||||
|
const unsigned char *sub_block = NULL;
|
||||||
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < (int) block_nb; i++) {
|
||||||
|
sub_block = message + (i << 6);
|
||||||
|
|
||||||
|
for (j = 0; j < 16; j++) {
|
||||||
|
PACK32(&sub_block[j << 2], &w[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 16; j < 64; j++) {
|
||||||
|
SHA256_SCR(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
wv[j] = ctx->h[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 64; j++) {
|
||||||
|
t1 = wv[7] + SHA256_F2(wv[4]) + CH(wv[4], wv[5], wv[6])
|
||||||
|
+ sha256_k[j] + w[j];
|
||||||
|
t2 = SHA256_F1(wv[0]) + MAJ(wv[0], wv[1], wv[2]);
|
||||||
|
wv[7] = wv[6];
|
||||||
|
wv[6] = wv[5];
|
||||||
|
wv[5] = wv[4];
|
||||||
|
wv[4] = wv[3] + t1;
|
||||||
|
wv[3] = wv[2];
|
||||||
|
wv[2] = wv[1];
|
||||||
|
wv[1] = wv[0];
|
||||||
|
wv[0] = t1 + t2;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
ctx->h[j] += wv[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256(const unsigned char *message, unsigned int len,
|
||||||
|
unsigned char *digest)
|
||||||
|
{
|
||||||
|
sha256_ctx ctx;
|
||||||
|
|
||||||
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
|
|
||||||
|
sha256_init(&ctx);
|
||||||
|
sha256_update(&ctx, message, len);
|
||||||
|
sha256_final(&ctx, digest);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256_init(sha256_ctx *ctx)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
ctx->h[i] = sha256_h0[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx->len = 0;
|
||||||
|
ctx->tot_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256_update(sha256_ctx *ctx, const unsigned char *message,
|
||||||
|
unsigned int len)
|
||||||
|
{
|
||||||
|
unsigned int block_nb = 0;
|
||||||
|
unsigned int new_len = 0;
|
||||||
|
unsigned int rem_len = 0;
|
||||||
|
unsigned int tmp_len = 0;
|
||||||
|
const unsigned char *shifted_message = NULL;
|
||||||
|
|
||||||
|
tmp_len = SHA256_BLOCK_SIZE - ctx->len;
|
||||||
|
rem_len = len < tmp_len ? len : tmp_len;
|
||||||
|
|
||||||
|
memcpy(&ctx->block[ctx->len], message, rem_len);
|
||||||
|
|
||||||
|
if (ctx->len + len < SHA256_BLOCK_SIZE) {
|
||||||
|
ctx->len += len;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
new_len = len - rem_len;
|
||||||
|
block_nb = new_len / SHA256_BLOCK_SIZE;
|
||||||
|
|
||||||
|
shifted_message = message + rem_len;
|
||||||
|
|
||||||
|
sha256_transf(ctx, ctx->block, 1);
|
||||||
|
sha256_transf(ctx, shifted_message, block_nb);
|
||||||
|
|
||||||
|
rem_len = new_len % SHA256_BLOCK_SIZE;
|
||||||
|
|
||||||
|
memcpy(ctx->block, &shifted_message[block_nb << 6],
|
||||||
|
rem_len);
|
||||||
|
|
||||||
|
ctx->len = rem_len;
|
||||||
|
ctx->tot_len += (block_nb + 1) << 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256_final(sha256_ctx *ctx, unsigned char *digest)
|
||||||
|
{
|
||||||
|
unsigned int block_nb = 0;
|
||||||
|
unsigned int pm_len = 0;
|
||||||
|
unsigned int len_b = 0;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
block_nb = (1 + ((SHA256_BLOCK_SIZE - 9)
|
||||||
|
< (ctx->len % SHA256_BLOCK_SIZE)));
|
||||||
|
|
||||||
|
len_b = (ctx->tot_len + ctx->len) << 3;
|
||||||
|
pm_len = block_nb << 6;
|
||||||
|
|
||||||
|
memset(ctx->block + ctx->len, 0, pm_len - ctx->len);
|
||||||
|
ctx->block[ctx->len] = 0x80;
|
||||||
|
UNPACK32(len_b, ctx->block + pm_len - 4);
|
||||||
|
|
||||||
|
sha256_transf(ctx, ctx->block, block_nb);
|
||||||
|
|
||||||
|
for (i = 0 ; i < 8; i++) {
|
||||||
|
UNPACK32(ctx->h[i], &digest[i << 2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
75
optee/optee_client/tee-supplicant/src/sha2.h
Normal file
75
optee/optee_client/tee-supplicant/src/sha2.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* FIPS 180-2 SHA-224/256/384/512 implementation
|
||||||
|
* Last update: 02/02/2007
|
||||||
|
* Issue date: 04/30/2005
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SHA2_H
|
||||||
|
#define SHA2_H
|
||||||
|
|
||||||
|
#define SHA256_DIGEST_SIZE ( 256 / 8)
|
||||||
|
#define SHA256_BLOCK_SIZE ( 512 / 8)
|
||||||
|
|
||||||
|
#ifndef SHA2_TYPES
|
||||||
|
#define SHA2_TYPES
|
||||||
|
typedef unsigned char uint8;
|
||||||
|
typedef unsigned int uint32;
|
||||||
|
typedef unsigned long long uint64;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned int tot_len;
|
||||||
|
unsigned int len;
|
||||||
|
unsigned char block[2 * SHA256_BLOCK_SIZE];
|
||||||
|
uint32 h[8];
|
||||||
|
} sha256_ctx;
|
||||||
|
|
||||||
|
typedef sha256_ctx sha224_ctx;
|
||||||
|
|
||||||
|
void sha256_init(sha256_ctx * ctx);
|
||||||
|
void sha256_update(sha256_ctx *ctx, const unsigned char *message,
|
||||||
|
unsigned int len);
|
||||||
|
void sha256_final(sha256_ctx *ctx, unsigned char *digest);
|
||||||
|
void sha256(const unsigned char *message, unsigned int len,
|
||||||
|
unsigned char *digest);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !SHA2_H */
|
||||||
|
|
||||||
848
optee/optee_client/tee-supplicant/src/tee_socket.c
Normal file
848
optee/optee_client/tee-supplicant/src/tee_socket.c
Normal file
@@ -0,0 +1,848 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <optee_msg_supplicant.h>
|
||||||
|
#include <poll.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/queue.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_socket.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "handle.h"
|
||||||
|
#include "__tee_isocket_defines.h"
|
||||||
|
#include "__tee_ipsocket.h"
|
||||||
|
#include "__tee_tcpsocket_defines.h"
|
||||||
|
#include "__tee_tcpsocket_defines_extensions.h"
|
||||||
|
#include "__tee_udpsocket_defines.h"
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Used when checking how much data we have queued.
|
||||||
|
*
|
||||||
|
* For SOCK_DGRAM we try to be accurate up to 4096 bytes as
|
||||||
|
* that's our arbitrary chosen sensible upper size (with
|
||||||
|
* some margin). Larger size doesn't make much sense since
|
||||||
|
* anything larger than the MTU is bound to cause trouble
|
||||||
|
* on a congested network.
|
||||||
|
*
|
||||||
|
* For SOCK_STREAM we chose the same upper limit for
|
||||||
|
* simplicity. It doesn't matter if there's more queued,
|
||||||
|
* no data will be lost.
|
||||||
|
*/
|
||||||
|
#define SUPP_MAX_PEEK_LEN 4096
|
||||||
|
|
||||||
|
struct sock_instance {
|
||||||
|
uint32_t id;
|
||||||
|
struct handle_db db;
|
||||||
|
TAILQ_ENTRY(sock_instance) link;
|
||||||
|
};
|
||||||
|
|
||||||
|
static pthread_mutex_t sock_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
TAILQ_HEAD(, sock_instance) sock_instances =
|
||||||
|
TAILQ_HEAD_INITIALIZER(sock_instances);
|
||||||
|
|
||||||
|
static void sock_lock(void)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&sock_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sock_unlock(void)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(&sock_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct sock_instance *sock_instance_find(uint32_t instance_id)
|
||||||
|
{
|
||||||
|
struct sock_instance *si = NULL;
|
||||||
|
|
||||||
|
TAILQ_FOREACH(si, &sock_instances, link) {
|
||||||
|
if (si->id == instance_id)
|
||||||
|
return si;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *fd_to_handle_ptr(int fd)
|
||||||
|
{
|
||||||
|
uintptr_t ptr = 0;
|
||||||
|
|
||||||
|
assert(fd >= 0);
|
||||||
|
ptr = fd + 1;
|
||||||
|
return (void *)ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int handle_ptr_to_fd(void *ptr)
|
||||||
|
{
|
||||||
|
assert(ptr);
|
||||||
|
return (uintptr_t)ptr - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int sock_handle_get(uint32_t instance_id, int fd)
|
||||||
|
{
|
||||||
|
int handle = -1;
|
||||||
|
struct sock_instance *si = NULL;
|
||||||
|
|
||||||
|
sock_lock();
|
||||||
|
|
||||||
|
si = sock_instance_find(instance_id);
|
||||||
|
if (!si) {
|
||||||
|
si = calloc(1, sizeof(*si));
|
||||||
|
if (!si)
|
||||||
|
goto out;
|
||||||
|
si->id = instance_id;
|
||||||
|
TAILQ_INSERT_TAIL(&sock_instances, si, link);
|
||||||
|
}
|
||||||
|
|
||||||
|
handle = handle_get(&si->db, fd_to_handle_ptr(fd));
|
||||||
|
out:
|
||||||
|
sock_unlock();
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int sock_handle_to_fd(uint32_t instance_id, uint32_t handle)
|
||||||
|
{
|
||||||
|
int fd = -1;
|
||||||
|
struct sock_instance *si = NULL;
|
||||||
|
|
||||||
|
sock_lock();
|
||||||
|
si = sock_instance_find(instance_id);
|
||||||
|
if (si)
|
||||||
|
fd = handle_ptr_to_fd(handle_lookup(&si->db, handle));
|
||||||
|
sock_unlock();
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sock_handle_put(uint32_t instance_id, uint32_t handle)
|
||||||
|
{
|
||||||
|
struct sock_instance *si = NULL;
|
||||||
|
|
||||||
|
sock_lock();
|
||||||
|
si = sock_instance_find(instance_id);
|
||||||
|
if (si)
|
||||||
|
handle_put(&si->db, handle);
|
||||||
|
sock_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool chk_pt(struct tee_ioctl_param *param, uint32_t type)
|
||||||
|
{
|
||||||
|
return (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) == type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fd_flags_add(int fd, int flags)
|
||||||
|
{
|
||||||
|
int val = 0;
|
||||||
|
|
||||||
|
val = fcntl(fd, F_GETFD, 0);
|
||||||
|
if (val == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
val |= flags;
|
||||||
|
|
||||||
|
return fcntl(fd, F_SETFL, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result sock_connect(uint32_t ip_vers, unsigned int protocol,
|
||||||
|
const char *server, uint16_t port, int *ret_fd)
|
||||||
|
{
|
||||||
|
TEEC_Result r = TEEC_ERROR_GENERIC;
|
||||||
|
struct addrinfo *res0 = NULL;
|
||||||
|
struct addrinfo *res = NULL;
|
||||||
|
int fd = -1;
|
||||||
|
char port_name[10] = { 0 };
|
||||||
|
struct addrinfo hints;
|
||||||
|
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
|
||||||
|
snprintf(port_name, sizeof(port_name), "%" PRIu16, port);
|
||||||
|
|
||||||
|
switch (ip_vers) {
|
||||||
|
case TEE_IP_VERSION_DC:
|
||||||
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
break;
|
||||||
|
case TEE_IP_VERSION_4:
|
||||||
|
hints.ai_family = AF_INET;
|
||||||
|
break;
|
||||||
|
case TEE_IP_VERSION_6:
|
||||||
|
hints.ai_family = AF_INET6;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (protocol == TEE_ISOCKET_PROTOCOLID_TCP)
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
else if (protocol == TEE_ISOCKET_PROTOCOLID_UDP)
|
||||||
|
hints.ai_socktype = SOCK_DGRAM;
|
||||||
|
else
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (getaddrinfo(server, port_name, &hints, &res0))
|
||||||
|
return TEE_ISOCKET_ERROR_HOSTNAME;
|
||||||
|
|
||||||
|
for (res = res0; res; res = res->ai_next) {
|
||||||
|
fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||||
|
if (fd == -1) {
|
||||||
|
if (errno == ENOMEM || errno == ENOBUFS)
|
||||||
|
r = TEE_ISOCKET_ERROR_OUT_OF_RESOURCES;
|
||||||
|
else
|
||||||
|
r = TEEC_ERROR_GENERIC;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (connect(fd, res->ai_addr, res->ai_addrlen)) {
|
||||||
|
if (errno == ETIMEDOUT)
|
||||||
|
r = TEE_ISOCKET_ERROR_TIMEOUT;
|
||||||
|
else
|
||||||
|
r = TEEC_ERROR_COMMUNICATION;
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
fd = -1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fd_flags_add(fd, O_NONBLOCK)) {
|
||||||
|
close(fd);
|
||||||
|
fd = -1;
|
||||||
|
r = TEEC_ERROR_GENERIC;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = TEEC_SUCCESS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
freeaddrinfo(res0);
|
||||||
|
*ret_fd = fd;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_open(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
int handle = 0;
|
||||||
|
int fd = 0;
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
char *server = NULL;
|
||||||
|
uint32_t ip_vers = 0;
|
||||||
|
uint16_t port = 0;
|
||||||
|
uint32_t protocol = 0;
|
||||||
|
|
||||||
|
if (num_params != 4 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT) ||
|
||||||
|
!chk_pt(params + 1, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT) ||
|
||||||
|
!chk_pt(params + 2, TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT) ||
|
||||||
|
!chk_pt(params + 3, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
port = params[1].a;
|
||||||
|
protocol = params[1].b;
|
||||||
|
ip_vers = params[1].c;
|
||||||
|
|
||||||
|
server = tee_supp_param_to_va(params + 2);
|
||||||
|
if (!server || server[MEMREF_SIZE(params + 2) - 1] != '\0')
|
||||||
|
return TEE_ISOCKET_ERROR_HOSTNAME;
|
||||||
|
|
||||||
|
res = sock_connect(ip_vers, protocol, server, port, &fd);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
handle = sock_handle_get(instance_id, fd);
|
||||||
|
if (handle < 0) {
|
||||||
|
close(fd);
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
params[3].a = handle;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_close(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
int handle = 0;
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (num_params != 1 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
handle = params[0].c;
|
||||||
|
fd = sock_handle_to_fd(instance_id, handle);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
sock_handle_put(instance_id, handle);
|
||||||
|
if (close(fd)) {
|
||||||
|
EMSG("tee_socket_close: close(%d): %s", fd, strerror(errno));
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sock_close_cb(int handle, void *ptr, void *arg)
|
||||||
|
{
|
||||||
|
struct sock_instance *si = arg;
|
||||||
|
int fd = handle_ptr_to_fd(ptr);
|
||||||
|
|
||||||
|
if (close(fd))
|
||||||
|
EMSG("sock_close_cb instance_id %d handle %d fd %d: %s",
|
||||||
|
si->id, handle, fd, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_close_all(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
struct sock_instance *si = NULL;
|
||||||
|
|
||||||
|
if (num_params != 1 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
sock_lock();
|
||||||
|
si = sock_instance_find(instance_id);
|
||||||
|
if (si)
|
||||||
|
handle_foreach_put(&si->db, sock_close_cb, si);
|
||||||
|
sock_unlock();
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TS_NSEC_PER_SEC 1000000000
|
||||||
|
|
||||||
|
static void ts_add(const struct timespec *a, const struct timespec *b,
|
||||||
|
struct timespec *res)
|
||||||
|
{
|
||||||
|
res->tv_sec = a->tv_sec + b->tv_sec;
|
||||||
|
res->tv_nsec = a->tv_nsec + b->tv_nsec;
|
||||||
|
if (res->tv_nsec >= TS_NSEC_PER_SEC) {
|
||||||
|
res->tv_sec++;
|
||||||
|
res->tv_nsec -= TS_NSEC_PER_SEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ts_diff_to_polltimeout(const struct timespec *a,
|
||||||
|
const struct timespec *b)
|
||||||
|
{
|
||||||
|
struct timespec diff;
|
||||||
|
|
||||||
|
memset(&diff, 0, sizeof(diff));
|
||||||
|
|
||||||
|
diff.tv_sec = a->tv_sec - b->tv_sec;
|
||||||
|
diff.tv_nsec = a->tv_nsec - b->tv_nsec;
|
||||||
|
if (a->tv_nsec < b->tv_nsec) {
|
||||||
|
diff.tv_nsec += TS_NSEC_PER_SEC;
|
||||||
|
diff.tv_sec--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((diff.tv_sec - 1) > (INT_MAX / 1000))
|
||||||
|
return INT_MAX;
|
||||||
|
return diff.tv_sec * 1000 + diff.tv_nsec / (TS_NSEC_PER_SEC / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ts_delay_from_millis(uint32_t millis, struct timespec *res)
|
||||||
|
{
|
||||||
|
res->tv_sec = millis / 1000;
|
||||||
|
res->tv_nsec = (millis % 1000) * (TS_NSEC_PER_SEC / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result poll_with_timeout(struct pollfd *pfd, nfds_t nfds,
|
||||||
|
uint32_t timeout)
|
||||||
|
{
|
||||||
|
int to = 0;
|
||||||
|
int r = 0;
|
||||||
|
struct timespec now;
|
||||||
|
struct timespec until;
|
||||||
|
|
||||||
|
memset(&now, 0, sizeof(now));
|
||||||
|
memset(&until, 0, sizeof(until));
|
||||||
|
|
||||||
|
if (timeout == OPTEE_MRC_SOCKET_TIMEOUT_BLOCKING) {
|
||||||
|
to = -1;
|
||||||
|
} else {
|
||||||
|
struct timespec delay;
|
||||||
|
|
||||||
|
memset(&delay, 0, sizeof(delay));
|
||||||
|
|
||||||
|
ts_delay_from_millis(timeout, &delay);
|
||||||
|
|
||||||
|
if (clock_gettime(CLOCK_REALTIME, &now))
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
|
||||||
|
ts_add(&now, &delay, &until);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
if (to != -1)
|
||||||
|
to = ts_diff_to_polltimeout(&until, &now);
|
||||||
|
|
||||||
|
r = poll(pfd, nfds, to);
|
||||||
|
if (!r)
|
||||||
|
return TEE_ISOCKET_ERROR_TIMEOUT;
|
||||||
|
if (r == -1) {
|
||||||
|
/*
|
||||||
|
* If we're interrupted by a signal treat
|
||||||
|
* recalculate the timeout (if needed) and wait
|
||||||
|
* again.
|
||||||
|
*/
|
||||||
|
if (errno == EINTR) {
|
||||||
|
if (to != -1 &&
|
||||||
|
clock_gettime(CLOCK_REALTIME, &now))
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result write_with_timeout(int fd, const void *buf, size_t *blen,
|
||||||
|
uint32_t timeout)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
struct pollfd pfd = { .fd = fd, .events = POLLOUT };
|
||||||
|
ssize_t r = 0;
|
||||||
|
|
||||||
|
res = poll_with_timeout(&pfd, 1, timeout);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
r = write(fd, buf, *blen);
|
||||||
|
if (r == -1) {
|
||||||
|
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
|
||||||
|
return TEE_ISOCKET_ERROR_TIMEOUT;
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
*blen = r;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_send(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
int handle = 0;
|
||||||
|
int fd = 0;
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
void *buf = NULL;
|
||||||
|
size_t bytes = 0;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT) ||
|
||||||
|
!chk_pt(params + 1, TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT) ||
|
||||||
|
!chk_pt(params + 2, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
handle = params[0].c;
|
||||||
|
fd = sock_handle_to_fd(instance_id, handle);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
bytes = MEMREF_SIZE(params + 1);
|
||||||
|
res = write_with_timeout(fd, buf, &bytes, params[2].a);
|
||||||
|
if (res == TEEC_SUCCESS)
|
||||||
|
params[2].b = bytes;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ssize_t recv_with_out_flags(int fd, void *buf, size_t len, int inflags,
|
||||||
|
int *out_flags)
|
||||||
|
{
|
||||||
|
ssize_t r = 0;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
struct iovec iov = { .iov_base = buf, .iov_len = len, };
|
||||||
|
struct msghdr msg = { .msg_iov = &iov, .msg_iovlen = 1, };
|
||||||
|
|
||||||
|
r = recvmsg(fd, &msg, inflags);
|
||||||
|
if (r < 0) {
|
||||||
|
/*
|
||||||
|
* If the syscall was just interrupted by a signal
|
||||||
|
* delivery, try again.
|
||||||
|
*/
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_flags = msg.msg_flags;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result read_with_timeout(int fd, void *buf, size_t *blen,
|
||||||
|
uint32_t timeout)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
struct pollfd pfd = { .fd = fd, .events = POLLIN };
|
||||||
|
int socktype = 0;
|
||||||
|
socklen_t l = sizeof(socktype);
|
||||||
|
size_t peek_len = 0;
|
||||||
|
int out_flags = 0;
|
||||||
|
ssize_t r = 0;
|
||||||
|
int e = 0;
|
||||||
|
|
||||||
|
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &socktype, &l))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (*blen) {
|
||||||
|
/* If *blen == 0, the timeout parameter has no effect. */
|
||||||
|
res = poll_with_timeout(&pfd, 1, timeout);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((socktype == SOCK_DGRAM && *blen < SUPP_MAX_PEEK_LEN) || !*blen) {
|
||||||
|
/* Check how much data we have queued. */
|
||||||
|
void *b = malloc(SUPP_MAX_PEEK_LEN);
|
||||||
|
|
||||||
|
if (!b)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
r = recv_with_out_flags(fd, b, SUPP_MAX_PEEK_LEN,
|
||||||
|
MSG_PEEK | MSG_DONTWAIT, &out_flags);
|
||||||
|
e = errno;
|
||||||
|
free(b);
|
||||||
|
if (r < 0)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the message was truncated we know that it's at least
|
||||||
|
* one byte larger.
|
||||||
|
*/
|
||||||
|
if (out_flags & MSG_TRUNC)
|
||||||
|
r++;
|
||||||
|
|
||||||
|
if (!*blen) {
|
||||||
|
*blen = r;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
peek_len = r;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = recv_with_out_flags(fd, buf, *blen, MSG_DONTWAIT, &out_flags);
|
||||||
|
if (r == -1) {
|
||||||
|
e = errno;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if (socktype == SOCK_DGRAM && (out_flags & MSG_TRUNC)) {
|
||||||
|
/*
|
||||||
|
* The datagram has been truncated, return the best length
|
||||||
|
* we have to indicate that.
|
||||||
|
*/
|
||||||
|
if (peek_len > (size_t)r)
|
||||||
|
*blen = peek_len;
|
||||||
|
else
|
||||||
|
*blen = r + 1;
|
||||||
|
} else {
|
||||||
|
*blen = r;
|
||||||
|
}
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
|
||||||
|
err:
|
||||||
|
if (e == EAGAIN || e == EWOULDBLOCK) {
|
||||||
|
/*
|
||||||
|
* If *blen is supplied as 0 then we're not supposed wait
|
||||||
|
* for data so the call to poll has been skipped. In case
|
||||||
|
* there is no data available recvmsg() will return an
|
||||||
|
* error with errno set to EAGAIN or EWOULDBLOCK.
|
||||||
|
*/
|
||||||
|
if (!*blen)
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
return TEE_ISOCKET_ERROR_TIMEOUT;
|
||||||
|
}
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_recv(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
int handle = 0;
|
||||||
|
int fd = 0;
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
void *buf = NULL;
|
||||||
|
size_t bytes = 0;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT) ||
|
||||||
|
!chk_pt(params + 1, TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT) ||
|
||||||
|
!chk_pt(params + 2, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
handle = params[0].c;
|
||||||
|
fd = sock_handle_to_fd(instance_id, handle);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
|
||||||
|
bytes = MEMREF_SIZE(params + 1);
|
||||||
|
res = read_with_timeout(fd, buf, &bytes, params[2].a);
|
||||||
|
if (res == TEEC_SUCCESS)
|
||||||
|
MEMREF_SIZE(params + 1) = bytes;
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_ioctl_tcp(int fd, uint32_t command,
|
||||||
|
void *buf, size_t *blen)
|
||||||
|
{
|
||||||
|
switch (command) {
|
||||||
|
case TEE_TCP_SET_RECVBUF:
|
||||||
|
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, buf, *blen))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
case TEE_TCP_SET_SENDBUF:
|
||||||
|
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, buf, *blen))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result sa_set_port(struct sockaddr *sa, socklen_t slen,
|
||||||
|
uint16_t port)
|
||||||
|
{
|
||||||
|
if (sa->sa_family == AF_INET) {
|
||||||
|
struct sockaddr_in *sain = (void *)sa;
|
||||||
|
|
||||||
|
if (slen < (socklen_t)sizeof(*sain))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
sain->sin_port = htons(port);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sa->sa_family == AF_INET6) {
|
||||||
|
struct sockaddr_in6 *sain6 = (void *)sa;
|
||||||
|
|
||||||
|
if (slen < (socklen_t)sizeof(*sain6))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
sain6->sin6_port = htons(port);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result sa_get_port(struct sockaddr *sa, socklen_t slen,
|
||||||
|
uint16_t *port)
|
||||||
|
{
|
||||||
|
if (sa->sa_family == AF_INET) {
|
||||||
|
struct sockaddr_in *sain = (void *)sa;
|
||||||
|
|
||||||
|
if (slen < (socklen_t)sizeof(*sain))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
*port = ntohs(sain->sin_port);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sa->sa_family == AF_INET6) {
|
||||||
|
struct sockaddr_in6 *sain6 = (void *)sa;
|
||||||
|
|
||||||
|
if (slen < (socklen_t)sizeof(*sain6))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
*port = ntohs(sain6->sin6_port);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result udp_changeaddr(int fd, int family, const char *server,
|
||||||
|
uint16_t port)
|
||||||
|
{
|
||||||
|
TEEC_Result r = TEE_ISOCKET_ERROR_HOSTNAME;
|
||||||
|
struct addrinfo *res0 = NULL;
|
||||||
|
struct addrinfo *res = NULL;
|
||||||
|
char port_name[10] = { 0 };
|
||||||
|
struct addrinfo hints;
|
||||||
|
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
|
||||||
|
snprintf(port_name, sizeof(port_name), "%" PRIu16, port);
|
||||||
|
|
||||||
|
hints.ai_family = family;
|
||||||
|
hints.ai_socktype = SOCK_DGRAM;
|
||||||
|
if (getaddrinfo(server, port_name, &hints, &res0))
|
||||||
|
return TEE_ISOCKET_ERROR_HOSTNAME;
|
||||||
|
for (res = res0; res; res = res->ai_next) {
|
||||||
|
if (connect(fd, res->ai_addr, res->ai_addrlen)) {
|
||||||
|
if (errno == ETIMEDOUT)
|
||||||
|
r = TEE_ISOCKET_ERROR_TIMEOUT;
|
||||||
|
else
|
||||||
|
r = TEEC_ERROR_COMMUNICATION;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
r = TEEC_SUCCESS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
freeaddrinfo(res0);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_ioctl_udp(int fd, uint32_t command,
|
||||||
|
void *buf, size_t *blen)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
uint16_t port = 0;
|
||||||
|
struct sockaddr_storage sass;
|
||||||
|
struct sockaddr *sa = (struct sockaddr *)&sass;
|
||||||
|
socklen_t len = sizeof(sass);
|
||||||
|
|
||||||
|
memset(&sass, 0, sizeof(sass));
|
||||||
|
|
||||||
|
if (getpeername(fd, sa, &len))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
switch (command) {
|
||||||
|
case TEE_UDP_CHANGEADDR:
|
||||||
|
res = sa_get_port(sa, len, &port);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
if (!blen || *((char *)buf + *blen - 1) != '\0')
|
||||||
|
return TEE_ISOCKET_ERROR_HOSTNAME;
|
||||||
|
|
||||||
|
return udp_changeaddr(fd, sa->sa_family, buf, port);
|
||||||
|
case TEE_UDP_CHANGEPORT:
|
||||||
|
if (*blen != sizeof(port))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
memcpy(&port, buf, sizeof(port));
|
||||||
|
res = sa_set_port(sa, len, port);
|
||||||
|
if (res != TEEC_SUCCESS)
|
||||||
|
return res;
|
||||||
|
if (connect(fd, sa, len))
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result tee_socket_ioctl(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||||
|
int handle = 0;
|
||||||
|
int fd = 0;
|
||||||
|
uint32_t instance_id = 0;
|
||||||
|
uint32_t command = 0;
|
||||||
|
void *buf = NULL;
|
||||||
|
int socktype = 0;
|
||||||
|
socklen_t l = 0;
|
||||||
|
size_t sz = 0;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
!chk_pt(params + 0, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT) ||
|
||||||
|
!chk_pt(params + 1, TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT) ||
|
||||||
|
!chk_pt(params + 2, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
instance_id = params[0].b;
|
||||||
|
handle = params[0].c;
|
||||||
|
command = params[2].a;
|
||||||
|
fd = sock_handle_to_fd(instance_id, handle);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
l = sizeof(socktype);
|
||||||
|
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &socktype, &l))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
|
||||||
|
switch (socktype) {
|
||||||
|
case SOCK_STREAM:
|
||||||
|
sz = MEMREF_SIZE(params + 1);
|
||||||
|
res = tee_socket_ioctl_tcp(fd, command, buf, &sz);
|
||||||
|
MEMREF_SIZE(params + 1) = sz;
|
||||||
|
return res;
|
||||||
|
case SOCK_DGRAM:
|
||||||
|
sz = MEMREF_SIZE(params + 1);
|
||||||
|
res = tee_socket_ioctl_udp(fd, command, buf, &sz);
|
||||||
|
MEMREF_SIZE(params + 1) = sz;
|
||||||
|
return res;
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result tee_socket_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
if (!num_params || !tee_supp_param_is_value(params))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
switch (params->a) {
|
||||||
|
case OPTEE_MRC_SOCKET_OPEN:
|
||||||
|
return tee_socket_open(num_params, params);
|
||||||
|
case OPTEE_MRC_SOCKET_CLOSE:
|
||||||
|
return tee_socket_close(num_params, params);
|
||||||
|
case OPTEE_MRC_SOCKET_CLOSE_ALL:
|
||||||
|
return tee_socket_close_all(num_params, params);
|
||||||
|
case OPTEE_MRC_SOCKET_SEND:
|
||||||
|
return tee_socket_send(num_params, params);
|
||||||
|
case OPTEE_MRC_SOCKET_RECV:
|
||||||
|
return tee_socket_recv(num_params, params);
|
||||||
|
case OPTEE_MRC_SOCKET_IOCTL:
|
||||||
|
return tee_socket_ioctl(num_params, params);
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
49
optee/optee_client/tee-supplicant/src/tee_socket.h
Normal file
49
optee/optee_client/tee-supplicant/src/tee_socket.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __TEE_SOCKET_H
|
||||||
|
#define __TEE_SOCKET_H
|
||||||
|
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
struct tee_ioctl_param;
|
||||||
|
|
||||||
|
#if defined(CFG_GP_SOCKETS) && CFG_GP_SOCKETS == 1
|
||||||
|
TEEC_Result tee_socket_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params);
|
||||||
|
#else
|
||||||
|
static inline TEEC_Result tee_socket_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
(void)num_params;
|
||||||
|
(void)params;
|
||||||
|
|
||||||
|
return TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*__SOCKET_H*/
|
||||||
681
optee/optee_client/tee-supplicant/src/tee_supp_fs.c
Normal file
681
optee/optee_client/tee-supplicant/src/tee_supp_fs.c
Normal file
@@ -0,0 +1,681 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#include <assert.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <handle.h>
|
||||||
|
#include <libgen.h>
|
||||||
|
#include <optee_msg_supplicant.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_supp_fs.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Path to all secure storage files. */
|
||||||
|
static char tee_fs_root[PATH_MAX];
|
||||||
|
|
||||||
|
#define TEE_FS_FILENAME_MAX_LENGTH 150
|
||||||
|
|
||||||
|
static pthread_mutex_t dir_handle_db_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
static struct handle_db dir_handle_db =
|
||||||
|
HANDLE_DB_INITIALIZER_WITH_MUTEX(&dir_handle_db_mutex);
|
||||||
|
|
||||||
|
static TEEC_Result errno_to_teec(int err)
|
||||||
|
{
|
||||||
|
switch (err) {
|
||||||
|
case ENOSPC:
|
||||||
|
return TEEC_ERROR_STORAGE_NO_SPACE;
|
||||||
|
case ENOENT:
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TEEC_ERROR_GENERIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
static size_t tee_fs_get_absolute_filename(char *file, char *out,
|
||||||
|
size_t out_size)
|
||||||
|
{
|
||||||
|
int s = 0;
|
||||||
|
|
||||||
|
if (!file || !out || (out_size <= strlen(tee_fs_root) + 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
s = snprintf(out, out_size, "%s%s", tee_fs_root, file);
|
||||||
|
if (s < 0 || (size_t)s >= out_size)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* Safe to cast since we have checked that sizes are OK */
|
||||||
|
return (size_t)s;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void fs_fsync(void)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
fd = open(tee_fs_root, O_RDONLY | O_DIRECTORY);
|
||||||
|
if (fd > 0) {
|
||||||
|
fsync(fd);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_mkdir(const char *path, mode_t mode)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
memset(&st, 0, sizeof(st));
|
||||||
|
|
||||||
|
if (mkdir(path, mode) != 0 && errno != EEXIST)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (stat(path, &st) != 0 && !S_ISDIR(st.st_mode))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
fs_fsync();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mkpath(const char *path, mode_t mode)
|
||||||
|
{
|
||||||
|
int status = 0;
|
||||||
|
char *subpath = strdup(path);
|
||||||
|
char *prev = subpath;
|
||||||
|
char *curr = NULL;
|
||||||
|
|
||||||
|
while (status == 0 && (curr = strchr(prev, '/')) != 0) {
|
||||||
|
/*
|
||||||
|
* Check for root or double slash
|
||||||
|
*/
|
||||||
|
if (curr != prev) {
|
||||||
|
*curr = '\0';
|
||||||
|
status = do_mkdir(subpath, mode);
|
||||||
|
*curr = '/';
|
||||||
|
}
|
||||||
|
prev = curr + 1;
|
||||||
|
}
|
||||||
|
if (status == 0)
|
||||||
|
status = do_mkdir(path, mode);
|
||||||
|
|
||||||
|
free(subpath);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tee_supp_fs_init(void)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
mode_t mode = 0700;
|
||||||
|
|
||||||
|
n = snprintf(tee_fs_root, sizeof(tee_fs_root), "%s/", supplicant_params.fs_parent_path);
|
||||||
|
|
||||||
|
if (n >= sizeof(tee_fs_root))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (mkpath(tee_fs_root, mode) != 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int open_wrapper(const char *fname, int flags)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
fd = open(fname, flags | O_SYNC, 0600);
|
||||||
|
if (fd >= 0 || errno != EINTR)
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_open(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
char abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char *fname = NULL;
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fname = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(fname, abs_filename,
|
||||||
|
sizeof(abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = open_wrapper(abs_filename, O_RDWR);
|
||||||
|
if (fd < 0) {
|
||||||
|
/*
|
||||||
|
* In case the problem is the filesystem is RO, retry with the
|
||||||
|
* open flags restricted to RO.
|
||||||
|
*/
|
||||||
|
fd = open_wrapper(abs_filename, O_RDONLY);
|
||||||
|
if (fd < 0)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
params[2].a = fd;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_create(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
char abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char abs_dir[PATH_MAX] = { 0 };
|
||||||
|
char *fname = NULL;
|
||||||
|
char *d = NULL;
|
||||||
|
int fd = 0;
|
||||||
|
const int flags = O_RDWR | O_CREAT | O_TRUNC;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fname = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(fname, abs_filename,
|
||||||
|
sizeof(abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = open_wrapper(abs_filename, flags);
|
||||||
|
if (fd >= 0)
|
||||||
|
goto out;
|
||||||
|
if (errno != ENOENT)
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
|
||||||
|
/* Directory for file missing, try make to it */
|
||||||
|
strncpy(abs_dir, abs_filename, sizeof(abs_dir));
|
||||||
|
abs_dir[sizeof(abs_dir) - 1] = '\0';
|
||||||
|
d = dirname(abs_dir);
|
||||||
|
if (!mkdir(d, 0700)) {
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
fd = open_wrapper(abs_filename, flags);
|
||||||
|
if (fd >= 0)
|
||||||
|
goto out;
|
||||||
|
/*
|
||||||
|
* The directory was made but the file could still not be
|
||||||
|
* created.
|
||||||
|
*/
|
||||||
|
err = errno;
|
||||||
|
rmdir(d);
|
||||||
|
return errno_to_teec(err);
|
||||||
|
}
|
||||||
|
if (errno != ENOENT)
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
|
||||||
|
/* Parent directory for file missing, try to make it */
|
||||||
|
d = dirname(d);
|
||||||
|
if (mkdir(d, 0700))
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
|
||||||
|
/* Try to make directory for file again */
|
||||||
|
strncpy(abs_dir, abs_filename, sizeof(abs_dir));
|
||||||
|
abs_dir[sizeof(abs_dir) - 1] = '\0';
|
||||||
|
d = dirname(abs_dir);
|
||||||
|
if (mkdir(d, 0700)) {
|
||||||
|
int err = errno;
|
||||||
|
|
||||||
|
d = dirname(d);
|
||||||
|
rmdir(d);
|
||||||
|
return errno_to_teec(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
fd = open_wrapper(abs_filename, flags);
|
||||||
|
if (fd < 0) {
|
||||||
|
int err = errno;
|
||||||
|
|
||||||
|
rmdir(d);
|
||||||
|
d = dirname(d);
|
||||||
|
rmdir(d);
|
||||||
|
return errno_to_teec(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
fs_fsync();
|
||||||
|
params[2].a = fd;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_close(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (num_params != 1 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = params[0].b;
|
||||||
|
while (close(fd)) {
|
||||||
|
if (errno != EINTR)
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
}
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_read(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
uint8_t *buf = NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
off_t offs = 0;
|
||||||
|
int fd = 0;
|
||||||
|
ssize_t r = 0;
|
||||||
|
size_t s = 0;
|
||||||
|
|
||||||
|
if (num_params != 2 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = params[0].b;
|
||||||
|
offs = params[0].c;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!buf)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
len = MEMREF_SIZE(params + 1);
|
||||||
|
|
||||||
|
s = 0;
|
||||||
|
r = -1;
|
||||||
|
while (r && len) {
|
||||||
|
r = pread(fd, buf, len, offs);
|
||||||
|
if (r < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
}
|
||||||
|
assert((size_t)r <= len);
|
||||||
|
buf += r;
|
||||||
|
len -= r;
|
||||||
|
offs += r;
|
||||||
|
s += r;
|
||||||
|
}
|
||||||
|
|
||||||
|
MEMREF_SIZE(params + 1) = s;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_write(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
uint8_t *buf = NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
off_t offs = 0;
|
||||||
|
int fd = 0;
|
||||||
|
ssize_t r = 0;
|
||||||
|
|
||||||
|
if (num_params != 2 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = params[0].b;
|
||||||
|
offs = params[0].c;
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!buf)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
len = MEMREF_SIZE(params + 1);
|
||||||
|
|
||||||
|
while (len) {
|
||||||
|
r = pwrite(fd, buf, len, offs);
|
||||||
|
if (r < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
}
|
||||||
|
assert((size_t)r <= len);
|
||||||
|
buf += r;
|
||||||
|
len -= r;
|
||||||
|
offs += r;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_truncate(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
size_t len = 0;
|
||||||
|
int fd = 0;
|
||||||
|
|
||||||
|
if (num_params != 1 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fd = params[0].b;
|
||||||
|
len = params[0].c;
|
||||||
|
|
||||||
|
while (ftruncate(fd, len)) {
|
||||||
|
if (errno != EINTR)
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_remove(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
char abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char *fname = NULL;
|
||||||
|
char *d = NULL;
|
||||||
|
|
||||||
|
if (num_params != 2 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fname = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(fname, abs_filename,
|
||||||
|
sizeof(abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (unlink(abs_filename))
|
||||||
|
return errno_to_teec(errno);
|
||||||
|
|
||||||
|
/* If a file is removed, maybe the directory can be removed to? */
|
||||||
|
d = dirname(abs_filename);
|
||||||
|
if (!rmdir(d)) {
|
||||||
|
/*
|
||||||
|
* If the directory was removed, maybe the parent directory
|
||||||
|
* can be removed too?
|
||||||
|
*/
|
||||||
|
d = dirname(d);
|
||||||
|
rmdir(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_rename(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
char old_abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char new_abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char *old_fname = NULL;
|
||||||
|
char *new_fname = NULL;
|
||||||
|
bool overwrite = false;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
overwrite = !!params[0].b;
|
||||||
|
|
||||||
|
old_fname = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!old_fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
new_fname = tee_supp_param_to_va(params + 2);
|
||||||
|
if (!new_fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(old_fname, old_abs_filename,
|
||||||
|
sizeof(old_abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(new_fname, new_abs_filename,
|
||||||
|
sizeof(new_abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!overwrite) {
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if (!stat(new_abs_filename, &st))
|
||||||
|
return TEEC_ERROR_ACCESS_CONFLICT;
|
||||||
|
}
|
||||||
|
if (rename(old_abs_filename, new_abs_filename)) {
|
||||||
|
if (errno == ENOENT)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
fs_fsync();
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_opendir(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
char abs_filename[PATH_MAX] = { 0 };
|
||||||
|
char *fname = NULL;
|
||||||
|
DIR *dir = NULL;
|
||||||
|
int handle = 0;
|
||||||
|
struct dirent *dent = NULL;
|
||||||
|
bool empty = true;
|
||||||
|
|
||||||
|
if (num_params != 3 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT ||
|
||||||
|
(params[2].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
fname = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!fname)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_get_absolute_filename(fname, abs_filename,
|
||||||
|
sizeof(abs_filename)))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
dir = opendir(abs_filename);
|
||||||
|
if (!dir)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore empty directories. Works around an issue when the
|
||||||
|
* data path is mounted over NFS. Due to the way OP-TEE implements
|
||||||
|
* TEE_CloseAndDeletePersistentObject1() currently, tee-supplicant
|
||||||
|
* still has a file descriptor open to the file when it's removed in
|
||||||
|
* ree_fs_new_remove(). In this case the NFS server may create a
|
||||||
|
* temporary reference called .nfs????, and the rmdir() call fails
|
||||||
|
* so that the TA directory is left over. Checking this special case
|
||||||
|
* here avoids that TEE_StartPersistentObjectEnumerator() returns
|
||||||
|
* TEE_SUCCESS when it should return TEEC_ERROR_ITEM_NOT_FOUND.
|
||||||
|
* Test case: "xtest 6009 6010".
|
||||||
|
*/
|
||||||
|
while ((dent = readdir(dir))) {
|
||||||
|
if (dent->d_name[0] == '.')
|
||||||
|
continue;
|
||||||
|
empty = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (empty) {
|
||||||
|
closedir(dir);
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
rewinddir(dir);
|
||||||
|
|
||||||
|
handle = handle_get(&dir_handle_db, dir);
|
||||||
|
if (handle < 0) {
|
||||||
|
closedir(dir);
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
params[2].a = handle;
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_closedir(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
DIR *dir = NULL;
|
||||||
|
|
||||||
|
if (num_params != 1 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
dir = handle_put(&dir_handle_db, params[0].b);
|
||||||
|
if (!dir)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEEC_Result ree_fs_new_readdir(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
DIR *dir = NULL;
|
||||||
|
struct dirent *dirent = NULL;
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
size_t fname_len = 0;
|
||||||
|
|
||||||
|
if (num_params != 2 ||
|
||||||
|
(params[0].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT ||
|
||||||
|
(params[1].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) !=
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
|
||||||
|
buf = tee_supp_param_to_va(params + 1);
|
||||||
|
if (!buf)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
len = MEMREF_SIZE(params + 1);
|
||||||
|
|
||||||
|
dir = handle_lookup(&dir_handle_db, params[0].b);
|
||||||
|
if (!dir)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
dirent = readdir(dir);
|
||||||
|
if (!dirent)
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
if (dirent->d_name[0] != '.')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fname_len = strlen(dirent->d_name) + 1;
|
||||||
|
MEMREF_SIZE(params + 1) = fname_len;
|
||||||
|
if (fname_len > len)
|
||||||
|
return TEEC_ERROR_SHORT_BUFFER;
|
||||||
|
|
||||||
|
memcpy(buf, dirent->d_name, fname_len);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEEC_Result tee_supp_fs_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
if (!num_params || !tee_supp_param_is_value(params))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (!tee_fs_root[0]) {
|
||||||
|
if (tee_supp_fs_init() != 0) {
|
||||||
|
EMSG("error tee_supp_fs_init: failed to create %s/",
|
||||||
|
tee_fs_root);
|
||||||
|
memset(tee_fs_root, 0, sizeof(tee_fs_root));
|
||||||
|
return TEEC_ERROR_STORAGE_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (params->a) {
|
||||||
|
case OPTEE_MRF_OPEN:
|
||||||
|
return ree_fs_new_open(num_params, params);
|
||||||
|
case OPTEE_MRF_CREATE:
|
||||||
|
return ree_fs_new_create(num_params, params);
|
||||||
|
case OPTEE_MRF_CLOSE:
|
||||||
|
return ree_fs_new_close(num_params, params);
|
||||||
|
case OPTEE_MRF_READ:
|
||||||
|
return ree_fs_new_read(num_params, params);
|
||||||
|
case OPTEE_MRF_WRITE:
|
||||||
|
return ree_fs_new_write(num_params, params);
|
||||||
|
case OPTEE_MRF_TRUNCATE:
|
||||||
|
return ree_fs_new_truncate(num_params, params);
|
||||||
|
case OPTEE_MRF_REMOVE:
|
||||||
|
return ree_fs_new_remove(num_params, params);
|
||||||
|
case OPTEE_MRF_RENAME:
|
||||||
|
return ree_fs_new_rename(num_params, params);
|
||||||
|
case OPTEE_MRF_OPENDIR:
|
||||||
|
return ree_fs_new_opendir(num_params, params);
|
||||||
|
case OPTEE_MRF_CLOSEDIR:
|
||||||
|
return ree_fs_new_closedir(num_params, params);
|
||||||
|
case OPTEE_MRF_READDIR:
|
||||||
|
return ree_fs_new_readdir(num_params, params);
|
||||||
|
default:
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
37
optee/optee_client/tee-supplicant/src/tee_supp_fs.h
Normal file
37
optee/optee_client/tee-supplicant/src/tee_supp_fs.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef TEE_SUPP_FS_H
|
||||||
|
#define TEE_SUPP_FS_H
|
||||||
|
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
struct tee_ioctl_param;
|
||||||
|
|
||||||
|
TEEC_Result tee_supp_fs_process(size_t num_params,
|
||||||
|
struct tee_ioctl_param *params);
|
||||||
|
|
||||||
|
#endif
|
||||||
995
optee/optee_client/tee-supplicant/src/tee_supplicant.c
Normal file
995
optee/optee_client/tee-supplicant/src/tee_supplicant.c
Normal file
@@ -0,0 +1,995 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2015, Linaro Limited
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <getopt.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <prof.h>
|
||||||
|
#include <plugin.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <rpmb.h>
|
||||||
|
#include <nvme_rpmb.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
#include <teec_ta_load.h>
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <tee_socket.h>
|
||||||
|
#include <tee_supp_fs.h>
|
||||||
|
#include <tee_supplicant.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "optee_msg_supplicant.h"
|
||||||
|
|
||||||
|
#ifndef __aligned
|
||||||
|
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||||
|
#endif
|
||||||
|
#include <linux/tee.h>
|
||||||
|
|
||||||
|
#define RPC_NUM_PARAMS 5
|
||||||
|
|
||||||
|
#define RPC_BUF_SIZE (sizeof(struct tee_iocl_supp_send_arg) + \
|
||||||
|
RPC_NUM_PARAMS * sizeof(struct tee_ioctl_param))
|
||||||
|
|
||||||
|
char **ta_path;
|
||||||
|
char *ta_path_str;
|
||||||
|
|
||||||
|
union tee_rpc_invoke {
|
||||||
|
uint64_t buf[(RPC_BUF_SIZE - 1) / sizeof(uint64_t) + 1];
|
||||||
|
struct tee_iocl_supp_recv_arg recv;
|
||||||
|
struct tee_iocl_supp_send_arg send;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct tee_shm {
|
||||||
|
int id;
|
||||||
|
void *p;
|
||||||
|
size_t size;
|
||||||
|
bool registered;
|
||||||
|
int fd;
|
||||||
|
struct tee_shm *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct thread_arg {
|
||||||
|
int fd;
|
||||||
|
uint32_t gen_caps;
|
||||||
|
bool abort;
|
||||||
|
size_t num_waiters;
|
||||||
|
pthread_mutex_t mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct param_value {
|
||||||
|
uint64_t a;
|
||||||
|
uint64_t b;
|
||||||
|
uint64_t c;
|
||||||
|
};
|
||||||
|
|
||||||
|
static pthread_mutex_t shm_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
static struct tee_shm *shm_head;
|
||||||
|
|
||||||
|
struct tee_supplicant_params supplicant_params = {
|
||||||
|
.ta_dir = "optee_armtz",
|
||||||
|
#ifdef TEE_PLUGIN_LOAD_PATH
|
||||||
|
.plugin_load_path = TEE_PLUGIN_LOAD_PATH,
|
||||||
|
#endif
|
||||||
|
.fs_parent_path = TEE_FS_PARENT_PATH,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void *thread_main(void *a);
|
||||||
|
|
||||||
|
static size_t num_waiters_inc(struct thread_arg *arg)
|
||||||
|
{
|
||||||
|
size_t ret = 0;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&arg->mutex);
|
||||||
|
arg->num_waiters++;
|
||||||
|
assert(arg->num_waiters);
|
||||||
|
ret = arg->num_waiters;
|
||||||
|
tee_supp_mutex_unlock(&arg->mutex);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static size_t num_waiters_dec(struct thread_arg *arg)
|
||||||
|
{
|
||||||
|
size_t ret = 0;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&arg->mutex);
|
||||||
|
assert(arg->num_waiters);
|
||||||
|
arg->num_waiters--;
|
||||||
|
ret = arg->num_waiters;
|
||||||
|
tee_supp_mutex_unlock(&arg->mutex);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *paged_aligned_alloc(size_t sz)
|
||||||
|
{
|
||||||
|
void *p = NULL;
|
||||||
|
|
||||||
|
if (!posix_memalign(&p, sysconf(_SC_PAGESIZE), sz))
|
||||||
|
return p;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int get_value(size_t num_params, struct tee_ioctl_param *params,
|
||||||
|
const uint32_t idx, struct param_value **value)
|
||||||
|
{
|
||||||
|
if (idx >= num_params)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
switch (params[idx].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
|
||||||
|
*value = (void *)¶ms[idx].a;
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct tee_shm *find_tshm(int id)
|
||||||
|
{
|
||||||
|
struct tee_shm *tshm = NULL;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&shm_mutex);
|
||||||
|
|
||||||
|
tshm = shm_head;
|
||||||
|
while (tshm && tshm->id != id)
|
||||||
|
tshm = tshm->next;
|
||||||
|
|
||||||
|
tee_supp_mutex_unlock(&shm_mutex);
|
||||||
|
|
||||||
|
return tshm;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct tee_shm *pop_tshm(int id)
|
||||||
|
{
|
||||||
|
struct tee_shm *tshm = NULL;
|
||||||
|
struct tee_shm *prev = NULL;
|
||||||
|
|
||||||
|
tee_supp_mutex_lock(&shm_mutex);
|
||||||
|
|
||||||
|
tshm = shm_head;
|
||||||
|
if (!tshm)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (tshm->id == id) {
|
||||||
|
shm_head = tshm->next;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
prev = tshm;
|
||||||
|
tshm = tshm->next;
|
||||||
|
if (!tshm)
|
||||||
|
goto out;
|
||||||
|
} while (tshm->id != id);
|
||||||
|
prev->next = tshm->next;
|
||||||
|
|
||||||
|
out:
|
||||||
|
tee_supp_mutex_unlock(&shm_mutex);
|
||||||
|
|
||||||
|
return tshm;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void push_tshm(struct tee_shm *tshm)
|
||||||
|
{
|
||||||
|
tee_supp_mutex_lock(&shm_mutex);
|
||||||
|
|
||||||
|
tshm->next = shm_head;
|
||||||
|
shm_head = tshm;
|
||||||
|
|
||||||
|
tee_supp_mutex_unlock(&shm_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get parameter allocated by secure world */
|
||||||
|
static int get_param(size_t num_params, struct tee_ioctl_param *params,
|
||||||
|
const uint32_t idx, TEEC_SharedMemory *shm)
|
||||||
|
{
|
||||||
|
struct tee_shm *tshm = NULL;
|
||||||
|
size_t offs = 0;
|
||||||
|
size_t sz = 0;
|
||||||
|
|
||||||
|
if (idx >= num_params)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
switch (params[idx].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(shm, 0, sizeof(*shm));
|
||||||
|
|
||||||
|
tshm = find_tshm(MEMREF_SHM_ID(params + idx));
|
||||||
|
if (!tshm) {
|
||||||
|
/*
|
||||||
|
* It doesn't make sense to query required size of an
|
||||||
|
* input buffer.
|
||||||
|
*/
|
||||||
|
if ((params[idx].attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) ==
|
||||||
|
TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Buffer isn't found, the caller is querying required size
|
||||||
|
* of the buffer.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sz = MEMREF_SIZE(params + idx);
|
||||||
|
offs = MEMREF_SHM_OFFS(params + idx);
|
||||||
|
if ((sz + offs) < sz)
|
||||||
|
return -1;
|
||||||
|
if ((sz + offs) > tshm->size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
shm->flags = TEEC_MEM_INPUT | TEEC_MEM_OUTPUT;
|
||||||
|
shm->size = sz;
|
||||||
|
shm->id = MEMREF_SHM_ID(params + idx);
|
||||||
|
shm->buffer = (uint8_t *)tshm->p + offs;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void uuid_from_octets(TEEC_UUID *d, const uint8_t s[TEE_IOCTL_UUID_LEN])
|
||||||
|
{
|
||||||
|
d->timeLow = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
|
||||||
|
d->timeMid = (s[4] << 8) | s[5];
|
||||||
|
d->timeHiAndVersion = (s[6] << 8) | s[7];
|
||||||
|
memcpy(d->clockSeqAndNode, s + 8, sizeof(d->clockSeqAndNode));
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t load_ta(size_t num_params, struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
int ta_found = 0;
|
||||||
|
size_t size = 0;
|
||||||
|
struct param_value *val_cmd = NULL;
|
||||||
|
TEEC_UUID uuid;
|
||||||
|
TEEC_SharedMemory shm_ta;
|
||||||
|
|
||||||
|
memset(&uuid, 0, sizeof(uuid));
|
||||||
|
memset(&shm_ta, 0, sizeof(shm_ta));
|
||||||
|
|
||||||
|
if (num_params != 2 || get_value(num_params, params, 0, &val_cmd) ||
|
||||||
|
get_param(num_params, params, 1, &shm_ta))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
uuid_from_octets(&uuid, (void *)val_cmd);
|
||||||
|
|
||||||
|
size = shm_ta.size;
|
||||||
|
ta_found = TEECI_LoadSecureModule(supplicant_params.ta_dir, &uuid, shm_ta.buffer, &size);
|
||||||
|
if (ta_found != TA_BINARY_FOUND) {
|
||||||
|
EMSG(" TA not found");
|
||||||
|
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
MEMREF_SIZE(params + 1) = size;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a buffer wasn't provided, just tell which size it should be.
|
||||||
|
* If it was provided but isn't big enough, report an error.
|
||||||
|
*/
|
||||||
|
if (shm_ta.buffer && size > shm_ta.size)
|
||||||
|
return TEEC_ERROR_SHORT_BUFFER;
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct tee_shm *alloc_shm(int fd, size_t size)
|
||||||
|
{
|
||||||
|
struct tee_shm *shm = NULL;
|
||||||
|
struct tee_ioctl_shm_alloc_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
shm = calloc(1, sizeof(*shm));
|
||||||
|
if (!shm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
data.size = size;
|
||||||
|
shm->fd = ioctl(fd, TEE_IOC_SHM_ALLOC, &data);
|
||||||
|
if (shm->fd < 0) {
|
||||||
|
free(shm);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm->p = mmap(NULL, data.size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||||
|
shm->fd, 0);
|
||||||
|
if (shm->p == (void *)MAP_FAILED) {
|
||||||
|
close(shm->fd);
|
||||||
|
free(shm);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm->id = data.id;
|
||||||
|
shm->registered = false;
|
||||||
|
return shm;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct tee_shm *register_local_shm(int fd, size_t size)
|
||||||
|
{
|
||||||
|
struct tee_shm *shm = NULL;
|
||||||
|
void *buf = NULL;
|
||||||
|
struct tee_ioctl_shm_register_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
buf = paged_aligned_alloc(size);
|
||||||
|
if (!buf)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
shm = calloc(1, sizeof(*shm));
|
||||||
|
if (!shm) {
|
||||||
|
free(buf);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.addr = (uintptr_t)buf;
|
||||||
|
data.length = size;
|
||||||
|
|
||||||
|
shm->fd = ioctl(fd, TEE_IOC_SHM_REGISTER, &data);
|
||||||
|
if (shm->fd < 0) {
|
||||||
|
free(shm);
|
||||||
|
free(buf);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm->p = buf;
|
||||||
|
shm->registered = true;
|
||||||
|
shm->id = data.id;
|
||||||
|
|
||||||
|
return shm;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t process_alloc(struct thread_arg *arg, size_t num_params,
|
||||||
|
struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
struct param_value *val = NULL;
|
||||||
|
struct tee_shm *shm = NULL;
|
||||||
|
|
||||||
|
if (num_params != 1 || get_value(num_params, params, 0, &val))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
if (arg->gen_caps & TEE_GEN_CAP_REG_MEM)
|
||||||
|
shm = register_local_shm(arg->fd, val->b);
|
||||||
|
else
|
||||||
|
shm = alloc_shm(arg->fd, val->b);
|
||||||
|
|
||||||
|
if (!shm)
|
||||||
|
return TEEC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
shm->size = val->b;
|
||||||
|
val->c = shm->id;
|
||||||
|
push_tshm(shm);
|
||||||
|
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t process_free(size_t num_params, struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
struct param_value *val = NULL;
|
||||||
|
struct tee_shm *shm = NULL;
|
||||||
|
int id = 0;
|
||||||
|
|
||||||
|
if (num_params != 1 || get_value(num_params, params, 0, &val))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
id = val->b;
|
||||||
|
|
||||||
|
shm = pop_tshm(id);
|
||||||
|
if (!shm)
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
close(shm->fd);
|
||||||
|
if (shm->registered) {
|
||||||
|
free(shm->p);
|
||||||
|
} else {
|
||||||
|
if (munmap(shm->p, shm->size) != 0) {
|
||||||
|
EMSG("munmap(%p, %zu) failed - Error = %s",
|
||||||
|
shm->p, shm->size, strerror(errno));
|
||||||
|
free(shm);
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(shm);
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* How many device sequence numbers will be tried before giving up */
|
||||||
|
#define MAX_DEV_SEQ 10
|
||||||
|
|
||||||
|
static int open_dev(const char *devname, uint32_t *gen_caps)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
struct tee_ioctl_version_data vers;
|
||||||
|
|
||||||
|
memset(&vers, 0, sizeof(vers));
|
||||||
|
|
||||||
|
fd = open(devname, O_RDWR);
|
||||||
|
if (fd < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (ioctl(fd, TEE_IOC_VERSION, &vers))
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
/* Only OP-TEE supported */
|
||||||
|
if (vers.impl_id != TEE_IMPL_ID_OPTEE)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if (gen_caps)
|
||||||
|
*gen_caps = vers.gen_caps;
|
||||||
|
|
||||||
|
DMSG("using device \"%s\"", devname);
|
||||||
|
return fd;
|
||||||
|
err:
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int get_dev_fd(uint32_t *gen_caps)
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
char name[PATH_MAX] = { 0 };
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
for (n = 0; n < MAX_DEV_SEQ; n++) {
|
||||||
|
snprintf(name, sizeof(name), "/dev/teepriv%zu", n);
|
||||||
|
fd = open_dev(name, gen_caps);
|
||||||
|
if (fd >= 0)
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int usage(int status)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage: tee-supplicant [options] [<device-name>]\n");
|
||||||
|
fprintf(stderr, "\t-h, --help: this help\n");
|
||||||
|
fprintf(stderr, "\t-d, --daemonize: run as a daemon (fork and return "
|
||||||
|
"after child has opened the TEE device or on error)\n");
|
||||||
|
fprintf(stderr, "\t-f, --fs-parent-path: secure fs parent path [%s]\n",
|
||||||
|
supplicant_params.fs_parent_path);
|
||||||
|
fprintf(stderr, "\t-t, --ta-dir: TAs dirname under %s [%s]\n", TEEC_LOAD_PATH,
|
||||||
|
supplicant_params.ta_dir);
|
||||||
|
fprintf(stderr, "\t-p, --plugin-path: plugin load path [%s]\n",
|
||||||
|
supplicant_params.plugin_load_path);
|
||||||
|
fprintf(stderr, "\t-r, --rpmb-cid: RPMB device identification register "
|
||||||
|
"(CID) in hexadecimal\n");
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t process_rpmb(size_t num_params, struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_SharedMemory req;
|
||||||
|
TEEC_SharedMemory rsp;
|
||||||
|
|
||||||
|
memset(&req, 0, sizeof(req));
|
||||||
|
memset(&rsp, 0, sizeof(rsp));
|
||||||
|
|
||||||
|
if (get_param(num_params, params, 0, &req) ||
|
||||||
|
get_param(num_params, params, 1, &rsp))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
return rpmb_process_request(req.buffer, req.size, rsp.buffer, rsp.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint32_t process_nvme_rpmb(size_t num_params, struct tee_ioctl_param *params)
|
||||||
|
{
|
||||||
|
TEEC_SharedMemory req;
|
||||||
|
TEEC_SharedMemory rsp;
|
||||||
|
|
||||||
|
memset(&req, 0, sizeof(req));
|
||||||
|
memset(&rsp, 0, sizeof(rsp));
|
||||||
|
|
||||||
|
if (get_param(num_params, params, 0, &req) ||
|
||||||
|
get_param(num_params, params, 1, &rsp))
|
||||||
|
return TEEC_ERROR_BAD_PARAMETERS;
|
||||||
|
|
||||||
|
return nvme_rpmb_process_request(req.buffer, req.size, rsp.buffer, rsp.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_request(int fd, union tee_rpc_invoke *request)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_buf_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
data.buf_ptr = (uintptr_t)request;
|
||||||
|
data.buf_len = sizeof(*request);
|
||||||
|
if (ioctl(fd, TEE_IOC_SUPPL_RECV, &data)) {
|
||||||
|
EMSG("TEE_IOC_SUPPL_RECV: %s", strerror(errno));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool write_response(int fd, union tee_rpc_invoke *request)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_buf_data data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
|
||||||
|
data.buf_ptr = (uintptr_t)&request->send;
|
||||||
|
data.buf_len = sizeof(struct tee_iocl_supp_send_arg) +
|
||||||
|
sizeof(struct tee_ioctl_param) *
|
||||||
|
(__u64)request->send.num_params;
|
||||||
|
if (ioctl(fd, TEE_IOC_SUPPL_SEND, &data)) {
|
||||||
|
EMSG("TEE_IOC_SUPPL_SEND: %s", strerror(errno));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool find_params(union tee_rpc_invoke *request, uint32_t *func,
|
||||||
|
size_t *num_params, struct tee_ioctl_param **params,
|
||||||
|
size_t *num_meta)
|
||||||
|
{
|
||||||
|
struct tee_ioctl_param *p = NULL;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
p = (struct tee_ioctl_param *)(&request->recv + 1);
|
||||||
|
|
||||||
|
/* Skip meta parameters in the front */
|
||||||
|
for (n = 0; n < request->recv.num_params; n++)
|
||||||
|
if (!(p[n].attr & TEE_IOCTL_PARAM_ATTR_META))
|
||||||
|
break;
|
||||||
|
|
||||||
|
*func = request->recv.func;
|
||||||
|
*num_params = request->recv.num_params - n;
|
||||||
|
*params = p + n;
|
||||||
|
*num_meta = n;
|
||||||
|
|
||||||
|
/* Make sure that no meta parameters follows a non-meta parameter */
|
||||||
|
for (; n < request->recv.num_params; n++) {
|
||||||
|
if (p[n].attr & TEE_IOCTL_PARAM_ATTR_META) {
|
||||||
|
EMSG("Unexpected meta parameter");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool spawn_thread(struct thread_arg *arg)
|
||||||
|
{
|
||||||
|
int e = 0;
|
||||||
|
pthread_t tid;
|
||||||
|
|
||||||
|
memset(&tid, 0, sizeof(tid));
|
||||||
|
|
||||||
|
DMSG("Spawning a new thread");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Increase number of waiters now to avoid starting another thread
|
||||||
|
* before this thread has been scheduled.
|
||||||
|
*/
|
||||||
|
num_waiters_inc(arg);
|
||||||
|
|
||||||
|
e = pthread_create(&tid, NULL, thread_main, arg);
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_create: %s", strerror(e));
|
||||||
|
num_waiters_dec(arg);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = pthread_detach(tid);
|
||||||
|
if (e)
|
||||||
|
EMSG("pthread_detach: %s", strerror(e));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool process_one_request(struct thread_arg *arg)
|
||||||
|
{
|
||||||
|
size_t num_params = 0;
|
||||||
|
size_t num_meta = 0;
|
||||||
|
struct tee_ioctl_param *params = NULL;
|
||||||
|
uint32_t func = 0;
|
||||||
|
uint32_t ret = 0;
|
||||||
|
union tee_rpc_invoke request;
|
||||||
|
|
||||||
|
memset(&request, 0, sizeof(request));
|
||||||
|
|
||||||
|
DMSG("looping");
|
||||||
|
request.recv.num_params = RPC_NUM_PARAMS;
|
||||||
|
|
||||||
|
/* Let it be known that we can deal with meta parameters */
|
||||||
|
params = (struct tee_ioctl_param *)(&request.send + 1);
|
||||||
|
params->attr = TEE_IOCTL_PARAM_ATTR_META;
|
||||||
|
|
||||||
|
num_waiters_inc(arg);
|
||||||
|
|
||||||
|
if (!read_request(arg->fd, &request))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!find_params(&request, &func, &num_params, ¶ms, &num_meta))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (num_meta && !num_waiters_dec(arg) && !spawn_thread(arg))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch (func) {
|
||||||
|
case OPTEE_MSG_RPC_CMD_LOAD_TA:
|
||||||
|
ret = load_ta(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_FS:
|
||||||
|
ret = tee_supp_fs_process(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_RPMB:
|
||||||
|
ret = process_rpmb(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_SHM_ALLOC:
|
||||||
|
ret = process_alloc(arg, num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_SHM_FREE:
|
||||||
|
ret = process_free(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_GPROF:
|
||||||
|
ret = prof_process(num_params, params, "gmon-");
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_SOCKET:
|
||||||
|
ret = tee_socket_process(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_FTRACE:
|
||||||
|
ret = prof_process(num_params, params, "ftrace-");
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_PLUGIN:
|
||||||
|
ret = plugin_process(num_params, params);
|
||||||
|
break;
|
||||||
|
case OPTEE_MSG_RPC_CMD_NVME_RPMB:
|
||||||
|
ret = process_nvme_rpmb(num_params, params);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
EMSG("Cmd [0x%" PRIx32 "] not supported", func);
|
||||||
|
/* Not supported. */
|
||||||
|
ret = TEEC_ERROR_NOT_SUPPORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.send.ret = ret;
|
||||||
|
return write_response(arg->fd, &request);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *thread_main(void *a)
|
||||||
|
{
|
||||||
|
struct thread_arg *arg = a;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now that this thread has been scheduled, compensate for the
|
||||||
|
* initial increase in spawn_thread() before.
|
||||||
|
*/
|
||||||
|
num_waiters_dec(arg);
|
||||||
|
|
||||||
|
while (!arg->abort) {
|
||||||
|
if (!process_one_request(arg))
|
||||||
|
arg->abort = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEEC_TEST_LOAD_PATH "/foo:/bar::/baz"
|
||||||
|
|
||||||
|
static void set_ta_path(void)
|
||||||
|
{
|
||||||
|
char *p = NULL;
|
||||||
|
char *saveptr = NULL;
|
||||||
|
const char *path = (char *)
|
||||||
|
#ifdef TEEC_TEST_LOAD_PATH
|
||||||
|
TEEC_TEST_LOAD_PATH ":"
|
||||||
|
#endif
|
||||||
|
TEEC_LOAD_PATH;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
ta_path_str = strdup(path);
|
||||||
|
if (!ta_path_str)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
p = ta_path_str;
|
||||||
|
while (strtok_r(p, ":", &saveptr)) {
|
||||||
|
p = NULL;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
n++; /* NULL terminator */
|
||||||
|
|
||||||
|
ta_path = malloc(n * sizeof(char *));
|
||||||
|
if (!ta_path)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
strcpy(ta_path_str, path);
|
||||||
|
p = ta_path_str;
|
||||||
|
while ((ta_path[n++] = strtok_r(p, ":", &saveptr)))
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
|
return;
|
||||||
|
err:
|
||||||
|
EMSG("out of memory");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Similar to the standard libc function daemon(0, 0) but the parent process
|
||||||
|
* issues a blocking read on pipefd[0] before exiting.
|
||||||
|
* Returns 0 on success, <0 on error.
|
||||||
|
*/
|
||||||
|
static int make_daemon(int pipefd[2])
|
||||||
|
{
|
||||||
|
int fd = 0;
|
||||||
|
char c = 0;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
switch (fork()) {
|
||||||
|
case -1:
|
||||||
|
return -1;
|
||||||
|
case 0:
|
||||||
|
/* In child */
|
||||||
|
close(pipefd[0]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* In parent */
|
||||||
|
close(pipefd[1]);
|
||||||
|
n = read(pipefd[0], &c, 1);
|
||||||
|
close(pipefd[0]);
|
||||||
|
if (!n) {
|
||||||
|
/*
|
||||||
|
* Nothing has been read: child has closed without
|
||||||
|
* writing (either exited on error or crashed)
|
||||||
|
*/
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
/* Child is done with the opening of the TEE device */
|
||||||
|
_exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setsid() < 0)
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
if (chdir("/") < 0)
|
||||||
|
return -3;
|
||||||
|
|
||||||
|
fd = open("/dev/null", O_RDWR);
|
||||||
|
if (fd < 0)
|
||||||
|
return -4;
|
||||||
|
dup2(fd, 0);
|
||||||
|
dup2(fd, 1);
|
||||||
|
dup2(fd, 2);
|
||||||
|
close(fd);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
struct thread_arg arg = { .fd = -1 };
|
||||||
|
int pipefd[2] = { 0, };
|
||||||
|
bool daemonize = false;
|
||||||
|
char *dev = NULL;
|
||||||
|
int e = 0;
|
||||||
|
int long_index = 0;
|
||||||
|
int opt = 0;
|
||||||
|
|
||||||
|
e = pthread_mutex_init(&arg.mutex, NULL);
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_init: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct option long_options[] = {
|
||||||
|
/* long name | has argument | flag | short value */
|
||||||
|
{ "help", no_argument, 0, 'h' },
|
||||||
|
{ "daemonize", no_argument, 0, 'd' },
|
||||||
|
{ "fs-parent-path", required_argument, 0, 'f' },
|
||||||
|
{ "ta-dir", required_argument, 0, 't' },
|
||||||
|
{ "plugin-path", required_argument, 0, 'p' },
|
||||||
|
{ "rpmb-cid", required_argument, 0, 'r' },
|
||||||
|
{ 0, 0, 0, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
while ((opt = getopt_long(argc, argv, "hdf:t:p:r:",
|
||||||
|
long_options, &long_index )) != -1) {
|
||||||
|
switch (opt) {
|
||||||
|
case 'h' :
|
||||||
|
return usage(EXIT_SUCCESS);
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
daemonize = true;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
supplicant_params.fs_parent_path = optarg;
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
supplicant_params.ta_dir = optarg;
|
||||||
|
break;
|
||||||
|
case 'p':
|
||||||
|
supplicant_params.plugin_load_path = optarg;
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
supplicant_params.rpmb_cid = optarg;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return usage(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* check for non option argument, which is device name */
|
||||||
|
if (argv[optind]) {
|
||||||
|
fprintf(stderr, "Using device %s.\n", argv[optind]);
|
||||||
|
dev = argv[optind];
|
||||||
|
/* check that we do not have too many arguments */
|
||||||
|
if (argv[optind + 1]) {
|
||||||
|
fprintf(stderr, "Too many arguments passed: extra argument: %s.\n",
|
||||||
|
argv[optind+1]);
|
||||||
|
return usage(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
set_ta_path();
|
||||||
|
|
||||||
|
if (plugin_load_all() != 0) {
|
||||||
|
EMSG("failed to load plugins");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (daemonize) {
|
||||||
|
if (pipe(pipefd) < 0) {
|
||||||
|
EMSG("pipe(): %s", strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
e = make_daemon(pipefd);
|
||||||
|
if (e < 0) {
|
||||||
|
EMSG("make_daemon(): %d", e);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev) {
|
||||||
|
arg.fd = open_dev(dev, &arg.gen_caps);
|
||||||
|
if (arg.fd < 0) {
|
||||||
|
EMSG("failed to open \"%s\"", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
arg.fd = get_dev_fd(&arg.gen_caps);
|
||||||
|
if (arg.fd < 0) {
|
||||||
|
EMSG("failed to find an OP-TEE supplicant device");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (daemonize) {
|
||||||
|
/* Release parent */
|
||||||
|
if (write(pipefd[1], "", 1) != 1) {
|
||||||
|
EMSG("write(): %s", strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
close(pipefd[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!arg.abort) {
|
||||||
|
if (!process_one_request(&arg))
|
||||||
|
arg.abort = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(arg.fd);
|
||||||
|
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool tee_supp_param_is_memref(struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool tee_supp_param_is_value(struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
|
||||||
|
case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *tee_supp_param_to_va(struct tee_ioctl_param *param)
|
||||||
|
{
|
||||||
|
struct tee_shm *tshm = NULL;
|
||||||
|
size_t end_offs = 0;
|
||||||
|
|
||||||
|
if (!tee_supp_param_is_memref(param))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
end_offs = MEMREF_SIZE(param) + MEMREF_SHM_OFFS(param);
|
||||||
|
if (end_offs < MEMREF_SIZE(param) || end_offs < MEMREF_SHM_OFFS(param))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
tshm = find_tshm(MEMREF_SHM_ID(param));
|
||||||
|
if (!tshm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (end_offs > tshm->size)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return (uint8_t *)tshm->p + MEMREF_SHM_OFFS(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tee_supp_mutex_lock(pthread_mutex_t *mu)
|
||||||
|
{
|
||||||
|
int e = pthread_mutex_lock(mu);
|
||||||
|
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_lock: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void tee_supp_mutex_unlock(pthread_mutex_t *mu)
|
||||||
|
{
|
||||||
|
int e = pthread_mutex_unlock(mu);
|
||||||
|
|
||||||
|
if (e) {
|
||||||
|
EMSG("pthread_mutex_unlock: %s", strerror(e));
|
||||||
|
EMSG("terminating...");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
58
optee/optee_client/tee-supplicant/src/tee_supplicant.h
Normal file
58
optee/optee_client/tee-supplicant/src/tee_supplicant.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, Linaro Limited
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef TEE_SUPPLICANT_H
|
||||||
|
#define TEE_SUPPLICANT_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
/* Helpers to access memref parts of a struct tee_ioctl_param */
|
||||||
|
#define MEMREF_SHM_ID(p) ((p)->c)
|
||||||
|
#define MEMREF_SHM_OFFS(p) ((p)->a)
|
||||||
|
#define MEMREF_SIZE(p) ((p)->b)
|
||||||
|
|
||||||
|
struct tee_ioctl_param;
|
||||||
|
|
||||||
|
/* Global tee-supplicant parameters */
|
||||||
|
struct tee_supplicant_params {
|
||||||
|
const char *ta_dir;
|
||||||
|
const char *plugin_load_path;
|
||||||
|
const char *fs_parent_path;
|
||||||
|
const char *rpmb_cid;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct tee_supplicant_params supplicant_params;
|
||||||
|
|
||||||
|
bool tee_supp_param_is_memref(struct tee_ioctl_param *param);
|
||||||
|
bool tee_supp_param_is_value(struct tee_ioctl_param *param);
|
||||||
|
void *tee_supp_param_to_va(struct tee_ioctl_param *param);
|
||||||
|
|
||||||
|
void tee_supp_mutex_lock(pthread_mutex_t *mu);
|
||||||
|
void tee_supp_mutex_unlock(pthread_mutex_t *mu);
|
||||||
|
|
||||||
|
#endif /*TEE_SUPPLICANT_H*/
|
||||||
192
optee/optee_client/tee-supplicant/src/teec_ta_load.c
Normal file
192
optee/optee_client/tee-supplicant/src/teec_ta_load.c
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#include <teec_trace.h>
|
||||||
|
#include <teec_ta_load.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Attempt to first load TAs from a writable directory. This is
|
||||||
|
* intended for testing (xtest 1008, load_corrupt_ta specifically),
|
||||||
|
* and should not be enabled in a production system, as it would
|
||||||
|
* greatly facilitate loading rogue TA code.
|
||||||
|
*/
|
||||||
|
#ifdef CFG_TA_TEST_PATH
|
||||||
|
# ifndef TEEC_TEST_LOAD_PATH
|
||||||
|
# ifdef __ANDROID__
|
||||||
|
# define TEEC_TEST_LOAD_PATH "/data/vendor/tee"
|
||||||
|
# else
|
||||||
|
# define TEEC_TEST_LOAD_PATH "/tmp"
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct tee_rpc_cmd {
|
||||||
|
void *buffer;
|
||||||
|
uint32_t size;
|
||||||
|
uint32_t type;
|
||||||
|
int fd;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Based on the uuid this function will try to find a TA-binary on the
|
||||||
|
* filesystem and return it back to the caller in the parameter ta.
|
||||||
|
*
|
||||||
|
* @param: prefix Prefix for TA load path
|
||||||
|
* @param: dev_path Where to load the TA from. The full path to the TA
|
||||||
|
* binary is @prefix/@dev_path/@destination.ta.
|
||||||
|
* @param: destination The uuid of the TA we are searching for.
|
||||||
|
* @param: ta A pointer which this function will allocate and copy
|
||||||
|
* the TA from the filesystem to the pointer itself. It is
|
||||||
|
* the callers responsibility to free the pointer.
|
||||||
|
* @param: ta_size The size of the TA found on file system. It will be 0
|
||||||
|
* if no TA was not found.
|
||||||
|
*
|
||||||
|
* @return 0 if TA was found, otherwise -1.
|
||||||
|
*/
|
||||||
|
static int try_load_secure_module(const char* prefix,
|
||||||
|
const char* dev_path,
|
||||||
|
const TEEC_UUID *destination, void *ta,
|
||||||
|
size_t *ta_size)
|
||||||
|
{
|
||||||
|
char fname[PATH_MAX] = { 0 };
|
||||||
|
FILE *file = NULL;
|
||||||
|
bool first_try = true;
|
||||||
|
size_t s = 0;
|
||||||
|
long l = 0;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
if (!ta_size || !destination) {
|
||||||
|
DMSG("wrong inparameter to TEECI_LoadSecureModule");
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We expect the TA binary to be named after the UUID as per RFC4122,
|
||||||
|
* that is: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.ta
|
||||||
|
* If the file cannot be open, try the deprecated format:
|
||||||
|
* xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx.ta
|
||||||
|
*/
|
||||||
|
again:
|
||||||
|
n = snprintf(fname, PATH_MAX,
|
||||||
|
"%s/%s/%08x-%04x-%04x-%02x%02x%s%02x%02x%02x%02x%02x%02x.ta",
|
||||||
|
prefix, dev_path,
|
||||||
|
destination->timeLow,
|
||||||
|
destination->timeMid,
|
||||||
|
destination->timeHiAndVersion,
|
||||||
|
destination->clockSeqAndNode[0],
|
||||||
|
destination->clockSeqAndNode[1],
|
||||||
|
first_try ? "-" : "",
|
||||||
|
destination->clockSeqAndNode[2],
|
||||||
|
destination->clockSeqAndNode[3],
|
||||||
|
destination->clockSeqAndNode[4],
|
||||||
|
destination->clockSeqAndNode[5],
|
||||||
|
destination->clockSeqAndNode[6],
|
||||||
|
destination->clockSeqAndNode[7]);
|
||||||
|
|
||||||
|
DMSG("Attempt to load %s", fname);
|
||||||
|
|
||||||
|
if ((n < 0) || (n >= PATH_MAX)) {
|
||||||
|
EMSG("wrong TA path [%s]", fname);
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
file = fopen(fname, "r");
|
||||||
|
if (file == NULL) {
|
||||||
|
DMSG("failed to open the ta %s TA-file", fname);
|
||||||
|
if (first_try) {
|
||||||
|
first_try = false;
|
||||||
|
goto again;
|
||||||
|
}
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fseek(file, 0, SEEK_END) != 0) {
|
||||||
|
fclose(file);
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
l = ftell(file);
|
||||||
|
if (l < 0) {
|
||||||
|
DMSG("failed to ftell the ta %s TA-file", fname);
|
||||||
|
fclose(file);
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
s = l;
|
||||||
|
if (s > *ta_size || !ta) {
|
||||||
|
/*
|
||||||
|
* Buffer isn't large enough, return the required size to
|
||||||
|
* let the caller increase the size of the buffer and try
|
||||||
|
* again.
|
||||||
|
*/
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fseek(file, 0, SEEK_SET) != 0) {
|
||||||
|
fclose(file);
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s != fread(ta, 1, s, file)) {
|
||||||
|
DMSG("failed to fread the ta %s TA-file", fname);
|
||||||
|
fclose(file);
|
||||||
|
return TA_BINARY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
*ta_size = s;
|
||||||
|
fclose(file);
|
||||||
|
return TA_BINARY_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TEECI_LoadSecureModule(const char* dev_path,
|
||||||
|
const TEEC_UUID *destination, void *ta,
|
||||||
|
size_t *ta_size)
|
||||||
|
{
|
||||||
|
int res = TA_BINARY_NOT_FOUND;
|
||||||
|
char **path = NULL;
|
||||||
|
|
||||||
|
for (path = ta_path; *path; path++) {
|
||||||
|
res = try_load_secure_module(*path, dev_path, destination, ta,
|
||||||
|
ta_size);
|
||||||
|
if (res == TA_BINARY_FOUND)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
55
optee/optee_client/tee-supplicant/src/teec_ta_load.h
Normal file
55
optee/optee_client/tee-supplicant/src/teec_ta_load.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, STMicroelectronics International N.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef _TEEC_TA_LOAD_H
|
||||||
|
#define _TEEC_TA_LOAD_H
|
||||||
|
#include <tee_client_api.h>
|
||||||
|
|
||||||
|
#define TA_BINARY_FOUND 0
|
||||||
|
#define TA_BINARY_NOT_FOUND -1
|
||||||
|
|
||||||
|
/* Heap copy of TA load paths, separated by '\0' (access via ta_path) */
|
||||||
|
extern char *ta_path_str;
|
||||||
|
/* NULL-terminated list of paths (pointers into ta_path_str) */
|
||||||
|
extern char **ta_path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Based on the uuid this function will try to find a TA-binary on the
|
||||||
|
* filesystem and return it back to the caller in the parameter ta.
|
||||||
|
*
|
||||||
|
* @param: destination The uuid of the TA we are searching for.
|
||||||
|
* @param: ta A pointer which this function will copy
|
||||||
|
* the TA from the filesystem to if *@ta_size i large
|
||||||
|
* enough.
|
||||||
|
* @param: ta_size The size of the TA found on file system. It will be 0
|
||||||
|
* if no TA was not found.
|
||||||
|
*
|
||||||
|
* @return 0 if TA was found, otherwise -1.
|
||||||
|
*/
|
||||||
|
int TEECI_LoadSecureModule(const char *name,
|
||||||
|
const TEEC_UUID *destination, void *ta,
|
||||||
|
size_t *ta_size);
|
||||||
|
#endif
|
||||||
74
optee/optee_client/tee-supplicant/tee_supplicant_android.mk
Normal file
74
optee/optee_client/tee-supplicant/tee_supplicant_android.mk
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
################################################################################
|
||||||
|
# Build tee supplicant #
|
||||||
|
################################################################################
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_CFLAGS += $(optee_CFLAGS)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -DDEBUGLEVEL_$(CFG_TEE_SUPP_LOG_LEVEL) \
|
||||||
|
-DBINARY_PREFIX=\"TEES\" \
|
||||||
|
-DTEE_FS_PARENT_PATH=\"$(CFG_TEE_FS_PARENT_PATH)\" \
|
||||||
|
-DTEEC_LOAD_PATH=\"$(CFG_TEE_CLIENT_LOAD_PATH)\"
|
||||||
|
|
||||||
|
ifneq ($(TEEC_TEST_LOAD_PATH),)
|
||||||
|
LOCAL_CFLAGS += -DTEEC_TEST_LOAD_PATH=\"$(TEEC_TEST_LOAD_PATH)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_TA_TEST_PATH),y)
|
||||||
|
LOCAL_CFLAGS += -DCFG_TA_TEST_PATH=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES += src/tee_supplicant.c \
|
||||||
|
src/teec_ta_load.c \
|
||||||
|
src/tee_supp_fs.c \
|
||||||
|
src/rpmb.c \
|
||||||
|
src/handle.c
|
||||||
|
|
||||||
|
ifeq ($(CFG_GP_SOCKETS),y)
|
||||||
|
LOCAL_SRC_FILES += src/tee_socket.c
|
||||||
|
LOCAL_CFLAGS += -DCFG_GP_SOCKETS=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
RPMB_EMU ?= 1
|
||||||
|
ifeq ($(RPMB_EMU),1)
|
||||||
|
LOCAL_SRC_FILES += src/sha2.c src/hmac_sha2.c
|
||||||
|
LOCAL_CFLAGS += -DRPMB_EMU=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter y,$(CFG_TA_GPROF_SUPPORT) $(CFG_FTRACE_SUPPORT)))
|
||||||
|
LOCAL_SRC_FILES += src/prof.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_TA_GPROF_SUPPORT),y)
|
||||||
|
LOCAL_CFLAGS += -DCFG_TA_GPROF_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_TEE_SUPP_PLUGINS),y)
|
||||||
|
LOCAL_SRC_FILES += src/plugin.c
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -DTEE_SUPP_PLUGINS \
|
||||||
|
-DTEE_PLUGIN_LOAD_PATH=\"$(CFG_TEE_PLUGIN_LOAD_PATH)\"
|
||||||
|
|
||||||
|
# Needed to dynamically load user plugins
|
||||||
|
LOCAL_LDFLAGS += -ldl
|
||||||
|
# Needed for dlopen()
|
||||||
|
LOCAL_LDFLAGS += -Wl,-rpath=$(CFG_TEE_PLUGIN_LOAD_PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -pthread
|
||||||
|
|
||||||
|
ifeq ($(CFG_FTRACE_SUPPORT),y)
|
||||||
|
LOCAL_CFLAGS += -DCFG_FTRACE_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../public \
|
||||||
|
$(LOCAL_PATH)/../libteec/include \
|
||||||
|
$(LOCAL_PATH)/src
|
||||||
|
|
||||||
|
LOCAL_SHARED_LIBRARIES := libteec
|
||||||
|
|
||||||
|
LOCAL_MODULE := tee-supplicant
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
80
optee/optee_client/typedefs.checkpatch
Normal file
80
optee/optee_client/typedefs.checkpatch
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
# Note: please keep the entries in this file sorted in reverse alphabetical
|
||||||
|
# order (sort -r)
|
||||||
|
TEEC_Result
|
||||||
|
TEEC_Context
|
||||||
|
TEEC_UUID
|
||||||
|
TEEC_SharedMemory
|
||||||
|
TEEC_TempMemoryReference
|
||||||
|
TEEC_RegisteredMemoryReference
|
||||||
|
TEEC_Value
|
||||||
|
TEEC_Parameter
|
||||||
|
TEEC_Session
|
||||||
|
TEEC_Operation
|
||||||
|
CK_VOID_PTR_PTR
|
||||||
|
CK_VOID_PTR
|
||||||
|
CK_VERSION_PTR
|
||||||
|
CK_VERSION
|
||||||
|
CK_UTF8CHAR_PTR
|
||||||
|
CK_UTF8CHAR
|
||||||
|
CK_USER_TYPE
|
||||||
|
CK_UNLOCKMUTEX
|
||||||
|
CK_ULONG_PTR
|
||||||
|
CK_ULONG
|
||||||
|
CK_TOKEN_INFO_PTR
|
||||||
|
CK_TOKEN_INFO
|
||||||
|
CK_STATE
|
||||||
|
CK_SLOT_INFO_PTR
|
||||||
|
CK_SLOT_INFO
|
||||||
|
CK_SLOT_ID_PTR
|
||||||
|
CK_SLOT_ID
|
||||||
|
CK_SESSION_INFO_PTR
|
||||||
|
CK_SESSION_INFO
|
||||||
|
CK_SESSION_HANDLE_PTR
|
||||||
|
CK_SESSION_HANDLE
|
||||||
|
CK_RV
|
||||||
|
CK_OBJECT_HANDLE_PTR
|
||||||
|
CK_OBJECT_HANDLE
|
||||||
|
CK_OBJECT_CLASS_PTR
|
||||||
|
CK_OBJECT_CLASS
|
||||||
|
CK_NOTIFY
|
||||||
|
CK_NOTIFICATION
|
||||||
|
CK_MECHANISM_TYPE_PTR
|
||||||
|
CK_MECHANISM_TYPE
|
||||||
|
CK_MECHANISM_PTR
|
||||||
|
CK_MECHANISM_INFO_PTR
|
||||||
|
CK_MECHANISM_INFO
|
||||||
|
CK_MECHANISM
|
||||||
|
CK_MAC_GENERAL_PARAMS_PTR
|
||||||
|
CK_MAC_GENERAL_PARAMS
|
||||||
|
CK_LONG
|
||||||
|
CK_LOCKMUTEX
|
||||||
|
CK_KEY_TYPE_PTR
|
||||||
|
CK_KEY_TYPE
|
||||||
|
CK_INFO_PTR
|
||||||
|
CK_INFO
|
||||||
|
CK_GCM_PARAMS_PTR
|
||||||
|
CK_GCM_PARAMS
|
||||||
|
CK_FUNCTION_LIST_PTR_PTR
|
||||||
|
CK_FUNCTION_LIST_PTR
|
||||||
|
CK_FUNCTION_LIST
|
||||||
|
CK_FLAGS
|
||||||
|
CK_DESTROYMUTEX
|
||||||
|
CK_DATE_PTR
|
||||||
|
CK_DATE
|
||||||
|
CK_CREATEMUTEX
|
||||||
|
CK_C_INITIALIZE_ARGS_PTR
|
||||||
|
CK_C_INITIALIZE_ARGS
|
||||||
|
CK_CHAR_PTR
|
||||||
|
CK_CHAR
|
||||||
|
CK_CCM_PARAMS_PTR
|
||||||
|
CK_CCM_PARAMS
|
||||||
|
CK_BYTE_PTR
|
||||||
|
CK_BYTE
|
||||||
|
CK_BBOOL
|
||||||
|
CK_ATTRIBUTE_TYPE
|
||||||
|
CK_ATTRIBUTE_PTR
|
||||||
|
CK_ATTRIBUTE
|
||||||
|
CK_AES_CTR_PARAMS_PTR
|
||||||
|
CK_AES_CTR_PARAMS
|
||||||
|
CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR
|
||||||
|
CK_AES_CBC_ENCRYPT_DATA_PARAMS
|
||||||
13
optee/optee_os/.checkpatch.conf
Normal file
13
optee/optee_os/.checkpatch.conf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
--codespell
|
||||||
|
--no-tree
|
||||||
|
--quiet
|
||||||
|
--strict
|
||||||
|
--max-line-length=80
|
||||||
|
--ignore=CAMELCASE
|
||||||
|
--ignore=CONCATENATED_STRING
|
||||||
|
--ignore=FILE_PATH_CHANGES
|
||||||
|
--ignore=GERRIT_CHANGE_ID
|
||||||
|
--ignore=NOT_UNIFIED_DIFF
|
||||||
|
--ignore=PREFER_KERNEL_TYPES
|
||||||
|
--ignore=USLEEP_RANGE
|
||||||
|
--kconfig-prefix=CFG_
|
||||||
21
optee/optee_os/.github/issue_template.md
vendored
Normal file
21
optee/optee_os/.github/issue_template.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<!--
|
||||||
|
General guidance when creating issues:
|
||||||
|
|
||||||
|
1. Please try to remember to close the issue when you have
|
||||||
|
got an answer to your question.
|
||||||
|
|
||||||
|
2. It never hurts to state which commit or release tag you are using in case
|
||||||
|
the question is about build issues.
|
||||||
|
|
||||||
|
3. Try to use GitHub markdown formatting to make your issue more readable:
|
||||||
|
https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax#quoting-code
|
||||||
|
|
||||||
|
4. Try to search for the issue before posting the question:
|
||||||
|
-> Issues tab -> Filters
|
||||||
|
|
||||||
|
5. Check the FAQ before posting a question:
|
||||||
|
https://optee.readthedocs.io/en/latest/faq/faq.html
|
||||||
|
|
||||||
|
NOTE: This comment will not be shown in the issue, so no harm keeping it,
|
||||||
|
but feel free to remove it if you like.
|
||||||
|
-->
|
||||||
19
optee/optee_os/.github/pull_request_template.md
vendored
Normal file
19
optee/optee_os/.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!--
|
||||||
|
If you are new to submitting pull requests to OP-TEE, then please have a
|
||||||
|
look at the list below and tick them off before submitting the pull request.
|
||||||
|
|
||||||
|
1. Read our contribution guidelines:
|
||||||
|
https://optee.readthedocs.io/en/latest/general/contribute.html
|
||||||
|
|
||||||
|
2. Read the contribution section in Notice.md and pay extra attention to the
|
||||||
|
"Developer Certificate of Origin" in the contribution guidelines.
|
||||||
|
|
||||||
|
3. You should run checkpatch preferably before submitting the pull request.
|
||||||
|
|
||||||
|
4. When everything has been reviewed, you will need to squash, rebase and
|
||||||
|
add tags like `Reviewed-by`, `Acked-by`, `Tested-by` etc. More details
|
||||||
|
about this can also be found on the link provided above.
|
||||||
|
|
||||||
|
NOTE: This comment will not be shown in the pull request, so no harm keeping
|
||||||
|
it, but feel free to remove it if you like.
|
||||||
|
-->
|
||||||
22
optee/optee_os/.github/workflows/ci-cancel.yml
vendored
Normal file
22
optee/optee_os/.github/workflows/ci-cancel.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Cancel previous CI workflows that are still running when a new one is
|
||||||
|
# requested with the same ID. Happens when a branch is pushed to,
|
||||||
|
# including when a PR is updated. It would be wasteful to leave CI
|
||||||
|
# running on obsolete content.
|
||||||
|
# See https://github.com/marketplace/actions/cancel-workflow-action#advanced-pull-requests-from-forks
|
||||||
|
name: Cancel obsolete CI
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [CI]
|
||||||
|
types: [requested]
|
||||||
|
branches-ignore: [master]
|
||||||
|
permissions: {}
|
||||||
|
jobs:
|
||||||
|
cancel:
|
||||||
|
permissions:
|
||||||
|
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
|
||||||
|
name: Cancel obsolete CI workflows
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: styfle/cancel-workflow-action@0.10.0
|
||||||
|
with:
|
||||||
|
workflow_id: ${{ github.event.workflow.id }}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user