Key management method, computer device, storage medium and program product

By analyzing operation instructions and automatically executing corresponding operations, the problem of low efficiency of firmware signature operation is solved, and a more efficient key management and signature process is achieved.

CN118797751BActive Publication Date: 2024-12-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411275547.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-03
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

In the field of server technology, the signature operation efficiency of firmware is low, and the signature process in the prior art is cumbersome and prone to errors, resulting in low operation efficiency.

Method used

By obtaining and parsing operation instructions, determining the key type and operation type, and automatically performing corresponding management operations, simplifying user input and improving signature efficiency.

Benefits of technology

It simplifies user operations, reduces the probability of errors, and improves the efficiency and management efficiency of firmware signatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797751B_ABST
    Figure CN118797751B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of servers, and discloses a key management method, a computer device, a storage medium and a program product, including: obtaining a first operation instruction, wherein the first operation instruction is an operation instruction generated in the first stage of the process of implanting key data, or an operation instruction generated in the second stage of the process of erasing key data; parsing the first operation instruction to obtain a key type and an operation type; obtaining target data according to the key type and the operation type; when the operation type is a first type of operation type, performing a signature operation corresponding to the operation type on each central processor in the target server according to the operation type and the target data. The present invention can improve the efficiency of the signature operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a key management method, a computer device, a storage medium and a program product. Background Art

[0002] In the field of server technology, various types of firmware can be fixed in the server's memory to control the behavior of corresponding server components. For example, the Basic Input Output System (BIOS) firmware includes basic input and output programs, operating system setting information, self-test programs after powering on, and operating system self-starting programs.

[0003] Since many functions of the server rely on the normal operation of each firmware, the security of each firmware needs to be highly valued. For example, in the current BIOS firmware update process, the BIOS firmware generally needs to be signed so that the legitimacy of the BIOS firmware can be checked when the BIOS firmware is subsequently updated. In the related art, the signing process of the BIOS firmware is carried out offline. Since the steps of the entire signing process are relatively cumbersome, each step requires the technician to enter complex instructions, which is easy to make mistakes. Once an error occurs, the signing process will fail and need to be re-signed.

[0004] This results in low efficiency of the firmware signing operation. Summary of the invention

[0005] In view of this, the present invention provides a key management method, apparatus, computer equipment, storage medium and program product to solve the problem of low efficiency of firmware signature operation.

[0006] In a first aspect, the present invention provides a key management method, the method comprising:

[0007] Obtaining a first operation instruction, wherein the first operation instruction is an operation instruction generated in the first stage of the process of implanting key data, or an operation instruction generated in the second stage of the process of erasing key data;

[0008] Parsing the first operation instruction to obtain a key type and an operation type;

[0009] Acquire target data according to the key type and the operation type;

[0010] When the operation type is a first type of operation type, a management operation corresponding to the operation type is performed on each of at least one central processor included in the target server according to the operation type and the target data.

[0011] The key management method provided by the present invention has the following advantages:

[0012] When the first operation instruction is obtained, the solution can parse the first operation instruction to obtain the key type and the operation type, and perform the corresponding operation according to the key type and the operation type. In this way, when signing the firmware, the user only needs to enter the key type and the operation type to perform the corresponding management operation, without the user having to enter many steps of corresponding complex instructions, which can simplify user operations and reduce the probability of errors, that is, it can improve the signing efficiency of the firmware.

[0013] In an optional embodiment, the key type is a first category key or a second category key, and the key data implantation process includes a key data generation phase and a key data implantation phase, the key data generation phase includes a first key data generation phase and a second key data generation phase, wherein the first key data includes first public key data and first private key data corresponding to the first category key, the second key data includes second public key data and second private key data corresponding to the second category key, the key data implantation phase includes an implantation phase of the first public key data and an implantation phase of the second public key data, and the key data erasing process includes an unloading phase of the key data and an erasing phase of the key data.

[0014] Specifically, by dividing the management operation of key data into stages, at each stage, the user can enter the key type and operation type to complete the management operation of that stage. There is no need to enter complex instructions at each stage, which can improve the ease of operation and thus improve management efficiency.

[0015] In an optional implementation, when the first stage is the implantation stage of the first public key data, the key type is the first category key, the operation type is the installation operation, the installation operation is the first category operation type, and the target data is the first public key data;

[0016] When the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including:

[0017] The first public key data is installed on each of the at least one central processor.

[0018] Specifically, during the implantation stage of the first public key data, the user only needs to enter the name of the first type of key and the name of the installation operation to automatically install the first public key data on each central processor of the target server. The operation is simple, the error probability is low, and the management efficiency can be improved.

[0019] In an optional implementation, when the first stage is the implantation stage of the second public key data, the key type is the second type of key, the operation type is the installation operation, the installation operation is the first type of operation, and the target data is the second public key data, wherein the implantation stage of the second public key data is a stage after the implantation stage of the first public key data;

[0020] When the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including:

[0021] The second public key data is installed on each of the at least one central processor to lock the first public key data.

[0022] Specifically, during the implantation stage of the second public key data, the user only needs to enter the name of the second type of key and the name of the installation operation to automatically install the second public key data on each central processor of the target server. The operation is simple, the error probability is low, and management efficiency can be improved.

[0023] In an optional implementation, when the second stage is the uninstallation stage, the key type is the first type of key, the operation type is an uninstallation operation, the uninstallation operation is the first type of operation type, and the target data is task execution information of a baseboard management controller in the target server;

[0024] When the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including:

[0025] Determining whether to allow the unlocking operation according to the task execution information;

[0026] When it is determined that the unlocking operation is allowed, obtaining a target parsing script, a binary unlocking file corresponding to the first type of key, the second public key data, and the second private key data;

[0027] Parsing the binary unlocking file according to the target parsing script, the second public key data and the second private key data to obtain a binary uninstallation file corresponding to the first type of key;

[0028] The binary uninstallation file is formatted to obtain a hexadecimal uninstallation file.

[0029] Specifically, in the related art, when using a burner to update the key of the central processing unit, it can be directly erased, which is less secure. However, this solution provides a key data erasure method, in which the user can enter the name of the first type of key and the name of the uninstall operation in the management device, so that the security key management tool can obtain the target parsing script, the binary unlocking file corresponding to the first type of key, the second public key data and the second private key data, and use these data to generate a file for unlocking for subsequent key erasure operations. In this way, the security of key data erasure can be improved, and the operation is simple, which can improve the erasure efficiency.

[0030] In an optional implementation, when the second stage is the erasing stage, the key type is the first type of key, the operation type is an erasing operation, the erasing operation is the first type of operation, the target data is the hexadecimal uninstall file, and the erasing stage is a stage after the uninstalling stage;

[0031] When the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including:

[0032] According to the hexadecimal uninstall file, unlocking the first public key data in each of the central processors;

[0033] When the result of the unlocking operation on the first public key data in the target central processor is successful, the first public key data in the target central processor is erased, wherein the target central processor is any central processor of at least one of the central processors.

[0034] Specifically, when performing an erasing operation, the user can input the name of the first type of key and the name of the erasing operation. Furthermore, the security key management tool can obtain a pre-generated hexadecimal uninstallation file and perform an erasing operation on the key data in the central processing unit according to the hexadecimal file. In this way, the operation is simple and the erasing efficiency can be improved.

[0035] In an optional implementation, the process of implanting key data further includes an implantation phase of the first private key data, and the method further includes:

[0036] Obtain the file where the first private key data is located;

[0037] According to a preset rule, rename the file where the first private key data is located;

[0038] Copy the renamed file containing the first private key data to the directory containing the target firmware;

[0039] A security signature is set for the directory where the target firmware is located, and a compile operation is performed to obtain the target firmware including the first private key data.

[0040] Specifically, by renaming the private key file, it is more difficult for an attacker to find the correct private key file. The security signature setting can prevent unauthorized modification of the firmware and ensure the integrity of the firmware and the authenticity of the source.

[0041] In an optional implementation, when the first stage is the stage of generating the key data, the operation type is a generation operation, the generation operation is a second type of operation, and the method further includes:

[0042] According to the key type, key data corresponding to the key type is generated, wherein the key data includes public key data and private key data.

[0043] Specifically, the user only needs to input the key type and the name of the generation operation, and the security key management tool can generate data of the corresponding key type. The operation is simple and the generation efficiency is high.

[0044] In an optional implementation, the target firmware is basic input / output system firmware.

