Firmware package generation method, secure boot method and its verification method, device and medium

By creating a secure storage area and building a trusted boot chain in the vehicle SoC system, the problem of root public keys being easily tampered with in existing technologies is solved. This enables online key rotation and complete trust chain management, meets information security regulatory requirements, and reduces deployment costs.

CN121479787BActive Publication Date: 2026-11-10BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511625295.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-11-10
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

Existing automotive SoC systems lack hardware-level security mechanisms, making them vulnerable to attackers tampering with early boot code, which can cause security mechanisms to fail. Furthermore, existing solutions cannot achieve online updates of the root public key and effective access control.

Method used

By creating a secure storage area in non-volatile memory, a trusted boot chain is constructed using software, including tamper-proof storage of the root public key and a dual verification mechanism, generating a secure boot firmware package that supports online updates of the root public key and migration of the trust chain.

Benefits of technology

It enables the construction of a complete trusted boot chain without the need for a hardware trust anchor, prevents root public key tampering, supports online key rotation, reduces deployment costs, is compatible with existing OTA and diagnostic upgrades, and meets information security regulatory requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121479787B_ABST
    Figure CN121479787B_ABST
Patent Text Reader

Abstract

This application relates to the field of system security technology, and discloses a firmware package generation method, a secure boot method and its verification method, apparatus and medium. This boot method is applicable to automotive SoC systems without OTP / eFuse and with an unmodifiable BootROM, and achieves the reconstruction of the root of trust through software. In response to a boot command, the BootROM loads a secure boot program; during initial deployment, a secure storage area is created in non-volatile memory, and an initial root public key and its digest are written, completing the initialization of the trust chain. During subsequent boots, the secure boot program verifies the integrity of the root public key, and then verifies the image public key, digest and signature of the image to be booted, ensuring the legitimacy of the source and the integrity of the data. It supports online updating of the root public key through a chained signature mechanism, that is, using the currently valid root private key to sign the digest of the new public key, which can only be replaced after the old public key verifies the signature, realizing key rotation and trust anchor migration without hardware modifications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of system security technology, and in particular to a firmware package generation method, a secure boot method and its verification method, apparatus and medium. Background Technology

[0002] As automotive electronic and electrical architectures evolve towards centralization and intelligence, the secure boot capability of onboard chips has become a fundamental aspect of ensuring vehicle information security. Secure boot establishes a trust chain that verifies the root public key at each level, from the BootROM to the operating system, ensuring that only authorized and signed firmware can be executed, thereby preventing malicious image flashing and remote vehicle control attacks. Currently, mainstream solutions rely on on-chip one-time programmable storage (OTP) or electronic fuses (eFuse) to store the root public key or its hash value, utilizing the irreversible write capability of hardware to prevent tampering and form a trusted root. However, many mass-produced or currently in-service automotive SoCs do not integrate OTP or eFuse structures due to cost control or design history, and their BootROMs are already fixed, making it impossible to introduce hardware-level security mechanisms through tape-out modifications. For such devices, if signature verification is only performed at the application layer or in non-privileged mode, attackers can easily bypass verification by tampering with early boot code, rendering the security mechanism ineffective. Although some solutions attempt to store the root public key in external Flash memory, the lack of effective access control to this storage area still leaves the risk of unauthorized replacement.

[0003] It is worth noting that existing solutions that store the root public key in external Flash memory (such as some MCU or SoC designs) typically only support one-time writing and lack effective access control and legitimacy verification mechanisms. Once the key is leaked, it cannot be updated, requiring a complete recall or physical chip replacement. Furthermore, these solutions often require key burning during the production stage, making it impossible to retrofit security capabilities via remote upgrades. Summary of the Invention

[0004] In view of this, embodiments of this application provide a firmware package generation method, a secure boot method and its verification method, apparatus and medium.

[0005] In a first aspect, embodiments of this application provide a method for generating a secure boot firmware package, comprising: obtaining a target system firmware to be upgraded, and performing a digest calculation on the target system firmware to obtain a firmware digest value; digitally signing the firmware digest value using a currently valid root private key to generate firmware signature data; if the upgrade requires updating the root public key, digitally signing the digest of the new root public key using the currently valid root private key to generate root public key update signature data; and encapsulating the target system firmware, the firmware signature data, and the root public key related information to obtain a secure boot firmware package.

[0006] In an optional implementation, when the root public key is not updated in this upgrade, the root public key related information includes: the currently valid root public key and the digest corresponding to the currently valid root public key; wherein, the root public key update signature field is empty or filled with a preset invalid value to indicate that no root public key update operation needs to be performed.

