👹
Carlos's Tech Blog
  • 🧔ECUs
    • ZYNQ_Documents
      • [ZYNQ] 构建ZYNQ的BSP工程
      • [ZYNQ] 启动流程
      • [ZYNQ] Secure Boot Flow
      • [ZYNQ] Provisioning Guideline
      • [ZYNQ] Decrypting Partition by the Decrypt Agent Using PUF key
      • [ZYNQ] enabling the cryptsetup on ramdisk
      • [ZYNQ] Encrypt external files based on file system using PUF key
      • [ZYNQ] Loading an Encrypted Linux kernel at U-Boot with a KUP Key
      • [ZYNQ] cross-compile the cryptsetup on Xilinx ZYNQ aarch64 platform
      • [ZYNQ] Linux Linaro系统镜像制作SD卡启动
    • S32G_Documents
      • [S32G] Going through the s32g hard/soft platform
      • [S32G] S32g247's Secure Boot using HSE firmware
        • S32g2 HSE key config
        • How S32g verify secure boot image
        • S32g secure boot signature generation
        • How to download and build S32g Secure boot image
        • [S32G] OTA with Secure Boot
    • RT117x_Documents
      • [RT-117x]IMX RT1170 Provisioning Guideline
      • [RT-117x] Going through the MX-RT1170 hard/soft platform
      • [RT-117x] i.MX-RT1170's Secure Boot
        • [RT-117x]Signing image with the HSM (SignServer)
    • LS104x_Documents
      • [LS104x] bsp project
      • [LS104x] boot flow
      • [LS104x] secure boot
      • [LS104x] Application Note, Using the PKCS#11 in TCU platform
      • [LS104x] 使用ostree更新rootfs
      • [LS104x] ostree的移植
      • [LS104x] Starting with Yocto
      • [LS104x] 使用FIT的kernel格式和initramfs
    • IMX6/8_Documents
      • [IMX6] Defining A U-Boot Command
      • NXP IMX6 嵌入式板子一些笔记
      • NXP-imx6 initialization
    • Vehicle_Apps
      • [SecOC] Tree
        • [SecOC] SecOC Freshness and MAC Truncation
  • 😾TECH
    • Rust Arm OS
      • ARMv7m_Using_The_RUST_Cross_Compiler
    • ARM
      • ARM-v7-M
        • 01_ARMv7-M_处理器架构技术综述
        • 02_ARMv7-M_编程模型与模式
        • 03_ARMv7-M_存储系统结构
        • 04_ARMv7-M_异常处理及中断处理
      • ARM-v8-A
        • 02_ARMv8_基本概念
        • 03_ARMv8_指令集介绍_加载指令集和存储指令集
        • 04_ARMv8_指令集_运算指令集
        • 05_ARMv8_指令集_跳转_比较与返回指令
        • 06_ARMv8_指令集_一些重要的指令
        • 0X_ARMv8_指令集_基于汇编的UART驱动
        • 07_ARMv8_汇编器Using as
        • 08_ARMv8_链接器和链接脚本
        • 09_ARMv8_内嵌汇编(内联汇编)Inline assembly
        • 10_ARMv8_异常处理(一) - 入口与返回、栈选择、异常向量表
        • 11_ARMv8_异常处理(二)- Legacy 中断处理
        • 12_ARMv8_异常处理(三)- GICv1/v2中断处理
        • 13_ARMv8_内存管理(一)-内存管理要素
        • 14_ARMv8_内存管理(二)-ARM的MMU设计
        • 15_ARMv8_内存管理(三)-MMU恒等映射及Linux实现
        • 16_ARMv8_高速缓存(一)cache要素
        • 17_ARMv8_高速缓存(二)ARM cache设计
        • 18_ARMv8_高速缓存(三)多核与一致性要素
        • 19_ARMv8_TLB管理(Translation Lookaside buffer)
        • 20_ARMv8_barrier(一)流水线和一致性模型
        • 21_ARMv8_barrier(二)内存屏障案例
      • ARM Boot Flow
        • 01_Embedded_ARMv7/v8 non-secure Boot Flow
        • 02_Embedded_ARMv8 ATF Secure Boot Flow (BL1/BL2/BL31)
        • 03_Embedded_ARMv8 BL33 Uboot Booting Flow
      • ARM Compiler
        • Compiler optimization and the volatile keyword
      • ARM Development
        • 在MACBOOK上搭建ARMv8架构的ARM开发环境
        • Starting with JLink debugger or QEMU
    • Linux
      • Kernel
        • 0x01_LinuxKernel_内核的启动(一)之启动前准备
        • 0x02_LinuxKernel_内核的启动(二)SMP多核处理器启动过程分析
        • 0x21_LinuxKernel_内核活动(一)之系统调用
        • 0x22_LinuxKernel_内核活动(二)中断体系结构(中断上文)
        • 0x23_LinuxKernel_内核活动(三)中断体系结构(中断下文)
        • 0x24_LinuxKernel_进程(一)进程的管理(生命周期、进程表示)
        • 0x25_LinuxKernel_进程(二)进程的调度器的实现
        • 0x26_LinuxKernel_设备驱动(一)综述与文件系统关联
        • 0x27_LinuxKernel_设备驱动(二)字符设备操作
        • 0x28_LinuxKernel_设备驱动(三)块设备操作
        • 0x29_LinuxKernel_设备驱动(四)资源与总线系统
        • 0x30_LinuxKernel_设备驱动(五)模块
        • 0x31_LinuxKernel_内存管理(一)物理页面、伙伴系统和slab分配器
        • 0x32_LinuxKernel_内存管理(二)虚拟内存管理、缺页与调试工具
        • 0x33_LinuxKernel_同步管理_原子操作_内存屏障_锁机制等
        • 01_LinuxDebug_调试理论和基础综述
      • Userspace
        • Linux-用户空间-多线程与同步
        • Linux进程之间的通信-管道(上)
        • Linux进程之间的通信-管道(下)
        • Linux进程之间的通信-信号量(System V)
        • Linux进程之间的通信-内存共享(System V)
        • Linux进程之间的通信-消息队列(System V)
        • Linux应用调试(一)方法、技巧和工具 - 综述
        • Linux应用调试(二)工具之coredump
        • Linux应用调试(三)工具之Valgrind
        • Linux机制之内存池
        • Linux机制之对象管理和引用计数(kobject/ktype/kset)
        • Linux机制copy_{to, from}_user
        • Linux设备树 - DTS语法、节点、设备树解析等
        • Linux System : Managing Linux Services - inittab & init.d
        • Linux System : Managing Linux Services - initramfs
      • Kernel Examples
        • Linux Driver - GPIO键盘驱动开发记录_OMAPL138
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(一)之miscdevice和ioctl
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(二)之cdev与read、write
        • 基于OMAPL138的字符驱动_GPIO驱动AD9833(三)之中断申请IRQ
        • Linux内核调用SPI驱动_实现OLED显示功能
        • Linux内核调用I2C驱动_驱动嵌套驱动方法MPU6050
    • OPTEE
      • 01_OPTEE-OS_基础之(一)功能综述、简要介绍
      • 02_OPTEE-OS_基础之(二)TrustZone和ATF功能综述、简要介绍
      • 03_OPTEE-OS_系统集成之(一)编译、实例、在QEMU上执行
      • 05_OPTEE-OS_系统集成之(三)ATF启动过程
      • 06_OPTEE-OS_系统集成之(四)OPTEE镜像启动过程
      • 07_OPTEE-OS_系统集成之(五)REE侧上层软件
      • 08_OPTEE-OS_系统集成之(六)TEE的驱动
      • 09_OPTEE-OS_内核之(一)ARM核安全态和非安全态的切换
      • 10_OPTEE-OS_内核之(二)对安全监控模式的调用的处理
      • 11_OPTEE-OS_内核之(三)中断与异常的处理
      • 12_OPTEE-OS_内核之(四)对TA请求的处理
      • 13_OPTEE-OS_内核之(五)内存和cache管理
      • 14_OPTEE-OS_内核之(六)线程管理与并发
      • 15_OPTEE-OS_内核之(七)系统调用及IPC机制
      • 16_OPTEE-OS_应用之(一)TA镜像的签名和加载
      • 17_OPTEE-OS_应用之(二)密码学算法和安全存储
      • 18_OPTEE-OS_应用之(三)可信应用的开发
      • 19_OPTEE-OS_应用之(四)安全驱动开发
      • 20_OPTEE-OS_应用之(五)终端密钥在线下发系统
    • Binary
      • 01_ELF文件_目标文件格式
      • 02_ELF文件结构_浅析内部文件结构
      • 03_ELF文件_静态链接
      • 04_ELF文件_加载进程虚拟地址空间
      • 05_ELF文件_动态链接
      • 06_Linux的动态共享库
      • 07_ELF文件_堆和栈调用惯例以ARMv8为例
      • 08_ELF文件_运行库(入口、库、多线程)
      • 09_ELF文件_基于ARMv7的Linux系统调用原理
      • 10_ELF文件_ARM的镜像文件(.bin/.hex/.s19)
    • Build
      • 01_Script_makefile_summary
    • Rust
      • 02_SYS_RUST_文件IO
    • Security
      • Crypto
        • 1.0_Security_计算机安全概述及安全需求
        • 2.0_Security_随机数(伪随机数)
        • 3.0_Security_对称密钥算法加解密
        • 3.1_Security_对称密钥算法之AES
        • 3.2_Security_对称密钥算法之MAC(CMAC/HMAC)
        • 3.3_Security_对称密钥算法之AEAD
        • 8.0_Security_pkcs7(CMS)_embedded
        • 9.0_Security_pkcs11(HSM)_embedded
      • Tools
        • Openssl EVP to implement RSA and SM2 en/dec sign/verify
        • 基于Mac Silicon M1 的OpenSSL 编译
        • How to compile mbedtls library on Linux/Mac/Windows
    • Embedded
      • eMMC启动介质
  • 😃Design
    • Secure Boot
      • JY Secure Boot Desgin
    • FOTA
      • [FOTA] Module of ECUs' FOTA unit design
        • [FOTA] Tech key point: OSTree Deployment
        • [FOTA] Tech key point: repositories role for onboard
        • [FOTA] Tech key point: metadata management
        • [FOTA] Tech key point: ECU verifying and Decrpting
        • [FOTA] Tech key point: time server
      • [FOTA] Local-OTA for Embedded Linux System
    • Provisioning
      • [X-Shield] Module of the Embedded Boards initialization
    • Report