[0045] Specifically, since the basic input and output system firmware undertakes many functions of the server, the process of signing the firmware is relatively complicated. Therefore, in the process of signing the firmware, you only need to enter the key type and operation type. The operation is simple, the error probability is low, and the signing efficiency can be improved.

[0046] In an optional implementation, the first type of key is a certificate authority key, and the second type of key is a local authentication module key.

[0047] In an optional implementation, when the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data includes:

[0048] According to the operation type and the target data, a second operation instruction is called to complete a management operation corresponding to the operation type for each of the central processors.

[0049] Specifically, management efficiency can be improved by automating operation instructions.

[0050] In an optional implementation manner, after completing the implantation phase of the first public key data, or completing the implantation phase of the second public key data, or completing the processing of the erasure phase, the method further includes:

[0051] The target server is restarted to update the status of the public key data of each central processor.

[0052] In a second aspect, the present invention provides a device for performing a signing operation, the device comprising:

[0053] An acquisition module, used to acquire a first operation instruction, wherein the first operation instruction is an operation instruction generated in the first stage of the process of implanting key data, or an operation instruction generated in the second stage of the process of erasing key data;

[0054] A parsing module, used to parse the first operation instruction to obtain a key type and an operation type;

[0055] The acquisition module is further used to acquire target data according to the key type and the operation type;

[0056] The management module is used to execute a management operation corresponding to the operation type on each central processor of at least one central processor included in the target server according to the operation type and the target data when the operation type is a first type of operation type.

[0057] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the key management method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0058] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the key management method of the first aspect or any corresponding embodiment thereof.

[0059] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the key management method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions 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 creative work.

[0061] Figure 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;

[0062] Figure 2 is a schematic diagram of the architecture of a security key management tool according to an embodiment of the present invention;

[0063] Figure 3 is a flowchart of a key management method according to an embodiment of the present invention;

[0064] Figure 4 is a flow chart of another key management method according to an embodiment of the present invention;

[0065] Figure 5 is a structural block diagram of a key management device according to an embodiment of the present invention;

[0066] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0068] The embodiment of the present invention can be applied to a system consisting of a server and a management device. Figure 1As shown, the server may include a baseboard management controller (Baseboard Management Controller, BMC) and a central processing unit (Central Processing Unit, CPU) module, and the CPU module may include at least one CPU, a memory module, at least one memory and a security verifier, etc. Among them, the BMC may be an Open BMC. The at least one memory may include a first memory, and the first memory may be used to store a basic input output system (Basic Input Output System, BIOS) firmware. For example, the first memory may be Flash. The security verifier may be an external root-of-trust (External Root-of-Trust, ERoT) verifier, which may be used to store various types of key data and perform security verification operations on the firmware stored in the memory, etc. The management device may be a terminal where the user is located, and its operating system may be a Linux operating system, and a security key (Key) management tool is installed. The security key management tool may be a script file or a software program.

[0069] like Figure 2 As shown, the functional modules of the security key management tool may include an instruction processing layer, a tool calling layer and a data storage layer. The instruction processing layer may include an instruction parsing module and an instruction calling module. The tool calling layer may include a Curl instruction calling module, a Hexdump instruction calling module, a Management Component Transport Protocol (MCTP) instruction calling module and a Python instruction calling module. The data storage layer includes a storage module for first key data, a storage module for second key data and a storage module for key parsing data. The first key data may include first public key data and first private key data corresponding to the first type of key, and the second key data may include second public key data and second private key data corresponding to the second type of key. The first type of key may be a Certification Authority Key (CAK) key, and the second type of key may be a Local Authentication Module Key (LAK) key. The key parsing data may include a binary unlock file (e.g., cak_unlock.bin), a hexadecimal uninstall file, etc. corresponding to the first type of key.

[0070] The embodiment of the present invention provides a key management method, and the user only needs to input a simple operation instruction, that is, an operation instruction including a key type and an operation type, to perform a signature operation according to the key type and the operation type, thereby improving the efficiency of the signature operation.

[0071] According to an embodiment of the present invention, a key management method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0072] In this embodiment, a key management method is provided, which can be executed by the above-mentioned security key management tool. Figure 3 is a flowchart of a key management method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0073] Step S301, obtaining a first operation instruction.