[0007] In an optional implementation, when the root public key is updated during this upgrade, the root public key related information includes: the new root public key, the digest of the new root public key, and the root public key update signature data; wherein, the root public key update signature is obtained by using the currently valid root private key to perform an asymmetric encryption signature on the digest of the new root public key, which is used to implement key rotation based on chain trust on the device side.

[0008] Secondly, embodiments of this application provide a secure boot method applied to a security chip system lacking a one-time programmable storage unit (OTP) or eFuse, comprising: in response to a boot command, loading and executing a secure boot program via a BootROM; wherein, upon initial deployment, the secure boot program can create a secure storage area in an existing system without secure boot, and write an initial root public key and its corresponding digest to complete the reconstruction of the trusted root; if the secure boot program detects the existence of a secure storage area located in non-volatile memory, it reads the current root public key and its corresponding pre-stored digest from the secure storage area; calculates the current root public key... The system obtains the root public key digest of the image and, when the root public key digest matches the pre-stored digest, obtains the image information in the image to be started; the image information includes the image public key, the image signature, and the image digest; when the image public key matches the current root public key, the system calculates the digest of the firmware body of the image to be started to obtain the actual digest; when the actual digest matches the image digest, the system performs digital verification of the image signature using the current root public key, and starts the system corresponding to the image to be started after the verification is successful; wherein, the startup image is obtained from the secure startup firmware package described in any of the foregoing embodiments.

[0009] In an optional implementation, if the secure storage area is detected to be non-existent, the method further includes: creating the secure storage area in the non-volatile memory through the secure boot program, and writing a default security field to the secure storage area; the default security field includes an initial root public key and a corresponding digest; wherein, after the secure storage area is created, the secure storage area is marked as initialized.

[0010] In an optional implementation, when the secure bootloader is deployed for the first time, its burning process includes: receiving a first upgrade package, the first upgrade package containing secure bootloader binary data with security verification function; the original bootloader writing the secure bootloader binary data into a preset jump address area of ​​non-volatile memory; and triggering a system restart after burning is completed, so that the BootROM loads and executes the secure bootloader.

[0011] Thirdly, this application provides a firmware upgrade verification method applied to the aforementioned secure chip system, comprising: upon receiving a secure boot firmware package, parsing whether the secure boot firmware package contains a root public key update signature through a secure boot program; if it contains a signature and is not marked as invalid, verifying the root public key update signature using the current root public key stored in the secure storage area; if the verification passes, calculating the digest value of the new root public key in the secure boot firmware package and comparing it with the digest of the new root public key carried in the secure boot firmware package; if the comparison matches, erasing the original contents of the secure storage area and writing the new root public key and its corresponding digest into the secure storage area, thereby completing the root public key update.

[0012] In an optional implementation, after the root public key update is completed, the method further includes: performing a digest calculation on the data in the secure boot firmware package to obtain an actual digest value; when the actual digest value matches the image digest carried in the secure boot firmware package, using the latest root public key to digitally verify the firmware signature data in the secure boot firmware package; wherein the firmware signature data is generated based on the image digest; after the verification is successful, the original firmware partition is erased and new firmware data is written.

[0013] Fourthly, embodiments of this application provide an in-vehicle electronic device, including: a SoC chip, wherein the SoC has no OTP or eFuse unit; a non-volatile memory, which has a secure storage area and stores a secure boot program and a main operating system; the secure boot program is configured to execute the secure boot method as described in any of the foregoing embodiments each time it is started, so as to establish a trusted execution environment.

[0014] Fifthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed on a processor, performs the above-described method.

[0015] The embodiments of this application have the following beneficial effects: The secure boot method of this application constructs a complete trusted boot chain through software without relying on hardware trust anchors such as OTP or eFuse. This method utilizes a secure storage area in non-volatile memory to implement tamper-proof storage of the root public key and performs a dual verification mechanism during the boot process: first verifying the integrity of the root public key itself, and then verifying the legitimacy of the source and the integrity of the data of the image to be booted. The entire process does not change the existing hardware design, the cost per chip is zero, and it is compatible with various automotive SoC platforms. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This paper illustrates a first flowchart of a firmware package generation method according to an embodiment of this application. Figure 2 This paper illustrates a second flowchart of the firmware package generation method according to an embodiment of this application. Figure 3 A first flowchart of the secure boot method according to an embodiment of this application is shown; Figure 4 This paper illustrates a second flowchart of the secure boot method according to an embodiment of the present application. Figure 5 This paper illustrates a first flowchart of a firmware upgrade verification method according to an embodiment of this application. Figure 6 A schematic diagram of the second process of the firmware upgrade verification method according to an embodiment of this application is shown. Detailed Implementation

