Firmware checking method, system startup method, device, system, equipment and medium

By performing data bit obfuscation and hash operations on the server firmware data, a hash key is generated to match the digital signature library, which solves the problem of difficult-to-identify tampered firmware data and improves the security and accuracy of server system startup.

CN117610004BActive Publication Date: 2025-10-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311294340.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2025-10-10
Estimated Expiration
2043-10-08

AI Technical Summary

Technical Problem

In the prior art, it is difficult to identify server firmware data after it has been tampered with, causing the system to enter an unauthorized boot interface, posing a system security risk.

Method used

By obtaining the target system firmware data in the reset or power-off state, performing data bit obfuscation and hash operations, generating a hash key, and matching it with the signature in the digital signature library, data integrity and authenticity are ensured.

Benefits of technology

The accuracy of the firmware verification process is improved, making it easier to identify situations where some information in the firmware has been tampered with, ensuring the security of the server system startup process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117610004B_ABST
    Figure CN117610004B_ABST
Patent Text Reader

Abstract

The application provides a firmware verification method, a system startup method, device, system, equipment and medium, and relates to the technical field of server security, and the method comprises the following steps: in the case that it is determined that a target platform hardware component is in a reset state or a power-off state, target system firmware data corresponding to the target platform hardware component is acquired; the target system firmware data is subjected to data bit confusion processing to obtain confused system firmware data; the confused system firmware data is subjected to hash operation processing to obtain a hash key corresponding to the target system firmware data; and the hash key and a digital signature in a digital signature library are matched, and if the matching is successful, it is determined that the target system firmware data passes the security verification, wherein the digital signature is obtained from original system firmware data after data bit confusion processing and hash operation processing. The application improves the accuracy of the firmware verification process, and makes the server system startup process safer.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of server security, and particularly relates to a firmware verification method, a system starting method, device, system, equipment and medium. BACKGROUND

[0002] With the continuous development and advancement of information technology and Internet technology, network security has become an important problem that enterprises face today, and in order to ensure the information security of enterprises, higher requirements need to be put forward for the security performance of servers.

[0003] In the current server starting process, the key of the firmware data of each platform hardware component needs to be verified with the digital signature stored in the non-volatile memory (NVM), and when the verification is passed, the boot process of the server system starting is entered. However, when part of the information in the firmware (FW) file data is tampered with, it will be difficult to identify only the key information, and if the firmware data is tampered with, the server system will enter an unauthorized boot interface after starting, damaging the system health and causing system security risks.

[0004] Therefore, there is an urgent need for a firmware verification method, system starting method, device, system, equipment and medium to solve the above problems. SUMMARY

[0005] In view of the problems in the prior art, the present application provides a firmware verification method, a system starting method, device, system, equipment and medium.

[0006] The present application provides a firmware verification method, comprising:

[0007] In a case where it is determined that a target platform hardware component is in a reset state or a power-off state, target system firmware data corresponding to the target platform hardware component is obtained, wherein the target system firmware data is system firmware data to be subjected to security verification, and the reset state or the power-off state is determined based on a control result of a platform firmware protection recovery chip on the target platform hardware component;

[0008] The target system firmware data is subjected to data bit confusion processing to obtain confused system firmware data;

[0009] The confused system firmware data is subjected to hash operation processing to obtain a hash key corresponding to the target system firmware data;

[0010] The hash key is matched with a digital signature in a digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the digital signature is obtained by the original system firmware data after the data bit obfuscation processing and the hash operation processing.

[0011] According to a firmware verification method provided by the present invention, performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data includes:

[0012] receiving a first input, wherein the first input includes an operation of performing data bit obfuscation processing on the target system firmware data;

[0013] In response to the first input, a corresponding private key is generated, and data bit shift processing, inversion processing, and string addition processing are performed on the target system firmware data using the private key to obtain the obfuscated system firmware data.

[0014] According to a firmware verification method provided by the present invention, performing a hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data includes:

[0015] Performing a first-level hash operation on the obfuscated system firmware data based on Information Digest Algorithm 5 to obtain a first hash value, where the first hash value is a 128-bit hash value corresponding to the obfuscated system firmware data;

[0016] The step of matching the hash key with a digital signature in a digital signature library and determining that the target system firmware data passes security verification if the match is successful includes:

[0017] The first hash value is matched with the first digital signature in the digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the first digital signature is based on the information digest algorithm 5 and is obtained by performing the first level hash operation on the original system firmware data after the data bit obfuscation processing.

[0018] According to a firmware verification method provided by the present invention, after performing a hash operation on the obfuscated system firmware data based on the message digest algorithm 5 to obtain a first hash value, the method further includes:

[0019] Performing a second-level hash operation based on the data length of the target system firmware data and the first hash value using a secure hash algorithm 256 to obtain a second hash value, where the second hash value is a 256-bit hash root key corresponding to the obfuscated system firmware data;

[0020] The step of matching the hash key with a digital signature in a digital signature library and determining that the target system firmware data passes security verification if the match is successful includes:

[0021] The second hash value is matched with the second digital signature in the digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the second digital signature is based on the secure hash algorithm 256, and is obtained by sequentially performing the first-level hash operation processing and the second-level hash operation processing on the original system firmware data after the data bit obfuscation processing.

[0022] According to a firmware verification method provided by the present invention, the steps of obfuscating the data bits corresponding to the private key are as follows:

[0023] Shifting the data bits of the target system firmware data to obtain shifted system firmware data;

[0024] Based on the data bit movement direction corresponding to the shift processing, the system firmware data after the shift processing is padded with 0, and the data bits padded with 0 are inverted to obtain the inverted system firmware data;

[0025] The inverted system firmware data is added to a preset character string to obtain the obfuscated system firmware data.

[0026] According to a firmware verification method provided by the present invention, the method of performing data bit shift processing, inversion processing, and string addition processing on the target system firmware data using the private key includes:

[0027] Obtain the corresponding data bit shift number in the private key;

[0028] The private key is judged according to the number of data shift bits and the preset maximum shift number. If the private key is determined to be a valid key according to the judgment result, the target system firmware data is subjected to data shift processing, inversion processing and string addition processing using the private key.

[0029] According to a firmware verification method provided by the present invention, the private key is judged according to the number of data shift bits and a preset maximum shift number, including:

[0030] Determine whether the number of data bit shifts is greater than the preset maximum shift number. If it is less than or equal to the preset maximum shift number, determine that the private key is a valid key, and use the private key determined to be the valid key to perform data bit shift processing, inversion processing, and string addition processing on the target system firmware data to obtain the obfuscated system firmware data.

[0031] According to a firmware verification method provided by the present invention, the method further includes:

[0032] If the number of data bit shifts is greater than the preset maximum number of shifts, it is determined that the private key is an invalid key, and a corresponding data bit obfuscation error prompt message is generated.

[0033] According to a firmware verification method provided by the present invention, after matching the hash key with a digital signature in a digital signature library, and if the match is successful, determining that the target system firmware data has passed the security verification, the method further includes:

[0034] Based on the target system firmware data that has passed the security check, the target platform hardware components are driven to start.

[0035] According to a firmware verification method provided by the present invention, if the hash key and the digital signature in the digital signature library are not matched successfully, the method further includes:

[0036] Acquire firmware backup data corresponding to the target system firmware data, wherein the firmware backup data and the target system firmware data are stored in different data storage areas;

[0037] performing the data bit obfuscation process and the hash operation process on the firmware backup data in sequence to obtain a hash key corresponding to the firmware backup data;

