居高临下是什么意思| 无条件是什么意思| 绿豆汤为什么是红色的| 独在异乡为异客是什么节日| 上皮源性肿瘤什么意思| 血压高什么症状| 药品经营与管理学什么| 润滑油是什么| 开场白是什么意思| 载脂蛋白a1偏高是什么原因| 为什么吃荔枝会上火| cor是什么意思| 吃什么补白蛋白最快| est是什么意思| 毛囊炎是什么引起的| 周易和易经有什么区别| 心脾两虚是什么意思| 什么芦荟可以直接擦脸| suvmax是什么意思| 梦见蛇是什么征兆| 大红袍茶属于什么茶| 副高是什么意思| b1是什么意思| 护理专业是干什么的| 膝盖肿胀是什么原因| 铲垃圾的工具叫什么| 7.17是什么日子| 伯父是什么关系| 流鼻涕吃什么药好得快| 小腿抽筋吃什么药| 老花眼有什么症状| vs什么意思| yuri是什么意思| 大吉是什么意思| 什么是我的| 高中什么时候分文理科| 冬至说什么祝福语| 灵魂是什么意思| 生理期吃什么水果比较好| 宫腔积液吃什么药效果最好| 裤裙搭配什么上衣好看| 外伤挂什么科| 高血压吃什么| 天麻炖什么治疗头痛效果最好| 为什么洗头发时会掉很多头发| 宝宝流鼻涕吃什么药| 疑神疑鬼是什么意思| 劫色是什么意思| 啫啫煲为什么念jue| 肚子饱胀是什么原因| 额头和下巴长痘痘是什么原因| 夜半是什么时辰| 人体缺钾是什么原因引起的| 得瑟是什么意思| 十周年是什么婚| 老人流口水是什么原因| 清创是什么意思| 放屁是什么原因| 民间故事有什么| 8月1日是什么节| 什么车不能开| 看客是什么意思| 云母是什么东西| 寒气和湿气有什么区别| fsw是什么意思| 刘亦菲是什么国籍| 病理活检是什么意思| 零反式脂肪是什么意思| 发福是什么意思| 污垢是什么意思| 四月十六日是什么星座| 补肾气吃什么药最好| 食物中毒用什么药| 男占258女占369什么意思| 抱大腿什么意思| 中国反导弹系统叫什么| 拉血是什么病| 什么叫凤凰男| 什么茶减肥| 什么是修养| 每天吃一个西红柿有什么好处| 上房是什么意思| 茜读什么| 喜气洋洋是什么意思| 雷同是什么意思| 尿路感染吃什么药| 2024年属什么| 精子长什么样| fps是什么意思| 卷帘大将是干什么的| 养成系是什么意思| 自慰是什么| 1月6号什么星座| img是什么意思| 甲亢是什么原因| 突然暴瘦是什么原因| 女生适合什么工作| 什么是用户名| 免疫固定电泳查什么的| 在什么情况下最容易怀孕| 面瘫什么意思| 自白是什么意思| 芪明颗粒主治什么病| 什么时候人流| 挚友是指什么的朋友| 肝经不通吃什么中成药| 阴性什么意思| 麸质是什么意思| 红糖不能和什么一起吃| 杭州什么宽带好又便宜| 吃莲子有什么好处| 艾司唑仑是什么药| 大脑记忆力下降是什么原因| davena手表什么牌子| 月经为什么推迟不来| 一国两制是什么时候提出的| 喝绿茶对身体有什么好处| 蟑螂喜欢什么环境| 须发早白吃什么中成药| 高胰岛素血症是什么病| 吃什么有营养| 男人吃海参有什么好处| 湿热带下是什么意思| 929是什么星座| 十余年是什么意思| 马叉虫是什么意思| 吃鹅蛋有什么好处和坏处| 阿魏酸是什么| hankook是什么轮胎| 怀孕肚皮痒是什么原因| 寂静的意思是什么| 酒酿是什么| 间作套种是什么意思| 胳膊肘往外拐是什么意思| 鼠和什么属相最配对| 射手座是什么性格| mico是什么意思| 鳄鱼属于什么动物| 羊水指数是什么意思| 血亏什么意思| 旗袍配什么鞋| 暨怎么读什么意思| 减肥可以吃什么零食| 人为什么有两个鼻孔| 开水烫了用什么紧急处理| 吃什么能补雌激素| 五行缺土是什么意思| 颞下颌关节紊乱挂什么科| 英雄是什么生肖| 低烧什么症状| 锆石是什么| 吃生姜对身体有什么好处| 胸膜增厚吃什么药| 天蝎什么象| 躺尸是什么意思| 2月9日什么星座| 什么水果蛋白质含量高| 水淀粉是什么粉| 托人办事送什么礼物较好| navy什么意思| 互联网是干什么的| 什么是思维| 甲状腺有血流信号是什么意思| 2021年是什么年| nsa是什么意思| 精液是什么组成的| 女性排卵期出血是什么原因| 皮夹克是什么意思| 95开头的是什么电话| 阴阳屏是什么意思| 舌苔厚发黄是什么原因| 瞬息万变是什么意思| 经常吃辣椒有什么好处和坏处| st股票是什么意思| 线性是什么意思| 尿检白细胞弱阳性是什么意思| 火加木是什么字| 一喝牛奶就拉肚子是什么原因| 依云矿泉水为什么贵| 不自爱是什么意思| 一切尽在不言中是什么意思| 鸡柳是什么肉| 骨髓不造血是什么病| 蓝色配什么颜色好看| 总胆固醇是什么意思| 什么是预防医学| 打破伤风不能吃什么| f4是什么意思| 九月十二号是什么星座| 河虾最爱吃什么食物| 好难过这不是我要的结果什么歌| 心烦意乱焦躁不安吃什么药| 为什么喝中药越来越胖| 雨淋棺材有什么说法| 什么时候测试怀孕最准确的| 警察为什么叫条子| touch是什么牌子| 六扇门是什么意思| 偏头疼是什么症状| 鸡的贵人是什么生肖| 间断是什么意思| 晋升是什么意思| 诺迪康胶囊治什么病| 种小麦用什么肥料好| 白色念珠菌是什么病| 奇异果是什么水果| 勃起功能障碍吃什么药| 四十不惑是什么意思| 总是打嗝是什么原因引起的| 什么是人乳头瘤病毒| 小孩子口臭是什么原因| 芭蕉和香蕉有什么区别| 百合有什么功效和作用| 女人绝经一般在什么年龄段| 音序是什么意思| 脖子粗是什么原因| 孩子低烧吃什么药| 罗西尼手表什么档次| vae是什么意思| 被蜈蚣咬了用什么药| 当医生需要什么条件| 年轻人白头发是什么原因引起的| 4月7号是什么星座| 葡萄套袋前打什么药| 孜孜不倦什么意思| 头上出汗多是什么原因| 做宫腔镜检查需要提前做什么准备| cba什么意思| 海绵体充血不足吃什么药| 什么充电宝可以带上飞机| 芋头不能和什么一起吃| 1984年属鼠的是什么命| 甲状腺结节吃什么药| 什么汤补气血效果最好| 皮癣用什么药膏| 胎停是什么原因造成的| dragon是什么意思| 7.10是什么日子| 什么油好| 面色少华是什么意思| 智字五行属什么| 眼镜蛇为什么叫眼镜蛇| 匀字五行属什么| 引力是什么| 落班是什么意思| 梦到扫地是什么意思| 性格好的女生是什么样| c k是什么牌子| 清洁度iv是什么意思| 梦见打老虎是什么预兆| 老舍原名是什么| 儿童荨麻疹吃什么药| 12月1日是什么意思| ckmb是什么意思| 看见蜈蚣有什么预兆| skechers是什么牌子| 失眠挂什么科室| 感冒吃什么菜| 小孩脸肿是什么原因引起的| 地主之谊是什么意思| 专辑是什么| lively是什么意思| 处女座幸运颜色是什么| 萎了是什么意思| 百度