[0018] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0019] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0020] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0021] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0022] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0023] The following describes the method for generating the secure boot firmware package using specific embodiments. This method is executed on the server by the firmware publisher of the in-vehicle system (such as an OEM or OTA service platform) to generate a firmware package that can be securely verified in an in-vehicle SoC system that does not have a one-time programmable storage unit (OTP) or an electronic fuse (eFuse).

[0024] Figure 1 A schematic flowchart illustrating a firmware package generation method for secure boot without requiring root public key updates, according to an embodiment of this application, is shown. Exemplarily, the firmware package generation method includes steps S111-S113: Step S111: Obtain the target system firmware to be upgraded, and perform a digest calculation on the target system firmware to obtain the firmware digest value.

[0025] As an example, the complete target system firmware to be released is first obtained, such as a binary image file (e.g., firmware.bin) containing the operating system, middleware, and application software. Then, a hash algorithm (e.g., SHA-256) is used to calculate a digest of the entire data of the target system firmware, yielding a firmware digest value that uniquely represents its integrity. This firmware digest value will serve as input data for subsequent digital signature verification on the device side to confirm whether the firmware has been tampered with.

[0026] Step S112: Digitally sign the firmware digest value using the currently valid root private key to generate firmware signature data.

[0027] In this step, the root private key, currently within its valid lifecycle (i.e., the currently valid root private key), is used to perform an asymmetric cryptographic signature operation on the firmware digest value obtained in step S111. In some implementations, RSA-2048 or ECDSA algorithms can be used to generate firmware signature data with strong anti-forgery capabilities. The obtained firmware signature data is used on the device side by the secure bootloader to verify the signature using the corresponding root public key to confirm the legitimacy of the firmware's origin.

[0028] Step S113: Encapsulate the target system firmware, firmware signature data, and root public key related information to obtain a secure boot firmware package.

[0029] The root public key information includes the currently valid root public key and its corresponding digest. In this embodiment, since no root public key update is involved, the root public key update signature field is empty or filled with a preset invalid value (such as all 0xFF) to indicate that the device does not need to perform a key update operation. This secure boot firmware package can be transmitted to the terminal device via USB, CAN FD, Ethernet, or OTA, allowing the secure bootloader to verify its integrity and legitimacy during the upgrade process.

[0030] During the encapsulation process, the target system firmware, firmware signature data, currently valid root public key and its digest, and other fields are packaged according to a predefined data structure to generate a complete secure boot firmware package.

[0031] Figure 2 This illustration shows a flowchart of a firmware package generation method for secure boot when the root public key needs to be updated, according to an embodiment of this application. This method is typically used in scenarios where an in-vehicle system faces root private key leakage or requires proactive key rotation for security purposes, to securely update the trust anchor via software without modifying the hardware design or recalling the device. Exemplarily, the firmware package generation method includes steps S211-S214: Step S211: Obtain the target system firmware to be upgraded, and perform a digest calculation on the target system firmware to obtain the firmware digest value.

[0032] Step S212: Digitally sign the firmware digest value using the currently valid root private key to generate firmware signature data.

[0033] Steps S211 and S212 are the same as steps S111 and S112 above, and will not be repeated here.

[0034] Step S213: Use the currently valid root private key to digitally sign the digest of the new root public key, and generate root public key update signature data.

[0035] As an example, when a change of trust anchor is required, a new root key pair is generated, and the new root public key is extracted. The same hash algorithm is used to calculate the digest value of this new root public key. Subsequently, the digest of the new root public key is digitally signed using the currently valid root private key, generating a root public key update signature data. This operation constitutes a one-way irreversible chain of trust, ensuring that only the party holding the legitimate private key can authorize key rotation and preventing unauthorized entities from injecting malicious public keys.

[0036] Step S214: Encapsulate the target system firmware, firmware signature data, and root public key related information to obtain a secure boot firmware package.

[0037] The root public key information includes the new root public key and its digest, as well as the root public key update signature data. This secure boot firmware package can be transmitted to the terminal device via OTA, USB, or a diagnostic interface. During the upgrade process, the secure bootloader verifies the legitimacy of the new public key and completes the online update of the trusted root.

[0038] When encapsulating the target system firmware, firmware signature data, and root public key related information, it is consistent with step S113 above, and will not be repeated here.