[0038] Matching the hash key corresponding to the firmware backup data with the digital signature in the digital signature library, determining that the firmware backup data passes the security verification if the match is successful, and driving the target platform hardware component to start based on the firmware backup data that passes the security verification;

[0039] If the matching fails, a corresponding platform hardware component startup failure prompt message is generated.

[0040] According to a firmware verification method provided by the present invention, the method further includes:

[0041] Performing data preprocessing on the system firmware data to be security-verified to obtain the target system firmware data;

[0042] Performing data preprocessing on the original system firmware data to obtain a corresponding digital signature through the original system firmware after data preprocessing;

[0043] The data preprocessing includes at least data cleaning, data standardization and denoising.

[0044] The present invention also provides a system startup method based on the above firmware verification method, which is applied to a platform firmware protection recovery chip, comprising:

[0045] Constructing a pre-boot environment for a server system to be started, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas;

[0046] Sending a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware components to enter a reset state or a power-off state;

[0047] When it is determined that each of the platform hardware components is in the reset state or the power-off state, obtaining system firmware data corresponding to each of the platform hardware components;

[0048] Obtaining a security verification result of each of the system firmware data, and judging the security verification result, if it is determined that all of the system firmware data pass the security verification, sending a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state;

[0049] After determining that all the platform hardware components are in the startup state, a normal startup environment is constructed, and the server system is started based on the system firmware data that has passed the security check.

[0050] According to a system startup method provided by the present invention, the platform firmware protection and recovery chip establishes a connection with each of the platform hardware components through a universal input and output interface, and obtains the system firmware data in the data storage area of ​​each of the platform hardware components through a multiplexer and a serial peripheral interface controller, wherein the platform firmware protection and recovery chip stores the obtained system firmware data in a data temporary storage area.

[0051] According to a system startup method provided by the present invention, obtaining the security verification results of each of the system firmware data and judging the security verification results include:

[0052] If it is judged that any one of the system firmware data does not pass the security check, obtain the firmware backup data corresponding to the system firmware data that does not pass the security check;

[0053] Write the firmware backup data into a target data storage area, wherein the target data storage area is the data storage area of the system firmware data that does not pass the security check;

[0054] Re-execute the firmware data check on the firmware backup data and other system firmware data, and if all pass the security check, generate the second initialization signal, wherein the other system firmware data is system firmware data other than the system firmware data that does not pass the security check and the corresponding firmware backup data.

[0055] According to the system startup method provided by the application, the method further comprises:

[0056] In the current startup process of the server system, judge whether the number of re-executions of the firmware data check is greater than a preset check number, and if it is greater than the preset check number, generate a system shutdown signal to control the server system to enter a shutdown state through the system shutdown signal.

[0057] The application further provides a firmware check device, comprising:

[0058] A firmware data acquisition unit is configured to acquire target system firmware data corresponding to a target platform hardware component in a reset state or a power-off state, wherein the target system firmware data is system firmware data to be subjected to security check, and the reset state or the power-off state is determined based on a control result of a platform firmware protection recovery chip on the target platform hardware component;

[0059] A data confusion unit is configured to perform data bit confusion processing on the target system firmware data to obtain confused system firmware data;

[0060] A key encryption unit is configured to perform hash operation processing on the confused system firmware data to obtain a hash key corresponding to the target system firmware data;

[0061] A key comparison unit is configured to match the hash key with a digital signature in a digital signature library, and if the matching is successful, it is determined that the target system firmware data passes the security check, wherein the digital signature is obtained from original system firmware data after the data bit confusion processing and the hash operation processing.

[0062] The application further provides a system startup device based on the above-mentioned firmware check device, comprising:

[0063] A pre-boot module is configured to construct a pre-boot environment for a server system to be booted, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas;

[0064] A first processing module is configured to send a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware components to enter a reset state or a power-off state;

[0065] an interaction module, configured to obtain system firmware data corresponding to each of the platform hardware components when determining that each of the platform hardware components is in the reset state or the power-off state;

[0066] a second processing module, configured to obtain a security verification result of each of the system firmware data, and to judge the security verification result; if it is determined that all of the system firmware data pass the security verification, to send a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state;

[0067] The system startup module is used to build a normal startup environment after determining that all the platform hardware components are in the startup state, and to start the server system based on the system firmware data that has passed the security check.

[0068] The present invention also provides a server system, comprising the above-mentioned firmware verification device, a system startup device and multiple platform hardware components, wherein the platform hardware components establish a connection with the system startup device through a universal input and output interface; after the system startup device controls the platform hardware components to a reset state or a power-off state, it is used to obtain system firmware data in the data storage area of ​​the platform hardware components through a multi-way selection switch and a serial peripheral interface controller, and after determining that the system firmware data passes the security verification, performs a startup operation on the server system; the firmware data verification device is used to perform a security verification on the system firmware data obtained by the system startup device.

[0069] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the processor implements any of the firmware verification methods described above, or any of the system startup methods described above.

[0070] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements any of the above-mentioned firmware verification methods or any of the above-mentioned system startup methods.

[0071] The firmware verification method, system startup method, apparatus, system, equipment and medium provided by the present invention sequentially perform data bit obfuscation processing and hash operation processing on the system firmware data to be security verified, and match the obtained hash key with the digital signature in the digital signature library obtained by the original system firmware data in the early stage of the data bit obfuscation processing and hash operation processing. If the match is successful, it is determined that the system firmware data has passed the security verification. Therefore, during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system more secure. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the present invention or 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0073] Figure 1 A schematic diagram of booting and starting a server system in the related art;

[0074] Figure 2 A schematic diagram of the flow of the firmware verification method provided by the present invention;

[0075] Figure 3 A schematic flow chart of the system startup method provided by the present invention;

[0076] Figure 4 A schematic diagram of the overall process of the system startup method provided by the present invention;

[0077] Figure 5 A schematic diagram of the structure of the firmware verification device provided by the present invention;

[0078] Figure 6 A schematic structural diagram of the system startup device provided by the present invention;

[0079] Figure 7 A schematic diagram of the system architecture for secure booting of a server system based on a platform firmware protection recovery chip provided by the present invention;

[0080] Figure 8 This is a schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0081] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0082] During the server system startup process, to ensure information data security, the Basic Input Output System (BIOS) needs to initialize, verify, and test the platform hardware components before the server system is completely started. This allows the system to enter the system interface and complete the startup process. The platform hardware components include the Baseboard Management Controller (BMC), Platform Controller Hub (PCH), and Central Processing Unit (CPU).

[0083] Figure 1 This is a schematic diagram of the server system boot and start in the related art, which can be referred to Figure 1 As shown, in the related technical solutions, system startup permission verification is performed during the system boot process, for example, user permission verification is completed using a password, or user permission is matched through biometrics. Such methods require user permission verification after the firmware boot is completed, and cannot guarantee that the system is protected from the harm of unauthorized booting.