Bug: 225203605

Clone this repo:
  1. fda4e68 Only allow TA downgrade when feature enabled am: 50e13101bc by David Drysdale · 5 months ago main master
  2. 50e1310 Only allow TA downgrade when feature enabled by David Drysdale · 5 months ago
  3. c07eaac Merge "Update CDDL for KeyMint v4" into main am: eb2497362e by David Drysdale · 6 months ago
  4. eb24973 Merge "Update CDDL for KeyMint v4" into main by David Drysdale · 6 months ago
  5. 3e08668 Update CDDL for KeyMint v4 by David Drysdale · 6 months ago

马英九:南海仲裁无实地调查 反成和平解决障碍

百度 文字是思想的外衣,正是文字的交流,才有了我们的思考与思想,理解与分享,不带一点杂质,不留一点遗憾。

This repository holds a reference implementation of the Android KeyMint HAL, including closely related HAL interfaces:

Repository Structure

The codebase is divided into a number of interdependent crates, as follows.

  • derive/: The kmr-derive crate holds proc macros used for deriving the kmr_wire::AsCborValue trait that is used for message serialization. This crate uses std, but is only required for the build process on the host, and does not produce code that runs on the device.
  • wire/: The kmr-wire crate holds the types that are used for communication between the userspace HAL service and the trusted application code that runs in the secure world, together with code for serializing and deserializing these types as CBOR. This crate is no_std but uses alloc.
  • common/: The kmr-common crate holds common code used throughout the KeyMint implementation. This includes metadata processing code, keyblob manipulation code, and also the abstractions used to represent access to underlying cryptographic functionality. This crate is no_std but uses alloc.
  • ta/: The kmr-ta crate holds the implementation of the KeyMint trusted application (TA), which is expected to run within the device's secure environment. This crate is no_std but uses alloc.
  • hal/: The kmr-hal crate holds the implementation of the HAL service for KeyMint, which is expected to run in the Android userspace and respond to Binder method invocations. This crate uses std (as it runs within Android, not within the more restricted secure environment).
  • boringssl/: The kmr-crypto-boring crate holds a BoringSSL-based implementation of the cryptographic abstractions from kmr-common. This crate is no_std (but using alloc); however, it relies on the Rust openssl crate for BoringSSL support, and that crate uses std.
  • tests/: The kmr-tests crate holds internal testing code.