[0074] Among them, the first operation instruction can be an operation instruction generated in the first stage of the key data implantation process, or an operation instruction generated in the second stage of the key data erasing process. The key data implantation process may include a key data generation stage and a key data implantation stage, and the key data generation stage may include a first key data generation stage and a second key data generation stage. The key data implantation stage may include a first public key data implantation stage, a second public key data implantation stage, and a first private key data implantation stage, and the second public key data implantation stage is a stage after the first public key data implantation stage. The key data erasing process may include a key data uninstallation stage and a key data erasing stage, and the erasing stage is a stage after the uninstallation stage. The first stage may be one of the first key data generation stage, the second key data generation stage, the first public key data implantation stage, and the second public key data implantation stage. The second stage may be one of the key data uninstallation stage and the key data erasing stage.

[0075] Specifically, during the generation and uninstallation phases of key data, the user can directly run the security key management tool under the operating system of the management device and input the key type and operation type, and then the security key management tool can generate the first operation instruction according to the key type and operation type. During the implantation and erasure phases of key data, the user can use the secure shell protocol (SSH) to log in to the OpenBMC in the target server, and then run the security key management tool and input the key type and operation type, and the security key management tool can generate the first operation instruction.

[0076] In some optional implementations, the security key management tool may record the correspondence between the number and the operation instruction, wherein the number may be a number. After running the security key management tool, the user may input the target number, and further, the security key management tool may determine the operation instruction corresponding to the target number based on the target number and the correspondence, and automatically input the operation instruction corresponding to the target number. In this way, the user only needs to input the number, which can simplify the operation and further reduce the probability of user operation errors, that is, the efficiency of key data management operations can be improved.

[0077] Step S302: parse the first operation instruction to obtain a key type and an operation type.

[0078] The key type may be a first type key or a second type key. The operation type may include a generation operation, an installation operation, an uninstallation operation, and an erasure operation. The installation operation, the uninstallation operation, and the erasure operation may be a first type operation type, and the generation operation may be a second type operation type.

[0079] Example 1: During the key data generation phase, the first operation instruction may be “DotKeyManage.sh CAKcreate” or “DotKeyManage.sh LAK create”, where “DotKeyManage.sh” may be the file name of a security key management tool, “CAK” and “LAK” are key types, and “create” is an operation type, indicating a generation operation.

[0080] Example 2: During the key data implantation phase, the first operation instruction may be “DotKeyManage.sh CAKinstall” or “DotKeyManage.sh LAK install”, where “install” is the operation type, indicating an installation operation.

[0081] Example 3: In the uninstallation phase of the key data, the first operation instruction may be "DotKeyManage.sh CAKuninstall", where "uninstall" is the operation type, indicating an uninstallation operation.

[0082] Example 4: In the key data erasing stage, the first operation instruction may be "DotKeyManage.sh CAKerase", where "erase" is the operation type, indicating an erasing operation.

[0083] Step S303, obtaining target data according to the key type and operation type.

[0084] Specifically, for different key types and operation types, the target data obtained is different, which can be divided into the following four cases:

[0085] In case 1, when the key type is the first type of key and the operation type is the installation operation, the target data may be the first public key data. Accordingly, the first operation instruction is the operation instruction corresponding to the implantation phase of the first public key data.

[0086] Case 2: When the key type is the second type of key and the operation type is installation operation, the target data may be the second public key data. Accordingly, the first operation instruction is the operation instruction corresponding to the implantation phase of the second public key data.

[0087] Case 3: when the key type is the first type of key and the operation type is an uninstall operation, the target data may be task execution information of the baseboard management controller. Accordingly, the first operation instruction is an operation instruction corresponding to the uninstall phase of the key data.

[0088] Case 4: when the key type is the first type of key, the operation type is an erase operation, and the target data can be a hexadecimal uninstall file, accordingly, the first operation instruction is an operation instruction corresponding to the erasure phase of the key data.

[0089] In some optional implementations, since there is a causal relationship between the aforementioned multiple stages, the subsequent stages cannot be performed if the previous stage is not completed. Therefore, in the processing of each round (a round may include a key data implantation process and a key data erasure process), the security key management tool may record the version number of the latest operation of the third stage after completing the operation of the third stage of the current round, wherein the third stage may be any stage in the above-mentioned key data implantation process, or any stage in the key data erasure process. After obtaining the first operation instruction, when the security key management tool can first determine the target stage that matches the target operation instruction, and obtain the first version number of the latest operation corresponding to the target stage, and the second version number of the latest operation of the previous stage corresponding to the target stage, determine whether the second version number is greater than the first version number, if yes, then step S303 may be executed, if not, then an error indication message may be returned, and the error indication message may be used to indicate the execution of the operation of the previous stage corresponding to the target stage. In this way, it is possible to determine whether the operation instruction can be successfully executed before the operation instruction is executed, and a corresponding prompt may be given in time if it is determined that the operation instruction cannot be successfully executed, so that the execution failure does not need to be discovered during the execution of the operation instruction, thereby improving management efficiency.