[0084] On the other hand, after powering on and entering the pre-boot environment, the firmware's key is verified against a digital signature stored in non-volatile memory (NVM). Once verification is successful, the system boot process begins. Digital signatures are a technique for verifying data integrity and authenticity. Data is signed with a private key, and the recipient can then decrypt the signature and verify its validity using a public key. Successful signature verification indicates that the data has not been tampered with. However, digital signature verification can only detect tampering with the entire data or forgery of the signature itself. If only a small amount of data in the firmware has been tampered with, and the tampering was performed without affecting the digital signature, digital signature verification may not detect these changes. A common approach is to hash the entire firmware using a hash function and then transmit the hash value along with the digital signature. The recipient can then recalculate the hash value and verify the signature using the public key to ensure that the two match. However, if only a small portion of the data has been tampered with, and this data was not included in the recalculated hash value, verification will still succeed because the digital signature matches the original hash value. Therefore, in digital signature verification, tampering of individual data may be difficult to detect, and it will be difficult to identify by simply comparing the firmware key, thereby entering an unauthorized illegal boot process and endangering the security of the server system.

[0085] Figure 2 A flowchart of the firmware verification method provided by the present invention is shown in FIG. Figure 2 As shown, the present invention provides a firmware verification method, comprising:

[0086] Step 201, when it is determined that the target platform hardware component is in a reset state or a power-off state, obtain the target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is the system firmware data to be security-checked, and the reset state or the power-off state is determined based on the control result of the platform firmware protection recovery chip on the target platform hardware component.

[0087] In the present invention, the system firmware data of each platform hardware component in the server system is obtained. In one embodiment, during the startup process of the server system, when the platform hardware component is in a reset state, the platform firmware protection recovery (Platform Firmware Resilience, PFR) complex programmable logic device (CPLD), i.e., the PFR chip, can be used to control the platform hardware component so that it is in a reset state or a power-off state, and then the system firmware data of the platform hardware component is obtained in this state and temporarily stored in a corresponding storage area, thereby obtaining the target system firmware data from the storage area for subsequent firmware verification. It should be noted that the system firmware data is a binary file that contains program code, data, configuration information, etc. In actual use, the length of the firmware file can be obtained by reading the file header information or setting an appropriate buffer size, and processed according to specific needs.

[0088] Step 202: Perform data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data.

[0089] Data bit obfuscation is a privacy and security protection technology. In the present invention, pseudo-random data, random numbers, or error bits can be inserted into specific locations within the target system firmware data to interfere with data analysis and restoration. This increases the randomness of the data, making it more difficult to understand and decode. Preferably, in one embodiment, by performing shift, inversion, and string addition operations on the target system firmware data, the data bits of the firmware data can be quickly altered, thereby improving the security of the firmware file. After data bit obfuscation, obfuscated system firmware data is obtained. This data contains obfuscated information, making the structure and content of the original data impossible to directly identify and restore.

[0090] Step 203: Perform a hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data.

[0091] In the present invention, it is first necessary to select an applicable hash algorithm, such as Message Digest Algorithm 5 (MD5). Preferably, in one embodiment, the MD5 algorithm is combined with the Secure Hash Algorithm 256 (SHA256). The hash algorithm is used to hash the obfuscated system firmware data to generate a fixed-length hash value, which can be considered the hash key for the target system firmware data. The hash value is unique and irreversible, meaning that different data will generate different hash values, and the original data cannot be deduced from the hash value.

[0092] Step 204 : Match the hash key with the digital signature in the digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the digital signature is obtained from the original system firmware data after the data bit obfuscation processing and the hash operation processing.

[0093] In this invention, a digital signature library is pre-built. This library contains a series of digitally signed raw system firmware data and its corresponding digital signatures. Each digital signature is obtained through data bit obfuscation and hashing, i.e., the data obfuscation and hashing processes are identical to those used for the target system firmware data. It should be noted that the raw system firmware data is the factory firmware data of the platform hardware components and is system firmware data that is confirmed to have not been tampered with.

[0094] Specifically, the digital signature corresponding to the target system firmware data is extracted from the digital signature library and compared. If the two match, meaning the digital signature and hash key are consistent, indicating that the target system firmware data has not been tampered with or damaged, and its source and content can be trusted, the target system firmware data can be determined to have passed the security verification and has integrity and authenticity. If the digital signature and hash key do not match, it indicates that the target system firmware data may have been tampered with or damaged, or its source is untrustworthy. In this case, further inspection and processing are required to ensure system security.

[0095] The role of a digital signature is to verify the integrity and authenticity of data. By using a digital signature, if the target system firmware data has been tampered with, after data bit obfuscation and hashing, there will be a significant difference between it and the pre-stored digital signature, making it easier to identify firmware data tampering.

[0096] The firmware verification method provided by the present invention sequentially performs data bit obfuscation processing and hash operation processing on system firmware data to be subjected to security verification, and matches the obtained hash key with a digital signature in a digital signature library obtained by the original system firmware data in an early stage after the data bit obfuscation processing and hash operation processing. If the match is successful, it is determined that the system firmware data has passed the security verification. Therefore, during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system safer.

[0097] Based on the above embodiment, performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data includes:

[0098] receiving a first input, wherein the first input includes an operation of performing data bit obfuscation processing on the target system firmware data;

[0099] In response to the first input, a corresponding private key is generated, and data bit shift processing, inversion processing, and string addition processing are performed on the target system firmware data using the private key to obtain the obfuscated system firmware data.

[0100] In this invention, a private key is used to obfuscate the target system firmware data, further enhancing security. In asymmetric encryption algorithms, data encrypted with a private key can only be decrypted using the corresponding public key, protecting the integrity and confidentiality of the firmware data. This provides a higher level of security and protection, making it more difficult for attackers to obtain or tamper with the data.

[0101] Specifically, based on the above embodiment, the steps for obfuscating the data bits corresponding to the private key are as follows:

[0102] Shifting the data bits of the target system firmware data to obtain shifted system firmware data;

[0103] Based on the data bit movement direction corresponding to the shift processing, the system firmware data after the shift processing is padded with 0, and the data bits padded with 0 are inverted to obtain the inverted system firmware data;

[0104] The inverted system firmware data is added to a preset character string to obtain the obfuscated system firmware data.

[0105] In the present invention, a private key is first generated, and the private key is used to perform data bit obfuscation processing on firmware data, and the data bits of the firmware file are quickly changed through shift, inversion and addition operations, wherein the private key can be a string of random numbers or characters.

[0106] Furthermore, the target system firmware data is subjected to a data bit shift operation, where each data bit is shifted to the left or right by a specified number of bits. For example, the binary representation of each byte can be shifted right by 5 bits. Since the shift operation will lose data bits, if the shift direction is right shift, the high bit (left side) needs to be padded with 0 during the shift process; if the shift direction is left shift, the low bit (right side) needs to be padded with 0 during the shift process, and then the digits padded with 0 are inverted. For example, if the shift direction is right shift by 5 bits, the high bit is padded with 5 0s, and then these 5 0s are inverted to become 5 1s.

[0107] The shifted and negated system firmware data is then added to a string (i.e., a password, including numbers and letters). The addition operation is then performed based on this string. For example, in binary, 10100011 (assuming the firmware file) + 1011 (preset string) = the calculated data 10101110, where the preset string can be numbers or letters (both converted to binary data). The present invention uses a private key to perform a string addition operation on the negated data, adding the data to the corresponding string in the private key bit by bit to increase the difficulty of cracking. It should be noted that the present invention implements the data bit obfuscation process by constructing a private key. For example, the private key can be written as 00000101 (shift) + 1011 (addition), where the shifted data bit (occupies 8 bytes, binary) is shifted by a maximum of 127 bits. The first bit of the private key is 0, indicating a right shift, and 1, indicating a left shift. After the shift is inverted, the data is added to the string 1011. The present invention does not limit the length of the key for the addition part. It should be noted that in the present invention, for digital signatures in the same digital signature library, the same data bit obfuscation process needs to be performed in the early stage. That is, during the server system startup process, different types of platform hardware components also perform the same data bit obfuscation process as their corresponding digital signatures, such as the same data bit shift method and preset string.

