Method, device, chip, network interface card, equipment, medium and program product for loading extended firmware
Patent Information
- Application Number
- CN202610829507.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]传统技术中,PCIe的Option ROM以明文形式存放在设备上,任何具有物理接触能力或供应链攻击能力的对手都可以读取、分析,甚至篡改其内容,安全性很低
[0056]上述扩展固件的加载方法、装置、芯片、网络接口卡、设备、介质和程序产品,在所述主机初始化阶段,将设备中的扩展固件加载至主机内存,所述扩展固件包括解密文件和加密数据存储文件;通过所述解密文件从所述设备获取到解密密钥;通过获取的所述解密密钥对所述加密数据存储文件存储的数据进行解密,得到扩展固件明文;加载所述扩展固件明文,扩展固件明文被加密,主机在获取到扩展固件后,还需要获取到解密密钥才能够对加密数据存储文件存储的数据进行解密,得到扩展固件明文,从而提高安全性。
Smart Images

Figure CN122884484A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, and in particular to a method, apparatus, chip, network interface card, device, medium, and program product for loading extended firmware. Background Technology
[0002] In modern server architectures, the Data Processing Unit (DPU) acts as an "infrastructure accelerator" in data centers, undertaking various high-security, high-bandwidth fundamental tasks such as network data plane offloading, storage acceleration, security isolation, encrypted computation, and deep packet inspection. The DPU is typically connected to the host CPU (Central Processing Unit) via PCIe (PCI Express). After the system powers on, the host firmware recognizes its PCIe functionality and may load its extended firmware OptionROM. The OptionROM's functions include, but are not limited to: device initialization, link training, onboard controller configuration, network PXE (Preboot eXecution Environment) startup, and storage array enumeration. These critical operations occur in the early stages of system startup, have high code privileges, and a wide impact, making them a crucial component of the system boot chain.
[0003] In traditional technologies, PCIe's Option ROM is stored in plaintext on the device, which can be read, analyzed, and even tampered with by any adversary with physical access or supply chain attack capabilities, resulting in very low security. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, chip, network interface card, device, medium, and program product for loading extended firmware that can improve security, in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a method for loading extended firmware, applied to a host, the method comprising:
[0006] During the host initialization phase, the extended firmware in the device is loaded into the host memory. The extended firmware includes a decryption file and an encrypted data storage file.
[0007] The decryption key is obtained from the device through the decryption file;
[0008] The data stored in the encrypted data storage file is decrypted using the obtained decryption key to obtain the plaintext of the extended firmware;
[0009] Load the plaintext of the extended firmware.
[0010] In one embodiment, the extended firmware further includes an authentication public key; obtaining the decryption key from the device via the decryption file includes:
[0011] The device is sent a decryption key acquisition request through the decryption file. The decryption key acquisition request is used to obtain the decryption key and encrypt the decryption key with the authentication private key to obtain the first encrypted information.
[0012] The device receives the first encrypted information sent by the device and decrypts the first encrypted information using the authentication public key to obtain the decryption key.
[0013] In one embodiment, the extended firmware further includes an authentication file; prior to obtaining the decryption key from the device via the decryption file, the method further includes:
[0014] Perform two-way authentication with the device using the authentication document;
[0015] If the two-way authentication is successful, proceed to the step of obtaining the decryption key from the device through the decryption file.
[0016] In one embodiment, the extended firmware further includes an authentication public key; the step of performing two-way authentication with the device through the authentication file includes:
[0017] The authentication file is used to send a start authentication command to the device. The start authentication command is used to instruct the device to generate a first random number and encrypt the first random number with the authentication private key to obtain a second encrypted information.
[0018] Receive the second encrypted information returned by the device, and decrypt the second encrypted information using the authentication public key to obtain a second random number;
[0019] The second random number is sent to the device, which instructs the device to compare the second random number with the first random number. If the second random number and the first random number are the same, the device returns a message indicating that the two-way authentication has passed to the host; if the second random number and the first random number are different, the device returns a message indicating that the two-way authentication has failed to pass to the host.
[0020] Secondly, this application also provides a method for loading extended firmware, applied to a device, wherein the extended firmware includes a decryption file and an encrypted data storage file; the method includes:
[0021] During the host initialization phase, a decryption key acquisition request is received from the host via the decryption file of the loaded extended firmware;
[0022] Based on the decryption key acquisition request, the decryption key is returned to the host. The decryption key is used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the extended firmware plaintext; and the extended firmware plaintext is loaded.
[0023] In one embodiment, the extended firmware further includes an authentication public key; the step of returning the decryption key to the host based on the decryption key acquisition request includes:
[0024] Obtain the decryption key based on the decryption key acquisition request;
[0025] The first encrypted information is obtained by encrypting the decryption key using the authentication private key;
[0026] The first encrypted information is sent to the host, and the first encrypted information is used to instruct the host to decrypt the first encrypted information using the authentication public key to obtain the decryption key.
[0027] In one embodiment, the extended firmware further includes an authentication file; the method further includes:
[0028] Receive a two-way authentication command sent by the host through the authentication file of the loaded extended firmware;
[0029] Perform two-way authentication based on the two-way authentication command and the authentication file;
[0030] If the two-way authentication is successful, the step of returning the decryption key to the host based on the decryption key acquisition request continues.
[0031] In one embodiment, the extended firmware further includes an authentication public key; the two-way authentication based on the two-way authentication command and the authentication file includes:
[0032] A first random number is generated, and the first random number is encrypted using the authentication private key to obtain the second encrypted information;
[0033] The second encrypted information is sent to the host, and the second encrypted information is used to instruct the host to decrypt the second encrypted information using the authentication public key to obtain a second random number;
[0034] Receive the second random number sent by the host;
[0035] The second random number is compared with the first random number. If the second random number and the first random number are the same, the system returns a message indicating that the two-way authentication has passed to the host; otherwise, the system returns a message indicating that the two-way authentication has failed to the host.
[0036] In one embodiment, the method further includes:
[0037] If the two-way authentication fails, a message is returned to the host rejecting the request to obtain the decryption key.
[0038] In one embodiment, the extended firmware is generated in the following manner:
[0039] An authentication public key and an authentication private key are generated using an asymmetric encryption algorithm. The authentication public key is stored in the extended firmware, and the private key is stored in the device.
[0040] The plaintext of the extended firmware is obtained based on the extended firmware;
[0041] A third random number is generated, and a decryption key and an encryption key are generated based on the third random number. The decryption key is stored in the device, and the plaintext of the extended firmware is encrypted using the encryption key to obtain the ciphertext of the extended firmware.
[0042] Configure an authentication file, a decryption file, and an encrypted data storage file for the extended firmware. The authentication file is used for two-way authentication between the extended firmware and the host, and the decryption file is used to obtain the decryption key.
[0043] The extended firmware ciphertext is stored in the encrypted data storage file of the extended firmware.
[0044] Thirdly, this application also provides an extended firmware loading device for a host computer, the device comprising:
[0045] An initialization module is used to load extended firmware from the device into the host memory during the host initialization phase. The extended firmware includes a decryption file and an encrypted data storage file.
[0046] A decryption key acquisition module is used to obtain a decryption key from the device through the decryption file;
[0047] The extended firmware plaintext acquisition module is used to decrypt the data stored in the encrypted data storage file using the acquired decryption key to obtain the extended firmware plaintext.
[0048] A loading module is used to load the plaintext of the extended firmware.
[0049] Fourthly, this application also provides an extended firmware loading device, applied to a device, wherein the extended firmware includes a decryption file and an encrypted data storage file; the device includes:
[0050] A key storage unit is configured to, during the host initialization phase, receive a decryption key acquisition request sent by the host through the decryption file of the loaded extended firmware; return a decryption key to the host based on the decryption key acquisition request, the decryption key being used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware; and load the plaintext of the extended firmware.
[0051] Fifthly, this application also provides a chip including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0052] Sixthly, this application also provides a network interface card, including the chip as described above and multiple interfaces, wherein the chip communicates externally through the interfaces.
[0053] In a seventh aspect, this application also provides a computer device, including a processor and a chip as described above, wherein the chip is used to schedule messages to the processor or to process them on its own, and the processor is used to process messages scheduled by the chip.
[0054] Eighthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0055] Ninthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0056] The aforementioned extended firmware loading method, apparatus, chip, network interface card, device, medium, and program product, during the host initialization phase, loads the extended firmware from the device into the host memory. The extended firmware includes a decryption file and an encrypted data storage file. A decryption key is obtained from the device through the decryption file. The obtained decryption key is used to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware. The plaintext of the extended firmware is loaded and encrypted. After obtaining the extended firmware, the host still needs to obtain the decryption key to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware, thereby improving security. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is an application environment diagram of the extended firmware loading method in one embodiment;
[0059] Figure 2 This is a flowchart illustrating the method for loading extended firmware in one embodiment;
[0060] Figure 3 This is a flowchart illustrating the two-way authentication steps in one embodiment;
[0061] Figure 4 This is a flowchart illustrating the method for loading extended firmware in another embodiment;
[0062] Figure 5 This is a timing diagram of a method for loading extended firmware in one embodiment;
[0063] Figure 6 This is a structural block diagram of a firmware loading device in one embodiment;
[0064] Figure 7 This is a structural block diagram of the loading device for extended firmware in another embodiment;
[0065] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0067] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0068] The extended firmware loading method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, the host and device communicate with each other. The device stores extended firmware. This device can be a PCIe device such as a DPU, SmartNIC (Smart Network Interface Card), or GPU (Graphics Processing Unit). The extended firmware can be Option ROM. The host and the device can communicate through PCIe channels, SMBUS (System Management Bus) channels, serial ports, or I2C (Inter-Integrated Circuit) channels. The communication method between the host and the device is not limited here.
[0069] During initialization, the host can read extended firmware from the device. This extended firmware includes an authentication file, a decryption file, an encrypted data storage file, and an authentication public key. The authentication file is used for two-way authentication with the device after the extended firmware is loaded by the host. This authentication file is stored in plaintext or with a signature and is executed first by the UEFI (Unified Extensible Firmware Interface) / BIOS (Basic Input / Output System) during the host initialization phase to initiate two-way authentication. The decryption file is used to obtain the decryption key after successful two-way authentication and to decrypt the encrypted data storage file. The decryption file is not executable before successful authentication and is used to decrypt the encrypted data storage file. The authentication public key is used in the two-way authentication and decryption key acquisition processes. When the host loads firmware, it needs to access data from an encrypted data storage file. This data is encrypted and stored within the encrypted data storage file, using symmetric algorithms such as AES (Advanced Encryption Standard) or 3DES (Triple Data Encryption Standard) for static encryption. Therefore, the host needs to communicate with the device to obtain the decryption key through the authentication file, decryption file, and authentication public key. The host can then decrypt the encrypted data storage file to obtain the plaintext of the extended firmware, thus enabling the loading of the extended firmware. Because the data exists in encrypted form, the security of the extended firmware is guaranteed. Even if an attacker obtains the extended firmware content, they can only see the encrypted firmware and cannot reverse engineer it.
[0070] The device also includes an authentication unit, a key storage unit, a random number generator, and an authentication private key. The authentication unit is used to achieve two-way authentication between the host and the device based on the authentication file in the extended firmware stored in the host. Two-way authentication involves the extended firmware verifying whether the device is genuine, and the device verifying whether the extended firmware is the original manufacturer version. Only when both parties pass authentication will the device provide the decryption key to the extended firmware. If two-way authentication fails, the key storage unit is locked, the extended firmware cannot decrypt, and the firmware cannot be executed. The key storage unit stores the decryption key, but this decryption key is not stored in plaintext in the extended firmware. The random number generator is used to generate random numbers during the two-way authentication process. The authentication private key is stored in the device and cannot be obtained from outside. This authentication private key is used to encrypt the decryption key to prevent it from being cracked during transmission.
[0071] In one exemplary embodiment, such as Figure 2 As shown, a method for loading extended firmware is provided, which is applied to... Figure 1 Taking the host machine as an example, the explanation includes the following steps S202 to S208. Wherein:
[0072] S202: During the host initialization phase, the extended firmware in the device is loaded into the host memory. The extended firmware includes decryption files and encrypted data storage files.
[0073] S204: Obtain the decryption key from the device by decrypting the file.
[0074] The host initialization phase, also known as the host UEFI or BIOS phase, involves the host loading extended firmware from the device into its memory. This extended firmware includes at least a decryption file and an encrypted data storage file. The decryption file is not encrypted; it is used to obtain the decryption key from the device for decrypting the encrypted data storage file.
[0075] In some optional embodiments, the extended firmware also includes an authentication public key; obtaining a decryption key from the device via a decryption file includes: sending a decryption key acquisition request to the device via the decryption file, the decryption key acquisition request being used to acquire the decryption key, and encrypting the decryption key with the authentication private key to obtain first encrypted information; receiving the first encrypted information sent by the device, and decrypting the first encrypted information with the authentication public key to obtain the decryption key.
[0076] The decryption key acquisition request is triggered when the host executes the decryption file and is sent by the host to the device. The authentication private key is stored locally on the device and is not publicly displayed. That is, the authentication private key is permanently stored internally and no readout interface is provided. The decryption key in the device's key storage unit is only used to provide decryption capabilities to extended firmware and is not exposed in plaintext. The authentication private key can encrypt the decryption key stored locally on the device to obtain the first encrypted information. The encryption algorithm corresponding to the authentication private key can be an asymmetric encryption algorithm, and this asymmetric encryption algorithm can be any asymmetric encryption algorithm; no specific limitation is made here.
[0077] After receiving the decryption key acquisition request, the device can encrypt the decryption key stored locally on the device using the authentication private key stored locally to obtain the first encrypted information, and send the first encrypted information to the host. The host decrypts the first encrypted information using the authentication public key in the extended firmware to obtain the decryption key. Throughout the process, the decryption key will not appear in plaintext on the bus or in the extended firmware, thus ensuring the security of the decryption key, and consequently ensuring the security of the data stored in the encrypted data storage file.
[0078] The authentication private key and authentication public key are the keys corresponding to the asymmetric encryption algorithm. The asymmetric algorithm can be a common algorithm in the field of cryptography, such as RAS and elliptic cryptography, and no specific restrictions are made here.
[0079] S206: Decrypt the data stored in the encrypted data storage file using the obtained decryption key to obtain the plaintext of the extended firmware.
[0080] S208: Load extended firmware in plaintext.
[0081] Once the host obtains the decryption key, it can use it to decrypt the data stored in the encrypted data storage file, obtaining the plaintext of the extended firmware. This plaintext firmware can then be loaded to securely load the extended firmware. In this way, the host obtains the decryption key from the device's key storage unit via the decryption file and decrypts the encrypted data storage file, achieving secure loading of the extended firmware.
[0082] The method for encrypting the plaintext of the extended firmware can be a common symmetric encryption algorithm in the field of cryptography, such as AES or 3DES, without making specific limitations here.
[0083] The aforementioned method for loading extended firmware involves loading the extended firmware from the device into the host memory during the host initialization phase. The extended firmware includes a decryption file and an encrypted data storage file. A decryption key is obtained from the device through the decryption file. The obtained decryption key is used to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware. The plaintext of the extended firmware is then loaded and encrypted. After obtaining the extended firmware, the host still needs to obtain the decryption key to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware. This ensures that the encrypted data cannot be reverse engineered, guaranteeing high security requirements.
[0084] In some optional embodiments, the extended firmware also includes an authentication file; before obtaining the decryption key from the device via the decryption file, it further includes: performing two-way authentication with the device via the authentication file; if the two-way authentication is successful, proceeding to the step of obtaining the decryption key from the device via the decryption file.
[0085] To ensure security, the extended firmware in this application can no longer be stored in plaintext and requires encryption and access control mechanisms. It must be ensured that the extended firmware can only be decrypted and executed on the genuine original device to prevent it from being copied for reverse engineering or emulation attacks. The decryption key cannot be stored in the extended firmware, nor can it be obtained by the host or attackers. During the host's initialization phase, the BIOS / UEFI must have the ability to assess the security of the extended firmware. A two-way authentication process between the extended firmware and the PCIe device needs to be added to prevent counterfeit devices or counterfeit extended firmware.
[0086] Therefore, the two-way authentication process in this application ensures both the security of the extended firmware and the security of the device. Specifically, in combination with... Figure 3 As shown, the extended firmware also includes an authentication public key; it enables two-way authentication with the device via an authentication file, including:
[0087] S302: Send a start authentication command to the device through the authentication file. The start authentication command is used to instruct the device to generate a first random number and encrypt the first random number with the authentication private key to obtain the second encrypted information.
[0088] The "Start Authentication" command is sent by the host to the device after reading the extended firmware during the initialization phase and executing the extended firmware's authentication file. This authentication file is in plaintext, so the host can execute it directly.
[0089] After receiving the start authentication command, the device generates a first random number using a random number generator, and encrypts the first random number using the authentication private key to obtain a second encrypted information. The device then sends the second encrypted information to the host, thus ensuring the security of the first random number.
[0090] S304: Receive the second encrypted information returned by the receiving device, and decrypt the second encrypted information using the authentication public key to obtain the second random number.
[0091] S306: Send a second random number to the device. The second random number is used to instruct the device to compare the second random number with the first random number. If the second random number and the first random number are the same, return a message indicating that the two-way authentication has passed to the host. If the second random number and the first random number are different, return a message indicating that the two-way authentication has failed to pass to the host.
[0092] After receiving the second encrypted information, the host can decrypt the second encrypted information into a second random number using the authentication public key in the extended firmware, and then send the second random number to the device.
[0093] The host can encrypt the second random number using the authentication public key and send the encrypted second random number to the device. The device receives the encrypted second random number, decrypts it using the authentication private key to obtain the plaintext second random number, and then compares the second random number with the first random number.
[0094] If the second random number is the same as the first random number, the two-way authentication is successful; if the second random number is different from the first random number, the two-way authentication is unsuccessful. The device can then return the result of the two-way authentication to the host.
[0095] Optionally, after receiving the result of the two-way authentication, if the two-way authentication result is successful, the host can continue to obtain the decryption key from the device through the decryption file; or the host does not need to receive the result of the two-way authentication, and after sending the second random number, it sends a decryption key acquisition request to the device through the decryption file. After receiving the decryption key acquisition request, the device first obtains the result of the two-way authentication. If the result of the two-way authentication is successful, it returns the decryption key. If the result of the two-way authentication is unsuccessful, it returns a message to the host that the decryption key acquisition failed, such as returning a message to the host that the decryption key acquisition request is rejected.
[0096] In the above embodiments, firstly, the extended firmware is encrypted to ensure its security; secondly, two-way authentication is required before obtaining the decryption key to ensure the security of the device and the extended firmware; thirdly, the acquisition of the decryption key requires encryption, which also ensures the security of the decryption key; and finally, the security of the data stored in the encrypted data storage file is ensured.
[0097] In one exemplary embodiment, such as Figure 4 As shown, a method for loading extended firmware is provided, which is applied to... Figure 1 Taking the device in the example, the explanation includes the following steps S402 to S404. Wherein:
[0098] S402: During the host initialization phase, receive a decryption key acquisition request sent by the host through the decryption file of the loaded extended firmware.
[0099] During the host initialization phase, the extended firmware stored in the device is read, and then the decryption file in the extended firmware is executed to obtain a decryption key acquisition request, which is then sent to the device.
[0100] Optionally, the extended firmware also includes an authentication public key; returning a decryption key to the host based on a decryption key acquisition request, including: acquiring a decryption key based on a decryption key acquisition request; encrypting the decryption key with an authentication private key to obtain first encrypted information; and sending the first encrypted information to the host, wherein the first encrypted information is used to instruct the host to decrypt the first encrypted information with the authentication public key to obtain a decryption key.
[0101] S404: Based on the decryption key acquisition request, return the decryption key to the host. The decryption key is used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware; and load the plaintext of the extended firmware.
[0102] After receiving the decryption key acquisition request, the device can encrypt the decryption key stored locally on the device using the authentication private key stored locally to obtain the first encrypted information, and send the first encrypted information to the host. The host decrypts the first encrypted information using the authentication public key in the extended firmware to obtain the decryption key. This ensures the security of the decryption key, and thus also ensures the security of the data stored in the encrypted data storage file.
[0103] After the host obtains the decryption key, it can use it to decrypt the data stored in the encrypted data storage file, obtaining the plaintext of the extended firmware. This plaintext extended firmware can then be loaded to securely load the extended firmware. In this way, the host obtains the decryption key from the device's key storage unit through the decryption file and decrypts the encrypted data storage file, achieving secure loading of the extended firmware.
[0104] In some optional embodiments, the extended firmware further includes an authentication file; the method further includes: receiving a two-way authentication command sent by the host through the authentication file of the loaded extended firmware; performing two-way authentication based on the two-way authentication command and the authentication file; and, if the two-way authentication is successful, continuing with the step of returning a decryption key to the host based on a decryption key acquisition request.
[0105] In some optional embodiments, the extended firmware further includes an authentication public key; performing two-way authentication based on a two-way authentication command and an authentication file includes: generating a first random number and encrypting the first random number with an authentication private key to obtain second encrypted information; sending the second encrypted information to the host, the second encrypted information being used to instruct the host to decrypt the second encrypted information with the authentication public key to obtain the second random number; receiving the second random number sent by the host; comparing the second random number with the first random number, and if the second random number and the first random number are the same, returning a two-way authentication successful message to the host, otherwise returning a two-way authentication failed message to the host.
[0106] In some alternative embodiments, the method further includes: returning a message to the host that the request to obtain the decryption key is rejected if the two-way authentication fails.
[0107] The specific limitations regarding two-way authentication can be found above and will not be repeated here.
[0108] In some optional embodiments, the extended firmware is generated by: generating an authentication public key and an authentication private key using an asymmetric encryption algorithm, storing the authentication public key in the extended firmware, and storing the private key in the device; obtaining the plaintext of the extended firmware based on the extended firmware; generating a third random number, and generating a decryption key and an encryption key based on the third random number, storing the decryption key in the device, and encrypting the plaintext of the extended firmware using the encryption key to obtain the ciphertext of the extended firmware; configuring an authentication file, a decryption file, and an encrypted data storage file for the extended firmware, wherein the authentication file is used for two-way authentication between the extended firmware and the host, and the decryption file is used to obtain the decryption key; and storing the ciphertext of the extended firmware in the encrypted data storage file of the extended firmware.
[0109] The preparation of the four parts in the encrypted Option ROM is completed during DPU production. The basic process is as follows:
[0110] An asymmetric encryption algorithm is used to generate a public-private key pair. The authentication private key is stored internally within the DPU and cannot be accessed externally. The authentication public key, which can be publicly disclosed, is built into the extended firmware Option ROM. The Option ROM is modularized, consisting of an authentication file, an encryption file, the authentication public key, and the plaintext of the extended firmware. A random number generator generates a third random number as the encryption and decryption key for the encrypted data storage file in the Option ROM. A symmetric encryption algorithm, such as AES or 3DES, is used to encrypt the data to be encrypted, i.e., the plaintext of the extended firmware, generating an encrypted data storage file. The encrypted Option ROM is then stored in the encrypted data storage file of the encrypted Option ROM.
[0111] Through the integration of the above structural design and security mechanisms, the Option ROM of the DPU in this embodiment is upgraded from a traditional plaintext, directly readable storage format to a secure boot component with device binding, encryption protection, and two-way authentication capabilities. Since the core content of the Option ROM is divided into encrypted data storage files, and the decryption key is stored only in a secure unit within the DPU in a non-exportable manner, attackers cannot directly obtain analyzable plaintext code, regardless of whether they acquire the Option ROM image through physical means, bus monitoring, or during the supply chain process, greatly increasing the difficulty of reverse engineering.
[0112] Meanwhile, two-way authentication during the loading process ensures that the host firmware and DPU device verify each other's identities before execution. Option ROM content that fails authentication will not be decrypted or executed, thus blocking attack paths such as code tampering, device counterfeiting, and man-in-the-middle injection at the source. Combined with mechanisms such as true random number generation and temporary session key negotiation, attackers cannot reuse or replay historical communication content even if they obtain it, thereby effectively resisting advanced attacks based on protocol analysis or timing speculation.
[0113] In the above embodiments, a complete and industrially deployable PCIe device firmware security system is constructed by introducing an Option ROM segmented encryption mechanism, device-side key storage and private key signing, two-way authentication based on random number challenges, secure key exchange using public-private key methods, and static protection of the encrypted data area. This ensures that the Option ROM can only be decrypted and executed by the original device, fundamentally preventing firmware reverse engineering, copying, counterfeiting, and attacks.
[0114] For ease of understanding, the following is combined Figure 1 As shown, the device includes extended firmware, an authentication unit, a key storage unit, an authentication private key, and a random number generator.
[0115] The extended firmware includes authentication files, decryption files, encrypted data storage files, and authentication public keys.
[0116] Combination Figure 5 As shown, Figure 5 This is a timing diagram illustrating the loading method of extended firmware in one embodiment. In this embodiment, during the initialization phase, the host UEFI or BIOS loads the encrypted extended firmware Option ROM into memory and begins execution. The authentication file is executed first; it is not encrypted and can be run directly. The authentication file runs on the host and performs bidirectional authentication with the authentication unit of the device DPU to confirm that the extended firmware Option ROM has not been tampered with and that the DPU device is a genuine device.
[0117] After successful authentication, the decryption file obtains the decryption key stored in the key storage unit from the authentication unit; it calls the decryption file inside the extended firmware Option ROM and uses the decryption key to decrypt the data in the encrypted data storage file inside the Option ROM; then it jumps to and executes the decrypted extended firmware Option ROM content.
[0118] In the above embodiments, a complete and industrially deployable PCIe device firmware security system is constructed by introducing an extended firmware Option ROM segmented encryption mechanism, device-side key storage and private key signing, two-way authentication based on random number challenges, secure key exchange using public-private key methods, and static protection of the encrypted data area. This ensures that the Option ROM can only be decrypted and executed by the original device, fundamentally preventing firmware reverse engineering, copying, counterfeiting, and attacks.
[0119] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0120] Based on the same inventive concept, this application also provides an extended firmware loading device for implementing the extended firmware loading method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more extended firmware loading device embodiments provided below can be found in the limitations of the extended firmware loading method described above, and will not be repeated here.
[0121] In one exemplary embodiment, such as Figure 6 As shown, an extended firmware loading device is provided, comprising: an initialization module 601, a decryption key acquisition module 602, an extended firmware plaintext acquisition module 603, and a loading module 604, wherein:
[0122] Initialization module 601 is used to load extended firmware from the device into host memory during the host initialization phase. The extended firmware includes decryption files and encrypted data storage files.
[0123] The decryption key acquisition module 602 is used to obtain the decryption key from the device through the decryption file;
[0124] The extended firmware plaintext acquisition module 603 is used to decrypt the data stored in the encrypted data storage file using the acquired decryption key to obtain the extended firmware plaintext.
[0125] Load module 604 is used to load the plaintext of the extended firmware.
[0126] In some optional embodiments, the extended firmware further includes an authentication public key; the decryption key acquisition module 602 is specifically used to send a decryption key acquisition request to the device through a decryption file, the decryption key acquisition request being used to acquire the decryption key, and to encrypt the decryption key with the authentication private key to obtain first encrypted information; to receive the first encrypted information sent by the device, and to decrypt the first encrypted information with the authentication public key to obtain the decryption key.
[0127] In some alternative embodiments, the extended firmware further includes an authentication file; the apparatus further includes a two-way authentication module, specifically used for two-way authentication with the device via the authentication file; if the two-way authentication is successful, the step of obtaining the decryption key from the device via the decryption file continues.
[0128] In some optional embodiments, the extended firmware further includes an authentication public key; specifically, the aforementioned two-way authentication module is used to send a start authentication command to the device via an authentication file, the start authentication command instructing the device to generate a first random number and encrypt the first random number using the authentication private key to obtain second encrypted information; receive the second encrypted information returned by the device, decrypt the second encrypted information using the authentication public key to obtain a second random number; send the second random number to the device, the second random number instructing the device to compare the second random number with the first random number, and if the second random number and the first random number are the same, return a two-way authentication successful message to the host; if the second random number and the first random number are different, return a two-way authentication failed message to the host.
[0129] In one exemplary embodiment, such as Figure 7 As shown, an extended firmware loading device is provided, including: a key storage unit 701, wherein:
[0130] The key storage unit 701 is used to receive a decryption key acquisition request sent by the host through the decryption file of the loaded extended firmware during the host initialization phase; return the decryption key to the host based on the decryption key acquisition request, the decryption key is used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware; and load the plaintext of the extended firmware.
[0131] In some optional embodiments, the extended firmware further includes an authentication public key; the key storage unit is specifically used for: obtaining a decryption key based on a decryption key acquisition request; encrypting the decryption key with the authentication private key to obtain first encrypted information; and sending the first encrypted information to the host, wherein the first encrypted information is used to instruct the host to decrypt the first encrypted information with the authentication public key to obtain a decryption key.
[0132] In some alternative embodiments, the extended firmware further includes an authentication file; the apparatus further includes: an authentication unit, configured to receive a two-way authentication command sent by the host through the authentication file of the loaded extended firmware; perform two-way authentication based on the two-way authentication command and the authentication file; and, if the two-way authentication is successful, continue to execute the step of returning the decryption key to the host based on the decryption key acquisition request.
[0133] In some optional embodiments, the extended firmware further includes an authentication public key; the authentication unit is specifically used to generate a first random number and encrypt the first random number using the authentication private key to obtain second encrypted information; send the second encrypted information to the host, the second encrypted information being used to instruct the host to decrypt the second encrypted information using the authentication public key to obtain the second random number; receive the second random number sent by the host; compare the second random number with the first random number, and if the second random number and the first random number are the same, return a message indicating that the two-way authentication has passed to the host, otherwise return a message indicating that the two-way authentication has failed to the host.
[0134] In some alternative embodiments, the key storage unit is specifically used to return a message to the host rejecting the request to obtain the decryption key if the two-way authentication fails.
[0135] In some optional embodiments, the above apparatus further includes: an extended firmware generation module, specifically configured to: generate an authentication public key and an authentication private key using an asymmetric encryption algorithm; store the authentication public key in the extended firmware and the private key in the device; obtain the extended firmware plaintext based on the extended firmware; generate a third random number, and generate a decryption key and an encryption key based on the third random number; store the decryption key in the device; and encrypt the extended firmware plaintext using the encryption key to obtain the extended firmware ciphertext; configure an authentication file, a decryption file, and an encrypted data storage file for the extended firmware, wherein the authentication file is used for two-way authentication between the extended firmware and the host, and the decryption file is used to obtain the decryption key; and store the extended firmware ciphertext in the extended firmware encrypted data storage file.
[0136] Each module in the aforementioned extended firmware loading device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0137] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for loading extended firmware. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0138] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0139] In one exemplary embodiment, a chip is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the above embodiments.
[0140] In one exemplary embodiment, a network interface card is provided, including a chip as described in any of the above embodiments and multiple interfaces, through which the chip processes data or communicates externally.
[0141] In one embodiment, a computer device is also provided, including a processor and a chip as described in any of the above embodiments, wherein the chip is configured to schedule messages to the processor or to process them on its own, and the processor is configured to process messages scheduled by the chip.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0143] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0146] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0147] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for loading extended firmware, characterized in that, Applied to a host, the method includes: During the host initialization phase, the extended firmware in the device is loaded into the host memory. The extended firmware includes a decryption file and an encrypted data storage file. The decryption key is obtained from the device through the decryption file; The data stored in the encrypted data storage file is decrypted using the obtained decryption key to obtain the plaintext of the extended firmware; Load the plaintext of the extended firmware.
2. The method according to claim 1, characterized in that, The extended firmware also includes an authentication public key; obtaining the decryption key from the device through the decryption file includes: The device is sent a decryption key acquisition request through the decryption file. The decryption key acquisition request is used to obtain the decryption key and encrypt the decryption key with the authentication private key to obtain the first encrypted information. The device receives the first encrypted information sent by the device and decrypts the first encrypted information using the authentication public key to obtain the decryption key.
3. The method according to claim 1, characterized in that, The extended firmware also includes an authentication file; before obtaining the decryption key from the device through the decryption file, it further includes: Perform two-way authentication with the device using the authentication document; If the two-way authentication is successful, proceed to the step of obtaining the decryption key from the device through the decryption file.
4. The method according to claim 3, characterized in that, The extended firmware also includes an authentication public key; the step of performing two-way authentication with the device through the authentication file includes: The authentication file is used to send a start authentication command to the device. The start authentication command is used to instruct the device to generate a first random number and encrypt the first random number with the authentication private key to obtain a second encrypted information. Receive the second encrypted information returned by the device, and decrypt the second encrypted information using the authentication public key to obtain a second random number; The second random number is sent to the device, which instructs the device to compare the second random number with the first random number. If the second random number and the first random number are the same, the device returns a message indicating that the two-way authentication has passed to the host; if the second random number and the first random number are different, the device returns a message indicating that the two-way authentication has failed to pass to the host.
5. A method for loading extended firmware, characterized in that, Applied to a device, the extended firmware includes a decryption file and an encrypted data storage file; the method includes: During the host initialization phase, a decryption key acquisition request is received from the host via the decryption file of the loaded extended firmware; Based on the decryption key acquisition request, the decryption key is returned to the host. The decryption key is used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the extended firmware plaintext; and the extended firmware plaintext is loaded.
6. The method according to claim 5, characterized in that, The extended firmware also includes an authentication public key; The step of returning the decryption key to the host based on the decryption key acquisition request includes: Obtain the decryption key based on the decryption key acquisition request; The first encrypted information is obtained by encrypting the decryption key using the authentication private key; The first encrypted information is sent to the host, and the first encrypted information is used to instruct the host to decrypt the first encrypted information using the authentication public key to obtain the decryption key.
7. The method according to claim 5, characterized in that, The extended firmware also includes an authentication file; the method further includes: Receive a two-way authentication command sent by the host through the authentication file of the loaded extended firmware; Perform two-way authentication based on the two-way authentication command and the authentication file; If the two-way authentication is successful, continue with the step of returning the decryption key to the host based on the decryption key acquisition request.
8. The method according to claim 7, characterized in that, The extended firmware also includes an authentication public key; the two-way authentication based on the two-way authentication command and the authentication file includes: A first random number is generated, and the first random number is encrypted using the authentication private key to obtain the second encrypted information; The second encrypted information is sent to the host, and the second encrypted information is used to instruct the host to decrypt the second encrypted information using the authentication public key to obtain a second random number; Receive the second random number sent by the host; The second random number is compared with the first random number. If the second random number and the first random number are the same, the system returns a message indicating that the two-way authentication has passed to the host; otherwise, the system returns a message indicating that the two-way authentication has failed to the host.
9. The method according to claim 7, characterized in that, The method further includes: If the two-way authentication fails, a message is returned to the host rejecting the request to obtain the decryption key.
10. The method according to any one of claims 5 to 9, characterized in that, The extended firmware is generated in the following ways: An authentication public key and an authentication private key are generated using an asymmetric encryption algorithm. The authentication public key is stored in the extended firmware, and the private key is stored in the device. The plaintext of the extended firmware is obtained based on the extended firmware; A third random number is generated, and a decryption key and an encryption key are generated based on the third random number. The decryption key is stored in the device, and the plaintext of the extended firmware is encrypted using the encryption key to obtain the ciphertext of the extended firmware. Configure an authentication file, a decryption file, and an encrypted data storage file for the extended firmware. The authentication file is used for two-way authentication between the extended firmware and the host, and the decryption file is used to obtain the decryption key. The extended firmware ciphertext is stored in the encrypted data storage file of the extended firmware.
11. A device for loading extended firmware, characterized in that, Applied to a host computer, the device includes: An initialization module is used to load extended firmware from the device into the host memory during the host initialization phase. The extended firmware includes a decryption file and an encrypted data storage file. A decryption key acquisition module is used to obtain a decryption key from the device through the decryption file; The extended firmware plaintext acquisition module is used to decrypt the data stored in the encrypted data storage file using the acquired decryption key to obtain the extended firmware plaintext. A loading module is used to load the plaintext of the extended firmware.
12. A device for loading extended firmware, characterized in that, Applied to a device, the extended firmware includes decryption files and encrypted data storage files; the device includes: A key storage unit is configured to, during the host initialization phase, receive a decryption key acquisition request sent by the host through the decryption file of the loaded extended firmware; return a decryption key to the host based on the decryption key acquisition request, the decryption key being used to instruct the host to decrypt the data stored in the encrypted data storage file to obtain the plaintext of the extended firmware; and load the plaintext of the extended firmware.
13. A chip comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 5 to 10.
14. A network interface card, characterized in that, It includes the chip as described in claim 13 and multiple interfaces, through which the chip communicates externally.
15. A computer device, characterized in that, It includes a processor and a chip as described in claim 13, wherein the chip is configured to schedule a message to the processor or to process the message itself, and the processor is configured to process the message scheduled by the chip.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.