[0039] The method in this embodiment solves the technical challenge of secure booting for in-vehicle systems without OTP or eFuse hardware support by constructing a secure and reliable firmware encapsulation mechanism at the software level. This method features a unified firmware package structure, compatible with various scenarios involving root public key updates. It supports source authentication in regular upgrades and enables secure online rotation of the root public key via chained signatures. The generated firmware package contains complete metadata required for verification, ensuring that the device can independently complete the trust chain verification. The entire generation process does not rely on dedicated security chips or physical flashing devices, significantly reducing deployment costs. It is also compatible with existing OTA and diagnostic upgrade channels, facilitating OEMs to quickly implement secure upgrade systems compliant with regulations such as UNECE WP.29 and ISO / SAE 21434.

[0040] The secure boot method will be further explained below. This embodiment specifically addresses the design of mass-produced automotive SoC platforms that lack OTP / eFuse and have unmodifiable BootROMs. The aim is to establish a verifiable root of trust within the operating environment through software means and construct a complete hierarchical trust chain, such as... Figure 3 As shown, the secure boot method includes steps S311-S322: Step S311: In response to the boot command, load and execute the secure boot program via BootROM.

[0041] As an example, when the on-board device is powered on or reset, the BootROM inside the SoC runs first as the trust starting point, and jumps to the location of the Secure Bootloader (Secure-BL) according to a preset address, loads it into memory (such as SRAM), and begins execution. The Secure Bootloader is a secondary boot code with integrity verification and digital signature verification functions, and is the core module for building a software-defined trust chain.

[0042] The BootROM (Boot Read-Only Memory) is an unmodifiable read-only memory area embedded within the SoC chip, containing the lowest-level boot code. Because its contents are written during chip manufacturing and cannot be changed, the BootROM is considered the physical starting point of the trust chain and plays the role of the initial root of trust during the secure boot process.

[0043] It should be noted that during the initial deployment of the secure bootstrap program, a secure storage area can be created in the existing insecure system, and the initial root public key and its digest can be written to it, completing the reconstruction of the trusted root. Subsequent upgrades support updating the root public key via a chained signature mechanism. That is, the digest of the new root public key is signed using the currently valid root private key. The new root public key can only be replaced by the old root public key after the device verifies the signature with the old root public key. This achieves online key rotation and trust anchor migration without hardware modifications. This mechanism solves the problem of the root public key being permanently fixed and becoming invalid upon leakage in traditional solutions, improving the long-term security and compliance adaptability of the system.

[0044] Step S312: The security boot program detects whether a secure storage area exists in the non-volatile memory.

[0045] As an example, upon startup, the Secure Bootloader (Secure-BL) first checks whether a secure storage region for storing the root public key has been created in non-volatile memory (such as eMMC, UFS, or NOR Flash). This region is preferably located in a reserved physical block of Flash and configured by the Memory Management Unit (MMU) to allow access only by the CPU in privileged mode, preventing unauthorized read / write operations by user-mode programs.

[0046] If a secure storage area is detected, proceed to step S313; otherwise, proceed to step S314.

[0047] Step S313: Read the current root public key and its corresponding pre-stored digest from the secure storage area.

[0048] In this step, the currently valid root public key and its corresponding pre-stored digest (i.e., the hash value of the public key) are read from the existing secure storage area for subsequent self-integrity verification.

[0049] The contents stored in the secure storage area are shown in Table 1.

[0050] Table 1:

[0051] Step S314: Create a secure storage area.

[0052] If the secure storage region has not yet been created (e.g., in the initial deployment scenario), the secure bootstrap program allocates a specified physical block in non-volatile memory and initializes it as a secure storage region. Default security fields, including but not limited to Magic_Word, the initial root public key, the digest of that root public key, and status flags, are then written into it, and the region is marked as initialized. After initialization is complete, proceed to step S313.

[0053] Step S315: Calculate the root public key digest of the current root public key and compare it with the pre-stored digest.

[0054] As an example, the Secure Bootloader Secure-BL recalculates the digest value of the currently read root public key using the same hash algorithm (such as SHA-256) used to generate the pre-stored digest, resulting in a locally computed root public key digest. This computed result is then compared for consistency with the pre-stored digest stored in the secure storage area.

[0055] If the root public key digest matches the pre-stored digest, it means the root public key has not been tampered with, and step S316 is executed; otherwise, step S317 is executed.

[0056] Step S317: It is confirmed that the startup failed.

[0057] If any verification step (root public key self-check, mirror public key comparison, digest comparison, or signature verification failure) fails, the system determines that there is a security risk in the startup process, terminates subsequent operations, and enters a security anomaly mode (such as locking the device, entering recovery mode, or reporting a security event).

[0058] Step S316: Obtain image information from the image to be started.

[0059] The image information includes the image public key, image signature, and image digest, all of which are packaged together with the image to be booted in the secure boot firmware package. Secure-BL parses this information from the image header metadata to prepare for source authentication and integrity verification.