[0108] In the present invention, the private keys required for the shift, subtraction and string addition operations can be managed by the user end (the process is reversible); the subsequent hash calculation process is derived from the hash function, and the process is irreversible.

[0109] Based on the above embodiment, performing a hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data includes:

[0110] Performing a first-level hash operation on the obfuscated system firmware data based on Information Digest Algorithm 5 to obtain a first hash value, where the first hash value is a 128-bit hash value corresponding to the obfuscated system firmware data;

[0111] The matching of the hash key and the digital signature in the digital signature library, if successful, determines that the target system firmware data passes the security check, comprising:

[0112] The first hash value is matched with the first digital signature in the digital signature library, if successful, determines that the target system firmware data passes the security check, wherein the first digital signature is based on the message digest algorithm 5, the first level hash operation processing is carried out on the original system firmware data after the data bit confusion processing.

[0113] In the application, after the confused system firmware data is obtained, MD5 algorithm is used to carry out hash operation on the confused system firmware data, so as to convert the data into a hash value with fixed length (128 bits). MD5 algorithm processes the input information in 512-bit groups, and each group is divided into 16 32-bit subgroups, after a series of processing, the output of the algorithm is composed of four 32-bit groups. For the server system startup scene with large data sample and low security level, the application uses MD5 algorithm to calculate the hash value of the confused system firmware data, at the same time, the original firmware data (which needs to be processed by data bit confusion) in the digital signature library is also calculated by the same MD5 algorithm in the early stage, so as to realize fast calculation, improve the efficiency of digital signature matching, and then make the server system quickly enter the startup state.

[0114] In the process of first level hash calculation, the original data (i.e. target system firmware data) is shifted and negated, which can quickly change the data structure, but the confusion function of the data is limited; then, the string addition operation is used for confusion diffusion, which can ensure the flexible adjustment of confusion parameters in the hash calculation process, so as to obtain better hash effect, i.e. the irreversibility of data.

[0115] On the basis of the above embodiment, after the hash operation processing of the confused system firmware data based on the message digest algorithm 5 is carried out, the method further comprises:

[0116] Based on the security hash algorithm 256, the second level hash operation processing is carried out according to the data length of the target system firmware data and the first hash value, and the second hash value is obtained, the second hash value is a 256-bit hash root key corresponding to the confused system firmware data;

[0117] The matching of the hash key and the digital signature in the digital signature library, if successful, determines that the target system firmware data passes the security check, comprising:

[0118] matching the second hash value with a second digital signature in the digital signature library, if the matching is successful, determining that the target system firmware data passes the security check, wherein the second digital signature is obtained by performing the first-level hash operation and the second-level hash operation on the original system firmware data after the data bit confusion processing based on a secure hash algorithm 256.

[0119] In the present application, in order to further improve the security of the server system in the starting process, on the basis of the above embodiment, the second-level hash operation processing is performed by SHA256. Specifically, first, the original data length (i.e. the data length of the target system firmware data) and the 128-bit hash key (i.e. the first hash value) are combined as input, and the SHA256 hash algorithm is used for hash calculation to generate a 256-bit hash value composed of 64 hexadecimal characters, i.e. the second hash value. Further, the second hash value is matched with the corresponding digital signature (i.e. the second digital signature) in the digital signature library, and if the matching is successful, it is determined that the security check of the target system firmware data is passed. It should be noted that in the present application, the second digital signature in the digital signature library is also obtained after the same data bit confusion processing and twice hash operation processing in the early stage. The present application adopts a two-level signature encryption mode, which takes into account the algorithm speed while making the key management more flexible and ensuring the security of the data structure.

[0120] On the basis of the above embodiment, the data bit shift processing, the inversion processing and the string addition operation processing of the target system firmware data by the private key include:

[0121] obtaining the corresponding data bit shift number in the private key;

[0122] judging the private key according to the data bit shift number and the preset maximum shift number, and if the private key is determined to be a valid key according to the judgment result, the data bit shift processing, the inversion processing and the string addition operation processing of the target system firmware data by the private key.

[0123] In the present application, the private key can be defined by the user terminal, in order to ensure the stability of the firmware verification process, it is necessary to judge the data bit shift mode in the private key to ensure the rationality of the private key, so that the target system firmware data can smoothly complete the data bit shift process. In the present application, the data bit shift number in the private key, such as left shift 10 bits, can be compared with the preset maximum shift number (such as maximum shift 127 bits). Specifically, the judgment of the private key according to the data bit shift number and the preset maximum shift number includes:

[0124] determining whether the data bit shift number is greater than the preset maximum shift number, if less than or equal to the preset maximum shift number, determining that the private key is a valid key, and performing data bit shift processing, negation processing and string addition operation processing on the target system firmware data by the private key determined as the valid key, to obtain the obfuscated system firmware data.

[0125] In the application, when it is determined that the data bit shift number in the private key is not greater than the preset maximum shift number, the current private key is determined as a valid key, and the data bit obfuscation processing on the target system firmware data can be completed by the private key.

[0126] On the basis of the above embodiment, the method further comprises:

[0127] If the data bit shift number is greater than the preset maximum shift number, it is determined that the private key is an invalid key, and corresponding data bit obfuscation processing error prompt information is generated.

[0128] In the application, if the private key setting is unreasonable, that is, the data bit shift number exceeds the preset maximum shift number, corresponding error prompt information is generated. It should be noted that in the application, the private key setting can be set when the digital signature is generated, that is, in order to ensure that the digital signature and the subsequent corresponding system firmware data adopt the same data bit obfuscation method, the data bit shift number adopted by the digital signature also needs to be determined when the digital signature library is constructed.

[0129] On the basis of the above embodiment, after the hash key and the digital signature in the digital signature library are matched, if the matching is successful, it is determined that the target system firmware data passes the security check, and the method further comprises:

[0130] Based on the target system firmware data that passes the security check, the target platform hardware component is driven to start.

[0131] In the application, for the starting process of the server system, in order to prevent security risks caused by tampered firmware, the system firmware data needs to be checked when the server system does not start by the firmware data. In an embodiment, based on the PFR function of the server system, the platform hardware component is placed in a reset state or a power-off state, at this time the server system is in a pre-starting environment, and then the system firmware data of each platform hardware component is checked, and after it is determined that all firmware checks pass, the corresponding platform hardware component is driven by the system firmware data, so that the server system starts, thereby improving the security of the server system starting process.

[0132] Based on the above embodiment, if the matching between the hash key and the digital signature in the digital signature library is unsuccessful, the method further includes:

[0133] Acquire firmware backup data corresponding to the target system firmware data, wherein the firmware backup data and the target system firmware data are stored in different data storage areas;

[0134] performing the data bit obfuscation process and the hash operation process on the firmware backup data in sequence to obtain a hash key corresponding to the firmware backup data;

[0135] Matching the hash key corresponding to the firmware backup data with the digital signature in the digital signature library, determining that the firmware backup data passes the security verification if the match is successful, and driving the target platform hardware component to start based on the firmware backup data that passes the security verification;

[0136] If the matching fails, a corresponding platform hardware component startup failure prompt message is generated.

