A full life cycle trusted chain and fault recovery backup method and system
By leveraging the secondary central processing unit's takeover of access to the primary flash memory and the coordination of the trusted cryptographic module, the recovery problem of the trusted computing system during the primary central processing unit's reset was solved, enabling on-site recovery and security auditing, and reducing maintenance costs and business interruptions.
Patent Information
- Application Number
- CN202611632501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-20
AI Technical Summary
In existing technologies, when the trusted cryptographic module fails to perform active measurement, the main central processing unit is kept in a reset state and cannot be restored on-site, causing the device to fail to start and requiring it to be returned to the factory or hardware modifications. Furthermore, it lacks a primary/backup mechanism, resulting in high costs and demanding deployment requirements.
When the active measurement fails, the secondary central processing unit takes over the access to the first flash memory. A trusted boot chain is built through a trusted cryptographic module to achieve on-site recovery. When necessary, it switches to the backup firmware or remotely downloads the legitimate firmware, and is controlled in conjunction with hardware switching switches and logic switching circuits.
It enables on-site recovery in the event of active measurement failure, avoids disassembling flash memory or replacing trusted cryptographic modules, reduces maintenance costs, supports recovery in various failure scenarios, and meets security audit requirements.
Smart Images

Figure CN123139293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of trusted computing and firmware recovery technology for embedded systems, and in particular to a full lifecycle trusted chain and fault recovery backup method and system. Background Technology
[0002] In existing technologies, trusted computing systems typically use trusted platform modules or trusted cryptographic modules as hardware roots of trust. The TPM2.0 specification developed by the Trusted Computing Group defines concepts such as trusted metric roots, trusted storage roots, and trusted reporting roots; trusted cryptographic modules conform to GM / T0012-2020 "Trusted Computing Trusted Cryptographic Module Interface Specification" and are compatible with national cryptographic algorithms. In secure boot applications, a trusted boot chain is typically constructed by starting from the trusted root and verifying firmware legitimacy step-by-step through the boot process. Published patent CN105678162A primarily focuses on how to create a trusted boot chain; CN121509122A primarily focuses on how to securely distribute firmware upgrade packages via an OTA server.
[0003] However, the aforementioned existing technologies have the following shortcomings. First, TCM active measurement relies on non-volatile configuration. When the system is upgraded via OTA, the firmware signature value or hash value changes, requiring TCM reconfiguration. This causes a short-term interruption or reconstruction of the trusted boot chain with TCM as the root of trust. Attackers may forge legitimate firmware to bypass the trusted boot chain during this period. If a power outage or voltage fluctuation occurs during reconfiguration, active measurement configuration may fail, and the system will not boot. Second, after the initial firmware flashing during production, TCM active measurement using the old firmware's baseline value to measure the new firmware will trigger measurement failure. The TCM remains in a CPU reset state, and the system can only update the firmware via OTA, limiting the choice of production debugging and user upgrade methods. Third, when TCM active measurement fails due to production errors, firmware defects, or malicious attacks, the CPU becomes completely inoperable. Even with legitimate firmware, it cannot be flashed on-site, requiring flash memory removal, TCM replacement, or factory repair, resulting in high costs and business interruption. Fourth, single-device systems lack a primary / backup mechanism. If the trusted boot chain is attacked or experiences software anomalies, it cannot be restarted. Dual-machine primary / backup solutions are costly and have stringent deployment requirements. Fifth, the CPU cannot work after the measurement fails, and the measurement log and system log cannot be obtained, making it difficult to determine the cause of the failure and failing to meet the security audit requirements. Summary of the Invention
[0004] This invention proposes a full lifecycle trusted chain and fault recovery backup method and system, aiming to solve the technical problem in the prior art where, when the trusted cryptographic module fails to actively measure, the main central processing unit is kept reset and cannot access the first flash memory to restore the system, resulting in the device being unable to start and requiring return to the factory or hardware modification.
[0005] In a first aspect, the present invention provides a full lifecycle trusted chain and fault recovery backup method, including: After power-on, the trusted cryptographic module actively measures the boot program in the first flash memory and pulls down the reset signal of the main central processing unit during the measurement. When the measurement passes, the main central processing unit is released, and the main central processing unit loads the boot program from the first flash memory, and builds a trusted boot chain step by step with the trusted cryptographic module as the trusted root. In the event of a measurement failure, the main CPU remains reset, the secondary CPU is released, the secondary CPU runs the recovery program in the read-only memory, and access to the first flash memory is switched to the secondary CPU. The secondary central processing unit reads and verifies the firmware in the first flash memory. If it is legitimate firmware, it reconfigures the non-volatile configuration of the trusted cryptographic module and restarts the main central processing unit. If it is illegitimate firmware, it writes the legitimate firmware into the first flash memory and restarts the main central processing unit.
[0006] Further, the release of the secondary central processing unit includes: inverting the chip select signal of the first flash memory to obtain a first signal, performing a NOR operation between the first signal and the reset signal of the primary central processing unit, and outputting a reset signal of the secondary central processing unit; when the chip select signal is valid or the reset signal of the primary central processing unit is invalid, the secondary central processing unit remains reset; when the chip select signal is invalid and the reset signal of the primary central processing unit is valid, the secondary central processing unit is released.
[0007] Furthermore, after the main central processing unit starts normally, it performs active measurement initialization configuration on the trusted cryptographic module, and sets the platform-level authorization value of the trusted cryptographic module with a true random number, thus fixing the trusted boot chain modification permission in the system firmware.
[0008] Furthermore, during over-the-air upgrade download, the system enters recovery mode, writes the new firmware to the first flash memory, and updates the non-volatile configuration of the trusted cryptographic module; if an anomaly occurs during the update process or the active measurement fails, the secondary central processing unit reconfigures the non-volatile configuration of the trusted cryptographic module and restarts the main central processing unit.
[0009] Furthermore, the secondary central processing unit reads and verifies the firmware in the first flash memory, including: calculating the firmware hash value or verifying the firmware signature; if the verification result shows that the firmware in the first flash memory is legitimate firmware and belongs to the firmware upgraded via over-the-air download, then the non-volatile configuration of the trusted cryptographic module is reconfigured and restarted; if the trusted cryptographic module is misconfigured due to an unexpected power outage, then the non-volatile configuration of the trusted cryptographic module is reconfigured and restarted; if it is illegally tampered with, then the active measurement failure is determined to be caused by an attack.
[0010] Furthermore, upon determining that the modification was illegal, the secondary central processing unit issues an alarm message through a communication peripheral and loads backup firmware from backup storage, or downloads legitimate firmware from the server to the first flash memory through at least one communication channel among Ethernet, fourth-generation mobile communication, fifth-generation mobile communication, and WiFi.
[0011] Furthermore, the backup storage includes a second flash memory or a second embedded multimedia card; the main central processing unit is physically isolated from the backup storage during normal operation, and only the secondary central processing unit can access the backup storage; the secondary central processing unit performs a signature or hash verification on the backup firmware before loading it.
[0012] Furthermore, during the process of building a trusted boot chain step by step, if any firmware measurement fails, the previous firmware will write the measurement log to the log partition of the first flash memory and trigger a restart; the secondary central processor will take over, read the log partition, and determine the cause of failure by combining the measurement results of the trusted cryptographic module and output audit information.
[0013] Furthermore, when the secondary central processing unit runs the recovery program, it enters the burning mode, exclusively accesses the first flash memory, and burns legitimate firmware that can be actively measured by the trusted cryptographic module to the first flash memory via the physical interface. After the burning is completed, the main central processing unit is restarted.
[0014] Secondly, the present invention provides a full lifecycle trusted chain and fault recovery backup system, including a main central processing unit, a secondary central processing unit, a trusted cryptographic module, a hardware switching switch, a first flash memory, a read-only memory, a logic switching circuit, backup storage and communication peripherals; The trusted cryptographic module is connected to the first flash memory and the main CPU reset terminal, and is used to actively measure the boot program in the first flash memory after power-on, and pull down the chip select signal of the first flash memory and the reset signal of the main CPU during the active measurement; the main CPU is released when the active measurement is successful, and the main CPU is kept reset when the active measurement fails. The logic switching circuit is connected to the trusted cryptographic module, the chip select signal of the first flash memory, the reset terminal of the main central processing unit, and the reset terminal of the secondary central processing unit, respectively, and is used to control the secondary central processing unit to start when the active measurement fails, based on the chip select signal of the first flash memory and the reset signal of the main central processing unit. The hardware switching switch connects the main central processing unit, the secondary central processing unit, and the first flash memory, and is used to transfer access rights of the first flash memory to the main central processing unit when the main central processing unit is working normally, and to transfer access rights to the secondary central processing unit when the main central processing unit is reset. The secondary central processing unit is connected to the read-only memory, the backup storage, and the communication peripheral. It is used to run the recovery program in the read-only memory, read and verify the firmware in the first flash memory, reconfigure the non-volatile configuration of the trusted cryptographic module when the firmware is valid, and output an alarm or load the backup firmware or obtain the valid firmware through the communication peripheral when the firmware is invalid. The system is configured to perform the method described.
[0015] The technical effects of the system disclosed in this invention are: 1. By using a secondary central processing unit, read-only memory, hardware switching switch and logic switching circuit, the system automatically takes over access to the first flash memory when active measurement fails, enabling on-site recovery and avoiding the need to disassemble the flash memory, replace the trusted cryptographic module or return it to the factory for repair.
[0016] 2. After recovery, the non-volatile configuration of the trusted cryptographic module is reconfigured and the system is restarted. There is no need to disable the active measurement function, the trusted boot chain is not interrupted, and the target system version to be recovered is determined and unique.
[0017] 3. Compatible with different master control platforms, supporting recovery from various fault scenarios such as abnormal over-the-air download upgrades, unexpected power outages, and unauthorized tampering, and supporting alarm, log auditing, and backup service takeover.
[0018] 4. The recovery and backup functions can be modularly customized, which facilitates production debugging and multi-model adaptation, reducing the manufacturer's after-sales maintenance costs and the user's business interruption losses. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the TCM active measurement principle proposed in an embodiment of the present invention; Figure 2 This is a schematic diagram of the core architecture of a full lifecycle trusted chain and fault recovery backup system proposed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the main / secondary CPU switching proposed in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Addressing the technical problem mentioned in the background section where, when the trusted cryptographic module's active measurement fails, the main central processing unit remains reset and cannot access the first flash memory to restore the system, resulting in device boot failure and requiring factory return or hardware modification, this embodiment provides a full lifecycle trusted chain and fault recovery backup method. This implementation does not consider attacks launched after the embedded device is physically acquired by an attacker, such as direct modification of the printed circuit board or replacement of chip components via flying wires. Such physical attacks may prevent system recovery. The system uses a trusted cryptographic module with active measurement functionality.
[0022] Figure 1 This is a schematic diagram of the TCM active measurement principle. In the diagram, TCM is the Trusted Cryptography Module, flash memory is the flash memory, the main CPU is the central processing unit, and reset is the reset signal. The TCM is bidirectionally connected to the flash memory via a serial peripheral interface bus. A reset signal line connects the TCM to the main CPU, and a data line connects the main CPU to the flash memory. After power-on, the TCM actively measures the boot program in the flash memory. During the measurement, it pulls down the main CPU's reset signal, causing the main CPU to stop running.
[0023] Figure 2 This is a diagram of the system's core framework. In the diagram, EMMC1 is the first embedded multimedia card, the main CPU is the main central processing unit, TCM is the trusted cryptographic module, switch is the hardware switching switch, flash1 is the first flash memory, the secondary CPU is the secondary central processing unit, ROM is read-only memory, and flash2 / EMMC2 is the second flash memory or the second embedded multimedia card. The recovery and backup module includes TCM, hardware switching switch, secondary CPU, ROM, and flash2 / EMMC2. The main CPU is bidirectionally connected to EMMC1 and to the hardware switching switch. The hardware switching switch is connected to flash1 and the secondary CPU. TCM is connected to the hardware switching switch, the main CPU, and the secondary CPU. The secondary CPU is connected to ROM and flash2 / EMMC2. The logic switching circuit is connected to the main CPU, secondary CPU, and flash1 respectively. During normal system startup, the main CPU is active, and the secondary CPU is inactive; when the system needs to recover or start a backup, the main CPU is inactive, and the secondary CPU is active.
[0024] Figure 3This is a schematic diagram of the master / slave CPU switching logic. In the diagram, the TCM is connected to the corresponding SPIS_MOSI, SPIS_MISO, SPIS_CLK, and SPIS_CS# signals of the flash memory via SPIS_MOSI, SPIS_MISO, SPIS_CLK, and SPIS_CS#. Specifically, SPIS_MOSI is the master output / slave input signal, SPIS_MISO is the master input / slave output signal, SPIS_CLK is the master serial clock signal, and SPIS_CS# is the master chip select signal; conversely, SPIS_MOSI is the slave input / master output signal, SPIS_MISO is the slave output / master input signal, SPIS_CLK is the slave serial clock signal, and SPIS_CS# is the slave chip select signal. The TCM's SPIS_CS# is also connected to the input of an inverter circuit. The output of the inverter circuit is connected to one input of a logic NOR circuit. The TCM's reset# is connected to the master CPU's reset pin. The master CPU's reset pin is also connected to the other input of the logic NOR circuit. The output of the logic NOR circuit is connected to the slave CPU's reset pin, outputting reset2#. reset# is the active-low reset signal for the main CPU, and reset2# is the active-low reset signal for the secondary CPU.
[0025] The method of switching between primary and secondary CPUs is simply a digital logic. In this embodiment, it is necessary to study the delay and filtering on the PCB to prevent interference such as level jitter. For example, a 74HC7002 chip with Schmitt trigger input can be used.
[0026] The method flow of this embodiment is described in detail below according to steps one through twelve.
[0027] Step 1: System power-on and proactive measurement of trusted cryptographic module.
[0028] like Figure 1 As shown, after the system powers on, the main CPU needs to load the bootloader from the first flash memory. The first flash memory is a non-volatile storage device used in embedded systems to store the bootloader, kernel, and system firmware, such as the serial peripheral interface flash memory. When the trusted cryptographic module is configured with the active measurement function, the trusted cryptographic module pulls low the reset pin of the main CPU, preventing the main CPU from executing any program. The trusted cryptographic module measures the firmware on the first flash memory by reading the data content. If the measurement passes, the main CPU's reset pin is released, and the main CPU can normally load the bootloader from the first flash memory and start. If the measurement fails, the main CPU remains reset, and the system cannot boot. In this way, the trusted boot chain uses the trusted cryptographic module as the root of trust, ensuring the legitimacy of the bootloader.
[0029] The proactive measurement function of the trusted cryptographic module relies on its internal non-volatile storage configuration, which stores a baseline hash value or signature verification information for the firmware in the first flash memory. During proactive measurement, the trusted cryptographic module reads the firmware content from the first flash memory, calculates the hash value or performs signature verification, and compares the result with the baseline value in the non-volatile storage configuration. If they match, the measurement passes; otherwise, it fails.
[0030] Using a hardware-based trusted cryptographic module as the root of trust, the legitimacy of the boot program is guaranteed from the source of startup, preventing unauthorized firmware from running during the startup phase.
[0031] Step 2: After the active measurement passes, the main central processing unit starts up normally and the trusted chain is built step by step.
[0032] like Figure 2 As shown, the system's main CPU needs to load the boot firmware from both the first flash memory and the embedded multimedia card. Taking the boot process of Linux or Android systems commonly used in embedded devices as an example, the system boot process mainly involves the following steps: loading and running the CPU's internal boot read-only memory, loading and running the bootloader, loading and running the system kernel, and loading and running the system applications. Through dual-media booting, the bootloader portion of the firmware can be written separately into the first flash memory and measured using a trusted cryptographic module. The system then performs step-by-step verification of the firmware starting from the trusted root of trust in the trusted cryptographic module's hardware.
[0033] More preferably, the hierarchical trust principle includes, but is not limited to, the following methods: the upper-level firmware verifies the signature of the lower-level firmware, compares the hash base value, measures the firmware and extends it to the platform configuration register of the trusted cryptographic module and verifies the valid platform configuration register value, and after the firmware is encrypted, the upper-level firmware decrypts the lower-level firmware. Through one or more of the above methods, a trusted boot chain is formed from the trusted cryptographic module to the bootloader, kernel, and application.
[0034] Even if the main control CPU does not have the native ability to boot the read-only memory to verify the boot loader, this system can still achieve a trusted boot chain throughout the entire lifecycle, with strong compatibility.
[0035] Step 3: Initialize the trusted cryptographic module and set the platform-level authorization value for the main central processing unit.
[0036] During the initial firmware flashing process in production, the trusted cryptographic module is not yet configured with active measurement functionality for the first flash memory. After the main CPU loads the bootloader normally, it performs the relevant initialization configurations for trusted measurement on the trusted cryptographic module. The main CPU configures the platform-level authorization value using a true random number, fixing the modification permissions of the trusted boot chain within the system firmware. Users cannot reset the trusted cryptographic module through platform-level authorization to disable the trusted boot chain, and this does not affect the user's ability to use the trusted cryptographic module as a regular trusted platform module peripheral at the owner level.
[0037] More preferably, the platform-level authorization value is generated by the system firmware during the first boot, but it is not saved, because saving it would only increase security risks. The bootloader resets the authorization value to a new true random number every time the system boots (not just the first boot). After setting it, subsequent firmware will no longer use or be able to use the high-privilege operations at the platform level.
[0038] The truly random number is not publicly disclosed. During subsequent startup, the system firmware uses this authorization value to authorize platform-level operations of the trusted cryptography module. The owner-level authorization value can be managed by the user and used for general trusted platform module functions, such as key storage and measurement reporting.
[0039] This prevents users or attackers from disabling the active measurement function through platform-level authorization, ensuring that the trusted startup chain is not interrupted by unauthorized access throughout its entire lifecycle, while preserving the availability of the trusted cryptographic module as a regular peripheral.
[0040] Step 4: Log recording during the trusted startup chain step-by-step measurement process.
[0041] To adapt to the recovery and backup process designed in this implementation, if the firmware is tampered with and cannot boot during the process of forming a trusted boot chain through step-by-step measurement, the previous level firmware will write the measurement log information to the reserved log partition in the first flash memory and then restart. At this time, the trusted cryptographic module's active measurement fails, and after entering the recovery and backup process, the reasons for the failure of the trusted boot of the normal system can be further read and analyzed.
[0042] More preferably, the information recorded in the log partition includes the measurement object identifier, measurement time, measurement result, expected baseline value, actual calculated value, failure level, and failure reason code. The log partition can be written in an append-only manner to prevent log tampering. After the secondary central processing unit takes over, it can read the log partition, combine it with the measurement results from the trusted cryptographic module to determine the cause of failure, and output audit information.
[0043] This addresses the issue of being unable to obtain log information and analyze the cause of system failure when the system fails to start due to measurement failure, thus meeting security auditing requirements.
[0044] Step 5: Over-the-air upgrade process.
[0045] The normal system process and the over-the-air (OTA) upgrade process are described below. The OTA process is triggered after the normal system boot. When an OTA upgrade is required, the system will restart into recovery mode. Recovery mode is used for OTA upgrades and factory resets; note the distinction between this and the recovery and backup process mentioned in this invention. In systems without recovery and backup capabilities, OTA upgrades require disabling or reconfiguring the trusted cryptographic module's active measurement function based on the new firmware. Since OTA is a software-implemented upgrade process, it cannot guarantee the correct configuration of the trusted cryptographic module's active measurement function in the event of a sudden power outage or other abnormal situation, which may lead to system boot failure. Furthermore, this process temporarily interrupts the trusted root of trust of the trusted cryptographic module's protection of the firmware, posing a security risk. The recovery and backup process of this invention can resolve these issues.
[0046] More preferably, during over-the-air (OTA) upgrades, the system enters recovery mode, writes the new firmware to the first flash memory, and updates the non-volatile configuration of the trusted cryptographic module. If a power outage, voltage fluctuation, or write anomaly occurs during the update process, causing the trusted cryptographic module's active measurement to fail, the secondary central processing unit reconfigures the non-volatile configuration of the trusted cryptographic module without removing the first flash memory or replacing the trusted cryptographic module.
[0047] Incorporating firmware upgrades into the trusted protection framework prevents interruptions to the trusted boot chain due to firmware upgrades, improves system security, and ensures on-site recovery in case of upgrade anomalies.
[0048] Step 6: When active measurement fails, the primary and secondary central processing units switch mutually exclusively.
[0049] like Figure 3 As shown, a scheme for switching between the primary and secondary central processing units (CPUs) is as follows: When the trusted cryptographic module measures the first flash memory, it needs to pull low the chip select signal of the serial peripheral interface and the reset signal of the primary CPU. By inverting the chip select signal of the serial peripheral interface and performing a NOR operation with the reset signal of the primary CPU, the operation of the secondary CPU can be prevented when the measurement or the primary CPU is running. If the measurement fails and the primary CPU cannot run, the system switches to the secondary CPU operating mode. When the secondary CPU is running, a hardware switching switch enables communication between the secondary CPU and the first flash memory.
[0050] Specifically, the logic switching circuit inverts the chip select signal of the first flash memory to obtain a first signal, performs a NOR operation with the reset signal of the main CPU, and outputs the reset signal of the secondary CPU. Assuming the chip select signal is active low (CS#), the main CPU reset signal is active low (reset#), and the secondary CPU reset signal is active low (reset2#), the logical relationship is as follows: ; Among them, symbols Indicates logical NOT. This represents a logical AND operation. When the chip select signal of the first flash memory is valid (CS# = 0), or the reset signal of the main CPU is invalid (reset# = 1), the secondary CPU remains reset (reset2# = 0). When the chip select signal of the first flash memory is invalid (CS# = 1) and the reset signal of the main CPU is valid (reset# = 0), the secondary CPU is released (reset2# = 1). A valid chip select signal for the first flash memory indicates that the trusted cryptographic module is accessing the first flash memory for active measurement, or that the main CPU is accessing the first flash memory. A valid reset signal for the main CPU indicates that the main CPU is in a reset state and cannot run. Therefore, the secondary CPU is only released and running when the trusted cryptographic module is not accessing the first flash memory and the main CPU is in a reset state.
[0051] The main CPU and the secondary CPU operate mutually exclusively through hardware logic, preventing them from accessing the first flash memory simultaneously and causing conflicts. At the same time, the secondary CPU automatically takes over if the main CPU fails to boot.
[0052] Step 7: The secondary central processing unit runs the read-only memory recovery program and obtains access to the first flash memory.
[0053] When the primary CPU fails to boot after a reset, the secondary CPU can implement various recovery modes by running programs in read-only memory. The secondary CPU controls a hardware switch to transfer access to the first flash memory from the primary CPU to the secondary CPU. In this text, the hardware switch refers generally to a hardware structure, using a complementary metal-oxide-semiconductor (CMOS) analog switch as an example, that enables different components on a printed circuit board to switch access to the same component, achieving multiplexing.
[0054] More preferably, the connection between the secondary central processing unit (CPU) and the embedded multimedia card is an optional function, operating on a similar principle to the connection of the first flash memory, and can be used for firmware recovery. The secondary CPU can also connect to backup storage, which includes a second flash memory or a second embedded multimedia card, for burning backup firmware. When the primary CPU is operating normally, it is physically unable to communicate with the backup storage, preventing attackers from tampering with the backup firmware through the primary CPU. Combining this physical layer-level security mechanism with the read-only memory's function to verify the backup firmware, a secure backup system can be temporarily activated to take over the original services and provide timely alerts after an attack on the normal system.
[0055] The secondary central processing unit automatically gains access to the primary flash memory after an active measurement failure, providing the hardware foundation for on-site recovery. Furthermore, the backup storage is physically isolated from the primary central processing unit, enhancing the security of the backup firmware.
[0056] Step 8: The secondary central processing unit reads and verifies the firmware of the first flash memory.
[0057] The secondary central processing unit reads and verifies the firmware in the first flash memory. Verification methods include calculating the firmware's hash value or verifying the firmware signature. If the verification result indicates that the firmware in the first flash memory is a legitimate over-the-air (OTA) download upgrade, the non-volatile configuration of the trusted cryptographic module is reconfigured and the system restarts. If the trusted cryptographic module's configuration is incorrect due to an unexpected power outage, the non-volatile configuration of the trusted cryptographic module is reconfigured and the system restarts. If the firmware has been illegally tampered with, the active measurement failure is determined to be caused by an attack. An unexpected power outage can also cause abnormal firmware writing in the first flash memory, exhibiting similar behavior to illegal tampering.
[0058] More preferably, the firmware verification methods of the recovery module include, but are not limited to: firmware signature verification using a preset key, remote verification via a server using the measurement results from a trusted cryptographic module, and firmware verification using an external security device such as a Universal Serial Bus (USB) key. During remote verification, the secondary central processing unit (CPU) sends the firmware measurement value to the remote server, which determines the firmware's legitimacy according to a preset policy and returns the result. During external security device verification, the CPU reads the key or certificate from the external security device via the USB interface to verify the firmware signature.
[0059] Accurately distinguish between three situations: legitimate upgrades, unexpected power outages, and illegal tampering, to avoid misjudgments, ensure that the target version to be restored is certain and unique, and avoid version rollback attacks.
[0060] Step 9: Recovery of legitimate firmware and reconfiguration of the non-volatile configuration of the trusted cryptographic module.
[0061] If the secondary central processing unit reads and verifies the firmware in the primary flash memory, it determines the reason for the trusted cryptographic module's measurement failure. If the verification shows a legitimate over-the-air (OTA) upgrade, the trusted cryptographic module's active measurement configuration information is reconfigured, and the system returns to normal after a reboot. If an unexpected power outage causes an incorrect trusted cryptographic module configuration or a failed firmware upgrade, the system will still enter the recovery and backup process. The secondary central processing unit will reconfigure the trusted cryptographic module's non-volatile configuration and reboot, demonstrating a certain degree of robustness.
[0062] More preferably, when reconfiguring the non-volatile configuration of the trusted cryptographic module, the secondary central processing unit calculates a new base hash value or signature verification information based on the legitimate firmware in the first flash memory, and authorizes the write operation using the platform-level authorization value of the trusted cryptographic module. According to the TPM2.0 specification, the platform-level authorization value of the TCM / TPM is reset to null after the chip is powered on again, relying on the system firmware to configure it as a true random number during system startup. Therefore, the secondary central processing unit can directly update the non-volatile configuration without needing to obtain it from elsewhere.
[0063] The system is restored to normal operation when the trusted cryptographic module has active measurement capabilities, rather than by temporarily interrupting or reconstructing the trusted chain by disabling the active measurement function. The target system version to be restored is definite and unique.
[0064] Step 10: Alarms and remote recovery for unauthorized tampering.
[0065] If the verification indicates illegal tampering, the secondary central processing unit (CPU) issues an alarm using relevant system communication peripherals. Simultaneously, it can remotely download legitimate firmware via the network for recovery. Communication peripherals include Ethernet, 4G / 5G, WiFi, and serial ports. During remote recovery, the CPU downloads the firmware to a Double Data Rate (DDR) memory, embedded multimedia card, or secure digital card via Ethernet, 4G / 5G, or WiFi before performing the remote recovery.
[0066] More preferably, the alarm information may include device identifier, failure time, metric failure reason, firmware hash value, and attack type inference. The alarm information can be sent to the management server or administrator terminal via Simple Network Management Protocol (SMMP), Message Queuing Telemetry Transport Protocol (MQTT), email, or SMS gateway.
[0067] Timely alerts, while minimizing business impact, enable administrators to quickly learn of security incidents and take further action.
[0068] Step 11: Load backup firmware and take over services.
[0069] If the verification indicates illegal tampering, the secondary central processing unit (CPU) uses relevant system communication peripherals to issue alarm information. Simultaneously, it can load the backup firmware from the backup storage to restore some or all of the service functions. The backup module's functionality can be adapted to some or all of the functions as needed. This can range from enabling basic functions such as alarms, log recording, and retrieval to running some or all of the original firmware services based on the performance of the secondary CPU to achieve reconnection and restoration of the original device's services.
[0070] More preferably, the secondary central processing unit (CPU) performs a signature or hash verification on the backup firmware before loading it. The backup firmware is stored in a second flash memory or a second embedded multimedia card. During normal operation, the primary CPU is physically isolated from the backup storage, and only the secondary CPU can access the backup storage. The secondary CPU runs some or all of the services in the backup firmware according to its own performance, and takes over the network connection or service port of the original device through communication peripherals to achieve service reconnection.
[0071] After a normal system is attacked, a secure backup system is temporarily activated to take over the original business, avoiding business shutdown and reducing reliance on and costs associated with a dual-machine primary / backup solution.
[0072] Step 12: Restart and audit after recovery.
[0073] After recovery is complete, the secondary central processing unit (CPU) restarts the primary CPU. Upon power-up of the primary CPU, the trusted cryptographic module re-executes the active measurement. If the measurement passes, the primary CPU starts up normally and resumes operations. The secondary CPU writes the operation records, measurement logs, alarm information, and recovery results from the recovery process to the log partition of the primary flash memory or backup storage for security auditing and fault analysis.
[0074] More preferably, the log information includes the recovery mode, recovery time, firmware versions before and after recovery, non-volatile configuration update records of the trusted cryptographic module, remote download source, and backup firmware version. The logs can be protected for integrity using hash chains or signatures.
[0075] Achieve full lifecycle trusted chain protection, build trusted measurement links in normal startup, over-the-air download upgrade, recovery and backup processes, and meet audit requirements.
[0076] Based on the same inventive concept, this embodiment also provides a full lifecycle trusted chain and fault recovery backup system, characterized in that it includes a main central processing unit, a secondary central processing unit, a trusted cryptographic module, a hardware switching switch, a first flash memory, a read-only memory, a logic switching circuit, backup storage, and communication peripherals. The trusted cryptographic module is connected to the first flash memory and the main CPU reset terminal, and is used to actively measure the boot program in the first flash memory after power-on, and pull down the chip select signal of the first flash memory and the reset signal of the main CPU during the active measurement; the main CPU is released when the active measurement is successful, and the main CPU is kept reset when the active measurement fails. The logic switching circuit is connected to the trusted cryptographic module, the chip select signal of the first flash memory, the reset terminal of the main central processing unit, and the reset terminal of the secondary central processing unit, respectively, and is used to control the secondary central processing unit to start when the active measurement fails, based on the chip select signal of the first flash memory and the reset signal of the main central processing unit. The hardware switching switch connects the main central processing unit, the secondary central processing unit, and the first flash memory, and is used to transfer access rights of the first flash memory to the main central processing unit when the main central processing unit is working normally, and to transfer access rights to the secondary central processing unit when the main central processing unit is reset. The secondary central processing unit is connected to the read-only memory, the backup storage, and the communication peripheral. It is used to run the recovery program in the read-only memory, read and verify the firmware in the first flash memory, reconfigure the non-volatile configuration of the trusted cryptographic module when the firmware is valid, and output an alarm or load the backup firmware or obtain the valid firmware through the communication peripheral when the firmware is invalid. The system is configured to perform the method described.
[0077] The recovery module includes a secondary central processing unit (CPU), a trusted cryptographic module, a read-only memory (ROM), optional first flash memory, and an embedded multimedia card. The recovery module can be directly integrated onto the printed circuit board (PCB) where the main CPU resides, or it can be fabricated as a separate PCB daughterboard to decouple the root of trust function, adapting to different device models. The software functions implemented by the ROM can be partially or fully integrated into the recovery and backup module to achieve a balance between cost and functional requirements for different models in actual production.
[0078] More preferably, the firmware recovery methods provided by the recovery module include, but are not limited to: wired burning via a secondary central processing unit (CPU) using a physical interface such as a serial port to enter the CPU burning mode; and remote recovery after downloading firmware to a double data rate memory, embedded multimedia card, or secure digital card via Ethernet, 4G, 5G, or WiFi channels. The firmware verification methods of the recovery module include, but are not limited to: firmware signature verification using a preset key; remote verification via a server using a trusted cryptographic module to measure the results; and firmware verification using an external security device such as a Universal Serial Bus (USB) key. The backup module functionality can be adapted to some or all functions as needed. It can be a device backup module enabling basic functions such as alarms, log recording, and retrieval, or it can leverage the performance of the secondary CPU to run some or all of the original firmware services to achieve reconnection and recovery of the original device's services.
[0079] Term Interpretation: Printed Circuit Board is the Chinese translation of "印制电路板". Trusted cryptography module is the Chinese translation of "可信密码模块", which is a hardware module of the trusted computing platform, provides cryptographic operation functions for the trusted computing platform, has a protected storage space, is a domestic research in China, and corresponds to the trusted platform module. Non-Volatile Memory is the Chinese translation of "非易失性存储", which specifically refers to the non-volatile storage space in the trusted cryptography module in this text. Trusted Platform Module is the Chinese translation of "可信平台模块", which is a chip embedded in a computer to provide a trust root for the computer, and the specifications of this chip are formulated by the Trusted Computing Group. Over-the-Air Technology is the Chinese translation of "空中下载技术", which is used for remote firmware upgrade. Flash Memory is the Chinese translation of "闪存", which is a non-volatile storage device that combines the characteristics of read-only memory and random access memory. It not only has the performance of electronic erasable programmability, but also can keep data from being lost after power off. Embedded Multi Media Card is the Chinese translation of "嵌入式多媒体卡", which is an embedded memory standard specification formulated by the MultiMediaCard Association, and is mainly applied in mobile devices such as smart phones and tablet computers. Read-Only Memory is the Chinese translation of "只读存储器", which works in a non-destructive readout mode, can only read information and cannot write information. Once the information is written, it is fixed, and the information will not be lost even if the power is cut off. The changeover switch in this text generally refers to a hardware structure that takes a complementary metal-oxide-semiconductor analog switch as an example, and realizes different components on the printed circuit board to switch and access the same component to implement multiplexing. BootRom is the Chinese translation of "启动只读存储器", which is a small piece of mask read-only memory or write-protected flash memory embedded in the processor chip, and is responsible for executing the first piece of code when the processor is powered on or reset. Bootloader is the Chinese translation of "启动引导程序", which is implemented depending on a specific hardware platform, runs before the operating system kernel, and is responsible for initializing hardware devices, establishing a memory space map, and preparing a correct environment for finally calling the operating system kernel. The platform level and the owner level are two of the three authorization levels (i.e., the platform level, the owner level and the endorsement level) defined in the TPM2.0 specification. The permission of the platform level can reset the trusted platform module and delete persistently stored information, so it can be used to turn off the active measurement function, and it is not recommended for users to control the permission of this level. Figure 2 The hardware changeover switch therein is a switch, which is used to switch the access path of the first flash memory. Figure 3In the above, SPIM_MOSI is the master output and slave input signal, SPIM_MISO is the master input and slave output signal, SPIM_CLK is the master serial clock signal, SPIM_CS# is the master chip select signal, SPIS_MOSI is the slave input and master output signal, SPIS_MISO is the slave output and master input signal, SPIS_CLK is the slave serial clock signal, and SPIS_CS# is the slave chip select signal.
[0080] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A full lifecycle trusted chain and fault recovery backup method, characterized in that, include: After power-on, the trusted cryptographic module actively measures the boot program in the first flash memory and pulls down the reset signal of the main central processing unit during the measurement. When the measurement passes, the main central processing unit is released, and the main central processing unit loads the boot program from the first flash memory, and builds a trusted boot chain step by step with the trusted cryptographic module as the trusted root. In the event of a measurement failure, the main CPU remains reset, the secondary CPU is released, the secondary CPU runs the recovery program in the read-only memory, and access to the first flash memory is switched to the secondary CPU. The secondary central processing unit reads and verifies the firmware in the first flash memory. If it is legitimate firmware, it reconfigures the non-volatile configuration of the trusted cryptographic module and restarts the main central processing unit. If it is illegitimate firmware, it writes the legitimate firmware into the first flash memory and restarts the main central processing unit.
2. The method according to claim 1, characterized in that, The release of the secondary central processing unit includes: inverting the chip select signal of the first flash memory to obtain a first signal; performing a NOR operation between the first signal and the reset signal of the primary central processing unit to output a reset signal for the secondary central processing unit; when the chip select signal is valid or the reset signal of the primary central processing unit is invalid, the secondary central processing unit remains reset; when the chip select signal is invalid and the reset signal of the primary central processing unit is valid, the secondary central processing unit is released.
3. The method according to claim 1, characterized in that, After the main central processing unit starts normally, it performs active measurement initialization configuration on the trusted cryptographic module, sets the platform-level authorization value of the trusted cryptographic module with a true random number, and fixes the trusted boot chain modification permission in the system firmware.
4. The method according to claim 1, characterized in that, During over-the-air (OTA) upgrade download, the system enters recovery mode, writes the new firmware to the first flash memory, and updates the non-volatile configuration of the trusted cryptographic module. If an anomaly occurs during the update process or the active measurement fails, the secondary central processing unit reconfigures the non-volatile configuration of the trusted cryptographic module and restarts the primary central processing unit.
5. The method according to claim 4, characterized in that, The secondary central processing unit reads and verifies the firmware in the first flash memory, including: calculating the firmware hash value or verifying the firmware signature; if the verification result shows that the firmware in the first flash memory is legitimate firmware and belongs to the firmware upgraded via over-the-air download, then the non-volatile configuration of the trusted cryptographic module is reconfigured and restarted; if the trusted cryptographic module is misconfigured due to an unexpected power outage, then the non-volatile configuration of the trusted cryptographic module is reconfigured and restarted; if it is illegally tampered with, then the active measurement failure is determined to be caused by an attack.
6. The method according to claim 5, characterized in that, Upon determination of illegal tampering, the secondary central processing unit issues an alarm message through communication peripherals and loads backup firmware from backup storage, or downloads legitimate firmware from the server to the first flash memory through at least one communication channel among Ethernet, fourth-generation mobile communication, fifth-generation mobile communication, and WiFi.
7. The method according to claim 6, characterized in that, The backup storage includes a second flash memory or a second embedded multimedia card; the main central processing unit is physically isolated from the backup storage during normal operation, and only the secondary central processing unit can access the backup storage. Before loading the backup firmware, the secondary central processing unit first performs a signature or hash verification on the backup firmware.
8. The method according to claim 1, characterized in that, During the process of building a trusted boot chain step by step, if any firmware measurement fails, the previous firmware will write the measurement log to the log partition of the first flash memory and then trigger a reboot. After taking over, the secondary central processing unit reads the log partition, combines the measurement results of the trusted cryptographic module to determine the cause of failure, and outputs audit information.
9. The method according to claim 1, characterized in that, When the secondary central processing unit runs the recovery program, it enters the burning mode, exclusively accesses the first flash memory, and burns legitimate firmware that can be actively measured by the trusted cryptographic module to the first flash memory via the physical interface. After the burning is completed, the main central processing unit is restarted.
10. A full lifecycle trusted chain and fault recovery backup system, characterized in that, It includes a main central processing unit, a secondary central processing unit, a trusted cryptographic module, a hardware switching switch, a first flash memory, a read-only memory, a logic switching circuit, backup storage, and communication peripherals; The trusted cryptographic module is connected to the first flash memory and the main CPU reset terminal, and is used to actively measure the boot program in the first flash memory after power-on, and pull down the chip select signal of the first flash memory and the reset signal of the main CPU during the active measurement; the main CPU is released when the active measurement is successful, and the main CPU is kept reset when the active measurement fails. The logic switching circuit is connected to the trusted cryptographic module, the chip select signal of the first flash memory, the reset terminal of the main central processing unit, and the reset terminal of the secondary central processing unit, respectively, and is used to control the secondary central processing unit to start when the active measurement fails, based on the chip select signal of the first flash memory and the reset signal of the main central processing unit. The hardware switching switch connects the main central processing unit, the secondary central processing unit, and the first flash memory, and is used to transfer access rights of the first flash memory to the main central processing unit when the main central processing unit is working normally, and to transfer access rights to the secondary central processing unit when the main central processing unit is reset. The secondary central processing unit is connected to the read-only memory, the backup storage, and the communication peripheral. It is used to run the recovery program in the read-only memory, read and verify the firmware in the first flash memory, reconfigure the non-volatile configuration of the trusted cryptographic module when the firmware is valid, and output an alarm or load the backup firmware or obtain the valid firmware through the communication peripheral when the firmware is invalid. The system is configured to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
TPM-based control method for safe startup of operating system
CN105678162A
Domain control electrical architecture vehicle OTA information security protection method and system
CN121509122A