SubdirCrate Namestd?Description
derivekmr-deriveYes (build-only)Proc macros for deriving the AsCborValue trait
wirekmr-wireNoTypes for HAL <-> TA communication
commonkmr-commonNoCommon code used throughout KeyMint/Rust
takmr-taNoTA implementation
halkmr-halYesHAL service implementation
boringsslkmr-crypto-boringYes (via openssl)Boring/OpenSSL-based implementations of crypto traits
testskmr-testsTests and test infrastructure

Porting to a Device

To use the Rust reference implementation on an Android device, implementations of various abstractions must be provided. This section describes the different areas of functionality that are required.

Rust Toolchain and Heap Allocator

Using the reference implementation requires a Rust toolchain that can target the secure environment. This toolchain (and any associated system libraries) must also support heap allocation (or an approximation thereof) via the alloc sysroot crate.

If the BoringSSL-based implementation of cryptographic functionality is used (see below), then some parts of the Rust std library must also be provided, in order to support the compilation of the openssl wrapper crate.

Checklist:

  • [ ] Rust toolchain that targets secure environment.
  • [ ] Heap allocation support via alloc.

HAL Service

KeyMint appears as a HAL service in userspace, and so an executable that registers for and services the KeyMint related HALs must be provided.

The implementation of this service is mostly provided by the kmr-hal crate, but a driver program must be provided that:

  • Performs start-of-day administration (e.g. logging setup, panic handler setup)
  • Creates a communication channel to the KeyMint TA.
  • Registers for the KeyMint HAL services.
  • Starts a thread pool to service requests.