[0137] In the present invention, when the system firmware data of some platform hardware components fails the firmware verification, the firmware backup data of the system firmware data is obtained from the data storage area storing the backup data. The firmware backup data is then subjected to the data bit obfuscation and hash operation processing described in the above embodiment. Based on the matching result of the processing and the digital signature, it is determined whether the platform hardware components can be started by the firmware backup data. If the matching fails, a corresponding failure prompt message is generated. The present invention uses the primary and backup firmware data to start the server system, which not only ensures the security of the server system startup process, but also improves the stability of the server system.

[0138] Based on the above embodiment, the method further includes:

[0139] Performing data preprocessing on the system firmware data to be security-verified to obtain the target system firmware data;

[0140] Performing data preprocessing on the original system firmware data to obtain a corresponding digital signature through the original system firmware after data preprocessing;

[0141] The data preprocessing includes at least data cleaning, data standardization and denoising.

[0142] In this invention, when generating a digital signature, the original system firmware data can be preprocessed, such as removing unnecessary characters, blanks, or other interference items; and converting the data into a standard format or unit for better comparison and processing. For example, string data can be converted to a uniform case format, and date and time formats can be normalized. Accordingly, during the subsequent firmware verification process, the system firmware data undergoing security verification can be preprocessed accordingly, which helps improve the effectiveness and accuracy of the hash algorithm.

[0143] Figure 3 A schematic diagram of the system startup method provided by the present invention is shown in FIG. Figure 3 As shown, the present invention adopts a system startup method based on the firmware verification method described in the above embodiments, which is applied to a platform firmware protection and recovery chip, including:

[0144] Step 301: construct a pre-boot environment for the server system to be booted, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas.

[0145] In the present invention, based on the PFR function of the server system, a pre-boot environment (i.e., the T-1 stage) is introduced during the normal boot process. In this pre-boot environment, the PFR CPLD (i.e., the platform firmware protection and recovery chip) can obtain the FLASH ownership of all platform hardware components (such as BIOS FLASH and BMCFLASH) through a multiplexer (MUX), and simultaneously achieve physical isolation between each platform hardware component (such as BMC and PCH) and its corresponding system firmware data.

[0146] Step 302: Send a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware components to enter a reset state or a power-off state.

[0147] In the present invention, the platform firmware protection recovery chip establishes connections with various platform hardware components in a pre-boot environment, and keeps platform hardware components such as BMC, PCH, and CPU in a reset state or a power-off state by sending a first initialization signal.

[0148] Step 303: When it is determined that each platform hardware component is in the reset state or the power-off state, obtain system firmware data corresponding to each platform hardware component.

[0149] In the present invention, when all platform hardware components in the server system are in reset state or power-off state, the system firmware data of all platform hardware components are read through the Serial Peripheral Interface (SPI) bus, and these system firmware data are temporarily stored in the CFM (Configuration Flash Memory) of the PFR FLASH.

[0150] Step 304: Obtain security verification results of each of the system firmware data, and determine the security verification results. If it is determined that all of the system firmware data pass the security verification, send a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state.

[0151] Step 305 : After determining that all the platform hardware components are in the startup state, a normal startup environment is constructed, and the server system is started based on the system firmware data that has passed the security verification.

[0152] In the present invention, the firmware verification method of the above embodiment is used to perform firmware verification on the system firmware data stored in the CFM of the PFR FLASH. When all the system firmware data passes the firmware verification, the PFR CPLD generates a signal for releasing the reset state or restoring the power-on state, so that each platform hardware component enters the startup state, thereby allowing the server system to enter the normal startup environment (i.e., the T0 stage), completing the server system startup.

[0153] The system startup method provided by the present invention sequentially performs data bit obfuscation processing and hash operation processing on system firmware data to be subjected to security verification, and matches the obtained hash key with a digital signature in a digital signature library obtained by the original system firmware data in an early stage after the data bit obfuscation processing and hash operation processing. If the match is successful, it is determined that the system firmware data has passed the security verification, so that during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system safer.

[0154] Based on the above embodiment, the platform firmware protection and recovery chip establishes a connection with each of the platform hardware components through a universal input and output interface, and obtains the system firmware data in the data storage area of ​​each of the platform hardware components through a multi-way selection switch and a serial peripheral interface controller, wherein the platform firmware protection and recovery chip stores the obtained system firmware data in the data temporary storage area.

[0155] In the present application, the platform firmware protection recovery chip establishes connection with various platform hardware components through a general purpose input output (GPIO) interface, which can include CPU, memory, peripherals, etc. Meanwhile, the platform firmware protection recovery chip controls data transmission and selection through a multiplexer and a serial peripheral interface controller (SPI Controller), wherein the multiplexer can be used to switch the connection between the platform firmware protection recovery chip and different platform hardware components to obtain the required system firmware data (only part of the firmware data can be checked according to the server startup requirements), and the SPI Controller is used for serial communication with the platform hardware components to read data.

[0156] In the pre-boot environment, the platform firmware protection recovery chip can obtain system firmware data from the data storage areas of various platform hardware components, which can be flash memory, EEPROM, NVRAM, etc. on the platform hardware components. By accessing these hardware components one by one or in parallel, the platform firmware protection recovery chip can collect complete system firmware data. Further, the obtained system firmware data is stored by the platform firmware protection recovery chip in a data temporary storage area, which can be a register, cache or external RAM inside the chip, for subsequent security check, recovery or other operations.

[0157] The present application can effectively obtain system firmware data and store it in a data temporary storage area through the connection and control of the platform firmware protection recovery chip and various platform hardware components, providing a necessary basis for subsequent firmware checking and recovery.

[0158] On the basis of the above embodiment, the security check result of each system firmware data is obtained, and the security check result is judged, comprising:

[0159] If it is judged that any one of the system firmware data does not pass the security check, the firmware backup data corresponding to the system firmware data that does not pass the security check is obtained;

[0160] The firmware backup data is written into a target data storage area, wherein the target data storage area is the data storage area of the system firmware data that does not pass the security check;

[0161] The firmware data check is re-executed on the firmware backup data and other system firmware data, and if all pass the security check, the second initialization signal is generated, wherein the other system firmware data is the system firmware data other than the system firmware data that does not pass the security check and the corresponding firmware backup data.

[0162] In the present invention, after determining that all system firmware data to be firmware verified are normal, the platform hardware component reset is released and the normal startup phase (T0 phase) is entered. In the case where a certain system firmware data fails the security verification, it is necessary to obtain the firmware backup data corresponding to the system firmware data, and then perform firmware data verification on this firmware backup data (the data bit obfuscation processing and hash operation processing of the above embodiment are also performed) and other system firmware data again, wherein the digital signature required for firmware data verification is stored in UFM (User Flash Memory). In one embodiment, in order to improve the efficiency of firmware verification, it is only necessary to perform firmware verification on the firmware backup data again.

[0163] Based on the above embodiment, the method further includes:

[0164] During the current startup process of the server system, it is determined whether the number of times the firmware data verification is re-executed is greater than the preset verification number. If it is greater than the preset verification number, a system shutdown signal is generated to control the server system to be shut down through the system shutdown signal.

[0165] In the present invention, if the firmware verification fails, the platform firmware protection recovery chip writes the data in the recovery area of ​​the PFRFLASH flash memory that stores the firmware code to the active area, counts +1, reads the newly written data in the active area, and performs firmware verification on the data. If the firmware verification fails 3 times, the system enters the shutdown state. When the preset number of times is reached, the system automatically shuts down, preventing suspicious files from continuing to run in the system during the server system startup process, which can ensure the security and stability of the server system and reduce maintenance costs and risks. Among them, the active area stores uncompressed, directly executed firmware data, which is also the system firmware data that needs to be firmware verified; the recovery area stores compressed backup files (there are multiple versions), which are only used when the active area is damaged.