[0060] After obtaining the mirror information in step S316, continue to step S318 to compare the mirror public key with the current root public key.

[0061] To prevent attackers from replacing the public key field in the image, Secure-BL first compares the image public key with the current root public key in the secure storage area byte by byte. If the image public key and the current root public key do not match, step S317 is executed.

[0062] If the image public key matches the current root public key, then step S319 is executed to calculate the digest of the firmware body of the image to be booted, so as to obtain the actual digest.

[0063] It is understandable that if the image public key comparison passes, the same hash algorithm as when packaging is applied to the firmware body of the received image to be launched, and its actual digest value is calculated for comparison with the image digest carried in the image.

[0064] Step S320: Compare the actual digest with the mirror digest.

[0065] Compare the actual digest obtained in step S319 with the image digest obtained in step S316. If they do not match, it indicates that the firmware has been tampered with during transmission or storage, and proceed to step S317; if they match, continue to step S321 to digitally verify the image signature using the current root public key.

[0066] It is understood that in this step, the current root public key in the secure storage area can be used to perform a digital signature verification operation on the image signature to verify whether the signature was generated by a legitimate private key. If the signature verification passes, it indicates that the image source is trustworthy, and then proceed to step S322; if it fails, then proceed to step S317.

[0067] Step S322: Start the system corresponding to the boot image. The boot image is obtained from the aforementioned secure boot firmware package.

[0068] It is understandable that after all verification steps pass, Secure-BL jumps to the main operating system entry address and officially starts the system corresponding to the image to be booted. The image to be booted originates from the secure boot firmware package generated in the aforementioned embodiments (such as...). Figure 1 or Figure 2 (Generated using the method shown), ensuring a closed loop for the entire trust chain.

[0069] The above process enables a technological breakthrough in "rebuilding" a root of trust in a system without a hardware trust anchor, allowing existing devices that lack native secure boot capabilities to meet requirements such as UNECE WP.29 R155 and ISO / SAE 21434 through pure software upgrades.

[0070] In some implementations, for existing vehicle systems that have not yet integrated a secure bootloader with security verification capabilities, the secure bootloader needs to be deployed for the first time via a software upgrade. For example... Figure 4The diagram illustrates the flashing process of the security bootloader during initial deployment in this embodiment of the application. This process can be executed in scenarios such as production line flashing, after-sales maintenance, or OTA remote upgrades, without requiring changes to the hardware design. The flashing process includes steps S411-S413: Step S411: Receive the first upgrade package, which contains secure bootloader binary data with security verification function.

[0071] As an example, during the initial deployment phase, the device receives a dedicated upgrade package (referred to as the first upgrade package) via a USB interface, diagnostic tool, OBD port, or wireless communication module. This upgrade package is formatted to be compatible with existing upgrade protocols (such as ISO 14229 UDS or A / B partition update mechanisms). The first upgrade package encapsulates binary data of a secure bootloader (Secure-BL) with full security verification capabilities, used to replace the original traditional bootloader which lacks signature verification functionality.

[0072] In step S412, the original bootloader writes the secure boot program binary data into the preset jump address area of ​​the non-volatile memory.

[0073] As an example, the device's existing bootloader parses and verifies the validity of the first upgrade package (e.g., based on CRC checksum or base version check), and then writes the secure bootloader binary data contained therein into a preset jump address region in non-volatile memory (such as eMMC or NOR Flash). This region is the bootable image load location defined by the SoC's BootROM (e.g., a fixed offset address 0x8000_0000), ensuring that it can be correctly recognized and loaded on the next power-on.

[0074] Step S413: After the burning process is complete, the system is restarted, causing the BootROM to load and execute the secure boot program.

[0075] Once the secure bootloader's data has been written and verified, the system automatically triggers a reboot. After rebooting, the BootROM checks for a valid image in the preset address region according to a predetermined process. If confirmed, it loads the image into memory and begins execution. From this point on, the device enters a secure boot mode dominated by the Secure-BL bootloader, and all subsequent firmware upgrades and system startups must undergo strict integrity and legitimacy verification.

[0076] In some implementations, after the first upgrade package completes the Secure-BL flashing and reboot, a formal security upgrade operation is required to establish a complete trust chain. This operation is achieved by sending a second upgrade package.

[0077] The second upgrade package is a secure boot firmware package conforming to the format defined in this application. The target system firmware contained therein integrates a Secure-BL-compatible boot header structure and carries a valid image public key, image signature, and image digest. The image public key is identical to the initial root public key in the secure storage area, and the image signature is generated from the corresponding private key.