[0090] Step S304: When the operation type is a first type of operation type, a signature operation corresponding to the operation type is performed on each of at least one central processor included in the target server according to the operation type and the target data.

[0091] Specifically, the management device may call the second operation instruction according to the operation type and target data to complete the signature operation corresponding to the operation type for each central processor, wherein the second operation instruction may be an instruction supported by the BMC.

[0092] Corresponding to situation 1 in step S303, the management device may call the first MCTP instruction to install the first public key data on each central processor of the target server.

[0093] Corresponding to the second situation in step S303, the management device may call a second MCTP instruction to install the second public key data on each central processor of the at least one central processor to lock the first public key data.

[0094] Corresponding to situation 3 in step S303, the management device may process according to the following steps:

[0095] Step 1: Determine whether to allow the unlocking operation based on the task execution information.

[0096] Step 2: When it is determined that the unlocking operation is allowed, obtain the target parsing script, the binary unlocking file corresponding to the first type of key, the second public key data and the second private key data.

[0097] Step three, parsing the binary unlocking file according to the target parsing script, the second public key data and the second private key data to obtain a binary uninstallation file corresponding to the first type of key.

[0098] The target parsing script may be a Python script including multiple parsing steps.

[0099] Step 4: Convert the format of the binary uninstall file to obtain a hexadecimal uninstall file.

[0100] Specifically, after obtaining the task execution information of the BMC, the management device can determine whether the BMC can perform the unlocking operation according to the task execution information. If so, the first Curl instruction can be sent to the BMC, and the BMC will obtain the binary unlocking file (for example, cak_unlock.bin) corresponding to the first type of key from the key data stored in itself, and obtain the second public key data and the second private key data from the memory of the target server, and feed it back to the management device, so that the management device can call the target parsing script, and parse the binary unlocking file according to the multiple parsing steps included in the target parsing script, as well as the second public key data and the second private key data, to obtain a binary uninstall file (for example, cak_uninstall.bin). Finally, the management device can call the Hexdump instruction to parse the binary uninstall file to obtain the hexadecimal uninstall file finally used for the unlocking operation.

[0101] Corresponding to the fourth situation in step S303, the management device may process according to the following steps:

[0102] Step 1: unlock the first public key data in each central processing unit according to the hexadecimal uninstall file.

[0103] Step 2: When the result of the unlocking operation on the first public key data in the target CPU is successful, the first public key data in the target CPU is erased.

[0104] The target CPU is any CPU in the at least one CPU.

[0105] In some optional implementations, the process of implanting key data may also include an implantation phase of the first private key data. Accordingly, the security management key tool may be processed in the following steps:

[0106] Step 1: Obtain the file containing the first private key data.

[0107] Step 2: Rename the file containing the first private key data according to a preset rule.

[0108] Step 3: Copy the renamed file containing the first private key data to the directory containing the target firmware.

[0109] The target firmware may be BIOS firmware.

[0110] Step 4: Set a security signature for the directory where the target firmware is located, and perform a compile operation to obtain the target firmware including the first private key data.

[0111] In some optional implementations, when the first stage is a key data generation stage, the operation type is a generation operation. Accordingly, the security key management tool can generate key data corresponding to the key type according to the key type after performing a parsing operation on the acquired first operation instruction.

[0112] The key data may include public key data and private key data.

[0113] Specifically, the security key management tool may call the first OpenSSL instruction according to the key type and the operation type to generate key data corresponding to the key type. In addition, in order to convert the generated key data into a readable form, the security key management tool may call the second OpenSSL instruction according to the generated key data to delete useless characters in the generated key data and retain only the key part to complete the update of the key data.