[0166] Figure 4 The overall flow diagram of the system startup method provided by the present invention can be referred to Figure 4 As shown in the figure, first, the boot loader directly accesses the memory module, starts and initializes the PFR CPLD, and enters the pre-boot environment (i.e., T-1 stage); in the T-1 stage, the PFR CPLD establishes connections with major platform components such as the BMC / PCH through GPIO signals and puts them into reset or power-off state.

[0167] Furthermore, the PFR CPLD obtains control of all SPI buses through the MUX and physically isolates the BMC / PCH from its system firmware data. At the same time, the PFR CPLD reads all platform firmware information through the SPI bus and temporarily stores it in the CFM part of the PFR FLASH, providing firmware data to be verified for subsequent system firmware verification.

[0168] During the firmware verification process, based on the firmware verification method in the above embodiment, the system firmware data (including the platform component type and firmware code) is read from the CFM, and then the data bit shift and inversion and string addition operations are performed, and then the obtained obfuscated and diffused data is subjected to MD5 hash calculation to obtain a 128-bit hash key; further, the platform firmware data length is obtained, and combined with the 128-bit hash key obtained in the previous step, a SHA256 hash calculation is performed to obtain a 256-bit hash root key; then, the 256-bit hash root key corresponding to each platform hardware component calculated in the previous step is verified and matched with the digital signature corresponding to each platform hardware component stored in the UFM.

[0169] If the verification is successful, the PFR CPLD releases the reset of major platform hardware components such as the BMC / PCH, and the system enters the normal boot phase (i.e., phase T0). If the verification fails, the data in the recovery area of ​​the FLASH flash memory storing the firmware code is written to the active area, the count is increased by 1, and the above firmware verification process is repeated. If the verification fails three times, the system enters the shutdown state.

[0170] The firmware verification device provided by the present invention is described below. The firmware verification device described below and the firmware verification method described above can be referenced to each other.

[0171] Figure 5 This is a schematic diagram of the structure of the firmware verification device provided by the present invention, as shown in FIG. Figure 5As shown, the present invention provides a firmware verification device, including a firmware data acquisition unit 501, a data obfuscation unit 502, a key encryption unit 503 and a key comparison unit 504, wherein the firmware data acquisition unit 501 is used to obtain target system firmware data corresponding to the target platform hardware component when determining that the target platform hardware component is in a reset state or a power-off state, wherein the target system firmware data is system firmware data to be security verified, and the reset state or the power-off state is determined based on the control result of the platform firmware protection and recovery chip on the target platform hardware component; the data obfuscation unit 502 performs data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; the key encryption unit 503 is used to perform hash operation processing on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; the key comparison unit 504 is used to match the hash key with a digital signature in a digital signature library. If the match is successful, it is determined that the target system firmware data has passed the security verification, wherein the digital signature is obtained from the original system firmware data after the data bit obfuscation processing and the hash operation processing.

[0172] The firmware verification device provided by the present invention performs data bit obfuscation processing and hash operation processing on the system firmware data to be subjected to security verification in sequence, and matches the obtained hash key with the digital signature in the digital signature library obtained by the original system firmware data in the early stage after the data bit obfuscation processing and hash operation processing. If the match is successful, it is determined that the system firmware data has passed the security verification. Therefore, during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system safer.

[0173] The system startup device provided by the present invention is described below. The system startup device described below and the system startup method described above can be referenced to each other.

[0174] Figure 6 This is a schematic diagram of the structure of the system startup device provided by the present invention, as shown in FIG. Figure 6As shown, the present invention provides a system startup device based on the firmware verification device described in the above embodiment, including a pre-startup module 601, a first processing module 602, an interaction module 603, a second processing module 604 and a system startup module 605, wherein the pre-startup module 601 is used to build a pre-startup environment for the server system to be started, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-startup environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas; the first processing module 602 is used to send a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware component to enter a reset state or a power-off state; the interaction module 603 is used to obtain the system firmware data corresponding to each of the platform hardware components when it is determined that each of the platform hardware components is in the reset state or the power-off state; the second processing module 604 is used to obtain the security verification results of each of the system firmware data and judge the security verification results. If it is determined that all of the system firmware data have passed the security verification, a second initialization signal is sent to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter the startup state from the reset state or the power-off state; the system startup module 605 is used to build a normal startup environment after determining that all of the platform hardware components are in the startup state, and start the server system based on the system firmware data that have passed the security verification.

[0175] The system startup device provided by the present invention performs data bit obfuscation processing and hash operation processing on the system firmware data to be subjected to security verification in sequence, and matches the obtained hash key with the digital signature in the digital signature library obtained by the original system firmware data that has been subjected to data bit obfuscation processing and hash operation processing in the early stage. If the match is successful, it is determined that the system firmware data has passed the security verification. Therefore, during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system safer.

[0176] The device provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.

[0177] The present invention also provides a server system, comprising the firmware verification device, system startup device and multiple platform hardware components described in the above embodiments, wherein the platform hardware component establishes a connection with the system startup device through a universal input and output interface; after the system startup device controls the platform hardware component to a reset state or a power-off state, it is used to obtain system firmware data in a data storage area of ​​the platform hardware component through a multi-way selection switch and a serial peripheral interface controller, and after determining that the system firmware data passes the security verification, performs a startup operation on the server system; the firmware data verification device is used to perform a security verification on the system firmware data obtained by the system startup device.

[0178] Figure 7 The system architecture diagram of the server system secure boot based on the platform firmware protection recovery chip provided by the present invention can be referred to Figure 7 As shown, in the present invention, the system startup device is mainly composed of a PFR CPLD (Platform Firmware Protection and Recovery Chip), and its main hardware modules include: a processor (such as a NIOS II processor) for executing and calculating basic instructions of the firmware verification system; a cryptographic compilation accelerator for providing hardware acceleration for hash calculations required for firmware authentication in the SPI area; a general input and output interface (GPIO) for interacting with various platform hardware components to control the power and reset of the CPU, PCH, and BMC, such as sending the reset signal BMC_RST; and a serial peripheral interface controller (SPI controller) for enabling the PFR CPLD to directly access the FLASH (flash memory) of various platform hardware components.

[0179] The firmware verification device mainly includes: a data acquisition unit (i.e., a firmware data acquisition unit), which is used to obtain firmware information and provide original data (system firmware data to be verified) for hash calculation. In one embodiment, the data obfuscation function in the hash calculation unit can be used as a separate unit (i.e., a data obfuscation unit) to perform data bit obfuscation processing, and the MD5 hash calculation function can be combined with the key encryption unit into a unit to perform hash operation processing; in this embodiment, the hash calculation unit shifts and inverts the original data part and then performs an addition operation, and then performs an MD5 hash calculation to obtain a 128-bit hash key; a key encryption unit, which is used to obtain the data length of the system firmware data, and combines the obtained 128-bit hash key with the SHA256 hash calculation to obtain a 256-bit hash root key. In one embodiment, if the above-mentioned hash calculation unit only performs data bit obfuscation, at this time, the key encryption unit also needs to perform a hash operation processing of the data after data bit obfuscation using the MD5 algorithm, and then perform a hash calculation using the SHA256 algorithm. The key comparison unit is used to verify and match the obtained 256-bit hash root key with the digital signature stored in the UFM of the platform firmware protection and recovery chip flash memory, thereby obtaining a firmware verification result. Furthermore, after determining the verification results of each system firmware data, the platform firmware protection and recovery chip releases the reset or power-off state of major platform hardware components such as BMC and PCH through GPIO signals, allowing the server system to enter the normal startup phase (T0 phase). It should be noted that in the present invention, the PFR CPLD establishes a connection with each platform hardware component through a multiplexer (i.e., MUX) and a serial peripheral interface controller, wherein the PFR CPLD establishes a connection with the corresponding platform hardware component by sending a chip select signal (SPI_CS_n).

