A TEE trusted authentication method, device, equipment and medium
By generating the target TEE in the TEE container and performing trusted authentication, the problem that the prior art cannot achieve task-oriented TEE trusted authentication is solved, and trusted verification of the TEE of the associated task is realized, and trusted credentials are enhanced. relevance and reliability of verification.
Patent Information
- Application Number
- CN202211295634.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-10-21
AI Technical Summary
The prior art cannot implement task-oriented TEE trusted authentication, and cannot perform trusted verification of TEEs associated with tasks.
The target task is issued to the host agent through the privacy computing platform. The host agent generates the target TEE in the TEE container and sends a first authentication request uniquely identified by the target TEE to the TEE container. The target TEE's TEE agent obtains the authentication request, generates a metric report, and sends the metric report and unique identifier to the authentication module for remote verification. After the authentication module is passed, the trusted credentials are obtained based on the unique identification and the authentication private key, and the authenticity of the trusted credentials is verified through the authentication public key.
The task-oriented TEE trusted authentication is realized, which enhances the correlation between trusted credentials and target TEEs, and improves the reliability of trusted verification.
Smart Images

Figure CN115664655B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a TEE trusted authentication method, device, equipment and medium. Background Art
[0002] At present, with the rise of privacy computing technology, privacy computing platforms based on related technologies have been proposed one after another. Specifically, it includes multi-party secure computing, homomorphic encryption, trusted execution environment (TEE), federated learning and other technologies. However, when building a privacy computing platform based on TEE, the first task is to complete the trusted authentication of TEE, which is initiated by the initiating verification end to the remote task execution end, and the task execution end proves to the initiating verification end that the task execution end has not been changed compared to the target verification environment. The verified end is a trusted execution environment, and the verification passes, indicating the security of the computing environment and the integrity of the running code.
[0003] The existing system only relies on the API (Application Program Interface) of third-party manufacturers to complete the remote authentication of TEE, that is, the verification of the certificate chain. With the rise of privacy computing technology, it is necessary to build a privacy computing platform based on TEE technology and place tasks in TEE for execution to ensure that code and data are not leaked. To know whether TEE has the ability to ensure that code and data are not leaked, it is necessary to complete remote authentication when TEE is started. However, this traditional verification method cannot achieve task-oriented TEE trusted authentication (that is, trusted verification of TEE associated tasks).
[0004] To sum up, how to achieve task-oriented TEE trusted authentication is a problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a TEE trusted authentication method, device, equipment and medium, which can realize task-oriented TEE trusted authentication. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a TEE trusted authentication method, which is applied to a TEE trusted authentication system. The TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container, and an authentication module. The method includes:
[0007] Sending the target task to the host agent through the privacy computing platform;
[0008] Generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container;
[0009] Obtaining the first authentication request through the TEE agent of the target TEE, generating a measurement report of the target TEE, and then sending a second authentication request including the measurement report and the unique identifier to the authentication module;
[0010] Obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the unique identifier and the authentication private key;
[0011] The host agent obtains the target information sent by the authentication module to the TEE agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifies the trusted credential using the authentication public key and the unique identifier. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module.
[0012] Optionally, generating a target TEE corresponding to the target task in the TEE container by the host agent, and sending a first authentication request including a unique identifier of the target TEE to the TEE container, includes:
[0013] Generate a target TEE corresponding to the target task in the TEE container through the host agent, and obtain the TEE address of the target TEE sent by the TEE agent of the target TEE; the TEE address includes a TEE IP address and a TEEMAC address;
[0014] The host agent generates a unique identifier of the target TEE based on the TEE address, and sends a first authentication request including the unique identifier of the target TEE to the TEE agent of the target TEE.
[0015] Optionally, generating a measurement report of the target TEE and then sending a second authentication request including the measurement report and the unique identifier to the authentication module includes:
[0016] Generate a target public-private key pair and a measurement report for the target TEE, and then send a second authentication request including the target public key, the measurement report and the unique identifier to the authentication module; the target public-private key pair is an SM2 public-private key pair;
[0017] Correspondingly, obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and obtaining a trusted credential based on the unique identifier and the authentication private key after the verification is passed, includes:
[0018] Obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the target public key, the unique identifier and the authentication private key;
[0019] Correspondingly, the obtaining, through the host agent, target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and querying the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifying the trusted credential using the authentication public key and the unique identifier, includes:
[0020] The host agent obtains the target public key sent by the TEE agent and the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifies the trusted credential using the target public key, the authentication public key and the unique identifier.
[0021] Optionally, the acquiring of a trusted credential based on the target public key, the unique identifier, and the authentication private key includes:
[0022] A first hash value corresponding to the target public key and the unique identifier is calculated, and the first hash value is signed with an authentication private key to obtain a signature value, and the signature value is used as a trusted credential.
[0023] Optionally, the verifying the trusted credential by using the authentication public key and the unique identifier includes:
[0024] Using the authentication public key to verify the signature of the trusted certificate to obtain the first hash value;
[0025] A second hash value corresponding to the target public key and the unique identifier is calculated. If the first hash value is consistent with the second hash value, the verification is successful.
[0026] Optionally, calculating a first hash value corresponding to the target public key and the unique identifier includes:
[0027] The SM3 algorithm is used to calculate a first hash value corresponding to the target public key and the unique identifier.
[0028] Optionally, after obtaining the trusted credential based on the unique identifier and the authentication private key, the method further includes:
[0029] The trusted credential is stored in a physical machine, and an association relationship between the trusted credential and the unique identifier is established.
[0030] In a second aspect, the present application discloses a TEE trusted authentication device, which is applied to a TEE trusted authentication system. The TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container, and an authentication module. The device includes:
[0031] A task delivery module, used to deliver the target task to the host agent through the privacy computing platform;
[0032] A first authentication request sending module, configured to generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container;
[0033] A second authentication request sending module, used to obtain the first authentication request through the TEE agent of the target TEE, generate a measurement report of the target TEE, and then send a second authentication request including the measurement report and the unique identifier to the authentication module;
[0034] A trusted credential acquisition module, used to acquire the second authentication request through the authentication module, then remotely verify the measurement report, and after the verification is passed, acquire the trusted credential based on the unique identifier and the authentication private key;
[0035] A trusted verification module is used to obtain, through the host agent, the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and query the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verify the trusted credential using the authentication public key and the unique identifier. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module.
[0036] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the aforementioned TEE trusted authentication method disclosed above is implemented.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed TEE trusted authentication method is implemented.
[0038] It can be seen that the present application sends the target task to the host agent through the privacy computing platform; generates the target TEE corresponding to the target task in the TEE container through the host agent, and sends a first authentication request including the unique identifier of the target TEE to the TEE container; obtains the first authentication request through the TEE agent of the target TEE, generates a measurement report of the target TEE, and then sends a second authentication request including the measurement report and the unique identifier to the authentication module; obtains the second authentication request through the authentication module, and then remotely verifies the measurement report, and after the verification passes, obtains the trusted credential based on the unique identifier and the authentication private key; obtains the target information sent by the TEE agent to the TEE agent by the host agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then uses the authentication public key and the unique identifier to verify the trusted credential. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module. It can be seen that this application creates a target TEE for each target task and performs trusted verification on the target TEE to achieve trusted verification of TEE-associated tasks in practice, that is, to achieve task-oriented trusted verification of TEE; this application builds a trusted credential based on the unique identifier of the target TEE, which is conducive to enhancing the association between the trusted credential and the target TEE; in this application, if the authentication public key verification fails, it means that the trusted credential is counterfeit, so the authentication public key and authentication private key can be used to find the counterfeit trusted credential, further enhancing the reliability of trusted verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0040] Figure 1 A flow chart of a TEE trusted authentication method provided for this application;
[0041] Figure 2 A specific TEE trusted authentication method flow chart provided for this application;
[0042] Figure 3 A flow chart of a TEE trusted authentication method provided for this application;
[0043] Figure 4A schematic diagram of the structure of a TEE trusted authentication method device provided for this application;
[0044] Figure 5 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] At present, with the rise of privacy computing technology, privacy computing platforms based on related technologies have been proposed one after another. Specifically, it includes technologies such as multi-party secure computing, homomorphic encryption, trusted execution environment (TEE), and federated learning. However, when building a privacy computing platform based on TEE, the first task is to complete the trusted authentication of TEE, which is initiated by the initiating verification end to the remote task execution end, and the task execution end proves to the initiating verification end that the task execution end has not been changed compared to the target verification environment. The verified end is a trusted execution environment, and the verification passes, indicating the security of the computing environment and the integrity of the running code. In general, a remote vendor's server is required for auxiliary verification. However, the existing system only relies on the API of a third-party vendor to complete the remote authentication of TEE. This traditional verification method cannot achieve task-oriented TEE trusted authentication (that is, trusted verification of the TEE of the associated task).
[0047] In order to overcome the above problems, this application provides a TEE trusted authentication solution that can implement task-oriented TEE trusted authentication.
[0048] See also Figure 1 As shown, the embodiment of the present application discloses a TEE trusted authentication method, which is applied to a TEE trusted authentication system. The TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container and an authentication module. The method includes:
[0049] Step S11: Send the target task to the host agent through the privacy computing platform.
[0050] In the embodiment of the present application, the TEE trusted authentication system is divided into four components: a privacy computing platform, a host agent, a TEE container, and an authentication module. The privacy computing platform is responsible for data scheduling and authorization, task scheduling, and business logic management between various participants. The host agent is software deployed on a host with hardware TEE features to assist the privacy computing platform in completing task scheduling, execution, and result return. The TEE in the TEE container is a technology that deploys three technologies (memory encryption, run isolation, and trusted startup) on the CPU (central processing unit) hardware to build a secure execution area that is a black box to all attackers outside the area. The authentication module will initiate a random number challenge to the TEE to complete the remote authentication and trusted authentication process.
[0051] Step S12: Generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container.
[0052] In an embodiment of the present application, the target TEE corresponding to the target task is generated in the TEE container by the host agent, and a first authentication request including a unique identifier of the target TEE is sent to the TEE container, including: generating the target TEE corresponding to the target task in the TEE container by the host agent, and obtaining the TEE address of the target TEE sent by the TEE agent of the target TEE; the TEE address includes a TEE IP address and a TEE MAC address; generating a unique identifier of the target TEE based on the TEE address by the host agent, and sending a first authentication request including the unique identifier of the target TEE to the TEE agent of the target TEE.
[0053] It should be pointed out that this system stipulates that each TEE has a 256-bit unique ID (Identity document) identifier (unique identifier). Therefore, after generating the target TEE corresponding to the target task, it is also necessary to generate the unique identifier of the target TEE based on the TEE address through the host agent.
[0054] It should be pointed out that after receiving the message, the host agent will store the TEE's IP (Internet Protocol) in the physical machine according to the MAC (Media Access Control) address.
[0055] Step S13: Obtain the first authentication request through the TEE agent of the target TEE, generate a measurement report of the target TEE, and then send a second authentication request including the measurement report and the unique identifier to the authentication module.
[0056] In an embodiment of the present application, the first authentication request is obtained through the TEE agent of the target TEE, and a measurement report of the target TEE, that is, a local report, is generated, and then a second authentication request including the measurement report and the unique identifier is sent to the authentication module (CA module).
[0057] Step S14: obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the unique identifier and the authentication private key.
[0058] In an embodiment of the present application, the specific steps of remotely verifying the measurement report are: requesting the TEE manufacturer's remote verification server to download the root certificate, and then completing the verification of the certificate chain in the local report.
[0059] In the embodiment of the present application, the obtaining of the trusted credential based on the unique identifier and the authentication private key includes: calculating the first hash value corresponding to the unique identifier, and signing the first hash value with the authentication private key to obtain a signature value, and using the signature value as the trusted credential. The authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module. It should be pointed out that the national secret algorithm is a set of data encryption processing algorithms independently developed and innovated by my country. From SM1 to SM4, symmetric, asymmetric, hashing and other algorithm functions are realized respectively. At the end of 2010, the State Cryptography Administration announced the public key cryptography algorithm SM2 based on elliptic curves. At present, the algorithm has been made public and is used to replace international algorithms such as RSA / DH / ECDSA / ECDH. At the same time, since the algorithm is based on ECC (Error Correcting Code, error correction code), the key generation speed and security strength are higher than RSA of the same level. At the same time, the algorithm can realize functions such as signing, verifying signatures and encrypting and decrypting symmetric keys of data. In this scheme, the signature and verification functions of the algorithm are mainly used to complete the trusted authentication of TEE.
[0060] It should be noted that the calculation of the first hash value commonly corresponding to the unique identifier includes: using the SM3 algorithm to calculate the first hash value commonly corresponding to the unique identifier. It should be noted that SM3 is a cryptographic hash function standard launched by the state, mainly used for digital signature and verification, message authentication code generation and verification, random number generation, etc., and its security and efficiency are equivalent to SHA-256.
[0061] It should be noted that, after obtaining the trusted credential based on the unique identifier and the authentication private key, the process further includes: storing the trusted credential in a physical machine, and establishing an association relationship between the trusted credential and the unique identifier.
[0062] Step S15: The host agent obtains the target information sent by the TEE agent from the authentication module to the TEE agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifies the trusted credential using the authentication public key and the unique identifier. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module.
[0063] In an embodiment of the present application, the verification of the trusted credential using the authentication public key and the unique identifier includes: using the authentication public key to verify the trusted credential to obtain the first hash value; calculating the second hash value corresponding to the unique identifier, and if the first hash value is consistent with the second hash value, the verification is successful.
[0064] It should be pointed out that if the verification passes, the trusted authentication of the target TEE is completed, that is, functions such as memory encryption and operation isolation have been realized, and the callback privacy computing platform TEE has been successfully created. After that, the privacy computing platform can send tasks to the TEE and perform related calculations.
[0065] It can be seen that the present application sends the target task to the host agent through the privacy computing platform; generates the target TEE corresponding to the target task in the TEE container through the host agent, and sends a first authentication request including the unique identifier of the target TEE to the TEE container; obtains the first authentication request through the TEE agent of the target TEE, generates a measurement report of the target TEE, and then sends a second authentication request including the measurement report and the unique identifier to the authentication module; obtains the second authentication request through the authentication module, and then remotely verifies the measurement report, and after the verification passes, obtains the trusted credential based on the unique identifier and the authentication private key; obtains the target information sent by the TEE agent to the TEE agent by the host agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then uses the authentication public key and the unique identifier to verify the trusted credential. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module. It can be seen that this application creates a target TEE for each target task and performs trusted verification on the target TEE to achieve trusted verification of TEE-associated tasks in practice, that is, to achieve task-oriented trusted verification of TEE; this application builds a trusted credential based on the unique identifier of the target TEE, which is conducive to enhancing the association between the trusted credential and the target TEE; in this application, if the authentication public key verification fails, it means that the trusted credential is counterfeit, so the authentication public key and authentication private key can be used to find the counterfeit trusted credential, further enhancing the reliability of trusted verification.
[0066] See also Figure 2 As shown, the embodiment of the present application discloses a specific TEE trusted authentication method, which includes:
[0067] Step S21: Send the target task to the host agent through the privacy computing platform.
[0068] In the present application embodiment, Figure 3 As shown, the privacy computing platform sends tasks to the host agent so that the host agent can perform the specific operations in 1.1, that is, create the target TEE.
[0069] Step S22: Generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container.
[0070] In an embodiment of the present application, the target TEE corresponding to the target task is generated in the TEE container by the host agent, and a first authentication request including a unique identifier of the target TEE is sent to the TEE container, including: generating the target TEE corresponding to the target task in the TEE container by the host agent, and obtaining the TEE address of the target TEE sent by the TEE agent of the target TEE; the TEE address includes a TEE IP address and a TEE MAC address; generating a unique identifier of the target TEE based on the TEE address by the host agent, and sending a first authentication request including the unique identifier of the target TEE to the TEE agent of the target TEE.
[0071] It should be pointed out that if Figure 3 As shown in the figure, the host agent creates the target TEE. After the target TEE starts and receives the task signal, it will immediately push the IP address and MAC address to the host agent. After receiving it, the host agent will store the TEE IP in the physical machine according to the MAC address. Secondly, the host agent sends a trusted authentication request to the TEE with the TEE ID attached, as shown in the figure. Figure 3 As shown in 2.1.
[0072] Step S23: Obtain the first authentication request through the TEE agent, generate the target public-private key pair and measurement report of the target TEE, and then send the second authentication request including the target public key, the measurement report and the unique identifier to the authentication module; the target public-private key pair is the SM2 public-private key pair.
[0073] In the implementation of this application, after obtaining the first authentication request through the TEE agent, an internal initialization key pair is required, and the key pair is an SM2 key pair, including a target public key and a target private key.
[0074] It should be noted that the TEE initializes the SM2 key pair internally, measures the system, application, software and hardware, etc., generates a local measurement report based on the measurement information and random number challenge, and the measurement report is associated with the summary value of the TEE ID, such as Figure 3 After the TEE generates a local report, it actively initiates a trusted authentication request to the authentication module CA, and carries the report, public key and TEE ID, as shown in 3.1 and 3.2. Figure 3 As shown in 3.3.
[0075] Step S24: Obtain the second authentication request through the authentication module, then remotely verify the measurement report, and after the verification is passed, obtain the trusted credential based on the target public key, the unique identifier and the authentication private key.
[0076] In an embodiment of the present application, the obtaining of a trusted credential based on the target public key, the unique identifier and the authentication private key includes: calculating a first hash value corresponding to the target public key and the unique identifier, and signing the first hash value with the authentication private key to obtain a signature value, and using the signature value as a trusted credential. It should be noted that the present application adds the use of the target public key to obtain the first hash value and further obtain the trusted credential, thereby enhancing the association between the trusted credential and the target TEE.
[0077] It should be noted that the calculating the first hash value corresponding to the target public key and the unique identifier includes: calculating the first hash value corresponding to the target public key and the unique identifier by using an SM3 algorithm.
[0078] It should be noted that, after obtaining the trusted credential based on the unique identifier and the authentication private key, the process further includes: storing the trusted credential in a physical machine, and establishing an association relationship between the trusted credential and the unique identifier.
[0079] It should be noted that after receiving the request from the target TEE, the authentication module of this application first performs remote verification of the target TEE local report, requests the TEE manufacturer's remote verification server to download the root certificate, and then completes the verification of the certificate chain in the local report, as shown in step Figure 3 After verification, the SM3 hash value (first hash value) of the target TEE's public key pk and TEE ID is calculated and the CA private key (authentication private key) is used to perform the SM2 signature on it. The signature value obtained is the trusted credential of the target TEE, as shown in Figure 3 As shown in 4.2. Then the trusted credentials are stored on the physical machine and associated with the TEE ID, as shown in Figure 3 As shown in 4.3. After 4.2 is completed, it indicates that the target TEE has successfully passed the remote verification and successfully issued a trusted certificate.
[0080] Step S25: Obtain, through the host agent, the target public key sent by the TEE agent and the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and query the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verify the trusted credential using the target public key, the authentication public key and the unique identifier. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module.
[0081] In an embodiment of the present application, the use of the authentication public key and the unique identifier to verify the trusted credential includes: using the authentication public key to verify the trusted credential to obtain the first hash value; calculating the second hash value corresponding to the target public key and the unique identifier, and if the first hash value is consistent with the second hash value, the verification is successful.
[0082] It should be pointed out that if Figure 3 As shown, the CA (authentication module) of this application returns the result to the TEE agent, and the TEE agent sends the result and the target public key to the host agent, such as Figure 3 As shown in 5.1. After receiving the information, the host agent actively requests the CA to query the corresponding TEE trusted certificate and authentication public key through the TEE ID, as shown in Figure 3 As shown in 6.1, the CA public key, TEE ID and authentication public key are then used to verify the trusted certificate, as shown in Figure 3 As shown in 6.2. After the signature verification is passed, it means that the TEE has successfully passed the remote verification, has realized functions such as memory encryption and operation isolation, and the callback privacy computing platform TEE has been successfully created. After that, the privacy computing platform can send tasks to the TEE and perform related calculations.
[0083] It can be seen that the present application sends the target task to the host agent through the privacy computing platform; generates the target TEE corresponding to the target task in the TEE container through the host agent, and sends a first authentication request including the unique identifier of the target TEE to the TEE container; generates the target public-private key pair and measurement report of the target TEE, and then sends a second authentication request including the target public key, the measurement report and the unique identifier to the authentication module; the target public-private key pair is the SM2 public-private key pair; obtains the second authentication request through the authentication module, and then remotely verifies the measurement report, and After the verification is passed, a trusted credential is obtained based on the target public key, the unique identifier and the authentication private key; the target public key sent by the TEE agent and the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained are obtained through the host agent, and the trusted credential and the authentication public key are queried from the authentication module based on the unique identifier, and then the trusted credential is verified using the target public key, the authentication public key and the unique identifier. If the verification is passed, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module. It can be seen that this application creates a target TEE for each target task and performs trusted verification on the target TEE to achieve trusted verification of the TEE associated tasks in practice, that is, to achieve task-oriented trusted verification of TEE; this application builds a trusted credential based on the unique identifier of the target TEE and the target public key corresponding to the target TEE, further enhancing the association between the trusted credential and the target TEE; in this application, if the authentication public key verification fails, it means that the trusted credential is fake, so the authentication public key and authentication private key can be used to find the fake trusted credential, further enhancing the reliability of trusted verification.
[0084] See also Figure 4 As shown, the embodiment of the present application discloses a TEE trusted authentication device, which is applied to a TEE trusted authentication system. The TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container and an authentication module. The device includes:
[0085] A task delivery module 11, used to deliver the target task to the host agent through the privacy computing platform;
[0086] A first authentication request sending module 12 is used to generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container;
[0087] A second authentication request sending module 13 is used to obtain the first authentication request through the TEE agent of the target TEE, generate a measurement report of the target TEE, and then send a second authentication request including the measurement report and the unique identifier to the authentication module;
[0088] A trusted credential acquisition module 14, configured to acquire the second authentication request through the authentication module, then remotely verify the measurement report, and after the verification is passed, acquire the trusted credential based on the unique identifier and the authentication private key;
[0089] The trusted verification module 15 is used to obtain, through the host agent, the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and query the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verify the trusted credential using the authentication public key and the unique identifier. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module.
[0090] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0091] It can be seen that the present application sends the target task to the host agent through the privacy computing platform; generates the target TEE corresponding to the target task in the TEE container through the host agent, and sends a first authentication request including the unique identifier of the target TEE to the TEE container; obtains the first authentication request through the TEE agent of the target TEE, generates a measurement report of the target TEE, and then sends a second authentication request including the measurement report and the unique identifier to the authentication module; obtains the second authentication request through the authentication module, and then remotely verifies the measurement report, and after the verification passes, obtains the trusted credential based on the unique identifier and the authentication private key; obtains the target information sent by the TEE agent to the TEE agent by the host agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then uses the authentication public key and the unique identifier to verify the trusted credential. If the verification passes, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module. It can be seen that this application creates a target TEE for each target task and performs trusted verification on the target TEE to achieve trusted verification of TEE-associated tasks in practice, that is, to achieve task-oriented trusted verification of TEE; this application builds a trusted credential based on the unique identifier of the target TEE, which is conducive to enhancing the association between the trusted credential and the target TEE; in this application, if the authentication public key verification fails, it means that the trusted credential is counterfeit, so the authentication public key and authentication private key can be used to find the counterfeit trusted credential, further enhancing the reliability of trusted verification.
[0092] Furthermore, an embodiment of the present application also provides an electronic device, Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0093] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, an input / output interface 24, a communication interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the TEE trusted authentication method disclosed in any of the aforementioned embodiments.
[0094] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 24 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0095] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The memory 22 can include a random access memory as a running memory and a non-volatile memory for external memory storage purposes. The storage resources thereon include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0096] Among them, the operating system 221 is used to manage and control the hardware devices on the electronic device 20 on the source host and the computer program 222. The operating system 221 can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the TEE trusted authentication method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0097] In this embodiment, the input and output interface 24 may specifically include but is not limited to a USB interface, a hard disk reading interface, a serial interface, a voice input interface, a fingerprint input interface, and the like.
[0098] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed TEE trusted authentication method is implemented.
[0099] For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0100] The computer-readable storage medium mentioned here includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, magnetic disk or optical disk or any other form of storage medium known in the technical field. Among them, the computer program implements the aforementioned TEE trusted authentication method when executed by the processor. For the specific steps of the method, please refer to the corresponding content disclosed in the aforementioned embodiment, which will not be repeated here.
[0101] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the TEE trusted authentication method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0102] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0103] The steps of the algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0104] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0105] The above is a detailed introduction to a TEE trusted authentication method, device, equipment and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A TEE trusted authentication method, characterized in that: Applied to a TEE trusted authentication system, the TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container and an authentication module, and the method includes: Sending the target task to the host agent through the privacy computing platform; Generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container; Obtaining the first authentication request through the TEE agent of the target TEE, generating a measurement report of the target TEE, and then sending a second authentication request including the measurement report and the unique identifier to the authentication module; Obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the unique identifier and the authentication private key; The host agent obtains the target information sent by the authentication module to the TEE agent, indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifies the trusted credential using the authentication public key and the unique identifier. If the verification is successful, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module; The generating of the measurement report of the target TEE and then sending the second authentication request including the measurement report and the unique identifier to the authentication module includes: Generate a target public-private key pair and a measurement report for the target TEE, and then send a second authentication request including the target public key, the measurement report and the unique identifier to the authentication module; the target public-private key pair is an SM2 public-private key pair; Correspondingly, obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and obtaining a trusted credential based on the unique identifier and the authentication private key after the verification is passed, includes: Obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the target public key, the unique identifier and the authentication private key; Correspondingly, the obtaining, through the host agent, target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and querying the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifying the trusted credential using the authentication public key and the unique identifier, includes: The host agent obtains the target public key sent by the TEE agent and the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and queries the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verifies the trusted credential using the target public key, the authentication public key and the unique identifier.
2. The TEE trusted authentication method according to claim 1, characterized in that: The generating a target TEE corresponding to the target task in the TEE container by the host agent, and sending a first authentication request including a unique identifier of the target TEE to the TEE container, includes: Generate a target TEE corresponding to the target task in the TEE container through the host agent, and obtain the TEE address of the target TEE sent by the TEE agent of the target TEE; the TEE address includes a TEE IP address and a TEE MAC address; The host agent generates a unique identifier of the target TEE based on the TEE address, and sends a first authentication request including the unique identifier of the target TEE to the TEE agent of the target TEE.
3. The TEE trusted authentication method according to claim 1, characterized in that: The obtaining of a trusted credential based on the target public key, the unique identifier and the authentication private key comprises: A first hash value corresponding to the target public key and the unique identifier is calculated, and the first hash value is signed with an authentication private key to obtain a signature value, and the signature value is used as a trusted credential.
4. The TEE trusted authentication method according to claim 3, characterized in that: The verifying the trusted credential by using the authentication public key and the unique identifier includes: Using the authentication public key to verify the signature of the trusted certificate to obtain the first hash value; A second hash value corresponding to the target public key and the unique identifier is calculated. If the first hash value is consistent with the second hash value, the verification is successful.
5. The TEE trusted authentication method according to claim 3, characterized in that: The calculating a first hash value corresponding to the target public key and the unique identifier includes: The SM3 algorithm is used to calculate a first hash value corresponding to the target public key and the unique identifier.
6. The TEE trusted authentication method according to any one of claims 1 to 5, characterized in that: After obtaining the trusted credential based on the unique identifier and the authentication private key, the method further includes: The trusted credential is stored in a physical machine, and an association relationship between the trusted credential and the unique identifier is established.
7. A TEE trusted authentication device, characterized in that: Applied to a TEE trusted authentication system, the TEE trusted authentication system includes a privacy computing platform, a host agent, a TEE container and an authentication module, and the device includes: A task delivery module, used to deliver the target task to the host agent through the privacy computing platform; A first authentication request sending module, configured to generate a target TEE corresponding to the target task in the TEE container through the host agent, and send a first authentication request including a unique identifier of the target TEE to the TEE container; A second authentication request sending module, used to obtain the first authentication request through the TEE agent of the target TEE, generate a measurement report of the target TEE, and then send a second authentication request including the measurement report and the unique identifier to the authentication module; A trusted credential acquisition module, used to acquire the second authentication request through the authentication module, then remotely verify the measurement report, and after the verification is passed, acquire the trusted credential based on the unique identifier and the authentication private key; A trusted verification module, used to obtain, through the host agent, the target information sent by the authentication module to the TEE agent indicating that the trusted credential has been obtained, and query the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verify the trusted credential using the authentication public key and the unique identifier. If the verification is successful, the trusted authentication of the target TEE is completed; the authentication public key and the authentication private key are the SM2 public-private key pair pre-generated by the authentication module; Among them, the second authentication request sending module is specifically used to generate a target public-private key pair and a measurement report of the target TEE, and then send a second authentication request including the target public key, the measurement report and the unique identifier to the authentication module; the target public-private key pair is an SM2 public-private key pair; Correspondingly, the trusted credential acquisition module is specifically used to obtain the second authentication request through the authentication module, and then remotely verify the measurement report, and after the verification is passed, obtain the trusted credential based on the unique identifier and the authentication private key, including: Obtaining the second authentication request through the authentication module, then remotely verifying the measurement report, and after the verification is passed, obtaining a trusted credential based on the target public key, the unique identifier and the authentication private key; Correspondingly, the trusted verification module is specifically used to obtain the target public key sent by the TEE agent and the target information sent by the authentication module to the TEE agent through the host agent, indicating that the trusted credential has been obtained, and query the trusted credential and the authentication public key from the authentication module based on the unique identifier, and then verify the trusted credential using the target public key, the authentication public key and the unique identifier.
8. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the TEE trusted authentication method as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the TEE trusted authentication method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Security verification method, device and equipment for application program
CN113282951A
Rapid authentication method and system for trusted execution environment
CN113329012A