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
f46edaa2a89ec59f46ac2287ba4a421c658929c3 - optee_src_build.sh d15f50688485e11293e0d0bd66d73655e79f7718 - nvcommon_build.sh 3fc87cf98488189e0f455c77ff7f17927c0f49a7 - optee/tegra234-optee.dts f17a52a204d42c6699bdc375e3aace6bcdcfdbf9 - optee/tegra194-optee.dts 21f0311895dab20e239a07f1d655ba2a4ef9f740 - optee/optee_os/MAINTAINERS eef25ac1c8ac71a1eed3b0a642394f7cc1308da3 - optee/optee_os/CHANGELOG.md cc2c39890c49fce1d5330a99b4180f277d31008e - 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 af7e0575658caf5c09c01df12c4499d2f8991efb - optee/optee_os/.azure-pipelines.yml c8b24a44047ee584e7f3af8c811637a0eb946d9d - optee/optee_os/typedefs.checkpatch bbed5b90884245b5c3ff961d4918db06ef372f25 - 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 6c74d0ea3907b1aab19f4776396d8750735fb125 - optee/optee_os/scripts/symbolize.py ab4324da2d6fb92edbcaa95bc23911ed63e4514d - optee/optee_os/scripts/arm32_sysreg.py 1149e9239d6df83aea1f59bf35377b8a4a4b61e3 - optee/optee_os/scripts/ts_bin_to_c.py 739132afa78f7893b32ea4af8688adfeb418edcd - optee/optee_os/scripts/bin_to_c.py ff049eaebed3e08d988cb5f11ead01795f787365 - 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 90bc17910c7593722e8d474c2bc9a1ec393fd371 - optee/optee_os/scripts/get_maintainer.py eaf89e7cb8261c02b4014ec78e58cdf64864a85c - optee/optee_os/scripts/checkpatch_inc.sh d5a2bcdf867452c172a4918936681d3ab8bd175e - optee/optee_os/scripts/gen_tee_bin.py 570bf1d2a225e0124496bc57c287ff0991fd023a - optee/optee_os/scripts/gen_stmm_hex.py d302da149f2f0d0b11b9c365bf3add51a131b8a9 - optee/optee_os/scripts/gen_ldelf_hex.py 51925b6bd9171dbe3d015a514497db4c2c193d2c - optee/optee_os/scripts/dump_ta_header.py c5d1a1d261c8bada5f949335bffe29a029d03e05 - optee/optee_os/ldelf/syscalls_a32.S db3db1aeff618f5696eb16e7076b63464784267e - optee/optee_os/ldelf/syscalls_asm.S 0f6e8540957074f112a95a1c89ca23dedd2a5f3b - optee/optee_os/ldelf/ta_elf_rel.c a9b2ffd0fe50a1d61e43db42366b9d2e7093e68e - optee/optee_os/ldelf/ldelf.ld.S cb079ab7bac5d488cf5375c1b028130bcb2c7997 - optee/optee_os/ldelf/sys.h 0ddc0b948c5e45562c3bb872f166a2716a27555c - optee/optee_os/ldelf/main.c 87d8438d725c689049dabad1a58459a5efaaef0a - optee/optee_os/ldelf/dl.c acc02cdc5871c88615cd3d46cc714ae689ad53bd - optee/optee_os/ldelf/ta_elf.c 29a349fad517b13af907e7705113c3831dccd9e9 - optee/optee_os/ldelf/syscalls_a64.S edfdf25acf220064bdc2c6e21b5ab0f7a5256386 - 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 2ed4dc452f938f6fc13777d795e35e581a3a78dc - optee/optee_os/ldelf/include/ldelf.h 73ca91bd849724101afd84c8dbbcbe35f51bd19f - optee/optee_os/core/mm/fobj.c 08d03010e77fb186cb8543e02dcf3e78ac3faccb - optee/optee_os/core/mm/mobj.c babd92383ad4884c9159c79a7d326bf65d441c23 - optee/optee_os/core/mm/vm.c 4c81a53362b3a07b1dabb5a197f0e3ec26117bee - optee/optee_os/core/mm/file.c 1a10b60dcd292e4989d39fac9e0a1205a6c9be59 - optee/optee_os/core/arch/arm/plat-k3/platform_config.h 8d3f09217eac18e605d7bdfe9453436b3fbdef0a - optee/optee_os/core/arch/arm/plat-k3/main.c e8c669f6cd515061ddc1fac878644149427040c8 - optee/optee_os/core/arch/arm/plat-rockchip/psci_rk322x.c 7321df9000292f732b6fcfd9280351f5c8655376 - 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 9418ae031362285bc9aaa7153067dc393ecdf620 - 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 60d53249268b5a85a71718fddfc3299658be4040 - optee/optee_os/core/arch/arm/mm/mobj_dyn_shm.c c3f15722f779f9fa7c746d6926c361ad9acf253b - optee/optee_os/core/arch/arm/mm/tee_mm.c e71197df96cbe0d572a4fbf62a6968b66e2ecf43 - optee/optee_os/core/arch/arm/mm/pgt_cache.c b5f78f514e07f13ad9276ce637df08d7fd3d4021 - optee/optee_os/core/arch/arm/mm/core_mmu_v7.c fe9bda82717fd30842a9e88954169089e83d5c05 - optee/optee_os/core/arch/arm/mm/mobj_ffa.c 90c710ff92a5471bbc91f3bad22e19a313038909 - optee/optee_os/core/arch/arm/mm/sp_mem.c 7604b3a85f910ae7d691ada6adc0bfbcbb720f3b - optee/optee_os/core/arch/arm/mm/core_mmu_private.h 5ac7efc96ba262ea98e92b62571e80ff89027ece - optee/optee_os/core/arch/arm/mm/core_mmu.c d811b0e6d683954714e8aad6114d25470b16aa7d - optee/optee_os/core/arch/arm/mm/core_mmu_lpae.c 9744ff992ce0c00fad1d1e0514e82fb745580d9f - 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 95b9bf5255e7e4a62218c8c51249067e7ab2721a - optee/optee_os/core/arch/arm/plat-vexpress/fvp_spmc_pm.c 6b00e835a114813df79a06c376c7a28f640b07f6 - 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 06cd6a0d54069ecae63755ae3388b6bf4cca6296 - optee/optee_os/core/arch/arm/plat-sam/platform_config.h d452ceba090437688ae1658171bcda10e43263b4 - optee/optee_os/core/arch/arm/plat-sam/tz_matrix.h ed5b0eb30c06ef7e7f271a4b045672e7f98a5079 - optee/optee_os/core/arch/arm/plat-sam/matrix.c 7cd99ccf5c09e00dadb4709c6a4294d5351d5550 - optee/optee_os/core/arch/arm/plat-sam/matrix.h 10e9a713aed60d4215c6524cb65dcf5e057209a4 - optee/optee_os/core/arch/arm/plat-sam/sama5d2.h a35af5e963d0d735f49a3c0e7007dd1818c2f3c1 - optee/optee_os/core/arch/arm/plat-sam/main.c 9e03ab42551128401c4786a75250b1db1cd4922d - optee/optee_os/core/arch/arm/plat-sam/sam_pl310.c a952acbce19bba1cb000aed4db4d32b8da7cf521 - optee/optee_os/core/arch/arm/plat-sam/sam_sfr.h a6e39fe7d60f889f814979419a8cd0b2fd7f2427 - optee/optee_os/core/arch/arm/plat-sam/pm/psci.c 1bc99ca6171c50f0a4dde961f36e26e0eb706b95 - optee/optee_os/core/arch/arm/plat-imx/imx_sip.h bfd010647330fd2fbafb08a6d68018496917c18f - optee/optee_os/core/arch/arm/plat-imx/mmdc.c 0bf32017891d702ac8c5cd72c848d9e34bad601f - optee/optee_os/core/arch/arm/plat-imx/imx-common.c 21a04aa0fd70bb226f6df5bb34b88dedb58caec8 - optee/optee_os/core/arch/arm/plat-imx/platform_config.h 0b4b165f0d532ecd5647407bcf3cd736ae5b4fb5 - 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 b150e5f4d32b659cd32a26a59ac84dd28bfb76c6 - optee/optee_os/core/arch/arm/plat-imx/main.c 0cc821dc228c741c0dcf7a53fd69d51cf3d27084 - 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 89cae00ca6b854e7b1f12378a0c7a0b330938022 - optee/optee_os/core/arch/arm/plat-imx/imx.h 658c3b177340e2efe74ac7cfe5a0c688aeadf90d - optee/optee_os/core/arch/arm/plat-imx/imx_pl310.h 6f2971596593a84d3f1aca0fab33f7b02571cdf6 - optee/optee_os/core/arch/arm/plat-imx/config/imx6sll.h 237c9827109951b41f1d159bf5e6f616c0934927 - optee/optee_os/core/arch/arm/plat-imx/config/imx6qdlsolo.h 94ddcf0576958c514cb301c4b44389ab1a16a1c9 - optee/optee_os/core/arch/arm/plat-imx/config/imx6sl.h ab88b7bab8be97e6f46fb19b94aafd0f9a9ee1ce - optee/optee_os/core/arch/arm/plat-imx/config/imx6sx.h 44918411e67ca41ddcd972ec7e130115ab50935e - optee/optee_os/core/arch/arm/plat-imx/drivers/imx_caam.h 7cb9f9ab515e9619e0b9eb0fb831a4ec677ddbf1 - optee/optee_os/core/arch/arm/plat-imx/drivers/imx_csu.c c11cf35156a4c8248d4a5f115ec893ea9684f4c8 - optee/optee_os/core/arch/arm/plat-imx/drivers/imx_scu.c f60bd4adf4b970e556702fcd2e9e53b5b755d1aa - optee/optee_os/core/arch/arm/plat-imx/drivers/imx_caam.c ef5e614ca831ce55880d7a05eebf54c619a09bf5 - optee/optee_os/core/arch/arm/plat-imx/drivers/imx_snvs.c 7d45413b3526dae7e122bf683ed7a52415529c09 - optee/optee_os/core/arch/arm/plat-imx/drivers/tzc380.c 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 af51912dcabaaa7d99cda934615fde0d34d6dae7 - optee/optee_os/core/arch/arm/plat-imx/pm/pm-imx7.c f19465a116d7fdbd539bec5bbd502ec3e28da464 - 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 8c72fe7c55598af1145d4ffde6b0ef3be9718f0c - optee/optee_os/core/arch/arm/plat-imx/registers/imx8ulp.h d69cf35faaa6c82dddf2ebee4006295b2d328632 - optee/optee_os/core/arch/arm/plat-imx/registers/imx7.h f8684a4072fe6c26b44fec3a1ee4653720165952 - 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 7ae79d0c4d103465f52118d82e1a9ae89a4b8219 - optee/optee_os/core/arch/arm/plat-imx/registers/imx6.h b355b4bb04068d735c1faa8039e1ade0d88d60d2 - optee/optee_os/core/arch/arm/plat-imx/registers/imx6-crm.h 4fccf8931a751e26741b9e9671ff68e8c5eb110c - optee/optee_os/core/arch/arm/plat-imx/registers/imx8q.h 3931a5db91c6b50993dba75c296966e3e9416994 - optee/optee_os/core/arch/arm/plat-imx/registers/imx7ulp-crm.h 0def3dbafb3637bb60ce25d7716f7215fb45eb40 - optee/optee_os/core/arch/arm/plat-imx/registers/imx8m.h d24f3474468f4d53960aee24b2ef2a4db0bd21ba - optee/optee_os/core/arch/arm/plat-imx/registers/imx7ulp.h 6c22417d4a6939956e88b2cfdff6550a92e8d714 - 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 cafa5495d52e2625269196193f463b1036bf9eca - optee/optee_os/core/arch/arm/plat-mediatek/platform_config.h e65ecbcb38c0f7e8e4807c0de29240a74c2f1653 - optee/optee_os/core/arch/arm/plat-mediatek/main.c 54bb5be4dc19e1a63964f2d38470f45cc9acf1b5 - optee/optee_os/core/arch/arm/plat-synquacer/rng_pta.h 596136d3b40cd1cbae47d4ed48a5b4d246e08dfe - optee/optee_os/core/arch/arm/plat-synquacer/platform_config.h cfee1a7e558e5a83b36260c1b345aff67cf568f2 - optee/optee_os/core/arch/arm/plat-synquacer/rng_pta.c 804785fbe5ca5dfc5dad21cf7f6b8c9f7cddeaf5 - 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 12ecdfd5b1834f64514850c6d1a09ae3ba5c002d - 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 fe7b2acc3fe6374e96f0cb8136a4e217f9f330a7 - optee/optee_os/core/arch/arm/plat-stm32mp1/platform_config.h 105fcd115c8f37f13c3f1617c6e564dce1a1a50f - optee/optee_os/core/arch/arm/plat-stm32mp1/reset.S bca8cf5a328dce574c9867cf0074ce81f0007051 - optee/optee_os/core/arch/arm/plat-stm32mp1/stm32_util.h 9283bddb057bf5d75765b0af3c1ba3a6cc16d216 - optee/optee_os/core/arch/arm/plat-stm32mp1/shared_resources.c 41fc0d480726ccac287c2341b62956a102d2b134 - optee/optee_os/core/arch/arm/plat-stm32mp1/boot_api.h 2dc4a4d55b9b5a8794dc256535474367306618e0 - optee/optee_os/core/arch/arm/plat-stm32mp1/main.c a3775914a5564d9c94b05c19d2ac60c454342afd - optee/optee_os/core/arch/arm/plat-stm32mp1/scmi_server.c 627bf8e919bb7d1ac7afae5ea1d1d036fb9c0abe - optee/optee_os/core/arch/arm/plat-stm32mp1/rng_seed.c 4cd706376b2b8e9f29529251f6e8dd0f97b45a2d - optee/optee_os/core/arch/arm/plat-stm32mp1/link_dummies_paged.c 66d2e182bd4ecf635ac7585478a15b147558bbd5 - optee/optee_os/core/arch/arm/plat-stm32mp1/plat_tzc400.c a1238faa3df41c0c66412e3b032255e1cd4988eb - optee/optee_os/core/arch/arm/plat-stm32mp1/scripts/stm32image.py 1ea92cd3b3bd0a2e695d1e042e893c0d68fd760f - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_etzpc.h f0c17a14e6b3e1f12e63b2b8c796561737abb035 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_rcc.c 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 0b224f2b0b4031a236a9d51050a02d560eb83d2b - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c 17b56fe0f8557ae3d51bd3ea2318a708103738c7 - optee/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_syscfg.c 1f34aadee8e8da6ebb2daaf390ecafca218b537b - optee/optee_os/core/arch/arm/plat-stm32mp1/pm/psci.c 6cb054d136e0650ff782c1b9f1f752a43e940523 - 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 55a179110a40d04671229f5aea34ee58555a9013 - 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 29793ec58f06e7f144486eaa4051c432ea581b35 - optee/optee_os/core/arch/arm/plat-hisilicon/psci.c 9421c26b6ce38f1d5da0e2f431afc0cab732f0e6 - optee/optee_os/core/arch/arm/sm/std_smc.c 0605dd7405a5dc02a47a75fab83960f8cbea4ffa - optee/optee_os/core/arch/arm/sm/pm_a32.S 615d9401894c37dec5e5ebe9bcdb678df854564e - optee/optee_os/core/arch/arm/sm/psci-helper.S c497b4b35a2b60ea9a45952fdfb7f981defd9b78 - 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 abbe0e5a7c63995c207b1995649e3a6ed6b4221a - optee/optee_os/core/arch/arm/dts/stm32mp15xc.dtsi c07147cb14bc871e069f3be8248fc2c79e311949 - optee/optee_os/core/arch/arm/dts/stm32mp15xxad-pinctrl.dtsi da60e25a55d351de5e395d7f18b12b727501b789 - optee/optee_os/core/arch/arm/dts/at91-sama5d27_som1_ek.dts 5ce94e005d1d641f3118bff7e4519eb71dc98b6f - optee/optee_os/core/arch/arm/dts/stm32mp157c-dk2.dts 7a10d4cc4fbe02371e6e65a181599b0a66f7fbec - optee/optee_os/core/arch/arm/dts/stm32mp151.dtsi be56b5f85afc3162ffed268a81e996de6d4c6b48 - optee/optee_os/core/arch/arm/dts/at91-sama5d2_xplained.dts 618d3e7c2fd280b1de94fa9f5ff8a6661e713588 - optee/optee_os/core/arch/arm/dts/stm32mp157c-ev1.dts 680dcc7986942f29364722aa0d0ff7b4d0d42dc4 - optee/optee_os/core/arch/arm/dts/stm32mp157c-ed1.dts 56e3a49814c4ee3d84af86c6faafb55ac9577864 - optee/optee_os/core/arch/arm/dts/stm32mp15xx-dkx.dtsi 49201a7369f158d086285c423688ddf62bed6789 - optee/optee_os/core/arch/arm/dts/sama5d2.dtsi 6ed7397e2751cabb21fc7e87b53983b9117d2e26 - optee/optee_os/core/arch/arm/dts/sama5d2-pinfunc.h 7f55ca60911dad2dc57c74c8579731d7bc38c44a - optee/optee_os/core/arch/arm/dts/stm32mp157a-dk1.dts 361479ac7684841706aca2fdb4c3d2c9f8e0e13e - optee/optee_os/core/arch/arm/dts/stm32mp15xxac-pinctrl.dtsi d26bbcf985b7523a6af715be4feb22233be74ba5 - optee/optee_os/core/arch/arm/dts/stm32mp15xxaa-pinctrl.dtsi d7230a1568081b9a39b151bbe38f188691b2b84b - optee/optee_os/core/arch/arm/dts/fsl-lx2160a-rdb.dts ebdd41169bd317a2ae7c1fbd0bed3cfc3dd2e57b - optee/optee_os/core/arch/arm/dts/stm32mp157.dtsi 9e92396953fc461edcec7baa3cc553806183dd72 - optee/optee_os/core/arch/arm/dts/at91-sama5d27_som1.dtsi 6459dcb642f710ab7f9bf469d3bc05ce4b5ca425 - optee/optee_os/core/arch/arm/dts/stm32mp153.dtsi 826db7e4acadd2958fc518578dc0f62d406fe36f - optee/optee_os/core/arch/arm/dts/fsl-lx2160a.dtsi 9621fbcfeb074b1f621a25ae509b2c6ba9cc9931 - optee/optee_os/core/arch/arm/dts/stm32mp15-pinctrl.dtsi 9f93f18baccbb7718af6c571e70dfecb3529b694 - optee/optee_os/core/arch/arm/dts/stm32mp15xxab-pinctrl.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 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 1ab432ea10e0e0edf03b0ce17bb5277fea163578 - optee/optee_os/core/arch/arm/crypto/sha256_armv8a_ce.c 9c1f14fdc223c00af03fe8b922a520419b7fd0b9 - optee/optee_os/core/arch/arm/crypto/sha1_armv8a_ce.c 2c3ba8b73e012b48da6c8ff12c635f8fa109e5a8 - optee/optee_os/core/arch/arm/crypto/aes_armv8a_ce.c 0b84c15b4796a2a23a095ae2d6d037677510760a - optee/optee_os/core/arch/arm/crypto/sha256_armv8a_ce_a64.S 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 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 3b86137354db1df78bac55ef3727e777bc84d700 - optee/optee_os/core/arch/arm/plat-ls/platform_config.h c3a9529ff0998cf35400a4d5eb538dbc56cc1b1a - 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 920ee6972afcb251ff12fe1f7216a6938fb074f1 - 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 35de88cf9a5b1f5caf77be9814256d98492e93ab - 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 82e1038830d8ecfdbf5c299102c7b0de17277612 - optee/optee_os/core/arch/arm/tee/arch_svc.c 0b4c46bea28ee75ae5ccc04061a970fc4a3b1657 - optee/optee_os/core/arch/arm/tee/arch_svc_a32.S fcd203776d7e3cf83ff4153c8fd2474ab577a3f9 - optee/optee_os/core/arch/arm/tee/arch_svc_private.h df18a9464597e6dbc2844ec1e5d735db00c74f37 - optee/optee_os/core/arch/arm/tee/svc_cache.c af3d77b6615ce0905913e639e6d32ffa95ec882c - optee/optee_os/core/arch/arm/tee/arch_svc_a64.S 27c86259be9622ea3db2da4bd669073cab8b43bd - optee/optee_os/core/arch/arm/tee/entry_fast.c 8694a8f4be2551b1bf8f1abcb17284a8b202e5af - optee/optee_os/core/arch/arm/plat-zynq7k/platform_config.h e8a97315a58b289054e1f3fb5418cba746b5633e - optee/optee_os/core/arch/arm/plat-zynq7k/platform_smc.h 3976209257c8dca39eedf4e113713b2649d5270b - 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 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 e197d92e89cd05addaaacc83ee08ec8b8d2aa7c0 - optee/optee_os/core/arch/arm/kernel/spin_lock_debug.c e3ced834beaad7b11b8ebfe30ba03edf424d3220 - optee/optee_os/core/arch/arm/kernel/thread_a32.S f9a92f478e19fbf1059649d6208b99ca6613b311 - optee/optee_os/core/arch/arm/kernel/cache_helpers_a64.S b284eac756a44f5d63021f6fd4fd859ba926c10b - optee/optee_os/core/arch/arm/kernel/misc_a32.S 1673daa4bed9025ebe8e1398ec553cbdd76e6bc8 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc_a64.S 1eca3339df28ba76ce4943ccc32dda6cf8f2f0aa - optee/optee_os/core/arch/arm/kernel/stmm_sp.c 11b06e85d634e8c9cd20e161f44e9222e0d0970c - optee/optee_os/core/arch/arm/kernel/virtualization.c af8d99e369132adac450a89f4b07fbbada85156d - optee/optee_os/core/arch/arm/kernel/misc_a64.S ea7d0253ef379b7c142cc21a22c79d899928defe - optee/optee_os/core/arch/arm/kernel/link_dummy.ld 09ae96d24a26b79da3b4d74657264ac8fa57e7ee - optee/optee_os/core/arch/arm/kernel/timer_a64.c 2fb2d810add8ee2c853973ce5a1cc00ee0469f03 - optee/optee_os/core/arch/arm/kernel/abort.c 01a6d6ed8f8e0b1a2e9ab3bc44e830abe52f30da - optee/optee_os/core/arch/arm/kernel/thread_spmc_a64.S c084aaa74ee77c828beb7313c32226c043a61670 - optee/optee_os/core/arch/arm/kernel/link_dummies_init.c 8ebc782c56e8a49cbb1a1842f396de645f1f46a7 - optee/optee_os/core/arch/arm/kernel/cache_helpers_a32.S ee18617f4335d06d63c83ef7cf197f30ef61da75 - optee/optee_os/core/arch/arm/kernel/thread_private.h e935ef062cf6f49e0a970956b28f70243e48b06d - optee/optee_os/core/arch/arm/kernel/trace_ext.c adc43e045eb320aed2792953149f77da79b625aa - optee/optee_os/core/arch/arm/kernel/entry_a32.S b4d3b744d8901b93961e5eec56d2d686fb936e54 - optee/optee_os/core/arch/arm/kernel/thread_a64.S 93b8d5e48af159d7ca5fa174b79d935f05dbaa8b - optee/optee_os/core/arch/arm/kernel/tee_time_ree.c c4fef219d60e06de343cd8d6ba3263943a2ea92d - 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 dd9b32c25af03b5140a0215143bd97a94f881042 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc_a32.S cfe9209c0f08602f20df8752df4016c257305627 - optee/optee_os/core/arch/arm/kernel/vfp.c 13333f3a2dba9a39f39733e3baaf79863db96af5 - optee/optee_os/core/arch/arm/kernel/thread_optee_smc.c 34c3fe34974039ae46f116dd60ce4b21a9fc901b - optee/optee_os/core/arch/arm/kernel/tee_time.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 b4a21d184a8cf33df24d152603e82fcdabe741f7 - optee/optee_os/core/arch/arm/kernel/unwind_arm64.c e99d460252d5e47e4c07915ca373fe0c15ed2eab - optee/optee_os/core/arch/arm/kernel/thread.c f4b199a80f0476f43f34060f72493f81a289748e - optee/optee_os/core/arch/arm/kernel/otp_stubs.c aec2ed8d1ceb6b17b4ffa587573dc97e665acb2e - optee/optee_os/core/arch/arm/kernel/thread_spmc_a32.S 5ca340af84791488b272c18d84af4e49b1c94f7e - optee/optee_os/core/arch/arm/kernel/tlb_helpers_a32.S 52db37b03f0c829ec0b1ca5ddd5ff53247c89ca1 - optee/optee_os/core/arch/arm/kernel/thread_spmc.c 4d98d1a3c20f4e424fd4140949c712f1769daf93 - optee/optee_os/core/arch/arm/kernel/tee_time_arm_cntpct.c cee66d055de50b0263297379950e08acd7d54831 - optee/optee_os/core/arch/arm/kernel/ldelf_loader.c b5ebdeae94cfe7fd7a32f0be15e8a28b230cd175 - optee/optee_os/core/arch/arm/kernel/tee_l2cc_mutex.c 381ea0a52032ec5b87753e766f2f40da69f4d934 - optee/optee_os/core/arch/arm/kernel/boot.c 170f9fade8d4cfd3805f2aa2383b7f3d358507df - optee/optee_os/core/arch/arm/kernel/idle.c 88bc3c8146f445828c561ff0ca0e4443f73bd25b - optee/optee_os/core/arch/arm/kernel/vfp_a32.S 0d9843230914ef8e37b9f7433b5a1afd09a645da - optee/optee_os/core/arch/arm/kernel/kern.ld.S 65b04ffba3b4626ca3df43fda076964ff18661ce - optee/optee_os/core/arch/arm/kernel/link_dummies_paged.c 599bd7fb683e3e1c0eddc71e66e5eb979e8e7c28 - optee/optee_os/core/arch/arm/kernel/spin_lock_a32.S 12d2e2fc3af41e2672029d10f08a5cd88197c7e6 - optee/optee_os/core/arch/arm/kernel/entry_a64.S a40de03a2611ad276761dea84b85fc13368bedfe - optee/optee_os/core/arch/arm/kernel/secure_partition.c 12070ee23d77a135b3963a4c6730d1e689540bb0 - optee/optee_os/core/arch/arm/kernel/delay.c a3d562edc0d696f64d77e9c96d86c9a88451b5a1 - optee/optee_os/core/arch/arm/kernel/vfp_private.h 09bcd7235532d115e4a111cbe72f10b24238adca - 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 f508b3e39afe5fde3ff8456964f2999b6872f62c - optee/optee_os/core/arch/arm/plat-stm/rng_support.c e416b62f68911e473ed59c9812d0ebe57eab4924 - 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 4813ba84352e0730b87ce81b1acc7028cec26824 - optee/optee_os/core/arch/arm/plat-sunxi/main.c d02c4d8f81f1838800bb5faddb9360af5b1e3912 - optee/optee_os/core/arch/arm/plat-sunxi/psci.c 2399244b8020942c1b3a3cb924194e8770560051 - optee/optee_os/core/arch/arm/plat-sunxi/plat_init.S f4d1309691854b5d86e093a638f251228466b2c1 - optee/optee_os/core/arch/arm/include/arm64.h 55298b41d3e8800e2aeebd746e9e1371142fbd6e - optee/optee_os/core/arch/arm/include/smccc.h 0da1c9a0b55b08c9ef7d154b22886b3695c5e30d - optee/optee_os/core/arch/arm/include/ffa.h ef7bffd960c06d3d1f3248123500188bfb08cd13 - optee/optee_os/core/arch/arm/include/pta_stmm.h d73b3a0bdba834911ef75a406d9dc2271082bdae - optee/optee_os/core/arch/arm/include/optee_ffa.h 9e8a29ed7f1b79f323329b1fb9c5ea8f94cd48eb - optee/optee_os/core/arch/arm/include/arm32.h 4eceaf87084688a4fd7e8194d19fae85c8a72d0a - optee/optee_os/core/arch/arm/include/arm64_macros.S e803abd6998e8c2623a437eab51371989a4bf92a - optee/optee_os/core/arch/arm/include/arm.h 4ea58ea931450a2d848a7db6657e4f142aae24ea - optee/optee_os/core/arch/arm/include/arm32_macros.S 1cea08afcf4cab7bbff31ea3666c5360c4c03498 - optee/optee_os/core/arch/arm/include/arm32_macros_cortex_a9.S d653c4b873069c35ecce54402a20e1952086c4cc - optee/optee_os/core/arch/arm/include/mm/pgt_cache.h 743e5afc40c3fb4f5abc801aa3598572b2490340 - optee/optee_os/core/arch/arm/include/mm/tee_pager.h 88ad70a8cf399952d8a598dcd77a60ba967edf75 - optee/optee_os/core/arch/arm/include/mm/generic_ram_layout.h 2d6d37bc78215835a648440eada23529de6e9bce - optee/optee_os/core/arch/arm/include/mm/core_mmu.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 7ee50f5b3384926081600c323b503d33c020db74 - 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 156892d52556dd97855948fe94b8ab84afd13ab4 - optee/optee_os/core/arch/arm/include/tee/arch_svc.h 51a0172df25bd2f8329cbc49565a07e6db5c105a - optee/optee_os/core/arch/arm/include/kernel/misc.h 5a0de7b1c504f18aab5888aa442e91658f32b63d - optee/optee_os/core/arch/arm/include/kernel/cache_helpers.h 565729a7cf2d195339a47b4fee375a8927ad3c34 - optee/optee_os/core/arch/arm/include/kernel/boot.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 59486a19b4d4da60fd534781e2a55292122568bd - optee/optee_os/core/arch/arm/include/kernel/thread_defs.h 8196cf0655a2a2e908ee4c2cc499495397400a28 - optee/optee_os/core/arch/arm/include/kernel/thread.h cfb4c21523125ca2527407fe786ed59f74a1a116 - optee/optee_os/core/arch/arm/include/kernel/thread_spmc.h 37af9222c63c149803c61dab6a9f91a50be335d0 - optee/optee_os/core/arch/arm/include/kernel/tz_proc_def.h 6558b86fed011946ba0327a36db02e2d3604443a - optee/optee_os/core/arch/arm/include/kernel/delay.h 9284944a0055f114d23e121c972c412ae97b7f7e - optee/optee_os/core/arch/arm/include/kernel/tee_l2cc_mutex.h e5ae9ecb33e9fb8c02a79adef8ed500bd5f3443f - optee/optee_os/core/arch/arm/include/kernel/stmm_sp.h 0f7eb297ee9d4dbf0e98871bec56c6dc261ba775 - optee/optee_os/core/arch/arm/include/kernel/abort.h 0607a5b2b01b53cceee3b47ccee320d2fb27bda9 - optee/optee_os/core/arch/arm/include/kernel/vfp.h bcf6bf199cc81682017d3318c1a231a4a42f120f - optee/optee_os/core/arch/arm/include/kernel/secure_partition.h b1849608c1186a5369739df856353a0de1e66fb1 - optee/optee_os/core/arch/arm/include/kernel/spinlock.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 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 7b0f9627308d7371c2700d17c34beba1dd9f2b98 - optee/optee_os/core/arch/arm/plat-totalcompute/platform_config.h d944f37d41781256b4a9db65f57183df5637edd0 - optee/optee_os/core/arch/arm/plat-totalcompute/tc_spmc_pm.c 83284fe55ebc42c1f014af6d39f29509cce948d9 - optee/optee_os/core/arch/arm/plat-totalcompute/main.c 652189bed519f40bd1402bea8eb06053887633e5 - optee/optee_os/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts d8ab17a66be4257c429fbd46501a309eea1da817 - optee/optee_os/core/arch/arm/plat-zynqmp/platform_config.h ba057361303624f5e5353e690893e41a4edf13aa - optee/optee_os/core/arch/arm/plat-zynqmp/main.c acb5b7a67e6e3a2c8309d3b5cd972a643437c4ad - optee/optee_os/core/arch/arm/plat-marvell/platform_config.h 894ccac36077cb7f938e800c73a11685e7bcc46e - 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 5cbed39be8170bf9562737159407824608d9ee20 - optee/optee_os/core/arch/arm/plat-rcar/platform_config.h 5f2683c32c48536f7f90ec2c5a761cfa6a235e16 - 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 9bec06280322151836d648e5127d8353df6f4d4c - optee/optee_os/core/arch/arm/plat-rcar/main.c ee44377cb699db70e16cd4c455632ac5ffd0309f - optee/optee_os/core/arch/arm/plat-rcar/core_pos_a64.S f8a2662937d568146b977cdedf2e268e5b1f6b6e - optee/optee_os/core/arch/arm/plat-rcar/romapi.h cad1e637ec4dcb69acb71e0ab050836e521faeb9 - optee/optee_os/core/arch/arm/plat-rcar/romapi_call.S 07c7324793b6f29f5af26d81477de8662853dd4e - optee/optee_os/core/arch/arm/plat-aspeed/platform_config.h 8d307a9e89ec7bd326d1c0ee0147ec8de4140380 - 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 6a9d889487661c9ed3bab948527dedaef2635bb7 - optee/optee_os/core/arch/arm/plat-ti/api_monitor_index_a15.h 3e1a361571fb8fa07a579f83c7f5ad14b1b7dea2 - optee/optee_os/core/arch/arm/plat-ti/platform_config.h efd84f3dd8840e74002559cbb0b0600903f15528 - optee/optee_os/core/arch/arm/plat-ti/api_monitor_index_a9.h 299d6594f02b97e6ab61a8bc06396e1ee01eecfe - optee/optee_os/core/arch/arm/plat-ti/a9_plat_init.S 9d70cdf109a0b74eadcae865961c0c48c342e9c0 - optee/optee_os/core/arch/arm/plat-ti/main.c 23be71a14ff0bf1d9da1d6d72a6e4ec7fdc3146b - optee/optee_os/core/arch/arm/plat-ti/sm_platform_handler_a15.c bf00b92130b9ab9907fea4c7009c09eb41e834ba - optee/optee_os/core/arch/arm/plat-ti/ti_pl310.c 0934b19135d14b49a99815f6afcc42b54b93d681 - optee/optee_os/core/arch/arm/plat-ti/sm_platform_handler_a9.c ea721c04ea8768b234e4827c328c5eccd37b4121 - optee/optee_os/core/crypto/crypto.c 6ee664faf892cf6eb54780694431dbc599714a4c - optee/optee_os/core/crypto/aes-gcm-sw.c d115e5e44b082ea4af5d2a76cd0fa1759060d9f8 - optee/optee_os/core/crypto/sm4.c e68ca1aeee7c839ed6427892eba453b827fe73a5 - optee/optee_os/core/crypto/sm4-ecb.c 38847958c76d006a2d38d942d52bea9f79db61bb - optee/optee_os/core/crypto/rng_hw.c 7155a48ae3c3f30123e067f2f32cee9b3d08af54 - 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 ce6be0315b8fa36b150c60bf05cc371f4f5ec56a - optee/optee_os/core/crypto/sm3.c faf9706d5d6fea1deb1b54539e55cdd318482d26 - optee/optee_os/core/crypto/signed_hdr.c 7b6658854eec61d103f730922493a99440ca594d - optee/optee_os/core/crypto/sm4-cbc.c 32e06a56bcd5a8d1a09f2265a02ec9476eadae28 - optee/optee_os/core/drivers/pl011.c a4bd9a9d1a087f03c6a54cfb63568fc4308a76f6 - optee/optee_os/core/drivers/stm32_etzpc.c e241e2600db481b9c897bc48b71104c3aaa5bbbf - optee/optee_os/core/drivers/bcm_hwrng.c ca5d3285331c002469710db75d131a8d0257db65 - optee/optee_os/core/drivers/serial8250_uart.c 514313602dfb100842f336c91efef495a658b3a9 - optee/optee_os/core/drivers/stih_asc.c 61fd12b4c0e6e8d4afffed71c182286581de4837 - optee/optee_os/core/drivers/ns16550.c 00f079f790a894b455a6fc84297b4263f63c78e8 - optee/optee_os/core/drivers/atmel_rstc.c 5661a315ebbe0d069c5220af53286545b10110f1 - optee/optee_os/core/drivers/gic.c 8146d598f90a81a75f752f1f4917d62136eae7cb - optee/optee_os/core/drivers/imx_uart.c 3f1a9e59e60ab0402bd2b1ef3668821bebe4fe9e - optee/optee_os/core/drivers/stm32_gpio.c 958cf80a218fa76392a775e1ac4881a1925b33a5 - 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 8ed7d854768a3a2ad5b631f1f7d211520831a05e - optee/optee_os/core/drivers/imx_sc_api.c e8a7e29b57d6f9e608014582467cbf49b142a0b0 - optee/optee_os/core/drivers/ls_i2c.c 1f8114767f04f10575e9d516120b9e8004560045 - optee/optee_os/core/drivers/zynqmp_csudma.c e26dcea60a7bdcf95acd06bb25f806e8b4d3d9ff - optee/optee_os/core/drivers/bcm_gpio.c ad1ff64a7933d88af2a4d50c00cf893bced87f6e - optee/optee_os/core/drivers/dra7_rng.c 56729058749c51344648a227f7c1d01e42fc1074 - optee/optee_os/core/drivers/sp805_wdt.c 04ff6a848f0dd5e16fb7fd76e95ce39785601df1 - optee/optee_os/core/drivers/mvebu_uart.c 26842fe6d5ee85586f9dd0692cf66f0938da1ff4 - optee/optee_os/core/drivers/stm32_bsec.c baded0ade9842dc363805b7112a8d98f5e5c12ad - optee/optee_os/core/drivers/stpmic1.c 09898d9b6b3ce2ff6bfaca61a6b13f0b9cd4efab - optee/optee_os/core/drivers/tzc400.c 0bf031f5f993b95b57b2aba4aebdd11b7b0304de - optee/optee_os/core/drivers/zynqmp_csu_puf.c cc100770e8cb44ea47d15cb3ef0204dbc0f4d27e - optee/optee_os/core/drivers/ls_gpio.c 0cdb9912f3a35cdd9d52951d5f489087f96d327b - optee/optee_os/core/drivers/amlogic_uart.c 9a15071ddcc011873e99276f43b98eb5c88bb1ea - optee/optee_os/core/drivers/zynqmp_csu_aes.c 033052ada215ccb3f67e6643ef12c4b5665f0448 - optee/optee_os/core/drivers/atmel_shdwc_a32.S 44b6f51b59cf7f37eee31ed63de794b26db096e8 - optee/optee_os/core/drivers/zynqmp_pm.c 8d04ceb536a6bf4d80820154070d8c7c642edb42 - optee/optee_os/core/drivers/sprd_uart.c d3d38e25f71fe1a0b5bf04ecee50e62d55ea7fb8 - optee/optee_os/core/drivers/imx_i2c.c 01c0b42d10060c5dd0db929bf8ab486a56aca327 - optee/optee_os/core/drivers/bcm_sotp.c 9a6399d3b9a2944a5cfebf5b6c67e29dc97474e5 - optee/optee_os/core/drivers/pl022_spi.c 0dfde1c94b7ceeb52c122530290495b8b87780e1 - optee/optee_os/core/drivers/imx_snvs.c 3b091b063bef5c62411242ca120ca44247acbdcd - optee/optee_os/core/drivers/imx_ocotp.c 3d831280552852a5d6a35167b847d1275416408e - optee/optee_os/core/drivers/stm32_uart.c fb3cf73c0d1d08988d883ad63001562e768ada8a - optee/optee_os/core/drivers/imx_lpuart.c 458fa069600734e6b59ce06a39a9edf5a731ac1d - optee/optee_os/core/drivers/zynqmp_huk.c 9b104bef20a893f215916d74c4a2de6f90f7f6db - optee/optee_os/core/drivers/atmel_trng.c 0acacd30db4c1e0ed01d342e922c5983c29729dd - optee/optee_os/core/drivers/ls_dspi.c c96f731961fc579a4966cae12e597d72c1ed06f3 - optee/optee_os/core/drivers/atmel_uart.c 335b96d1b833cd2254cc0cc41890d2b3c63112e8 - optee/optee_os/core/drivers/atmel_shdwc.c 14821062b61d50f2f3756a2388ed48e7b5f38545 - optee/optee_os/core/drivers/stm32_i2c.c ba938d917edc42fd1e53f93a707cc9ff5ff45686 - optee/optee_os/core/drivers/scif.c 0b9c9c13ac91c1ad15073161f147dc427ca379fc - optee/optee_os/core/drivers/imx_mu.c 9fca22816795b16db2c7d03e0f3c505846fb081d - optee/optee_os/core/drivers/imx_wdog.c 9fbe74cf959bf2b80b39c4cf5ff6d4cc0ed64759 - optee/optee_os/core/drivers/tegra_combined_uart.c 51c5eac081728251efeed4d6aeffc4395ebecfc9 - optee/optee_os/core/drivers/hi16xx_rng.c a9e721b1faeb4865248d3c188b56278116a3185f - optee/optee_os/core/drivers/pl061_gpio.c 983604b67b76fdae15da9f590d678c532dd3998b - optee/optee_os/core/drivers/stm32_rng.c b8501f6351be83ab404275ae723310a7b83956b7 - optee/optee_os/core/drivers/tzc380.c fbee23ad24545aea0bd9fd6ae6b67e9acc2ef16f - optee/optee_os/core/drivers/scmi-msg/base.h 93be063666a6a98dd1fa8f45bba0c3ca91136171 - optee/optee_os/core/drivers/scmi-msg/voltage_domain.h e7d76ad625169123e10af0903216e51fb2d1bb86 - optee/optee_os/core/drivers/scmi-msg/common.h d6d4d85037d819a22e6d1b265b7ad064c90be6ce - optee/optee_os/core/drivers/scmi-msg/smt.c b6dc570c20e25ebbb69c815e65c4e3a77f6cf00d - optee/optee_os/core/drivers/scmi-msg/reset_domain.h 240929e0249e9285b2e4dafe21bd1c3d07677677 - optee/optee_os/core/drivers/scmi-msg/voltage_domain.c 189d1a32fdc699c67e4da64ae26380a2b3facd66 - optee/optee_os/core/drivers/scmi-msg/clock.h 53a2267e9cdb816d6088a4141e11c8c6f480d5d5 - optee/optee_os/core/drivers/scmi-msg/clock.c 13ed9520d3f452a3b5919a38066b702cc2f31c5b - optee/optee_os/core/drivers/scmi-msg/reset_domain.c f563a4396814cf9c97889742448e9890181cbce8 - optee/optee_os/core/drivers/scmi-msg/entry.c cf6e57dd706760cb478d1999cfd39b53410f7967 - optee/optee_os/core/drivers/scmi-msg/base.c 47f5e9653c3eaf4ce1e2f35b7617147ca91213d6 - optee/optee_os/core/drivers/clk/clk-stm32mp15.c d90147b7ace7c5c873e7f1f8512cf6d46ddba175 - optee/optee_os/core/drivers/clk/clk_dt.c 8ad2be706b99a45605f3f6d4f7d5b0afd349dab5 - optee/optee_os/core/drivers/clk/clk.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 31964389f68800831a30d0fc84acb36a089a9206 - optee/optee_os/core/drivers/clk/sam/at91_clk.h e1d3971e3b4310e95da87f3e7eed68f2b7ef8b9c - 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 e99fd29152a43e4a9842427b3f4938c3f243c23c - optee/optee_os/core/drivers/clk/sam/sama5d2_clk.c c8f55ceeed065fc01646d87f268c82acf9c5e6db - 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 e0a296e1905df6fc3d89c30001069ae9e3057dc4 - 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 badac369bec5f53c3cd5ed0f62651d3bcd56fa40 - optee/optee_os/core/drivers/clk/sam/at91_programmable.c 3cc6160c3ae52400111c85d3c4ce08d787630856 - optee/optee_os/core/drivers/clk/sam/at91_i2s_mux.c 136d736092773f8e5c2cb36f8ea132f9eb0a9f33 - optee/optee_os/core/drivers/imx/dcp/dcp.c 237f6f7a1a20a48556cbe1b274c89d4fde91d9a8 - optee/optee_os/core/drivers/imx/dcp/dcp_huk.c 51537d6adee92999637e0a7cf5bb923db4b08c60 - 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 11129b0de4044e6ac21a6e4586e58696f8e2e33a - optee/optee_os/core/drivers/crypto/se050/session.c d8feef2a2d65ee7e6d67381109b5736e1f14094a - optee/optee_os/core/drivers/crypto/se050/adaptors/utils/scp_config.c 3c604315b05f930c3ed7932edcc9be4e5a4af916 - 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 da23cd274fbb5fc824f4435ee48e4fc35b8b9532 - 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 060b3b52797ed57dde580564eb829dbe69a23a19 - optee/optee_os/core/drivers/crypto/se050/adaptors/apis/sss.c 05b8cb927ce8c6dc6b2c3391b71366cf1b9dfc89 - optee/optee_os/core/drivers/crypto/se050/glue/user.c 4525d5ca9fc09faba6945dbe75bcec4b7bd948ee - optee/optee_os/core/drivers/crypto/se050/glue/i2c.c 13946b24b6db3a0969333a317a4acdd978d0e73b - optee/optee_os/core/drivers/crypto/se050/core/ecc.c acd04d6ec81f1e8fcd19581e8e7d194f372b861d - optee/optee_os/core/drivers/crypto/se050/core/ctr.c c56f4efb3958c1a4bf12e90dbae48adf78e31ec2 - 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 461771eacc710384a3317c219da9122b4bb8c4ac - optee/optee_os/core/drivers/crypto/se050/core/rng.c 2bfc19e0e0e85d9305249130e474588e60b28f37 - optee/optee_os/core/drivers/crypto/se050/core/cipher.c d709ded3f6aee81e3c5543807eff8d9556e922a9 - optee/optee_os/core/drivers/crypto/se050/core/storage.c 77ac6992ffdbc505fd3b8113c9335ea835c5f6c1 - optee/optee_os/core/drivers/crypto/se050/core/include/se050_cipher_algorithms.h b2624e3678d299efa44e3d406c66970eb5a18493 - optee/optee_os/core/drivers/crypto/stm32/authenc.c 06f4d05c0b8dff1db83d75e507975331028c073c - optee/optee_os/core/drivers/crypto/stm32/common.h d9c378e552d85fdc118b3b70af1a46687ad45424 - optee/optee_os/core/drivers/crypto/stm32/cipher.c 9ec1acb66a34b9a04783b09956106a5e12505a74 - optee/optee_os/core/drivers/crypto/stm32/stm32_cryp.h 6883fcfe4c2d0b5beb1ffbd46e77421fb95065aa - optee/optee_os/core/drivers/crypto/stm32/stm32_cryp.c bb297b79a3f0cc6cb59b1a18f8d19242c9fc12b7 - optee/optee_os/core/drivers/crypto/crypto_api/drvcrypt.c c9114e4414643d0fdedf812e46a4e8ac95a640eb - optee/optee_os/core/drivers/crypto/crypto_api/cipher/cipher.c d2aa7e1480f0e72a95d0a053597cd0c6b10081ff - 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 06bc4cb4d724a94dde8730e131b2802610c8f6e8 - 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 52e3c0f027bf86c0cd17148a014a5fc08fcf598d - optee/optee_os/core/drivers/crypto/crypto_api/acipher/ecc.c 66b46915d1c8bb714d38e4392277b58ef6f6ec61 - 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 3fb0446b2e20bdd54e340be3ecf4371e4e6f0dd9 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/rsassa.c d235d21c1de200d48e91b12063eb2f8f1caf0881 - optee/optee_os/core/drivers/crypto/crypto_api/acipher/local.h f8fb70b3262268367a6889b9af80bbdf63cf42bb - 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 d9cd5564c98225c830a9c3ccfbeae110cff97877 - optee/optee_os/core/drivers/crypto/caam/caam_jr.c fa5518a3d339506a995cb6e49ce8879d0f0796a2 - optee/optee_os/core/drivers/crypto/caam/caam_pwr.c e50b088ae52c3e7016bce9511e39b1adfa3f0b4a - optee/optee_os/core/drivers/crypto/caam/caam_desc.c b11b8e31d14793f1ab1dd8424b2cf09159b7c499 - optee/optee_os/core/drivers/crypto/caam/caam_rng.c c91006bedc99566c06672ee68ff3bd910aab155a - optee/optee_os/core/drivers/crypto/caam/caam_ctrl.c c1bb3a12440790f622827c0c8f216da3e9b41155 - 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 cbd8a78df7ccf6a32aef0edc7b9d0f35cab743de - optee/optee_os/core/drivers/crypto/caam/utils/utils_mem.c 092fdc41083d5a764928b9edf9bd5f07abf077bd - optee/optee_os/core/drivers/crypto/caam/utils/utils_sgt.c a851fe14429fd51822e2bb00e5788618eff74d7b - optee/optee_os/core/drivers/crypto/caam/utils/utils_dmaobj.c df1b924dffd39801578b9393a6d5165d4635c416 - 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 8f34eedaf46d9f01726a70a7bc65ed23fccc3508 - optee/optee_os/core/drivers/crypto/caam/hal/imx_8m/registers/ctrl_regs.h 04d5b46480de4ee8ec6dc36aa8cd04d6c8cf696c - 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 8dc51e341c9229c7064661f0c76300e826b69bac - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_jr.c 213b2abd6e597d2e0ea7a04c46f0f82f3b1d7810 - optee/optee_os/core/drivers/crypto/caam/hal/common/hal_cfg_dt.c a839d48b8824d4fde6b29a11fe83c6b159d53ebc - 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 7ba51e247e60652ac12220cfea51165c4db491fd - 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 42cc84af73a8980ed1e51aac57b7ac2bfe8ea567 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_cfg.h f784f2f0f427a9ec9db113ebc58342dcec14e58c - 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 7cd221d126315f24843a9e5113e6c27a92f14c2a - 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 79c877388f4e9dd6c1eea651a1010db05e8563e2 - optee/optee_os/core/drivers/crypto/caam/include/caam_trace.h e37c04fb5c4c51512dbf96667a67de2672bc796c - optee/optee_os/core/drivers/crypto/caam/include/caam_acipher.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 e24a2cb9035b6cf51805671353756d570f542e09 - optee/optee_os/core/drivers/crypto/caam/include/caam_hal_jr.h 125bbaaf0ee1ac0d2d425654c338239f1ed1a274 - 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 796d278d049ba5caed40d7f1070ba044e8aa1b72 - 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 6606bbe2c6116cc1911a3f921072b880f4d2228b - optee/optee_os/core/drivers/crypto/caam/acipher/caam_math.c d3ece29647fe7d5a6db8f9a47a1b91fcfd9429f7 - 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 04d02b09d79b3b8f769795992bdc43c0f4a09a44 - optee/optee_os/core/drivers/crypto/caam/acipher/caam_rsa.c ebb54adb3fb083edef44688da96c8759dcf58e6c - optee/optee_os/core/drivers/rstctrl/rstctrl.c 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 deaa0cb34c0e3164bfa105ecbbbc490732bba0f7 - 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 5267fab904402332001b7e7433c44819a2ccf8a7 - optee/optee_os/core/drivers/tegra/common/tegra_driver_se.c 8ddfe60e8a3922e61fd88aea05be2a5dd13e8ec9 - optee/optee_os/core/drivers/tegra/common/tegra_driver_rng1.c c900c5464f1984f630f15fd4fdd9126ca888cb91 - optee/optee_os/core/drivers/tegra/common/tegra_driver_fuse.c d4654766a46d1186e241c2e252b6d38ac9f71355 - optee/optee_os/core/drivers/tegra/common/tegra_driver_common.c 7b6b67892e455b1a9566a8a8f33053b6050f7804 - optee/optee_os/core/drivers/tegra/common/tegra_driver_srv_intf.c 45554944c00285a2602b6b0a34615669854f8f65 - 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 6d3ed472c571156fa066bf5b5dc1644d5f5b950f - optee/optee_os/core/drivers/tegra/t194/tegra_se_aes.c dbb0eea77ab40a265c133eea0b23731b46b29de8 - 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 3c93fa1fbf115515f5e1313b315ae7219e5bbe3f - optee/optee_os/core/tee/tee_time_generic.c 8461f4081f065f150d08fe886df77a075791b060 - optee/optee_os/core/tee/tee_svc_cryp.c a00d48ecd6498ccba17eb691531f55e5e28eee49 - optee/optee_os/core/tee/tee_fs_rpc.c 76f17d3b56d82dd65a611a2e6252ca6e74f2b1fc - optee/optee_os/core/tee/tee_cryp_utl.c 310e0f0ab20e771505c142a7e332a4b0fc560b31 - optee/optee_os/core/tee/entry_std.c a1202328842c81639257318e2047a9e13b1802c0 - optee/optee_os/core/tee/uuid.c 66696eb393ee5feb870aabe16a3a92cc342b7c68 - optee/optee_os/core/tee/tee_svc.c 812a8dc5dae043685e7385521d44fc1da568b2a5 - optee/optee_os/core/tee/tee_svc_storage.c 421523edc7c9440857684a89bfdec1cd58825086 - optee/optee_os/core/tee/fs_dirfile.c 1b987a7a750e59bf7f97f04737eb126df09ecb29 - 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 0df72b55d6ed8fc416fbb30dd913d9df9282204b - optee/optee_os/core/tee/tee_rpmb_fs.c 2cd6bc6e485303f0f52b55e68881e1f7d119d005 - 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 9323261c4542f4f78ce0668852a81df361a9953e - optee/optee_os/core/kernel/initcall.c 319ed85ec61351b9c0a4c7acde4ccaadecf700f3 - optee/optee_os/core/kernel/ldelf_syscalls.c 94e2c0c379ce289434664a0320006df2fbae034b - optee/optee_os/core/kernel/msg_param.c fffa1ff6b23a89aaf847a4ab6140a7bede922945 - optee/optee_os/core/kernel/tee_ta_manager.c 95db84ed2db1edad93dd163e910a57e8a493e1af - optee/optee_os/core/kernel/ubsan.c faff548bd0f97ab6d25c1893feff55cd67488bab - optee/optee_os/core/kernel/console.c 428633d470058beee68720c1ef0fb9ff4a3096df - optee/optee_os/core/kernel/dt_driver.c 5507bde30082bac9d1a101094c3f7cde4e04e1ff - optee/optee_os/core/kernel/wait_queue.c 4233d22a1d795e0774118ceedf2c5bac134e0b54 - optee/optee_os/core/kernel/dt.c 1beba0db1ff1f826641fd640ce1927e68758f838 - optee/optee_os/core/kernel/early_ta.c 3fc5e9e411b1ae45c0e4cae4b8a6bb864f0af29a - optee/optee_os/core/kernel/mutex.c 1dc95bf333f9a22b2f47b3b6f98f95a9336388ef - optee/optee_os/core/kernel/embedded_ts.c af2e20cbb543df6547a140deb039888cf8560fe4 - optee/optee_os/core/kernel/asan.c c4d1e1eaa2b62e210d11a3efe1ebab039a3227b3 - optee/optee_os/core/kernel/ree_fs_ta.c 9975d02cd73795987cd451389809dfce9a902e9b - optee/optee_os/core/kernel/user_mode_ctx.c 4931d22ebf9d5389b6bb8c59af1c129a4940e031 - optee/optee_os/core/kernel/interrupt.c 02448f355229caa2a32a4411c3198eb084395320 - optee/optee_os/core/kernel/lockdep.c c73deba9b34deb07440e782a9e7b70cb6adc64d9 - optee/optee_os/core/kernel/notif.c d8e82cb84852b8297dd53a8f1b53946dce2c8e4d - optee/optee_os/core/kernel/user_ta.c 7be1928ee7e34f7f47f52b99bce43e0024f06a44 - optee/optee_os/core/kernel/assert.c 128de0f07034058c418419586e3713dcf763b65d - optee/optee_os/core/kernel/tpm.c 45819f2e5ba540d45317cb88dcb17716bd768f23 - optee/optee_os/core/kernel/ts_manager.c c5144935485fc83d941a9c80668ace38c73633fc - optee/optee_os/core/kernel/huk_subkey.c 9d6653b2bdb5034d75ac5d7e3b847dec4b18363f - optee/optee_os/core/kernel/user_access.c 083433b7eb05b40ae1f1590d1532f3c09cc5adc8 - 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 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 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 337886ffa126c1313d292fb3b428a421bc01a8f4 - 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 352c517fa2d1fa2f0c811c1181ca8298750e8962 - optee/optee_os/core/include/io.h 129133eb0ba4e4b73eaf1d84710e580b22e10009 - optee/optee_os/core/include/spi.h 76a3a307fcae8ca4315d47c57222dfdbf7db3af7 - optee/optee_os/core/include/bench.h f7d4637ab97fb31c77f7816932a21c418f53c55d - optee/optee_os/core/include/signed_hdr.h a368caa21683937ca27d5854e743a1d5359cd46d - optee/optee_os/core/include/ta_pub_key.h e30f790a7b73708cebbfc99a50c0e2ab0805f516 - optee/optee_os/core/include/scattered_array.h 2856ba81c6121d427cfdda78cdfddf089d447628 - 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 d65531dfff61a502ccebd4a75ab0d2ed927e8135 - optee/optee_os/core/include/mm/sp_mem.h 30b8bfeb037aa430b36a9d62a9d906834dcf8903 - optee/optee_os/core/include/mm/fobj.h f6e0ea450c4eab7653c874f430040b8899326357 - optee/optee_os/core/include/mm/mobj.h 47e7a30f3a57e70e1a9c9bd1adb2003120fab5ac - optee/optee_os/core/include/mm/tee_mmu_types.h 3813eb3d7bca8b05bf4d8df687119a55c902d925 - optee/optee_os/core/include/mm/tee_mm.h 7201b66d2851448cd3d9ccbddae928f9d78b8dd0 - optee/optee_os/core/include/mm/vm.h 1af89b4c6e2cc87501b23b0f12e2365c613a6996 - optee/optee_os/core/include/mm/core_memprot.h 3ab7ecf667fa906a144379998f686f44c83c2394 - optee/optee_os/core/include/mm/file.h 851424df9ef09fa7a23f7d1751273eb6f6b17823 - optee/optee_os/core/include/dt-bindings/clock/at91.h cdb0691be3e0d905b1fbd9f283290efe068df812 - optee/optee_os/core/include/dt-bindings/clock/stm32mp1-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 fff918d3ee3b00888fd8e9d0be930ca960058a7e - 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 c2b9ebd197c5fef35e827cb67622fcd9a6f63b59 - optee/optee_os/core/include/dt-bindings/reset/stm32mp1-resets.h dcd9135e8790bfdbf7e925e8e5c9d421b5e89041 - optee/optee_os/core/include/dt-bindings/pinctrl/stm32-pinfunc.h 4ad764d66d0f0ed988666a385f3222af8813830d - 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 c16dda70d03dd19d304b79c07ddf4eb7bb3f3b2a - optee/optee_os/core/include/crypto/crypto_accel.h a7145b35d9b713a5597b81e3658d486443ded037 - optee/optee_os/core/include/crypto/crypto_impl.h 1194dccd40e26dd576c39fe6ee123d2c458db1f4 - 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 57365a8d2cff5eebde958e27337b16964165c9be - optee/optee_os/core/include/drivers/zynqmp_pm.h 06eeeda268cf3762b55e4a86c63c606f0a1383f8 - optee/optee_os/core/include/drivers/imx_snvs.h 2890796b0472edd48d6bc36ca057a19720fdf48a - 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 c34c44797b1839c6df9d5ef1d33d8724d99d4c41 - 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 6267fd81bf3990311590c922d90fc4cecd83ea5b - optee/optee_os/core/include/drivers/hi16xx_uart.h 90f5cecf44f1353954b9f509e72380c23dae5481 - optee/optee_os/core/include/drivers/zynqmp_csu_aes.h 3eab3b939280e8984b98283ca0325b82ae90fa88 - optee/optee_os/core/include/drivers/serial8250_uart.h 6b7582abba355109d5d9d986e907d3811d747f5d - optee/optee_os/core/include/drivers/stm32_rng.h fae94b268fec5a3abf648cc84a211a1fa4711c08 - optee/optee_os/core/include/drivers/clk_dt.h d8d7d4a8d49679a771871e00b6cd40f7ef72321b - 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 fa33f522c3cb38d765763701719a079010068a81 - optee/optee_os/core/include/drivers/atmel_uart.h 21f16be3e12698442b37c7fbd4b2cf9b5e1eb2da - optee/optee_os/core/include/drivers/mvebu_uart.h 850d68c54c252aaad1b085a02dd9755cdafbf8d1 - optee/optee_os/core/include/drivers/pl011.h 32c3753b88a0007a0bd7bd03bd183240730782b6 - optee/optee_os/core/include/drivers/zynqmp_efuse.h 1812668c99effd763e9d6c5f8832ffbf09476001 - optee/optee_os/core/include/drivers/stm32_bsec.h 99bfacba42bd5af9f2397720ee762052951c6bda - optee/optee_os/core/include/drivers/stm32_gpio.h 71790296a245b0eb250d447d6f06d278becf3f3a - optee/optee_os/core/include/drivers/scmi-msg.h ed0702ba8e49ca5d2b8fde5b754911bdd2120b71 - optee/optee_os/core/include/drivers/imx_i2c.h 3266893eb7d2e46e79fe68c327377ceb0b2384f4 - optee/optee_os/core/include/drivers/bcm_sotp.h d6e344ad9b81930944052a2aa7439fea4f98e7a3 - optee/optee_os/core/include/drivers/imx_sc_api.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 de5db4401e8d142e22d114224d007921eac318e2 - optee/optee_os/core/include/drivers/gic.h 5039a1bb39cb28575fc0a305850f40df2f3a8e48 - optee/optee_os/core/include/drivers/stpmic1.h 6110fa3ecbd1bb7185abcee753303ad1090d1aca - optee/optee_os/core/include/drivers/ls_i2c.h b0bd034bd589dd4037f5d2c08c927680967378fe - optee/optee_os/core/include/drivers/bcm_hwrng.h 03e62f840c1787e03eeef8e2651241d857e9db43 - optee/optee_os/core/include/drivers/bcm_gpio.h b787c9b07112e6f43ed8abc347b883446f6a4eb1 - 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 5ff0b0a51178c901092daedd19fb97ba89033676 - optee/optee_os/core/include/drivers/imx_uart.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 183cf51fc6158367d25562a122ff0c83e35c671e - optee/optee_os/core/include/drivers/imx_mu.h aadb7be6044c3bcaa87e467e366a80c602d2fc46 - optee/optee_os/core/include/drivers/stm32mp1_rcc.h f15cc62ed1de06587145c0fb453cb291930709a5 - optee/optee_os/core/include/drivers/bcm/bnxt.h 27a0bcdfc3607bdd1a545343d05ec3d2fc417762 - optee/optee_os/core/include/drivers/imx/dcp.h 52b5808b4a516e6c675df4c885fbc0c9fda34c4a - optee/optee_os/core/include/drivers/tegra/tegra_fuse.h 10d24246baa1619ea4de7cef8ec205c94aa2aca2 - optee/optee_os/core/include/drivers/tegra/tegra_se_kdf.h a78b817961d28a2e17766f4cd2dcda7f92414b8a - 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 aa960f1a28cfd7d8204037c81beaf55484eb2426 - 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 d12fd2cb7d26185eb7bcea0e666a0b97aa742746 - 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 c692ac6e2696827769b5da9865ffb5ce917c4a5d - optee/optee_os/core/include/tee/tee_fs.h 9750e6a5488dc5a6a2bd7c73d69f8b7324519907 - 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 5ab6e080b8bd4d660989be114a56aba81bfe6713 - optee/optee_os/core/include/kernel/pm.h 6a70452c8b44c8e2c5cd9b2882d9b5b2523e6d6f - optee/optee_os/core/include/kernel/ts_store.h 0e119d6c1c012d0e897cd92f4d1e69edb103d332 - optee/optee_os/core/include/kernel/trace_ta.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 20f6426b8501c30095a7977dc89ac1b187e81180 - optee/optee_os/core/include/kernel/dt_driver.h 1f01922d333b66cb291425b1df13da258ce3c63a - optee/optee_os/core/include/kernel/ldelf_syscalls.h 96d25725477790880e31e1fc1bf8348e57aad30c - optee/optee_os/core/include/kernel/tpm.h 50ad6b5029b19a50602abf8eb47e8e9899f1c5b6 - optee/optee_os/core/include/kernel/mutex.h c4ebaf232c23695ed4c208b1b72cedeb996b2336 - optee/optee_os/core/include/kernel/dt.h 3c866070d82642a38f13295e6f77062550edf5ad - optee/optee_os/core/include/kernel/msg_param.h ad2a242f3d2159af1fbab6dd61510bffc9c4ab5b - optee/optee_os/core/include/kernel/wait_queue.h 622d2a0a223a6213e2c69689b9696e59c144af62 - optee/optee_os/core/include/kernel/asan.h 20b6809c10b27e0f3f68a37fb3e63acdbb2ed77c - optee/optee_os/core/include/kernel/early_ta.h a0b85246de5efd3059e6668d1184a7be7210efb2 - optee/optee_os/core/include/kernel/ts_manager.h 008387623d8bffb1af193f51ceef6a0e1ee50d27 - optee/optee_os/core/include/kernel/huk_subkey.h 7f89c2dabef6f3e9504dd329d767754a6649de96 - optee/optee_os/core/include/kernel/user_mode_ctx_struct.h 7beb0d03bbf670fec4501a0f47399d2688f320ea - optee/optee_os/core/include/kernel/tee_common.h 5fbe79e0b932e1b83838be100efc77aa8c4bec81 - optee/optee_os/core/include/kernel/tee_ta_manager.h b0de994edd87f61963212e452f9a2395f6cfa405 - optee/optee_os/core/include/kernel/tee_misc.h 9580dfe1f16580758041e227e65811d04ca384b6 - optee/optee_os/core/include/kernel/lockdep.h 794f29e2701b79021aa45108e202b7dd5b569624 - optee/optee_os/core/include/kernel/chip_services.h 6c528a520935bddfbbaf947901e2980f63070147 - optee/optee_os/core/include/kernel/virtualization.h c7f3799e8db3911f324d4cb4892e433edaab0059 - optee/optee_os/core/include/kernel/unwind.h 62d13a3db07b7c18d5949063ea1282c0378cfd54 - 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 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 fc092160167db1d740c059462903eccd4996ee18 - optee/optee_os/core/lib/zlib/zutil.h 8770ab43c9050b824c646f6e6cee8b3c0628cbda - optee/optee_os/core/lib/zlib/inffixed.h 9e84fc471a15b733b098edc11d5661c8a15dcfb7 - optee/optee_os/core/lib/zlib/inflate.h 41d8cbbc2f240fdec91849f59dd511c3a216f3fa - optee/optee_os/core/lib/zlib/gzguts.h 16c5383a343571b1249e360ad8df26350e6c19be - optee/optee_os/core/lib/zlib/inftrees.c 8139ab5dd86e53ccbde7ba4e78200db4cd79f9a9 - optee/optee_os/core/lib/zlib/inftrees.h 10247ba75c580d43fcc18a915ebc9482e9ccb234 - optee/optee_os/core/lib/zlib/zutil.c eb37e780cdfe0dbafb29c0fa8629125c6e19bd6a - optee/optee_os/core/lib/zlib/adler32.c 0633f23750ac1655a30e3fb10b246284dbcf0185 - optee/optee_os/core/lib/zlib/inflate.c 13d3984f852f6a392d1d3b73a6ea6e3114a26713 - optee/optee_os/core/lib/zlib/inffast.c 341003df806d2bcfcbd194fc3f9da99919b918a9 - optee/optee_os/core/lib/zlib/inffast.h fca1beaaddfd3529d0286e1385a9820e4ee4aefe - optee/optee_os/core/lib/zlib/zlib.h ce569e81ab26f5eb8d922b18be6561af7876c4e8 - optee/optee_os/core/lib/zlib/zconf.h 4a0a6a4143a741a93bff92126e6928fb9c40785c - 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 7f29b7a0d58635d1af05ef155fd252d5975435d9 - 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 da0383e5612ae0c648640af4f6d5c03322343514 - 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 466eb4dd083c77261b455c56dfb3036243b0992e - optee/optee_os/core/lib/libtomcrypt/sha1_accel.c 013e84ddde665682a36781ea3391f5014d0138fc - optee/optee_os/core/lib/libtomcrypt/sm2-pke.c 60e4647f65f3dfc0264f477c4be7e8a70e6c3a0d - 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 46959e8a5e7b77584fa4a6df7612774554a84f7e - optee/optee_os/core/lib/libtomcrypt/dsa.c 5cabbae14bf3a3eb9b078b3852f2a6356b29cf4e - optee/optee_os/core/lib/libtomcrypt/hash.c 627ba519b1c58c51f6ba86d4c3efcf948e497db9 - optee/optee_os/core/lib/libtomcrypt/sm2-kep.c 2c4bd32c499d8f43589465b04ce7cd93e7cb2a8c - optee/optee_os/core/lib/libtomcrypt/tomcrypt.c d3beca58e52f1477c74232cd3862fdeec805839f - optee/optee_os/core/lib/libtomcrypt/mpi_desc.c 191319cf67c91dac0437c501694f9973ada49045 - optee/optee_os/core/lib/libtomcrypt/xts.c 1283bd823a7ec1d1d5c9fda7c76ca840efa82244 - 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 f5b7da88cb55e9fc917433132a04029dd8a80d40 - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd320.c 04aa8573dcf42f7c1e189f5b5b8f106e2717f4bb - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd128.c fa9e62043a50c88ebb4f79a404859cde8c84cd53 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha1.c 07a5c304b0f2845417a809e48993506fcfdc59b8 - optee/optee_os/core/lib/libtomcrypt/src/hashes/md2.c a06c821747be82831ff0eb56c92be553c93f5d1d - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd256.c f533e9c089c1fab81b8f1befd8a8d3ed343b59f7 - optee/optee_os/core/lib/libtomcrypt/src/hashes/rmd160.c 3387bdc2bcace608817363df54b284e21197dba5 - optee/optee_os/core/lib/libtomcrypt/src/hashes/md5.c 76d14b8c6358900e8cb2d81ef7e37eba461d8c3c - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha3_test.c 57a7d42436d9ee0cd22f1dc40ff0f917a352addd - optee/optee_os/core/lib/libtomcrypt/src/hashes/blake2s.c f1f13a377a570da8edc1af2b11a82220f68c1a81 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha3.c 5e89f948c6f4bec5d8da302212b2046202b08c04 - optee/optee_os/core/lib/libtomcrypt/src/hashes/tiger.c 74edfe96b464a0291030cfda2d717fe703a703b7 - optee/optee_os/core/lib/libtomcrypt/src/hashes/md4.c 688584301e6a91a3f7a34cad5e2583634f2d471c - optee/optee_os/core/lib/libtomcrypt/src/hashes/blake2b.c e1c4e8a85bf39dc2edafd70254d64232c31214e8 - optee/optee_os/core/lib/libtomcrypt/src/hashes/whirl/whirltab.c 726cbb1289d548f9a7eb3460a3ea63b3586b0e0c - optee/optee_os/core/lib/libtomcrypt/src/hashes/whirl/whirl.c 752c57974151d11ddb8cd7c8ed5141028fca8572 - optee/optee_os/core/lib/libtomcrypt/src/hashes/chc/chc.c d7bbaa7268247a0accc246ccbb2e9be13521260e - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512_224.c 45c56d126d3592d8c95254390dd05717233beaa8 - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha384.c d9184b41c64d2e67faa98b53a6a798b8136d57eb - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512_256.c 4e273f1a1e1814d462d9e913c0bbdfa680d9efcd - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha224.c 7f7d0ee32cfd5f440d757fb00ed17c6cbe988dad - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha512.c eccab4bcde54f1c830cee18b5c824b1896e1f86a - optee/optee_os/core/lib/libtomcrypt/src/hashes/sha2/sha256.c 5b15805540cf2609acbd2017582f4a201ed8658e - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_file.c 9f8405b5a7d67b47df20c2f754d471910d702921 - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_memory.c f70e83bfb313197e7988dd039c70203115ae10a7 - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_filehandle.c b85c6a808bd49cc6fb3f4822373fcfe4bed452cc - optee/optee_os/core/lib/libtomcrypt/src/hashes/helper/hash_memory_multi.c c0f3a9835a794c47e3e7612ce01c1248561100d8 - optee/optee_os/core/lib/libtomcrypt/src/prngs/chacha20.c 9991ddd993b1d2bcb9dd9cbc89a61da664f3ddd2 - optee/optee_os/core/lib/libtomcrypt/src/prngs/rc4.c be008df6b430591ee99991122d519ed6e6f065ac - optee/optee_os/core/lib/libtomcrypt/src/prngs/rng_get_bytes.c 8e90a21764397c33f08831537abfb07ef8e8e90b - optee/optee_os/core/lib/libtomcrypt/src/prngs/rng_make_prng.c 67df9d8b3a21ec5ea392040b9e4713ef5c295d59 - optee/optee_os/core/lib/libtomcrypt/src/prngs/sprng.c 2dc8ddd0e76356dcc33ee742078827cd483b2a12 - optee/optee_os/core/lib/libtomcrypt/src/prngs/yarrow.c 00ec244320470a3c68c7ccf23b37b7fc368c8666 - optee/optee_os/core/lib/libtomcrypt/src/prngs/fortuna.c db3b865d52bb2f660763730d531ed10af86293ed - optee/optee_os/core/lib/libtomcrypt/src/prngs/sober128.c b0ac689af42bbb4b11968ffae967aab1e4768c53 - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk.c 5938f07199f7d15830fb25c5ba66db2e396d98d8 - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk_test.c 6a830a288dfb89b8696d4f1f84abcb12227dbce5 - optee/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/sosemanuk_memory.c 529c2565a2a986590b34dfcdc3a54e261fa55e44 - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_stream_memory.c 5c2b1067becc85e1b4e9216794625212fef25370 - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_test.c 7063b435136cc2592d03bcf89811775e7e57ffc2 - optee/optee_os/core/lib/libtomcrypt/src/stream/rc4/rc4_stream.c 59ca23bc0e0d79eb3329c3187f84f538551dba41 - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128tab.c 3cd97791d427f4b63b54bda13d4631b769d942fb - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_test.c ec2dae2cc66460776b5b60978abc7937388206e9 - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_stream_memory.c 30e13f9c24ed53275fa6eb7a6a162c7982ae7abe - optee/optee_os/core/lib/libtomcrypt/src/stream/sober128/sober128_stream.c ab1dc040d2873b2e3d21d9df7acc6c2a62bb3d9f - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_done.c c76b7b601d4df0c534d56795b8a06fa22006735a - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_setup.c 9c6d16a811d5ca98fee174b3fd78963aa6e9c03c - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_test.c b81277f87d6cef5bdd9db6985b32cc8068490419 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_ivctr32.c cf38dbe138c9dccc3ef6fa3c4b819eaee01c8c3f - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_keystream.c e4d55e2bdc6f4dd659aa2461028cbad8e05b5eb3 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_crypt.c 3aa33c69831768631680effe7b98a13f486cfede - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_memory.c a3276d8778e3745c38baf73b580b9ae077b4de23 - optee/optee_os/core/lib/libtomcrypt/src/stream/chacha/chacha_ivctr64.c 21c18ea37c720d35091468946bde0a89487927b9 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_keystream.c 591d7276697b062bc9a1f303b04c57ea19fccce1 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_ivctr64.c 7c15a87fad2450cef328a4a2c1418067f723c044 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_setup.c 621e84cc5baad5a9fdcb4771389fc98bba94b6ca - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_memory.c 79d8f627d66de47d74d15f14e8353af5e28395e3 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_test.c b3542b89905fd0858b9f3baeef93fd5512ead1c5 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_done.c 455927efd0913267d3a0982999abbc3a119cefea - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_crypt.c 656159c16d7ef0f5bf333b886c8208d34e2ca4c1 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_test.c 22f585fef4dab34717b32a33d6593ce53c7761cd - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/xsalsa20_memory.c abd9fc0ce3276e6c1354d6851d8675e8572583d0 - optee/optee_os/core/lib/libtomcrypt/src/stream/salsa20/salsa20_setup.c 4282a580ce985cafd5e6bb173d802aeb8cf475bc - optee/optee_os/core/lib/libtomcrypt/src/stream/rabbit/rabbit.c cebd4c3aad7c56255bb86742d817600ea11d2e55 - optee/optee_os/core/lib/libtomcrypt/src/stream/rabbit/rabbit_memory.c 1435d34772d9e50c63b37ba98f48a6255e30fafc - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_encrypt.c 23b1e20e4c6d8011e6ae470b2017c25b5b8dd68a - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_decrypt.c e6dd00629128a2cd8bb868570db0342e29e8cad4 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_getiv.c 81a775b341c7e151131c91723dfb1ee102bf32fb - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_start.c 3df88d62809c8fbd37e08ca802d68ab6a176c7f8 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_setiv.c 53cfab8a4e7c863b347a12f911e0f35a906f0b65 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_test_mode.c bbe3867fb2f4ef40eaff3d27c1a32a0f00e84f81 - optee/optee_os/core/lib/libtomcrypt/src/modes/f8/f8_done.c e0adf6ed81b3a6fc9d4fa42952144cec9d353f9e - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_test.c 93b27f8bb2f6c1d11d17edbe60b395c2887c899d - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_mult_x.c e7ee085ac634194a6b8958c2b690f6a95ac0f80a - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_done.c 01c397c11a02749d41bccda993b4121a5e1db9aa - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_init.c 8f30441042d8e70baa688ed90f6afcdf94883507 - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_encrypt.c 917a6e155203f084722bb7c7132799ee025c074f - optee/optee_os/core/lib/libtomcrypt/src/modes/xts/xts_decrypt.c 9ab9f56f4d62bcc11cf04e68d20ac7c67f633f01 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_decrypt.c c45f44fc64ba79544a928aef4a7abefbbffa74fe - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_encrypt.c 0b89cdd8cb1e47293b88878ebf03d67749d1aba3 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_setiv.c dc71d3796576ca7e7e2037673c03d054f083120b - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_done.c 3a201baaf4a3d025dea296653cfc50fb9d653d03 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_getiv.c 29cf274b26fc009044c57e930ae68f9748cf5371 - optee/optee_os/core/lib/libtomcrypt/src/modes/cbc/cbc_start.c 706b8d96e011054a8ccf3cc81e7f8aac654303df - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_start.c caba8a60c8d630ef988ec4c724effa0835645366 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_getiv.c 1af1be4cc528bd576daef1b2c2f64c64ddd32745 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_encrypt.c 843db11351a8391298fcf8d7b2779fb50d6c6290 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_done.c 17cddabe84a7152ad14d35a332d15a1c0f9fd024 - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_decrypt.c c2d76d71e6d046926079d6d25ad4704e41d4f49d - optee/optee_os/core/lib/libtomcrypt/src/modes/ofb/ofb_setiv.c 42469a5729d3bde864baf15ba21653ed1fb7d957 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_decrypt.c 6d1de1c814bb98c1eb9719be0aa8f16bcdbb85e6 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_encrypt.c b9e3ed1072b3feb1e6f4adae5719ad632de259e2 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_done.c d41bb70541a11ab427db0bce9435706248e53aed - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_getiv.c 839ab2547f9ac40f92274ebd370782d4d692ff45 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_setiv.c b022b663923f029d024938862e8e6a2115b90a26 - optee/optee_os/core/lib/libtomcrypt/src/modes/cfb/cfb_start.c 855b63b9e59223f899caa687e7a5359c8705fdb9 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_setiv.c 117ff278a918ad95a25d80563698570be033bfb4 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_decrypt.c 0d19ee78b932f1ba56ec8ffb7b345f0fea418ba7 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_getiv.c 45cce86ea25b55695a91af0a0b50c0dcd3fe693b - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_test.c 95a44874e6c70587d2a31b5440b682b5969fa7c9 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_done.c 9a3cfb397e6fae00cfc1683f9b8d72babc899498 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_start.c 65c28b141a5f416054bafce25f42bd39dd0a8e59 - optee/optee_os/core/lib/libtomcrypt/src/modes/ctr/ctr_encrypt.c 298863a2fd00a344eebf5711486a3144bad81e2d - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_start.c 7721c46edef41cf020ceab9f199a0e9eed3376db - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_test.c 614ba29f3e8614802858be23daccf9f16576094e - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_setiv.c 0ba8ba80c3ae5ef0e25ddc174e3cb18847a99a44 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_process.c 24f1ea95ffb3ab6e16df410951fa5c261ecffc29 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_getiv.c fb57eb8a4e898c5882ffa6026164ee622aa6cd1d - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_decrypt.c 382fc3ce88195c916fea2f6ae5da28b4e2e52c15 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_done.c ad6cd4d1a9d084c37485a3d245842512632d8a16 - optee/optee_os/core/lib/libtomcrypt/src/modes/lrw/lrw_encrypt.c cde2354e8421617edcfa2b866353ca3431ef4275 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_encrypt.c fcce352d6c6ab0cbaa77d9d0b7d6443048723822 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_done.c eb75b2ac27fff0ca9ef526ab172f803c01a03880 - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_start.c 8871b157952ef90cf8cc07b2b528bd237aef086e - optee/optee_os/core/lib/libtomcrypt/src/modes/ecb/ecb_decrypt.c d8d767dcf68e12f0b1c8437026c12ce0457bf7b9 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_memory.c 6392d2785ead3d6eb88e61deb6203550c18a09c4 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_mult_h.c 7d5d2e6a44538ea8adb045d5f0b554df6f544a04 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_add_iv.c f266088102531e59541c4d918290f76844591c73 - 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 180f7b4e2d727747dce57fd7ce794b4b3139bf58 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_init.c 105e89159e2ab76c471c4cb3069767092321f707 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_reset.c e2d44f2d265ed9e6b3dcd55c6504ce3ddf2f712a - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_done.c a528e0ad542470ea90e78e119dd40eb021518dc5 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_gf_mult.c 8b87b22064f32108e0254ee469ef95ed95ec03e5 - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_add_aad.c 16cf7a55f86f42c96aa106eb88ede2b68400755f - optee/optee_os/core/lib/libtomcrypt/src/encauth/gcm/gcm_test.c a73231d496298ce754dfd5570493c6fc99284ce9 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_last.c 27506cedaca5893481cabebc698b80dd81d00bd4 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c 6a7491ff008bde5618d25051a720b5743269c93e - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt.c 30b5cb05b1bcc53680b131b49789621e35f1f4b1 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_test.c 8b4d07d243ef22ac94b4ff8d964c94366214bf65 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_verify_memory.c 5de654932d350da549d806642f2edd83d2c5bbc8 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_add_aad.c 85853d7476e30a0d6624728e760772af04e03292 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_last.c d6769de40d4e6198cd16bccabc7d1a53f39fb1b9 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_done.c 22d2f524ee9ec5e361f1535d5b89770248d9aead - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_init.c 1bcbbe5190b90f600a40f7c78b152db245f75bbe - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_decrypt.c 7d0d7248bfeff6c2e175a3a570bef2a125924dc2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_int_xor_blocks.c 8f35cb13f836faa3b3baf2f4c0a2075407810281 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ocb3_int_ntz.c 07a1f265dcab1f37d915581d48833ecddee7e5ea - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_done_decrypt.c 4197f58ba7c4401c9eca8a67adf9c06f5e0a8a1e - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_test.c 1f88e5e49c51364f193d236c12fbe6a4c6c790e4 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_shift_xor.c 20266eef3975cbd85380634b7a787ff80c164e4c - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/s_ocb_done.c d7a2a5517a35b26088a7347b56760f664aba3f82 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_encrypt_authenticate_memory.c 26a5a06a70fb58a1766c2476d5fe3b31571cfb4e - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_decrypt.c 787fe2e684d08171ecb30bc6a573d87f52fb4672 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_done_encrypt.c 648601c6440995fdc18877a5a8d87e6d292230c5 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_ntz.c 617fe15f4d17800e71e96c655f0782e8848f5ed0 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_encrypt.c 298b6de6a991e334690053f9aa8f6c21de376ef0 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_decrypt_verify_memory.c 073888b400308c3febc62b49ea368a7d91a63f96 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ocb_init.c aa298a96d7a7f683d3f96f2d3c157510d72a0052 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_init.c f77f49a2442670f3cd2b36fab06f508ed955a779 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_test.c 97df3261f1489e5bb9658d4bca86fa044c58f4d2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_memory.c 16c42fd0e845f44ce4fe29d8af11b2d9f27cc18d - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_add_aad.c 9635a6663446411b69ed3128e1208722df5acab2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_decrypt.c 8c43875f4f41bc05ade0068748ff42ca9ac9ee7c - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c 70fd8aa6851fb7c7771047f25771877e1d3f44d2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_done.c 54bff3b3ea2f36fc2a914c159bc100ccf19edf73 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_encrypt.c 4a0bb241a8490af91eea8e2c782c9657a7948e79 - optee/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv.c d5deee879d12321c7fc37c8b54cb4d7bde4bb719 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_decrypt_verify_memory.c a38fdf0ce705825ed9cd33235b1b4c61b9daaabf - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_encrypt.c 082cca8fdd5ed74cd302b838e0e309ff55112bc2 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_decrypt.c c2564ade8140db6136dfabcf39f64dafbf42c88d - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_done.c 2db0cb2a461f368cd70027dd901eaa7b32d84a31 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_test.c ef878a1d32df2139e53ab18c3ba5f32cfb430d73 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_init.c c8a07dc2c3bc156458b9cba9b5c345707d15b583 - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_encrypt_authenticate_memory.c 7b322004129ea3283f7bd237c18b15ac921a3c3e - optee/optee_os/core/lib/libtomcrypt/src/encauth/eax/eax_addheader.c f398921a2578ae8cafac98d591f8bf3bcc43812e - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_reset.c b8298b88992aaa34459af3d333448d69ba5e9b03 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_process.c c73a97246278246dd185894dd41da21ebdf22c4f - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_memory.c e05fb9e1239c358266e85d5d2ded970431834b33 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_add_aad.c 57b8e2395faa66e9021238cb1dcf71edcd85949a - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_done.c 973ed2b4cb649fee861ced14fdbc9757b35b508c - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_add_nonce.c 2975e12c1ef30d68bbb76471aaf6c6b1721f4fc6 - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_init.c 190d0a845564ba925781c04068c7fb2d7823177d - optee/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ccm_test.c 92022e481254992baeee3a1511ab6f56cbde2bdf - optee/optee_os/core/lib/libtomcrypt/src/misc/burn_stack.c fecb09341abe3a36ec513aa9d52cb82cff3ad673 - optee/optee_os/core/lib/libtomcrypt/src/misc/compare_testvector.c c340056b94a08d48aecbc8629cf26623d1c077df - optee/optee_os/core/lib/libtomcrypt/src/misc/error_to_string.c 4ee7abfcd51c96dc74c5b421470120cf1e52ea72 - optee/optee_os/core/lib/libtomcrypt/src/misc/adler32.c 6ad351f1f3de1aec52934e0d2a94eedeadd6b10c - optee/optee_os/core/lib/libtomcrypt/src/misc/copy_or_zeromem.c 1b6cff0760ceb5043d191bebe82a74169af47f68 - optee/optee_os/core/lib/libtomcrypt/src/misc/zeromem.c 85c625d5e5080f43eeaaf0a153910fd8a6b59a12 - optee/optee_os/core/lib/libtomcrypt/src/misc/mem_neq.c e9a92042b91de19b3170b482823bc9f82003ebf3 - optee/optee_os/core/lib/libtomcrypt/src/misc/crc32.c 7d917b06c02543842b8540943650fecb44109b0f - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/pkcs12_kdf.c 0925c6ea0a0637d53910a53955ba7fd099174f58 - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/pkcs12_utf8_to_utf16.c a6b8b4d7b08841e2436df2bb5d315dc0b6a963ea - optee/optee_os/core/lib/libtomcrypt/src/misc/padding/padding_pad.c d8512f85e76cc802607289720b9adcc1f8eee71e - optee/optee_os/core/lib/libtomcrypt/src/misc/padding/padding_depad.c 2ff905d64d856c4e651b9c7fe0b91373c59230ec - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes2.c 2e570b62c3c29970c7f119f001b035487b2fc492 - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes.c 94433df67012f87f1272164907a815c4e16401a0 - optee/optee_os/core/lib/libtomcrypt/src/misc/pbes/pbes1.c 55f32985166fb94878ac8844f4b73f27cc8006f4 - optee/optee_os/core/lib/libtomcrypt/src/misc/hkdf/hkdf.c e1c2e8463fbca6d3ab8e2d0bb682ac7edcf57f69 - optee/optee_os/core/lib/libtomcrypt/src/misc/hkdf/hkdf_test.c 1424153d50e8209aaa82528cb3669d16a7f51d3f - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_sizes.c 7977b73f8a90d9b369618d4d78016584d2093a2c - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher.c 9511eaeb1da11bfac33990af7f0a4c066d079de6 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash.c c13ffe97969200c8e98b47ec7d701954779c8c4a - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_fsa.c 4ca7e525e0cdbb967fa935dc04929de0d5ed1309 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt.c 0d8d3cbad4f0d8211e64dad13e331cc3171e92e9 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_prng.c 2ffb7d8ecc0026236e3629743da100a335034297 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_prng.c 848f5e890dd4e3083cf00faf0ec05997ee55adb7 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher_any.c 771b8af3bcc8b13084c5af0f4caf21981ec2ca51 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_any.c fee375d7ab845550d53ee260f78c26a4133a8390 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_hash.c 94982259efabae5737c02eb5d3b3e78578770ffe - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_prngs.c 66f3c49a42ec15311181ac5f035308e66611a58f - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_prng.c 363e6c83203c0771c2124717163d419a869b131f - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c 4b1aeb79b94c6a7f24634e72e2f5c9717e058a73 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_cipher_descriptor.c 08f7c8c03f5f7a3d35cd062301f3e495996acedf - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_ciphers.c ae06af305112001cd8ac66ad906c08b367952b4e - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_constants.c 1ac37d79331289303774628f97cf8213e3b14621 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_cipher_is_valid.c eb04ad61272d960fde8a681230519028a897ac4f - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_hash_descriptor.c 7839bef1523378cf6fb6fda44d57a33144421ef1 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_inits.c f504e0a7245303c302376aaa2b9acfb509ea591e - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_cipher.c af885ba81a624ff27a9b9e17e36549c31ec8a80e - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_rng_descriptor.c df28110a3b5cfa7c494d91f561fe17d610058f4d - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_cipher_id.c 339d69914b02cb2caa2c8d3cd869045a353e339c - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_is_valid.c 093e1385175c4993d6a949f68b4630fc527e5692 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_unregister_hash.c d026e9d82da7cd30d7ce72f4db756a040dc765fc - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_id.c 0cfae82c207083fce38fa4645e7679fde4619147 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_prng_descriptor.c 47384029e1ac5e150d9d622a7ce0f22f4f02b368 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_all_hashes.c 97bd2f3e723eeebdd8f125d4f58a0a5aac3b63c7 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_register_cipher.c 9dab3af80b1a4b74be9fb2e2743ff8708fd55a78 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_argchk.c c11464a3af7e70d496104c8ece071ec929c8c8f4 - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_ltc_mp_descriptor.c 6d8c7ba45d1154e60e8ba1367852a1a55a4ea12d - optee/optee_os/core/lib/libtomcrypt/src/misc/crypt/crypt_find_hash_oid.c 3f5730d946be75e642faa47d7178d65ab3734e6b - optee/optee_os/core/lib/libtomcrypt/src/misc/ssh/ssh_encode_sequence_multi.c fb109df30613fe5584ec576a7ae76bbc9364f2d9 - optee/optee_os/core/lib/libtomcrypt/src/misc/ssh/ssh_decode_sequence_multi.c 129b57d44df0178aafc66165255519e1ea7a1183 - optee/optee_os/core/lib/libtomcrypt/src/misc/base16/base16_encode.c da9348ab5ec198150ee96f1457ae61f5e307452e - optee/optee_os/core/lib/libtomcrypt/src/misc/base16/base16_decode.c 75534ae697585233ca79ecb70b4065ea5a6f9179 - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_1.c 6f82e0b86c179453e2a4b1ed1741d156635dc497 - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_test.c 24c707c4fbcddebfbd73ce4440b52775fd3a9b3e - optee/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/pkcs_5_2.c 46340a727c90dc7512aac07d910f7387905c4bb6 - optee/optee_os/core/lib/libtomcrypt/src/misc/base32/base32_decode.c 1fa0193de66dd830a6b8cb5d9d881d980eeecc13 - optee/optee_os/core/lib/libtomcrypt/src/misc/base32/base32_encode.c 99954e67f50d4e180464a6a852764da7e467960b - optee/optee_os/core/lib/libtomcrypt/src/misc/base64/base64_decode.c 009a1157c67cdbe1ad216079592b5bb79216278f - optee/optee_os/core/lib/libtomcrypt/src/misc/base64/base64_encode.c 00dcc357b058c7bd26b6cd12fa3e37f373f4e3ef - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc5.c b08da321ec133ccf600abcdfca14ce70477d2cc4 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/anubis.c fd724afd77fd57c41d5c5e14ee19a628c9f3a509 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/des.c 259147b20da0609752687b581ea60507a3686cb2 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc2.c d6064e0ce84f133ce1f8055516a54f639104365e - optee/optee_os/core/lib/libtomcrypt/src/ciphers/khazad.c 1c095ca7ae32b041a85d220a39ba864b79a2cd52 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/kasumi.c ad060b4e5c3770dcd8b3ba661274cbc91f14d949 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/cast5.c 0a800f56072351e10b1cf2a4ecbc49fbeadbdbd8 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/idea.c 42e1de13af0a08935b4a18da9026e2bc2f842d47 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/kseed.c 9be1878fa1561976414e5465d85c3c2c38c0e4a3 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/skipjack.c e4c514abafe02508ab5f7b8e7cc0af207d687e42 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/xtea.c 8bc91cd8cece0f8c8178e7093ad960e23c92e157 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/noekeon.c 8cbd1e75d06d8a87d898adf7953bad5f5da61bbd - optee/optee_os/core/lib/libtomcrypt/src/ciphers/multi2.c 741d3eceb16e094d04b6e03d24ec18a6018d21c2 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/camellia.c f8be6e7b4db257a623a5970c887a572de3f0520f - optee/optee_os/core/lib/libtomcrypt/src/ciphers/rc6.c 0ddc4c48de30635e2342c64f19ec9c951b95f049 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/blowfish.c 18b20f24306911aabe453d5a3dd8300e992dfccc - optee/optee_os/core/lib/libtomcrypt/src/ciphers/serpent.c 60eced2ac882aaf474e266e74c6c52be77a5c686 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/aes/aes.c cbbd27082f8bd319fb96df90f3c43d5ea43b8134 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/aes/aes_tab.c ad201d963fffdab2a50e6072b7c6a18dfb0d67d4 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/safer.c e8b78dfa060ba45c657ae0bc3f9ee1fd92cf3313 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/safer_tab.c 331aa91be00816462bdf341af49f865376ee875a - optee/optee_os/core/lib/libtomcrypt/src/ciphers/safer/saferp.c ce193d032f19f96d4216184bccb772f7adbdb4c0 - optee/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/twofish_tab.c 31dac75652de97f94b3e45160ef843aadcab4a1c - optee/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/twofish.c 43c8978da064343e730fd2f419ca2a3aeca5421e - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_math.h bc81be319b5e88d5de13b1d13045044c0e16cb25 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_custom.h c532e82888c202298a94b63acd6cbfc8e7ead341 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_macros.h 3dbc620d15ef39c3479221b65271df7fbf8d28e7 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_hash.h d6db951c3f5a058d4827618334d3cd1f49f2540a - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_misc.h 892bb975a31d956ee91a8b4377c8247bef29a83b - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_private.h 0b266c4200201232a0a8518c8e36bc124d866b8e - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt.h f846b425b9b1abd163af68910640f2987b944d89 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_pk.h 4c1fa18e96a8b254dbcc28868a8d1e6ccf75f616 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_cfg.h 7bb701be80e327ed227dfa1e2235fceae4554abd - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_prng.h 2e713c6c463faaebb4e01472732e51d74aa5b185 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_arm_neon.h 39e5c28a693bfdcebf5dd6821ff378f662e2210b - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_argchk.h 842b7c4d51573a3ddfc7edd32f367d7ab35b76f8 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_mac.h 414446ec8def5ef118b2ee1e28b0864c59d45d12 - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_cipher.h 518f4f4d729a107a3e59d8c0368af9e0c25d232f - optee/optee_os/core/lib/libtomcrypt/src/headers/tomcrypt_pkcs.h 70cb636e4e84f048f04f8aa0b7a94cdd55ab68e2 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ec25519_import_pkcs8.c eec18378742ac6fc247758176da22363ffd60d91 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ec25519_export.c f578d6ed250f38f642ab939cb1a1c3ea0753eeb3 - optee/optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c dcfc1f7c511ab6bc00eff5c9606074259883f693 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_os2ip.c f58539d26522b5038648b568d65b127e3e790b06 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c 3599512fd378208e2057016a644433a216e28059 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c 40339724f0841fb2fdbefa2394b22612f821d6b3 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c 8e6d61cca2a8fd1716522235429ddea70f765751 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c eaafbfabb1c667ebc2c68953100eda987ac11bfa - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c f101f27440dbb3fb90dd50956c8b8f9a40cb0433 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c aa54dcc08cccfec5017295a35a3877f1513cd4b2 - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c aca7c79aa1c6b438d3d425923973d05579b2e89d - optee/optee_os/core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_i2osp.c 6b31caed35ff2f019df30528edbab6939bdb3e6c - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_set.c e47f7f1e330690dfd6696c80030e179038d701be - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_exptmod.c 582eaa949fbdf09fe4bd09c3a10c0fe10b47c9df - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_get_size.c cc2a94453960fb1aa574a1c2e735cbd257546183 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_sign_saltlen_get.c 1e1fe0a965e2e91809f1005c8d7310021a4a93b6 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_make_key.c 5b164e1857c97dd98df7517c6d909655d974037d - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import_x509.c a5408efe1012460c65ba483f0ed59bb56ba7609f - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c f748e0aa564b9f0b959ae8161d78221d36ce7c69 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c 3ca654b86e59629caddfe4679a62d32e84d2edf7 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c df2f01dc204fd99232af1787dd3a46c406770c84 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_free.c 07a4bc870a0b05e5a748260efed5dc198bba9fd2 - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_sign_hash.c e191a55129d36a986d2a491a92e1461bd69ccb1d - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_verify_hash.c ad7c6d4e8a80d112fd3f40aa9d2d04d07077977d - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_export.c 1ed277141bc8dccc963df2a717436aa072186e5f - optee/optee_os/core/lib/libtomcrypt/src/pk/rsa/rsa_import.c be33f0f15948cf06f0a069b2f2a4dbb59589965b - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_make_key.c 3cbe8870afb1783d7dfa9a0aed90d5b418507ff3 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import_pkcs8.c 40bc377e4ad4d6a4415a041547e06bd5a593aae4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_verify.c a17546e45ff54641bc9f99aa8f95fe1400ffb50d - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_sign.c 4a123758fda26cbc2d066a83d03a740d8aa8307c - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_export.c 852da308dfc15eb6c2c5e8e2af6241cc50db57e6 - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_set_key.c 0d68e2ea82b1420db57f8734d16e9872a5855b8b - optee/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_import_x509.c 8105ab2d3fc42b2a6bb0ad9fb097bf329f2d22cb - 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 0425a2286a60d3508b450225aa7b9834102652a1 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_check_pubkey.c 15f7db9fa10fa76c16228ee4bc626d763aeda1c9 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_generate_key.c d75ef9768785a7c50fd27496aa1b335f0f722242 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_set.c 3dc77b2efa7af418a4e546c2669b21fa1d0ebfb5 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_export.c 680e83900005c1d0e0bc32ac583c1f7056be5321 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_set_pg_dhparam.c 7d00ee8e8c68c6fb1acd6873f8b7cfa712180059 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh.c 61bbc3f4e69e47f87a24bb737a12c5ae6bd8c015 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_shared_secret.c d6dcab8b39ea66f3ce735867872fc03cc0b6156a - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_export_key.c fb59598f59744f625cdb3c63ac6617a7d30b801e - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_import.c 39a90f872c3bcdc17901e1759aeccd8bfcefd714 - optee/optee_os/core/lib/libtomcrypt/src/pk/dh/dh_free.c 958845e7c94fe4b5053f042685fa83ad09c1f4e3 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_set_pqg_dsaparam.c 2a3c9cfb71513cb45dfbae402c9aa7925ad63115 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_export.c b34dc58281d45f1584351e0d21428238af066f3f - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_verify_key.c 56dcc63a1a6e93f4a0af3434c121e0613b338752 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_make_key.c 7054ab26666c3862a86c509df5e04cf3aa1b6bb5 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_shared_secret.c b36fe42485681df5968911a39637add77ed4cd70 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_sign_hash.c 9e27584bff8bcfdaa4d2c1ee2f61d29621dc9e97 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_import.c b4ad5f046237f7008cdb6f4e27804cc5d9b66e5c - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_encrypt_key.c 52a17c2c931281e9bee638e6f589cb9ea67b17c7 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_decrypt_key.c 5b624ac999e05743cb99f8a870e7ffb49aefe87b - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_generate_pqg.c 6847b55d19533482445e836fa3a8d7c620252c65 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_free.c 324428db679caaa0d22cf37e753e202d503fdeb9 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_generate_key.c c92e700a0b9226c066604328ad3620fcc3b1ebbe - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_set.c acbccf8c14d825a868055bfe7ae0511de2ce0c40 - optee/optee_os/core/lib/libtomcrypt/src/pk/dsa/dsa_verify_hash.c 8c04e2cdb3237402e8c8c161e239b0a0dcfaef94 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c 4ae2d348ddb26bd059d4fc5e0fed1a5d03bb53e4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_openssl.c 9ae9f67472ca1b06cd3adf8df985b53b6e8aeca0 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_oid_str.c 6837912c44340217c8c4f61025f6335ee7b3db3f - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_pkcs8.c e66299e6fb4064594aaf206fa24f92df4e573de7 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_find_curve.c 424f65d2aa5fcbf8f4c662b80a0bbb4d0ac2c78c - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c 2783f4a05cfff01a29f153bf02a43c13df01e633 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_is_point_at_infinity.c 3901d769f2b0cfe0d9367d920e039ea214132340 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_curve.c b4f14afb64736fc5f078427cebb58a403ed785d1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc.c a38de62acecca074e7a0e24c577c7aecd70bb398 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import.c 1d56b3b485f334a52683214390ea8a2e5a263923 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_sizes.c a9099ff382b104ec0fc2c383b4d56bef80427b06 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ansi_x963_export.c ac5a66f6418a07cad72b15b8cb8a133adf6f973f - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_key.c 209c9850a9941be1680f3e2764b62de3d438be85 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_export_openssl.c 31de7d7a2fa3e32ce27fb048229306e8bdcb245a - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_get_size.c 418d21f1b1ba44da004cc7e6af57e32dbe4175d4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_is_point.c f3c32b72189494cf4d66b349ced53f5abb253087 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_make_key.c f04327646f6219323315b01d037c120a89a5d8db - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c 554d5a9b88cca798c82a5b2a5f08465add64cb67 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ssh_ecdsa_encode_name.c e591d3a7653657d33450d68052ecfc00b6bd7d9b - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_export_point.c b597f22f90e5663f6d00bd1b8d5b8742d8ef1c0a - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_sign_hash.c 4b33ac9c39d090d05b31f737bb782ee0b3d055ab - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_decrypt_key.c 2ef3963b09142be0ed8c68782858dc8a137bf7a7 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c 97b062b8e60463da33889ed0e2c4bc3aa107884a - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_points.c 066b5f9b6d7078012031ae43263413270c4fe5a1 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_verify_hash.c c21379dadbf15969b44955a8eb79351597122483 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_free.c 73afb9ddbd9015fbef925b8af65502e118597f59 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_recover_key.c 0c63c7ed2e38264a46c426b4768f82098a71ee62 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_verify_key.c b5335ddec4d47ed384fc6efc343ce7786fbd5769 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_export.c e0066c64c77e8a309b0cea0a1d9cb693f3aedcc3 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_ansi_x963_import.c 5b94ae14dfa4d52758f71a0e5f329626ad9c08e4 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_curve_internal.c 7e98f34b99b7fd993a464202d538d7896d3a4205 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_shared_secret.c 3a6f1237d91d514d4e939d1695921c0f08e8a81e - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_map.c 7f10eeebc933e629738421ceaee867f90b2397f0 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_import_x509.c d1b6e6c96d0ef594494d986b8832aa3e351b8b44 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_set_key.c a7728c7eabb76f3d7135d0dcb9543277a29187bf - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_import_point.c 87d352582bbf3433714c1268188738e4d05da4e2 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ecc_encrypt_key.c 754185145c9c0ff40c447c3afa98a166953b5b06 - optee/optee_os/core/lib/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c 4860a09637c9eabff415e05465a5a9dc723d4ea8 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import_pkcs8.c 531e6e62ceabfa1a7c31c74a2b429f9c56148d10 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_shared_secret.c 53db22f751a5fc4def5e74872c3f12326aed66f1 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import.c 72121292f5852434ec4809c17230c86b5777eed1 - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_set_key.c e642711bf19f0e43720454acefba2b771c5175ff - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_export.c 77675e352f3ade3fa0d080e44916687a19fb1d8a - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_make_key.c 1e428db27d29f0f18732b53d2bb520f1817fca0e - optee/optee_os/core/lib/libtomcrypt/src/pk/x25519/x25519_import_x509.c b3d3f52cc21347bc95211b44b4b493b97c708615 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_length_printable_string.c 408c7ae4f4e8f5a6048b16a4c3971fedf67ca8d4 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_decode_printable_string.c 326c09d3079231349f11b2c09fec22cad770f9d1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/der_encode_printable_string.c 485970800461a16a8313e0c56ceca8533879c2cd - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_decode_integer.c 3d0a8044e7f66965994913bd679cf59b686f3e88 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_encode_integer.c 7ab9730708c971830073fa9c4f60a66a9427219f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/der_length_integer.c 7a240d865c9dd7f9b82f551eb887280803e6ade6 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/set/der_encode_setof.c 7187b3707f4c75b819ec6c6b45fd1cf301134413 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/set/der_encode_set.c cf6b15e08cbee72b2d0f4133f6b97800aa9c91cd - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_decode_ia5_string.c c76469fe79f99bdd1b323690c01a21776bed6d18 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c 5e68bf137c8185bfcdf6fbdc6ca2b34e6ac2b155 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/der_length_ia5_string.c 9562574b5cde1c5ea4858d302e32e231e8d0aa5c - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c 9f79ec8cea6a03333fe91a7c24a31db38d02e027 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/teletex_string/der_length_teletex_string.c 11d38c658f2a2983ad36978bd62ce74c9b304f4e - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_shrink.c 858c025b19105ad8d74709cc84cecdf4f6b86801 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_ex.c e5756044f5f8a48ff7a6377b08251c96f3666601 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_multi.c 71bd568ef3287a3e4090ff196bc51c2bc0799d5e - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_free.c 6fb48f4177b0900defedceb2e1d7ca19ebf0f02b - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_length_sequence.c b25afba9842b229f275b1299c62f202212f20823 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c 4328fe59c642e4e13421b54685233adc46157f67 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.c 41633fe126d6779c4a776bb440871dfd33d324c8 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_ex.c 79c56189ec2b315f4e0b508336f55c6a4af62be3 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_decode_custom_type.c c76322506774fa9b70072d084a2ac18112359a45 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_length_custom_type.c fa85effe3e82908103d037b4df585726808d4cae - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/der_encode_custom_type.c c3e33e87bc6a91dab1097be6765cef548c719ba9 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c 00521394d357a680a5f84d5eced67c0e1088de64 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c 8ba1f6680731280ca28598d1b6eef2359dc480d2 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/der_length_object_identifier.c 4a37f7e3212cfce61285defbde2bc4a1d4b20098 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c cf7034160c7cc45751a4c6a2b6d3fae9f7815bb2 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_decode_raw_bit_string.c 14090234b159f731f48c2a4d1229c90d7668d640 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c 9e6435915eea8ed5d87f83040ff35f84360d19b8 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_length_bit_string.c e7cf1d24006edd59eb8c9ecbe0f050ddcc36a962 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/der_encode_raw_bit_string.c a41c306269c5b29b19c561eb067f977c2245b02d - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_length_boolean.c 17d2c58008964b73735a85826782d557e5137ea1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_encode_boolean.c 6d83825388d0497653f5f6e199124d857cc3732f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c 67edacf2cbc8fc5feb9d0b2624f72b1863e7ee86 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_length_utf8_string.c ca6cfdcd0f7b912fd1ae72de76eaa2f6db3cac1f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_decode_utf8_string.c 05979557f5a89cd96af1cb0442e83fca8b1a85c1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/der_encode_utf8_string.c f426ec8c438eac6b4d2d6f525fe3156c461de3eb - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_length_octet_string.c 429404c1766c4d67b42001672eb1d38e0fa0f259 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_decode_octet_string.c 799456fa78d5c871bec7fc4b523f3441602b799c - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/octet/der_encode_octet_string.c 5da361be0eadd614684b0a9a5f5b2b82d2f07393 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/der_decode_choice.c 25f570123f2cd9f3d484858516c333bf0405a5b2 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_decode_asn1_length.c 9b217118466c17495eff749ce5f13fd342dbea59 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_asn1_maps.c c9a4734180d2ea8142f7c0233b31ce060bc6bcd8 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_decode_asn1_identifier.c 3e6efdbd8d511cecd82713ea1d24440cbd4d5020 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_length_asn1_length.c 522c20a68c23512b0fed67d0b59f32f25c63a3b6 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_length_asn1_identifier.c f5d9c13332f4e379e30382c24a80d886ac4450be - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_encode_asn1_length.c 4e3a49e730780d64904851b569729cbc3b616fcc - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/der_encode_asn1_identifier.c 8e960e6f4b919abe98925d2beabce184467dc4c9 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_length_utctime.c 3b3363b25247edcbdc94141d369821e4329e2848 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_encode_utctime.c 77f313c3e23ed2106bb1b444917546d270feed6f - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c 87ad6c59a03d704c6eef64e2a134818f4a760ccf - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c feb12af75ffd940a35efb013449b21fdb84dff72 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c a021fd0eb6790cef2739682e885c9a2efcafad6a - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b8998fbfeb895cba84093070798f44fe3bf08cb0 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_decode_short_integer.c a9452e5cdf4a5d64a7b2ac76dfdc5da32875ae67 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_length_short_integer.c 8f23dd8e40a2812eaeb17c2f7a5286f97a231850 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/der_encode_short_integer.c 1ed900b71cecb2263c849fa9d712fb7bfad0ac11 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/pkcs8/pkcs8_decode_flexi.c b1379ba2248755006135677e9062393cd6c01bc6 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_decode_public_key_from_certificate.c 9892ae13305e92670e668cc9da6b6684a6ec2c94 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_encode_subject_public_key_info.c fbed8643bcc78a010c69264df0f0feaa1b7f3aaf - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/x509_decode_subject_public_key_info.c fc9ddf75a5e2a242eb5a89318f8825d365ee0745 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_get_oid.c c404779cf4c13c134cb29f44cad8a959e1069bb1 - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_oid_str.c 2c4cad72807d6438f07688352aa9427579a8fa0e - optee/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/pk_oid_cmp.c db19e0722e96ae6c10c1e8705b081eaf81934591 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_file.c 00f0f40c009f4a199373ffa0d224bba81018565b - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_memory_multi.c 307f4a0d805de0436cc968022884591fcff17b23 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_memory.c 83c86961f8779090651627d7f874b6d9f204203a - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_init.c 7c8b2e827969354795dc56def80286fad20baf78 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_done.c 4ef5b8ee99d745834b17e65349b5b3952e29f369 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_test.c a08fd7988bf11e190ec0aa170089d7317946bd84 - optee/optee_os/core/lib/libtomcrypt/src/mac/omac/omac_process.c 7fb983ee32da2a784773eb2774abf460fd018db2 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_done.c 8b380ead6f3a8c6cec4894eb0d7c614fae1c4122 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_init.c 8976115feec00878c9f07550eec1c984b4007181 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_memory_multi.c 69fe2be770db3ea500ce102f5b4c7eee71c68904 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_test.c 70b5916d9bc718b02f6f0b2179c441cc60bf08df - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_file.c 6d1ea4aba014ba6c5bdc27f0489e05b36bb35abd - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_process.c 49b6444356eef384ba1ee0de33c99acb2c8f3847 - optee/optee_os/core/lib/libtomcrypt/src/mac/f9/f9_memory.c 891653f1567bfa0a545f341acc8b4d25f4d6162d - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_ntz.c 7e6ea812a7e0b6fe5d6b9699829a03672942c249 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_memory.c 9f803c98e42efd9ca7f0aab7e63184788b7345f6 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_memory_multi.c 065b03e55f1361705df6eaf0f3c613738e64b04c - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_test.c 6a91b00ae844ba506131348e840d05c434a990fb - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_process.c 4a41813ee924b65c3ef1d7ec47217bc4041d19ce - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_shift_xor.c 23c341ffe9be175d7e3736409b87358eb7d15e1c - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_init.c c1d0386dc8546488de74a4350f2bbceb95db1090 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_done.c 9bafd9bba7d2a327dd13cedd44e46cdd6d9c82c9 - optee/optee_os/core/lib/libtomcrypt/src/mac/pmac/pmac_file.c 9e297e501998232f1d7f9f706f416de78a67380e - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_test.c 3ee28c892dc12359e83da00ae802d9b30c322003 - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_memory_multi.c 4bd5ffba6d7ce36e84980fb8bc6409251d43d98f - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_file.c 67fa74d6f02b957e9a07f9f3a93d93791fba397e - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305.c c26ac35eeb2db0064ffc4f1a646817cdb67c150b - optee/optee_os/core/lib/libtomcrypt/src/mac/poly1305/poly1305_memory.c 791f1fa174ab61958db1cfa9e6119e7f7f14a4c9 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_memory_multi.c df4cdc3c2035947f996feef2a36b166eff1b1193 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_file.c 26bbe3caebaeb9c7bb57636e77a383752a2f7152 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_init.c 1af3633d0a8e501ba61969625633fcbce78ef108 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_test.c c614d150690689a05ad280574f00ab1586d7695e - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_process.c eb6b52f1a704965e0c70672a4b255e875d850140 - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_done.c 5a7ff461a51eaa7b58b3a8e35a3ab0628b72739d - optee/optee_os/core/lib/libtomcrypt/src/mac/hmac/hmac_memory.c e800dd0c96716f9abbf18f897d299bfa3bd8d590 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_memory.c 240ba3a5263abd2d302d81171737fcb523fb26be - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_memory.c 794375d10887b9c88667261c8857bc20ee336b27 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_file.c 4edc8baedc1dbe0ecaac134b7d1426149ea6fc3a - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_test.c cd9db986db516db22a1d9c207debb5fff7d7b6ce - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_memory_multi.c 1610f849416a94086442f78c3c1b4df20d7500e2 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_test.c 9f4c76b6995baa04334fe0ab76970ee2d6d0cba4 - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac_memory_multi.c 0097eaffe05e1a4cc1aacded588333d9ab6a157c - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac_file.c bbb555b962d17968ffae6e5283d6d65514e3fcda - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2smac.c 45113427a5dd53a3fa843148a1051d0c769efacd - optee/optee_os/core/lib/libtomcrypt/src/mac/blake2/blake2bmac.c fbbab6738d55ce4a626f462abb40d6cdea5c54c5 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_init.c b6d00f21ef34584c3f79c84c45b42f3b140a47a1 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_test.c 38d9e2574ffae31011499e3eb56e0ad0614fcb65 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_done.c 00f72d640b26f65f764bda401f2f0971c45eab23 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_memory.c 54ac58ca3d7d47d103dcde0fa6c87d610462c1ec - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_process.c fc2332f12dddc23d7e415d2969c2fd74ef41da81 - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_memory_multi.c 167c0f06c42b42b6638be68a3141ecbec61956dc - optee/optee_os/core/lib/libtomcrypt/src/mac/xcbc/xcbc_file.c 76451bd7d6c863dc6951c0a46d447d5ea27730dd - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican_memory.c ed6f76e57e85721d7e091369e34a9d3fd7a85854 - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican_test.c 681fa292f2bc240fb0a3bc12648d8561c428cf15 - optee/optee_os/core/lib/libtomcrypt/src/mac/pelican/pelican.c e9ad6045f7d23f0248f70626ee34fc727c57c37f - optee/optee_os/core/lib/libtomcrypt/src/math/tfm_desc.c 683bec0ffd7f67242786f9a78766e554424623c3 - optee/optee_os/core/lib/libtomcrypt/src/math/ltm_desc.c e5197954f4030508dc144bfc6079bc780011cfe5 - optee/optee_os/core/lib/libtomcrypt/src/math/multi.c c94e47196f8bf00919bcf2c7b4b0cc23ae4cdeb6 - optee/optee_os/core/lib/libtomcrypt/src/math/rand_bn.c 4437dc27db07ef02f6d7b01414e75a38e7903a4b - optee/optee_os/core/lib/libtomcrypt/src/math/gmp_desc.c 7aa5889fe83821d6b55198733836f75c7478c916 - optee/optee_os/core/lib/libtomcrypt/src/math/radix_to_bin.c b0accfa029ae0028ff77ad5389cffa096044b3e4 - optee/optee_os/core/lib/libtomcrypt/src/math/rand_prime.c 84708bdabb44d07ba1fdd989492bcd9c22e3b2c2 - optee/optee_os/core/lib/libtomcrypt/src/math/fp/ltc_ecc_fp_mulmod.c 8eb767695e5573271863a44feebb74683f2f7ff6 - optee/optee_os/core/pta/benchmark.c 399f570322b11cc30dc9983469ad27a134be135a - optee/optee_os/core/pta/secstor_ta_mgmt.c 28a2bc8e09fae473cd0afb82f80f6ea2c0532287 - optee/optee_os/core/pta/scmi.c 4e1b614df9067b7a1f2158f1d5111c1925483f9b - optee/optee_os/core/pta/apdu.c eff011e23f0770c49cc286a9c2f8aeeb9e25679c - optee/optee_os/core/pta/system.c 3ea15c610f4ecba8788d1055a06e13c3b6aeea5f - optee/optee_os/core/pta/scp03.c f87beab7042049570163e35bb08a2496d5d12080 - optee/optee_os/core/pta/hwrng.c 45504e19b5c581433e6378bb6d50fb8cab486f49 - optee/optee_os/core/pta/stats.c 6a748b8c571c2b207c9db79b56b491192bf22379 - optee/optee_os/core/pta/gprof.c 180ceff2d84ef1c23cebbf754ba4fa71b65a483c - optee/optee_os/core/pta/device.c 92265a3a661a4862d09043e5c3ed8787895b4d23 - optee/optee_os/core/pta/bcm/bnxt.c 9112222656f3f1f8fa0565cfc29ac65ae1241d54 - optee/optee_os/core/pta/bcm/sotp.c 9548805f4cdf2d64fe66f30a4518b5738878b0b9 - optee/optee_os/core/pta/bcm/gpio.c 210d19d8a039a7dae80ac625c3ab0dab70b156a5 - 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 6c9131a0acae2f027e9f7deb6312a53895e7e582 - optee/optee_os/core/pta/tests/misc.c 0b504475e75b33d097100a32f3f02db5555b358b - 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 44e7ee33ea0134e7e49117626456a2f728f697e0 - optee/optee_os/core/pta/tests/invoke.c 5334d9f03de114b60edb9b9b5e7037b10eea8c69 - optee/optee_os/core/pta/tests/aes_perf.c 9dd9fc718badfd3aa130b4f8a57b69aac976191a - optee/optee_os/core/pta/tegra/jetson_user_key_pta.c be4c6a3071f47d6d836b24e210bc1d446aa9afcc - optee/optee_os/lib/libdl/dlfcn.c 902b546a61d836961ed0f5fe348b564b0583755a - optee/optee_os/lib/libdl/include/dlfcn.h fefe7492131d6b07e2e9baaf5d081ceb45916864 - optee/optee_os/lib/libmbedtls/mbedtls/SECURITY.md 37cb4866bdc58903533569785c08382aef66e401 - optee/optee_os/lib/libmbedtls/mbedtls/ChangeLog c95ee85b3b8949025e1cbf10520ad08381ccec1c - optee/optee_os/lib/libmbedtls/mbedtls/BUGS.md 51f3339841e51a23983bc0f0b178a5a3a867b5a3 - optee/optee_os/lib/libmbedtls/mbedtls/SUPPORT.md 5de98d90f371d3110d92b78169e5fc2c21482075 - optee/optee_os/lib/libmbedtls/mbedtls/README.md 2b8b815229aa8a61e483fb4ba0588b8b6c491890 - optee/optee_os/lib/libmbedtls/mbedtls/LICENSE a79545109df45de148b7952c96133925b755fe3f - 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 47fa0f94d17dde2aadef45765eb682c4c443b714 - optee/optee_os/lib/libmbedtls/mbedtls/library/threading.c 802ddc87f5c178b530879700f1d7053225c863af - optee/optee_os/lib/libmbedtls/mbedtls/library/pkparse.c 579deecc5d63bf0b2fc7d22c7cc001924588cc88 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_ciphersuites.c 315ee16fbc23682b7e4d5757716b16f5cd02bc4c - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs5.c 85d31fc70fbb2b4c1cf275700ca4864b6c351cc3 - optee/optee_os/lib/libmbedtls/mbedtls/library/chacha20.c 050784a26f8a9126500e5681f7b624fef4aa4495 - optee/optee_os/lib/libmbedtls/mbedtls/library/bignum.c bbea759b99d41cde2cdfce188b67719863a02e21 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_srv.c e99d7eac51adb83314f006fba2f812b38c0e7252 - 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 8dbb542b61d423ae2fa9dbb23a9bcce6980c01ed - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_msg.c 63f97dee98c3e121f09f1a92ce5a4db660b69055 - optee/optee_os/lib/libmbedtls/mbedtls/library/arc4.c 8d3e7e8daa2852e54c16db037de624e20f2fac02 - optee/optee_os/lib/libmbedtls/mbedtls/library/sha1.c 3e043333ef6c7f6d31225398864768ab84097a5c - optee/optee_os/lib/libmbedtls/mbedtls/library/gcm.c 5827bc500a73f094b451db6459c2b3b0ea349b30 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_ticket.c c518169e89e4a6a9741c048118a20187a9b5c9d5 - optee/optee_os/lib/libmbedtls/mbedtls/library/oid.c bdbe812982081fddc8007ffbddd76e5ff7f1627b - optee/optee_os/lib/libmbedtls/mbedtls/library/ecdh.c d649b6cba0af54490fa949f5ab09c124f61eb97a - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_tls.c 3e58d30c5744d24dd6736f9ce00c1ee9b9648398 - optee/optee_os/lib/libmbedtls/mbedtls/library/rsa.c a3282b114dd0db10a524680656e06992405df54b - 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 deb9b88e39d8ef63bbce39ae16b5f54f9a72afa8 - optee/optee_os/lib/libmbedtls/mbedtls/library/aria.c 65c820df6c741eaed7f7ada0b376e57f14ba2626 - optee/optee_os/lib/libmbedtls/mbedtls/library/timing.c b4aea5a2977ca8fb41e762b829ff759ae8e7b667 - optee/optee_os/lib/libmbedtls/mbedtls/library/ctr_drbg.c 1f347626adec9dc5f78ed6e14129a3174690a843 - 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 e931763597a9d3f71939b0a7ac42afeb491d238c - 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 170220efe903addf5921f3aa162bf91a31e46e4e - optee/optee_os/lib/libmbedtls/mbedtls/library/md5.c 8b68b2b0495b729a7de57aeabcd8306615f75e88 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_crt.c 9ddeb707be554648d86dbf8b3bd105cebf911eb6 - optee/optee_os/lib/libmbedtls/mbedtls/library/hmac_drbg.c db59ea5372e154bab5366468e02ac7fd3f64914e - optee/optee_os/lib/libmbedtls/mbedtls/library/chachapoly.c 32e11c604902e774bc142f71e23a479263df9826 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_cookie.c b255f5117b8d7c51edf2e480ea74bf97759e7a08 - optee/optee_os/lib/libmbedtls/mbedtls/library/rsa_internal.c 992cb1c4e65133eef880d31838359579d7b0b363 - 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 ce3fd9b349563a2f48b0bd2597fcebb87dcfb303 - optee/optee_os/lib/libmbedtls/mbedtls/library/common.h 1a8326d4950f64fdaa63a159f99e4544370995e3 - 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 81f5674b47fc8903be22d4ab872a8e08b1c79a1c - optee/optee_os/lib/libmbedtls/mbedtls/library/ecp.c 15bef11e50868588f93f75b0981dc1ff276ac2e5 - optee/optee_os/lib/libmbedtls/mbedtls/library/poly1305.c b22dd298d902a849246c0d0cbedc2f689b457336 - optee/optee_os/lib/libmbedtls/mbedtls/library/xtea.c 2f42dd42ff8318a73747f54e0bd572543cf70018 - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_invasive.h 6ccacdbcb3d6683215a378812ac9c07a95d15b52 - optee/optee_os/lib/libmbedtls/mbedtls/library/platform.c eff5827f73dc11e94f0cdb521b69c886b6d977bf - optee/optee_os/lib/libmbedtls/mbedtls/library/havege.c b10ad001855cf65d2241f1ac3869dbd630b7d748 - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs12.c 02f7698bb543239d6b05ded6c65b0e51c0c7eef8 - 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 96697b936c6ff662b7157eb7c43f249006dad4f2 - optee/optee_os/lib/libmbedtls/mbedtls/library/memory_buffer_alloc.c 9d90bb77df488f317de1f643347dbd477b1694bf - optee/optee_os/lib/libmbedtls/mbedtls/library/x509write_crt.c b1e5a79d68a7a1ec7f0275df720f96ef736ab374 - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_create.c 95edec67bc89b0025dab4ecdfce200d7b11a22df - optee/optee_os/lib/libmbedtls/mbedtls/library/ecjpake.c 37e5b3cc8961e52ea01124de8ece6931a411a3f9 - optee/optee_os/lib/libmbedtls/mbedtls/library/cipher.c b9ac8249e859484ab792b9a1b059950f2491d516 - optee/optee_os/lib/libmbedtls/mbedtls/library/md4.c 3f6c78ed35a8be672e1d62c68534aae40675278a - optee/optee_os/lib/libmbedtls/mbedtls/library/ssl_cli.c 239a0e9dcd99ae1b7a1200e4fb4ad0aefb03bebc - optee/optee_os/lib/libmbedtls/mbedtls/library/x509_crl.c 2def7447401b608adce999138281423a3102b8af - optee/optee_os/lib/libmbedtls/mbedtls/library/error.c c8664d36b70854e42876b896896e006a339d5036 - optee/optee_os/lib/libmbedtls/mbedtls/library/sha512.c cad5ec51a48f021f7c951c76d78e3c882cc0d863 - optee/optee_os/lib/libmbedtls/mbedtls/library/nist_kw.c 142ac144081804afe7d4e8fc50cff380303e0b02 - optee/optee_os/lib/libmbedtls/mbedtls/library/pkcs11.c e1acb22617ae7a4e538bd8722a935af6f86ad3f3 - 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 fe69cac93356f92575515b8695476b1d966d1997 - optee/optee_os/lib/libmbedtls/mbedtls/library/base64.c 84909268d883db4c57668b39777af6b85db6acdc - optee/optee_os/lib/libmbedtls/mbedtls/library/blowfish.c 5da0e5d8b3a1e2793d7d20cd0195424d344cca2c - optee/optee_os/lib/libmbedtls/mbedtls/library/cipher_wrap.c ba3c3e68c8371bfb3689a26525119416b2eeead0 - optee/optee_os/lib/libmbedtls/mbedtls/library/dhm.c 071404ea75bca296116fabe763c57e4cbc1939ca - optee/optee_os/lib/libmbedtls/mbedtls/library/x509.c 266537d63a7f48ae398125dfe4a5b2403a0afcb5 - optee/optee_os/lib/libmbedtls/mbedtls/library/ccm.c ebc9d7694d77dc95c9a26e172b1778334df73a71 - optee/optee_os/lib/libmbedtls/mbedtls/library/pem.c 9696cf5bff4ffa7e547e06264efa773b1a97fd52 - optee/optee_os/lib/libmbedtls/mbedtls/library/version_features.c 0216451c2a72c56b49859c56b65702015ec71bc4 - optee/optee_os/lib/libmbedtls/mbedtls/library/sha256.c 162f3018da00b99abf6c1926989ad37f19d96884 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_crt.h 7a8fd1f6b729f3ad210ea034763ec05999fc1499 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecdsa.h b0b158484c7640615774bce89c3a60e523efd008 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/rsa.h f3c661371a92dfe6623c471b27a0bbd6ee72275c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/dhm.h aa606828ab5672434794072df23364ad98f8b40b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/entropy.h fdab353d59e781049e2839fe8c0bd9fe5c7376f9 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pk_internal.h 6d4ef5bc4d6f3b08b3f73f2e66aab9b9b45d96bc - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pkcs12.h a05229fa4173b9f1be4fea0aaeba96870a9dc9b1 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/padlock.h e12e6a0ade950ce6e783dffc4aec31864c6af4ef - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ctr_drbg.h 272990d465af7402e8b97347ad55a6927b04f7b0 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_cookie.h 353340ee43fc823c5c1b4db6c851275c54cb49c4 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pkcs5.h 1b7af14c487ce7a08908afdf9b9885cdd2d96b7c - 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 18efad447efdd9f45a08e01a4d6a2bdb54163827 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/memory_buffer_alloc.h 95e87cf060431b9af28d0e4ec64c30992780ca61 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md4.h 7e42b4bf819ae258e66d9a85ae35645115253776 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha256.h 59b70310a22be592d622621e775020b57c08516a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/xtea.h f68ba04bf10e7ae5460af4cd3a0a0aeef75e1b1c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/entropy_poll.h f203e183eece292ae57254e30d273cec1b7b9507 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/chachapoly.h 0d2c4840f5cf57ba823ad3e8ea851184d1c7dfd4 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/arc4.h d48476839fedb64fa7560143bb8acc15097cb2d9 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/check_config.h 1fd549849be8d4b4e5f2df80e9e0521b3f77af66 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/cipher_internal.h c9d02b33d288370ef0d32a68ff0c5210d684e0a4 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/debug.h 3421e523a4eb7a40b760ae0fef477c206fe1c0a1 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/havege.h 2b1ae95a5f5bddac7fee61f4fba13aa0bb609283 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/hkdf.h 1a7a1dce0eb66eb2233ab066f79dee0ba0e63aeb - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/base64.h 008631ff909fbfd652c0f7a9e70692dbb937e67e - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/aes.h fa1b0d87d4389e58f06148397c57493176fff4b2 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_csr.h 20ecfdacd1621759af56ad40ee0cc0b3b23fd72d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/poly1305.h aa470db56cfed79b4a69c1bb8df69d02896ae539 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509_crl.h 9282d1e261e43fb7696c71b61bc7ee41db3c495a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/asn1.h cdd9ce974ed226c5fab2ef004d2f1319d2938fc5 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pk.h 6946d05f02bae8db69c2d8fe537bf1fd4e93c6c7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/rsa_internal.h fbaa4e6441ce57463abb3e5a1d251a0b104566bb - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/des.h 043dfd3a2c342c111be3739c38e95c1f07a3b2e1 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md.h c521f97634828137d1dd0e8b0fe1404d88bf838c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/blowfish.h 8adda2efde38cb1defad07706f15ae4fb536d72f - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md2.h 3c23e8d56fc0fc5ca288a6b23d7d1e72689fce30 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecdh.h 343e62b459ac9403b6914513fb122f8d2a1eaa55 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/bn_mul.h 442330a98cce1910d3d97e5ca2cd93538df30546 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md5.h ae138d9efa5476d5050cf0b21ff0deb7331fd520 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ccm.h 52eea021d0400addcae3ad59a690cd58ed281662 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecjpake.h a38c5bb0ee495bbb9cc2e49d8f30fac255af8e89 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecp.h 3490475b8c5e92f17e322e26b36e3822c57b65f3 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha1.h ef6dc18a06fe96400c6fc925e0eb3805631ff930 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/timing.h 32b11ed5133d1e756a1e497da51e69f90288e2a6 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_ticket.h 6b40cb0a1f9972f4f29754dbccbcf2bc384ab182 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/psa_util.h b4b7b0fd5cb9db5e05afea5ace2811809ecd17ff - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/compat-1.3.h 4daa909ae7c675a2b44941a3c68672ea08eeaca2 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform.h 8c9c74f68f1ce3a1ee90da1c8017877e6c2207a2 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/error.h 7c8c873a285b798b1bed2a0303f7ba679776fe8d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/chacha20.h 18ebc0927569fd32ff64c0a512f75ab0ee443590 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform_util.h a7ee52024c73476e7fa3af80724625aacd5d7976 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ripemd160.h abca2018afce45a60943457a90b6109d271f10c4 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/pem.h 49ab5f3017bfc3a84965238655a1c7763d773d0d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl.h 5d75d5424716ad4ad724d932ad1e2a0f4816d19b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/md_internal.h 6044aa83ff1b7b1fb0dc501456aa9fe7ca2c19d6 - 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 ca0451b0cf613bfe02a8ca32eb7989e7c8a8526d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/net_sockets.h 6a23d17bd6e89b823200ec15a2e1aa1a6eeb75ee - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ecp_internal.h 81384035dad529344c4d5e337c50693b466e397a - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/camellia.h 58d14a3da288383e17a50162b7ee8676aa39e30b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/aesni.h d46e9b1af49da6f5d2fb5706fa39e1f4894aed0c - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_cache.h 1376f3dbb90577bf94c21659781a57225b82bee6 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/version.h 9e2b25b0cb1a5171395bbca6cfe2acceb8d4025b - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/cipher.h 10871deab2c43fafc9b3d9511da9b3e68307f5a6 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/x509.h ca333793842d13532c6f9ef72a73de2f75ce0059 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/sha512.h cb262531fb7d9934e757d4853605d02386bc2d16 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/hmac_drbg.h 83b41aa47ae7819b6f2fd26a7d59ffaec06612da - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ssl_internal.h 2c63023e236d8eefd4ddf1e8fef9e6f4fb2b92db - 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 3b59c35a83896b968d614718c9c642f31667800d - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/gcm.h 745e76a7fd8b08c95c327977c6272bb0481f30b2 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/threading.h 8e89522a648f6c7eb71fbb973b688ba1283d3ff7 - optee/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/platform_time.h 8c3f09496ceb05b5f047c22bf0083e3e586d8b82 - 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 36c11456f08b655f4600fba0e1f98c1bdc3a190a - 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 b5e5a702a48c3e791e7265618f27f0cb1e3662bd - 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 27fb926e228911a9a55f799f503144cc3acfa57a - 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 a528919e2db46110e20ee9ca359096a439225809 - optee/optee_os/lib/libmbedtls/include/mbedtls_config_uta.h b731700c06c76f5168b86d511264a0a2a30d7114 - 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 8d6b22214c57ad89d47fbf50c9d2a28ec11c2951 - optee/optee_os/lib/libutils/ext/snprintk.c 9fd93f109631c93c98f7d21f4b2bc03867d03097 - optee/optee_os/lib/libutils/ext/trace.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 527c3d07f4d854cb770425c1d1bb43d87d25a622 - optee/optee_os/lib/libutils/ext/arch/arm/aeabi_unwind.c f06ced6d5e519b8c5c6b2f8a15477c5d09d63e7f - optee/optee_os/lib/libutils/ext/arch/arm/atomic_a32.S ff0eea4f25438d8836034710afb20c6ff62d9805 - optee/optee_os/lib/libutils/ext/arch/arm/atomic_a64.S c76559d831152142d5a0612b9a2ba8988ead0414 - optee/optee_os/lib/libutils/ext/arch/arm/auxval.c adf6c7b011707e03c48439a6a7de0b07e91d5e59 - optee/optee_os/lib/libutils/ext/arch/arm/mcount_a64.S 028fdd012476e8da6ec16945c3718fa8d2efe051 - optee/optee_os/lib/libutils/ext/arch/arm/mcount_a32.S 0e9c096815b105d29d59a8cfadaaeb5e7a3b7998 - optee/optee_os/lib/libutils/ext/include/arm64_bti.S 0b6d1e0167458e1b14bb4e78e2c771f5e811c756 - optee/optee_os/lib/libutils/ext/include/bitstring.h 2317ead861cf811db33ffc0e58a1446a4e01f519 - 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 b22dee75d061e73c4ee3bd6258b52df7d63b4231 - optee/optee_os/lib/libutils/ext/include/types_ext.h e019ae05fad7919cb56cfe288590613a69f829a8 - 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 3cd124fe02789cd9febbe85e572465765ea6f08b - optee/optee_os/lib/libutils/ext/include/stdlib_ext.h 16f599bb58f02b1c2da9c7fc9a5d0e7a76a07e77 - optee/optee_os/lib/libutils/ext/include/compiler.h 30b8669a4c03df240e1bcd892ddb978cdefb2d4e - optee/optee_os/lib/libutils/ext/include/confine_array_index.h 99f2448dbf86f490b782291dc75d76b907acc7e6 - optee/optee_os/lib/libutils/ext/include/string_ext.h b5e7d766670b001150bb9d2fb65a689a8c9f3ca0 - optee/optee_os/lib/libutils/ext/include/speculation_barrier.h b705eed4493303b08b06836e93c1e5802a5037ab - 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 c7c311292cb67ba7a5f7a1c6268c23700fd691e2 - 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 3b33e14d656d7cb02e8a583aa3ff70107acdba0d - 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 539cd00765160505f7a05bbef22745c8456292af - 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 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 d1864fb6caa351229195575a0073cacff77841fa - 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 97053b47c92b014274bc5b5f24e2f16612a0ade8 - optee/optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S 2560394a3ddd2d99f70c9acf33c76df43a18385e - 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 6982c1ad9a102e41b95fecb13c8dcfbff50a0fe2 - optee/optee_os/lib/libutils/isoc/include/wchar.h 12fa5d0f6eafcea31f4d0f99bb54f14476d29363 - optee/optee_os/lib/libutils/isoc/include/time.h 17f274e6a97223d10171f5cfb7e6afa844b45034 - optee/optee_os/lib/libutils/isoc/include/unistd.h 88594c7b91c73d9d20f4c7cb90050cf762430b50 - optee/optee_os/lib/libutils/isoc/include/memory.h 3f28303ad2e42f2fc0ecd4efa2aec52b8891cc05 - optee/optee_os/lib/libutils/isoc/include/signal.h 034ce8cd3bfa1df7ce9d5d5ee863b287924ade2d - optee/optee_os/lib/libutils/isoc/include/setjmp.h d107150611ad4db054a4c134a03cb4072e5b978f - optee/optee_os/lib/libutils/isoc/include/strings.h dae7fc2eec9e158e6e12c88f510d7f364fb6d992 - optee/optee_os/lib/libutils/isoc/include/inttypes.h f8d3835b4658b045b39738bde5c14b8c0dea6a65 - optee/optee_os/lib/libutils/isoc/include/stdlib.h 471feb04e7dcd33da6c9273a93cb9cd86497e163 - optee/optee_os/lib/libutils/isoc/include/stdio.h a48cb1a9553023eeb7965e293c335da44ff3c7c2 - optee/optee_os/lib/libutils/isoc/include/malloc.h be2a4474fefc872613c193ec38e4874d40cca5ae - optee/optee_os/lib/libutils/isoc/include/assert.h 731455bb6891c2816bb418632214526ada32aafc - optee/optee_os/lib/libutils/isoc/include/limits.h e83da5f07c33bc84bb291affe6480214bb4e6f9a - optee/optee_os/lib/libutils/isoc/include/ctype.h e2279a5c7dc51a2f83eb5dd4ea4adb6156190b85 - optee/optee_os/lib/libutils/isoc/include/stdint.h f4f68ab67638dbbe914af4728c8654709751187f - 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 67ff06389a963f1b5da5623a75a35bd4846cae94 - optee/optee_os/lib/libutee/tee_api_arith_mpi.c e8aae8d47ac613da5424e4a7415228282e3bc602 - 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 9be5b1825b8ad25e78f1698ab6082a3eda7e3e0d - optee/optee_os/lib/libutee/tee_api.c d2fb404a1458cdc7b4ae85088e0441aa0bed2519 - optee/optee_os/lib/libutee/tee_api_property.c 9653b1a7c52d3ad6deb26bc95f9f44318f157bb1 - 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 bc9153018927868009fb5a5e6df2a409ecb13f4c - optee/optee_os/lib/libutee/tee_system_pta.c 32b49d90873b584a78714f1d4d929162c3ec14c0 - optee/optee_os/lib/libutee/tee_api_panic.c b4d75c22cea319de57b7d095ce76316fa38d1506 - optee/optee_os/lib/libutee/base64.c 59df608d61e4d49604bb5026212561e25dbbb5f3 - optee/optee_os/lib/libutee/tee_api_objects.c ce4bc2d3ed7f6c3ecb68a1f98a7f368f7369a286 - optee/optee_os/lib/libutee/arch/arm/utee_syscalls_asm.S b509ddd566f88800558771a54af48f9c04a982d9 - optee/optee_os/lib/libutee/arch/arm/utee_syscalls_a64.S 5c26c43ba23b219dbe6e2d76db3ac514ae66176b - optee/optee_os/lib/libutee/arch/arm/utee_syscalls_a32.S 505da116e55bfaee3c94a6db710ef70a860f9bf1 - optee/optee_os/lib/libutee/arch/arm/tcb.c 068c37176d66fdd085dea7c09467f2515314db23 - optee/optee_os/lib/libutee/arch/arm/user_ta_entry.c 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 d788d5516f5ce4a5129145bfb93fe63613f7a326 - optee/optee_os/lib/libutee/include/tee_api_types.h 0bdf2f8e20af673d9a98c39f5e461a47eaba3768 - optee/optee_os/lib/libutee/include/tee_ta_api.h 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 0914ffb8eea917ca32ddfd5e9d1e07b08242a132 - optee/optee_os/lib/libutee/include/elf64.h 6fb113f592e8eb5ea786a5b2d79d0e2ab87ecf60 - optee/optee_os/lib/libutee/include/utee_syscalls.h 47e7cf8af6ad09392aa45b94e88e4cc07e54520e - optee/optee_os/lib/libutee/include/tee_syscall_numbers.h 6b2c1423ccb1f22eedd5313d9c9fb62221d022ac - optee/optee_os/lib/libutee/include/tee_api_defines.h aa09af74960113ccd4fb8827d07e4b9140aacf8f - optee/optee_os/lib/libutee/include/arm_user_sysreg.h 2f771edf8ca2053a42cdf07c82b3c8f222f7bfa7 - optee/optee_os/lib/libutee/include/elf_common.h 34686e9ef3d016d68cb94ca12b860c89349b5eca - optee/optee_os/lib/libutee/include/__tee_tcpsocket_defines_extensions.h bd48e013c88626f0afe75927b2a7c67d397fa221 - optee/optee_os/lib/libutee/include/rng_pta_client.h 4f93534ad6dd83305d87e99ed4d2e14c2426f38d - optee/optee_os/lib/libutee/include/arm64_user_sysreg.h 41b79406ff05bc4d3528fca688813e7f88e7d135 - optee/optee_os/lib/libutee/include/tee_isocket.h ebea83d32048f9808bd31f5e2dabc5c0314057bb - optee/optee_os/lib/libutee/include/__tee_ipsocket.h c21a58ccf86108975650a7e717fe03cc35aba09b - optee/optee_os/lib/libutee/include/pta_jetson_user_key.h 27c03b1a7cb59487f9cb4b7791d692842d8099ed - optee/optee_os/lib/libutee/include/pta_scmi_client.h 97d31ae314c5a425250ce5131b18172c9be17637 - optee/optee_os/lib/libutee/include/utee_defines.h aa9643e14ae760f449d8ab4b68c70b3741758eb3 - optee/optee_os/lib/libutee/include/pta_invoke_tests.h e1e75f31a47fb1720c7338ba47302283921b3c3f - 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 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 6cc2da60c896e20bd367f41d222c15b54b295829 - optee/optee_os/lib/libutee/include/tee_api_defines_extensions.h de14da32b806783c8c71ff6ae8b8c68681e98fe9 - optee/optee_os/lib/libutee/include/user_ta_header.h 591d4ed947e32e0c72a95a7a2514221f1cf9490d - optee/optee_os/lib/libutee/include/pta_gprof.h c8a241f8eaf39f421715c95308f5a21825b8280f - optee/optee_os/lib/libutee/include/tee_internal_api.h bb6d698cdcb798870d6464794897208c00efd718 - optee/optee_os/lib/libutee/include/utee_types.h b6140b59a2c3bf54d4c3af7f095045974bef78e4 - 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 739a223e693f30815eb57c7b1bdae6bc5e2c8028 - optee/optee_os/lib/libunw/unwind_arm32.c 488b3fe6f9ebe0755c66f3e6c24e5f4fda85bf6d - optee/optee_os/lib/libunw/unwind_arm64.c ed0dcfee69d62ba6a491a74e4e2d763a7f62eae4 - optee/optee_os/lib/libunw/include/unw/unwind.h 2c9328fae670c2c68d77e5df1bb081c8db3c0eec - optee/optee_os/prebuilt/t234/libcommon_crypto.a 4ec1a9b7d2f64d94ccdaa889afe2cba025e5b33b - optee/optee_os/keys/default_ta.pem 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 347a62441ac4bceca8c1671d33dd25287e62d136 - 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 04c572976b9c169c8ee3d3abba60c514d4ca355c - 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 00d2f9c6fa5c6fae52ec03e3b8546d42e745bc8b - 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 85d3afbbfe401b7e9c6b2b743bee3fcde956eb8f - optee/optee_os/ta/pkcs11/src/processing_digest.c 26dc92427964930f69b616be7c77b90da4bcb8df - optee/optee_os/ta/pkcs11/src/object.h e4695e1499e54f58d074a4fce7b880d11a76b6e8 - optee/optee_os/ta/pkcs11/src/pkcs11_token.c fb13a7d2381ef0bc40438bc32f4406ee2690d914 - optee/optee_os/ta/pkcs11/src/processing_aes.c 08185a6792d86f0f8e5605602a56447e1980db8e - 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 9d51c811896cd294d5e1534c4f2c76933a17df17 - optee/optee_os/ta/pkcs11/src/pkcs11_attributes.h 8d8b0a84e056fa008bf4be504cddf4b5f059389a - optee/optee_os/ta/pkcs11/src/handle.c 5f106086375385fd930e194ebe9248b2b158338d - optee/optee_os/ta/pkcs11/src/processing_symm.c ea3d3dddc4c6aaf5c1538ffc7be49b30c16a9565 - optee/optee_os/ta/pkcs11/src/processing_ec.c 45de643887836d8e425a8ec6b5a253eac79dfc13 - optee/optee_os/ta/pkcs11/src/pkcs11_helpers.c 0ffa60c477bc8ee08f506cf0302096d0982314b1 - optee/optee_os/ta/pkcs11/src/pkcs11_token.h 8fa05391352c6b3df7683a1524a304d3207b3b39 - optee/optee_os/ta/pkcs11/src/processing.c 406de9608e4061b2c61b5af8605bcd7f389e4bf3 - optee/optee_os/ta/pkcs11/src/handle.h 067b099ef14642c63de868d05642ad1091149c51 - optee/optee_os/ta/pkcs11/src/entry.c e527d6f9ee47c285de23edf8e91219e289f4517e - optee/optee_os/ta/pkcs11/src/token_capabilities.c fd41318af65871914595b66e619423df93a1913c - optee/optee_os/ta/pkcs11/src/processing_asymm.c d9c7097d0c1be04c2af97794cc50ee5e9bfec02c - 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 186e47207d0435df9010c6959f8ab8f2faf14d04 - optee/optee_os/ta/arch/arm/ta_entry_a32.S 30a5980d841be6fd593b8778f141209b80864fdd - optee/optee_os/ta/arch/arm/user_ta_header.c 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 6ff1805aab548a5b0097c61f5526954d89dbbd4a - 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 c89a0b360ad146126f8a5d4d7b8151dffa3a84d9 - 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 a2064aff2f71c168fddfa38cfa516d3de1b88b7a - optee/samples/hwkey-agent/host/tool/gen_ekb/example.sh a7c1bc6377f0a49a2bbda6a1b8ab86b76ccfdd4e - optee/samples/hwkey-agent/host/tool/gen_ekb/README 5aea3eb78f560878bd8ef3e29b9208077b7c6b10 - 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 12287ece58d275afd7129e4fae09254217ea4f70 - 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 2b63828aabfc6281710ac07b1bba3f7e31c53b73 - optee/samples/luks-srv/ta/luks_srv_ta.c fa3f0583c33f15560475d2899643217e9b8bdedd - optee/samples/luks-srv/ta/Makefile 2f3959664d91c746de347918142d90609da977a2 - optee/samples/luks-srv/ta/include/luks_srv_ta.h 621396030464a52bd8fcd533f0a006d0ba59b281 - optee/optee_client/Makefile 1be3a93bb56c46ee4d4693b47ddd7c4c5487ffd3 - optee/optee_client/README.md a7d910ff308216f427e9a4776d72cfe84e2915ad - optee/optee_client/LICENSE 2b9d7650a73860cc81340298cc4147d6d4a74584 - optee/optee_client/.travis.yml c9b3bb5ab0a3d0252ed93cfc3578e3991ee2b994 - optee/optee_client/typedefs.checkpatch c9c46f6d84c395db9e62599d15980f06cf993db7 - optee/optee_client/libckteec/Makefile 97a6ea46ede1c99d6398cd2a301e38bc4ead9495 - optee/optee_client/libckteec/include/pkcs11_ta.h 7d66a5a9955374f577b36eda3684c254841edbda - optee/optee_client/libckteec/include/ck_debug.h 9d167cc946da7c056c484bb4efce93c71a107dd6 - 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 445b16b255515fa01dbd8b9b4c92be1a3dab1eed - 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 0fadec55c1d7c137dce4eeeb1b3eb7523eb5f4df - 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 0ddc947d4bafad6f4a3d62517c539706e25b6cd0 - optee/optee_client/libteec/Makefile 6f319e289afeaa66b6058c8f2397e66d4bd79b70 - optee/optee_client/libteec/include/teec_benchmark.h 15278a332dd772f0c91e486e562d10ba1b9cb6df - optee/optee_client/libteec/include/linux/tee.h 2402afb2deb01fd079379a62ddce40556ee4948b - 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 5e833db7c7b3b9a3f3d80f966a6f41a358cd7d86 - optee/optee_client/tee-supplicant/Makefile 8fbfe192d68bdb1e126598cb730e7c11f511960d - optee/optee_client/tee-supplicant/src/hmac_sha2.h 528fecc3c0654e46342498181fc0dc06ff56b44d - optee/optee_client/tee-supplicant/src/rpmb.c ff7692fe871e5cf37ebabccf6abc2bb07fdd63ef - optee/optee_client/tee-supplicant/src/teec_ta_load.h e122f3cffa5712b4a3a747834d421c98dcc0f528 - optee/optee_client/tee-supplicant/src/tee_supp_fs.c 5387e1fcf4e95d497b72ee814d729c4c90adb740 - optee/optee_client/tee-supplicant/src/plugin.h eb428488f05ca6049614557e2a89abbe531b1e24 - optee/optee_client/tee-supplicant/src/sha2.c 2b4e00ad1b9e0f3a5e7c2efbef6591de41a0e409 - optee/optee_client/tee-supplicant/src/sha2.h 63336b0b20be6b4331ab8a43d0fcdb51a7ba69be - 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 9e9025bc3bfdedae38804d5d193a739bd3fbe720 - optee/optee_client/tee-supplicant/src/tee_supplicant.c dbe68e038118c5311cda55821456c6bbcddf3a13 - optee/optee_client/tee-supplicant/src/tee_supplicant.h de4acd840046862a04f01281909c164e9d1b7d98 - 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 f2ec7b16eb607d42e8841c3ce7098bbe09ab3a58 - optee/optee_client/tee-supplicant/src/plugin.c a16a80d873293f74d73baf53721eb5019ded25cf - optee/optee_client/tee-supplicant/src/tee_socket.c bed7d31fece3711cc20a9418d51d24ef7fe3391b - optee/optee_client/tee-supplicant/src/prof.c e651b90d41d086a7f611ccecca74426fd22521a1 - 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 5c6f5c3e93b74c4ab887c0a37e780510d142977f - optee/optee_test/host/xtest/regression_8100.c 4e533d0531c352071ee236302dab1c2fed2068d6 - optee/optee_test/host/xtest/install_ta.h 0ce63a4baac97767ffb9573b93492395c6a4ef3d - optee/optee_test/host/xtest/sdp_basic.h d8afd0900d976a6790773706db00f9d1f4575f33 - optee/optee_test/host/xtest/xtest_test.c 1cbffe4dc8601d1122741bf237321c3962b6be03 - optee/optee_test/host/xtest/xtest_test.h 1baf9be40706c39da0e80e63324399978dca3b71 - 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 ac791e4d2d6001af505e2457629a05e39101d99e - optee/optee_test/host/xtest/sha_perf.c c69fa446e4c1635a71cb6304a1b0eff363c86a9c - optee/optee_test/host/xtest/regression_1000.c 1c0d518167dbd004a55feb971308505c53869a40 - optee/optee_test/host/xtest/sock_server.h 52c8b047598111e1892f242fb0d10da16d0b5b54 - optee/optee_test/host/xtest/regression_4100.c beef192bde3e2c57fcb9a18957879c8e25fea491 - optee/optee_test/host/xtest/regression_4000.c 1a9482b5a704b8c10a44d5f5702cf9f3bfb34f71 - optee/optee_test/host/xtest/Makefile 9e1d0a71c9e29e67a7817bd3fbc94750511388a4 - optee/optee_test/host/xtest/sdp_basic.c bd49cf9db779e53c6a3985efde0a619948b6fc29 - optee/optee_test/host/xtest/benchmark_2000.c 4e6bea36b51603241b5980cc3bb5d536547ef196 - optee/optee_test/host/xtest/xtest_uuid_helpers.c ce75badee1d4b4a072e1f3bcb37fc893449c3dc5 - optee/optee_test/host/xtest/xtest_main.c 14686c51c1e1fc99b03e351c11aed2874aee799d - optee/optee_test/host/xtest/install_ta.c 4cc77b90af91e615a64ae04893fdffa7939db84c - optee/optee_test/host/xtest/LICENSE 02e343953dcc4aa89dc7e3d257169525c8f80bca - optee/optee_test/host/xtest/stats.c 4b76e6786bed1ae8da806d21ac567198a5bebdd8 - optee/optee_test/host/xtest/rand_stream.h b603bf342e0e39723fb2cef5fb371651eac03f00 - optee/optee_test/host/xtest/regression_4000_data.h aa77ac60083525624b7b523ebc76ed7920f85aa4 - optee/optee_test/host/xtest/xtest_uuid_helpers.h 16276b9d01ba73bf3bb21cb41ff264f3d0126d20 - optee/optee_test/host/xtest/sock_server.c e821790fa9d29543cb3ed6e6a8b9973affaf8f41 - optee/optee_test/host/xtest/xtest_helpers.h 10f0c17d888a467517c22ad4e7df93d4bd5d6e88 - optee/optee_test/host/xtest/pkcs11_1000.c e0ffc86a03f1d4e057ef9fc4d1f541e012d72632 - 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 d88b8dd29ce25f102d619b867e7107a3ef0cc213 - optee/optee_test/host/xtest/aes_perf.c d4e67633393e1eafbf02639e218f430a71cb978d - optee/optee_test/host/xtest/xtest_helpers.c b1f7a06e523bc02656533d557625fb39a8f6d3ef - 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 cade9adb848cbfa5e176a0af5dc9a3b3e4b2c929 - 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 e1a2ada90669428144fe7ba406257157874e1f30 - 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 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 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 c30cbe58f8c0c006b9162980e5bb92deca19339c - optee/optee_test/host/xtest/include/uapi/linux/ion_old.h 1172454c24da65d8d34d4fb391b7e9d64e094847 - optee/optee_test/host/xtest/include/uapi/linux/ion.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 ad174ed6790ffa96565a9e53448b5133947382b2 - optee/optee_test/ta/Makefile c16239ae81d65b85bdbf88f1ec1695ce06a10c24 - optee/optee_test/ta/aes_perf/ta_entry.c 571347fdcd744e2ab03261542891ebb469e61c85 - optee/optee_test/ta/aes_perf/Makefile e79ea5043e052ea105d1b256010d59ca895c3776 - 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 3d7230f7d586f6476565ec6729e6b0e2fa0849f9 - 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 d71ac66c515df70cc6b2ece5b374c4912d78ac3c - 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 03b8ea6cda734b12ed0b769ff8da6a5896ee580d - optee/optee_test/ta/os_test/ta_entry.c a4ae385c460bad98c3f1bb74e4cd6d78a3d1c569 - optee/optee_test/ta/os_test/cxx_tests.cpp 0455da7d426f2d9c91e8d1f0ceedcbcdc25b7e63 - optee/optee_test/ta/os_test/cxx_tests.h d5428b72979d326a9c2b5f95be053e4965f63134 - 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 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 915d0c0f05c9ac5ffb2cda70c0764b1dc902e284 - 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 77f1ab3ad488445ca4e99b08a4dff96ce10a358b - optee/optee_test/ta/os_test/include/os_test.h c0f2b4917d2e7e2c64767ce20c51277d030da95e - optee/optee_test/ta/os_test/include/init.h d9d8c33e49d6c3df01a5e3ae023500f525cf6585 - optee/optee_test/ta/sha_perf/ta_entry.c 0a012b4de2ab61ce945973f22363cf7a80722ef8 - optee/optee_test/ta/sha_perf/ta_sha_perf.c c55f5d16d5adcee00938fe1809a49f80f8b4466c - optee/optee_test/ta/sha_perf/Makefile 5356eca1c4c3e7964592e815372eaee81f9106c2 - optee/optee_test/ta/sha_perf/include/ta_sha_perf.h b47ddb13b357977a9ba1ee49d3d1c3c8a3fa7d1f - optee/optee_test/ta/sha_perf/include/user_ta_header_defines.h f226e55b4e2d3c512b7157ef2f0b6b49e6926b16 - optee/optee_test/ta/sha_perf/include/ta_sha_perf_priv.h 34b3400b1703254bcb2a7257bd67a272ae9ff021 - 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 e996dbe785d2b9b352a74ae27dc569fcd5f25dea - 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 148fa86fcd4d7f29d0a1bbffe3f7adaca730b4a0 - 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 0b4fc2e90776793847040b7b48875ac48766e29d - 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 9695d7a752ae039481436b5c5f39a776a6a3d74c - 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 181caaccd987fdc8ffd8f892bf80d724b280e5db - optee/optee_test/ta/crypt/cryp_taf.c 507408cbed9ddeabf7f14780bfc38ca2277773c7 - 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 996a9022f605b3cd20ca62a6a4d4916b51b76b10 - 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 8ca44f8a376c18091b5d6852bcc13f5d88d2e882 - 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 9bfd76b2e01b8f1bee874d847cedfe62cdae761c - optee/optee_test/ta/include/ta_storage.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 25b6a6ccdc342f572cd42e487a41c2bc39bab7b5 - 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 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: I88c1e91a6fab6449a9bd6210b315473a4105907e
This commit is contained in:
2640
commitFile.txt
Normal file
2640
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
|
||||
111
optee/atf_and_optee_README.txt
Normal file
111
optee/atf_and_optee_README.txt
Normal file
@@ -0,0 +1,111 @@
|
||||
**********************************************************************
|
||||
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
|
||||
|
||||
----------------------------------------------------------------------
|
||||
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-
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Building the OP-TEE source code
|
||||
----------------------------------------------------------------------
|
||||
Execute this command to build the OP-TEE source package:
|
||||
|
||||
CROSS_COMPILE_AARCH64_PATH="${CROSS_COMPILE_AARCH64_PATH}" \
|
||||
./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 secure-os <your_board_conf_file> mmcblk0p1
|
||||
ex:
|
||||
sudo ./flash.sh -k secure-os jetson-xavier-nx-devkit mmcblk0p1
|
||||
|
||||
3. Copy all the files under ./optee/install/t<platform> to the target.
|
||||
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
|
||||
44
optee/optee_client/.travis.yml
Normal file
44
optee/optee_client/.travis.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
# One may have a look at http://docs.travis-ci.com/user/installing-dependencies/
|
||||
|
||||
language: c
|
||||
|
||||
notifications:
|
||||
- email: true
|
||||
|
||||
git:
|
||||
depth: false
|
||||
|
||||
before_script:
|
||||
- export OPTEE_CLIENT=$PWD
|
||||
|
||||
# Download checkpatch.pl
|
||||
- export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts
|
||||
- wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/checkpatch.pl && chmod a+x checkpatch.pl
|
||||
- wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/spelling.txt
|
||||
- echo "invalid.struct.name" >const_structs.checkpatch
|
||||
- export PATH=$KERNEL/scripts/:$PATH
|
||||
- cd $OPTEE_CLIENT
|
||||
- source scripts/checkpatch_inc.sh
|
||||
|
||||
# Install the cross-compiler
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
|
||||
- arm-linux-gnueabihf-gcc --version
|
||||
# Travis does 'export CC=gcc'. Unset CC so that ./flags.mk properly
|
||||
# defines the cross-compiler to the default value: $(CROSS_COMPILE)gcc.
|
||||
- unset CC
|
||||
|
||||
# Several compilation options are checked
|
||||
script:
|
||||
# Run checkpatch.pl on:
|
||||
# - the tip of the branch if we're not in a pull request
|
||||
# - each commit in the development branch that's not in the target branch otherwise
|
||||
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then checkpatch HEAD; else for c in $(git rev-list HEAD^1..HEAD^2); do checkpatch $c || failed=1; done; [ -z "$failed" ]; fi
|
||||
# If we have a pull request with more than 1 commit, also check the squashed commits
|
||||
# Useful to check if fix-up commits do indeed solve previous checkpatch errors
|
||||
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2); fi; fi
|
||||
|
||||
- make clean all
|
||||
- CFG_TEE_CLIENT_LOG_LEVEL=0 make clean all
|
||||
- CFG_TEE_CLIENT_LOG_LEVEL=5 make clean all
|
||||
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
|
||||
40
optee/optee_client/CMakeLists.txt
Normal file
40
optee/optee_client/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required (VERSION 3.4)
|
||||
project (optee_client C)
|
||||
|
||||
# https://cmake.org/Wiki/CMake_Useful_Variables
|
||||
set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
|
||||
|
||||
set (CFG_WERROR 1 CACHE BOOL "Build with -Werror")
|
||||
|
||||
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 -Wunsafe-loop-optimizations
|
||||
-Wwrite-strings -fPIC
|
||||
)
|
||||
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)
|
||||
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.
|
||||
149
optee/optee_client/Makefile
Normal file
149
optee/optee_client/Makefile
Normal file
@@ -0,0 +1,149 @@
|
||||
# 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
|
||||
|
||||
.PHONY: all build build-libteec build-libckteec build-libseteec 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
|
||||
|
||||
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
|
||||
|
||||
install: copy_export
|
||||
|
||||
clean: clean-libteec clean-tee-supplicant clean-cscope clean-libckteec clean-libseteec
|
||||
|
||||
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
|
||||
|
||||
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 -a ${O}/libteec/libteec.so* $(DESTDIR)$(LIBDIR)
|
||||
cp -a ${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 -a ${O}/libckteec/libckteec.so* $(DESTDIR)$(LIBDIR)
|
||||
cp -a ${O}/libckteec/libckteec.a $(DESTDIR)$(LIBDIR)
|
||||
cp libseteec/include/*.h $(DESTDIR)$(INCLUDEDIR)
|
||||
cp -a ${O}/libseteec/libseteec.so* $(DESTDIR)$(LIBDIR)
|
||||
cp -a ${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
|
||||
76
optee/optee_client/config.mk
Normal file
76
optee/optee_client/config.mk
Normal file
@@ -0,0 +1,76 @@
|
||||
#########################################################################
|
||||
# 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
|
||||
# The location of the client library file.
|
||||
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.
|
||||
|
||||
32
optee/optee_client/flags.mk
Normal file
32
optee/optee_client/flags.mk
Normal file
@@ -0,0 +1,32 @@
|
||||
#########################################################################
|
||||
# COMMON COMPILATION FLAGS #
|
||||
#########################################################################
|
||||
|
||||
CROSS_COMPILE ?= arm-linux-gnueabihf-
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
AR ?= $(CROSS_COMPILE)ar
|
||||
|
||||
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 -Wunsafe-loop-optimizations \
|
||||
-Wwrite-strings -D_FILE_OFFSET_BITS=64
|
||||
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
|
||||
80
optee/optee_client/libckteec/CMakeLists.txt
Normal file
80
optee/optee_client/libckteec/CMakeLists.txt
Normal file
@@ -0,0 +1,80 @@
|
||||
project(ckteec C)
|
||||
|
||||
set(MAJOR_VERSION 0)
|
||||
set(MINOR_VERSION 1)
|
||||
set(PATCH_VERSION 0)
|
||||
|
||||
set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
|
||||
################################################################################
|
||||
# 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 ${MAJOR_VERSION}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# 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 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))
|
||||
|
||||
7
optee/optee_client/libckteec/include/CMakeLists.txt
Normal file
7
optee/optee_client/libckteec/include/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
project (libckteec-headers C)
|
||||
|
||||
FILE(GLOB INSTALL_HEADERS "*.h")
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
|
||||
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*/
|
||||
1208
optee/optee_client/libckteec/include/pkcs11.h
Normal file
1208
optee/optee_client/libckteec/include/pkcs11.h
Normal file
File diff suppressed because it is too large
Load Diff
1331
optee/optee_client/libckteec/include/pkcs11_ta.h
Normal file
1331
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*/
|
||||
676
optee/optee_client/libckteec/src/serialize_ck.c
Normal file
676
optee/optee_client/libckteec/src/serialize_ck.c
Normal file
@@ -0,0 +1,676 @@
|
||||
// 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_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_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_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_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_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);
|
||||
|
||||
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*/
|
||||
72
optee/optee_client/libseteec/CMakeLists.txt
Normal file
72
optee/optee_client/libseteec/CMakeLists.txt
Normal file
@@ -0,0 +1,72 @@
|
||||
project(seteec C)
|
||||
|
||||
set(MAJOR_VERSION 0)
|
||||
set(MINOR_VERSION 1)
|
||||
set(PATCH_VERSION 0)
|
||||
|
||||
set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
|
||||
################################################################################
|
||||
# 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 ${MAJOR_VERSION}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# 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 include
|
||||
PRIVATE src
|
||||
)
|
||||
|
||||
target_include_directories(teec
|
||||
PUBLIC include
|
||||
)
|
||||
|
||||
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;
|
||||
}
|
||||
75
optee/optee_client/libteec/CMakeLists.txt
Normal file
75
optee/optee_client/libteec/CMakeLists.txt
Normal file
@@ -0,0 +1,75 @@
|
||||
project(libteec C)
|
||||
|
||||
set(PROJECT_VERSION "1.0.0")
|
||||
|
||||
################################################################################
|
||||
# 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_target_properties (teec PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION 1
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Flags always set
|
||||
################################################################################
|
||||
target_compile_definitions (teec
|
||||
PRIVATE -D_GNU_SOURCE
|
||||
PRIVATE -DCFG_TEE_CLIENT_LOG_LEVEL=${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 */
|
||||
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, 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
|
||||
21
optee/optee_client/public/CMakeLists.txt
Normal file
21
optee/optee_client/public/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
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 ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
################################################################################
|
||||
# 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 */
|
||||
554
optee/optee_client/public/tee_client_api.h
Normal file
554
optee/optee_client/public/tee_client_api.h
Normal file
@@ -0,0 +1,554 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
/**
|
||||
* 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_PARAMS_TYPE 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
|
||||
}
|
||||
|
||||
118
optee/optee_client/tee-supplicant/CMakeLists.txt
Normal file
118
optee/optee_client/tee-supplicant/CMakeLists.txt
Normal file
@@ -0,0 +1,118 @@
|
||||
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 "Location of libteec.so")
|
||||
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/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 -DCFG_TEE_SUPP_LOG_LEVEL=${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})
|
||||
106
optee/optee_client/tee-supplicant/Makefile
Normal file
106
optee/optee_client/tee-supplicant/Makefile
Normal file
@@ -0,0 +1,106 @@
|
||||
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 \
|
||||
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 */
|
||||
|
||||
300
optee/optee_client/tee-supplicant/src/optee_msg_supplicant.h
Normal file
300
optee/optee_client/tee-supplicant/src/optee_msg_supplicant.h
Normal file
@@ -0,0 +1,300 @@
|
||||
/*
|
||||
* 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 __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
|
||||
|
||||
/*
|
||||
* 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*/
|
||||
222
optee/optee_client/tee-supplicant/src/plugin.c
Normal file
222
optee/optee_client/tee-supplicant/src/plugin.c
Normal file
@@ -0,0 +1,222 @@
|
||||
// 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;
|
||||
|
||||
p->handle = handle;
|
||||
|
||||
m = (struct plugin_method *)dlsym(handle, "plugin_method");
|
||||
if (!m || !m->name || !m->invoke)
|
||||
return PLUGIN_DL_SYM_ERR;
|
||||
|
||||
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;
|
||||
|
||||
dir = opendir(TEE_PLUGIN_LOAD_PATH);
|
||||
if (!dir) {
|
||||
IMSG("could not open directory %s", TEE_PLUGIN_LOAD_PATH);
|
||||
|
||||
/* don't generate error if there is no the dir */
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
||||
while ((entry = readdir(dir))) {
|
||||
struct plugin *p;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
res = load_plugin((const char *)entry->d_name, 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 */
|
||||
856
optee/optee_client/tee-supplicant/src/rpmb.c
Normal file
856
optee/optee_client/tee-supplicant/src/rpmb.c
Normal file
@@ -0,0 +1,856 @@
|
||||
/*
|
||||
* 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 <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))
|
||||
|
||||
/* Response to device info request */
|
||||
struct rpmb_dev_info {
|
||||
uint8_t cid[16];
|
||||
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_SEND_EXT_CSD 8
|
||||
#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;
|
||||
}
|
||||
|
||||
/* Open eMMC device dev_id */
|
||||
static int mmc_fd(uint16_t dev_id)
|
||||
{
|
||||
int fd = 0;
|
||||
char path[PATH_MAX] = { 0 };
|
||||
|
||||
DMSG("dev_id = %u", dev_id);
|
||||
#ifdef __ANDROID__
|
||||
snprintf(path, sizeof(path), "/dev/block/mmcblk%u", dev_id);
|
||||
#else
|
||||
snprintf(path, sizeof(path), "/dev/mmcblk%u", dev_id);
|
||||
#endif
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
EMSG("Could not open %s (%s)", path, strerror(errno));
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void close_mmc_fd(int fd)
|
||||
{
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/* Device Identification (CID) register is 16 bytes. It is read from sysfs. */
|
||||
static uint32_t read_cid(uint16_t dev_id, uint8_t *cid)
|
||||
{
|
||||
TEEC_Result res = TEEC_ERROR_GENERIC;
|
||||
char path[48] = { 0 };
|
||||
char hex[3] = { 0 };
|
||||
int st = 0;
|
||||
int fd = 0;
|
||||
int i = 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) {
|
||||
EMSG("Could not open %s (%s)", path, strerror(errno));
|
||||
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
st = read(fd, hex, 2);
|
||||
if (st < 0) {
|
||||
EMSG("Read CID error (%s)", strerror(errno));
|
||||
res = TEEC_ERROR_NO_DATA;
|
||||
goto err;
|
||||
}
|
||||
cid[i] = (uint8_t)strtol(hex, NULL, 16);
|
||||
}
|
||||
res = TEEC_SUCCESS;
|
||||
err:
|
||||
close(fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
static void ioctl_emu_set_ext_csd(uint8_t *ext_csd)
|
||||
{
|
||||
ext_csd[168] = EMU_RPMB_SIZE_MULT;
|
||||
ext_csd[222] = EMU_RPMB_REL_WR_SEC_C;
|
||||
}
|
||||
|
||||
/* 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_SEND_EXT_CSD:
|
||||
ioctl_emu_set_ext_csd((uint8_t *)(uintptr_t)cmd->data_ptr);
|
||||
break;
|
||||
|
||||
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 int mmc_fd(uint16_t dev_id)
|
||||
{
|
||||
(void)dev_id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void close_mmc_fd(int fd)
|
||||
{
|
||||
(void)fd;
|
||||
}
|
||||
|
||||
#endif /* RPMB_EMU */
|
||||
|
||||
/*
|
||||
* Extended CSD Register is 512 bytes and defines device properties
|
||||
* and selected modes.
|
||||
*/
|
||||
static uint32_t read_ext_csd(int fd, uint8_t *ext_csd)
|
||||
{
|
||||
int st = 0;
|
||||
struct mmc_ioc_cmd cmd = {
|
||||
.blksz = 512,
|
||||
.blocks = 1,
|
||||
.flags = MMC_RSP_R1 | MMC_CMD_ADTC,
|
||||
.opcode = MMC_SEND_EXT_CSD,
|
||||
};
|
||||
|
||||
mmc_ioc_cmd_set_data(cmd, ext_csd);
|
||||
|
||||
st = IOCTL(fd, MMC_IOC_CMD, &cmd);
|
||||
if (st < 0)
|
||||
return TEEC_ERROR_GENERIC;
|
||||
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
int fd = 0;
|
||||
uint32_t res = 0;
|
||||
uint8_t ext_csd[512] = { 0 };
|
||||
|
||||
res = read_cid(dev_id, info->cid);
|
||||
if (res != TEEC_SUCCESS)
|
||||
return res;
|
||||
|
||||
fd = mmc_fd(dev_id);
|
||||
if (fd < 0)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
res = read_ext_csd(fd, ext_csd);
|
||||
if (res != TEEC_SUCCESS)
|
||||
goto err;
|
||||
|
||||
info->rel_wr_sec_c = ext_csd[222];
|
||||
info->rpmb_size_mult = ext_csd[168];
|
||||
info->ret_code = RPMB_CMD_GET_DEV_INFO_RET_OK;
|
||||
|
||||
err:
|
||||
close_mmc_fd(fd);
|
||||
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;
|
||||
uint32_t res = 0;
|
||||
int fd = 0;
|
||||
|
||||
if (req_size < sizeof(*sreq))
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
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(sreq->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(sreq->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*/
|
||||
648
optee/optee_client/tee-supplicant/src/tee_supp_fs.c
Normal file
648
optee/optee_client/tee-supplicant/src/tee_supp_fs.c
Normal file
@@ -0,0 +1,648 @@
|
||||
/*
|
||||
* 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 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 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;
|
||||
|
||||
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/", TEE_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 TEEC_ERROR_GENERIC;
|
||||
|
||||
/* 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)) {
|
||||
fd = open_wrapper(abs_filename, flags);
|
||||
if (fd >= 0)
|
||||
goto out;
|
||||
/*
|
||||
* The directory was made but the file could still not be
|
||||
* created.
|
||||
*/
|
||||
rmdir(d);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
if (errno != ENOENT)
|
||||
return TEEC_ERROR_GENERIC;
|
||||
|
||||
/* Parent directory for file missing, try to make it */
|
||||
d = dirname(d);
|
||||
if (mkdir(d, 0700))
|
||||
return TEEC_ERROR_GENERIC;
|
||||
|
||||
/* 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)) {
|
||||
d = dirname(d);
|
||||
rmdir(d);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
fd = open_wrapper(abs_filename, flags);
|
||||
if (fd < 0) {
|
||||
rmdir(d);
|
||||
d = dirname(d);
|
||||
rmdir(d);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
out:
|
||||
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 TEEC_ERROR_GENERIC;
|
||||
}
|
||||
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 TEEC_ERROR_GENERIC;
|
||||
}
|
||||
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 TEEC_ERROR_GENERIC;
|
||||
}
|
||||
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 TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
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)) {
|
||||
if (errno == ENOENT)
|
||||
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
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 (strlen(tee_fs_root) == 0) {
|
||||
if (tee_supp_fs_init() != 0) {
|
||||
EMSG("error tee_supp_fs_init: failed to create %s/",
|
||||
TEE_FS_PARENT_PATH);
|
||||
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
|
||||
809
optee/optee_client/tee-supplicant/src/tee_supplicant.c
Normal file
809
optee/optee_client/tee-supplicant/src/tee_supplicant.c
Normal file
@@ -0,0 +1,809 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <prof.h>
|
||||
#include <plugin.h>
|
||||
#include <pthread.h>
|
||||
#include <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))
|
||||
|
||||
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;
|
||||
|
||||
static const char *ta_dir;
|
||||
|
||||
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(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;
|
||||
|
||||
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));
|
||||
close(shm->fd);
|
||||
free(shm);
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
}
|
||||
}
|
||||
|
||||
close(shm->fd);
|
||||
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;
|
||||
|
||||
ta_dir = "optee_armtz";
|
||||
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 [-d] [<device-name>]\n");
|
||||
fprintf(stderr, " -d: run as a daemon (fork after successful "
|
||||
"initialization)\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 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;
|
||||
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;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct thread_arg arg = { .fd = -1 };
|
||||
bool daemonize = false;
|
||||
char *dev = NULL;
|
||||
int e = 0;
|
||||
int i = 0;
|
||||
|
||||
e = pthread_mutex_init(&arg.mutex, NULL);
|
||||
if (e) {
|
||||
EMSG("pthread_mutex_init: %s", strerror(e));
|
||||
EMSG("terminating...");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (argc > 3)
|
||||
return usage(EXIT_FAILURE);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-d"))
|
||||
daemonize = true;
|
||||
else if (!strcmp(argv[i], "-h"))
|
||||
return usage(EXIT_SUCCESS);
|
||||
else
|
||||
dev = argv[i];
|
||||
}
|
||||
|
||||
if (daemonize && daemon(0, 0) < 0) {
|
||||
EMSG("daemon(): %s", strerror(errno));
|
||||
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 (plugin_load_all() != 0) {
|
||||
EMSG("failed to load plugins");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
48
optee/optee_client/tee-supplicant/src/tee_supplicant.h
Normal file
48
optee/optee_client/tee-supplicant/src/tee_supplicant.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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*/
|
||||
190
optee/optee_client/tee-supplicant/src/teec_ta_load.c
Normal file
190
optee/optee_client/tee-supplicant/src/teec_ta_load.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* 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: 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)
|
||||
{
|
||||
#ifdef TEEC_TEST_LOAD_PATH
|
||||
int res = 0;
|
||||
|
||||
res = try_load_secure_module(TEEC_TEST_LOAD_PATH,
|
||||
dev_path, destination, ta, ta_size);
|
||||
if (res != TA_BINARY_NOT_FOUND)
|
||||
return res;
|
||||
#endif
|
||||
|
||||
return try_load_secure_module(TEEC_LOAD_PATH,
|
||||
dev_path, destination, ta, ta_size);
|
||||
}
|
||||
50
optee/optee_client/tee-supplicant/src/teec_ta_load.h
Normal file
50
optee/optee_client/tee-supplicant/src/teec_ta_load.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
/**
|
||||
* 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
|
||||
272
optee/optee_os/.azure-pipelines.yml
Normal file
272
optee/optee_os/.azure-pipelines.yml
Normal file
@@ -0,0 +1,272 @@
|
||||
jobs:
|
||||
- job: code_style
|
||||
displayName: 'Check code style'
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
container:
|
||||
image: jforissier/optee_os_ci
|
||||
steps:
|
||||
- script: |
|
||||
set -e
|
||||
pushd .
|
||||
mkdir -p /tmp/linux/scripts
|
||||
cd /tmp/linux/scripts
|
||||
wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/checkpatch.pl
|
||||
chmod +x checkpatch.pl
|
||||
wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/spelling.txt
|
||||
echo "invalid.struct.name" >const_structs.checkpatch
|
||||
export PATH=/tmp/linux/scripts:$PATH
|
||||
popd
|
||||
source scripts/checkpatch_inc.sh
|
||||
function _do() { echo '>>' $*; $*; }
|
||||
# Run checkpatch.pl:
|
||||
# - on the tip of the branch only if we're not in a pull request
|
||||
# - otherwise:
|
||||
# * on each commit in the development branch that is not in the target (merge to) branch
|
||||
# * on the global diff if the PR contains more than one commit (useful to check if fixup
|
||||
# commits do solve previous checkpatch errors)
|
||||
if [ "${SYSTEM_PULLREQUEST_PULLREQUESTID}" == "" ]; then \
|
||||
_do checkpatch HEAD || failed=1; \
|
||||
else \
|
||||
for c in $(git rev-list HEAD^1..HEAD^2); do \
|
||||
_do checkpatch $c || failed=1; \
|
||||
done; \
|
||||
if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then \
|
||||
_do checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2) || failed=1; \
|
||||
fi; \
|
||||
fi
|
||||
[ -z "$failed" ]
|
||||
displayName: 'Run checkpatch'
|
||||
- script: |
|
||||
sudo -E bash -c "apt update -qq -y && apt install -qq -y pycodestyle"
|
||||
pycodestyle scripts/*.py core/arch/arm/plat-stm32mp1/scripts/stm32image.py
|
||||
displayName: 'Run pycodestyle'
|
||||
condition: succeededOrFailed() # Run this 'script' even if previous ones failed
|
||||
- job: build_all
|
||||
displayName: 'Build all'
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
container:
|
||||
image: jforissier/optee_os_ci
|
||||
steps:
|
||||
- task: InstallSSHKey@0
|
||||
displayName: 'Install SSH key for build cache'
|
||||
inputs:
|
||||
hostname: 'cache.forissier.org'
|
||||
knownHostEntry: 'cache.forissier.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDhjh94ShHh6M19+0NBjgX8ZUiZINQS60GmQjzLfivljvAxBtheCDlDqK5NLIoXn4HE2FxkNTMqmJ+D0p7eQAy81OyYVtvTrJm4B4dk60wMDzQgUK2Cikl2YWNTuxeHpwvpEXP0EK/AHjX1z+98Us9XP6bMr7n1nN6WM8JEdOKpMgl7O9uK3jqYJHo9k+ldkAR4yX8jYgxothu9qkeu2X8tbaP3rjaLlDEsi90AOZb0VJxVmTRWFjh3DBcbbeiurTQndKrQff6T5SkbK2vjKP7ipFAKfAYK6SDOxsZ6c5KB8/5aMHXnble9aL2tDV2CArlbKlTySM9ozcN274gK8n2at8lKfDgzK1yzCehVk6KQk+EERNqxFESpoFgq28DLGqxcPQW27nD7jqFSxPSHGll3ePTF49e8/sNi6vRD3dvmgGMMZWmdI8QwfR83ELN+jcwb3sCNhUh/kK4ETfDMV3N5kRhSGcJK84Lzb4s85afacGxXRu/9HhiEe7wl+LWv5Es='
|
||||
sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHVf1VsKwFAc1574TJfQK1v7ugPoYIpASm3UqB8HUQHVl353zH/veEL2xer1g4GSj27LIh0wszGqu6wMIWGNxb1iEozhLBABnavAht9mSYWkeOfzWb8f8c4EgLyK5gWhT049+A1iI8tu9DjHjgGD6JeyYyUXGHwC0cexqu6QJszWuXi2a0arCeM2Dbo/bjTJ4HdKEJBaxHpaO0JbbNmJrKwlAySHKdWtQ7uowKQgdD6BZcjV4n++pj4WfMMUVgBfaw7m3S6DP7I+yAWH4U3mLpf6Yq54rYYCewjLtQHj9H5xAPAi7Yk7b4+DJgeOY8CQ3zSdsnrHf69905ShVy9fUbylilgqdZEiRwxCaQ7Felh9cH9OBmP1DtEDpL1FSj5lj9o7fSNCJ22F8vYKf7hQRK68vjJW16rB1iPh63fHSIdEQV4pobxjhoOctckxI7svHT6u7pf6tP4BW9wu8i4utQq5XaF1HN2DWcKSP8I+R3668/p/kHfAvJQZaHsbFmB+s= jerome@azure-pipelines'
|
||||
sshKeySecureFile: 'ssh_rsa_build-cache'
|
||||
- script: |
|
||||
set -e -v
|
||||
export LC_ALL=C
|
||||
export PATH=/usr/local/bin:$PATH # clang
|
||||
export CROSS_COMPILE32="ccache arm-linux-gnueabihf-"
|
||||
export CROSS_COMPILE64="ccache aarch64-linux-gnu-"
|
||||
export CFG_DEBUG_INFO=n
|
||||
export CFG_WERROR=y
|
||||
export START=$(date +%s)
|
||||
export PROJ=$(System.CollectionId)-$(System.TeamProject) # $ORG_NAME-$REPO_NAME
|
||||
export SCP_OPT="-o ConnectTimeout=10 -o StrictHostKeyChecking=no"
|
||||
|
||||
function download_cache() { ssh $SCP_OPT optee_os_ci@cache.forissier.org "cat ccache-$PROJ.tar.gz" | tar zx -C $HOME || echo Nevermind; }
|
||||
function upload_cache() { if [ ! -e .uploaded ]; then echo Uploading cache && tar c -C $HOME .ccache | gzip -1 | ssh $SCP_OPT optee_os_ci@cache.forissier.org "cat >ccache-$PROJ.tar.gz" && touch .uploaded || echo Nevermind; fi; }
|
||||
function check_upload_cache() { NOW=$(date +%s); if [ $(expr $NOW - $START) -gt 3000 ]; then upload_cache; fi; }
|
||||
function _make() { make -j$(getconf _NPROCESSORS_ONLN) -s O=out $* && check_upload_cache; }
|
||||
function download_plug_and_trust() { mkdir -p $HOME/se050 && git clone --single-branch -b v0.1.0 https://github.com/foundriesio/plug-and-trust $HOME/se050/plug-and-trust || (rm -rf $HOME/se050 ; echo Nervermind); }
|
||||
|
||||
download_cache
|
||||
ccache -s
|
||||
download_plug_and_trust
|
||||
|
||||
_make
|
||||
_make COMPILER=clang
|
||||
_make CFG_TEE_CORE_LOG_LEVEL=4 CFG_TEE_CORE_DEBUG=y CFG_TEE_TA_LOG_LEVEL=4 CFG_CC_OPT_LEVEL=0 CFG_DEBUG_INFO=y
|
||||
_make CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n CFG_TEE_TA_LOG_LEVEL=0 CFG_DEBUG_INFO=n CFG_ENABLE_EMBEDDED_TESTS=n
|
||||
_make CFG_TEE_CORE_MALLOC_DEBUG=y CFG_CORE_DEBUG_CHECK_STACKS=y
|
||||
_make CFG_CORE_SANITIZE_UNDEFINED=y
|
||||
_make CFG_CORE_SANITIZE_KADDRESS=y
|
||||
_make CFG_LOCKDEP=y
|
||||
_make CFG_CRYPTO=n
|
||||
_make CFG_CRYPTO_{AES,DES}=n
|
||||
_make CFG_CRYPTO_{DSA,RSA,DH}=n
|
||||
_make CFG_CRYPTO_{DSA,RSA,DH,ECC}=n
|
||||
_make CFG_CRYPTO_{H,C,CBC_}MAC=n
|
||||
_make CFG_CRYPTO_{G,C}CM=n
|
||||
_make CFG_CRYPTO_{MD5,SHA{1,224,256,384,512,512_256}}=n
|
||||
_make CFG_WITH_PAGER=y out/core/tee{,-pager,-pageable}.bin
|
||||
_make CFG_WITH_PAGER=y CFG_CRYPTOLIB_NAME=mbedtls CFG_CRYPTOLIB_DIR=lib/libmbedtls
|
||||
_make CFG_WITH_PAGER=y CFG_WITH_LPAE=y
|
||||
_make CFG_WITH_LPAE=y
|
||||
_make CFG_RPMB_FS=y
|
||||
_make CFG_RPMB_FS=y CFG_RPMB_TESTKEY=y
|
||||
_make CFG_REE_FS=n CFG_RPMB_FS=y
|
||||
_make CFG_WITH_PAGER=y CFG_WITH_LPAE=y CFG_RPMB_FS=y CFG_DT=y CFG_TEE_CORE_LOG_LEVEL=1 CFG_TEE_CORE_DEBUG=y CFG_CC_OPT_LEVEL=0 CFG_DEBUG_INFO=y
|
||||
_make CFG_WITH_PAGER=y CFG_WITH_LPAE=y CFG_RPMB_FS=y CFG_DT=y CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n DEBUG=0
|
||||
_make CFG_BUILT_IN_ARGS=y CFG_PAGEABLE_ADDR=0 CFG_NS_ENTRY_ADDR=0 CFG_DT_ADDR=0 CFG_DT=y
|
||||
_make CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_ULIBS_SHARED=y
|
||||
_make CFG_TA_GPROF_SUPPORT=y CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y CFG_ULIBS_MCOUNT=y
|
||||
_make CFG_SECURE_DATA_PATH=y
|
||||
_make CFG_REE_FS_TA_BUFFERED=y
|
||||
_make CFG_WITH_USER_TA=n
|
||||
_make PLATFORM=vexpress-qemu_armv8a
|
||||
_make PLATFORM=vexpress-qemu_armv8a COMPILER=clang
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n CFG_TEE_TA_LOG_LEVEL=0 CFG_DEBUG_INFO=n
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_WITH_PAGER=y
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_ULIBS_SHARED=y
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_TA_GPROF_SUPPORT=y CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y CFG_ULIBS_MCOUNT=y
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_VIRTUALIZATION=y
|
||||
_make PLATFORM=vexpress-qemu_armv8a CFG_CORE_SEL1_SPMC=y
|
||||
dd if=/dev/urandom of=BL32_AP_MM.fd bs=2621440 count=1 && _make PLATFORM=vexpress-qemu_armv8a CFG_STMM_PATH=BL32_AP_MM.fd CFG_RPMB_FS=y CFG_CORE_HEAP_SIZE=524288 CFG_TEE_RAM_VA_SIZE=0x00400000
|
||||
_make PLATFORM=stm-b2260
|
||||
_make PLATFORM=stm-cannes
|
||||
_make PLATFORM=stm32mp1
|
||||
_make PLATFORM=stm32mp1-157C_DK2
|
||||
_make PLATFORM=vexpress-fvp
|
||||
_make PLATFORM=vexpress-fvp CFG_ARM64_core=y
|
||||
_make PLATFORM=vexpress-juno
|
||||
_make PLATFORM=vexpress-juno CFG_ARM64_core=y
|
||||
_make PLATFORM=hikey
|
||||
_make PLATFORM=hikey CFG_ARM64_core=y
|
||||
_make PLATFORM=mediatek-mt8173
|
||||
_make PLATFORM=mediatek-mt8175
|
||||
_make PLATFORM=mediatek-mt8183
|
||||
_make PLATFORM=mediatek-mt8516
|
||||
_make PLATFORM=imx-mx6ulevk
|
||||
_make PLATFORM=imx-mx6ulevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
_make PLATFORM=imx-mx6ul9x9evk
|
||||
_make PLATFORM=imx-mx6ullevk CFG_WITH_SOFTWARE_PRNG=n CFG_IMX_RNGB=y
|
||||
if [ -d $HOME/se050/plug-and-trust ]; then _make PLATFORM=imx-mx6ullevk CFG_NXP_SE05X=y CFG_IMX_I2C=y CFG_STACK_{THREAD,TMP}_EXTRA=8192 CFG_CRYPTO_DRV_{CIPHER,ACIPHER}=y CFG_WITH_SOFTWARE_PRNG=n CFG_NXP_SE05X_{DIEID,RNG,RSA,ECC,CTR}_DRV=y CFG_NXP_SE05X_PLUG_AND_TRUST=$HOME/se050/plug-and-trust ; fi
|
||||
_make PLATFORM=imx-mx6ulzevk
|
||||
_make PLATFORM=imx-mx6slevk
|
||||
_make PLATFORM=imx-mx6sllevk
|
||||
_make PLATFORM=imx-mx6sxsabreauto
|
||||
_make PLATFORM=imx-mx6sxsabresd
|
||||
_make PLATFORM=imx-mx6sxsabresd CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
_make PLATFORM=imx-mx6solosabresd
|
||||
_make PLATFORM=imx-mx6solosabreauto
|
||||
_make PLATFORM=imx-mx6sxsabreauto
|
||||
_make PLATFORM=imx-mx6qsabrelite
|
||||
_make PLATFORM=imx-mx6qsabresd
|
||||
_make PLATFORM=imx-mx6qsabresd CFG_RPMB_FS=y
|
||||
_make PLATFORM=imx-mx6qsabreauto
|
||||
_make PLATFORM=imx-mx6qsabreauto CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
_make PLATFORM=imx-mx6qpsabreauto
|
||||
_make PLATFORM=imx-mx6qpsabresd
|
||||
_make PLATFORM=imx-mx6dlsabresd
|
||||
_make PLATFORM=imx-mx6dlsabreauto
|
||||
_make PLATFORM=imx-mx6dapalis
|
||||
_make PLATFORM=imx-mx6qapalis
|
||||
_make PLATFORM=imx-mx7dsabresd
|
||||
_make PLATFORM=imx-mx7dsabresd CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
_make PLATFORM=imx-mx7ulpevk
|
||||
_make PLATFORM=imx-mx8mmevk
|
||||
_make PLATFORM=imx-mx8mmevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
if [ -d $HOME/se050/plug-and-trust ]; then _make PLATFORM=imx-mx8mmevk CFG_NXP_CAAM=y CFG_NXP_CAAM_RNG_DRV=y CFG_NXP_SE05X=y CFG_IMX_I2C=y CFG_STACK_{THREAD,TMP}_EXTRA=8192 CFG_CRYPTO_DRV_{CIPHER,ACIPHER}=y CFG_NXP_SE05X_RNG_DRV=n CFG_WITH_SOFTWARE_PRNG=n CFG_NXP_SE05X_{DIEID,RSA,ECC,CTR}_DRV=y CFG_NXP_SE05X_PLUG_AND_TRUST=$HOME/se050/plug-and-trust ; fi
|
||||
_make PLATFORM=imx-mx8mnevk
|
||||
_make PLATFORM=imx-mx8mqevk
|
||||
_make PLATFORM=imx-mx8mpevk
|
||||
_make PLATFORM=imx-mx8qxpmek
|
||||
_make PLATFORM=imx-mx8qmmek
|
||||
_make PLATFORM=imx-mx8dxlevk
|
||||
_make PLATFORM=imx-mx8ulpevk
|
||||
_make PLATFORM=imx-mx8ulpevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
|
||||
_make PLATFORM=k3-j721e
|
||||
_make PLATFORM=k3-j721e CFG_ARM64_core=y
|
||||
_make PLATFORM=k3-am65x
|
||||
_make PLATFORM=k3-am65x CFG_ARM64_core=y
|
||||
_make PLATFORM=ti-dra7xx out/core/tee{,-pager,-pageable}.bin
|
||||
_make PLATFORM=ti-am57xx
|
||||
_make PLATFORM=ti-am43xx
|
||||
_make PLATFORM=sprd-sc9860
|
||||
_make PLATFORM=sprd-sc9860 CFG_ARM64_core=y
|
||||
_make PLATFORM=ls-ls1021atwr
|
||||
_make PLATFORM=ls-ls1021aqds
|
||||
_make PLATFORM=ls-ls1043ardb
|
||||
_make PLATFORM=ls-ls1046ardb
|
||||
_make PLATFORM=ls-ls1012ardb
|
||||
_make PLATFORM=ls-ls1012afrwy
|
||||
_make PLATFORM=ls-ls1028ardb
|
||||
_make PLATFORM=ls-ls1088ardb
|
||||
_make PLATFORM=ls-ls2088ardb
|
||||
_make PLATFORM=ls-lx2160ardb
|
||||
_make PLATFORM=ls-lx2160aqds
|
||||
_make PLATFORM=zynq7k-zc702
|
||||
_make PLATFORM=zynqmp-zcu102
|
||||
_make PLATFORM=zynqmp-zcu102 CFG_ARM64_core=y
|
||||
_make PLATFORM=d02
|
||||
_make PLATFORM=d02 CFG_ARM64_core=y
|
||||
_make PLATFORM=rcar
|
||||
_make PLATFORM=rzg
|
||||
_make PLATFORM=rzg CFG_ARM64_core=y
|
||||
_make PLATFORM=rpi3
|
||||
_make PLATFORM=rpi3 CFG_ARM64_core=y
|
||||
_make PLATFORM=hikey-hikey960
|
||||
_make PLATFORM=hikey-hikey960 COMPILER=clang
|
||||
_make PLATFORM=hikey-hikey960 CFG_ARM64_core=y
|
||||
_make PLATFORM=hikey-hikey960 CFG_ARM64_core=y COMPILER=clang
|
||||
_make PLATFORM=hikey-hikey960 CFG_SECURE_DATA_PATH=n
|
||||
_make PLATFORM=poplar
|
||||
_make PLATFORM=poplar CFG_ARM64_core=y
|
||||
_make PLATFORM=rockchip-rk322x
|
||||
_make PLATFORM=sam
|
||||
_make PLATFORM=marvell-armada7k8k
|
||||
_make PLATFORM=marvell-armada3700
|
||||
_make PLATFORM=marvell-otx2t96
|
||||
_make PLATFORM=marvell-otx2f95
|
||||
_make PLATFORM=marvell-otx2t98
|
||||
_make PLATFORM=synquacer
|
||||
_make PLATFORM=sunxi-bpi_zero
|
||||
_make PLATFORM=sunxi-sun50i_a64
|
||||
_make PLATFORM=bcm-ns3 CFG_ARM64_core=y
|
||||
_make PLATFORM=hisilicon-hi3519av100_demo
|
||||
_make PLATFORM=amlogic
|
||||
_make PLATFORM=rzn1
|
||||
|
||||
upload_cache
|
||||
|
||||
- job: QEMUv8_check
|
||||
displayName: 'Run regression tests (xtest) in QEMUv8'
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
container:
|
||||
image: jforissier/optee_os_ci:qemuv8_check
|
||||
steps:
|
||||
- script: |
|
||||
set -e -v
|
||||
export LC_ALL=C
|
||||
# Azure CI sets ${SYSTEM} to "build" which prevents OpenSSL from building due to:
|
||||
# https://github.com/openssl/openssl/blob/OpenSSL_1_1_1l/config#L56
|
||||
unset SYSTEM
|
||||
WD=$(pwd)
|
||||
sudo -E bash -c "cd /root/optee_repo_qemu_v8/.repo/repo && git pull"
|
||||
sudo -E bash -c "cd /root/optee_repo_qemu_v8 && repo sync -j 10"
|
||||
sudo mv /root/optee_repo_qemu_v8/optee_os /root/optee_repo_qemu_v8/optee_os_old
|
||||
sudo ln -s ${WD} /root/optee_repo_qemu_v8/optee_os
|
||||
|
||||
sudo -E make -C /root/optee_repo_qemu_v8/build -j$(getconf _NPROCESSORS_ONLN) CFG_TEE_CORE_LOG_LEVEL=0 check
|
||||
|
||||
sudo -E rm -rf /root/optee_repo_qemu_v8/out-br/build/optee_test*
|
||||
sudo -E make -C /root/optee_repo_qemu_v8/build arm-tf-clean
|
||||
sudo -E make -C /root/optee_repo_qemu_v8/build -j$(getconf _NPROCESSORS_ONLN) CFG_TEE_CORE_LOG_LEVEL=0 check XEN_BOOT=y
|
||||
|
||||
- job: QEMUv8_build_Rust
|
||||
displayName: 'Run regression tests (Rust) in QEMUv8'
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
container:
|
||||
image: jforissier/optee_os_ci:qemuv8_check
|
||||
steps:
|
||||
- script: |
|
||||
set -e -v
|
||||
export HOME=/root
|
||||
export LC_ALL=C
|
||||
# Azure CI sets ${SYSTEM} to "build" which prevents OpenSSL from building due to:
|
||||
# https://github.com/openssl/openssl/blob/OpenSSL_1_1_1l/config#L56
|
||||
unset SYSTEM
|
||||
WD=$(pwd)
|
||||
sudo -E bash -c "cd /root/optee_repo_qemu_v8/.repo/repo && git pull"
|
||||
sudo -E bash -c "cd /root/optee_repo_qemu_v8 && repo sync -j 10"
|
||||
sudo mv /root/optee_repo_qemu_v8/optee_os /root/optee_repo_qemu_v8/optee_os_old
|
||||
sudo ln -s ${WD} /root/optee_repo_qemu_v8/optee_os
|
||||
|
||||
sudo -E bash -c "make -C /root/optee_repo_qemu_v8/build -j$(getconf _NPROCESSORS_ONLN) CFG_TEE_CORE_LOG_LEVEL=0 OPTEE_RUST_ENABLE=y check-rust"
|
||||
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.
|
||||
-->
|
||||
27
optee/optee_os/.github/workflows/stales.yml
vendored
Normal file
27
optee/optee_os/.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
|
||||
1524
optee/optee_os/CHANGELOG.md
Normal file
1524
optee/optee_os/CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
45
optee/optee_os/LICENSE
Normal file
45
optee/optee_os/LICENSE
Normal file
@@ -0,0 +1,45 @@
|
||||
Unless it has its own copyright/license embedded in its body, each 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.
|
||||
|
||||
|
||||
The following terms apply to this list of files:
|
||||
1. core/drivers/tegra/t234/include/tegra_se_ccc.h
|
||||
2. prebuilt/t234/libcommon_crypto.a
|
||||
|
||||
These items are under the following terms:
|
||||
|
||||
* NVIDIA License terms *
|
||||
SPDX-FileCopyrightText: Copyright (c) 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.
|
||||
141
optee/optee_os/LICENSE.NVIDIA
Normal file
141
optee/optee_os/LICENSE.NVIDIA
Normal file
@@ -0,0 +1,141 @@
|
||||
The below listed files are provided under the following terms:
|
||||
|
||||
core/drivers/tegra/t234/include/tegra_se_ccc.h
|
||||
core/drivers/tegra/t234/include/tegra_se_ccc_errno.h
|
||||
prebuilt/t234/libcommon_crypto.a
|
||||
|
||||
Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
License For Customer Use of NVIDIA Software
|
||||
|
||||
|
||||
IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of
|
||||
NVIDIA Software ("LICENSE") is the agreement which governs use of
|
||||
the software of NVIDIA Corporation and its subsidiaries ("NVIDIA")
|
||||
downloadable herefrom, including computer software and associated
|
||||
printed materials ("SOFTWARE"). By downloading, installing, copying,
|
||||
or otherwise using the SOFTWARE, you agree to be bound by the terms
|
||||
of this LICENSE. If you do not agree to the terms of this LICENSE,
|
||||
do not download the SOFTWARE.
|
||||
|
||||
RECITALS
|
||||
|
||||
Use of NVIDIA's products requires three elements: the SOFTWARE, the
|
||||
hardware on a graphics controller board, and a personal computer. The
|
||||
SOFTWARE is protected by copyright laws and international copyright
|
||||
treaties, as well as other intellectual property laws and treaties.
|
||||
The SOFTWARE is not sold, and instead is only licensed for use,
|
||||
strictly in accordance with this document. The hardware is protected
|
||||
by various patents, and is sold, but this agreement does not cover
|
||||
that sale, since it may not necessarily be sold as a package with
|
||||
the SOFTWARE. This agreement sets forth the terms and conditions
|
||||
of the SOFTWARE LICENSE only.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
1.1 Customer. Customer means the entity or individual that
|
||||
downloads the SOFTWARE.
|
||||
|
||||
2. GRANT OF LICENSE
|
||||
|
||||
2.1 Rights and Limitations of Grant. NVIDIA hereby grants Customer
|
||||
the following non-exclusive, non-transferable right to use the
|
||||
SOFTWARE, with the following limitations:
|
||||
|
||||
2.1.1 Rights. Customer may install and use multiple copies of the
|
||||
SOFTWARE on a shared computer or concurrently on different computers,
|
||||
and make multiple back-up copies of the SOFTWARE, solely for Customer's
|
||||
use within Customer's Enterprise. "Enterprise" shall mean individual use
|
||||
by Customer or any legal entity (such as a corporation or university)
|
||||
and the subsidiaries it owns by more than fifty percent (50%).
|
||||
|
||||
2.1.2 Linux/FreeBSD Exception. Notwithstanding the foregoing terms
|
||||
of Section 2.1.1, SOFTWARE designed exclusively for use on the Linux or
|
||||
FreeBSD operating systems, or other operating systems derived from the
|
||||
source code to these operating systems, may be copied and redistributed,
|
||||
provided that the binary files thereof are not modified in any way
|
||||
(except for unzipping of compressed files).
|
||||
|
||||
2.1.3 Limitations.
|
||||
|
||||
No Reverse Engineering. Customer may not reverse engineer,
|
||||
decompile, or disassemble the SOFTWARE, nor attempt in any other
|
||||
manner to obtain the source code.
|
||||
|
||||
No Separation of Components. The SOFTWARE is licensed as a
|
||||
single product. Its component parts may not be separated for use
|
||||
on more than one computer, nor otherwise used separately from the
|
||||
other parts.
|
||||
|
||||
No Rental. Customer may not rent or lease the SOFTWARE to someone
|
||||
else.
|
||||
|
||||
3. TERMINATION
|
||||
|
||||
This LICENSE will automatically terminate if Customer fails to
|
||||
comply with any of the terms and conditions hereof. In such event,
|
||||
Customer must destroy all copies of the SOFTWARE and all of its
|
||||
component parts.
|
||||
|
||||
Defensive Suspension. If Customer commences or participates in any legal
|
||||
proceeding against NVIDIA, then NVIDIA may, in its sole discretion,
|
||||
suspend or terminate all license grants and any other rights provided
|
||||
under this LICENSE during the pendency of such legal proceedings.
|
||||
|
||||
4. COPYRIGHT
|
||||
|
||||
All title and copyrights in and to the SOFTWARE (including but
|
||||
not limited to all images, photographs, animations, video, audio,
|
||||
music, text, and other information incorporated into the SOFTWARE),
|
||||
the accompanying printed materials, and any copies of the SOFTWARE,
|
||||
are owned by NVIDIA, or its suppliers. The SOFTWARE is protected
|
||||
by copyright laws and international treaty provisions. Accordingly,
|
||||
Customer is required to treat the SOFTWARE like any other copyrighted
|
||||
material, except as otherwise allowed pursuant to this LICENSE
|
||||
and that it may make one copy of the SOFTWARE solely for backup or
|
||||
archive purposes.
|
||||
|
||||
5. APPLICABLE LAW
|
||||
|
||||
This agreement shall be deemed to have been made in, and shall be
|
||||
construed pursuant to, the laws of the State of California.
|
||||
|
||||
6. DISCLAIMER OF WARRANTIES AND LIMITATION ON LIABILITY
|
||||
|
||||
6.1 No Warranties. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE
|
||||
LAW, THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA AND ITS SUPPLIERS
|
||||
DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT
|
||||
NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE.
|
||||
|
||||
6.2 No Liability for Consequential Damages. TO THE MAXIMUM
|
||||
EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL NVIDIA OR
|
||||
ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
|
||||
CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
|
||||
DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS
|
||||
OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT
|
||||
OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NVIDIA HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
6.3 Specific Use. SOFTWARE is licensed only for use with NVIDIA products.
|
||||
Customer's use of NVIDIA products with any other firmware is at its own
|
||||
risk and may cause an NVIDIA product to become non-compliant with certain
|
||||
of its certification markings.
|
||||
|
||||
7. MISCELLANEOUS
|
||||
|
||||
The United Nations Convention on Contracts for the International
|
||||
Sale of Goods is specifically disclaimed. If any provision of this
|
||||
LICENSE is inconsistent with, or cannot be fully enforced under,
|
||||
the law, such provision will be construed as limited to the extent
|
||||
necessary to be consistent with and fully enforceable under the law.
|
||||
This agreement is the final, complete and exclusive agreement between
|
||||
the parties relating to the subject matter hereof, and supersedes
|
||||
all prior or contemporaneous understandings and agreements relating
|
||||
to such subject matter, whether oral or written. Customer agrees
|
||||
that it will not ship, transfer or export the SOFTWARE into any
|
||||
country, or use the SOFTWARE in any manner, prohibited by the
|
||||
United States Bureau of Export Administration or any export laws,
|
||||
restrictions or regulations. This LICENSE may only be modified in
|
||||
writing signed by an authorized officer of NVIDIA.
|
||||
|
||||
300
optee/optee_os/MAINTAINERS
Normal file
300
optee/optee_os/MAINTAINERS
Normal file
@@ -0,0 +1,300 @@
|
||||
Maintainers in the OP-TEE project
|
||||
|
||||
Linaro as such maintains OP-TEE, but for individual devices which might not be
|
||||
available to Linaro and/or in public in general we have assigned
|
||||
sub-maintainers for these platforms.
|
||||
|
||||
Please keep this list in alphabetical order, and refer to the Linux kernel's
|
||||
MAINTAINER file for the description of section entries [1].
|
||||
|
||||
Note that OP-TEE development mainly occurs on GitHub [2] so this file should be
|
||||
used a bit differently compared to the Linux MAINTAINERS file:
|
||||
|
||||
1. GitHub accounts or team names may be given in square brackets, starting with
|
||||
an @ sign. For example, [@jbech-linaro] or [@OP-TEE/linaro].
|
||||
|
||||
2. Patches should generally be submitted as GitHub pull requests (more details
|
||||
in documentation/github.md). Therefore, please do NOT send patches to the
|
||||
e-mail addresses below. Maintainers normally are subscribed to GitHub
|
||||
notifications, so they should see your pull requests. If you need to 'ping'
|
||||
some maintainer, just mention his/her GitHub account in a comment in the pull
|
||||
request.
|
||||
|
||||
2. Bug reports and questions should be posted to the GitHub project as well
|
||||
(use the "Issues" tab).
|
||||
|
||||
3. The last entry ("THE REST") lists the overall maintainers (M:) and the
|
||||
members of the Linaro Security Working Group who provide reviews on a regular
|
||||
basis (R:).
|
||||
|
||||
[1] https://www.kernel.org/doc/linux/MAINTAINERS
|
||||
[2] https://github.com/OP-TEE/optee_os
|
||||
|
||||
----------
|
||||
|
||||
ARM Foundation FVP
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: [@OP-TEE/plat-vexpress]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-vexpress/
|
||||
|
||||
ARM Juno
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: [@OP-TEE/plat-vexpress]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-vexpress/
|
||||
|
||||
AllWinner sun8i H2+
|
||||
R: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> [@grandpaul]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-sunxi/
|
||||
|
||||
AllWinner sun50i A64
|
||||
R: Amit Singh Tomar <amittomer25@gmail.com> [@Amit-Radur]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-sunxi/
|
||||
|
||||
AmLogic AXG (A113D)
|
||||
R: Carlo Caione <ccaione@baylibre.com> [@carlocaione]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-amlogic/
|
||||
|
||||
Atmel ATSAMA5D2-XULT
|
||||
R: Akshay Bhat <akshay.bhat@timesys.com> [@nodeax]
|
||||
R: [@OP-TEE/plat-sam]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-sam/
|
||||
|
||||
Broadcom ns3
|
||||
R: Sandeep Tripathy <sandeep.tripathy@broadcom.com> [@sandeepbrcm]
|
||||
L: Broadcom <bcm-optee-feedback-list.pdl@broadcom.com>
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-bcm/
|
||||
|
||||
Core Drivers I2C
|
||||
R: Jorge Ramirez <jorge@foundries.io>
|
||||
S: Maintained
|
||||
F: core/drivers/imx_i2c.c
|
||||
|
||||
Core Drivers RNGB
|
||||
R: Jorge Ramirez <jorge@foundries.io>
|
||||
S: Maintained
|
||||
F: core/drivers/imx_rngb.c
|
||||
|
||||
Core Drivers SE050
|
||||
R: Jorge Ramirez <jorge@foundries.io>
|
||||
S: Maintained
|
||||
F: core/drivers/crypto/se050
|
||||
|
||||
Core Drivers ZYNQMP
|
||||
R: Jorge Ramirez <jorge@foundries.io> [@ldts]
|
||||
S: Maintained
|
||||
F: core/drivers/zynqmp_csu_aes.c
|
||||
F: core/drivers/zynqmp_csu_puf.c
|
||||
F: core/drivers/zynqmp_csudma.c
|
||||
F: core/drivers/zynqmp_huk.c
|
||||
F: core/drivers/zynqmp_pm.c
|
||||
|
||||
Function Graph Tracer (ftrace) support
|
||||
R: Sumit Garg <sumit.garg@linaro.org> [@b49020]
|
||||
S: Maintained
|
||||
F: ldelf/ftrace.c
|
||||
F: lib/libutils/ext/ftrace/
|
||||
|
||||
HiSilicon D02
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-d02/
|
||||
|
||||
HiSilicon HiKey (Kirin 620), HiKey960 (Kirin 960)
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: [@OP-TEE/plat-hikey]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-hikey/
|
||||
|
||||
HiSilicon Poplar (Hi3798C V200)
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: Igor Opaniuk <igor.opaniuk@gmail.com> [@igoropaniuk]
|
||||
R: [@OP-TEE/plat-poplar]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-poplar/
|
||||
|
||||
Hisilicon Hi3519AV100 family
|
||||
R: Jerome Forissier <jerome@forissier.org> [@jforissier]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-hisilicon
|
||||
|
||||
Marvell Armada 70x0, Armada 80x0, Armada 3700, OcteonTX2 CN96XX, OcteonTX2 CFN95XX, OcteonTX2 CN98XX
|
||||
R: Tao Lu <taolu@marvell.com> [@taovcu]
|
||||
R: [@OP-TEE/plat-ls]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-marvell/
|
||||
|
||||
MediaTek MT8173 EVB
|
||||
S: Orphan
|
||||
F: core/arch/arm/plat-mediatek/
|
||||
|
||||
NXP LS1021A, LS1043A-RDB, LS1046A-RDB, LS1012A-RDB, LS1012A-FRWY, LS1028A-RDB, LS1088A-RDB, LS2088A-RDB, LX2160A-RDB, LX2160A-QDS
|
||||
R: Pankaj Gupta <pankaj.gupta@nxp.com> [@pangupta]
|
||||
R: Sahil Malhotra <sahil.malhotra@nxp.com> [@sahilnxp]
|
||||
R: [@OP-TEE/plat-ls]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-ls/
|
||||
|
||||
Core Drivers I2C
|
||||
R: Sahil Malhotra <sahil.malhotra@nxp.com>
|
||||
S: Maintained
|
||||
F: core/drivers/ls_i2c.c
|
||||
|
||||
LS Core Drivers GPIO
|
||||
R: Sahil Malhotra <sahil.malhotra@nxp.com>
|
||||
S: Maintained
|
||||
F: core/drivers/ls_gpio.c
|
||||
|
||||
LS Core Drivers DSPI
|
||||
R: Sahil Malhotra <sahil.malhotra@nxp.com>
|
||||
S: Maintained
|
||||
F: core/drivers/ls_dspi.c
|
||||
|
||||
NXP (Freescale) i.MX family
|
||||
R: Peng Fan <peng.fan@nxp.com> [@MrVan]
|
||||
R: Cedric Neveux <cedric.neveux@nxp.com> [@cneveux]
|
||||
R: Silvano Di Ninno <silvano.dininno@nxp.com> [@sdininno]
|
||||
R: Clement Faure <clement.faure@nxp.com> [@clementfaure]
|
||||
R: [@OP-TEE/plat-imx]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-imx/
|
||||
F: core/arch/arm/plat-imx/registers
|
||||
F: core/drivers/crypto/caam/
|
||||
|
||||
Clock driver framework
|
||||
R: Clement Leger <clement.leger@bootlin.com> [@clementleger]
|
||||
S: Maintained
|
||||
F: core/drivers/clk/
|
||||
|
||||
Crypto driver interface
|
||||
R: Cedric Neveux <cedric.neveux@nxp.com> [@cneveux]
|
||||
R: Silvano Di Ninno <silvano.dininno@nxp.com> [@sdininno]
|
||||
R: Clement Faure <clement.faure@nxp.com> [@clementfaure]
|
||||
S: Maintained
|
||||
F: core/drivers/crypto/
|
||||
|
||||
NXP (Freescale) i.MX7 WaRP7
|
||||
R: Peng Fan <peng.fan@nxp.com> [@MrVan]
|
||||
R: Bryan O'Donoghue <bryan.odonoghue@linaro.org> [@bryanodonoghue]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-imx/conf.mk
|
||||
|
||||
PKCS#11 TA
|
||||
R: Etienne Carriere <etienne.carriere@st.com> [@etienne-lms]
|
||||
R: Ruchika Gupta <ruchika.gupta@linaro.org> [@ruchi393]
|
||||
R: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> [@vesajaaskelainen]
|
||||
S: Maintained
|
||||
F: ta/pkcs11
|
||||
|
||||
QEMU (32 and 64 bits)
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-vexpress/
|
||||
|
||||
Raspberry Pi3
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: [@OP-TEE/rpi3]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-rpi3/
|
||||
|
||||
Renesas RCAR
|
||||
R: Volodymyr Babchuk <vlad.babchuk@gmail.com> [@lorc]
|
||||
R: [@OP-TEE/plat-rcar]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-rcar/
|
||||
|
||||
Renesas RZ/G2
|
||||
R: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> [@prabhakarlad]
|
||||
R: Biju Das <biju.das.jz@bp.renesas.com> [@bijucdas]
|
||||
R: [@OP-TEE/plat-rzg]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-rzg/
|
||||
|
||||
Renesas RZ/N1
|
||||
R: Sumit Garg <sumit.garg@linaro.org> [@b49020]
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-rzn1/
|
||||
|
||||
Rockchip RK322X
|
||||
R: Rockchip <op-tee@rock-chips.com>
|
||||
R: [@OP-TEE/plat-rockchip]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-rockchip/
|
||||
|
||||
Socionext DeveloperBox (Synquacer SC2A11)
|
||||
R: Sumit Garg <sumit.garg@linaro.org> [@b49020]
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-synquacer/
|
||||
|
||||
Socionext UniPhier
|
||||
R: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
|
||||
R: [@96boards-akebi96/optee]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-uniphier/
|
||||
|
||||
Spreadtrum SC9860
|
||||
R: Aijun Sun <aijun.sun@unisoc.com>
|
||||
R: [@OP-TEE/plat-sprd]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-sprd/
|
||||
|
||||
STMicroelectronics b2260-h410, b2120-h310/h410
|
||||
R: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: [@OP-TEE/plat-stm]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-stm/
|
||||
|
||||
STMicroelectronics stm32mp1
|
||||
R: Etienne Carriere <etienne.carriere@st.com>
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-stm32mp1/
|
||||
|
||||
Texas Instruments AM43xx, AM57xx, DRA7xx, AM65x, J721E
|
||||
R: [@OP-TEE/plat-ti]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-ti/
|
||||
F: core/arch/arm/plat-k3/
|
||||
|
||||
Xilinx Zynq 7000 ZC702 Board
|
||||
R: Yan Yan <yan.yan@windriver.com>
|
||||
R: Feng Yu <Yu.Feng@windriver.com>
|
||||
R: [@OP-TEE/plat-zynq7k]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-zynq7k/
|
||||
|
||||
Xilinx Zynq UltraScale+ MPSOC
|
||||
R: Ricardo Salveti <ricardo@foundries.io> [@ricardosalveti]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-zynqmp/
|
||||
|
||||
Virtualization support
|
||||
R: Volodymyr Babchuk <vlad.babchuk@gmail.com>
|
||||
S: Maintained
|
||||
F: core/arch/arm/kernel/virtualization.c
|
||||
|
||||
Aspeed AST2600
|
||||
R: Chia-Wei Wang <chiawei_wang@aspeedtech.com> [@ChiaweiW]
|
||||
R: Neal Liu <neal_liu@aspeedtech.com> [@Neal-liu]
|
||||
R: [@OP-TEE/plat-aspeed]
|
||||
S: Maintained
|
||||
F: core/arch/arm/plat-aspeed/
|
||||
|
||||
THE REST
|
||||
M: Joakim Bech <joakim.bech@linaro.org> [@jbech-linaro]
|
||||
M: Jens Wiklander <jens.wiklander@linaro.org> [@jenswi-linaro]
|
||||
M: Jerome Forissier <jerome@forissier.org> [@jforissier]
|
||||
M: Linaro <op-tee@linaro.org> [@OP-TEE/linaro]
|
||||
R: Etienne Carriere <etienne.carriere@linaro.org> [@etienne-lms]
|
||||
R: Victor Chong <victor.chong@linaro.org> [@vchong]
|
||||
L: tee-dev@lists.linaro.org
|
||||
S: Maintained
|
||||
F: *
|
||||
F: */
|
||||
124
optee/optee_os/Makefile
Normal file
124
optee/optee_os/Makefile
Normal file
@@ -0,0 +1,124 @@
|
||||
SHELL = bash
|
||||
|
||||
# It can happen that a makefile calls us, which contains an 'export' directive
|
||||
# or the '.EXPORT_ALL_VARIABLES:' special target. In this case, all the make
|
||||
# variables are added to the environment for each line of the recipes, so that
|
||||
# any sub-makefile can use them.
|
||||
# We have observed this can cause issues such as 'Argument list too long'
|
||||
# errors as the shell runs out of memory.
|
||||
# Since this Makefile won't call any sub-makefiles, and since the commands do
|
||||
# not expect to implicitely obtain any make variable from the environment, we
|
||||
# can safely cancel this export mechanism. Unfortunately, it can't be done
|
||||
# globally, only by name. Let's unexport MAKEFILE_LIST which is by far the
|
||||
# biggest one due to our way of tracking dependencies and compile flags
|
||||
# (we include many *.cmd and *.d files).
|
||||
unexport MAKEFILE_LIST
|
||||
|
||||
# Automatically delete corrupt targets (file updated but recipe exits with a
|
||||
# nonzero status). Useful since a few recipes use shell redirection.
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
include mk/checkconf.mk
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
||||
.PHONY: mem_usage
|
||||
mem_usage:
|
||||
|
||||
# log and load eventual tee config file
|
||||
# path is absolute or relative to current source root directory.
|
||||
ifdef CFG_OPTEE_CONFIG
|
||||
$(info Loading OPTEE configuration file $(CFG_OPTEE_CONFIG))
|
||||
include $(CFG_OPTEE_CONFIG)
|
||||
endif
|
||||
|
||||
# If $(PLATFORM) is defined and contains a hyphen, parse it as
|
||||
# $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience
|
||||
ifneq (,$(findstring -,$(PLATFORM)))
|
||||
ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM))))
|
||||
$(foreach op,$(ops),$(eval override $(op)))
|
||||
endif
|
||||
|
||||
# Make these default for now
|
||||
$(call force,ARCH,arm)
|
||||
PLATFORM ?= vexpress
|
||||
# Default value for PLATFORM_FLAVOR is set in plat-$(PLATFORM)/conf.mk
|
||||
ifeq ($O,)
|
||||
O := out
|
||||
out-dir := $(O)/$(ARCH)-plat-$(PLATFORM)
|
||||
else
|
||||
out-dir := $(O)
|
||||
endif
|
||||
|
||||
arch_$(ARCH) := y
|
||||
|
||||
ifneq ($V,1)
|
||||
q := @
|
||||
cmd-echo := true
|
||||
cmd-echo-silent := echo
|
||||
else
|
||||
q :=
|
||||
cmd-echo := echo
|
||||
cmd-echo-silent := true
|
||||
endif
|
||||
|
||||
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
|
||||
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
|
||||
cmd-echo-silent := true
|
||||
endif
|
||||
else # make-3.8x
|
||||
ifneq ($(findstring s, $(MAKEFLAGS)),)
|
||||
cmd-echo-silent := true
|
||||
endif
|
||||
endif
|
||||
|
||||
SCRIPTS_DIR := scripts
|
||||
|
||||
include core/core.mk
|
||||
|
||||
# Platform/arch config is supposed to assign the targets
|
||||
ta-targets ?= invalid
|
||||
default-user-ta-target ?= $(firstword $(ta-targets))
|
||||
|
||||
ifeq ($(CFG_WITH_USER_TA),y)
|
||||
include ldelf/ldelf.mk
|
||||
define build-ta-target
|
||||
ta-target := $(1)
|
||||
include ta/ta.mk
|
||||
endef
|
||||
$(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
|
||||
|
||||
# Build user TAs included in this git
|
||||
define build-user-ta
|
||||
ta-mk-file := $(1)
|
||||
include ta/mk/build-user-ta.mk
|
||||
endef
|
||||
$(foreach t, $(sort $(wildcard ta/*/user_ta.mk)), $(eval $(call build-user-ta,$(t))))
|
||||
endif
|
||||
|
||||
include mk/cleandirs.mk
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@$(cmd-echo-silent) ' CLEAN $(out-dir)'
|
||||
$(call do-rm-f, $(cleanfiles))
|
||||
${q}dirs="$(call cleandirs-for-rmdir)"; if [ "$$dirs" ]; then $(RMDIR) $$dirs; fi
|
||||
@if [ "$(out-dir)" != "$(O)" ]; then $(cmd-echo-silent) ' CLEAN $(O)'; fi
|
||||
${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi
|
||||
|
||||
.PHONY: cscope
|
||||
cscope:
|
||||
@echo ' CSCOPE .'
|
||||
${q}rm -f cscope.*
|
||||
${q}find $(PWD) -name "*.[chSs]" | grep -v export-ta_ > cscope.files
|
||||
${q}cscope -b -q -k
|
||||
|
||||
.PHONY: checkpatch checkpatch-staging checkpatch-working
|
||||
checkpatch: checkpatch-staging checkpatch-working
|
||||
|
||||
checkpatch-working:
|
||||
${q}./scripts/checkpatch.sh
|
||||
|
||||
checkpatch-staging:
|
||||
${q}./scripts/checkpatch.sh --cached
|
||||
7
optee/optee_os/README.md
Normal file
7
optee/optee_os/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# OP-TEE Trusted OS
|
||||
This git contains source code for the secure side implementation of OP-TEE
|
||||
project.
|
||||
|
||||
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
|
||||
|
||||
// OP-TEE core maintainers
|
||||
357
optee/optee_os/core/arch/arm/arm.mk
Normal file
357
optee/optee_os/core/arch/arm/arm.mk
Normal file
@@ -0,0 +1,357 @@
|
||||
# Setup compiler for the core module
|
||||
ifeq ($(CFG_ARM64_core),y)
|
||||
arch-bits-core := 64
|
||||
else
|
||||
arch-bits-core := 32
|
||||
endif
|
||||
CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core))
|
||||
COMPILER_core := $(COMPILER)
|
||||
include mk/$(COMPILER_core).mk
|
||||
|
||||
# Defines the cc-option macro using the compiler set for the core module
|
||||
include mk/cc-option.mk
|
||||
|
||||
# Size of emulated TrustZone protected SRAM, 448 kB.
|
||||
# Only applicable when paging is enabled.
|
||||
CFG_CORE_TZSRAM_EMUL_SIZE ?= 458752
|
||||
|
||||
ifneq ($(CFG_LPAE_ADDR_SPACE_SIZE),)
|
||||
$(warning Error: CFG_LPAE_ADDR_SPACE_SIZE is not supported any longer)
|
||||
$(error Error: Please use CFG_LPAE_ADDR_SPACE_BITS instead)
|
||||
endif
|
||||
|
||||
CFG_LPAE_ADDR_SPACE_BITS ?= 32
|
||||
|
||||
CFG_MMAP_REGIONS ?= 13
|
||||
CFG_RESERVED_VASPACE_SIZE ?= (1024 * 1024 * 10)
|
||||
|
||||
ifeq ($(CFG_ARM64_core),y)
|
||||
CFG_KERN_LINKER_FORMAT ?= elf64-littleaarch64
|
||||
CFG_KERN_LINKER_ARCH ?= aarch64
|
||||
# TCR_EL1.IPS needs to be initialized according to the largest physical
|
||||
# address that we need to map.
|
||||
# Physical address size
|
||||
# 32 bits, 4GB.
|
||||
# 36 bits, 64GB.
|
||||
# (etc.)
|
||||
CFG_CORE_ARM64_PA_BITS ?= 32
|
||||
else
|
||||
ifeq ($(CFG_ARM32_core),y)
|
||||
CFG_KERN_LINKER_FORMAT ?= elf32-littlearm
|
||||
CFG_KERN_LINKER_ARCH ?= arm
|
||||
else
|
||||
$(error Error: CFG_ARM64_core or CFG_ARM32_core should be defined)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CFG_TA_FLOAT_SUPPORT),y)
|
||||
# Use hard-float for floating point support in user TAs instead of
|
||||
# soft-float
|
||||
CFG_WITH_VFP ?= y
|
||||
ifeq ($(CFG_ARM64_core),y)
|
||||
# AArch64 has no fallback to soft-float
|
||||
$(call force,CFG_WITH_VFP,y)
|
||||
endif
|
||||
ifeq ($(CFG_WITH_VFP),y)
|
||||
arm64-platform-hard-float-enabled := y
|
||||
ifneq ($(CFG_TA_ARM32_NO_HARD_FLOAT_SUPPORT),y)
|
||||
arm32-platform-hard-float-enabled := y
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Adds protection against CVE-2017-5715 also know as Spectre
|
||||
# (https://spectreattack.com)
|
||||
# See also https://developer.arm.com/-/media/Files/pdf/Cache_Speculation_Side-channels.pdf
|
||||
# Variant 2
|
||||
CFG_CORE_WORKAROUND_SPECTRE_BP ?= y
|
||||
# Same as CFG_CORE_WORKAROUND_SPECTRE_BP but targeting exceptions from
|
||||
# secure EL0 instead of non-secure world.
|
||||
CFG_CORE_WORKAROUND_SPECTRE_BP_SEC ?= $(CFG_CORE_WORKAROUND_SPECTRE_BP)
|
||||
|
||||
# Adds protection against a tool like Cachegrab
|
||||
# (https://github.com/nccgroup/cachegrab), which uses non-secure interrupts
|
||||
# to prime and later analyze the L1D, L1I and BTB caches to gain
|
||||
# information from secure world execution.
|
||||
CFG_CORE_WORKAROUND_NSITR_CACHE_PRIME ?= y
|
||||
ifeq ($(CFG_CORE_WORKAROUND_NSITR_CACHE_PRIME),y)
|
||||
$(call force,CFG_CORE_WORKAROUND_SPECTRE_BP,y,Required by CFG_CORE_WORKAROUND_NSITR_CACHE_PRIME)
|
||||
endif
|
||||
|
||||
CFG_CORE_RWDATA_NOEXEC ?= y
|
||||
CFG_CORE_RODATA_NOEXEC ?= n
|
||||
ifeq ($(CFG_CORE_RODATA_NOEXEC),y)
|
||||
$(call force,CFG_CORE_RWDATA_NOEXEC,y)
|
||||
endif
|
||||
# 'y' to set the Alignment Check Enable bit in SCTLR/SCTLR_EL1, 'n' to clear it
|
||||
CFG_SCTLR_ALIGNMENT_CHECK ?= n
|
||||
|
||||
ifeq ($(CFG_CORE_LARGE_PHYS_ADDR),y)
|
||||
$(call force,CFG_WITH_LPAE,y)
|
||||
endif
|
||||
|
||||
# SPMC configuration "S-EL1 SPMC" where SPM Core is implemented at S-EL1,
|
||||
# that is, OP-TEE.
|
||||
ifeq ($(CFG_CORE_SEL1_SPMC),y)
|
||||
$(call force,CFG_CORE_FFA,y)
|
||||
$(call force,CFG_CORE_SEL2_SPMC,n)
|
||||
endif
|
||||
# SPMC configuration "S-EL2 SPMC" where SPM Core is implemented at S-EL2,
|
||||
# that is, the hypervisor sandboxing OP-TEE
|
||||
ifeq ($(CFG_CORE_SEL2_SPMC),y)
|
||||
$(call force,CFG_CORE_FFA,y)
|
||||
endif
|
||||
|
||||
# Unmaps all kernel mode code except the code needed to take exceptions
|
||||
# from user space and restore kernel mode mapping again. This gives more
|
||||
# strict control over what is accessible while in user mode.
|
||||
# Addresses CVE-2017-5715 (aka Meltdown) known to affect Arm Cortex-A75
|
||||
CFG_CORE_UNMAP_CORE_AT_EL0 ?= y
|
||||
|
||||
# Initialize PMCR.DP to 1 to prohibit cycle counting in secure state, and
|
||||
# save/restore PMCR during world switch.
|
||||
CFG_SM_NO_CYCLE_COUNTING ?= y
|
||||
|
||||
|
||||
# CFG_CORE_ASYNC_NOTIF_GIC_INTID is defined by the platform to some free
|
||||
# interrupt. Setting it to a non-zero number enables support for using an
|
||||
# Arm-GIC to notify normal world. This config variable should use a value
|
||||
# larger the 32 to make it of the type SPI.
|
||||
# Note that asynchronous notifactions must be enabled with
|
||||
# CFG_CORE_ASYNC_NOTIF=y for this variable to be used.
|
||||
CFG_CORE_ASYNC_NOTIF_GIC_INTID ?= 0
|
||||
|
||||
ifeq ($(CFG_ARM32_core),y)
|
||||
# Configration directive related to ARMv7 optee boot arguments.
|
||||
# CFG_PAGEABLE_ADDR: if defined, forces pageable data physical address.
|
||||
# CFG_NS_ENTRY_ADDR: if defined, forces NS World physical entry address.
|
||||
# CFG_DT_ADDR: if defined, forces Device Tree data physical address.
|
||||
endif
|
||||
|
||||
core-platform-cppflags += -I$(arch-dir)/include
|
||||
core-platform-subdirs += \
|
||||
$(addprefix $(arch-dir)/, kernel crypto mm tee) $(platform-dir)
|
||||
|
||||
ifneq ($(CFG_WITH_ARM_TRUSTED_FW),y)
|
||||
core-platform-subdirs += $(arch-dir)/sm
|
||||
endif
|
||||
|
||||
arm64-platform-cppflags += -DARM64=1 -D__LP64__=1
|
||||
arm32-platform-cppflags += -DARM32=1 -D__ILP32__=1
|
||||
|
||||
platform-cflags-generic ?= -ffunction-sections -fdata-sections -pipe
|
||||
platform-aflags-generic ?= -pipe
|
||||
|
||||
arm32-platform-aflags += -marm
|
||||
|
||||
arm32-platform-cflags-no-hard-float ?= -mfloat-abi=soft
|
||||
arm32-platform-cflags-hard-float ?= -mfloat-abi=hard -funsafe-math-optimizations
|
||||
arm32-platform-cflags-generic-thumb ?= -mthumb \
|
||||
-fno-short-enums -fno-common -mno-unaligned-access
|
||||
arm32-platform-cflags-generic-arm ?= -marm -fno-omit-frame-pointer -mapcs \
|
||||
-fno-short-enums -fno-common -mno-unaligned-access
|
||||
arm32-platform-aflags-no-hard-float ?=
|
||||
|
||||
arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
|
||||
arm64-platform-cflags-hard-float ?=
|
||||
arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,)
|
||||
|
||||
platform-cflags-optimization ?= -O$(CFG_CC_OPT_LEVEL)
|
||||
|
||||
ifeq ($(CFG_DEBUG_INFO),y)
|
||||
platform-cflags-debug-info ?= -g3
|
||||
platform-aflags-debug-info ?= -g
|
||||
endif
|
||||
|
||||
core-platform-cflags += $(platform-cflags-optimization)
|
||||
core-platform-cflags += $(platform-cflags-generic)
|
||||
core-platform-cflags += $(platform-cflags-debug-info)
|
||||
|
||||
core-platform-aflags += $(platform-aflags-generic)
|
||||
core-platform-aflags += $(platform-aflags-debug-info)
|
||||
|
||||
ifeq ($(CFG_CORE_ASLR),y)
|
||||
core-platform-cflags += -fpie
|
||||
endif
|
||||
|
||||
ifeq ($(CFG_CORE_BTI),y)
|
||||
bti-opt := $(call cc-option,-mbranch-protection=bti)
|
||||
ifeq (,$(bti-opt))
|
||||
$(error -mbranch-protection=bti not supported)
|
||||
endif
|
||||
core-platform-cflags += $(bti-opt)
|
||||
endif
|
||||
|
||||
ifeq ($(CFG_ARM64_core),y)
|
||||
core-platform-cppflags += $(arm64-platform-cppflags)
|
||||
core-platform-cflags += $(arm64-platform-cflags)
|
||||
core-platform-cflags += $(arm64-platform-cflags-generic)
|
||||
core-platform-cflags += $(arm64-platform-cflags-no-hard-float)
|
||||
core-platform-aflags += $(arm64-platform-aflags)
|
||||
else
|
||||
core-platform-cppflags += $(arm32-platform-cppflags)
|
||||
core-platform-cflags += $(arm32-platform-cflags)
|
||||
core-platform-cflags += $(arm32-platform-cflags-no-hard-float)
|
||||
ifeq ($(CFG_UNWIND),y)
|
||||
core-platform-cflags += -funwind-tables
|
||||
endif
|
||||
ifeq ($(CFG_SYSCALL_FTRACE),y)
|
||||
core-platform-cflags += $(arm32-platform-cflags-generic-arm)
|
||||
else
|
||||
core-platform-cflags += $(arm32-platform-cflags-generic-thumb)
|
||||
endif
|
||||
core-platform-aflags += $(core_arm32-platform-aflags)
|
||||
core-platform-aflags += $(arm32-platform-aflags)
|
||||
endif
|
||||
|
||||
# Provide default supported-ta-targets if not set by the platform config
|
||||
ifeq (,$(supported-ta-targets))
|
||||
supported-ta-targets = ta_arm32
|
||||
ifeq ($(CFG_ARM64_core),y)
|
||||
supported-ta-targets += ta_arm64
|
||||
endif
|
||||
endif
|
||||
|
||||
ta-targets := $(if $(CFG_USER_TA_TARGETS),$(filter $(supported-ta-targets),$(CFG_USER_TA_TARGETS)),$(supported-ta-targets))
|
||||
unsup-targets := $(filter-out $(ta-targets),$(CFG_USER_TA_TARGETS))
|
||||
ifneq (,$(unsup-targets))
|
||||
$(error CFG_USER_TA_TARGETS contains unsupported value(s): $(unsup-targets). Valid values: $(supported-ta-targets))
|
||||
endif
|
||||
|
||||
ifneq ($(filter ta_arm32,$(ta-targets)),)
|
||||
# Variables for ta-target/sm "ta_arm32"
|
||||
CFG_ARM32_ta_arm32 := y
|
||||
arch-bits-ta_arm32 := 32
|
||||
ta_arm32-platform-cppflags += $(arm32-platform-cppflags)
|
||||
ta_arm32-platform-cflags += $(arm32-platform-cflags)
|
||||
ta_arm32-platform-cflags += $(platform-cflags-optimization)
|
||||
ta_arm32-platform-cflags += $(platform-cflags-debug-info)
|
||||
ta_arm32-platform-cflags += -fpic
|
||||
|
||||
# Thumb mode doesn't support function graph tracing due to missing
|
||||
# frame pointer support required to trace function call chain. So
|
||||
# rather compile in ARM mode if function tracing is enabled.
|
||||
ifeq ($(CFG_FTRACE_SUPPORT),y)
|
||||
ta_arm32-platform-cflags += $(arm32-platform-cflags-generic-arm)
|
||||
else
|
||||
ta_arm32-platform-cflags += $(arm32-platform-cflags-generic-thumb)
|
||||
endif
|
||||
|
||||
ifeq ($(arm32-platform-hard-float-enabled),y)
|
||||
ta_arm32-platform-cflags += $(arm32-platform-cflags-hard-float)
|
||||
else
|
||||
ta_arm32-platform-cflags += $(arm32-platform-cflags-no-hard-float)
|
||||
endif
|
||||
ifeq ($(CFG_UNWIND),y)
|
||||
ta_arm32-platform-cflags += -funwind-tables
|
||||
endif
|
||||
ta_arm32-platform-aflags += $(platform-aflags-generic)
|
||||
ta_arm32-platform-aflags += $(platform-aflags-debug-info)
|
||||
ta_arm32-platform-aflags += $(arm32-platform-aflags)
|
||||
|
||||
ta_arm32-platform-cxxflags += -fpic
|
||||
ta_arm32-platform-cxxflags += $(arm32-platform-cxxflags)
|
||||
ta_arm32-platform-cxxflags += $(platform-cflags-optimization)
|
||||
ta_arm32-platform-cxxflags += $(platform-cflags-debug-info)
|
||||
|
||||
ifeq ($(arm32-platform-hard-float-enabled),y)
|
||||
ta_arm32-platform-cxxflags += $(arm32-platform-cflags-hard-float)
|
||||
else
|
||||
ta_arm32-platform-cxxflags += $(arm32-platform-cflags-no-hard-float)
|
||||
endif
|
||||
|
||||
ta-mk-file-export-vars-ta_arm32 += CFG_ARM32_ta_arm32
|
||||
ta-mk-file-export-vars-ta_arm32 += ta_arm32-platform-cppflags
|
||||
ta-mk-file-export-vars-ta_arm32 += ta_arm32-platform-cflags
|
||||
ta-mk-file-export-vars-ta_arm32 += ta_arm32-platform-aflags
|
||||
ta-mk-file-export-vars-ta_arm32 += ta_arm32-platform-cxxflags
|
||||
|
||||
ta-mk-file-export-add-ta_arm32 += CROSS_COMPILE ?= arm-linux-gnueabihf-_nl_
|
||||
ta-mk-file-export-add-ta_arm32 += CROSS_COMPILE32 ?= $$(CROSS_COMPILE)_nl_
|
||||
ta-mk-file-export-add-ta_arm32 += CROSS_COMPILE_ta_arm32 ?= $$(CROSS_COMPILE32)_nl_
|
||||
ta-mk-file-export-add-ta_arm32 += COMPILER ?= gcc_nl_
|
||||
ta-mk-file-export-add-ta_arm32 += COMPILER_ta_arm32 ?= $$(COMPILER)_nl_
|
||||
ta-mk-file-export-add-ta_arm32 += PYTHON3 ?= python3_nl_
|
||||
endif
|
||||
|
||||
ifneq ($(filter ta_arm64,$(ta-targets)),)
|
||||
# Variables for ta-target/sm "ta_arm64"
|
||||
CFG_ARM64_ta_arm64 := y
|
||||
arch-bits-ta_arm64 := 64
|
||||
ta_arm64-platform-cppflags += $(arm64-platform-cppflags)
|
||||
ta_arm64-platform-cflags += $(arm64-platform-cflags)
|
||||
ta_arm64-platform-cflags += $(platform-cflags-optimization)
|
||||
ta_arm64-platform-cflags += $(platform-cflags-debug-info)
|
||||
ta_arm64-platform-cflags += -fpic
|
||||
ta_arm64-platform-cflags += $(arm64-platform-cflags-generic)
|
||||
ifeq ($(arm64-platform-hard-float-enabled),y)
|
||||
ta_arm64-platform-cflags += $(arm64-platform-cflags-hard-float)
|
||||
else
|
||||
ta_arm64-platform-cflags += $(arm64-platform-cflags-no-hard-float)
|
||||
endif
|
||||
ta_arm64-platform-aflags += $(platform-aflags-generic)
|
||||
ta_arm64-platform-aflags += $(platform-aflags-debug-info)
|
||||
ta_arm64-platform-aflags += $(arm64-platform-aflags)
|
||||
|
||||
ta_arm64-platform-cxxflags += -fpic
|
||||
ta_arm64-platform-cxxflags += $(platform-cflags-optimization)
|
||||
ta_arm64-platform-cxxflags += $(platform-cflags-debug-info)
|
||||
|
||||
ifeq ($(CFG_TA_BTI),y)
|
||||
bti-ta-opt := $(call cc-option,-mbranch-protection=bti)
|
||||
ifeq (,$(bti-ta-opt))
|
||||
$(error -mbranch-protection=bti not supported)
|
||||
endif
|
||||
ta_arm64-platform-cflags += $(bti-ta-opt)
|
||||
endif
|
||||
|
||||
ta-mk-file-export-vars-ta_arm64 += CFG_ARM64_ta_arm64
|
||||
ta-mk-file-export-vars-ta_arm64 += ta_arm64-platform-cppflags
|
||||
ta-mk-file-export-vars-ta_arm64 += ta_arm64-platform-cflags
|
||||
ta-mk-file-export-vars-ta_arm64 += ta_arm64-platform-aflags
|
||||
ta-mk-file-export-vars-ta_arm64 += ta_arm64-platform-cxxflags
|
||||
|
||||
ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE64 ?= $$(CROSS_COMPILE)_nl_
|
||||
ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE_ta_arm64 ?= $$(CROSS_COMPILE64)_nl_
|
||||
ta-mk-file-export-add-ta_arm64 += COMPILER ?= gcc_nl_
|
||||
ta-mk-file-export-add-ta_arm64 += COMPILER_ta_arm64 ?= $$(COMPILER)_nl_
|
||||
ta-mk-file-export-add-ta_arm64 += PYTHON3 ?= python3_nl_
|
||||
endif
|
||||
|
||||
# Set cross compiler prefix for each TA target
|
||||
$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm)))))
|
||||
|
||||
arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt
|
||||
arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h
|
||||
arm32-sysregs-$(arm32-sysreg-txt)-s := arm32_sysreg.S
|
||||
arm32-sysregs += $(arm32-sysreg-txt)
|
||||
|
||||
ifeq ($(CFG_ARM_GICV3),y)
|
||||
arm32-gicv3-sysreg-txt = core/arch/arm/kernel/arm32_gicv3_sysreg.txt
|
||||
arm32-sysregs-$(arm32-gicv3-sysreg-txt)-h := arm32_gicv3_sysreg.h
|
||||
arm32-sysregs-$(arm32-gicv3-sysreg-txt)-s := arm32_gicv3_sysreg.S
|
||||
arm32-sysregs += $(arm32-gicv3-sysreg-txt)
|
||||
endif
|
||||
|
||||
arm32-sysregs-out := $(out-dir)/$(sm)/include/generated
|
||||
|
||||
define process-arm32-sysreg
|
||||
FORCE-GENSRC$(sm): $$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-h)
|
||||
cleanfiles := $$(cleanfiles) $$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-h)
|
||||
|
||||
$$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-h): $(1) scripts/arm32_sysreg.py
|
||||
@$(cmd-echo-silent) ' GEN $$@'
|
||||
$(q)mkdir -p $$(dir $$@)
|
||||
$(q)scripts/arm32_sysreg.py --guard __$$(arm32-sysregs-$(1)-h) \
|
||||
< $$< > $$@
|
||||
|
||||
FORCE-GENSRC$(sm): $$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-s)
|
||||
cleanfiles := $$(cleanfiles) $$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-s)
|
||||
|
||||
$$(arm32-sysregs-out)/$$(arm32-sysregs-$(1)-s): $(1) scripts/arm32_sysreg.py
|
||||
@$(cmd-echo-silent) ' GEN $$@'
|
||||
$(q)mkdir -p $$(dir $$@)
|
||||
$(q)scripts/arm32_sysreg.py --s_file < $$< > $$@
|
||||
endef #process-arm32-sysreg
|
||||
|
||||
$(foreach sr, $(arm32-sysregs), $(eval $(call process-arm32-sysreg,$(sr))))
|
||||
10
optee/optee_os/core/arch/arm/cpu/cortex-a15.mk
Normal file
10
optee/optee_os/core/arch/arm/cpu/cortex-a15.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
$(call force,CFG_ARM32_core,y)
|
||||
$(call force,CFG_ARM64_core,n)
|
||||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,y)
|
||||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y)
|
||||
arm32-platform-cpuarch := cortex-a15
|
||||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
# Program flow prediction may need manual enablement
|
||||
CFG_ENABLE_SCTLR_Z ?= y
|
||||
10
optee/optee_os/core/arch/arm/cpu/cortex-a5.mk
Normal file
10
optee/optee_os/core/arch/arm/cpu/cortex-a5.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
$(call force,CFG_ARM32_core,y)
|
||||
$(call force,CFG_ARM64_core,n)
|
||||
$(call force,CFG_WITH_LPAE,n)
|
||||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,n)
|
||||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,n)
|
||||
$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,n)
|
||||
arm32-platform-cpuarch := cortex-a5
|
||||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user