[0114] After completing the implantation stage of the second public key data, when the target firmware needs to be updated, the security verifier can first obtain the second private key data, and use the second private key data to verify the second public key data in the central processing unit. When the verification passes, the first public key data implanted in the central processing unit can be unlocked and obtained, and then the first public key data can be used to verify the target firmware. After the verification passes, the update operation is allowed.

[0115] In some optional embodiments, after completing the implantation phase of the first public key data, or completing the implantation phase of the second public key data, or completing the erasure phase, the security key management tool can restart the target server to update the status of the public key data of each central processor.

[0116] The key management method provided in this embodiment can parse the first operation instruction when obtaining the first operation instruction, obtain the key type and the operation type, and perform the corresponding operation according to the key type and the operation type. In this way, when signing the firmware, the user only needs to enter the key type and the operation type to perform the corresponding management operation, without the user having to enter many steps of corresponding complex instructions, which can simplify the user operation and reduce the error probability, that is, it can improve the signing efficiency of the firmware.

[0117] In the process of managing the key data of the target server, the aforementioned key data generation phase is the first phase, and the key data implantation phase is the second phase. After completing the key data implantation operation, when the target firmware needs to be started or updated, it is necessary to first verify it based on the implanted key data before performing the corresponding operation to ensure the security of the target server. When the implanted key data needs to be erased, the key data uninstallation phase is entered first, and then the key data erasure phase is entered. Figure 4 As shown, a complete process from the generation stage to the erasure stage of key data is given.

[0118] The user can run the security key management tool on the management device, and first enter the name of the first type of key (CAK) and the name of the generation operation (Create) in the security key management tool, and the security key management tool can generate the first key data. Furthermore, after the format of the generated first key data is converted, the first public key data and the first private key data can be extracted and stored in the data storage layer. Then, enter the name of the second type of key (LAK) and the name of the generation operation, and the security key management tool can generate the second key data. Furthermore, after the format of the generated second key data is converted, the second public key data and the second private key data can be extracted and stored in the data storage layer.

[0119] When it is necessary to implant key data, first, the user can use SSH to log in to the Open BMC of the target server on the management device, find the file where the corresponding first private key data is located, rename it, and copy the file where the first private key data is located to the directory where the target firmware is located for compilation, which completes the operation of implanting the first private key data into the target firmware. Second, the user can enter the name of the first type of key and the name of the installation operation (Install) in the security key management tool, and the security key management tool can obtain the first public key data from the data storage layer and implant the first public key data into each central processor. Then, the user can enter the name of the second type of key and the name of the installation operation, and the security key management tool can obtain the second public key data from the data storage layer, and implant the second public key data into each central processor, and lock the first public key data implanted in each central processor. In this way, the signing operation of the target firmware is completed.

[0120] When the target firmware needs to be started or updated, the target server can perform a verification operation using the second private key data input by the user or stored in the second memory of the target server and the implanted key data, and when the verification passes, the target firmware is updated.

[0121] When it is necessary to erase the data implanted in the CPU, the user can enter the name of the first-class key and the name of the uninstall operation (uninstall) in the security key management tool, so that the security key management tool can automatically generate a hexadecimal uninstall file for the erase operation and store it in the data storage layer. Then, the user can enter the name of the first-class key and the name of the erase operation (erase) in the security key management tool, so that the security key management tool can obtain the hexadecimal uninstall file from the data storage layer and use the hexadecimal uninstall file to perform an erase operation on the public key data in the CPU.

[0122] In this embodiment, a key management device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0123] This embodiment provides a key management device, such as Figure 5 As shown, including:

[0124] An acquisition module 501 is used to acquire a first operation instruction, wherein the first operation instruction is an operation instruction generated in the first stage of the process of implanting key data, or an operation instruction generated in the second stage of the process of erasing key data;

[0125] The parsing module 502 is used to parse the first operation instruction to obtain a key type and an operation type;

[0126] The acquisition module 501 is further used to acquire target data according to the key type and the operation type;

[0127] The management module 503 is used to execute a management operation corresponding to the operation type on each of the at least one central processor included in the target server according to the operation type and the target data when the operation type is the first type of operation.

[0128] In some optional embodiments, the key type is a first type key or a second type key, the process of implanting key data includes a key data generation phase and a key data implantation phase, the key data generation phase includes a first key data generation phase and a second key data generation phase, wherein the first key data includes first public key data and first private key data corresponding to the first type key, the second key data includes second public key data and second private key data corresponding to the second type key, the key data implantation phase includes a first public key data implantation phase and a second public key data implantation phase, and the key data erasing process includes a key data unloading phase and a key data erasing phase.

