Firmware upgrade method, computer program product, electronic device and medium
By generating a digitally signed upgrade file, the firmware upgrade process is decoupled, solving the problem of internal firmware upgrade coupling within the BMC, improving the stability and security of firmware upgrades, and simplifying the maintenance process.
Patent Information
- Application Number
- PCT/CN2025/098182
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-28
- Filing Date
- 2025-05-29
- Publication Date
- 2026-03-05
AI Technical Summary
The existing firmware upgrade method results in severe coupling between BMC and other firmware upgrades, affecting other firmware upgrades, making later maintenance inconvenient, and failing to effectively verify firmware types, leading to upgrade errors.
By generating a specified upgrade file with a digital signature, the firmware upgrade process is decoupled using preset rules. This includes packaging the firmware version file, upgrade script, and tools, compressing and encrypting the signature, achieving security verification and version checking, and ensuring the correctness and security of the upgrade file.
This decouples the baseboard management controller from the system firmware, reduces the risk of upgrade failures, improves the stability and security of firmware upgrades, and simplifies the maintenance process.
Smart Images

Figure CN2025098182_05032026_PF_FP_ABST
Abstract
Description
Firmware upgrade methods, computer program products, electronic devices and media
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411187210.6, filed on August 28, 2024, entitled "Firmware Upgrade Method, Computer Program Product, Electronic Device and Media", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of server technology, and in particular to a firmware upgrade method, computer program product, electronic device and medium. Background Technology
[0004] The BMC (Baseboard Management Controller) is a server-specific management controller, independent of the business system. It is used to monitor the overall operation of the server, including remote management, monitoring, deployment, and restart. In addition to monitoring the server, the BMC also supports firmware upgrades for itself and other firmware on the server.
[0005] The typical firmware upgrade process involves selecting the system firmware type via a web interface, transferring the firmware value to the BMC (Browser Control Center), and then triggering the upgrade process within the BMC by clicking the upgrade button. Consequently, the entire firmware upgrade process is controlled by internal BMC processes, resulting in a severe coupling between the system and the BMC. Attempting an upgrade for one firmware can affect upgrades for others, causing numerous problems and making subsequent maintenance and follow-up inconvenient. Summary of the Invention
[0006] This application provides a firmware upgrade method, a computer program product, an electronic device, and a medium.
[0007] Firstly, this application provides a firmware upgrade method, the method comprising:
[0008] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0009] In response to the determination that no system firmware upgrade thread was detected, a security verification is performed on the specified upgrade file according to preset verification rules; and
[0010] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0011] In some embodiments, before detecting whether a system firmware upgrade thread exists in the baseboard management controller in response to detecting the presence of a specified upgrade file, the method further includes: generating a specified upgrade file with a digital signature according to preset rules;
[0012] The step of generating a specified upgrade file with a digital signature according to preset rules includes:
[0013] Package the firmware version file, upgrade script, and upgrade tool, and compress them to generate a transitional upgrade file; and
[0014] Digitally sign the transition upgrade file to generate the specified upgrade file.
[0015] In some embodiments, digitally signing the transition upgrade file to generate a specified upgrade file includes:
[0016] The digital signature and signature image structure for generating the transition upgrade file; and
[0017] Add the digital signature and signature image structure to the transition upgrade file to generate the specified upgrade file;
[0018] The process of generating the digital signature for the transition upgrade file includes:
[0019] Generate a first digest of the transition upgrade file based on the hash function; and
[0020] The first digest is encrypted using the private key to generate a digital signature, which is represented as a hash string.
[0021] The process of generating the signature image structure includes:
[0022] Obtain data verification information, data description information, and image type. Data verification information includes the first magic number; data description information includes the encryption algorithm type, hash function type, and hash string length.
[0023] A signature image structure is generated based on the obtained data verification information, data description information, and image type.
[0024] In some embodiments, the method further includes:
[0025] In response to the detection of a running upgrade tool and / or upgrade script within the baseboard management controller, determine the existence of a system firmware upgrade thread within the baseboard management controller and set the firmware upgrade variable value to 1; and
[0026] In response to the detection that the firmware upgrade variable value is 1, the specified upgrade file is stored in the preset storage space.
[0027] In some embodiments, after detecting that the firmware upgrade variable value is 1 and storing the specified upgrade file in a preset storage space, the method includes:
[0028] The firmware upgrade variable value is read once at a preset time interval;
[0029] In response to determining that the read firmware upgrade variable value is not 1 and the number of reads is within a preset threshold, a security verification of the specified upgrade file is triggered; and
[0030] If the number of reads exceeds a preset threshold, the uploaded specified upgrade file will be deleted.
[0031] In some embodiments, before performing security verification on the specified upgrade file according to preset verification rules, the method further includes:
[0032] In response to the detection of a specified upgrade file being passed in, check whether a system firmware upgrade thread exists within the baseboard management controller;
[0033] If no system firmware upgrade thread is detected, the preset storage space is read.
[0034] In response to determining that the preset storage space is empty, perform security verification on the currently passed specified upgrade file according to the preset verification rules; and
[0035] In response to the determination that the preset storage space is not empty, the specified upgrade files stored in the storage space are subjected to security verification according to the preset verification rules.
[0036] In some embodiments, in response to determining that the preset storage space is not empty, a security verification is performed on the specified upgrade files already stored in the storage space according to preset verification rules, including:
[0037] In response to the determination that multiple specified upgrade files exist within the preset storage space, the specified upgrade file with the earliest storage time among the multiple specified upgrade files is determined as the target upgrade file, and security verification is performed on the target upgrade file according to preset verification rules; and
[0038] In response to the determination that a specified upgrade file exists in the preset storage space, the specified upgrade file stored in the preset storage space is subjected to security verification according to the preset verification rules.
[0039] In some embodiments, in response to detecting the presence of a specified upgrade file being passed in, after detecting whether a system firmware upgrade thread exists within the baseboard management controller, the method includes:
[0040] In response to determining that a system firmware upgrade thread exists within the detection board management controller, the specified upgrade file already stored in the preset storage space is compared with the currently passed specified upgrade file.
[0041] In response to determining that a stored specified upgrade file matching the currently passed-in specified upgrade file exists in the preset storage space, the currently passed-in specified upgrade file is deleted; and
[0042] If it is determined that there is no stored specified upgrade file in the preset storage space that matches the currently passed specified upgrade file, then the currently passed specified upgrade file is stored in the preset storage space.
[0043] In some embodiments, obtaining the target system firmware contained in a specified upgrade file that has passed security verification, and upgrading the target system firmware according to the specified upgrade file, includes:
[0044] Retrieve the image type from the signature image structure within the specified upgrade file;
[0045] The target system firmware is determined based on the obtained image type;
[0046] Extract the specified upgrade file to obtain the firmware version file, upgrade script, and upgrade tool; and
[0047] The target system firmware is upgraded based on the obtained firmware version file, upgrade script, and upgrade tool.
[0048] In some embodiments, security verification includes a first verification, a second verification, and a third verification, performing security verification on a specified upgrade file according to preset verification rules, including:
[0049] Perform a first verification on the specified upgrade file to verify the type of the specified upgrade file;
[0050] In response to determining that the specified upgrade file has passed the first verification, a second verification is performed on the specified upgrade file to verify the digital signature of the specified upgrade file;
[0051] In response to the determination that the specified upgrade file has failed the first verification, the uploaded specified upgrade file is deleted;
[0052] In response to determining that the specified upgrade file has passed the second verification, a third verification is performed on the specified upgrade file to verify the data consistency of the specified upgrade file;
[0053] In response to determining that the specified upgrade file has failed the second verification, the uploaded specified upgrade file is deleted; and
[0054] If the specified upgrade file passes third-party verification, then the specified upgrade file is determined to have passed security verification.
[0055] In some embodiments, a first verification is performed on the specified upgrade file to verify the type of the specified upgrade file, including:
[0056] Retrieve the first magic number from the signature image structure within the uploaded specified upgrade file;
[0057] Retrieve the second magic number corresponding to the uploaded specified upgrade file;
[0058] Compare the first magic number and the second magic number;
[0059] In response to the determination that the first magic number and the second magic number are the same, the first verification is deemed to have passed; and
[0060] In response to the determination that the first magic number and the second magic number are different, the type of the specified upgrade file has been changed and the first verification has failed.
[0061] In some embodiments, a second verification is performed on the specified upgrade file to verify the digital signature of the specified upgrade file, including:
[0062] Retrieve the encryption algorithm type and image type from the signature image structure within the uploaded specified upgrade file;
[0063] Read multiple pending public keys that match the private key from the stored data based on the image type;
[0064] Based on the type of encryption algorithm, determine the target public key among the pending public keys;
[0065] Verify the digital signature of the specified upgrade file using the target public key;
[0066] In response to the confirmation that the digital signature verification was successful, the second verification is then confirmed to have passed; and
[0067] In response to the determination that digital signature verification has failed, it is determined that the second verification has also failed.
[0068] In some embodiments, a third verification is performed on a specified upgrade file to verify the data consistency of the specified upgrade file, including:
[0069] Retrieves the first digest contained in the specified upgrade file and the hash function type in the signed image structure;
[0070] Remove the digital signature and signature image structure from the specified upgrade file to generate the file to be processed;
[0071] Generate a second digest of the file to be processed based on the hash function type;
[0072] Compare the first and second abstracts;
[0073] In response to the determination that the first digest and the second digest are consistent, the third verification is determined to be successful; and
[0074] In response to the determination that the first digest and the second digest are inconsistent, the type of the specified upgrade file is changed and the third verification fails.
[0075] In some embodiments, after detecting the presence of a system firmware upgrade thread within the baseboard management controller in response to detecting the presence of a specified upgrade file, the method further includes:
[0076] Perform a priori operation on the specified upgrade file to determine if the specified upgrade file is invalid; and
[0077] In response to the successful completion of the prior operation on the specified upgrade file, a security verification is performed on the specified upgrade file according to the preset verification rules.
[0078] In some embodiments, performing prior operation steps on a specified upgrade file includes:
[0079] Retrieves the signature image management structure from the specified upgrade file passed in;
[0080] Parse the signature image management structure to obtain the version information and image type of the upgraded firmware;
[0081] Based on the image type, find the current version information of the server system firmware or baseboard management controller that matches the image type; and
[0082] Perform a priori operations on the specified upgrade file based on the current version information.
[0083] In some embodiments, prior operation steps are performed on a specified upgrade file based on the current version information, including:
[0084] Compare the current version information with the version information contained in the specified upgrade file;
[0085] In response to the determination that the current version information is the same as the version information contained in the specified upgrade file, or that the version number in the current version information is greater than the version number contained in the version information contained in the specified upgrade file, the uploaded specified upgrade file is deleted, and a prompt is generated to inform the user that the current firmware is already the latest version; and
[0086] If it is determined that the version number in the current version information is less than the version number in the version information contained in the specified upgrade file, then the above prior operation is passed.
[0087] In some embodiments, prior to the step of determining the specified upgrade file with the earliest storage time among the multiple specified upgrade files as the target upgrade file in response to determining that multiple specified upgrade files exist in a preset storage space, the method includes:
[0088] In response to determining that multiple specified upgrade files are stored in a preset storage space, a storage timestamp is set for each specified upgrade file to specify the storage time of each specified upgrade file in the preset storage space.
[0089] Secondly, this application provides a firmware upgrade system, the system comprising:
[0090] The environmental detection module is used to detect whether a system firmware upgrade thread exists within the baseboard management controller in response to the detection of a specified upgrade file being passed in. The specified upgrade file is a digitally signed file generated according to preset rules.
[0091] The security verification module is used to perform security verification on a specified upgrade file according to preset verification rules when it is determined that no system firmware upgrade thread has been detected; and
[0092] The firmware upgrade module is used to obtain the target system firmware contained in a specified upgrade file that has passed security verification, and to upgrade the target system firmware according to the specified upgrade file.
[0093] Thirdly, this application provides a computer program, wherein computer-readable instructions, when executed by one or more processors, implement the steps of the following method:
[0094] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0095] In response to the determination that no system firmware upgrade thread was detected, a security verification is performed on the specified upgrade file according to preset verification rules; and
[0096] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0097] Fourthly, this application provides an electronic device, which includes:
[0098] One or more processors;
[0099] and memory associated with one or more processors, the memory being used to store computer-readable instructions, which, when read and executed by one or more processors, perform the following operations:
[0100] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0101] In response to the determination that no system firmware upgrade thread has been detected, the specified upgrade file is subjected to security verification according to the preset verification rules;
[0102] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0103] Fifthly, this application also provides a non-volatile computer-readable storage medium storing computer-readable instructions, which, when executed by one or more processors, perform the following operations:
[0104] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0105] In response to the determination that no system firmware upgrade thread has been detected, the specified upgrade file is subjected to security verification according to the preset verification rules;
[0106] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0107] This application provides a firmware upgrade method, including: in response to detecting the presence of a specified upgrade file, detecting whether a system firmware upgrade thread exists in the baseboard management controller, wherein the specified upgrade file is a digitally signed file generated according to preset rules; in response to determining that no system firmware upgrade thread is detected, performing security verification on the specified upgrade file according to preset verification rules; obtaining the target system firmware contained in the specified upgrade file that has passed security verification, and upgrading the target system firmware according to the specified upgrade file. Attached Figure Description
[0108] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein:
[0109] Figure 1 is a connection diagram provided in an embodiment of this application;
[0110] Figure 2 is a schematic diagram of a firmware upgrade method provided in an embodiment of this application;
[0111] Figure 3 is a schematic diagram of a specified upgrade file generation provided in an embodiment of this application;
[0112] Figure 4 is a schematic flowchart of a firmware upgrade method provided in an embodiment of this application;
[0113] Figure 5 is a schematic diagram of a firmware upgrade system provided in an embodiment of this application;
[0114] Figure 6 is a structural diagram of the electronic device provided in an embodiment of this application;
[0115] Figure 7 is a structural diagram of a non-volatile computer-readable storage medium provided in an embodiment of this application;
[0116] Figure 8 is a structural diagram of the computer program product provided in an embodiment of this application. Detailed Implementation
[0117] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0118] It should be understood that, in the description of this application, unless the context explicitly requires it, the words "comprising," "including," and similar terms throughout the specification and claims should be interpreted as encompassing rather than being exclusive or exhaustive; that is, meaning "including but not limited to."
[0119] It should also be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0120] It should be noted that the terms "S1," "S2," etc., are used only for descriptive purposes and do not specifically refer to the order or sequence, nor are they intended to limit this application. They are merely for the convenience of describing the method of this application and should not be construed as indicating the sequential order of the steps. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0121] A server is a dedicated computer in a network environment that provides certain services to clients. It is a high-performance computer system used for storage, processing, and providing network services. The BMC (Browser Management Controller) is a small embedded system located on the server's motherboard. The BMC and the server are two independent systems. The BMC monitors the overall operation of the server and is a server-specific management controller. As a small operating system independent of the server system, the BMC is used for remote server management, monitoring, deployment, and restarting. The BMC starts running as soon as it is powered on, unaffected by the server's power on / off cycle, and operates independently of the business system.
[0122] As shown in Figure 1, the BMC monitoring server has many devices that connect to flash memory via SPI (Serial Peripheral Interface) and DRAM (Dynamic Random Access Memory). It also connects to various I2C devices via I2C (Inter-Integrated Circuit) channels, monitors pins via GPIO (General-purpose input / output), and connects to the PCH (Platform Controller Hub) via PCIE (Peripheral Component Interconnect Express), USB (Universal Serial Bus), LPC (Low Pin Count Bus), and PECI (Platform Environment Control Interface) channels to obtain system-side information. Besides monitoring the system's operational status, the BMC (Browser Control Center) also supports firmware upgrades for itself and other firmware on the server, including BIOS (Basic Input / Output System), CPLD (Complex Programmable Logic Device), and PSU (Power Supply Unit). Traditional firmware upgrades involve selecting the firmware type through the BMC's web interface, transferring the firmware (BMC, BIOS, CPLD, or PSU) to the BMC, and clicking the upgrade button to trigger the upgrade process. This entire upgrade process is controlled by internal BMC processes, resulting in severe coupling within the BMC. Debugging the upgrade process for one firmware can affect the upgrades of other firmware, causing numerous problems and hindering future maintenance and improvements. Furthermore, each upgrade requires selecting the firmware type; if an incorrect type is selected, the BMC does not verify the firmware type, leading to upgrade errors.
[0123] Therefore, this application provides a system firmware upgrade method that uses an independent upgrade script to upgrade the system firmware, thereby decoupling to the greatest extent and reducing the risk of system firmware upgrade anomalies.
[0124] This application provides a firmware upgrade method. In some embodiments, it is applied to a baseboard management controller, as shown in Figure 2. The method disclosed in this application is used to upgrade the firmware on the baseboard management controller and other firmware on the server, including the following:
[0125] S1. In response to the detection that a specified upgrade file has been passed in, check whether there is a system firmware upgrade thread in the baseboard management controller.
[0126] This application decouples firmware upgrades and the baseboard management controller to the greatest extent possible by creating a designated upgrade file independent of the baseboard management controller, thereby reducing the impact between firmware components. The designated upgrade file is a digitally signed file generated according to preset rules, as shown in Figure 3. The generation process includes: packaging the firmware version file, upgrade script, and upgrade tool, and compressing them to generate a transitional upgrade file (such as an update.tar.gz file); digitally signing the transitional upgrade file to generate the designated upgrade file, which in the implementation scenario can be an update.bin file, but other file formats are not excluded. This application significantly shortens the time for transferring files from the web interface to the baseboard management controller through compression, and the addition of a digital signature increases the security of the file during transmission, ensuring that the designated upgrade file received by the baseboard management controller is the original and correct data.
[0127] Furthermore, the aforementioned digital signature of the transition upgrade file to generate the specified upgrade file includes: generating a digital signature and a signature image structure for the transition upgrade file; adding the digital signature and the signature image structure to the transition upgrade file to generate the specified upgrade file; wherein, the process of generating the digital signature of the transition upgrade file includes: generating a first digest of the transition upgrade file according to a hash function; encrypting the first digest according to a private key to generate a digital signature, the digital signature being represented in the form of a hash string; wherein, the process of generating the signature image structure includes: obtaining data verification information, data description information, and image type, the data verification information including a first magic number, the data description information including the encryption algorithm type, hash function type, and hash string length; generating the signature image structure based on the obtained data verification information, data description information, and image type. This application adds a digital signature and a signature image structure to the end of the specified upgrade file, and packages the image type in the signature image structure, which is automatically recognized after being transmitted to the baseboard management controller, eliminating the need for selection on the web page and reducing the risk of errors.
[0128] It is understandable that version information can be added to the above data verification information. Furthermore, after receiving the specified upgrade file, the baseboard control manager performs a priori operation. In some embodiments, this priori operation includes: obtaining the signature image management structure within the incoming specified upgrade file, and parsing the signature image management structure to obtain the version information and image type of the upgraded firmware contained therein; searching for the current version information of the server system firmware or the baseboard management controller itself that matches the image type; comparing the current version information with the version information contained in the specified upgrade file; in response to determining that the current version information is the same as the version information contained in the specified upgrade file, or that the version number in the current version information is greater than the version number in the version information contained in the specified upgrade file, deleting the uploaded specified upgrade file and generating a prompt to inform the user that the current firmware is already the latest version; in response to determining that the version number in the current version information is less than the version number in the version information contained in the specified upgrade file, determining that the above priori operation has been passed, and performing subsequent security verification and other operations. By setting prior operations, subsequent security verification and other operations are only specified after it is confirmed that the current firmware can be upgraded using the specified upgrade file. This avoids invalid uploads of the specified upgrade file and ensures the rational use of resources to the greatest extent.
[0129] For ease of understanding, this application provides the `signimage_info_t` structure for some implementation scenarios. It should be understood that the following structure is for illustrative purposes only and is not limited to this one structure form:
[0130] In some implementation scenarios, the above-mentioned detection of whether a system firmware upgrade thread exists within the baseboard management controller further includes: in response to detecting the existence of a running upgrade tool and / or upgrade script within the baseboard management controller, determining that a system firmware upgrade thread exists within the baseboard management controller and setting the firmware upgrade variable value to 1. In response to detecting that the firmware upgrade variable value is 1, storing the specified upgrade file in a preset storage space. The preset storage space can be a specific location allocated within the baseboard management controller, or a specific location on a storage medium or device mounted on the baseboard management controller; this application does not limit this. It is understood that in other implementation scenarios, after detecting that the firmware upgrade variable value is 1, the uploaded specified upgrade file can be directly deleted, and the firmware upgrade process can be terminated.
[0131] Furthermore, after storing the specified upgrade file in the preset storage space, the firmware upgrade variable value is read once every preset time interval. If the read firmware upgrade variable value is not 1 and the number of reads is within a preset threshold, a security verification of the specified upgrade file is triggered. If the number of reads exceeds the preset threshold, the uploaded specified upgrade file is deleted. The preset time interval is set according to the time required for firmware upgrade and the operating status of the baseboard management controller, or it can be customized according to the actual scenario; this application does not limit this. The preset threshold is set by those skilled in the art according to the actual scenario; this application does not limit this. When other firmware is being upgraded in the current baseboard management controller, the specified upgrade file uploaded at this time is temporarily stored in the baseboard management controller. By polling the firmware upgrade variable, the uploaded specified firmware upgrade is immediately used to upgrade the matching system firmware after the current firmware upgrade stops, thus accelerating the firmware upgrade speed. This reduces the number of firmware uploads, thereby improving resource utilization.
[0132] S2. In response to determining that no system firmware upgrade thread has been detected, perform security verification on the specified upgrade file according to the preset verification rules.
[0133] Upon confirming that no other firmware is being upgraded, a security verification can be performed on the uploaded specified upgrade file. This security verification includes a first verification, a second verification, and a third verification; all three verifications must be passed for the security verification to be successful. Specifically, the `lseek` function can be used to locate the signature image structure, and then the data verification information, data description information, and image type contained within the signature image structure can be read, including the first magic number, encryption algorithm type, hash function type, and hash string length. Similarly, the `lseek` function can be used to locate the hash string, and then the complete hash string can be read based on the length of the read hash string.
[0134] In some embodiments, the aforementioned security verification of the specified upgrade file according to preset verification rules includes: performing a first verification on the specified upgrade file to verify the type of the specified upgrade file; in response to determining that the specified upgrade file has passed the first verification, performing a second verification on the specified upgrade file to verify the digital signature of the specified upgrade file; in response to determining that the specified upgrade file has failed the first verification, deleting the uploaded specified upgrade file; in response to determining that the specified upgrade file has passed the second verification, performing a third verification on the specified upgrade file to verify the data consistency of the specified upgrade file; in response to determining that the specified upgrade file has failed the second verification, deleting the uploaded specified upgrade file; and in response to the specified upgrade file passing the third verification, determining that the specified upgrade file has passed the security verification. By setting multiple verification logic, the speed and accuracy of security verification are greatly accelerated, further reducing the security risks of uploaded upgrade files, thereby improving the stability of the firmware upgrade process.
[0135] The first verification of the specified upgrade file to verify its type includes: obtaining the first magic number from the signature image structure within the uploaded specified upgrade file; obtaining the second magic number corresponding to the uploaded specified upgrade file; comparing the first magic number and the second magic number; if the first magic number and the second magic number are the same, the first verification is considered successful; if the first magic number and the second magic number are different, the type of the specified upgrade file is determined to have been changed and the first verification is considered to have failed. It is understandable that if the first magic number and the second magic number are different, it can be determined that the file type has been tampered with or disguised. In this case, the uploaded specified upgrade file must have been changed, and an alert is generated to notify the user that the specified upgrade file poses a security risk.
[0136] The aforementioned second verification of the specified upgrade file to verify its digital signature includes: obtaining the encryption algorithm type and image type from the signature image structure within the uploaded specified upgrade file; reading multiple pending public keys that match the private key based on the image type; determining the target public key among the pending public keys based on the encryption algorithm type; verifying the digital signature of the specified upgrade file based on the target public key; determining that the second verification passes if the digital signature verification is successful; and determining that the second verification fails and deleting the uploaded specified upgrade file if the digital signature verification fails. It is understood that, to ensure compatibility with multiple encryption algorithms, this application pre-stores multiple public keys obtained through different encryption algorithms for a unified private key, and different images have different public keys. The public keys for all types of images are stored in an array, where each array element is the file path of the public key.
[0137] The aforementioned third verification of the specified upgrade file to verify its data consistency includes: obtaining the first digest and hash function type in the signature mirror structure contained in the specified upgrade file; removing the digital signature and signature mirror structure from the specified upgrade file to generate a file to be processed; generating a second digest of the file to be processed based on the hash function type; comparing the first digest and the second digest; if the first digest and the second digest are consistent, the third verification is deemed successful; if the first digest and the second digest are inconsistent, the type of the specified upgrade file is determined to have changed, the third verification is deemed unsuccessful, and the uploaded specified upgrade file is deleted. It is understandable that, for ease of later decompression, the digital signature and signature mirror structure in the input specified upgrade file can be removed before updating the specified upgrade file.
[0138] Furthermore, regarding the aforementioned implementation scenario where a firmware upgrade variable value of 1 is detected, and the specified upgrade file is stored in a preset storage space, this application also proposes the following steps before performing security verification on the specified upgrade file according to preset rules: In response to detecting the presence of a specified upgrade file, detecting whether a system firmware upgrade thread exists within the baseboard management controller; in response to determining that no system firmware upgrade thread is detected, reading the preset storage space; in response to determining that the preset storage space is empty, performing security verification on the currently incoming specified upgrade file according to preset verification rules; in response to determining that the preset storage space is not empty, performing security verification on the specified upgrade file already stored in the storage space according to preset verification rules.
[0139] Furthermore, in response to determining that the preset storage space is not empty, security verification is performed on the specified upgrade files already stored in the storage space according to preset verification rules. This includes: in response to determining that multiple specified upgrade files exist in the preset storage space, determining the specified upgrade file with the earliest storage time among the multiple specified upgrade files as the target upgrade file, and performing security verification on the target upgrade file according to preset verification rules; in response to determining that one specified upgrade file exists in the preset storage space, performing security verification on the specified upgrade files already stored in the preset storage space according to preset verification rules. It is understood that when a specified upgrade file is stored in the preset storage space, a storage time tag can be added to each specified upgrade file at the same time to clarify the storage time of each specified upgrade file in the preset storage space, further determining the target upgrade file with the earliest storage time; or the specified upgrade files can be stored in a queue, and the earliest stored target upgrade file can be determined by the first-in-first-out characteristic of the queue. When the baseboard management controller receives a new specified upgrade file, it considers whether the specified upgrade file exists in the preset storage space. In response to determining that the specified upgrade file already exists in the preset storage space, it considers using the upgrade file in the preset storage space. Meanwhile, when multiple specified upgrade files exist within a preset storage space, in some embodiments, the specified upgrade file with the earliest storage time is used. By defining the usage rules for specified upgrade files within the preset storage space, an orderly firmware upgrade method is provided, avoiding the chaos that may be caused by uploading multiple specified firmware upgrade files in a short period of time, and further improving the stability of firmware upgrades.
[0140] Furthermore, the above-mentioned response to detecting the presence of a specified upgrade file and detecting whether a system firmware upgrade thread exists within the baseboard management controller includes: upon determining that a system firmware upgrade thread exists within the baseboard management controller, comparing the specified upgrade file already stored in the preset storage space with the currently transmitted specified upgrade file; upon determining that a stored specified upgrade file matching the currently transmitted specified upgrade file exists in the preset storage space, deleting the currently transmitted specified upgrade file; and upon determining that no stored specified upgrade file matching the currently transmitted specified upgrade file exists in the preset storage space, storing the currently transmitted specified upgrade file in the preset storage space. Newly uploaded specified upgrade files may be identical to those in the preset storage space. In this case, the newly uploaded specified upgrade file can be directly deleted, and the stored specified upgrade files matching the currently transmitted specified upgrade file can be upgraded according to the chronological order of the stored specified upgrade files in the preset storage space. This avoids duplicate uploads of upgrade files with the same firmware, preventing resource waste.
[0141] S3. Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0142] It is understood that an image type is added to the signed image structure in the specified upgrade file; this application determines the target system firmware that matches the specified upgrade file by reading the image type in the signed image structure. For example, in some scenarios, 0 can be set in the image type to represent BMC, 1 to represent BIOS, 2 to represent CPLD, 3 to represent PSU, and so on. This application does not limit the rules for setting the values in the image type and the firmware, and can set them according to needs. The above-mentioned system firmware types include, but are not limited to, CPLD, BIOS, and PSU.
[0143] After the security verification is passed, a shared memory can be mounted to store the decompressed specified upgrade file. Alternatively, space can be allocated from the baseboard management controller for later retrieval. This application does not limit the storage method. After successful decompression, the uploaded original specified upgrade file is deleted.
[0144] The process of obtaining the target system firmware contained in a specified upgrade file that has passed security verification, and upgrading the target system firmware according to the specified upgrade file, includes: obtaining the image type in the signature image structure within the specified upgrade file; determining the target system firmware based on the obtained image type; decompressing the specified upgrade file to obtain the firmware version file, upgrade script, and upgrade tool; granting the decompressed firmware version file execute permissions; and then upgrading the target system firmware according to the obtained firmware version file, upgrade script, and upgrade tool; that is, the system call function system() can be called to upgrade the target system firmware. In the implementation scenario, upon determining that the image type is 0, indicating a BMC upgrade, `sh / mnt / fwupdate / BMC_Update.sh` is executed; upon determining that the image type is 1, indicating a BIOS upgrade, `sh / mnt / fwupdate / BIOS_Update.sh.sh` is executed; upon determining that the image type is 2, indicating a CPLD upgrade, `sh / mnt / fwupdate / CPLD_Update.sh` is executed; and upon determining that the image type is 3, indicating a CPLD upgrade, `sh / mnt / fwupdate / PSU_Update.sh` is executed. After a successful firmware upgrade, an operation log can be recorded. It is understood that the focus of this application is on the process of packaging the firmware upgrade file (i.e., generating the specified upgrade file) and passing it into the BMC for parsing and processing. The process of using the upgrade tool to upgrade the firmware is not the focus of this application, and the content of the upgrade script and upgrade tool is not described in detail.
[0145] As shown in Figure 4, this application transmits the specified upgrade file to the baseboard management controller via a web page. After confirming that there are no other firmware being upgraded in the baseboard management controller, a security check is performed first. After the security check passes, the specified upgrade file is decompressed, and the FW file, upgrade tool, and upgrade script are extracted. Finally, the system call function system() is used to upgrade the firmware using the upgrade script and upgrade tool.
[0146] This application constructs a specified upgrade file by compressing the firmware version file, upgrade tool, and upgrade script, and adding a digital signature and a signed image structure to generate the specified upgrade file that is finally uploaded to the baseboard management controller. This extracts the system firmware upgrade process, which was originally placed inside the baseboard management controller, to outside the baseboard management controller, thereby decoupling the baseboard management controller and the system firmware upgrade, and making it easier for the code maintenance and upgrade improvement of the tool in the later stage.
[0147] Corresponding to the above embodiments, this application also provides a firmware upgrade system, as shown in FIG5, including:
[0148] The environmental detection module 510 is used to detect whether a system firmware upgrade thread exists in the baseboard management controller in response to the detection of a specified upgrade file being passed in. The specified upgrade file is a file with a digital signature generated according to preset rules.
[0149] Security verification module 520 is used to perform security verification on a specified upgrade file according to preset verification rules in response to determining that no system firmware upgrade thread has been detected.
[0150] Firmware upgrade module 530 is used to obtain the target system firmware contained in a specified upgrade file that has passed security verification, and to upgrade the target system firmware according to the specified upgrade file.
[0151] In some embodiments, the system further includes a file synthesis module (not shown in the figure), which is used to generate a specified upgrade file with a digital signature according to preset rules: package the firmware version file, upgrade script and upgrade tool and compress them to generate a transition upgrade file; and digitally sign the transition upgrade file to generate the specified upgrade file.
[0152] In some embodiments, the file synthesis module is further configured to generate a digital signature and a signature image structure for the transition upgrade file; add the digital signature and the signature image structure to the transition upgrade file to generate a specified upgrade file; wherein the process of generating the digital signature of the transition upgrade file includes: generating a first digest of the transition upgrade file according to a hash function; encrypting the first digest according to a private key to generate a digital signature, the digital signature being represented in the form of a hash string; wherein the process of generating the signature image structure includes: obtaining data verification information, data description information, and image type, the data verification information including a first magic number, the data description information including an encryption algorithm type, a hash function type, and a hash string length; generating a signature image structure based on the obtained data verification information, data description information, and image type.
[0153] In some embodiments, the environment detection module 510 is further configured to, in response to detecting the existence of a running upgrade tool and / or upgrade script in the baseboard management controller, determine the existence of a system firmware upgrade thread in the baseboard management controller and set the firmware upgrade variable value to 1; in response to detecting that the firmware upgrade variable value is 1, store the specified upgrade file in a preset storage space.
[0154] In some embodiments, the environment detection module 510 is further configured to read the firmware upgrade variable value once every preset time interval; in response to determining that the read firmware upgrade variable value is not 1 and the number of reads is within a preset threshold, a security verification of the specified upgrade file is triggered; in response to determining that the number of reads exceeds the preset threshold, the uploaded specified upgrade file is deleted.
[0155] In some embodiments, the environment detection module 510 is further configured to: detect whether a system firmware upgrade thread exists in the baseboard management controller in response to detecting the presence of a specified upgrade file; read a preset storage space in response to determining that no system firmware upgrade thread is detected; perform security verification on the currently incoming specified upgrade file according to preset verification rules in response to determining that the preset storage space is empty; and perform security verification on the specified upgrade file already stored in the storage space according to preset verification rules in response to determining that the preset storage space is not empty.
[0156] In some embodiments, the environment detection module 510 is further configured to: in response to determining that multiple specified upgrade files exist in the preset storage space, determine the specified upgrade file with the earliest storage time among the multiple specified upgrade files as the target upgrade file, and perform security verification on the target upgrade file according to preset verification rules; in response to determining that a specified upgrade file exists in the preset storage space, perform security verification on the specified upgrade file already stored in the preset storage space according to preset verification rules.
[0157] In some embodiments, the environmental detection module 510 is further configured to: in response to determining that a system firmware upgrade thread exists within the detection substrate management controller, compare the specified upgrade file already stored in the preset storage space with the currently passed specified upgrade file; in response to determining that there is a stored specified upgrade file in the preset storage space that matches the currently passed specified upgrade file, delete the currently passed specified upgrade file; in response to determining that there is no stored specified upgrade file in the preset storage space that matches the currently passed specified upgrade file, store the currently passed specified upgrade file in the preset storage space.
[0158] In some embodiments, the firmware upgrade module 530 is further configured to obtain the image type in the signature image structure within the specified upgrade file; determine the target system firmware based on the obtained image type; decompress the specified upgrade file to obtain the firmware version file, upgrade script, and upgrade tool; and upgrade the target system firmware based on the obtained firmware version file, upgrade script, and upgrade tool.
[0159] In some embodiments, the security verification module 520 is further configured to perform a first verification on the specified upgrade file to verify the type of the specified upgrade file; in response to determining that the specified upgrade file has passed the first verification, perform a second verification on the specified upgrade file to verify the digital signature of the specified upgrade file; in response to determining that the specified upgrade file has failed the first verification, delete the uploaded specified upgrade file; in response to determining that the specified upgrade file has passed the second verification, perform a third verification on the specified upgrade file to verify the data consistency of the specified upgrade file; in response to determining that the specified upgrade file has failed the second verification, delete the uploaded specified upgrade file; and in response to the specified upgrade file passing the third verification, determine that the specified upgrade file has passed the security verification.
[0160] In some embodiments, the security verification module 520 is further configured to obtain a first magic number in the signature image structure within the uploaded specified upgrade file; obtain a second magic number corresponding to the uploaded specified upgrade file; compare the first magic number and the second magic number, and in response to determining that the first magic number and the second magic number are the same, determine that the first verification passes; in response to determining that the first magic number and the second magic number are different, determine that the type of the specified upgrade file has changed and determine that the first verification fails.
[0161] In some embodiments, the security verification module 520 is further configured to obtain the encryption algorithm type and image type in the signature image structure within the uploaded specified upgrade file; read multiple pending public keys that match the private key according to the image type; determine the target public key among the pending public keys according to the encryption algorithm type; verify the digital signature of the specified upgrade file according to the target public key; determine the second verification is passed in response to determining that the digital signature verification is successful; and determine that the second verification is not passed in response to determining that the digital signature verification is unsuccessful.
[0162] In some embodiments, the security verification module 520 is further configured to obtain a first digest contained in a specified upgrade file and a hash function type in a signature image structure; remove the digital signature and signature image structure from the specified upgrade file to generate a file to be processed; generate a second digest of the file to be processed according to the hash function type; compare the first digest and the second digest, and in response to determining that the first digest and the second digest are consistent, determine that the third verification passes; in response to determining that the first digest and the second digest are inconsistent, determine that the type of the specified upgrade file has changed and determine that the third verification fails.
[0163] Corresponding to the above embodiments, as shown in FIG8, this application embodiment also provides a computer program product, including computer-readable instructions, which, when executed by one or more processors, implement the steps of the following method:
[0164] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0165] In response to the determination that no system firmware upgrade thread has been detected, the specified upgrade file is subjected to security verification according to the preset verification rules;
[0166] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0167] Corresponding to all the above embodiments, this application provides an electronic device, including: one or more processors; and a memory associated with the one or more processors, the memory being used to store computer-readable instructions, which, when read and executed by the one or more processors, perform the following operations:
[0168] In response to the detection of a specified upgrade file being passed in, the system checks whether a system firmware upgrade thread exists within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules. In response to the determination that no system firmware upgrade thread is detected, the specified upgrade file is security verified according to preset verification rules. The target system firmware contained in the specified upgrade file that has passed security verification is obtained, and the target system firmware is upgraded according to the specified upgrade file.
[0169] Figure 6 illustrates an exemplary architecture of an electronic device, which may include a processor 610, a video display adapter 611, a disk drive 612, an input / output interface 613, a network interface 614, and a memory 620. The processor 610, video display adapter 611, disk drive 612, input / output interface 613, network interface 614, and memory 620 can communicate with each other via a bus 630.
[0170] The processor 610 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant readable instructions to implement the technical solution provided in this application.
[0171] The memory 620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 can store the operating system 621 for controlling the execution of the electronic device 600, and the basic input / output system (BIOS) 622 for controlling the low-level operations of the electronic device 600. Additionally, it can store a web browser 623, a data storage management system 624, and an icon font processing system 625, etc. The aforementioned icon font processing system 625 can be the application program that implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610.
[0172] Input / output interface 613 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0173] Network interface 614 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0174] Bus 630 includes a pathway for transmitting information between various components of the device, such as processor 610, video display adapter 611, disk drive 612, input / output interface 613, network interface 614, and memory 620.
[0175] In addition, the electronic device 600 can also obtain information on the conditions for receiving virtual resource objects from the database of conditions for receiving information, so as to make condition judgments, etc.
[0176] It should be noted that although the above-described device only shows the processor 610, video display adapter 611, disk drive 612, input / output interface 613, network interface 614, memory 620, bus 630, etc., in practice, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.
[0177] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus the required general-purpose hardware platform. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a cloud server, or a network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.
[0178] Corresponding to all the above embodiments, as shown in FIG7, this application embodiment also provides a non-volatile computer-readable storage medium that stores computer-readable instructions, which, when executed by one or more processors, perform the following operations:
[0179] In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is checked within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules.
[0180] In response to the determination that no system firmware upgrade thread has been detected, the specified upgrade file is subjected to security verification according to the preset verification rules;
[0181] Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
[0182] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0183] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A firmware upgrade method, applied to a baseboard management controller, characterized in that, The method includes: In response to the detection that a specified upgrade file has been passed in, the system firmware upgrade thread is detected within the baseboard management controller. The specified upgrade file is a digitally signed file generated according to preset rules. In response to determining that no system firmware upgrade thread was detected, a security verification is performed on the specified upgrade file according to preset verification rules; and Obtain the target system firmware contained in the specified upgrade file that has passed security verification, and upgrade the target system firmware according to the specified upgrade file.
2. The method according to claim 1, characterized in that, Before the step of detecting the presence of a specified upgrade file and checking whether a system firmware upgrade thread exists within the baseboard management controller, the method further includes: Generate a specified upgrade file with a digital signature according to the preset rules; The step of generating a specified upgrade file with a digital signature according to the preset rules includes: Package the firmware version file, upgrade script, and upgrade tool, and compress them to generate a transitional upgrade file; and The transition upgrade file is digitally signed to generate the specified upgrade file.
3. The method according to claim 2, characterized in that, The step of digitally signing the transition upgrade file to generate the specified upgrade file includes: Generate the digital signature and signature image structure of the transition upgrade file; and Add the digital signature and signature image structure to the transition upgrade file to generate the specified upgrade file; The process of generating the digital signature for the transition upgrade file includes: A first digest of the transition upgrade file is generated based on the hash function; and The first digest is encrypted using a private key to generate a digital signature, which is represented as a hash string. The process of generating the signature image structure includes: Obtain data verification information, data description information, and image type. The data verification information includes the first magic number, and the data description information includes the encryption algorithm type, hash function type, and hash string length. A signature image structure is generated based on the obtained data verification information, data description information, and image type.
4. The method according to claim 1, characterized in that, The method further includes: In response to detecting the presence of a running upgrade tool and / or upgrade script within the baseboard management controller, it is determined that a system firmware upgrade thread exists within the baseboard management controller, and the firmware upgrade variable value is set to 1; and In response to detecting that the firmware upgrade variable value is 1, the specified upgrade file is stored in the preset storage space.
5. The method according to claim 4, characterized in that, After detecting that the firmware upgrade variable value is 1, the method of storing the specified upgrade file in a preset storage space includes: The firmware upgrade variable value is read once at a preset time interval; In response to determining that the read value of the firmware upgrade variable is not 1 and the number of reads is within a preset threshold, a security verification of the specified upgrade file is triggered; and In response to determining that the number of reads exceeds the preset threshold, the uploaded specified upgrade file is deleted.
6. The method according to claim 4, characterized in that, Before performing security verification on the specified upgrade file according to preset verification rules, the method further includes: In response to the detection that a specified upgrade file has been passed, the system firmware upgrade thread is checked within the baseboard management controller. In response to determining that no system firmware upgrade thread has been detected, the preset storage space is read; In response to determining that the preset storage space is empty, a security verification is performed on the currently incoming specified upgrade file according to the preset verification rules; and In response to determining that the preset storage space is not empty, the specified upgrade file stored in the storage space is subjected to security verification according to the preset verification rules.
7. The method according to claim 6, characterized in that, In response to determining that the preset storage space is not empty, the specified upgrade file stored in the storage space is subjected to security verification according to the preset verification rules, including: In response to determining that multiple specified upgrade files exist within the preset storage space, the specified upgrade file with the earliest storage time among the multiple specified upgrade files is determined as the target upgrade file, and the target upgrade file is subjected to security verification according to the preset verification rules; and In response to determining that a specified upgrade file exists in the preset storage space, a security verification is performed on the specified upgrade file stored in the preset storage space according to the preset verification rules.
8. The method according to claim 6, characterized in that, In response to detecting the presence of a specified upgrade file and then detecting whether a system firmware upgrade thread exists within the baseboard management controller, the method includes: In response to determining that a system firmware upgrade thread exists within the baseboard management controller, the specified upgrade file already stored in the preset storage space is compared with the currently passed specified upgrade file. In response to determining that a stored specified upgrade file matching the currently passed specified upgrade file exists in the preset storage space, the currently passed specified upgrade file is deleted; and In response to determining that there is no stored specified upgrade file in the preset storage space that matches the currently passed specified upgrade file, the currently passed specified upgrade file is stored in the preset storage space.
9. The method according to claim 3, characterized in that, The step of obtaining the target system firmware contained in the specified upgrade file that has passed security verification, and upgrading the target system firmware according to the specified upgrade file, includes: Obtain the image type from the signature image structure within the specified upgrade file; The target system firmware is determined based on the obtained image type; Decompress the specified upgrade file to obtain the firmware version file, upgrade script, and upgrade tool; and The target system firmware is upgraded based on the obtained firmware version file, upgrade script, and upgrade tool.
10. The method according to claim 3, characterized in that, The security verification includes a first verification, a second verification, and a third verification. The step of performing security verification on the specified upgrade file according to preset verification rules includes: The first verification is performed on the specified upgrade file to verify the type of the specified upgrade file; In response to determining that the specified upgrade file has passed the first verification, a second verification is performed on the specified upgrade file to verify the digital signature of the specified upgrade file; In response to determining that the specified upgrade file has failed the first verification, the uploaded specified upgrade file is deleted; In response to determining that the specified upgrade file has passed the second verification, a third verification is performed on the specified upgrade file to verify the data consistency of the specified upgrade file; In response to determining that the specified upgrade file has failed the second verification, the uploaded specified upgrade file is deleted; and In response to the specified upgrade file passing the third verification, it is determined that the specified upgrade file has passed the security verification.
11. The method according to claim 10, characterized in that, The first verification of the specified upgrade file to verify the type of the specified upgrade file includes: Obtain the first magic number from the signature image structure within the uploaded specified upgrade file; Obtain the second magic number corresponding to the uploaded specified upgrade file; Compare the first magic number and the second magic number; In response to determining that the first magic number and the second magic number are the same, the first verification is determined to be successful; and In response to determining that the first magic number and the second magic number are different, it is determined that the type of the specified upgrade file has changed and that the first verification has failed.
12. The method according to claim 10, characterized in that, The second verification of the specified upgrade file to verify the digital signature of the specified upgrade file includes: Obtain the encryption algorithm type and image type from the signature image structure within the uploaded specified upgrade file; Read multiple pending public keys that match the private key from the stored data according to the image type; Based on the encryption algorithm type, determine the target public key among the pending public keys; Verify the digital signature of the specified upgrade file using the target public key; In response to determining that the digital signature verification was successful, the second verification is determined to be passed; and In response to determining that the digital signature verification has failed, it is determined that the second verification has not passed.
13. The method according to claim 10, characterized in that, The third verification of the specified upgrade file to verify the data consistency of the specified upgrade file includes: Obtain the first digest contained in the specified upgrade file and the hash function type in the signature image structure; Remove the digital signature and the signature image structure from the specified upgrade file to generate a file to be processed; Generate a second digest of the file to be processed based on the hash function type; Compare the first summary and the second summary; In response to determining that the first digest matches the second digest, the third verification is determined to be successful; and In response to determining that the first digest and the second digest are inconsistent, it is determined that the type of the specified upgrade file has changed and that the third verification has failed.
14. The method according to claim 1, characterized in that, After the step of detecting the presence of a specified upgrade file and checking whether a system firmware upgrade thread exists within the baseboard management controller, the method further includes: Perform a priori operation on the specified upgrade file to determine whether the specified upgrade file is invalid; and In response to the successful completion of the prior operation on the specified upgrade file, a security verification is performed on the specified upgrade file according to preset verification rules.
15. The method according to claim 1, characterized in that, The step of performing a priori operations on the specified upgrade file includes: Retrieves the signature image management structure from the specified upgrade file passed in; Parse the signature image management structure to obtain the version information and image type of the upgraded firmware; Based on the image type, locate the server system firmware or the current version information of the baseboard management controller that matches the image type; and Perform a priori operation on the specified upgrade file based on the current version information.
16. The method according to claim 15, characterized in that, The step of performing a priori operation on the specified upgrade file based on the current version information includes: Compare the current version information with the version information contained in the specified upgrade file; In response to determining that the current version information is the same as the version information contained in the specified upgrade file, or that the version number in the current version information is greater than the version number in the version information contained in the specified upgrade file, the uploaded specified upgrade file is deleted, and a prompt is generated to inform the user that the current firmware is already the latest version; and If it is determined that the version number in the current version information is less than the version number in the version information contained in the specified upgrade file, then the above prior operation is passed.
17. The method according to claim 7, characterized in that, Before the step of determining the earliest specified upgrade file among the multiple specified upgrade files as the target upgrade file in response to determining that multiple specified upgrade files exist in the preset storage space, the following steps are included: In response to determining that multiple specified upgrade files are stored in the preset storage space, a storage time tag is set for each specified upgrade file to specify the storage time of each specified upgrade file in the preset storage space.
18. A computer program product comprising computer-readable instructions, characterized in that, When the computer-readable instructions are executed by one or more processors, they implement the steps of the method described in any of claims 1-17.
19. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory associated with the one or more processors, the memory being used to store computer-readable instructions that, when read and executed by the one or more processors, implement the method as described in any one of claims 1-17.
20. A non-volatile computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by one or more processors, implement the method as described in any one of claims 1-17.
Citation Information
Patent Citations
Safe starting method and device of system, terminal equipment and storage medium
CN116070215A
Baseboard management controller cluster firmware upgrading method, product, equipment and medium
CN118484219A
Firmware upgrading method, computer program product, electronic equipment and medium
CN118689523A
Firmware security verification method and device
US20220075873A1
Firmware upgrade method, terminal and computer-readable non-volatile storage medium
WO2018176733A1
Cited By
Decoupling method and device, program product, server and storage medium
CN121957702A