[0180] The server system provided by the present invention sequentially performs data bit obfuscation processing and hash operation processing on system firmware data to be subjected to security verification, and matches the obtained hash key with a digital signature in a digital signature library obtained by previously performing data bit obfuscation processing and hash operation processing on the original system firmware data. If the match is successful, it is determined that the system firmware data has passed the security verification. Therefore, during the firmware verification process, it is easier to identify that some information in the firmware has been tampered with, thereby improving the accuracy of the firmware verification process and making the startup process of the server system more secure.

[0181] Figure 8 A schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 8As shown, the electronic device may include: a processor (Processor) 801, a communication interface (Communications Interface) 802, a memory (Memory) 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804. The processor 801 can call the logic instructions in the memory 803 to execute the firmware verification method, which includes: when it is determined that the target platform hardware component is in a reset state or a power-off state, obtaining the target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is the system firmware data to be security verified, and the reset state or the power-off state is determined based on the control result of the platform firmware protection and recovery chip on the target platform hardware component; performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; performing hash operation processing on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; matching the hash key with the digital signature in the digital signature library, and if the match is successful, determining that the target system firmware data passes the security verification, wherein the digital signature is obtained by the original system firmware data after the data bit obfuscation processing and the hash operation processing;

[0182] Alternatively, a system startup method is executed, the method comprising: constructing a pre-boot environment for a server system to be started, wherein a data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each data storage area; sending a first initialization signal to each platform hardware component, wherein the first initialization signal is used to control the platform hardware component to enter a reset state or a power-off state; when it is determined that each platform hardware component is in the reset state or the power-off state, obtaining the system firmware data corresponding to each platform hardware component; obtaining a security verification result of each system firmware data, and judging the security verification result. If it is determined that all the system firmware data pass the security verification, sending a second initialization signal to each platform hardware component, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state; after determining that all the platform hardware components are in the startup state, constructing a normal startup environment, and starting the server system based on the system firmware data that passed the security verification.

[0183] In addition, the logic instructions in the above-mentioned memory 803 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.

[0184] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer can execute the firmware verification method provided by the above methods, the method including: when it is determined that the target platform hardware component is in a reset state or a power-off state, obtaining target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is system firmware data to be security verified, and the reset state or the power-off state is determined based on the control result of the platform firmware protection and recovery chip on the target platform hardware component; performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; performing hash operation processing on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; matching the hash key with a digital signature in a digital signature library, and if the match is successful, determining that the target system firmware data passes the security verification, wherein the digital signature is obtained from the original system firmware data after the data bit obfuscation processing and the hash operation processing;

[0185] Alternatively, the system startup method provided by each of the above methods is executed, the method comprising: constructing a pre-boot environment for a server system to be started, wherein a data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas; sending a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware component to enter a reset state or a power-off state; when it is determined that each of the platform hardware components is in the reset state or the power-off state, obtaining the system firmware data corresponding to each of the platform hardware components; obtaining a security verification result of each of the system firmware data, and judging the security verification result. If it is determined that all of the system firmware data pass the security verification, sending a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state; after determining that all of the platform hardware components are in the startup state, constructing a normal startup environment, and starting the server system based on the system firmware data that passed the security verification.

[0186] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the firmware verification method provided by the above-mentioned embodiments, the method comprising: when it is determined that the target platform hardware component is in a reset state or a power-off state, obtaining target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is system firmware data to be security-verified, and the reset state or the power-off state is determined based on the control result of the platform firmware protection and recovery chip on the target platform hardware component; performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; performing hash operation processing on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; matching the hash key with a digital signature in a digital signature library, and if the match is successful, determining that the target system firmware data passes the security verification, wherein the digital signature is obtained by the original system firmware data after the data bit obfuscation processing and the hash operation processing;

[0187] Alternatively, the system startup method provided in each of the above embodiments is executed, the method comprising: constructing a pre-boot environment for a server system to be started, wherein a data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each data storage area; sending a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware component to enter a reset state or a power-off state; when it is determined that each of the platform hardware components is in the reset state or the power-off state, obtaining the system firmware data corresponding to each of the platform hardware components; obtaining a security verification result of each of the system firmware data, and judging the security verification result. If it is determined that all of the system firmware data pass the security verification, sending a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state; after determining that all of the platform hardware components are in the startup state, constructing a normal startup environment, and starting the server system based on the system firmware data that passed the security verification.

[0188] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0189] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A firmware verification method, characterized in that: include: When it is determined that the target platform hardware component is in a reset state or a power-off state, obtaining target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is system firmware data to be security-verified, and the reset state or the power-off state is determined based on a control result of the target platform hardware component by a platform firmware protection and recovery chip; Performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; Performing a hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; The hash key is matched with a digital signature in a digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the digital signature is obtained by the original system firmware data after the data bit obfuscation processing and the hash operation processing.

2. The firmware verification method according to claim 1, wherein: The performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data includes: receiving a first input, wherein the first input includes an operation of performing data bit obfuscation processing on the target system firmware data; In response to the first input, a corresponding private key is generated, and data bit shift processing, inversion processing, and string addition processing are performed on the target system firmware data using the private key to obtain the obfuscated system firmware data.

3. The firmware verification method according to claim 1, wherein: The performing hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data includes: Performing a first-level hash operation on the obfuscated system firmware data based on Information Digest Algorithm 5 to obtain a first hash value, where the first hash value is a 128-bit hash value corresponding to the obfuscated system firmware data; The step of matching the hash key with a digital signature in a digital signature library and determining that the target system firmware data passes security verification if the match is successful includes: The first hash value is matched with the first digital signature in the digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the first digital signature is based on the information digest algorithm 5 and is obtained by performing the first level hash operation on the original system firmware data after the data bit obfuscation processing.

4. The firmware verification method according to claim 3, wherein: After performing a hash operation on the obfuscated system firmware data based on the message digest algorithm 5 to obtain a first hash value, the method further includes: Performing a second-level hash operation based on the data length of the target system firmware data and the first hash value using a secure hash algorithm 256 to obtain a second hash value, where the second hash value is a 256-bit hash root key corresponding to the obfuscated system firmware data; The step of matching the hash key with a digital signature in a digital signature library and determining that the target system firmware data passes security verification if the match is successful includes: The second hash value is matched with the second digital signature in the digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the second digital signature is based on the secure hash algorithm 256, and is obtained by sequentially performing the first-level hash operation processing and the second-level hash operation processing on the original system firmware data after the data bit obfuscation processing.

5. The firmware verification method according to claim 2, wherein: The steps for obfuscating the data bits corresponding to the private key are: Shifting the data bits of the target system firmware data to obtain shifted system firmware data; Based on the data bit movement direction corresponding to the shift processing, the system firmware data after the shift processing is padded with 0, and the data bits padded with 0 are inverted to obtain the inverted system firmware data; The inverted system firmware data is added to a preset character string to obtain the obfuscated system firmware data.