由 GitBook 提供支持
在本页
  • 1. Background and Significance
  • 2. Secure Time synchronization system
  • 2.1 Time Server Deployment
  • 2.2 Time Server Rules
  • 2.3 Time Server Sequence
  • 3. Time Server Usage
  • 3.1 For the Director repository
  • 3.2 For the Primary ECU
  • 3.3 For ECU version report
  • 3.4 For All ECUs
  • 4. Interfaces for Time Server Usage
  • Ref
  1. Design
  2. FOTA
  3. [FOTA] Module of ECUs' FOTA unit design

[FOTA] Tech key point: time server

上一页[FOTA] Tech key point: ECU verifying and Decrpting下一页[FOTA] Local-OTA for Embedded Linux System

最后更新于1年前

1. Background and Significance

Uptane was born out of the TUF (The Update Framework) and adapted to the overall automotive environment. The design of TUF includes the following four concepts: trust separation, signature threshold, explicit and implicit key revocation mechanisms, and offline protection of critical keys. On the basis of retaining the above four design concepts, Uptane has added four key designs to adapt to client heterogeneity, limited resources, and no trusted communication mechanism between ECUs during the vehicle OTA process.

These four key points designs are:

Num

Describation

1

Based on the design of maintaining a remote software library in TUF, Uptane has added a library and divided the responsibilities of the original software library.

  • Image Repository: used to store images and image metadata files

  • Director Repository: used to manage rules of metadata files update.