[0078] After the device reboots and Secure-BL is loaded from the BootROM, Secure-BL will parse the second upgrade package and execute the secure boot process as described above: including root public key self-check, image public key comparison, actual digest calculation, comparison with image digest, and digital signature verification. Once all verifications are successful, the original firmware partition can be erased and the new firmware written.

[0079] This enables a smooth migration from a system with no security capabilities to a fully trusted system across the entire chain, ensuring that end-to-end tamper-proof capabilities are still present when security mechanisms are first enabled.

[0080] This embodiment's secure boot method, without relying on hardware security modules such as one-time programmable storage units (OTP) or electronic fuses (eFuse), constructs a complete and reliable boot verification mechanism through software, effectively solving the technical challenge of existing automotive SoC systems failing to meet information security regulatory requirements. This method utilizes reserved physical blocks in non-volatile memory to create a secure storage area and ensures that privileged mode reads and writes are enabled only through access control, achieving tamper-proof storage of the root public key and its digest. Each time the system boots, the secure bootloader first performs a self-integrity check on the root public key to prevent malicious replacement, and then performs step-by-step verification of the legitimacy of the boot image's source and data integrity, forming a dual protection mechanism to enhance the system's resistance to attacks. Compared to traditional solutions relying on hardware trust anchors, this method requires no changes to chip design, packaging, or PCB layout, increasing the cost per device to zero, making it particularly suitable for mid-to-low-end automotive platforms already in mass production or installed in vehicles. Simultaneously, this method is compatible with existing OTA, USB, and diagnostic interface upgrade processes, supporting security capability deployment via software push, thereby reducing the technical upgrade threshold and maintenance costs for OEMs. Furthermore, by designing the initial deployment of the secure bootloader as an independently executable burning process, a smooth migration from a system without security features to a trusted system can be achieved, thereby ensuring the compatibility and upgrade reliability of the new and old systems.

[0081] The firmware upgrade verification method of this application embodiment will be further described below. This firmware upgrade verification method is applied to the security chip system of the aforementioned embodiments that does not have a one-time programmable storage unit (OTP) or an electronic fuse (eFuse). It is used to perform trusted verification on whether the root public key has been updated and the legality of the new public key after the device receives the secure boot firmware package, ensuring the security and controllability of the key rotation process. Figure 5 As shown, the firmware upgrade verification method includes steps S511-S517: Step S511: After receiving the secure boot firmware package, the secure boot program parses whether the secure boot firmware package contains a root public key update signature.

[0082] As an example, when a device receives a secure boot firmware package via OTA, USB, or a diagnostic interface, the secure bootloader first parses the metadata fields in the package to determine whether it contains valid root public key update signature data. The presence or absence of this field indicates whether the upgrade involves a change to the root public key.

[0083] If the root public key update signature data is empty or marked as invalid (e.g., all 0xFF), then it is considered that there is no need to update the root public key, and proceed to step S512; otherwise, proceed to step S515.

[0084] Step S512: Determine whether the root public key digest matches.

[0085] Without updating the root public key, the secure bootloader compares the root public key and its digest carried in the secure boot firmware package with the current root public key and its pre-stored digest stored in the current secure storage area. If they match perfectly, it means the public key information has not been tampered with, and step S514 is executed; if they do not match, step S513 is executed.

[0086] Step S513: It is confirmed that the startup failed.

[0087] As an example, when any verification step fails, including situations such as root public key digest mismatch, signature verification failure, or digest inconsistency, the system determines that there is a security risk, terminates the upgrade process, and enters a security anomaly handling mode, such as locking write permissions, reporting a security event, or entering recovery mode.

[0088] Step S514: Continue to start the process.

[0089] After confirming that there is no need to update the root public key and that all information is consistent, the secure bootloader continues to perform the subsequent firmware integrity and legitimacy verification process, preparing to write the new firmware.

[0090] Step S515: Verify the root public key update signature using the current root public key stored in the secure storage area.

[0091] If, during this step, the root public key update signature data is detected to be non-empty and not marked as invalid, the secure bootstrap program uses the current root public key stored in the current secure storage area to perform a digital verification operation on the signature. This signature should be the result of encrypting the digest of the new root public key using the currently valid root private key, used to prove the legitimate source of the new public key's authorization.

[0092] If the signature verification fails, it indicates that the signature is invalid or the private key does not match, and step S513 is executed; if it passes, proceed to step S516.

[0093] Step S516: Calculate the digest value of the new root public key in the Secure Boot firmware package and compare it with the digest of the new root public key carried in the Secure Boot firmware package.

[0094] Understandably, in this step, the new root public key is extracted from the firmware package via the secure bootloader, and its digest value is recalculated using the same hash algorithm (such as SHA-256) as the packaging end. This calculation result is then compared with the new root public key digest field explicitly carried within the package to verify that the public key itself has not been tampered with.