[0129] In some optional implementations, when the first stage is the implantation stage of the first public key data, the key type is the first type of key, the operation type is the installation operation, the installation operation is the first type of operation, and the target data is the first public key data;

[0130] The management module 503 is specifically used for:

[0131] The first public key data is installed on each of the at least one central processor.

[0132] In some optional implementations, when the first stage is the implantation stage of the second public key data, the key type is the second type of key, the operation type is the installation operation, the installation operation is the first type of operation, and the target data is the second public key data, wherein the implantation stage of the second public key data is a stage after the implantation stage of the first public key data;

[0133] The management module 503 is specifically used for:

[0134] The second public key data is installed on each central processor of at least one central processor to lock the first public key data.

[0135] In some optional implementations, when the second stage is the uninstallation stage, the key type is the first type of key, the operation type is the uninstallation operation, the uninstallation operation is the first type of operation, and the target data is the task execution information of the baseboard management controller in the target server;

[0136] The management module 503 is specifically used for:

[0137] Determine whether to allow the unlocking operation according to the task execution information;

[0138] When it is determined that the unlocking operation is allowed, obtaining a target parsing script, a binary unlocking file corresponding to the first type of key, a second public key data, and a second private key data;

[0139] Parse the binary unlocking file according to the target parsing script, the second public key data and the second private key data to obtain a binary uninstallation file corresponding to the first type of key;

[0140] Convert the binary uninstall file to a hexadecimal uninstall file.

[0141] In some optional implementations, when the second stage is an erasure stage, the key type is a first-class key, the operation type is an erasure operation, the erasure operation is a first-class operation type, and the target data is a hexadecimal uninstall file, wherein the erasure stage is a stage after the uninstall stage;

[0142] The management module 503 is specifically used for:

[0143] According to the hexadecimal uninstall file, unlock the first public key data in each central processing unit;

[0144] When the result of the unlocking operation on the first public key data in the target central processor is successful, the first public key data in the target central processor is erased, wherein the target central processor is any central processor of the at least one central processor.

[0145] In some optional implementations, the device further includes a renaming module 504, a copying module 505, and a compiling module 506, and the process of implanting key data further includes an implantation phase of the first private key data;

[0146] The acquisition module 501 is also used to obtain the file where the first private key data is located;

[0147] The renaming module 504 is further used to rename the file where the first private key data is located according to a preset rule;

[0148] A copy module 505, used to copy the renamed file containing the first private key data to the directory containing the target firmware;

[0149] The compiling module 506 is used to set a security signature for the directory where the target firmware is located, and perform a compiling operation to obtain the target firmware including the first private key data.

[0150] In some optional implementations, the device further includes a generation module 507, and when the first stage is a key data generation stage, the operation type is a generation operation, and the generation operation is a second type of operation type;

[0151] The generating module 507 is used to generate key data corresponding to the key type according to the key type, wherein the key data includes public key data and private key data.

[0152] In some optional implementations, the target firmware is basic input / output system firmware.

[0153] In some optional implementations, the first type of key is a certificate authority key, and the second type of key is a local authentication module key.

[0154] In some optional implementations, the management module 503 is specifically configured to:

[0155] According to the operation type and target data, the second operation instruction is called to complete the management operation corresponding to the operation type for each central processor.

[0156] In some optional implementations, the device further includes a restart module 508, configured to:

[0157] After completing the implantation phase of the first public key data, or completing the implantation phase of the second public key data, or completing the erasure phase, the target server is restarted to update the status of the public key data of each central processor.

[0158] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0159] The key management device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0160] The embodiment of the present invention also provides a computer device having the above Figure 5 The key management device shown.

