A firmware flashing method, device, storage medium and electronic device
Signature encryption and decryption through the public key and private key set by the management platform, and use trusted components to verify the integrity of the flashing tool and firmware, solving the problem of public key leakage or tampering by the device manufacturer, and realizing the autonomy of the firmware of functional equipment Controllability and security guarantee.
Patent Information
- Application Number
- CN202111432714.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In the prior art, the public key provided by the equipment manufacturer may be leaked or tampered, resulting in the integrity verification of the firmware of the functional device that is not reliable enough, and the firmware is lacking in independent controllability during the firmware flashing process, making it difficult to ensure the security of the firmware.
The public and private keys set by the management platform are used for signature encryption and decryption, and the integrity of the flashing tool and new functional firmware are verified through trusted components to ensure the security and integrity of the flashing process.
It realizes independent controllable integrity verification and security guarantee of the firmware of functional equipment, avoids malicious tampering and intrusion of firmware, and ensures the integrity and security of the firmware.
Smart Images

Figure CN114237637B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a firmware flashing method, device, storage medium and electronic device. Background Art
[0002] Before introducing and using functional devices such as servers, computers, graphics cards, etc. produced by device manufacturers, the integrity of the functional devices will be checked using the public keys provided by the manufacturers. However, the private keys used by the manufacturers to sign and encrypt the functional devices may be leaked or tampered with. In addition, the existing technology also uses the public keys provided by the manufacturers to verify the integrity of the firmware when flashing the firmware of the functional devices. Therefore, it is necessary to provide a more secure firmware flashing solution that can achieve autonomous and controllable integrity verification. Summary of the invention
[0003] The embodiments of this specification provide a firmware flashing method, device, storage medium and electronic device, which can use the public key and private key set by the management platform for signing and decrypting, so as to realize the autonomous control of the firmware flashing, security assurance and integrity verification of the functional equipment, and flashing can be performed after verifying the integrity of the flashing tool and the newly added functional firmware, so as to avoid the firmware from being maliciously tampered with or invaded, and ensure the integrity and security of the firmware.
[0004] In a first aspect, an embodiment of the present specification provides a firmware flashing method, the method comprising:
[0005] Obtain a flashing request for the new function firmware and verify the integrity of the flashing tool based on the trusted component;
[0006] If the integrity verification of the flashing tool succeeds, the integrity of the newly added function firmware is verified based on the transaction public key in the signature verification firmware, the newly added function firmware is the newly added functional firmware signed based on the transaction private key, and the transaction public key and the transaction private key are the verification key pair set for the functional device based on the trusted component;
[0007] If the integrity verification of the newly added function firmware is successful, the flashing tool is used to flash the newly added function firmware.
[0008] In a second aspect, an embodiment of the present specification provides a firmware flashing method, the method comprising:
[0009] Acquire a first functional firmware for a functional device, where the first functional firmware is an initial functional firmware signed by a device manufacturer using a manufacturer's private key;
[0010] Using the manufacturer's public key to verify the integrity of the first functional firmware;
[0011] If the integrity verification of the first functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component;
[0012] The first functional firmware is signed using the transaction private key to obtain initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
[0013] In a third aspect, an embodiment of the present specification provides a firmware flashing device, the device comprising:
[0014] A tool verification module is used to obtain a flashing request for the newly added function firmware and verify the integrity of the flashing tool based on the trusted component;
[0015] A firmware verification module, configured to, if the integrity verification of the flashing tool succeeds, perform integrity verification on the newly added function firmware based on the transaction public key in the signature verification firmware, wherein the newly added function firmware is the newly added functional firmware signed based on the transaction private key, and the transaction public key and the transaction private key are a verification key pair set for the functional device based on a trusted component;
[0016] The firmware flashing module is used to flash the new function firmware using the flashing tool if the integrity verification of the new function firmware is successful.
[0017] In a fourth aspect, an embodiment of the present specification provides a firmware flashing device, the device comprising:
[0018] A firmware acquisition module, used to acquire a first functional firmware for a functional device, where the first functional firmware is an initial functional firmware signed by a device manufacturer using a manufacturer's private key;
[0019] A manufacturer verification module, used to verify the integrity of the first functional firmware using the manufacturer's public key;
[0020] A key acquisition module, configured to generate a transaction private key and a transaction public key corresponding to the functional device based on a trusted component if the integrity verification of the first functional firmware succeeds;
[0021] The firmware signing module is used to use the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and flash the initial functional firmware and the transaction public key to the functional device.
[0022] In a fifth aspect, an embodiment of the present specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0023] In a sixth aspect, an embodiment of the present specification provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0024] In the embodiment of the present specification, the management platform uses the manufacturer's public key to perform integrity verification on the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the transaction private key is used to sign the first functional firmware to obtain the initial functional firmware. The initial functional firmware and the transaction public key are flashed to the functional device. The functional device obtains a flashing request for the newly added functional firmware, and the integrity of the flashing tool is verified based on the trusted component. If the integrity verification of the flashing tool is successful, the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Before the functional device is introduced, the integrity of the first functional firmware is verified with the manufacturer's public key, and the public key and private key set by the management platform are used for signature encryption and decryption, so as to realize the autonomous control of the firmware flashing, security assurance, and integrity verification of the functional device, and the flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified, so as to avoid malicious tampering and intrusion of the firmware, and ensure the integrity and security of the firmware. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 This is an example schematic diagram of a functional firmware signature provided in an embodiment of this specification;
[0027] Figure 2 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0028] Figure 3 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0029] Figure 4 This is an example schematic diagram of flashing a functional device provided in an embodiment of this specification;
[0030] Figure 5 This is an example schematic diagram of flashing a functional device provided in an embodiment of this specification;
[0031] Figure 6 This is an example schematic diagram of flashing a functional device provided in an embodiment of this specification;
[0032] Figure 7 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0033] Figure 8 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0034] Fig. 9 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0035] Fig.10 It is a flowchart of a firmware flashing method provided in an embodiment of this specification;
[0036] Fig.11 It is a structural diagram of a firmware flashing device provided in an embodiment of this specification;
[0037] Fig.12 It is a structural diagram of a firmware flashing device provided in an embodiment of this specification;
[0038] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of this specification;
[0039] Fig.14 It is a structural diagram of a firmware flashing device provided in an embodiment of this specification;
[0040] Fig.15 It is a structural diagram of a firmware flashing device provided in an embodiment of this specification;
[0041] Fig.16 It is a structural schematic diagram of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0043] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood in specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0044] The firmware flashing method provided in the embodiment of this specification can be implemented by a computer program and can be run on a firmware flashing device based on the von Neumann system. The computer program can be integrated in an application or run as an independent tool application. The firmware flashing device in the embodiment of this specification can be a functional device or a module in a functional device that can implement the firmware flashing method. The firmware in the embodiment of this specification is a program written into an erasable programmable read-only memory (EPROM) or an electrically erasable programmable read-only memory (EEPROM) of a functional device. It is a software that serves as the system foundation and underlying work of the functional device, and also determines the function and performance of the functional device. The firmware flashing device in the embodiment of this specification can be a management platform or a module in a management platform that can implement the firmware flashing method. The management platform can be a transaction party server or management system that implements the firmware flashing method and manages the firmware in the functional device. The functional device may be a server, a computer, a graphics card, a sound card, or other device. A trusted component may exist in the functional device in the embodiments of the present specification. The trusted component may be stored in the functional device in the form of trusted firmware, or may be installed in the functional device in the form of a trusted chip or a trusted card, or may be set in a processor core. The trusted component may specifically be a trusted root that supports trusted computing in the functional device, and because it exists in the functional device in the form of firmware, a chip, a card, etc., the trusted component does not rely on the Core Root Of Trust For Measurement (CRTM) in the trusted computing. It can be understood that even if the CRTM is maliciously tampered with, it will not affect the accuracy of the trusted computing based on the trusted component in the functional device.
[0045] Functional devices are produced and shipped by the device manufacturer. When the device manufacturer ships the functional device, the first functional firmware will be written into the functional device. The first functional firmware is the initial functional firmware obtained after the device manufacturer signs it with the manufacturer's private key, and is used to implement initialization functions of the functional device such as input and output. The manufacturer's private key and the manufacturer's public key are the verification key pair set by the device manufacturer. The device manufacturer can sign the first functional firmware with the manufacturer's private key, and then send the manufacturer's public key to the management platform. The management platform can decrypt the first functional firmware based on the manufacturer's public key, and judge whether the first functional firmware is complete and tampered with through the decryption result, and can also judge whether the first functional firmware is produced by the device manufacturer.
[0046] See also Figure 1, an example schematic diagram of a functional firmware signature is provided for the embodiment of this specification. Before the functional device is shipped out of the factory, the device manufacturer will sign the functional firmware in the functional device with the manufacturer's private key to obtain the first functional firmware, and then write the first functional firmware into the functional device, and send the manufacturer's public key that matches the manufacturer's private key to the management platform. Before introducing, using, and installing the functional device, the integrity of the functional firmware in the functional device needs to be verified through the management platform to ensure that the functional firmware in the functional device provided by the device manufacturer is provided by the device manufacturer, and is complete and has not been tampered with. Therefore, the management platform can obtain the first functional firmware in the functional device and use the manufacturer's public key to verify the integrity of the first functional firmware. If the integrity verification of the first functional firmware passes, the management platform can use the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and then write the initial functional firmware into the functional device.
[0047] It is understandable that the trusted component can be the unique identification information in the functional device, and the management platform can generate a verification key pair, namely, a transaction private key and a transaction private key, based on the trusted component of the functional device. In this way, when it is necessary to introduce, use, or install a functional device, or when it is necessary to flash the firmware of the functional device, the transaction public key provided by the management platform can be used to verify the integrity of the firmware in the functional device, thus avoiding security issues caused by the leakage or tampering of the manufacturer's private key of the device manufacturer.
[0048] The firmware flashing method provided in this specification is described in detail below in conjunction with specific embodiments.
[0049] See also Figure 2 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Figure 2 As shown, the embodiments of this specification are described from both the functional device side and the management platform side, and the method may include the following steps S102-S116.
[0050] S102: The management platform obtains a first functional firmware for a functional device.
[0051] Specifically, the device manufacturer sends the functional device or the first functional firmware of the functional device to the management platform for verification or acceptance by the management platform. The first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key. The device manufacturer can also send the manufacturer's public key that matches the manufacturer's private key to the management platform, and the management platform obtains the first functional firmware in the functional device.
[0052] S104: The management platform uses the manufacturer's public key to verify the integrity of the first functional firmware.
[0053] Specifically, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware. For example, in addition to the first functional firmware and the manufacturer's public key, the device manufacturer will also send the unsigned initial functional firmware to the management platform. The management platform uses the manufacturer's public key to decrypt the first functional firmware. If the first functional firmware can be decrypted by the manufacturer's public key, it means that the first functional firmware is generated by the device manufacturer. Then the management platform performs a hash calculation on the decrypted result to obtain a first hash value. The management platform directly performs a hash calculation on the initial functional firmware to obtain a second hash value. If the first hash value is the same as the second hash value, it means that the first functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the first functional firmware is successful. On the contrary, if the manufacturer's public key cannot decrypt the first functional firmware, or the first hash value is different from the second hash value, then the first functional firmware is not generated by the device manufacturer, or the first functional firmware is incomplete and has been tampered with, that is, the integrity verification of the first functional firmware fails.
[0054] S106: If the integrity verification of the first functional firmware succeeds, the management platform generates a transaction private key and a transaction public key corresponding to the functional device based on the trusted component.
[0055] Specifically, if the integrity verification of the first functional firmware succeeds, the management platform may generate a verification key pair corresponding to the functional device, ie, a transaction public key and a transaction private key, based on the trusted components in the functional device.
[0056] S108, the management platform uses the transaction private key to sign the first functional firmware to obtain the initial functional firmware.
[0057] Specifically, the management platform may use the transaction private key to sign the first functional firmware to obtain the initial functional firmware.
[0058] S110, the management platform flashes the initial functional firmware and the transaction public key to the functional device.
[0059] Specifically, the management platform can flash the initial functional firmware and transaction public key into the functional device. The management platform can generate the signature verification firmware based on the transaction public key, and then flash the signature verification firmware and the initial functional firmware partition into the functional device. Since the transaction public key exists in the signature verification firmware, the signature verification firmware can be used to verify the integrity of the initial functional firmware and the newly added functional firmware that needs to be flashed into the functional device. Therefore, the partition storage of the signature verification firmware and the initial functional firmware can prevent the signature verification firmware from being disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device.
[0060] Optionally, the management platform can also send the transaction private key to the signature server for storage as a backup and reserve for the transaction private key. The signature server also has a trusted component corresponding to the signature server. The trusted component corresponding to the signature server also exists in the signature server in the form of a trusted firmware or a trusted chip. The signature server can use the trusted component to ensure the integrity of the transaction private key. It is understandable that the signature server can be a management platform or a service device that is distinguished from the management platform and independently stores private keys and public keys.
[0061] S112, the functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component.
[0062] Specifically, the functional device obtains a flashing request for newly added functional firmware. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The newly added functional firmware can be the functional firmware that needs to be newly added to the functional device and is different from the initial functional firmware, or it can be the functional firmware that replaces the initial functional firmware, or it can be the part of the initial functional firmware after flashing that is changed from the initial functional firmware before flashing. It is understandable that the flashing tool may be maliciously tampered with. If a tampered and unsafe flashing tool is used for flashing, the firmware of the functional device may be maliciously invaded and changed. Therefore, before using the flashing tool, the functional device can use a trusted component to perform a trusted operation on the flashing tool to complete the integrity verification of the flashing tool.
[0063] S114: If the integrity verification of the flashing tool is successful, the functional device performs integrity verification on the newly added functional firmware based on the transaction public key in the signature verification firmware.
[0064] Specifically, if the integrity verification of the flashing tool is successful, the functional device can start the flashing tool, and then use the transaction public key in the signature verification firmware to verify the integrity of the newly added functional firmware. It can be understood that the newly added functional firmware is also signed by the transaction private key. The functional device can use the transaction public key to decrypt the newly added functional firmware. If it can be decrypted successfully, it means that the newly added functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the newly added functional firmware is successful. On the contrary, if the transaction public key cannot be used to decrypt the newly added functional firmware, it means that the newly added functional firmware is incomplete and unsafe, indicating that the integrity verification of the newly added functional firmware has failed, and the newly added functional firmware cannot be flashed.
[0065] S116, if the integrity verification of the new function firmware is successful, the functional device uses a flashing tool to flash the new function firmware.
[0066] Specifically, if the integrity verification of the flashing tool succeeds and the integrity verification of the newly added function firmware succeeds, it means that the flashing tool is safe and trustworthy, the newly added function firmware is also safe and trustworthy, and the functional device can use the flashing tool to flash the newly added function firmware.
[0067] In the embodiment of the present specification, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the first functional firmware is signed with the transaction private key to obtain the initial functional firmware. The initial functional firmware and the transaction public key are flashed to the functional device. The functional device obtains a flashing request for the newly added functional firmware, and the integrity of the flashing tool is verified based on the trusted component. If the integrity verification of the flashing tool is successful, the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Before the functional device is introduced, the integrity of the first functional firmware is verified with the manufacturer's public key, and the public key and private key set by the management platform are used for signature encryption and decryption, so as to realize the autonomous control of the firmware flashing, security assurance, and integrity verification of the functional device, and the flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified, so as to avoid malicious tampering and intrusion of the firmware, and ensure the integrity and security of the firmware.
[0068] See also Figure 3 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Figure 3 As shown, the embodiments of this specification are described from both the functional device side and the management platform side, and the method may include the following steps S202-S220.
[0069] S202: The management platform obtains a first functional firmware for a functional device.
[0070] For details, please refer to S102, which will not be described here in detail.
[0071] S204: The management platform uses the manufacturer's public key to verify the integrity of the first functional firmware.
[0072] For details, please refer to S104, which will not be described here in detail.
[0073] S206: If the integrity verification of the first functional firmware succeeds, the management platform generates a transaction private key and a transaction public key corresponding to the functional device based on the trusted component.
[0074] Specifically, if the integrity verification of the first functional firmware succeeds, the management platform may generate a verification key pair corresponding to the functional device, ie, a transaction public key and a transaction private key, based on the trusted components in the functional device.
[0075] S208, the management platform uses the transaction private key to sign the first functional firmware to obtain the initial functional firmware.
[0076] Specifically, the management platform may use the transaction private key to sign the first firmware to obtain the initial functional firmware.
[0077] It is understandable that there are three situations when the device manufacturer sends the first function firmware to the management platform for acceptance:
[0078] One situation is that the device manufacturer directly gives the functional device with the first functional firmware flashed to the management platform. The management platform needs to obtain the first functional firmware from the functional device, and perform integrity verification, signature processing and other steps on the first functional firmware to obtain the initial functional firmware, i.e., S204-S208. At this time, the management platform needs to flash the initial functional firmware into the functional device.
[0079] One situation is that the device directly sends the first functional firmware signed by the manufacturer's private key to the management platform after leaving the factory. The management platform can directly verify the integrity of the first functional firmware, that is, S204-S206. At this time, the management platform can use the transaction private key to sign the first functional firmware to obtain the initial functional firmware. Since the management platform cannot directly flash the initial functional firmware into the functional device, the management platform needs to send the initial functional firmware and the transaction public key to the device manufacturer. The device manufacturer can generate a signature verification firmware based on the transaction public key, and then flash the signature verification firmware and the initial functional firmware partitions into the functional device.
[0080] One situation is that the device manufacturer directly sends the first functional firmware that has been processed using the manufacturer's private key to the management platform. The management platform can use the manufacturer's public key to verify the integrity of the first functional firmware. If the integrity verification of the first functional firmware is successful, the management platform can generate the access private key and access public key corresponding to the functional device based on the trusted component, and then use the access private key to sign the first functional firmware to obtain the second functional firmware. Since the management platform cannot directly write the second functional firmware to the functional device, it is necessary to send the second functional firmware and the access public key to the device manufacturer, and the device manufacturer will write the second functional firmware and the access public key to the functional device. It can be understood that although the second functional firmware and the access private key generated by the trusted component are signed, the functional device is still at risk of malicious tampering and intrusion at the device factory. Therefore, before accessing and using the functional device, the management platform needs to obtain the second functional firmware from the functional device and use the access public key to verify the integrity of the second functional firmware. If the access public key can decrypt the second functional firmware, it means that the integrity verification of the second functional firmware is successful. The management platform can generate the transaction private key and transaction public key corresponding to the functional device based on the trusted component, and then use the transaction private key to sign the second functional firmware to obtain the initial functional firmware.
[0081] S210: The management platform generates a signature verification firmware based on the transaction public key.
[0082] Specifically, the management platform may generate the signature verification firmware based on the transaction public key, that is, the signature verification firmware includes the transaction public key.
[0083] S212: The management platform flashes the initial functional firmware and the signature verification firmware partitions to the functional device.
[0084] Specifically, the management platform can flash the signature verification firmware and the initial functional firmware partitions into the functional device. Since the signature verification firmware contains the transaction public key, the signature verification firmware can be used to verify the integrity of the initial functional firmware, the new functional firmware that needs to be flashed into the functional device later, and other functional firmware. Therefore, the partitioned storage of the signature verification firmware and the initial functional firmware can prevent the signature verification firmware from being disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device.
[0085] Optionally, since the signature verification firmware contains the transaction public key, and the initial functional firmware and the newly added functional firmware are signed by the transaction private key, the transaction public key in the signature verification firmware must be used for integrity verification, so the integrity and security of the signature verification firmware are very important. After the signature verification firmware is flashed into the functional device, the trusted components in the functional device can be used to ensure the integrity of the signature verification firmware.
[0086] S214, if the management platform detects an access request from a functional device, the management platform uses the transaction public key to verify the integrity of the initial functional firmware. If the integrity verification of the initial functional firmware succeeds, the functional device is accessed.
[0087] Specifically, when there is a need to access and use a functional device, such as when a server needs to be enabled or a graphics card needs to be installed in a computer and used, the functional device will send an access request to the management platform. When the management platform detects the access request of the functional device, it will use the transaction public key to verify the integrity of the initial functional firmware of the functional device. If the transaction public key can decrypt the initial functional firmware, it means that the integrity verification of the initial functional firmware is successful, it is safe and has not been tampered with, then the management platform can allow access to the functional device.
[0088] It can be understood that the three situations in S208 when the device manufacturer sends the first functional firmware to the management platform for acceptance correspond to different flashing methods for the functional devices.
[0089] Please also see Figure 4 , an example schematic diagram of flashing a functional device is provided for an embodiment of this specification. If the device manufacturer directly gives the functional device flashed with the first functional firmware to the management platform, the management platform verifies the integrity of the first functional firmware, and then uses the transaction private key to sign the first functional firmware to obtain the initial functional firmware, generates the signature verification firmware based on the transaction public key, and the management platform flashes the initial functional firmware and the signature verification firmware partitions to the functional device. If the management platform detects an access request from the functional device, it is necessary to verify the integrity of the initial functional firmware before accessing the functional device.
[0090] Please also see Figure 5 , an example schematic diagram of flashing a functional device is provided for an embodiment of this specification. If the device manufacturer only sends the first functional firmware to the management platform, the management platform verifies the integrity of the first functional firmware, signs the first functional firmware with the transaction private key to obtain the initial functional firmware, and sends the initial functional firmware and the transaction public key to the device manufacturer. The device manufacturer generates the signature verification firmware according to the transaction public key, and flashes the initial functional firmware and the signature verification firmware partitions to the functional device. If the management platform detects an access request from the functional device, it is also necessary to verify the integrity of the initial functional firmware before accessing the functional device.
[0091] Please also see Figure 6, an example schematic diagram of flashing a functional device is provided for an embodiment of this specification. If the device manufacturer only sends the first functional firmware to the management platform, the management platform verifies the integrity of the first functional firmware, signs the first functional firmware with an access private key to obtain a second functional firmware, and sends the second functional firmware and the access public key to the device manufacturer. The device manufacturer flashes the initial functional firmware and the access public key to the functional device, and then the device manufacturer sends the functional device to the management platform. The management platform verifies the integrity of the second functional firmware, signs the second functional firmware with a transaction private key to obtain the initial functional firmware, generates a signature verification firmware based on the transaction public key, and flashes the initial functional firmware and the signature verification firmware partitions to the functional device. If the management platform detects an access request from the functional device, it is not necessary to perform an integrity check on the initial functional firmware and directly access the functional device.
[0092] S216, the functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component.
[0093] Specifically, the functional device obtains a flashing request for newly added functional firmware. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The newly added functional firmware can be the functional firmware that needs to be newly added to the functional device and is different from the initial functional firmware, or it can be the functional firmware that replaces the initial functional firmware, or it can be the part of the initial functional firmware after flashing that is changed from the initial functional firmware before flashing. It is understandable that the flashing tool may be maliciously tampered with. If a tampered and unsafe flashing tool is used for flashing, the firmware of the functional device may be maliciously invaded and changed. Therefore, before using the flashing tool, the functional device can use a trusted component to perform a trusted operation on the flashing tool to complete the integrity verification of the flashing tool.
[0094] S218, if the integrity verification of the flashing tool succeeds, the functional device introduces the functional firmware into the cache component of the functional device, and in the cache component, the integrity of the functional firmware is verified based on the transaction public key in the signature verification firmware.
[0095] Specifically, if the integrity verification of the flashing tool is successful, the functional device can start the flashing tool, and then the functional device can introduce the functional firmware into the cache component of the functional device. The cache component can be the EPROM or EEPROM of the functional device, and the transaction public key in the signature verification firmware is used in the cache component to verify the integrity of the newly added functional firmware. It can be understood that the newly added functional firmware is also signed by the transaction private key. The functional device can use the transaction public key to decrypt the newly added functional firmware. If it can be decrypted successfully, it means that the newly added functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the newly added functional firmware is successful. On the contrary, if the transaction public key cannot be used to decrypt the newly added functional firmware, it means that the newly added functional firmware is incomplete and unsafe, indicating that the integrity verification of the newly added functional firmware has failed, and the newly added functional firmware cannot be flashed.
[0096] Optionally, if the newly added function firmware is the Basic Input Output System (BIOS) firmware, since the BIOS firmware is the firmware on the Central Processing Unit (CPU), the functional device does not need to introduce the newly added function firmware into the cache component, and can directly verify the integrity of the newly added function firmware based on the signature verification firmware.
[0097] Optionally, if the integrity verification of the flashing tool fails, the functional device prevents the flashing tool from starting, so that the flashing tool is not used to flash the firmware. The functional device can also output notification information of the failure of the integrity verification of the flashing tool to notify the user or relevant staff to check and repair the flashing tool.
[0098] S220: If the integrity verification of the new function firmware is successful, the functional device uses a flashing tool to flash the new function firmware.
[0099] Specifically, if the integrity verification of the flashing tool succeeds and the integrity verification of the newly added function firmware succeeds, it means that the flashing tool is safe and trustworthy, the newly added function firmware is also safe and trustworthy, and the functional device can use the flashing tool to flash the newly added function firmware.
[0100] Optionally, if the integrity verification of the new function firmware fails, the functional device will close the flashing tool to prevent the flashing of the new function firmware. The functional device can also output notification information of the failure of the integrity verification of the new function firmware to notify users or relevant staff to check and repair the new function firmware.
[0101] In the embodiment of the present specification, the management platform uses the manufacturer's public key to perform integrity verification on the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the first functional firmware is signed using the transaction private key to obtain the initial functional firmware, and a signature verification firmware is generated based on the transaction public key. The signature verification firmware and the initial functional firmware are partitioned and flashed to the functional device, so that the signature verification firmware is not interfered by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. After detecting the access request of the functional device, the initial functional firmware is integrity verified using the transaction public key. Only when the verification is successful can the functional device be accessed, avoiding access to the functional device that has been maliciously tampered with at the factory of the device. The functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool is successful, the newly added functional firmware is introduced into the cache component, and the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware in the cache component. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Before introducing the functional device, the integrity of the first functional firmware is verified with the manufacturer's public key, and the signature and decryption are performed using the public key and private key set by the management platform, thereby achieving independent control over the firmware flashing, security assurance, and integrity verification of the functional device. Flashing is performed only after the integrity of the flashing tool and the newly added functional firmware has been verified, thereby preventing the firmware from being maliciously tampered with or invaded, and ensuring the integrity and security of the firmware.
[0102] See also Figure 7 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Figure 7 As shown, the embodiment of this specification is described from the functional device side, and the method may include the following steps S302-S306.
[0103] S302, obtaining a flashing request for the newly added function firmware, and performing integrity verification on the flashing tool based on the trusted component.
[0104] Specifically, the functional device obtains a flashing request for newly added functional firmware. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The newly added functional firmware can be the functional firmware that needs to be newly added to the functional device and is different from the initial functional firmware, or it can be the functional firmware that replaces the initial functional firmware, or it can be the part of the initial functional firmware after flashing that is changed from the initial functional firmware before flashing. It is understandable that the flashing tool may be maliciously tampered with. If a tampered and unsafe flashing tool is used for flashing, the firmware of the functional device may be maliciously invaded and changed. Therefore, before using the flashing tool, the functional device can use a trusted component to perform a trusted operation on the flashing tool to complete the integrity verification of the flashing tool.
[0105] S304: If the integrity verification of the flashing tool is successful, the integrity of the newly added function firmware is verified based on the transaction public key in the signature verification firmware.
[0106] Specifically, if the integrity verification of the flashing tool is successful, the functional device can start the flashing tool, and then use the transaction public key in the signature verification firmware to verify the integrity of the newly added functional firmware. It can be understood that the newly added functional firmware is signed by the transaction private key, and the transaction public key and the transaction private key are verification key pairs set for the functional device based on the trusted component, where the transaction public key exists in the signature verification firmware. The functional device can use the transaction public key in the signature verification firmware to decrypt the newly added functional firmware. If the decryption is successful, it means that the newly added functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the newly added functional firmware is successful. On the contrary, if the transaction public key cannot be used to decrypt the newly added functional firmware, it means that the newly added functional firmware is incomplete and unsafe, indicating that the integrity verification of the newly added functional firmware has failed, and the newly added functional firmware cannot be flashed.
[0107] S306: If the integrity verification of the new function firmware is successful, a flashing tool is used to flash the new function firmware.
[0108] Specifically, if the integrity verification of the flashing tool succeeds and the integrity verification of the newly added function firmware succeeds, it means that the flashing tool is safe and trustworthy, the newly added function firmware is also safe and trustworthy, and the functional device can use the flashing tool to flash the newly added function firmware.
[0109] In the embodiments of this specification, the functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool succeeds, the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware succeeds, the flashing tool is used to flash the newly added functional firmware. Flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified, thereby preventing the firmware from being maliciously tampered with or invaded, and ensuring the integrity and security of the firmware.
[0110] See also Figure 8 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Figure 8 As shown, the embodiments of this specification are described from the functional device side, and the method may include the following steps S402-S408.
[0111] S402: Obtain the initial function firmware and the signature verification firmware sent by the management platform, and save the initial function firmware and the signature verification firmware in partitions.
[0112] Specifically, the management platform will write the initial functional firmware and the signature verification firmware to the functional device, where the initial functional firmware is the initial functional firmware signed by the management platform using the transaction private key, and the signature verification firmware is generated by the management platform based on the transaction public key, and the transaction public key and the transaction private key are the verification key pairs set for the functional device based on the trusted components. The functional device can save the initial functional firmware and the signature verification firmware in partitions. Since the transaction public key exists in the signature verification firmware, the signature verification firmware can be used to verify the integrity of the initial functional firmware and the newly added functional firmware that needs to be written into the functional device later. Therefore, the partition storage of the signature verification firmware and the initial functional firmware can prevent the signature verification firmware from being disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device.
[0113] Optionally, since the signature verification firmware contains the transaction public key, and the initial functional firmware and the newly added functional firmware are signed by the transaction private key, the transaction public key in the signature verification firmware must be used for integrity verification, so the integrity and security of the signature verification firmware are very important. After the signature verification firmware is flashed into the functional device, the trusted components in the functional device can be used to ensure the integrity of the signature verification firmware.
[0114] S404, obtaining a flashing request for the newly added function firmware, and performing integrity verification on the flashing tool based on the trusted component.
[0115] Specifically, the functional device obtains a flashing request for newly added functional firmware. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The newly added functional firmware can be the functional firmware that needs to be newly added to the functional device and is different from the initial functional firmware, or it can be the functional firmware that replaces the initial functional firmware, or it can be the part of the initial functional firmware after flashing that is changed from the initial functional firmware before flashing. It is understandable that the flashing tool may be maliciously tampered with. If a tampered and unsafe flashing tool is used for flashing, the firmware of the functional device may be maliciously invaded and changed. Therefore, before using the flashing tool, the functional device can use a trusted component to perform a trusted operation on the flashing tool to complete the integrity verification of the flashing tool.
[0116] S406: If the integrity verification of the flashing tool succeeds, the functional firmware is introduced into the cache component of the functional device. In the cache component, the integrity of the functional firmware is verified based on the transaction public key in the signature verification firmware.
[0117] If the integrity verification of the flashing tool is successful, the functional device can start the flashing tool, and then the functional device can introduce the functional firmware into the cache component of the functional device. The cache component can be the EPROM or EEPROM of the functional device, and the transaction public key in the signature verification firmware is used in the cache component to verify the integrity of the newly added functional firmware. It can be understood that the newly added functional firmware is also signed by the transaction private key. The functional device can use the transaction public key to decrypt the newly added functional firmware. If it can be decrypted successfully, it means that the newly added functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the newly added functional firmware is successful. On the contrary, if the transaction public key cannot be used to decrypt the newly added functional firmware, it means that the newly added functional firmware is incomplete and unsafe, indicating that the integrity verification of the newly added functional firmware has failed, and the newly added functional firmware cannot be flashed.
[0118] Optionally, if the newly added function firmware is BIOS firmware, since the BIOS firmware is the firmware on the CPU, the functional device does not need to introduce the newly added function firmware into the cache component, and can directly verify the integrity of the newly added function firmware based on the signature verification firmware.
[0119] Optionally, if the integrity verification of the flashing tool fails, the functional device prevents the flashing tool from starting, so that the flashing tool is not used to flash the firmware. The functional device can also output notification information of the failure of the integrity verification of the flashing tool to notify the user or relevant staff to check and repair the flashing tool.
[0120] S408: If the integrity verification of the new function firmware is successful, a flashing tool is used to flash the new function firmware.
[0121] Specifically, if the integrity verification of the flashing tool succeeds and the integrity verification of the newly added function firmware succeeds, it means that the flashing tool is safe and trustworthy, the newly added function firmware is also safe and trustworthy, and the functional device can use the flashing tool to flash the newly added function firmware.
[0122] Optionally, if the integrity verification of the new function firmware fails, the functional device will close the flashing tool to prevent the flashing of the new function firmware. The functional device can also output notification information of the failure of the integrity verification of the new function firmware to notify users or relevant staff to check and repair the new function firmware.
[0123] In the embodiments of the present specification, the functional device can save the initial functional firmware and the signature verification firmware in partitions, so that the signature verification firmware is not disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. The functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool is successful, the newly added functional firmware is introduced into the cache component, and the integrity of the newly added functional firmware is verified in the cache component based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Flashing is performed after verifying the integrity of the flashing tool and the newly added functional firmware, so as to prevent the firmware from being maliciously tampered with or invaded, and ensure the integrity and security of the firmware.
[0124] See also Fig. 9 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Fig. 9 As shown, the embodiment of this specification is described from the management platform side, and the method may include the following steps S502-S508.
[0125] S502: Obtain first functional firmware for a functional device.
[0126] Specifically, the device manufacturer sends the functional device or the first functional firmware of the functional device to the management platform for verification or acceptance by the management platform. The first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key. The device manufacturer can also send the manufacturer's public key that matches the manufacturer's private key to the management platform, and the management platform obtains the first functional firmware in the functional device.
[0127] S504: Use the manufacturer's public key to verify the integrity of the first function firmware.
[0128] Specifically, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware. For example, in addition to the first functional firmware and the manufacturer's public key, the device manufacturer will also send the unsigned initial functional firmware to the management platform. The management platform uses the manufacturer's public key to decrypt the first functional firmware. If the first functional firmware can be decrypted by the manufacturer's public key, it means that the first functional firmware is generated by the device manufacturer. Then the management platform performs a hash calculation on the decrypted result to obtain a first hash value. The management platform directly performs a hash calculation on the initial functional firmware to obtain a second hash value. If the first hash value is the same as the second hash value, it means that the first functional firmware is complete, secure and has not been tampered with, that is, the integrity verification of the first functional firmware is successful. On the contrary, if the manufacturer's public key cannot decrypt the first functional firmware, or the first hash value is different from the second hash value, then the first functional firmware is not generated by the device manufacturer, or the first functional firmware is incomplete and has been tampered with, that is, the integrity verification of the first functional firmware fails.
[0129] S506: If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key corresponding to the functional device are generated based on the trusted component.
[0130] Specifically, if the integrity verification of the first functional firmware succeeds, the management platform may generate a verification key pair corresponding to the functional device, ie, a transaction public key and a transaction private key, based on the trusted components in the functional device.
[0131] S508, using the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and flashing the initial functional firmware and the transaction public key to the functional device.
[0132] Specifically, the management platform can use the transaction private key to sign the first functional firmware to obtain the initial functional firmware. The management platform can flash the initial functional firmware and the transaction public key into the functional device. The management platform can generate the signature verification firmware based on the transaction public key, and then flash the signature verification firmware and the initial functional firmware partition into the functional device. Since the transaction public key exists in the signature verification firmware, the signature verification firmware can be used to verify the integrity of the initial functional firmware, the newly added functional firmware that needs to be flashed into the functional device, and other functional firmware. Therefore, the partitioned storage of the signature verification firmware and the initial functional firmware can prevent the signature verification firmware from being disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device.
[0133] In the embodiment of this specification, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the transaction private key is used to sign the first functional firmware to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed to the functional device. Before the functional device is introduced, the integrity of the first functional firmware is verified with the manufacturer's public key, and the signature and decryption are performed using the public key and private key set by the management platform, so that the firmware flashing, security assurance, and integrity verification of the functional device can be controlled autonomously, and the flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified.
[0134] See also Fig.10 , which is a flowchart of a firmware flashing method provided in the embodiment of this specification. Fig.10 As shown, the embodiment of this specification is described from the management platform side, and the method may include the following steps S602-S612.
[0135] S602: Obtain first functional firmware for a functional device.
[0136] For details, please refer to S502, which will not be described in detail here.
[0137] S604: Use the manufacturer's public key to verify the integrity of the first function firmware.
[0138] For details, please refer to S504, which will not be described in detail here.
[0139] S606: If the integrity verification of the first functional firmware succeeds, a transaction private key and a transaction public key corresponding to the functional device are generated based on the trusted component.
[0140] Specifically, if the integrity verification of the first functional firmware succeeds, the management platform may generate a verification key pair corresponding to the functional device, ie, a transaction public key and a transaction private key, based on the trusted components in the functional device.
[0141] S608: Use the transaction private key to sign the first functional firmware to obtain the initial functional firmware.
[0142] Specifically, the management platform may use the transaction private key to sign the first firmware to obtain the initial functional firmware.
[0143] It is understandable that there are three situations when the device manufacturer sends the first function firmware to the management platform for acceptance:
[0144] One situation is that the device manufacturer directly gives the functional device with the first functional firmware flashed to the management platform. The management platform needs to obtain the first functional firmware from the functional device, and perform integrity verification and signature processing on the first functional firmware to obtain the initial functional firmware. At this time, the management platform needs to flash the initial functional firmware into the functional device.
[0145] One situation is that the device directly sends the first functional firmware signed by the manufacturer's private key to the management platform after leaving the factory. The management platform can directly verify the integrity of the first functional firmware. At this time, the management platform can use the transaction private key to sign the first functional firmware to obtain the initial functional firmware. Since the management platform cannot directly flash the initial functional firmware into the functional device, the management platform needs to send the initial functional firmware and the transaction public key to the device manufacturer. The device manufacturer can generate the signature verification firmware based on the transaction public key, and then flash the signature verification firmware and the initial functional firmware partition into the functional device.
[0146] One situation is that the device manufacturer directly sends the first functional firmware that has been processed using the manufacturer's private key to the management platform. The management platform can use the manufacturer's public key to verify the integrity of the first functional firmware. If the integrity verification of the first functional firmware is successful, the management platform can generate the access private key and access public key corresponding to the functional device based on the trusted component, and then use the access private key to sign the first functional firmware to obtain the second functional firmware. Since the management platform cannot directly write the second functional firmware to the functional device, it is necessary to send the second functional firmware and the access public key to the device manufacturer, and the device manufacturer will write the second functional firmware and the access public key to the functional device. It can be understood that although the second functional firmware and the access private key generated by the trusted component are signed, the functional device is still at risk of malicious tampering and intrusion at the device factory. Therefore, before accessing and using the functional device, the management platform needs to obtain the second functional firmware from the functional device and use the access public key to verify the integrity of the second functional firmware. If the access public key can decrypt the second functional firmware, it means that the integrity verification of the second functional firmware is successful. The management platform can generate the transaction private key and transaction public key corresponding to the functional device based on the trusted component, and then use the transaction private key to sign the second functional firmware to obtain the initial functional firmware.
[0147] S610: Generate signature verification firmware based on the transaction public key, and flash the initial functional firmware and signature verification firmware partitions to the functional device.
[0148] Specifically, the management platform can generate a signature verification firmware based on the transaction public key, that is, the signature verification firmware contains the transaction public key, and the signature verification firmware and the initial functional firmware are partitioned and flashed to the functional device. Since the transaction public key exists in the signature verification firmware, the signature verification firmware can be used to verify the integrity of the initial functional firmware, the new functional firmware that needs to be flashed into the functional device later, and other functional firmware. Therefore, the partitioned storage of the signature verification firmware and the initial functional firmware can prevent the signature verification firmware from being disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device.
[0149] Optionally, the management platform can also send the transaction private key to the signature server for storage as a backup and reserve for the transaction private key. The signature server also has a trusted component corresponding to the signature server. The trusted component corresponding to the signature server also exists in the signature server in the form of a trusted firmware or a trusted chip. The signature server can use the trusted component to ensure the integrity of the transaction private key. It is understandable that the signature server can be a management platform or a service device that is distinguished from the management platform and independently stores private keys and public keys.
[0150] S612: If an access request of a functional device is detected, the integrity of the initial functional firmware is verified using the transaction public key. If the integrity verification of the initial functional firmware is successful, the functional device is accessed.
[0151] Specifically, when there is a need to access and use a functional device, such as when a server needs to be enabled or a graphics card needs to be installed in a computer and used, the functional device will send an access request to the management platform. When the management platform detects the access request of the functional device, it will use the transaction public key to verify the integrity of the initial functional firmware of the functional device. If the transaction public key can decrypt the initial functional firmware, it means that the integrity verification of the initial functional firmware is successful, it is safe and has not been tampered with, then the management platform can allow access to the functional device.
[0152] In the embodiment of this specification, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the first functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the signature verification firmware is generated based on the transaction public key. The signature verification firmware and the initial functional firmware are partitioned and flashed to the functional device, so that the signature verification firmware is not interfered by the flashing of the functional firmware, and the integrity and security of the functional device and the firmware in the functional device are further guaranteed. After the access request of the functional device is detected, the initial functional firmware is verified with the transaction public key. Only when the verification is successful can the functional device be accessed, avoiding access to the functional device that has been maliciously tampered with at the factory. Before the functional device is introduced, the integrity of the first functional firmware is verified with the manufacturer's public key, and the public key and private key set by the management platform are used for signature encryption and decryption, so that the firmware flashing, security assurance, and integrity verification of the functional device are realized. The flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified.
[0153] The following will be combined with the attached Fig.11 -Attached Fig.12 , the firmware flash writing device provided in the embodiment of this specification is introduced in detail. It should be noted that the attached Fig.11 -Attached Fig.12 The firmware flashing device in the embodiment may be a functional device in the above embodiment, which is used to execute the present specification. Figure 7 and Figure 8 For the convenience of explanation, only the part related to the embodiment of this specification is shown. For the specific technical details not disclosed, please refer to this specification. Figure 7 and Figure 8 The embodiment shown.
[0154] See also Fig.11 , which shows a schematic diagram of the structure of a firmware flashing device provided by an exemplary embodiment of the present specification. The firmware flashing device can be implemented as all or part of the device through software, hardware or a combination of both. The device 1 includes a tool verification module 11, a firmware verification module 12 and a firmware flashing module 13.
[0155] The tool verification module 11 is used to obtain a flashing request for the newly added function firmware and verify the integrity of the flashing tool based on the trusted component;
[0156] The firmware verification module 12 is used to verify the integrity of the newly added functional firmware based on the transaction public key in the signature verification firmware if the integrity verification of the flashing tool succeeds. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The transaction public key and the transaction private key are the verification key pair set for the functional device based on the trusted component;
[0157] The firmware flashing module 13 is used to flash the new function firmware using a flashing tool if the new function firmware integrity verification succeeds.
[0158] In the embodiment, the functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool succeeds, the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware succeeds, the flashing tool is used to flash the newly added functional firmware. Flashing is performed after the integrity of the flashing tool and the newly added functional firmware is verified, thereby preventing the firmware from being maliciously tampered with or invaded, and ensuring the integrity and security of the firmware.
[0159] See also Fig.12 , which shows a schematic diagram of the structure of a firmware flashing device provided by an exemplary embodiment of the present specification. The firmware flashing device can be implemented as all or part of the device through software, hardware or a combination of both. The device 1 includes a tool verification module 11, a firmware verification module 12, a firmware flashing module 13, a partition saving module 14, a startup blocking module 15 and a tool closing module 16.
[0160] The partition storage module 14 is used to obtain the initial functional firmware and the signature verification firmware sent by the management platform. The initial functional firmware is the initial functional firmware signed by the management platform using the transaction private key, and the signature verification firmware is generated based on the transaction public key;
[0161] Save the initial function firmware and signature verification firmware in partitions;
[0162] The tool verification module 11 is used to obtain a flashing request for the newly added function firmware and verify the integrity of the flashing tool based on the trusted component;
[0163] The firmware verification module 12 is used to verify the integrity of the newly added functional firmware based on the transaction public key in the signature verification firmware if the integrity verification of the flashing tool succeeds. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The transaction public key and the transaction private key are the verification key pair set for the functional device based on the trusted component;
[0164] Optionally, the firmware verification module 12 is specifically used to introduce the functional firmware into the cache component of the functional device if the integrity verification of the flashing tool succeeds;
[0165] In the cache component, the integrity of the functional firmware is verified based on the transaction public key in the signature firmware.
[0166] The startup preventing module 15 is used to prevent the flashing tool from starting if the integrity verification of the flashing tool fails.
[0167] The firmware flashing module 13 is used to flash the new function firmware using a flashing tool if the new function firmware integrity verification succeeds.
[0168] The tool closing module 16 is used to close the flashing tool if the integrity verification of the newly added function firmware fails.
[0169] In this embodiment, the functional device can save the initial functional firmware and the signature verification firmware in partitions, so that the signature verification firmware is not disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. The functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool is successful, the newly added functional firmware is introduced into the cache component, and the integrity of the newly added functional firmware is verified in the cache component based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Flashing is performed after verifying the integrity of the flashing tool and the newly added functional firmware, which prevents the firmware from being maliciously tampered with or invaded, thereby ensuring the integrity and security of the firmware.
[0170] Please refer to Fig.13 , which shows a block diagram of the structure of an electronic device provided in an embodiment of this specification. The electronic device in the embodiment of this specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via a bus 150.
[0171] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions and processes data of the terminal 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of CPU, graphics processing unit (GPU), modem, etc. Among them, the CPU mainly processes the operating system, user pages and applications; the GPU is responsible for rendering and drawing display content; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but implemented separately through a communication chip.
[0172] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium (Non-Transitory Computer-Readable Storage Medium). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems.
[0173] The memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good operating results, the operating system allocates corresponding system resources to different third-party applications. However, the requirements for system resources in different application scenarios in the same third-party application are also different. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0174] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0175] The input device 130 is used to receive input commands or data, and includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output commands or data, and includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are touch screen displays.
[0176] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of this specification.
[0177] In addition, those skilled in the art will appreciate that the structure of the terminal shown in the above drawings does not constitute a limitation on the terminal, and the terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module, and other components, which will not be described in detail here.
[0178] exist Fig.13 In the electronic device shown, the processor 110 may be used to call the surface imaging application stored in the memory 120 and specifically perform the following operations:
[0179] Obtain a flashing request for the new function firmware and verify the integrity of the flashing tool based on the trusted component;
[0180] If the integrity verification of the flashing tool is successful, the integrity of the newly added functional firmware is verified based on the transaction public key in the signature verification firmware. The newly added functional firmware is the newly added functional firmware signed based on the transaction private key. The transaction public key and the transaction private key are the verification key pair set for the functional device based on the trusted component;
[0181] If the integrity verification of the new function firmware is successful, the new function firmware is flashed using a flashing tool.
[0182] In one embodiment, before executing to obtain the flashing request for the functional firmware, the processor 110 further performs the following operations:
[0183] Obtain the initial functional firmware and signature verification firmware sent by the management platform. The initial functional firmware is the initial functional firmware signed by the management platform using the transaction private key, and the signature verification firmware is generated based on the transaction public key;
[0184] Save the initial functional firmware and signature verification firmware in partitions.
[0185] In one embodiment, when the processor 110 performs integrity verification on the functional firmware based on the transaction public key in the signature verification firmware if the integrity verification of the flash tool succeeds, the processor 110 specifically performs the following operations:
[0186] If the integrity verification of the flash tool succeeds, the functional firmware is introduced into the cache component of the functional device;
[0187] In the cache component, the integrity of the functional firmware is verified based on the transaction public key in the signature firmware.
[0188] In one embodiment, after performing integrity verification on the flash tool based on the trusted component, the processor 110 further performs the following operations:
[0189] If the flash tool integrity verification fails, the flash tool is prevented from starting.
[0190] In one embodiment, after performing integrity verification on the new function firmware based on the transaction public key in the signature verification firmware, the processor 110 further performs the following operations:
[0191] If the new function firmware integrity verification fails, close the flashing tool.
[0192] In this embodiment, the functional device can save the initial functional firmware and the signature verification firmware in partitions, so that the signature verification firmware is not disturbed by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. The functional device obtains a flashing request for the newly added functional firmware, and performs integrity verification on the flashing tool based on the trusted component. If the integrity verification of the flashing tool is successful, the newly added functional firmware is introduced into the cache component, and the integrity of the newly added functional firmware is verified in the cache component based on the transaction public key in the signature verification firmware. If the integrity verification of the newly added functional firmware is successful, the flashing tool is used to flash the newly added functional firmware. Flashing is performed after verifying the integrity of the flashing tool and the newly added functional firmware, which prevents the firmware from being maliciously tampered with or invaded, thereby ensuring the integrity and security of the firmware.
[0193] The following will be combined with the attached Fig.14 -Attached Fig.15 , the firmware flash writing device provided in the embodiment of this specification is introduced in detail. It should be noted that the attached Fig.14 -Attached Fig.15 The firmware flashing device in the embodiment may be the management platform in the above embodiment, which is used to execute the present specification. Fig. 9 and Fig.10 For the convenience of explanation, only the part related to the embodiment of this specification is shown. For the specific technical details not disclosed, please refer to this specification. Fig. 9 and Fig.10 The embodiment shown.
[0194] See also Fig.14 , which shows a schematic diagram of the structure of a firmware flashing device provided by an exemplary embodiment of the present specification. The firmware flashing device can be implemented as all or part of the device through software, hardware or a combination of both. The device 2 includes a firmware acquisition module 21, a manufacturer verification module 22, a key acquisition module 23 and a firmware signature module 24.
[0195] The firmware acquisition module 21 is used to acquire the first functional firmware for the functional device, where the first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key;
[0196] A manufacturer verification module 22, used to verify the integrity of the first function firmware using the manufacturer's public key;
[0197] The key acquisition module 23 is used to generate a transaction private key and a transaction public key corresponding to the functional device based on the trusted component if the integrity verification of the first functional firmware succeeds;
[0198] The firmware signing module 24 is used to use the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and flash the initial functional firmware and the transaction public key to the functional device.
[0199] In this embodiment, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the transaction private key is used to sign the first functional firmware to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed to the functional device. Before the functional device is introduced, the integrity of the first functional firmware is verified with the manufacturer's public key, and the signature and decryption are performed using the public key and private key set by the management platform, so that the firmware flashing, security assurance, and integrity verification of the functional device can be controlled autonomously.
[0200] See also Fig.15 , which shows a schematic diagram of the structure of a firmware flashing device provided by an exemplary embodiment of the present specification. The firmware flashing device can be implemented as all or part of the device through software, hardware or a combination of both. The device 2 includes a firmware acquisition module 21, a manufacturer verification module 22, a key acquisition module 23, a firmware signature module 24 and an access verification module 25.
[0201] The firmware acquisition module 21 is used to acquire the first functional firmware for the functional device, where the first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key;
[0202] A manufacturer verification module 22, used to verify the integrity of the first function firmware using the manufacturer's public key;
[0203] The key acquisition module 23 is used to generate a transaction private key and a transaction public key corresponding to the functional device based on the trusted component if the integrity verification of the first functional firmware succeeds;
[0204] The firmware signing module 24 is used to sign the first functional firmware with the transaction private key to obtain the initial functional firmware, and flash the initial functional firmware and the transaction public key to the functional device;
[0205] Optionally, the firmware signing module 24 is specifically used to use the transaction private key to sign the first functional firmware to obtain the initial functional firmware;
[0206] The initial function firmware and transaction public key are sent to the device manufacturer, instructing the device manufacturer to flash the initial function firmware and transaction public key to the functional device.
[0207] Optionally, the key acquisition module 23 is specifically configured to generate an access private key and an access public key corresponding to the functional device based on the trusted component if the integrity verification of the first functional firmware is successful;
[0208] Optionally, the firmware signing module 24 is specifically used to use the access private key to sign the first functional firmware to obtain the second functional firmware;
[0209] Send the second function firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second function firmware and the access public key to the functional device;
[0210] The second function firmware is verified for integrity using the access public key. If the integrity verification of the second function firmware succeeds, a transaction private key and a transaction public key corresponding to the functional device are generated based on the trusted component.
[0211] The second functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
[0212] Optionally, the firmware signature module 24 is specifically used to generate signature verification firmware based on the transaction public key;
[0213] Flash the initial functional firmware and signature verification firmware partitions to the functional device.
[0214] The access verification module 25 is used to verify the integrity of the initial functional firmware using the transaction public key if an access request of the functional device is detected;
[0215] If the initial functional firmware integrity verification is successful, the functional device is connected.
[0216] In this embodiment, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the first functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the signature verification firmware is generated based on the transaction public key. The signature verification firmware and the initial functional firmware are partitioned and written to the functional device, so that the signature verification firmware is not interfered by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. After detecting the access request of the functional device, the initial functional firmware is verified with the transaction public key. Only when the verification is successful can the functional device be accessed, avoiding access to the functional device that has been maliciously tampered with at the factory. Before introducing the functional device, the integrity of the first functional firmware is verified with the manufacturer's public key, and the public key and private key set by the management platform are used for signature encryption and decryption, realizing the autonomous control of the firmware flashing, security assurance, and integrity verification of the functional device.
[0217] Please refer to Fig.16 , which shows a block diagram of the structure of an electronic device provided in an embodiment of this specification. The electronic device in the embodiment of this specification may include one or more of the following components: a processor 210, a memory 220, an input device 230, an output device 240, and a bus 250. The processor 210, the memory 220, the input device 230, and the output device 240 may be connected via a bus 250.
[0218] The processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions and processes data of the terminal 200 by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 210 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user pages, and applications; the GPU is responsible for rendering and drawing display content; and the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, but may be implemented separately through a communication chip.
[0219] The memory 220 may include a RAM or a ROM. Optionally, the memory 220 includes a non-transitory computer-readable medium. The memory 220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system, or other systems.
[0220] The memory 220 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good operating results, the operating system allocates corresponding system resources to different third-party applications. However, the requirements for system resources in different application scenarios in the same third-party application are also different. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0221] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0222] The input device 230 is used to receive input commands or data, and includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 240 is used to output commands or data, and includes but is not limited to a display device and a speaker. In one example, the input device 230 and the output device 240 can be combined, and the input device 230 and the output device 240 are touch screen displays.
[0223] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of this specification.
[0224] In addition, those skilled in the art will appreciate that the structure of the terminal shown in the above drawings does not constitute a limitation on the terminal, and the terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a WiFi module, a power supply, and a Bluetooth module, which will not be described in detail here.
[0225] exist Fig.16 In the electronic device shown, the processor 210 may be used to call the surface imaging application stored in the memory 220 and specifically perform the following operations:
[0226] Acquire a first functional firmware for a functional device, where the first functional firmware is an initial functional firmware signed by a device manufacturer using a manufacturer's private key;
[0227] Using the manufacturer's public key to verify the integrity of the first function firmware;
[0228] If the integrity verification of the first functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component;
[0229] The first functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
[0230] In one embodiment, when the processor 210 uses the transaction private key to sign the first functional firmware to obtain the initial functional firmware and flashes the initial functional firmware and the transaction public key to the functional device, the processor 210 specifically performs the following operations:
[0231] The first functional firmware is signed using the transaction private key to obtain the initial functional firmware;
[0232] The initial function firmware and transaction public key are sent to the device manufacturer, instructing the device manufacturer to flash the initial function firmware and transaction public key to the functional device.
[0233] In one embodiment, when executing the firmware flashing method, the processor 210 further performs the following operations:
[0234] If an access request from a functional device is detected, the initial functional firmware is verified for integrity using the transaction public key;
[0235] If the initial functional firmware integrity verification is successful, the functional device is connected.
[0236] In one embodiment, when the processor 210 successfully performs the integrity verification of the first function firmware, the processor 210 specifically performs the following operations when generating a transaction private key and a transaction public key corresponding to the first function firmware based on the trusted component:
[0237] If the integrity verification of the first functional firmware is successful, the access private key and access public key corresponding to the functional device are generated based on the trusted component
[0238] When the processor 210 uses the transaction private key to sign the first functional firmware to obtain the initial functional firmware and flashes the initial functional firmware and the transaction public key to the functional device, the processor 210 specifically performs the following operations:
[0239] The first function firmware is signed using the access private key to obtain the second function firmware;
[0240] Send the second function firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second function firmware and the access public key to the functional device;
[0241] The second function firmware is verified for integrity using the access public key. If the integrity verification of the second function firmware succeeds, a transaction private key and a transaction public key corresponding to the functional device are generated based on the trusted component.
[0242] The second functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
[0243] In one embodiment, when the processor 210 executes flashing the initial function firmware and the transaction public key into the function device, the processor 210 specifically performs the following operations:
[0244] Generate signature verification firmware based on the transaction public key;
[0245] Flash the initial functional firmware and signature verification firmware partitions to the functional device.
[0246] In this embodiment, the management platform uses the manufacturer's public key to verify the integrity of the first functional firmware of the functional device. If the integrity verification of the first functional firmware is successful, a transaction private key and a transaction public key are generated based on the trusted component, and the first functional firmware is signed with the transaction private key to obtain the initial functional firmware, and the signature verification firmware is generated based on the transaction public key. The signature verification firmware and the initial functional firmware are partitioned and written to the functional device, so that the signature verification firmware is not interfered by the flashing of the functional firmware, further ensuring the integrity and security of the functional device and the firmware in the functional device. After detecting the access request of the functional device, the initial functional firmware is verified with the transaction public key. Only when the verification is successful can the functional device be accessed, avoiding access to the functional device that has been maliciously tampered with at the factory. Before introducing the functional device, the integrity of the first functional firmware is verified with the manufacturer's public key, and the public key and private key set by the management platform are used for signature encryption and decryption, realizing the autonomous control of the firmware flashing, security assurance, and integrity verification of the functional device.
[0247] The present specification also provides a computer storage medium that can store multiple instructions suitable for being loaded and executed by a processor as described above. Figure 2-Figure 10 The firmware flashing method of the embodiment shown in the figure can be found in the specific execution process. Figure 2-Figure 10 The specific description of the illustrated embodiment will not be repeated here.
[0248] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor as described above. Figure 1-Figure 10 The firmware flashing method of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 10 The specific description of the illustrated embodiment will not be repeated here.
[0249] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0250] The above disclosure is only the preferred embodiment of this specification, which certainly cannot be used to limit the scope of rights of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.
[0251] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A firmware flashing method, applied to a functional device, comprising: Obtain a flashing request for the firmware with new functions, and verify the integrity of the flashing tool based on the trusted components; If the integrity verification of the flashing tool succeeds, the integrity of the newly added function firmware is verified based on the transaction public key in the signature verification firmware, the newly added function firmware is the newly added functional firmware signed based on the transaction private key, and the transaction public key and the transaction private key are the verification key pair set for the functional device based on the trusted component; If the integrity verification of the newly added function firmware is successful, the newly added function firmware is flashed using the flashing tool; If the integrity verification of the first functional firmware succeeds, an access private key and an access public key corresponding to the functional device are generated based on the trusted component, and the first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key; Using the access private key to sign the first functional firmware to obtain the second functional firmware; Sending the second functional firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second functional firmware and the access public key into the functional device; Using the access public key to perform integrity verification on the second functional firmware, if the integrity verification of the second functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component; The second functional firmware is signed using the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
2. The method according to claim 1, before obtaining the flashing request for the functional firmware, further comprising: Obtaining the initial functional firmware and the signature verification firmware sent by the management platform, wherein the initial functional firmware is the initial functional firmware signed by the management platform using the transaction private key, and the signature verification firmware is generated based on the transaction public key; The initial function firmware and the signature verification firmware are stored in partitions.
3. The method according to claim 1, if the integrity verification of the flashing tool succeeds, then performing integrity verification on the functional firmware based on the transaction public key in the signature verification firmware, comprising: If the integrity verification of the flash tool succeeds, the functional firmware is introduced into the cache component of the functional device; In the cache component, the integrity of the functional firmware is verified based on the transaction public key in the signature verification firmware.
4. The method according to claim 1, after verifying the integrity of the flash tool based on the trusted component, further comprises: If the integrity verification of the flashing tool fails, the flashing tool is prevented from starting.
5. The method according to claim 1, after the integrity verification of the newly added function firmware based on the transaction public key in the signature verification firmware, further comprises: If the integrity verification of the newly added function firmware fails, the flashing tool is closed.
6. A firmware flashing method, applied to a management platform, comprising: Acquire a first functional firmware for a functional device, where the first functional firmware is an initial functional firmware signed by a device manufacturer using a manufacturer's private key; Using the manufacturer's public key to verify the integrity of the first functional firmware; If the integrity verification of the first functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component; The first functional firmware is signed by using the transaction private key to obtain an initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device; If the integrity verification of the first functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the first functional firmware based on a trusted component includes: If the integrity verification of the first functional firmware succeeds, generating an access private key and an access public key corresponding to the functional device based on the trusted component; The using the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and flashing the initial functional firmware and the transaction public key to the functional device, includes: The first functional firmware is signed using the access private key to obtain the second functional firmware; Sending the second functional firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second functional firmware and the access public key into the functional device; Using the access public key to perform integrity verification on the second functional firmware, if the integrity verification of the second functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component; The second functional firmware is signed by using the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
7. The method according to claim 6, wherein the using the transaction private key to sign the first functional firmware to obtain the initial functional firmware, and flashing the initial functional firmware and the transaction public key to the functional device comprises: Using the transaction private key to sign the first functional firmware to obtain an initial functional firmware; The initial functional firmware and the transaction public key are sent to the device manufacturer, instructing the device manufacturer to flash the initial functional firmware and the transaction public key into the functional device.
8. The method according to claim 7, further comprising: If an access request of the functional device is detected, the initial functional firmware is verified for integrity using the transaction public key; If the integrity verification of the initial functional firmware is successful, the functional device is accessed.
9. The method according to claim 6, wherein flashing the initial functional firmware and the transaction public key into the functional device comprises: Generate a signature verification firmware based on the transaction public key; The initial functional firmware and the signature verification firmware partition are flashed to the functional device.
10. A firmware flashing device, the device comprising: A tool verification module is used to obtain a flashing request for the newly added function firmware and verify the integrity of the flashing tool based on the trusted component; A firmware verification module, configured to, if the integrity verification of the flashing tool succeeds, perform integrity verification on the newly added function firmware based on the transaction public key in the signature verification firmware, wherein the newly added function firmware is the newly added functional firmware signed based on the transaction private key, and the transaction public key and the transaction private key are a verification key pair set for the functional device based on the trusted component; A firmware flashing module, configured to flash the newly added function firmware using the flashing tool if the integrity verification of the newly added function firmware is successful; If the integrity verification of the first functional firmware succeeds, an access private key and an access public key corresponding to the functional device are generated based on the trusted component, and the first functional firmware is the initial functional firmware signed by the device manufacturer using the manufacturer's private key; The first functional firmware is signed using the access private key to obtain the second functional firmware; Sending the second functional firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second functional firmware and the access public key into the functional device; Using the access public key to perform integrity verification on the second functional firmware, if the integrity verification of the second functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component; The second functional firmware is signed by using the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
11. A firmware flashing device, the device comprising: A firmware acquisition module, used to acquire a first functional firmware for a functional device, where the first functional firmware is an initial functional firmware signed by a device manufacturer using a manufacturer's private key; A manufacturer verification module, used to verify the integrity of the first functional firmware using the manufacturer's public key; A key acquisition module, configured to generate a transaction private key and a transaction public key corresponding to the functional device based on a trusted component if the integrity verification of the first functional firmware succeeds; The key acquisition module is specifically configured to generate an access private key and an access public key corresponding to the functional device based on a trusted component if the integrity verification of the first functional firmware succeeds; a firmware signing module, configured to use the transaction private key to sign the first functional firmware to obtain an initial functional firmware, and flash the initial functional firmware and the transaction public key to the functional device; The firmware signature module is specifically used to use the access private key to sign the first functional firmware to obtain the second functional firmware; Sending the second functional firmware and the access public key to the device manufacturer, instructing the device manufacturer to flash the second functional firmware and the access public key into the functional device; Using the access public key to perform integrity verification on the second functional firmware, if the integrity verification of the second functional firmware succeeds, generating a transaction private key and a transaction public key corresponding to the functional device based on the trusted component; The second functional firmware is signed by using the transaction private key to obtain the initial functional firmware, and the initial functional firmware and the transaction public key are flashed into the functional device.
12. A computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the method steps of any one of claims 1 to 5 or 6 to 9.
13. A computer program product, wherein the computer program product stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 5 or 6 to 9.
14. An electronic device comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 5 or 6 to 9.
