A method for signing and verifying ELF files on RISC-V system
By generating and managing private keys and public keys in the RISC-V system, ELF file signature and verification are performed, and system calls are intercepted with kprobes and ftrace technologies, the security and performance problems of ELF file signature verification in the RISC-V system in the prior art are solved, and higher security and efficiency are achieved.
Patent Information
- Application Number
- CN202411776629.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The prior art ELF file signature verification method in RISC-V system has insufficient security, lack of credibility verification mechanism, performance and efficiency problems, and cannot effectively prevent ELF file tampering and malicious code injection, and lacks strict verification of file integrity and source.
A method for signing an ELF file on a RISC-V system is proposed, including generating a private key and a public key file, determining whether the ELF file has been signed, and signing or re-signing according to user selection. After the signature is completed, convert the public key to the format supported by the kernel key ring and save it. At the same time, the sys_execve system call is parsed through kprobes and ftrace technology, intercepting and verifying the signature of the ELF file.
It significantly improves the security of ELF files in the RISC-V system, prevents the execution of unauthorized codes, guarantees the security of the system and data integrity, and provides automated methods for private and public key management, file signature detection and signature status decision-making.
Smart Images

Figure CN119249509B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and specifically provides an ELF file signature and verification method on a RISC-V system. Background Art
[0002] As an open standard instruction set architecture, RISC-V architecture has made significant progress in the field of computer architecture. From embedded systems to high-performance computing, the flexibility and customizability of RISC-V make it an ideal choice for a variety of application scenarios. However, with the widespread application of RISC-V in various fields in my country, it has become crucial to ensure the security and credibility of RISC-V systems. Among them, signing and verifying RISC-V executable files (ELF files) to ensure the integrity and source of the files has become a key task.
[0003] Although RISC-V has attracted many manufacturers to join, it is still in its infancy and various technologies are not yet mature. Existing signature verification tools still have the following problems when processing RISC-V ELF files:
[0004] ① Traditional signature verification methods are not applicable to RISC-V architecture: Traditional ELF file signing and verification methods are usually based on non-RISC-V architectures and standards, such as X86. These methods do not fully consider the special requirements and architectural differences of RISC-V, so compatibility and performance issues may occur when running on RISC-V systems.
[0005] ② Insufficient security: Due to the openness and customizability of RISC-V, the architecture has more security threats and vulnerability risks. Existing technologies fail to provide sufficient security protection and cannot effectively prevent potential problems such as ELF file tampering and malicious code injection.
[0006] ③ Lack of credibility verification mechanism: It is crucial to ensure that the source of ELF files in RISC-V systems is credible, but traditional methods do not provide sufficient credibility verification mechanisms and lack strict verification of file integrity and source.
[0007] ④Performance and efficiency issues: Existing ELF file signing and verification methods may introduce additional performance consumption on RISC-V systems, affecting the operating efficiency of the system, resulting in a large amount of computing resources and time required to complete the verification process, reducing system performance.
[0008] Therefore, there is no stable and reliable tool available for signing and verifying ELF files. Summary of the invention
[0009] In order to overcome the above defects, the present invention is proposed to solve the technical problems of insufficient security, lack of credibility verification mechanism, performance and efficiency in the existing ELF file signature verification method in RISC-V system.
[0010] In a first aspect, the present invention proposes an ELF file signing method on a RISC-V system, the signing method comprising the following steps performed in sequence:
[0011] Get the ELF file to be signed, extract the ELF file name through the absolute path of the ELF file, and generate the corresponding private key file name and public key file name according to the ELF file name, create a private key file and a public key file in the specified path respectively, name the private key file according to the private key file name, and name the public key file according to the public key file name;
[0012] Read the 8 bytes at the end of the ELF file to determine whether the ELF file has been signed;
[0013] When the ELF file is not signed, the ELF file is signed; when the ELF file is signed, the user is prompted that the ELF file is signed and an instruction selected by the user whether to re-sign is obtained. If a re-sign instruction is obtained, the original signature is deleted and the ELF file is signed. If a non-re-sign instruction is obtained, the process ends;
[0014] Sign the ELF file;
[0015] Convert the public key file to a format supported by the kernel keyring and save it to the kernel keyring.
[0016] Further, the reading of 8 bytes of data at the end of the ELF file to determine whether the ELF file has been signed includes the following steps performed in sequence:
[0017] Read the last 8 bytes of data from the ELF file and convert them into an integer;
[0018] Compare the converted integer value with 256. If they are equal, the ELF file is signed, otherwise the ELF file is unsigned.
[0019] Further, the ELF file is signed including the following steps performed in sequence:
[0020] Create an EVP_PKEY_CTX context and an EVP_PKEY structure, generate an RSA private key and an RSA public key based on the EVP_PKEY_CTX context, and store them in the EVP_PKEY structure;
[0021] The RSA private key is written into the above private key file through the PEM_write_PrivateKey function, and the RSA public key is written into the above public key file through the PEM_write_PUBKEY function;
[0022] Read the ELF file data into the allocated memory, use the SHA256 function to perform SHA-256 hash calculation on the read ELF file data, and store the calculated hash data in a temporary array;
[0023] Get the RSA private key and sign the hash data in the temporary array according to the RSA private key;
[0024] Append the digital signature to the end of the ELF file and write the signature length data of 8 bytes to the end of the ELF file to complete the signature.
[0025] Further, the generation of an RSA private key and an RSA public key according to the EVP_PKEY_CTX context includes the following steps performed in sequence:
[0026] Use the EVP_PKEY_keygen_init function to initialize the EVP_PKEY_CTX context;
[0027] The EVP_PKEY_keygen function is used to generate an RSA key pair, where the RSA key pair includes an RSA private key and an RSA public key.
[0028] Further, the obtaining of the RSA private key and signing the hash data in the temporary array according to the RSA private key includes the following steps performed in sequence:
[0029] Open the private key file, use the PEM_read_PrivateKey function to obtain the RSA private key and store it in a temporary variable pKey, and use the temporary variable pKey to initialize the EVP_MD_CTXEVP related structure context;
[0030] Through the EVP_DigestSign function, pass in the NULL temporary variable sig as the signature buffer parameter, obtain the length of the digital signature, and allocate memory space for the signature buffer according to the length of the digital signature;
[0031] Through the EVP_DigestSign function, pass in a non-NULL temporary variable sig as the signature buffer parameter, sign the hash data in the temporary array, and store the signature result in the signature buffer pointed to by the temporary variable sig.
[0032] In a second aspect, the present invention proposes an ELF file verification method on a RISC-V system, which is used after the signing method. The verification method includes the following steps performed in sequence:
[0033] Use kprobes technology to parse the sys_execve system call address, and use ftrace technology to hook the sys_execve system call to the custom hooked_sys_execve function;
[0034] When there is an ELF file to be verified, it enters the hooked_sys_execve function;
[0035] Get the first parameter of the system call from the a0 register of RISC-V, which is the ELF file to be verified, and convert the a0 address into a character pointer;
[0036] Get the absolute path of the ELF file to be verified through the character pointer, extract the ELF file name from it, and get the public key file name based on the ELF file name;
[0037] Find the corresponding RSA public key in the kernel key manager according to the public key file name.
[0038] If the RSA public key is found, the ELF file will be verified. If the verification is successful, the ELF file will continue to be executed. If the verification fails, the system will prompt that the verification failed and end.
[0039] If the RSA public key is not found, a message will be displayed indicating that it is not found and the ELF file will continue to be executed.
[0040] Further, the ELF file is verified, comprising the following steps performed in sequence:
[0041] Get signature data from the ELF file to be verified;
[0042] Select the SHA256 hash algorithm for corresponding initialization, use crypto_ahash_digest to calculate the hash value and save it;
[0043] Get the corresponding public key from the kernel keyring through the keyring_search function;
[0044] Initialize the public_key_signature structure, fill in the structure elements key, hash value, and signature data information, and use the obtained RSA public key as the public_key_verify_signature function parameter for signature verification.
[0045] Working principle and beneficial effects of the present invention:
[0046] In the technical solution of the present invention, a key pair corresponding to an ELF file is first automatically generated, and then the signature status of the ELF file is detected, providing the user with the option of re-signing or retaining the original signature. For files that need to be signed, RSA encryption and SHA-256 hash calculation are implemented through OpenSSL, the signature result is attached to the end of the file, and the signature length is stored for verification. After the signature is completed, the public key is converted and stored in the kernel key ring for verification and use. Before the ELF file is executed, the system intercepts and verifies the validity of the signature through the kernel module to ensure that only verified files are executed. Through automated private and public key management, file signature detection, signature status decision, and key ring integration methods, a secure signature and verification process is provided for ELF files. The present invention significantly improves the security of ELF files in RISC-V systems by comprehensively using key management, signature verification, and system call interception technologies, prevents the execution of unauthorized code, and ensures the security of the system and the integrity of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:
[0048] Figure 1 It is a schematic diagram of the overall process of an ELF file signing method on a RISC-V system of the present invention;
[0049] Figure 2 It is a schematic diagram of the signing steps in an ELF file signing method on a RISC-V system of the present invention;
[0050] Figure 3 It is a schematic diagram of the overall process of an ELF file verification method on a RISC-V system of the present invention;
[0051] Figure 4 It is a schematic diagram of verification steps in an ELF file verification method on a RISC-V system of the present invention. DETAILED DESCRIPTION
[0052] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0053] The ELF file signature and verification method on the RISC-V system in the present invention is divided into two parts, the first part is the execution process of the signature module, and the second part is the execution process of the verification module. Both modules are designed for the RISC-V architecture and run independently. The function interfaces used in the modules are all applicable to the RISC-V platform. Example 1
[0054] The main function of the signature module is to sign the ELF file in the RISC-V system. It accepts unsigned ELF files as input, performs signature operations, and outputs signed ELF files. This process ensures the integrity of the file and the verifiability of its source.
[0055] Figure 1 This is a schematic diagram of the overall process of an ELF file signing method on a RISC-V system of the present invention. Figure 1 As shown, the signing method in this embodiment includes the following steps:
[0056] 1.1 Get the ELF file that needs to be signed, extract the ELF file name through the absolute path of the ELF file, and generate the corresponding private key file name and public key file name according to the ELF file name, create a private key file and a public key file in the specified path respectively, and name them according to the generated private key file name and public key file name respectively.
[0057] 1.2 Read the 8 bytes at the end of the ELF file to determine whether the ELF file has been signed.
[0058] The 8 bytes at the end of the ELF file represent the signature length. The signature length of the ELF file signed with the RSA256 algorithm is fixed to 256. That is, by reading the last 8 bytes of the ELF file and converting them into a decimal number, the converted decimal number is compared with 256. If they are equal, the ELF file is signed, otherwise it is unsigned.
[0059] 1.3 When the ELF file is not signed, directly execute step 1.4 to sign it; when the ELF file is signed, prompt the user that the ELF file is signed, and obtain the user's selected instruction on whether to re-sign. If the re-sign instruction is obtained, the original signature will be deleted and then step 1.4 will be executed to re-sign. If the instruction not to re-sign is obtained, the process ends.
[0060] 1.4 Based on the RISC-V architecture and openKylin system, the ELF file is signed by executing the following 1.4.1-1.4.5 steps. The signing process uses the functions in the OpenSSL library. Figure 2 This is a schematic diagram of the signing steps in the ELF file signing method on the RISC-V system of the present invention. Figure 2 As shown, the signing process in this embodiment specifically includes the following steps:
[0061] 1.4.1 Create an EVP_PKEY_CTX context and an EVP_PKEY structure, generate an RSA private key and an RSA public key based on the EVP_PKEY_CTX context, and store them in the EVP_PKEY structure.
[0062] Specifically, create an EVP_PKEY_CTX context and an EVP_PKEY structure, use the EVP_PKEY_keygen_init function to initialize the EVP_PKEY_CTX context, and then use the EVP_PKEY_keygen function to generate an RSA key pair, which includes an RSA private key and an RSA public key. The initialized EVP_PKEY_CTX context provides EVP_PKEY_keygen with necessary configuration and control information such as key generation type and key length, and uses the EVP_PKEY structure to store the generated RSA private key and RSA public key. The length of the RSA key pair is set to 2048 bits to provide a certain degree of security.
[0063] 1.4.2 After storage is completed, the RSA private key is written into the above private key file through the PEM_write_PrivateKey function, and the RSA public key is written into the above public key file through the PEM_write_PUBKEY function.
[0064] 1.4.3 Read the ELF file data into the allocated memory, use the SHA256 function to perform SHA-256 hash calculation on the read ELF file data, and store the calculated hash data in a temporary array.
[0065] 1.4.4 Get the RSA private key and sign the hash data in the temporary array.
[0066] Specifically, open the above private key file, use the PEM_read_PrivateKey function to obtain the RSA private key and store it in the temporary variable pKey, use the temporary variable pKey to initialize the EVP_MD_CTXEVP related structure context; through the EVP_DigestSign function, pass in the NULL temporary variable sig as the signature buffer parameter, obtain the length of the digital signature, and allocate memory space for the signature buffer according to the length of the digital signature; through the EVP_DigestSign function, pass in the non-NULL temporary variable sig as the signature buffer parameter, sign the hash data in the temporary array, and the signature result, that is, the digital signature, is stored in the signature buffer pointed to by the temporary variable sig.
[0067] In this embodiment, EVP_MD_CTX is a structure context used for digest and signature operations in OpenSSL, which contains all the state information required to perform these operations. The EVP_DigestSign function is a function used to generate a digital signature, which relies on the EVP_MD_CTX related structure context to store and operate the state and temporary data required in the signing process. Before calling the EVP_DigestSign function, you must first initialize an EVP_MD_CTX instance, and then call the EVP_DigestSign function and pass in the EVP_MD_CTX instance as a parameter. The function will use the state and digest algorithm stored in EVP_MD_CTX to generate a signature.
[0068] 1.4.5 Append the digital signature (i.e. the hash data after signing) obtained in the process of 1.4.4 to the end of the ELF file, and write the 8-byte signature length data corresponding to the digital signature length to the end of the ELF file to complete the signing.
[0069] Open the ELF file in append mode and append the digital signature to the end of the ELF file. Use the fwrite function to write the digital signature data (sig) to the ELF file. At the same time, the length of the signature (sig_len) is also written to the end of the file so that the length of the signature data is known when verifying the signature. Finally, release the resources to end the signature.
[0070] In one implementation, because the uint64_t type is used in the C language code to store the signature length, the uint64_t type itself occupies 8 bytes of space, and this value can be directly written to the end of the file using fwrite.
[0071] 1.5 Extract the public key from the public key file and convert it into a format supported by the kernel keyring and save it in the kernel keyring.
[0072] After signing, the generated public key file needs to be formatted and converted into a format acceptable to the kernel key ring, and the format-converted public key is saved to the kernel key ring through the keyctl command for use by subsequent verification modules. When saving, a public key name can be specified as the identifier of the public key. In this invention, the public key name is extracted from the public key file name as an identifier. Example 2
[0073] The main function of the verification module is to verify the ELF files signed by the above signature module in the RISC-V system. The legitimacy of the ELF file is confirmed by verifying the accuracy of the signature, ensuring that only ELF files that have passed the verification will be accepted and executed, thereby enhancing the security of the system.
[0074] Figure 3 This is a schematic diagram of the overall process of an ELF file verification method on a RISC-V system of the present invention. Figure 3 As shown, the process of executing the signature by the verification module in this embodiment includes the following steps:
[0075] 2.1 Use kprobes technology to parse the sys_execve system call address, and use ftrace technology to hook the sys_execve system call to the custom hooked_sys_execve function. When there is an ELF file to be verified, enter the hooked_sys_execve function and verify the ELF file signature in this function.
[0076] In this embodiment, the verification module is compiled into a kernel driver, complies with the GPL agreement, and uses the hook_init function defined by the module_init macro to initialize the verification module. In the initialization function, the kprobes technology is used to register the kprobe using register_kprobe to parse the sys_execve system call address; the ftrace technology is used to hook the sys_execve system call to the custom hooked_sys_execve function. Among them, sys_execve is a "system call" of the Linux system, which is only for the RISC-V architecture and has different names for different architectures. "hooked_sys_execve" is a custom function, the name can be customized and is not limited by the CPU architecture.
[0077] 2.2 Get the first parameter of the system call from the a0 register of RISC-V as the ELF file to be verified, and convert the a0 address into a character pointer so that the kernel can access the user space memory;
[0078] Through the a0 field in the struct pt_regs *regs structure of the hooked_sys_execve function parameter, that is, the a0 register of RISC-V, the first parameter of the system call, that is, the ELF file to be verified, is obtained, and the a0 address is converted into a character pointer so that the user space memory can be accessed in the kernel.
[0079] 2.3 Get the absolute path of the ELF file to be verified through the character pointer, extract the ELF file name from it, and get the public key file name based on the ELF file name. Because when signing the ELF file, the public key file name and private key file name are generated based on the ELF file name, so the same method is used here to get the public key file name.
[0080] 2.4 Search for the corresponding RSA public key in the kernel key manager according to the public key name. If the RSA public key is found, execute step 2.5 to verify the ELF file. If the verification is successful, continue to execute the ELF file. If the verification fails, it will prompt that the verification failed and end. If the RSA public key is not found, it will prompt that it is not found, indicating that the file does not need to be verified, and then continue to execute the ELF file.
[0081] 2.5 Based on the RISC-V architecture and openKylin system, perform signature verification on the ELF file by executing the following steps 2.5.1-2.5.5. The signature verification is implemented in the kernel space by calling the Linux Crypto API. Figure 4 Schematic diagram of verification steps in an ELF file verification method on a RISC-V system of the present invention. Figure 4 As shown, the verification process in this embodiment specifically includes the following steps:
[0082] 2.5.1 Get the signature data from the ELF file to be verified.
[0083] 2.5.2 Get the ELF file data, specify the SHA256 hash algorithm, use the crypto_ahash_digest function to hash the ELF file data, and save the hash value.
[0084] 2.5.3 Get the corresponding public key from the kernel keyring through the keyring_search function.
[0085] 2.5.4 Initialize the public_key_signature structure, fill in the structure elements key, hash value, signature data and other information, and use the obtained RSA public key as the public_key_verify_signature function parameter for signature verification.
[0086] Based on the above-mentioned signature method and verification method, a key pair corresponding to the ELF file is first automatically generated, and then the signature status of the ELF file is detected, providing the user with the option of re-signing or retaining the original signature. For files that need to be signed, RSA encryption and SHA-256 hash calculation are implemented through OpenSSL, the signature result is attached to the end of the file, and the signature length is stored for verification. After the signature is completed, the public key is converted and stored in the kernel key ring for verification and use. Before the ELF file is executed, the system intercepts and verifies the validity of the signature through the kernel module to ensure that only verified files are executed. Through automated private and public key management, file signature detection, signature status decision, and key ring integrated methods, a secure signature and verification process is provided for ELF files. The present invention significantly improves the security of ELF files in RISC-V systems by comprehensively using key management, signature verification and system call interception technology, prevents the execution of unauthorized code, and ensures the security of the system and the integrity of data.
[0087] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order, and they can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0088] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for signing an ELF file on a RISC-V system, characterized in that: The signing method comprises the following steps which are performed in sequence: Get the ELF file to be signed, extract the ELF file name through the absolute path of the ELF file, and generate the corresponding private key file name and public key file name according to the ELF file name, create a private key file and a public key file in the specified path respectively, name the private key file according to the private key file name, and name the public key file according to the public key file name; Read the 8 bytes at the end of the ELF file to determine whether the ELF file has been signed; When the ELF file is not signed, the ELF file is signed; when the ELF file is signed, the user is prompted that the ELF file is signed and an instruction selected by the user whether to re-sign is obtained. If a re-sign instruction is obtained, the original signature is deleted and the ELF file is signed. If a non-re-sign instruction is obtained, the process ends; Sign the ELF file; Convert the public key file into a format supported by the kernel keyring and save it in the kernel keyring; The ELF file signing process includes the following steps: Create an EVP_PKEY_CTX context and an EVP_PKEY structure, generate an RSA private key and an RSA public key based on the EVP_PKEY_CTX context, and store them in the EVP_PKEY structure; The RSA private key is written into the above private key file through the PEM_write_PrivateKey function, and the RSA public key is written into the above public key file through the PEM_write_PUBKEY function; Read the ELF file data into the allocated memory, use the SHA256 function to perform SHA-256 hash calculation on the read ELF file data, and store the calculated hash data in a temporary array; Get the RSA private key and sign the hash data in the temporary array according to the RSA private key; Append the digital signature to the end of the ELF file and write the signature length data of 8 bytes to the end of the ELF file to complete the signature.
2. A method for signing an ELF file on a RISC-V system according to claim 1, characterized in that: The process of reading the 8 bytes of data at the end of the ELF file and determining whether the ELF file has been signed includes the following steps performed in sequence: Read the last 8 bytes of data from the ELF file and convert them into an integer; Compare the converted integer value with 256. If they are equal, the ELF file is signed, otherwise the ELF file is unsigned.
3. A method for signing an ELF file on a RISC-V system according to claim 1, characterized in that: The generation of the RSA private key and the RSA public key according to the EVP_PKEY_CTX context includes the following steps performed in sequence: Use the EVP_PKEY_keygen_init function to initialize the EVP_PKEY_CTX context; The EVP_PKEY_keygen function is used to generate an RSA key pair, where the RSA key pair includes an RSA private key and an RSA public key.
4. The ELF file signing method on a RISC-V system according to claim 1, characterized in that: The method of obtaining the RSA private key and signing the hash data in the temporary array according to the RSA private key includes the following steps performed in sequence: Open the private key file, use the PEM_read_PrivateKey function to obtain the RSA private key and store it in a temporary variable pKey, and use the temporary variable pKey to initialize the EVP_MD_CTXEVP related structure context; Through the EVP_DigestSign function, pass in the NULL temporary variable sig as the signature buffer parameter, obtain the length of the digital signature, and allocate memory space for the signature buffer according to the length of the digital signature; Through the EVP_DigestSign function, pass in a non-NULL temporary variable sig as the signature buffer parameter, sign the hash data in the temporary array, and store the signature result in the signature buffer pointed to by the temporary variable sig.
5. An ELF file verification method on a RISC-V system, the verification method is used after the signing method as described in any one of claims 1 to 4, characterized in that: The verification method comprises the following steps performed in sequence: Use kprobes technology to parse the sys_execve system call address, and use ftrace technology to hook the sys_execve system call to the custom hooked_sys_execve function; When there is an ELF file to be verified, it enters the hooked_sys_execve function; Get the first parameter of the system call from the a0 register of RISC-V, which is the ELF file to be verified, and convert the a0 address into a character pointer; Get the absolute path of the ELF file to be verified through the character pointer, extract the ELF file name from it, and get the public key file name based on the ELF file name; Find the corresponding RSA public key in the kernel key manager according to the public key file name. If the RSA public key is found, the ELF file will be verified. If the verification is successful, the ELF file will continue to be executed. If the verification fails, the system will prompt that the verification failed and end. If the RSA public key is not found, a message will be displayed indicating that it is not found and the ELF file will continue to be executed.
6. A method for verifying an ELF file on a RISC-V system according to claim 5, characterized in that: The verification of the ELF file comprises the following steps which are performed in sequence: Get signature data from the ELF file to be verified; Select the SHA256 hash algorithm for corresponding initialization, use crypto_ahash_digest to calculate the hash value and save it; Get the corresponding public key from the kernel keyring through the keyring_search function; Initialize the public_key_signature structure, fill in the structure elements key, hash value, and signature data information, and use the obtained RSA public key as the public_key_verify_signature function parameter for signature verification.
Citation Information
Patent Citations
Linux-based ELF file data integrity protection method
CN113971297A