[0095] If the comparison is inconsistent, proceed to step S513; if they are consistent, proceed to step S517.

[0096] Step S517: Erase the contents of the original secure storage area and write the new root public key and its corresponding digest into the secure storage area to complete the root public key update.

[0097] After both authentications pass, the secure bootloader releases the write-protected state of the original secure storage area, erases the old root public key and related data, and writes the new root public key and its digest into the area. Once written, the area is marked as updated, achieving a trusted migration of the trust anchor. From this point on, subsequent startup and authentication will be based on the new root public key, forming a unidirectional, irreversible chain of trust, effectively preventing rollback attacks and systemic risks caused by root private key leakage.

[0098] In some implementations, to ensure the integrity and security of the system upgrade process, after the root public key update is completed, an independent integrity and source legitimacy verification of the target firmware is also required. For example... Figure 6 As shown, after the root public key update is completed, steps S611-S615 are also included: Step S611: Perform digest calculation on the data in the Secure Boot firmware package to obtain the actual digest value.

[0099] In this step, the target system firmware (i.e., the complete image data to be upgraded) encapsulated in the secure boot firmware package is extracted by the secure boot program, and a digest of the firmware body is calculated using a preset hash algorithm (such as SHA-256) to obtain the locally generated actual digest value. This operation is completed independently on the device side to prevent the firmware from being tampered with during transmission or storage.

[0100] Step S612: Compare the actual digest value with the image digest carried in the Secure Boot firmware package.

[0101] The actual digest value calculated in step S611 is compared with the image digest field explicitly carried in the secure boot firmware package. If the two match perfectly, the firmware data is complete and error-free, and step S614 is executed; if they do not match, step S613 is executed.

[0102] Step S613: Summary mismatch, update terminated.

[0103] It is understandable that when the actual digest value is inconsistent with the image digest comparison result, the firmware integrity is deemed to be compromised, which may indicate malicious modification or transmission errors. The system will immediately terminate the upgrade operation, prohibit any write operations, and may trigger a security alarm or enter recovery mode to prevent unauthorized firmware from being flashed.

[0104] Step S614: Use the latest root public key to digitally verify the firmware signature data in the secure boot firmware package.

[0105] As an example, after the firmware integrity verification passes, the secure bootloader invokes the latest root public key (i.e., the newly updated root public key) to perform a digital signature verification operation on the firmware signature data in the secure boot firmware package. The firmware signature data is an encrypted signature generated during the firmware packaging stage using the corresponding latest root private key based on the image digest, and can only be verified by the paired public key.

[0106] If the signature verification passes, it means that the firmware does indeed come from a trusted publisher and has not been forged, so proceed to step S615; if the signature verification fails, return to step S613.

[0107] Step S615: Erase the original firmware partition and write the new firmware data.

[0108] Understandably, after all verification steps are passed, the secure bootloader releases the write protection state of the original system firmware partition, erases the old firmware version, and writes the new target system firmware data to the designated storage area. Once the writing is complete, the upgrade can be marked as successful, and the updated secure bootloader or operating system will be loaded by the BootROM on the next boot, achieving synchronization of feature iteration and security policies.

[0109] The firmware upgrade verification method in this embodiment achieves secure online updates of the root public key without requiring hardware security modules. This method performs dual verification of the new root public key on the device side: confirming its legitimacy through signature verification using the old root public key, and ensuring its integrity through digest comparison, effectively preventing unauthorized key injection and rollback attacks. Simultaneously, after the key update is completed, independent integrity verification and source authentication of the firmware itself are performed, constructing a complete trust transfer chain.

[0110] Furthermore, the chained signature update mechanism adopted in this application ensures that each change to the root public key must be authorized by the currently valid private key, forming a unidirectional, progressive chain of trust and preventing replay attacks and unauthorized public key injection. This approach overcomes the limitation of traditional external storage public key schemes where the key is valid for life once written, thus enabling full lifecycle management of the root trust anchor in the absence of OTP / eFuse.

[0111] This application also provides an in-vehicle electronic device, including: a SoC chip, which has no internal OTP or eFuse unit; non-volatile memory with a secure storage area, storing a secure boot program and a main operating system; the secure boot program is configured to execute the aforementioned secure boot method each time it starts up, in order to establish a trusted execution environment. The SoC chip is a system-on-chip, integrating a central processing unit (CPU), memory controller, bus interface, DMA engine, and various peripheral modules, used to run functions such as in-vehicle infotainment systems, cockpit control, or gateway communication. In this embodiment, the SoC chip does not integrate hardware security elements such as one-time programmable storage units (OTP) or electronic fuses (eFuse), and its BootROM is fixed, making it impossible to introduce a physical trust anchor through tape-out modifications.