The KeyMint HAL service (which runs in userspace) must communicate with the KeyMint TA (which runs in the secure environment). The reference implementation assumes the existence of a reliable, message-oriented, bi-directional communication channel for this, as encapsulated in the kmr_hal::SerializedChannel trait.

This trait has a single method execute(), which takes as input a request message (as bytes), and returns a response message (as bytes) or an error.

A (shared) instance of this trait must be provided to each of the kmr_hal::<interface>::Device types, which allows them to service Binder requests for the relevant interface by forwarding the requests to the TA as request/response pairs.

Checklist:

  • [ ] Implementation of HAL service, which registers for all HAL services.
  • [ ] SELinux policy for the HAL service.
  • [ ] init.rc configuration for the HAL service.
  • [ ] Implementation of SerializedChannel trait, for reliable HAL <-> TA communication.
  • [ ] Populate userspace environment information at start of day, using kmr_hal::send_hal_info().

The Cuttlefish implementation of the KeyMint/Rust HAL service provides an example of all of the above.

TA Driver

The kmr-ta crate provides the majority of the implementation of the KeyMint TA, but needs a driver program that:

  • Performs start-of-day administration (e.g. logging setup).
  • Populates initially required information (e.g. kmr_ta::HardwareInfo)
  • Creates a kmr_ta::KeyMintTa instance.
  • Configures the communication channel with the HAL service.
  • Configures the communication channel with the bootloader, which is required so that the current root-of-trust boot information can be received.
  • Holds the main loop that:
    • reads request messages from the channel(s)
    • passes request messages to kmr_ta::KeyMintTa::process(), receiving a response
    • writes response messages back to the relevant channel.

Checklist:

  • [ ] Implementation of main equivalent for TA, handling scheduling of incoming requests.
  • [ ] Implementation of communication channel between HAL service and TA.
  • [ ] Implementation of communication channel from bootloader to TA.
    • [ ] Trigger call to kmr_ta::KeyMintTa::set_boot_info on receipt of boot info.

The Cuttlefish implementation of the KeyMint/Rust TA provides an example of all of the above.

Bootloader

The bootloader is required to transmit root of trust and boot state information to the TA at start of day, so the TA can bind keys to the root of trust appropriately. The bootloader should fill out and send a kmr_wire::SetBootInfoRequest message to do this.

Checklist:

  • [ ] Implementation of communication channel from bootloader to TA.
  • [ ] Trigger for and population of kmr_wire::SetBootInfoRequest message.

Authenticators

KeyMint supports auth-bound keys that can only be used when an appropriate hardware authentication token (HAT) is presented. Secure authenticators such as Gatekeeper or Fingerprint produce these HATs, and validation of them requires that:

  • [ ] KeyMint and the authenticators share a common monotonic time source.
  • [ ] The authenticators have access to the (per-boot) HMAC signing key, via one of:
    • [ ] The authenticator retrieves the HMAC key from KeyMint via a communication mechanism that is completely internal to the secure environment, using KeyMintTa::get_hmac_key, or
    • [ ] The authenticator also implements the ISharedSecret HAL, and joins in the HMAC key derivation process. This requires that the authenticator have access to the pre-shared key that is used as the basis of the derivation process.

Cryptographic Abstractions

The KeyMint TA requires implementations for low-level cryptographic primitives to be provided, in the form of implementations of the various Rust traits held in kmr_common::crypto.

Note that some of these traits include methods that have default implementations, which means that an external implementation is not required (but can be provided if desired).