[0161] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0162] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0163] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0164] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0165] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0166] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0167] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0168] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0169] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0170] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A key management method, It is characterized in that The method comprises: Acquire a first operation instruction, wherein the first operation instruction is an operation instruction generated in the first stage of the key data implantation process, or an operation instruction generated in the second stage of the key data erasing process, the key data implantation process includes a key data generation stage and a key data implantation stage, the key data generation stage includes a second key data generation stage, the second key data includes second public key data and second private key data corresponding to the second type of key, the key data implantation stage includes a second public key data implantation stage, and the key data erasing process includes a key data uninstallation stage; Parsing the first operation instruction to obtain a key type and an operation type, wherein the operation type is one of a generation operation, an installation operation, an uninstallation operation, and an erasure operation, the installation operation, the uninstallation operation, and the erasure operation belong to the first type of operation type, the generation operation belongs to the second type of operation type, and the key type is the first type of key or the second type of key; Acquire target data according to the key type and the operation type; Wherein, when the first operation instruction is the operation instruction generated in the second stage and the second stage is the uninstallation stage of the key data, the key type is the first type of key, the operation type is the uninstallation operation, and the target data is the task execution information of the baseboard management controller; When the operation type is the first type of operation, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including: Determining whether to allow the unlocking operation according to the task execution information; When it is determined that the unlocking operation is allowed, obtaining a target parsing script, a binary unlocking file corresponding to the first type of key, the second public key data, and the second private key data; Parsing the binary unlocking file according to the target parsing script, the second public key data and the second private key data to obtain a binary uninstallation file corresponding to the first type of key; The binary uninstallation file is formatted to obtain a hexadecimal uninstallation file.

2. The method according to claim 1, It is characterized in that The key data generation stage includes a first key data generation stage and a second key data generation stage, wherein the first key data includes first public key data and first private key data corresponding to the first type of key, the key data implantation stage also includes the first public key data implantation stage, and the key data erasing process also includes a key data erasing stage.

3. The method according to claim 2, It is characterized in that When the first operation instruction is an operation instruction generated in the first stage and the first stage is the implantation stage of the first public key data, the key type is the first category key, the operation type is the installation operation, the installation operation is the first category operation type, and the target data is the first public key data; When the operation type is the first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including: The first public key data is installed on each of the at least one central processor.

4. The method according to claim 2, It is characterized in that When the first operation instruction is an operation instruction generated in the first stage and the first stage is the implantation stage of the second public key data, the key type is the second type of key, the operation type is the installation operation, the target data is the second public key data, and the implantation stage of the second public key data is a stage after the implantation stage of the first public key data; When the operation type is the first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including: The second public key data is installed on each of the at least one central processor to lock the first public key data.

5. The method according to claim 2, It is characterized in that When the first operation instruction is an operation instruction generated in the second stage and the second stage is the erasing stage, the key type is the first type of key, the operation type is the erasing operation, the target data is the hexadecimal uninstallation file, and the erasing stage is a stage after the uninstallation stage; When the operation type is the first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including: According to the hexadecimal uninstall file, unlocking the first public key data in each of the central processors; When the result of the unlocking operation on the first public key data in the target central processor is successful, the first public key data in the target central processor is erased, wherein the target central processor is any central processor of at least one of the central processors.

6. The method according to claim 2, It is characterized in that The key data implantation process also includes an implantation phase of the first private key data, and the method further includes: Obtain the file where the first private key data is located; According to a preset rule, rename the file where the first private key data is located; Copy the renamed file containing the first private key data to the directory containing the target firmware; A security signature is set for the directory where the target firmware is located, and a compile operation is performed to obtain the target firmware including the first private key data.

7. The method according to claim 2, It is characterized in that When the first stage is a stage for generating the key data, the operation type is the generating operation, and the method further includes: According to the key type, key data corresponding to the key type is generated, wherein the key data includes public key data and private key data.

8. The method according to claim 6, It is characterized in that The target firmware is basic input and output system firmware.

9. The method according to any one of claims 1 to 8, It is characterized in that The first type of key is a certificate authority key, and the second type of key is a local authentication module key.

10. The method according to claim 1 or 2, It is characterized in that When the operation type is a first type of operation type, performing a management operation corresponding to the operation type on each of at least one central processor included in the target server according to the operation type and the target data, including: According to the operation type and the target data, a second operation instruction is called to complete a management operation corresponding to the operation type for each of the central processors.

11. The method according to claim 2, It is characterized in that After completing the implantation phase of the first public key data, or completing the implantation phase of the second public key data, or completing the processing of the erasure phase, the method further includes: The target server is restarted to update the status of the public key data of each central processor.

12. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the key management method according to any one of claims 1 to 11 by executing the computer instructions.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the key management method according to any one of claims 1 to 11.

14. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the key management method according to any one of claims 1 to 11.