[0112] This application also provides a computer-readable storage medium for storing the computer program used in the aforementioned vehicle-mounted electronic device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0114] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0115] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0116] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for generating a firmware package for secure boot, characterized in that, include: Obtain the target system firmware to be upgraded, and perform digest calculation on the target system firmware to obtain the firmware digest value; The firmware digest value is digitally signed using the currently valid root private key to generate firmware signature data; If this upgrade requires updating the root public key, then the digest of the new root public key is digitally signed using the currently valid root private key to generate root public key update signature data; The target system firmware, the firmware signature data, and root public key related information are encapsulated to obtain a secure boot firmware package; When the root public key is updated during this upgrade, the relevant information of the root public key includes: the new root public key, the digest of the new root public key, and the root public key update signature data; wherein, the root public key update signature data is obtained by using the currently valid root private key to perform asymmetric encryption signature on the digest of the new root public key, which is used to implement key rotation based on chain trust on the device side.

2. The firmware package generation method according to claim 1, characterized in that, When the root public key is not updated during this upgrade, the root public key related information includes: the currently valid root public key and the digest corresponding to the currently valid root public key; wherein, the root public key update signature data is empty or filled with a preset invalid value to indicate that no root public key update operation needs to be performed.

3. A safe boot method, characterized in that, For use in security chip systems that do not have one-time programmable memory units (OTP) or eFuse, including: In response to the boot command, a secure boot program is loaded and executed via BootROM; wherein, when the secure boot program is deployed for the first time, a secure storage area can be created in the original system without secure boot, and the initial root public key and the corresponding digest can be written to complete the reconstruction of the trusted root; If the secure bootloader detects the existence of the secure storage area located in non-volatile memory, it reads the current root public key and the corresponding pre-stored digest from the secure storage area. Calculate the root public key digest of the current root public key, and when the root public key digest matches the pre-stored digest, obtain the image information in the image to be started; the image information includes the image public key, the image signature, and the image digest; When the image public key matches the current root public key, a digest is calculated on the firmware body of the image to be started to obtain the actual digest; When the actual digest matches the image digest, the image signature is digitally verified using the current root public key, and the system corresponding to the image to be started is started after the verification is successful; wherein, the startup image is obtained from the secure boot firmware package according to any one of claims 1-2.

4. The safe startup method according to claim 3, characterized in that, If the secure storage area is detected to be absent, the method further includes: The secure bootloader creates the secure storage region in the non-volatile memory and writes a default security field into the secure storage region; the default security field includes an initial root public key and a corresponding digest; Once the secure storage area is created, it is marked as initialized.

5. The safe startup method according to claim 3, characterized in that, The security bootloader, when deployed for the first time, includes the following burning process: Receive a first upgrade package, which contains secure bootloader binary data with security verification capabilities; The original bootloader writes the secure boot program binary data into a preset jump address region of the non-volatile memory; After the burning process is complete, the system will restart, causing the BootROM to load and execute the secure boot program.

6. A firmware upgrade verification method, characterized in that, Applied to the security chip system as described in any one of claims 3-5, comprising: Upon receiving the Secure Boot firmware package, the Secure Boot program parses the Secure Boot firmware package to determine whether it contains a root public key update signature. If it contains and is not marked as invalid, the current root public key stored in the secure storage area is used to verify the signature update of the root public key; If the signature verification is successful, the digest value of the new root public key in the Secure Boot firmware package is calculated and compared with the digest of the new root public key carried in the Secure Boot firmware package. If the comparison matches, the original secure storage area content is erased, and the new root public key and its corresponding digest are written into the secure storage area, thus completing the root public key update.

7. The firmware upgrade verification method according to claim 6, characterized in that, After the root public key update is completed, the following is also included: Digest calculation is performed on the data in the secure boot firmware package to obtain the actual digest value; When the actual digest value matches the image digest carried in the Secure Boot firmware package, the latest root public key is used to digitally verify the firmware signature data in the Secure Boot firmware package; wherein, the firmware signature data is generated based on the image digest; After the signature verification is successful, the original firmware partition is erased and new firmware data is written.

8. A vehicle-mounted electronic device, characterized in that, include: SoC chip, wherein the SoC has no OTP or eFuse unit; Non-volatile memory with a secure storage area, which stores a secure boot program and the main operating system; The secure bootloader is configured to execute the secure boot method as described in any one of claims 3-5 at each startup to establish a trusted execution environment.

9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed on a processor, implements the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Apparatus and method for secure boot-up using authorized sub-keys

    CN118591803A