Checklist:

  • [ ] RNG implementation: Rng.
  • [ ] Constant time comparison implementation: ConstTimeEq.
  • [ ] AES implementation: Aes.
  • [ ] 3-DES implementation: Des.
  • [ ] HMAC implementation: Hmac.
  • [ ] RSA implementation: Rsa.
  • [ ] EC implementation, including curve 25519 support: Ec.
  • [ ] AES-CMAC or CKDF implementation: AesCmac, Ckdf.

BoringSSL-based implementations are available for all of the above.

Device Abstractions

The KeyMint TA requires implementations of traits that involve interaction with device-specific features or provisioned information, in the form of implementations of the various Rust traits held (mostly) in kmr_ta::device.

Checklist:

  • [ ] Secure time implementation (monotonic, shared with authenticators): kmr_common::crypto::MonotonicClock.
  • [ ] Root key(s) retrieval implementation: RetrieveKeyMaterial.
  • [ ] Attestation key / chain retrieval implementation (optional): RetrieveCertSigningInfo.
  • [ ] Attestation device ID retrieval implementation: RetrieveAttestationIds.
  • [ ] Retrieval of BCC and DICE artefacts: RetrieveRpcArtefacts.
  • [ ] Secure secret storage (for rollback-resistant keys) implementation (optional): SecureDeletionSecretManager.
  • [ ] Bootloader status retrieval (optional): BootloaderStatus.
  • [ ] Storage key wrapping integration (optional): StorageKeyWrapper.
  • [ ] Trusted user presence indication (optional): TrustedUserPresence.
  • [ ] Legacy keyblob format converter (optional): LegacyKeyHandler.

Supporting Older Versions of the KeyMint HAL

The reference implementation has the ability to behave like an earlier version of the KeyMint HAL for testing. To enable emulation of (say) KeyMint v1, link the HAL service against the libkmr_hal_v1 and libkmr_wire_hal_v1 targets rather than libkmr_hal / libkmr_wire, and ensure that the downgrade feature for the TA code is enabled.

The downgrade feature for the TA code (kmr-ta crate) should not be enabled for a production device.

炖鱼放什么调料 68岁属什么 伽马射线是什么 脚趾头发麻什么原因 缺锌吃什么食物和水果
小狗呕吐是什么原因 谵语是什么意思 所什么无什么 蜱虫是什么虫 西红柿和番茄有什么区别
肛周瘙痒是什么原因 卵泡刺激素高说明什么 中医内科主要看什么 脚环肿是什么原因引起的 向日葵花语是什么
皮肤黑穿什么颜色好看 泌乳素过高女性会出现什么症状 吃什么补血小板快 皮草是什么意思 万能受血者是什么血型
尿遁什么意思hcv7jop5ns6r.cn 10月12是什么星座hcv9jop0ns3r.cn 膏肓是什么意思hcv8jop8ns1r.cn 胎毒是什么hcv9jop7ns2r.cn 双手麻是什么原因hcv8jop1ns5r.cn
孕妇低血压什么补最快hcv9jop5ns4r.cn 营养不良会导致身体出现什么症状hcv7jop5ns2r.cn 良知是什么意思weuuu.com 别开生面是什么意思hcv9jop4ns8r.cn 主见是什么意思hcv7jop5ns5r.cn
朴树是什么树youbangsi.com julius手表是什么牌子hcv8jop0ns3r.cn 苏州机场叫什么hcv8jop3ns1r.cn 驿站是什么意思hcv8jop0ns0r.cn 复印病历需要什么证件hcv7jop9ns7r.cn
吃人肉会得什么病hcv7jop7ns2r.cn mm代表什么hcv9jop3ns6r.cn 荷叶和什么搭配最减肥hcv7jop7ns4r.cn 有故事的人是什么意思hcv8jop1ns7r.cn 胆囊壁毛糙吃什么药hcv8jop2ns7r.cn
百度