6. The firmware verification method according to claim 5, wherein: The method of performing data bit shift processing, inversion processing, and string addition processing on the target system firmware data using the private key includes: Obtain the corresponding data bit shift number in the private key; The private key is judged according to the number of data shift bits and the preset maximum shift number. If the private key is determined to be a valid key according to the judgment result, the target system firmware data is subjected to data shift processing, inversion processing and string addition processing using the private key.

7. The firmware verification method according to claim 6, wherein: The determining of the private key according to the number of data shift bits and the preset maximum number of shift bits includes: Determine whether the number of data bit shifts is greater than the preset maximum shift number. If it is less than or equal to the preset maximum shift number, determine that the private key is a valid key, and use the private key determined to be the valid key to perform data bit shift processing, inversion processing, and string addition processing on the target system firmware data to obtain the obfuscated system firmware data.

8. The firmware verification method according to claim 7, wherein: The method further comprises: If the number of data bit shifts is greater than the preset maximum number of shifts, it is determined that the private key is an invalid key, and a corresponding data bit obfuscation error prompt message is generated.

9. The firmware verification method according to claim 1, wherein: After matching the hash key with the digital signature in the digital signature library and determining that the target system firmware data passes the security verification if the match is successful, the method further includes: Based on the target system firmware data that has passed the security check, the target platform hardware components are driven to start.

10. The firmware verification method according to claim 9, wherein: If the hash key and the digital signature in the digital signature library are not matched successfully, the method further includes: Acquire firmware backup data corresponding to the target system firmware data, wherein the firmware backup data and the target system firmware data are stored in different data storage areas; performing the data bit obfuscation process and the hash operation process on the firmware backup data in sequence to obtain a hash key corresponding to the firmware backup data; Matching the hash key corresponding to the firmware backup data with the digital signature in the digital signature library, determining that the firmware backup data passes the security verification if the match is successful, and driving the target platform hardware component to start based on the firmware backup data that passes the security verification; If the matching fails, a corresponding platform hardware component startup failure prompt message is generated.

11. The firmware verification method according to claim 1, wherein: The method further comprises: Performing data preprocessing on the system firmware data to be security-verified to obtain the target system firmware data; Performing data preprocessing on the original system firmware data to obtain a corresponding digital signature through the original system firmware after data preprocessing; The data preprocessing includes at least data cleaning, data standardization and denoising.

12. A system startup method based on the firmware verification method according to any one of claims 1 to 11, characterized in that: Applied to platform firmware protection and recovery chips, including: Constructing a pre-boot environment for a server system to be started, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas; Sending a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware components to enter a reset state or a power-off state; When it is determined that each of the platform hardware components is in the reset state or the power-off state, obtaining system firmware data corresponding to each of the platform hardware components; Obtaining a security verification result of each of the system firmware data, and judging the security verification result, if it is determined that all of the system firmware data pass the security verification, sending a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state; After determining that all the platform hardware components are in the startup state, a normal startup environment is constructed, and the server system is started based on the system firmware data that has passed the security check.

13. The system startup method according to claim 12, characterized in that: The platform firmware protection and recovery chip establishes a connection with each of the platform hardware components through a universal input and output interface, and obtains the system firmware data in the data storage area of ​​each of the platform hardware components through a multiplexer and a serial peripheral interface controller, wherein the platform firmware protection and recovery chip stores the obtained system firmware data in a temporary data storage area.

14. The system startup method according to claim 12, characterized in that: The obtaining of the security verification results of each of the system firmware data and judging the security verification results includes: If it is determined that any of the system firmware data fails the security check, obtaining firmware backup data corresponding to the system firmware data that fails the security check; Writing the firmware backup data into a target data storage area, wherein the target data storage area is a data storage area for the system firmware data that has not passed the security check; Re-perform firmware data verification on the firmware backup data and other system firmware data. If all pass the security verification, generate the second initialization signal, wherein the other system firmware data is the system firmware data other than the system firmware data that fails the security verification and the corresponding firmware backup data.

15. The system startup method according to claim 14, characterized in that: The method further comprises: During the current startup process of the server system, it is determined whether the number of times the firmware data verification is re-executed is greater than the preset verification number. If it is greater than the preset verification number, a system shutdown signal is generated to control the server system to be shut down through the system shutdown signal.

16. A firmware verification device, characterized in that: include: a firmware data acquisition unit, configured to, upon determining that a target platform hardware component is in a reset state or a power-off state, acquire target system firmware data corresponding to the target platform hardware component, wherein the target system firmware data is system firmware data to be security-verified, and the reset state or the power-off state is determined based on a control result of the target platform hardware component by a platform firmware protection and recovery chip; a data obfuscation unit, performing data bit obfuscation processing on the target system firmware data to obtain obfuscated system firmware data; a key encryption unit, configured to perform a hash operation on the obfuscated system firmware data to obtain a hash key corresponding to the target system firmware data; A key comparison unit is used to match the hash key with a digital signature in a digital signature library. If the match is successful, it is determined that the target system firmware data passes the security verification, wherein the digital signature is obtained by the original system firmware data after the data bit obfuscation processing and the hash operation processing.

17. A system startup device based on the firmware verification device according to claim 16, characterized in that: include: A pre-boot module is configured to construct a pre-boot environment for a server system to be booted, wherein the data storage area of ​​each platform hardware component in the server system stores corresponding system firmware data, and in the pre-boot environment, the platform firmware protection and recovery chip establishes a connection with each of the data storage areas; A first processing module is configured to send a first initialization signal to each of the platform hardware components, wherein the first initialization signal is used to control the platform hardware components to enter a reset state or a power-off state; an interaction module, configured to obtain system firmware data corresponding to each of the platform hardware components when determining that each of the platform hardware components is in the reset state or the power-off state; a second processing module, configured to obtain a security verification result of each of the system firmware data, and to judge the security verification result; if it is determined that all of the system firmware data pass the security verification, to send a second initialization signal to each of the platform hardware components, wherein the second initialization signal is used to control the platform hardware component to enter a startup state from the reset state or the power-off state; The system startup module is used to build a normal startup environment after determining that all the platform hardware components are in the startup state, and to start the server system based on the system firmware data that has passed the security check.

18. A server system, characterized in that: The invention comprises the firmware verification device according to claim 16, the system startup device according to claim 17 and a plurality of platform hardware components, wherein the platform hardware component establishes a connection with the system startup device via a universal input / output interface; after the system startup device controls the platform hardware component to enter a reset state or a power-off state, it is used to obtain the system firmware data in the data storage area of ​​the platform hardware component through a multi-way selection switch and a serial peripheral interface controller, and after determining that the system firmware data has passed the security verification, performs a startup operation on the server system; the firmware data verification device is used to perform a security verification on the system firmware data obtained by the system startup device.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the firmware verification method according to any one of claims 1 to 11 is implemented, or the system startup method according to any one of claims 12 to 15 is implemented.

20. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the firmware verification method according to any one of claims 1 to 11 or the system startup method according to any one of claims 12 to 15 is implemented.

Citation Information

Patent Citations

  • Method for identifying and cracking a fragile hash function for firmware of intelligent equipment

    CN109740347A

  • Information data longitudinal redundancy check error correction encoding and decoding method

    CN111327397A