2

ECU for different hardware resources can perform Full or Partial verification of metadata and image files.

3

Divide the primary (main) ECU and secondary ECU for the onboard. The primary ECU communicates directly with the software upgrade library, and the secondary ECU obtains updates through the primary ECU.

4

Set the Time server to provide time base for ECU that is without a reliable clock source.

This document mainly focuses on the fourth key point (time server for onboard ECU)

For some secure reasons:

Without access to a secure source of time, ECUs may be prevented from receiving the most recent updates. If the ECU’s time is set too far ahead, it will determine that the current valid metadata is expired and thus be unable to perform an update. If the ECU’s time is set too far behind, an attacker can freeze or replay old metadata to the ECU. (ECUs in Uptane will not accept an earlier time than what has been seen before and signed with the same key.) [ref: https://uptane.github.io/papers/uptane-deployment-best-practices-1.1.0.html#secure-source-of-time]

If an ECU does not have a secure clock, the Uptane recommends the use of a Time Server for time. In AUTOX XERO onboard ECU design, the arch is shown in the following figure:

The primary ECU may be the TCU or VDU that is performing the Linux OS. The clock base is from the onboard Real-time clock that is an un-secure clock. So the secure time server shall be deployed for the primary ECU.

2. Secure Time synchronization system

2.1 Time Server Deployment

The typical Uptane framework includes a Time server to provide a time synchronization service for ECUs without reliable clock signals. The primary ECU interacts with the Image Repository and the Director Repository. The interaction process includes signature verification, metadata verification, and image download. The secondary ECU interacts with the primary ECU, and the primary ECU helps the secondary ECU perform all metadata validation. The secondary ECU performs partial metadata validation under limited conditions.

2.2 Time Server Rules

A Time Server, as the name suggests, is a specialized server that is in charge of giving ECUs that would not otherwise have access to this data a safe source of the current time. Through signed records and an exchange of tokens, it provides information to ECUs in a cryptographically safe method. A list of tokens from vehicles is delivered to the Time Server, which then returns a list of signed records that includes every token from the initial set as well as at least one instance of the current time.

If the Time Server is used, it is CONDITIONALLY REQUIRED to conform to the following requirements:

  • The Time Server will provide one or more signed responses that include the time and the sequence of tokens it received from the vehicle. It MAY generate numerous signed time attestation documents, each containing the current time and one or more tokens, or a single document containing the current time and all tokens. The response must contain all tokens.

  • A public interface for communicating with Primaries will be made available via the Time Server. This exchange MAY take place through HTTP, HTTPS (prefer), SFTP, FTP, FTPS, or any other transport control the implementer deems appropriate.

  • By including the new key in the Director's Root metadata, the Time Server's key is rotated in the same way that other roles' keys are. Additionally, it is specified in the Targets metadata of the Director repository's Secondaries (for partial verification).

2.3 Time Server Sequence

The metadata request issuing and downloading progress is shown in the following diagram:

  • Secondary ECUs issue the ECU version metadata and nonce to the primary ECU;

  • The primary ECU generates a manifest containing the vehicle version, then the manifest will be transformed into the Director Repo. Meanwhile, the nonce generated by the primary ECU is sent to the Time Server.

  • The signed time + nonce is returned from the time server. The primary ECU will check the signature.

  • After the primary ECU verified the signature, the primary ECU will download the metadata from the Director Repo and Image Repo.

3. Time Server Usage

3.1 For the Director repository

In Director repository Root metadata, a representation of a Time Server's public key is CONDITIONALLY REQUIRED if one is operational.

A representation of the public key(s) for the Time Server, similar to the representation of public keys in Root metadata.

Listing the public key of the Time Server in Director Targets metadata is necessary to allow partial verification Secondaries to perform Time Server key rotation.

3.2 For the Primary ECU

According to diagram Time Server in the flow, if the Time Server is implemented, the Primary is CONDITIONALLY REQUIRED to use the following procedure to verify the time. This procedure occurs after the vehicle version manifest is sent and will fulfill the Download and check current time step of the Uptane Standard:

The Primary SHALL load the current time from a secure source.

  1. Gather the tokens from each Secondary ECU’s version report.

  2. Send the list of tokens to the Time Server to fetch the current time. The Time Server responds, as described above in the Time Server subsection, by providing a cryptographic attestation of the last known time.

  3. If the Time Server’s response meets the criteria below, update the Primary ECU’s clock and retain the Time Server’s response for distribution to Secondary ECUs. If it fails to meet this criteria, discard the response and continue the procedure without an updated time. The criteria for checking the Time Server’s response are:

  4. The signature over the Time Server’s response is valid.

  5. All the tokens provided to the Time Server are included in the response.

  6. The time in the Time Server’s response is later than the last time verified in this manner.

3.3 For ECU version report

Each Secondary's ECU version report will include a token that can be provided in any way the implementer decides to the Time Server.

The payload of the ECU version report sent from the Primary to the Director MAY contain the tokens sent to the Time Server, which is shown in the following figure:

In this case, if any token is removed or changed, the signature will not match. To detect a replay attack, each token SHOULD be unique per ECU. There will be sufficient tokens to enable this since the uptane anticipate that these updates will be very frequently (e.g., because of a finite number of write cycles).

3.4 For All ECUs

ECUs MAY get an attestation of the current time as retrieved from the Time Server once the vehicle has been put assembled. As the first step to verifying metadata, described in the Standard for both the Primary and Secondaries:

5.4.3.1. Load and verify the latest attested time

The ECU SHALL load and verify the current time, or the most recent securely attested time.

5.4.2.2. Download and check current time

The Primary SHALL load the current time from a secure source.

The ECU SHOULD load and verify the most recent time from the Time Server using the following procedure:

  1. Verify that the signatures on the downloaded time are valid.

  2. Verify that the list of tokens in the downloaded time includes the token that the ECU sent in its version report.

  3. Verify that the time downloaded is greater than the previous time.

If all three steps are completed without error, the ECU is CONDITIONALLY REQUIRED to overwrite its current attested time with the time it has just downloaded and to generate a new token for the next request to the Time Server.

5.4.3.6. Create and send version report

The ECU SHALL create a version report as described in Section 5.4.2.1.2, and send it to the Primary (or simply save it to disk, if the ECU is a Primary). The Primary SHOULD write the version reports it receives to disk and associate them with the Secondaries that sent them.

4. Interfaces for Time Server Usage

  • time_srv_get_current_time

  • time_srv_set_nonce(nonce)

  • time_srv_get_signed_time(nonce)

  • time_srv_refresh_key

Ref

  • https://uptane.github.io/papers/uptane-deployment-best-practices-1.1.0.html#secure-source-of-time

  • https://uptane.github.io/papers/ieee-isto-6100.1.0.0.uptane-standard.html#verify_time

  • https://uptane.github.io/papers/ieee-isto-6100.1.0.0.uptane-standard.html#check_timestamp

😃
Uptane architecture with a secure time server
Time Server in the flow
The payload of the ECU version report