技术领域Technical field
本申请涉及数据处理领域,并且更具体地,涉及一种数据存储方法和电子设备。The present application relates to the field of data processing, and more specifically, to a data storage method and electronic device.
背景技术Background technique
重放保护内存块(Replay Protected Memory Block,RPMB)通常是指存储器中一个单独的物理分区,常常用来存储密钥等敏感数据。其中,存储器可以包括通用文件存储器(Universal Flash Storage,UFS)和嵌入式多媒体存储卡(Embedded Multi Media Card,eMMC)。Replay Protected Memory Block (RPMB) usually refers to a separate physical partition in the memory and is often used to store sensitive data such as keys. The memory may include universal file storage (Universal Flash Storage, UFS) and embedded multimedia memory card (Embedded Multi Media Card, eMMC).
随着终端技术的不断进步,多可信执行环境(Trustedexecution environment,TEE)架构成为了一种常见的架构。通常,Secure Key只能存储在一个TEE中。在终端设备采用多TEE框架的情况下,由于Secure Key只能存储在一个TEE中,其他的TEE无法调用SecureKey对数据进行计算得到第一认证数据,因此使得RPMB无法完成对待写入数据的认证,导致RPMB无法存储待写入数据,进而导致无法实现每个TEE均能向RPMB写入数据的功能。With the continuous advancement of terminal technology, the multi-trusted execution environment (Trustedexecution environment, TEE) architecture has become a common architecture. Normally, Secure Key can only be stored in one TEE. When the terminal device adopts a multi-TEE framework, since the Secure Key can only be stored in one TEE, other TEEs cannot call the SecureKey to calculate the data to obtain the first authentication data. Therefore, RPMB cannot complete the authentication of the data to be written. As a result, RPMB cannot store data to be written, and thus cannot realize the function of each TEE being able to write data to RPMB.
基于此,如何实现多TEE框架中每个TEE均能向RPMB写入数据成为了一个亟待解决的问题。Based on this, how to realize that each TEE in the multi-TEE framework can write data to RPMB has become an urgent problem to be solved.
发明内容Contents of the invention
本申请提供了一种数据存储方法,能够实现多TEE框架中每个TEE均能向RPMB写入数据的功能。This application provides a data storage method that enables each TEE in a multi-TEE framework to write data to RPMB.
第一方面,提供了一种数据存储方法,该方法应用于电子设备,电子设备包括至少两个可信执行环境TEE,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,安全密钥是指重放保护内存块RPMB对存入数据进行校验的密钥;包括:In a first aspect, a data storage method is provided. The method is applied to an electronic device. The electronic device includes at least two trusted execution environments TEE. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to the untrusted execution environment TEE. The TEE that stores the security key. The second TEE refers to the TEE that stores the security key. The security key refers to the key used by the replay protection memory block RPMB to verify the stored data; including:
第二可信应用程序TA向第一可信应用程序TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序;The second trusted application TA sends a security key to the first trusted application TA. The first TA refers to the trusted application running on the first TEE, and the second TA refers to the trustworthy application running on the second TEE. letter application;
第一TA根据安全密钥和待存储数据,得到第一数据包;The first TA obtains the first data packet based on the security key and the data to be stored;
第一TA向RPMB发送第一数据包;The first TA sends the first data packet to RPMB;
RPMB基于第一数据包存储待存储数据。RPMB stores the data to be stored based on the first data packet.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序,然后,第一TA根据安全密钥和待存储数据,得到第一数据包,第一TA向RPMB发送第一数据包,RPMB基于第一数据包存储待存储数据。也即是说,在本申请的实施例中,由于第一TEE中未存储安全密钥,因此若第一TEE中运行的第一TA需要向RPMB存储待存储数据时,第一TA无法获取安全密钥对待存储数据进行认证计算,导致第一TA无法直接将待存储数据存储至RPMB;在本申请的方案中,由于第二TEE中存储安全密钥,第二TEE中的第二TA可以将安全密钥发送给运行在未存储安全密钥的第一TEE中的第一TA,然后第一TA根据上述安全密钥对待存储数据进行认证计算得到第一数据包,进而使得RPMB在接收到第一数据包之后,可以采用安全密钥对第一数据包进行计算认证,并在认证通过的情况下存储第一数据包中的待存储数据,从而实现了多TEE架构中每个TEE中运行的应用程序均能向RPMB写入数据的功能。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA. The first TA refers to the trusted application running on the first TEE. The second TA refers to The trusted application runs in the second TEE. Then, the first TA obtains the first data packet based on the security key and the data to be stored. The first TA sends the first data packet to RPMB, and RPMB stores it based on the first data packet. Data to be stored. That is to say, in the embodiment of the present application, since the security key is not stored in the first TEE, if the first TA running in the first TEE needs to store data to be stored in the RPMB, the first TA cannot obtain the security key. The key is used to authenticate and calculate the data to be stored, resulting in the first TA being unable to directly store the data to be stored in RPMB; in the solution of this application, since the security key is stored in the second TEE, the second TA in the second TEE can The security key is sent to the first TA running in the first TEE that does not store the security key, and then the first TA performs authentication calculations on the data to be stored based on the above security key to obtain the first data packet, so that RPMB receives the first data packet. After a data packet, the security key can be used to calculate and authenticate the first data packet, and if the authentication passes, the data to be stored in the first data packet is stored, thus realizing the multi-TEE architecture running in each TEE. All applications can write data to RPMB.
结合第一方面,在第一方面的某些实现方式中,上述第一TA根据安全密钥和待存储数据,得到第一数据包,包括:Combined with the first aspect, in some implementations of the first aspect, the above-mentioned first TA obtains the first data packet based on the security key and the data to be stored, including:
在计数器处于空闲状态时,第一TA获取第一计数值,第一计数值是指计数器在当前时刻的计数值;When the counter is in the idle state, the first TA obtains the first count value, which refers to the count value of the counter at the current moment;
第一TA根据第一计数值、安全密钥和待存储数据得到第一数据包。The first TA obtains the first data packet according to the first count value, the security key and the data to be stored.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,然后,第一TA确定计数器是否处于空闲状态,并在计数器处于空闲状态时,获取计数器的计数值,在计数器处于忙碌状态时,等待获取计数值的状态,直至计数器处于空闲状态,获取到计数值。第一TA采用安全密钥对计数值和待存储数据进行认证计算得到第一认证数据,然后根据计数值、第一认证数据和待存储数据得到第一数据包,并向RPMB发送第一数据包。这样使得第一TA向RPMB发送的第一数据包中的第一认证数据采用的计数值,与RPMB进行校验得到的第二认证数据采用的计数值是相同的。避免了在RPMB存入第二TEE中运行的第二TA发送的数据的过程中,RPMB向第一TEE中运行第一TA发送计数值,进而导致RPMB存储第二TA发送的数据之后,采用更新后的计数值去校验第一TA发送的第一数据包的情况。也即是说,采用本申请实施例提供的数据存储方法,避免了第一TA得到第一认证数据所采用的计数值,与RPMB对第一数据进行校验所采用的计数值不同,进而导致的认证不通过,RPMB无法存储第一TA发送的待存储数据的情况。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA, and then the first TA determines whether the counter is in an idle state, and obtains the counter when the counter is in an idle state. When the counter is in a busy state, it waits to obtain the count value until the counter is in an idle state and obtains the count value. The first TA uses the security key to authenticate and calculate the count value and the data to be stored to obtain the first authentication data, and then obtains the first data packet based on the count value, the first authentication data and the data to be stored, and sends the first data packet to RPMB. . In this way, the count value adopted by the first authentication data in the first data packet sent by the first TA to the RPMB is the same as the count value adopted by the second authentication data obtained by verification by the RPMB. It avoids that during the process of RPMB storing the data sent by the second TA running in the second TEE, RPMB sends the count value to the first TA running in the first TEE, which in turn causes RPMB to store the data sent by the second TA and use the update method. The subsequent count value is used to verify the first data packet sent by the first TA. That is to say, by using the data storage method provided by the embodiment of the present application, it is avoided that the count value used by the first TA to obtain the first authentication data is different from the count value used by RPMB to verify the first data, thus causing The authentication fails and RPMB cannot store the data to be stored sent by the first TA.
结合第一方面,在第一方面的某些实现方式中,上述计数器处于空闲状态包括RPMB当前处于未存储数据的状态。With reference to the first aspect, in some implementations of the first aspect, the idle state of the above counter includes that the RPMB is currently in a state of not storing data.
应理解,计数器处于空闲状态时,当第一TA向计数器获取计数值时,计数器可以将当前时刻的计数值发送给第一TA,以使第一TA采用当前时刻的计数值得到第一认证数据,并根据第一认证数据、当前时刻的计数值和待存储数据生成向RPMB发送的第一数据包。It should be understood that when the counter is in an idle state, when the first TA obtains the count value from the counter, the counter can send the count value at the current time to the first TA, so that the first TA uses the count value at the current time to obtain the first authentication data. , and generates the first data packet sent to RPMB based on the first authentication data, the current count value and the data to be stored.
结合第一方面,在第一方面的某些实现方式中,上述第一TA根据安全密钥和待存储数据,得到第一数据包,还包括:Combined with the first aspect, in some implementations of the first aspect, the above-mentioned first TA obtains the first data packet based on the security key and the data to be stored, which also includes:
在计数器处于忙碌状态时,第一TA处于等待获取第一计数值的状态,忙碌状态包括RPMB当前处于存储第二TA的数据的状态。When the counter is in a busy state, the first TA is in a state of waiting to obtain the first count value. The busy state includes that the RPMB is currently in a state of storing data of the second TA.
应理解,忙碌状态包括RPMB当前处于存储其他TA的数据的状态。It should be understood that the busy state includes that the RPMB is currently in a state of storing data of other TAs.
示例性的,如图1所示,RPMB存储数据的过程可以包括至少3个步骤,其中,从返回计数值开始(即第二个步骤),计数器开始处于忙碌状态,直至RPMB完成待存储数据的存储(相当于图1中所示的第三个步骤)之后,计数器的状态由忙碌状态变为空闲状态。For example, as shown in Figure 1, the process of RPMB storing data may include at least three steps. Starting from returning the count value (ie, the second step), the counter starts to be in a busy state until RPMB completes the process of storing the data. After storage (equivalent to the third step shown in Figure 1), the status of the counter changes from busy to idle.
结合第一方面,在第一方面的某些实现方式中,上述第一数据包还包括第一认证数据,第一认证数据为第一TA采用安全密钥对待存储数据进行认证计算得到的数据,RPMB基于第一数据包存储待存储数据,包括:In conjunction with the first aspect, in some implementations of the first aspect, the above-mentioned first data packet also includes first authentication data, and the first authentication data is data obtained by the first TA using the security key to authenticate and calculate the data to be stored, RPMB stores the data to be stored based on the first data packet, including:
RPMB采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据;RPMB uses the security key to perform authentication calculations on the data to be stored in the first data packet to obtain the second authentication data;
在第二认证数据与第一认证数据匹配的情况下,RPMB存储待存储数据。In the case where the second authentication data matches the first authentication data, the RPMB stores the data to be stored.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,然后,第一TA确定计数器是否处于空闲状态,并在计数器处于空闲状态时,获取计数器的计数值,在计数器处于忙碌状态时,等待获取计数值的状态,直至获取到计数值。第一TA采用安全密钥对返回的计数值和待存储数据进行认证计算得到第一认证数据,然后根据计数值、第一认证数据和待存储数据得到第一数据包,并向RPMB发送第一数据包。RPMB在接收到第一数据包之后,采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据,并在第二认证数据和第一认证数据匹配的情况下,存储待存储数据。这样使得存入RPMB的数据均是RPMB校验通过的数据,提高了存储RPMB中数据的安全性。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA, and then the first TA determines whether the counter is in an idle state, and obtains the counter when the counter is in an idle state. When the counter is in a busy state, wait for the count value to be obtained until the count value is obtained. The first TA uses the security key to authenticate and calculate the returned count value and the data to be stored to obtain the first authentication data, and then obtains the first data packet based on the count value, the first authentication data and the data to be stored, and sends the first data packet to RPMB. data pack. After receiving the first data packet, RPMB uses the security key to perform authentication calculations on the data to be stored in the first data packet to obtain the second authentication data, and when the second authentication data matches the first authentication data, Store the data to be stored. In this way, the data stored in RPMB are all data that have passed the RPMB verification, which improves the security of data stored in RPMB.
结合第一方面,在第一方面的某些实现方式中,上述认证计算包括哈希HMAC计算。In conjunction with the first aspect, in some implementations of the first aspect, the above authentication calculation includes hash HMAC calculation.
在本申请的实施例中,第一TA采用安全密钥通过哈希运算对待存储数据进行认证计算,得到第一认证数据,由于哈希运算是目前被广泛应用的,且经受了多种形式攻击的加密算法,使得通过哈希运算得到的第一认证数据是更加可靠的加密数据,提高了根据第一认证数据和待存储数据得到的第一数据包的安全性。In the embodiment of this application, the first TA uses the security key to perform authentication calculation on the data to be stored through hash operation to obtain the first authentication data. Since hash operation is currently widely used and has withstood various forms of attacks, The encryption algorithm makes the first authentication data obtained through hash operation more reliable encrypted data, and improves the security of the first data packet obtained based on the first authentication data and the data to be stored.
结合第一方面,在第一方面的某些实现方式中,上述待存储数据为第一TA调用第一传感器采集得到的数据。In connection with the first aspect, in some implementations of the first aspect, the data to be stored is data collected by the first TA by calling the first sensor.
本申请的实施例中所提供的数据存储方法,其中待存储数据可以是指第一TA调用第一传感器采集得到的数据,传感器通常需要通过对应的TA才能调用,因此,在第一传感器对应的第一TA所在的TEE中未存储有安全密钥的情况下,可以采用本申请实施例所提供的数据存储方法将第一传感器采集的数据存储在RPMB中,提高了第一传感器采集的数据的安全性。In the data storage method provided in the embodiment of the present application, the data to be stored may refer to the data collected by the first TA calling the first sensor. The sensor usually needs to be called through the corresponding TA. Therefore, in the first sensor corresponding to When there is no security key stored in the TEE where the first TA is located, the data storage method provided by the embodiment of the present application can be used to store the data collected by the first sensor in the RPMB, which improves the security of the data collected by the first sensor. safety.
结合第一方面,在第一方面的某些实现方式中,上述第一传感器包括指纹采集器。With reference to the first aspect, in some implementations of the first aspect, the above-mentioned first sensor includes a fingerprint collector.
本申请的实施例中所提供的数据存储方法,由于第一传感器包括指纹采集器,因此,第一TA调用指纹采集器采集到的待存储数据为指纹数据。又由于指纹数据通常用于加密,是安全等级要求相对较高的数据,因此需要存储在RPMB中。在指纹传感器所连接的可信应用程序所在的TEE中未存储有安全密钥的情况下,可以采用本申请实施例所提供的数据存储方法将指纹数据存储在RPMB中,提高了指纹数据的安全性。In the data storage method provided in the embodiment of the present application, since the first sensor includes a fingerprint collector, the first TA calls the fingerprint collector to collect data to be stored as fingerprint data. And because fingerprint data is usually used for encryption and requires relatively high security levels, it needs to be stored in RPMB. When there is no security key stored in the TEE where the trusted application program connected to the fingerprint sensor is located, the data storage method provided by the embodiment of the present application can be used to store the fingerprint data in the RPMB, thereby improving the security of the fingerprint data. sex.
第二方面,提供了一种数据存储装置,包括用于执行第一方面中任一种方法的单元。该装置可以是终端设备,还可以是终端设备内的芯片。该装置可以包括获取单元和处理单元。In a second aspect, a data storage device is provided, including a unit for performing any method in the first aspect. The device may be a terminal device or a chip within the terminal device. The device may include an acquisition unit and a processing unit.
当该装置是终端设备时,该处理单元可以是处理器,该输入单元可以是通信接口;该终端设备还可以包括存储器,该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该终端设备执行第一方面中的任一种方法。When the device is a terminal device, the processing unit can be a processor, and the input unit can be a communication interface; the terminal device can also include a memory, the memory is used to store computer program codes, and when the processor executes the stored code in the memory The computer program code causes the terminal device to execute any method in the first aspect.
当该装置是终端设备内的芯片时,该处理单元可以是芯片内部的处理单元,该输入单元可以是输出接口、管脚或电路等;该芯片还可以包括存储器,该存储器可以是该芯片内的存储器(例如,寄存器、缓存等),也可以是位于该芯片外部的存储器(例如,只读存储器、随机存取存储器等);该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该芯片执行第一方面中的任一种方法。When the device is a chip in a terminal device, the processing unit can be a processing unit inside the chip, and the input unit can be an output interface, a pin or a circuit, etc.; the chip can also include a memory, and the memory can be a memory within the chip. The memory (for example, register, cache, etc.) can also be the memory located outside the chip (for example, read-only memory, random access memory, etc.); this memory is used to store computer program code. When the processor executes the memory The stored computer program code causes the chip to perform any method in the first aspect.
在一种可能的实现方式中,存储器用于存储计算机程序代码;处理器,处理器执行该存储器所存储的计算机程序代码,当该存储器存储的计算机程序代码被执行时,该处理器用于执行:第二可信应用程序TA向第一可信应用程序TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序;第一TA根据安全密钥和待存储数据,得到第一数据包;第一TA向RPMB发送第一数据包;RPMB基于第一数据包存储待存储数据。In a possible implementation, the memory is used to store computer program code; the processor is used to execute the computer program code stored in the memory. When the computer program code stored in the memory is executed, the processor is used to execute: The second trusted application TA sends a security key to the first trusted application TA. The first TA refers to the trusted application running on the first TEE, and the second TA refers to the trustworthy application running on the second TEE. letter application; the first TA obtains the first data packet based on the security key and the data to be stored; the first TA sends the first data packet to RPMB; RPMB stores the data to be stored based on the first data packet.
第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序代码,当所述计算机程序代码被数据存储装置运行时,使得该数据存储装置执行第一方面中的任一种数据存储方法。In a third aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer program code. When the computer program code is run by a data storage device, the data storage device causes the data storage device to execute the first aspect. any data storage method.
第四方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被数据存储装置运行时,使得该数据存储装置执行第一方面中的任一种装置方法。In a fourth aspect, a computer program product is provided. The computer program product includes: computer program code. When the computer program code is run by a data storage device, the data storage device causes the data storage device to execute any one of the first aspects. Installation method.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序,然后,第一TA根据安全密钥和待存储数据,得到第一数据包,第一TA向RPMB发送第一数据包,RPMB基于第一数据包存储待存储数据。也即是说,在本申请的实施例中,由于第一TEE中未存储安全密钥,因此若第一TEE中运行的第一TA需要向RPMB存储待存储数据时,第一TA无法获取安全密钥对待存储数据进行认证计算,导致第一TA无法直接将待存储数据存储至RPMB;在本申请的方案中,由于第二TEE中存储安全密钥,第二TEE中的第二TA可以将安全密钥发送给运行在未存储安全密钥的第一TEE中的第一TA,然后第一TA根据上述安全密钥对待存储数据进行认证计算得到第一数据包,进而使得RPMB在接收到第一数据包之后,可以采用安全密钥对第一数据包进行计算认证,并在认证通过的情况下存储第一数据包中的待存储数据,从而实现了多TEE架构中每个TEE中运行的应用程序均能向RPMB写入数据的功能。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA. The first TA refers to the trusted application running on the first TEE. The second TA refers to The trusted application runs in the second TEE. Then, the first TA obtains the first data packet based on the security key and the data to be stored. The first TA sends the first data packet to RPMB, and RPMB stores it based on the first data packet. Data to be stored. That is to say, in the embodiment of the present application, since the security key is not stored in the first TEE, if the first TA running in the first TEE needs to store data to be stored in the RPMB, the first TA cannot obtain the security key. The key is used to authenticate and calculate the data to be stored, resulting in the first TA being unable to directly store the data to be stored in RPMB; in the solution of this application, since the security key is stored in the second TEE, the second TA in the second TEE can The security key is sent to the first TA running in the first TEE that does not store the security key, and then the first TA performs authentication calculations on the data to be stored based on the above security key to obtain the first data packet, so that RPMB receives the first data packet. After a data packet, the security key can be used to calculate and authenticate the first data packet, and if the authentication passes, the data to be stored in the first data packet is stored, thus realizing the multi-TEE architecture running in each TEE. All applications can write data to RPMB.
附图说明Description of the drawings
图1是一种RPMB写入数据的流程示意图;Figure 1 is a schematic flow chart of RPMB writing data;
图2是一种适用于本申请的电子设备的硬件系统的示意图;Figure 2 is a schematic diagram of a hardware system suitable for the electronic device of the present application;
图3是一种适用于本申请的电子设备的软件系统的示意图;Figure 3 is a schematic diagram of a software system suitable for the electronic device of the present application;
图4是本申请实施例提供的一种应用场景的示意图;Figure 4 is a schematic diagram of an application scenario provided by the embodiment of the present application;
图5是本申请实施例提供的一种数据存储的电子设备的示意图;Figure 5 is a schematic diagram of an electronic device for data storage provided by an embodiment of the present application;
图6是本申请实施例提供的一种数据存储方法的流程示意图;Figure 6 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图7是本申请实施例提供的另一种数据存储的电子设备的示意图;Figure 7 is a schematic diagram of another data storage electronic device provided by an embodiment of the present application;
图8是本申请实施例提供的另一种数据存储方法的流程示意图;Figure 8 is a schematic flow chart of another data storage method provided by an embodiment of the present application;
图9是本申请实施例提供的另一种数据存储的电子设备的示意图;Figure 9 is a schematic diagram of another data storage electronic device provided by an embodiment of the present application;
图10是本申请实施例提供的另一种数据存储方法的流程示意图;Figure 10 is a schematic flow chart of another data storage method provided by an embodiment of the present application;
图11是本申请提供的一种数据存储的电子设备的示意图;Figure 11 is a schematic diagram of an electronic device for data storage provided by this application;
图12是本申请提供的一种数据存储的电子设备的示意图。Figure 12 is a schematic diagram of an electronic device for data storage provided by this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise stated, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a way to describe related objects. The association relationship means that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B alone exists. In addition, in the description of the embodiments of this application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms “first”, “second” and “third” are used for descriptive purposes only and shall not be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Thus, features defined as "first", "second", and "third" may explicitly or implicitly include one or more of these features.
为了便于理解,示例的给出部分与本申请实施例相关概念的说明以供参考。To facilitate understanding, the examples given are descriptions of concepts related to the embodiments of the present application for reference.
1、RPMB1.RPMB
RPMB是指存储器中中一个独立的物理分区,通常用于存储有防止非法篡改需求的数据,例如手机上指纹支付相关的公钥、序列号等。通常,RPMB会对写入操作进行鉴权,但是读取操作并不需要鉴权。RPMB refers to an independent physical partition in the memory, which is usually used to store data that needs to be prevented from illegal tampering, such as public keys and serial numbers related to fingerprint payment on mobile phones. Normally, RPMB authenticates write operations, but read operations do not require authentication.
应理解,在生产电子设备的过程中,会为每一个电子设备生成一个唯一的安全密钥,并将该安全密钥烧写到电子设备的存储器中OTP区域中。其中,OTP区域是指只能烧写一次的区域。同时电子设备的主机Host会在安全的执行环境(例如TEE)中存储该安全密钥。Host在向RPMB写入数据时,RPMB可以采用该安全密钥进行鉴权。It should be understood that in the process of producing electronic devices, a unique security key will be generated for each electronic device, and the security key will be programmed into the OTP area of the memory of the electronic device. Among them, the OTP area refers to the area that can only be programmed once. At the same time, the host of the electronic device will store the security key in a secure execution environment (such as TEE). When the Host writes data to RPMB, RPMB can use this security key for authentication.
示例性的,以主机Host(TEE中的可信应用程序TA)向设备Device(例如UFS)写入数据为例进行说明。As an example, the host (the trusted application TA in the TEE) writes data to the device Device (for example, UFS).
如图1所示,Host发送读取计数值Write Cnt请求和一个随机数给Device,以获取Device中的计数值Write Cnt。Device在接收到读取计数值Write Cnt请求之后,采用安全密钥对计数值Write Cnt和随机数进行HMAC计算后生成第一MAC,然后Device将Write Cnt、随机数和第一MAC填充到RPMB数据包对应区域,生成RPMB数据包,并将RPMB数据包发送给Host。Host在接收到RPMB数据包时,采用安全密钥对RPMB数据包中的Write Cnt和随机数进行HMAC计算,得到第二MAC,对比第一MAC和第二MAC的数值是否一致,并在第一MAC和第二MAC数值一致的情况下,对比Host发送给Device的随机数和RPMB数据包中的随机数是否一致,并在Host发送给Device的随机数和RPMB数据包中的随机数一致的情况下,确定RPMB数据包中的Write Cnt可信。As shown in Figure 1, the Host sends a read count value Write Cnt request and a random number to the Device to obtain the count value Write Cnt in the Device. After receiving the request to read the count value Write Cnt, the Device uses the security key to perform HMAC calculation on the count value Write Cnt and the random number to generate the first MAC. Then the Device fills the Write Cnt, random number and first MAC into the RPMB data. The packet corresponds to the area, generates the RPMB data packet, and sends the RPMB data packet to the Host. When the Host receives the RPMB data packet, it uses the security key to perform HMAC calculation on the Write Cnt and random number in the RPMB data packet to obtain the second MAC. It compares the values of the first MAC and the second MAC to see if they are consistent, and performs the HMAC calculation on the first MAC. When the MAC and second MAC values are consistent, compare the random number sent by the Host to the Device and the random number in the RPMB packet, and check whether the random number sent by the Host to the Device is consistent with the random number in the RPMB packet. In this case, make sure the Write Cnt in the RPMB packet is trustworthy.
进一步地,Host采用安全密钥对待存储数据的目的地址、待存储数据和Write Cnt进行HMAC计算,得到第三MAC,并将第三MAC填充到RPMB数据包中的MAC区域,得到更新后的RPMB数据包,然后将更新后的RPMB数据包发送给Device。Device接收到的更新后的RPMB数据包,使用安全密钥对待存储数据的目的地址、待存储数据和Write Cnt进行HMAC计算后得到第四MAC,将第四MAC与第三MAC进行比较,在第四MAC和第三MAC一致的情况下,对比更新后的RPMB数据包中的Write Cnt和Device中的Write Cnt是否一致,并在更新后的RPMB数据包中的Write Cnt和Device中的Write Cnt一致的情况下,将更新后的RPMB数据包中的待存储数据存储到待存储数据对应的目的地址中,并且将Device中的Write Cnt进行加1操作,得到更新后的Write Cnt。Further, the Host uses the security key to perform HMAC calculation on the destination address of the data to be stored, the data to be stored and Write Cnt to obtain the third MAC, and fills the third MAC into the MAC area in the RPMB packet to obtain the updated RPMB packet, and then sends the updated RPMB packet to the Device. The updated RPMB data packet received by the Device uses the security key to perform HMAC calculation on the destination address of the data to be stored, the data to be stored and Write Cnt to obtain the fourth MAC. The fourth MAC is compared with the third MAC. If the fourth MAC and the third MAC are consistent, compare the Write Cnt in the updated RPMB packet and the Write Cnt in the Device to see if they are consistent, and make sure that the Write Cnt in the updated RPMB packet is consistent with the Write Cnt in the Device. In the case of , store the data to be stored in the updated RPMB packet to the destination address corresponding to the data to be stored, and add 1 to the Write Cnt in the Device to obtain the updated Write Cnt.
2、可信执行环境(Trusted execution environment,TEE)2. Trusted execution environment (TEE)
TEE是指终端设备中一个独立的安全运行环境,通常是指和富执行环境(Richexecution environment,REE)逻辑隔离的运行环境。TEE上定义了严格的保护措施,能够抵御常规REE侧易操守的软件攻击。因此TEE通常用于处理安全级别高的任务。TEE refers to an independent secure operating environment in the terminal device, which usually refers to an operating environment that is logically isolated from the Rich Execution Environment (REE). Strict protection measures are defined on TEE to resist software attacks that are easy to cause on the regular REE side. Therefore TEE is usually used to handle tasks with high security level.
3、富执行环境(Rich execution environment,REE)3. Rich execution environment (REE)
REE通常是指终端设备上通用的运行环境,是不具备特定安全功能的运行环境。例如,Andorid系统、IOS系统均属于REE。REE usually refers to a common operating environment on terminal devices, which does not have specific security functions. For example, Android system and IOS system both belong to REE.
TEE和REE之间相互隔离,通常REE无法直接访问TEE的硬件和软件资源,只能通过授权的应用程序编程接口进行交互。TEE and REE are isolated from each other. Generally, REE cannot directly access the hardware and software resources of TEE and can only interact through authorized application programming interfaces.
4、可信应用程序(Trusted Application,TA)4. Trusted Application (TA)
TA通常是指在TEE上运行的应用程序。能够为运行在TEE之外的应用程序提供安全服务。TA usually refers to the application running on the TEE. Able to provide security services for applications running outside the TEE.
5、客户端应用程序(Client Application,CA)5. Client Application (CA)
CA通常是指在REE上运行的应用程序。CA usually refers to applications running on REE.
6、Hypervisor6.Hypervisor
Hypervisor是指运行在基础物理服务器和操作系统之间的中间软件层,通过Hypervisor可以访问电子设备器上包括磁盘和内存在内的所有物理设备。Hypervisor协调硬件资源访问,各个虚拟机之间的防护。服务器启动后,Hypervisor会加载所有虚拟机客户端的操作系统,为虚拟机分配内存、磁盘和网络等。基于Hypervisor的机制,电子设备可以支持多个TEE同时运行。Hypervisor refers to the intermediate software layer that runs between the basic physical server and the operating system. All physical devices on the electronic device, including disks and memory, can be accessed through the Hypervisor. Hypervisor coordinates hardware resource access and protection between virtual machines. After the server starts, the hypervisor will load the operating systems of all virtual machine clients and allocate memory, disks, networks, etc. to the virtual machines. Based on the Hypervisor mechanism, electronic equipment can support multiple TEEs running simultaneously.
7、ATF7.ATF
ATF(ARMFirmware)是一针对/>芯片给出的底层的开源固件代码。固件将整个系统分成四种运行等级,分别为:EL0、EL1、EL2和EL3。其中,应用程序的运行等级为ELO,驱动的运行等级为EL1,Hypervisor模块的运行等级为EL2,ATF模块的运行等级为EL3。ATF(ARM Firmware) is a target/> The underlying open source firmware code provided by the chip. The firmware divides the entire system into four operating levels: EL0, EL1, EL2 and EL3. Among them, the running level of the application is ELO, the running level of the driver is EL1, the running level of the hypervisor module is EL2, and the running level of the ATF module is EL3.
本申请实施例提供的数据存储方法,可以应用于电子设备。可选的,电子设备包括终端设备,终端设备也可以称为终端(terminal)、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。终端设备可以是手机(mobilephone)、智能电视、穿戴式设备、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。本申请的实施例对终端设备所采用的具体技术和具体设备形态不做限定。The data storage method provided by the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, and the terminal device may also be called a terminal (terminal), user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet (Pad), a computer with wireless transceiver functions, a virtual reality (VR) terminal device, or an augmented reality (AR) terminal device. , wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, transportation safety Wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of this application do not limit the specific technology and specific equipment form used by the terminal equipment.
示例性的,图2示出了电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。For example, FIG. 2 shows a schematic structural diagram of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。Fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
可选地,电子设备中的存储器包括eMMC和通用文件存储器(Universal FileStore,UFS)。其中,存储器中的RPMB通常用于存储有保密需求的数据。在向RPMB中写入数据时,需要通过预先存储的安全密钥进行认证加密。RPMB用其上存储的安全密钥对写入数据进行校验,在校验通过后,再将写入数据存储在RPMB上。Optionally, the memory in the electronic device includes eMMC and universal file storage (Universal FileStore, UFS). Among them, RPMB in the memory is usually used to store data that requires confidentiality. When writing data to RPMB, it needs to be authenticated and encrypted through a pre-stored security key. RPMB uses the security key stored on it to verify the written data. After the verification passes, the written data is stored on RPMB.
需要说明的是,本申请实施例提到的任一电子设备可以包括电子设备100中更多或者更少的模块。It should be noted that any electronic device mentioned in the embodiments of this application may include more or fewer modules in the electronic device 100 .
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
图3是本申请实施例的电子设备100的软件结构框图。FIG. 3 is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
电子设备100的分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture of the electronic device 100 divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime (Android runtime) and system libraries, and kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图3所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 3, the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make this data accessible to applications. Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, etc. A view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 100 . For example, call status management (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and application framework layer into binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D Graphics Engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动,Wi-Fi驱动等。The kernel layer is the layer between hardware and software. The kernel layer at least includes display driver, camera driver, audio driver, sensor driver, Wi-Fi driver, etc.
需要说明的是,本申请实施例提到的电子设备可以包括上述电子设备中更多或者更少的模块。It should be noted that the electronic device mentioned in the embodiment of the present application may include more or less modules in the above-mentioned electronic device.
下面结合附图对本申请实施例提供的应用场景进行说明。The application scenarios provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
随着终端技术的不断发展,多TEE架构成为了一种常见的架构。示例性的,如图4所示,终端设备中包括两个TEE和RPMB,分别为第一TEE、第二TEE和RPMB。其中,第一TEE中未存储安全密钥,第二TEE存储安全密钥。在第一TEE中运行的第一TA需要向RPMB中写入数据的情况下,第一TEE中运行的第一TA可以从第一TEE和第二TEE之间的第一通道,获取存储在第二TEE的安全密钥,然后根据安全密钥和待存储数据得到第一数据包,并向RPMB发送第一数据,以使RPMB基于第一数据存储待存储数据。With the continuous development of terminal technology, multi-TEE architecture has become a common architecture. For example, as shown in Figure 4, the terminal device includes two TEEs and RPMB, which are a first TEE, a second TEE, and an RPMB respectively. Among them, the security key is not stored in the first TEE, and the security key is stored in the second TEE. When the first TA running in the first TEE needs to write data into the RPMB, the first TA running in the first TEE can obtain the data stored in the RPMB from the first channel between the first TEE and the second TEE. Second, the security key of the TEE is obtained, and then the first data packet is obtained according to the security key and the data to be stored, and the first data is sent to RPMB, so that RPMB stores the data to be stored based on the first data.
其中,待存储数据可以是第一TA调用第一传感器采集得到的数据。示例性的,第一传感器是指纹传感器,待存储数据可以是指第一TA调用指纹传感器采集的指纹数据。The data to be stored may be data collected by the first TA by calling the first sensor. For example, the first sensor is a fingerprint sensor, and the data to be stored may refer to fingerprint data collected by the first TA by calling the fingerprint sensor.
通常指纹数据用于对终端设备中进行加解密,因此需要将指纹数据存储至安全区域,例如RPMB中。在第一TA中没有存储RPMB中用于校验写入RPMB中数据的安全密钥的情况下,第一TA可以通过第一TEE和第二TEE之间的数据通道获取安全密钥。Usually fingerprint data is used for encryption and decryption in terminal devices, so the fingerprint data needs to be stored in a secure area, such as RPMB. In the case where the security key used in the RPMB to verify the data written in the RPMB is not stored in the first TA, the first TA can obtain the security key through the data channel between the first TEE and the second TEE.
应理解,上述为对应用场景的举例说明,并不对本申请的应用场景作任何限定。It should be understood that the above are examples of application scenarios and do not limit the application scenarios of the present application in any way.
下面结合图5至图11对本申请实施例提供的数据存储方法进行详细描述。The data storage method provided by the embodiment of the present application will be described in detail below with reference to Figures 5 to 11.
示例性的,如图5所示,电子设备包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,第一TEE和第二TEE之间存在用于传输安全密钥的第一通道。Exemplarily, as shown in Figure 5, the electronic device includes a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to a TEE that stores a security key. The first TEE and A first channel for transmitting security keys exists between the second TEEs.
下面结合图6对应用在图5所示的电子设备的数据存储方法进行详细描述。The data storage method applied to the electronic device shown in Figure 5 will be described in detail below with reference to Figure 6 .
图6为本申请一个实施例中提供的数据存储方法的流程示意图,如图6所示,该方法应用于如图5所示的电子设备中。该方法包括:FIG. 6 is a schematic flowchart of a data storage method provided in an embodiment of the present application. As shown in FIG. 6 , this method is applied to the electronic device shown in FIG. 5 . The method includes:
S101、第二TA向第一TA发送安全密钥。S101. The second TA sends the security key to the first TA.
应理解,在电子设备的生产过程中,会向电子设备中的存储器(例如RPMB)中烧写安全密钥,同时,将该安全密钥写入TEE中,以使TEE中运行的TA在向RPMB写入数据时,可以调用安全密钥对待存储数据进行加密。在电子设备包括至少两个TEE的情况下,通常只会将安全密钥写入一个TEE中。It should be understood that during the production process of electronic equipment, the security key will be burned into the memory (such as RPMB) in the electronic equipment, and at the same time, the security key will be written into the TEE, so that the TA running in the TEE will When RPMB writes data, it can call the security key to encrypt the data to be stored. In cases where the electronic device includes at least two TEEs, the security key is usually written into only one TEE.
应理解,安全密钥可以被存储在至少两个TEE中的任一个。It should be understood that the security key may be stored in either of at least two TEEs.
示例性的,至少两个TEE包括第一TEE和第二TEE,其中第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE。在第一TEE中运行的第一TA需要向RPMB中写入数据的情况,由于第一TEE中未存储安全密钥。因此第一TA无法调用安全密钥对待存储数据(也即是第一待存储数据)进行认证计算,进而使得第一TA无法直接将待存储数据发送至RPMB存储。在这种情况下,第二TA可以通过第一TEE和第二TEE之间的第一通道,向第一TA发送存储在第二TEE中的安全密钥。Exemplarily, the at least two TEEs include a first TEE and a second TEE, where the first TEE refers to a TEE that does not store a security key, and the second TEE refers to a TEE that stores a security key. The first TA running in the first TEE needs to write data to the RPMB because the security key is not stored in the first TEE. Therefore, the first TA cannot call the security key to perform authentication calculation on the data to be stored (that is, the first data to be stored), and thus the first TA cannot directly send the data to be stored to the RPMB storage. In this case, the second TA can send the security key stored in the second TEE to the first TA through the first channel between the first TEE and the second TEE.
应理解,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序。It should be understood that the first TA refers to the trusted application program running on the first TEE, and the second TA refers to the trusted application program running on the second TEE.
应理解,Hypervisor模块具有访问电子设备器上包括磁盘和内存在内的所有物理设备的功能。服务器启动后,Hypervisor模块会加载所有虚拟机客户端的操作系统(包括第一TEE和第二TEE),为虚拟机分配内存、磁盘和网络。这样使得Hypervisor模块可以为第一TEE和第二TEE直接分配数据接口,使得第一TEE和第二TEE之间可以传输数据。第一通道可以是指上述Hypervisor模块所分配的数据接口。It should be understood that the hypervisor module has the functionality to access all physical devices on the electronic device, including disks and memory. After the server starts, the hypervisor module loads the operating systems of all virtual machine clients (including the first TEE and the second TEE) and allocates memory, disks, and networks to the virtual machines. In this way, the hypervisor module can directly allocate data interfaces to the first TEE and the second TEE, so that data can be transmitted between the first TEE and the second TEE. The first channel may refer to the data interface allocated by the above-mentioned Hypervisor module.
S102、第一TA根据安全密钥和待存储数据,得到第一数据包。S102. The first TA obtains the first data packet based on the security key and the data to be stored.
其中,待存储数据可以是指第一TEE上的第一TA采集得到的数据。The data to be stored may refer to data collected by the first TA on the first TEE.
示例性的,第一TEE中的第一TA是需要指纹数据进行加解密的应用程序。待存储数据可以是指第一TA通过指纹采集器采集得到的指纹数据。For example, the first TA in the first TEE is an application that requires fingerprint data for encryption and decryption. The data to be stored may refer to the fingerprint data collected by the first TA through the fingerprint collector.
示例性的,第一TEE中的第一TA是需要声音数据进行加解密的应用程序。待存储数据可以是指第一TA通过麦克风采集得到的声音数据。For example, the first TA in the first TEE is an application that requires voice data to be encrypted and decrypted. The data to be stored may refer to the sound data collected by the first TA through the microphone.
示例性的,第一TEE中的第一TA是需要字符密码进行加解密的应用程序。待存储数据可以是指第一TA通过接收用户在显示屏上的点击操作得到的字符数据。For example, the first TA in the first TEE is an application that requires character passwords for encryption and decryption. The data to be stored may refer to character data obtained by the first TA by receiving the user's click operation on the display screen.
示例性的,第一TEE中的第一TA是需要眼纹数据进行加解密的应用程序。待存储数据可以是指第一TA通过摄像头采集得到的眼纹数据。For example, the first TA in the first TEE is an application that requires eyeprint data for encryption and decryption. The data to be stored may refer to the eyeprint data collected by the first TA through the camera.
示例性的,第一TEE中的第一TA是需要人脸进行加解密的应用程序。待存储数据可以是指第一TA通过摄像头采集得到的人脸数据。For example, the first TA in the first TEE is an application that requires faces for encryption and decryption. The data to be stored may refer to the face data collected by the first TA through the camera.
示例性的,第一TA也可以是向CA提供安全服务的应用程序,待存储数据可以是指CA向第一TA发送的密码数据,包括且不限于上述指纹数据、声音数据、字符数据、眼纹数据和人脸数据。Exemplarily, the first TA may also be an application that provides security services to the CA. The data to be stored may refer to password data sent by the CA to the first TA, including but not limited to the above fingerprint data, voice data, character data, eyeball data, etc. fingerprint data and face data.
可选地,第一TA采用安全密钥对待存储数据进行认证计算的过程,可以是获取RPMB中的计数器的计数值,然后采用安全密钥对待存储数据和上述计数值进行认证计算,得到第一认证数据,然后再将第一认证数据、待存储数据和计数值进行打包,得到第一数据包。Optionally, the process of the first TA using the security key to perform authentication calculation on the data to be stored may be to obtain the count value of the counter in the RPMB, and then use the security key to perform authentication calculation on the data to be stored and the above count value to obtain the first authentication data, and then package the first authentication data, the data to be stored and the count value to obtain the first data packet.
S103、第一TA向RPMB发送第一数据包。S103. The first TA sends the first data packet to RPMB.
S104、RPMB基于第一数据包存储待存储数据。S104. RPMB stores the data to be stored based on the first data packet.
应理解,在接收到第一数据包之后,RPMB为了保证存入RPMB中的数据的安全性,可以先对第一数据包进行校验,并在校验通过之后,存储第一数据包中的待存储数据。It should be understood that after receiving the first data packet, in order to ensure the security of the data stored in RPMB, RPMB can first verify the first data packet, and after passing the verification, store the data in the first data packet. Data to be stored.
示例性的,RPMB在存储待存储数据时,需要先使用安全密钥对待存储数据进行计算得到第二认证数据,并在第一认证数据和第二认证数据相同的情况下,确定第一数据包认证通过,存储待存储数据。For example, when RPMB stores the data to be stored, it needs to first use the security key to calculate the data to be stored to obtain the second authentication data, and when the first authentication data and the second authentication data are the same, determine the first data packet After the authentication is passed, the data to be stored is stored.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序,然后,第一TA根据安全密钥和待存储数据,得到第一数据包,第一TA向RPMB发送第一数据包,RPMB基于第一数据包存储待存储数据。也即是说,在本申请的实施例中,由于第一TEE中未存储安全密钥,因此若第一TEE中运行的第一TA需要向RPMB存储待存储数据时,第一TA无法获取安全密钥对待存储数据进行认证计算,导致第一TA无法直接将待存储数据存储至RPMB;在本申请的方案中,由于第二TEE中存储安全密钥,第二TEE中的第二TA可以将安全密钥发送给运行在未存储安全密钥的第一TEE中的第一TA,然后第一TA根据上述安全密钥对待存储数据进行认证计算得到第一数据包,进而使得RPMB在接收到第一数据包之后,可以采用安全密钥对第一数据包进行计算认证,并在认证通过的情况下存储第一数据包中的待存储数据,从而实现了多TEE架构中每个TEE中运行的应用程序均能向RPMB写入数据的功能。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA. The first TA refers to the trusted application running on the first TEE. The second TA refers to The trusted application runs in the second TEE. Then, the first TA obtains the first data packet based on the security key and the data to be stored. The first TA sends the first data packet to RPMB, and RPMB stores it based on the first data packet. Data to be stored. That is to say, in the embodiment of the present application, since the security key is not stored in the first TEE, if the first TA running in the first TEE needs to store data to be stored in the RPMB, the first TA cannot obtain the security key. The key is used to authenticate and calculate the data to be stored, resulting in the first TA being unable to directly store the data to be stored in RPMB; in the solution of this application, since the security key is stored in the second TEE, the second TA in the second TEE can The security key is sent to the first TA running in the first TEE that does not store the security key, and then the first TA performs authentication calculations on the data to be stored based on the above security key to obtain the first data packet, so that RPMB receives the first data packet. After a data packet, the security key can be used to calculate and authenticate the first data packet, and if the authentication passes, the data to be stored in the first data packet is stored, thus realizing the multi-TEE architecture running in each TEE. All applications can write data to RPMB.
采用本申请实施例提供的数据存储方法,在第一TEE中运行的第一TA和在第二TEE中运行的第二TA均能够向RPMB写入数据。应理解,应用程序在向RPMB写入数据时,通常需要获取RPMB中计数器当前时刻的计数值。示例性的,第一TA在向RPMB写入数据的过程中,先通过kernel向RPMB发送写入请求,以获取RPMB中计数器的计数值。kernel先确认计数器的状态,在计数器的状态处于空闲状态时,向应用程序返回当前时刻的计数值。应用程序采用安全密钥对当前时刻的计数值、待存储数据进行认证计算,得到第一认证数据,然后根据第一认证数据和待存储数据生成第一数据包,并将第一数据包发送给RPMB。RPMB接收到第一数据包之后,对第一认证数据进行校验,并在校验通过之后存入待存储数据,此时计数器的计数值会加一。在RPMB下一次存储数据时,将加一之后的计数值返回给应用程序,以使应用程序根据返回的加一之后的计数值,进行认证计算。在第一TEE中运行的第一TA和在第二TEE中运行的第二TA均能够向RPMB写入数据的情况下,当第一TA向RPMB写入数据的过程中,第二TA请求向RPMB写入数据,此时计数器的计数值尚未更新,向第二TA发送的计数器的计数值可能是尚未更新的计数值,这样会导致第二TA采用尚未更新的计数值进行认证计算,得到的认证数据出错的情况。为了避免由于计数值未更新导致的认证数据出错的情况,可以在一个TA向RPMB写入数据的过程中,使得另一个TA处于等待向RPMB请求写入数据的状态。这样可以有效的避免另一个TA采用尚未更新的计数值进行认证计算,得到的认证数据出错的情况。下面通过图7至图10进行说明。Using the data storage method provided by the embodiment of the present application, both the first TA running in the first TEE and the second TA running in the second TEE can write data to the RPMB. It should be understood that when an application program writes data to RPMB, it usually needs to obtain the current count value of the counter in RPMB. For example, in the process of writing data to RPMB, the first TA first sends a write request to RPMB through the kernel to obtain the count value of the counter in RPMB. The kernel first confirms the status of the counter, and returns the current count value to the application program when the counter status is idle. The application uses the security key to perform authentication calculations on the current count value and the data to be stored to obtain the first authentication data, and then generates the first data packet based on the first authentication data and the data to be stored, and sends the first data packet to RPMB. After receiving the first data packet, RPMB verifies the first authentication data, and stores the data to be stored after the verification passes. At this time, the count value of the counter will be increased by one. The next time RPMB stores data, the count value plus one is returned to the application program, so that the application program can perform authentication calculations based on the returned count value plus one. When both the first TA running in the first TEE and the second TA running in the second TEE can write data to RPMB, when the first TA writes data to RPMB, the second TA requests to RPMB writes data. At this time, the count value of the counter has not been updated. The count value of the counter sent to the second TA may be a count value that has not yet been updated. This will cause the second TA to use the count value that has not yet been updated for authentication calculation. The obtained The authentication data is incorrect. In order to avoid authentication data errors caused by the count value not being updated, while one TA is writing data to RPMB, another TA can be placed in a state of waiting for a request to write data to RPMB. This can effectively avoid the situation where another TA uses a count value that has not been updated to perform authentication calculations, and the authentication data obtained is incorrect. This will be explained below with reference to Figures 7 to 10 .
图7为一种适用于本申请实施例的电子设备的结构示意图,如图7所示,该电子设备包括第一TEE、第二TEE、内核kernel和RPMB。其中,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE。内核kernel中包括Hypervisor模块。RPMB中包括计数器。Figure 7 is a schematic structural diagram of an electronic device suitable for embodiments of the present application. As shown in Figure 7, the electronic device includes a first TEE, a second TEE, a kernel and an RPMB. Among them, the first TEE refers to the TEE that does not store the security key, and the second TEE refers to the TEE that stores the security key. The kernel kernel includes the Hypervisor module. Counters are included in RPMB.
下面结合图8对应用在图7所示的电子设备的数据存储方法进行详细描述。The data storage method applied to the electronic device shown in Figure 7 will be described in detail below with reference to Figure 8 .
图8为本申请一个实施例中提供的数据存储方法的流程示意图,该方法应用于图7所示的电子设备。如图8所示,该方法包括:FIG. 8 is a schematic flowchart of a data storage method provided in an embodiment of the present application. The method is applied to the electronic device shown in FIG. 7 . As shown in Figure 8, the method includes:
S201、第二TA向第一TA发送安全密钥。S201. The second TA sends the security key to the first TA.
S202、第一TA确定计数器处于空闲状态或者忙碌状态。若是空闲状态,则执行S204;若是忙碌状态,则执行S203。S202. The first TA determines that the counter is in an idle state or a busy state. If it is in the idle state, perform S204; if it is in the busy state, perform S203.
应理解,在RPMB存储数据的过程中,计数器将当前时刻的计数值发送给向RPMB写入数据的TA,然后在RPMB完成本次的数据存储之后,将计数器的计数值加一,得到更新后的计数值。相当于在RPMB存储数据的过程中,计数器处于忙碌状态,在RPMB停止存储数据时,计数器处于空闲状态。It should be understood that during the process of RPMB storing data, the counter sends the current count value to the TA that writes data to RPMB, and then after RPMB completes this data storage, it adds one to the counter value to obtain the updated count value. It is equivalent to the counter being in a busy state during the process of RPMB storing data, and the counter being in an idle state when RPMB stops storing data.
由图1可知,RPMB存储数据的过程可以包括至少3个步骤,其中,从返回计数值开始(即第二个步骤),计数器开始处于忙碌状态,直至RPMB完成待存储数据的存储(相当于图1中所示的第三个步骤)之后,计数器的状态由忙碌状态变为空闲状态。As can be seen from Figure 1, the process of RPMB storing data can include at least 3 steps. Starting from returning the count value (i.e. the second step), the counter starts to be in a busy state until RPMB completes the storage of the data to be stored (equivalent to Figure 1). After the third step shown in 1), the status of the counter changes from busy to idle.
可选地,计数器处于空闲状态包括RPMB当前处于未存储数据的状态。Optionally, the counter being in an idle state includes that the RPMB is currently in a state of not storing data.
应理解,忙碌状态包括RPMB当前处于存储其他TA的数据的状态。It should be understood that the busy state includes that the RPMB is currently in a state of storing data of other TAs.
示例性的,在第一TA向kernel发送写入请求的情况下,在RPMB当前处于存储第二TA(即其他TA)写入的数据的状态,则计数器处于忙碌状态。For example, when the first TA sends a write request to the kernel, and the RPMB is currently in a state of storing data written by the second TA (ie, other TA), the counter is in a busy state.
示例性的,在第二TA向kernel发送写入请求的情况下,在RPMB当前处于存储第一TA(即其他TA)写入的数据的状态,则计数器处于忙碌状态。For example, when the second TA sends a write request to the kernel, and the RPMB is currently in a state of storing data written by the first TA (that is, other TAs), the counter is in a busy state.
S203、第一TA处于等待获取计数值的状态,直至计数器处于空闲状态。S203. The first TA is in a state of waiting to obtain the count value until the counter is in an idle state.
S204、第一TA获取计数器在当前时刻的计数值(相当于第一计数值)。S204. The first TA obtains the count value of the counter at the current time (equivalent to the first count value).
应理解,由于本申请实施例是在计数器处于空闲状态时,才获取计数器的计数值。在计数器处于空闲状态,RPMB处于未存储数据的状态的情况下,计数器的计数值不会发生变化。在这种情况下,不会出现以下情况,导致RPMB认证不通过的情况:It should be understood that the embodiment of the present application only obtains the count value of the counter when the counter is in an idle state. When the counter is in the idle state and the RPMB is in the state of not storing data, the count value of the counter will not change. In this case, the following situations will not occur, causing RPMB certification to fail:
示例性的,计数器通过kernel向第一TA返回的计数值N,第一TA采用计数值N进行认证计算,得到第一认证数据。而RPMB由于存入数据,更新了计数器的计数值N+1,这样导致RPMB在采用计数值(N+1)对第一TA发送的待存储数据进行认证计算,得到的第二认证数据。由于第一认证数据和第二认证数据是采用了不同的计数值对相同的待存储数据进行认证得到。因此,第一认证数据和第二认证数据之间不匹配。也即是说,RPMB因为认证不通过,拒绝存储第一TA发送的待存储数据。For example, the counter returns the count value N to the first TA through the kernel, and the first TA uses the count value N to perform authentication calculations to obtain the first authentication data. Since RPMB stores data, it updates the count value N+1 of the counter. This causes RPMB to use the count value (N+1) to perform authentication calculations on the data to be stored sent by the first TA, and obtain the second authentication data. Because the first authentication data and the second authentication data are obtained by using different count values to authenticate the same data to be stored. Therefore, there is a mismatch between the first authentication data and the second authentication data. That is to say, RPMB refuses to store the data to be stored sent by the first TA because the authentication fails.
在一种可能的情况下,当第一TA向RPMB写入数据的过程中,第二TA向kernel发送写入请求,此时kernel向RPMB请求获取计数器的计数值时,RPMB正在存储第一TA发送的待存储数据,相当于RPMB中的计数器处于忙碌状态。需要等待第一TA完成向RPMB写入数据的流程之后,再向第二TA返回更新后的计数器的计数值。In one possible situation, when the first TA is writing data to RPMB, the second TA sends a write request to the kernel. At this time, when the kernel requests RPMB to obtain the count value of the counter, RPMB is storing the first TA. The data sent to be stored is equivalent to the counter in RPMB being busy. It is necessary to wait for the first TA to complete the process of writing data to the RPMB, and then return the updated counter value to the second TA.
示例性的,第一TA向RPMB发送写入请求,其中,写入请求用于请求获取计数器的计数值。kernel在接收到写入请求之后,确定计数器的状态是否是空闲状态,若是,则将计数器的状态修改为忙碌状态,并获取计数器的计数值,向第一TA返回计数器的计数值。此时,若第二TEE中运行的第二TA向kernel发送写入请求。kernel确定计数器的状态为忙碌状态,并开始等待计数器的状态为空闲状态。同时第一TA使用安全密钥对待存储数据和计数值进行哈希计算,得到第一认证数据。第一TA进而根据第一认证数据、计数值和待存储数据得到第一数据包,向kernel发送第一数据包。kernel向RPMB发送第一数据包之后,第一TA读取kernel的写入RPMB的结果。若RPMB已经成功写入待存储数据,则将计数器的状态设置为空闲状态,并向第一TA返回已经写入成功的消息,其中,写入成功的消息中包括更新后的计数值(例如,在前述计数值加一得到更新后的计数值)。第一TA基于返回的消息,确定已经向RPMB成功写入待存储数据。此时,计数器的状态才会被更改为空闲状态,kernel才向第二TA返回计数器的更新后的计数值。For example, the first TA sends a write request to RPMB, where the write request is used to request to obtain the count value of the counter. After receiving the write request, the kernel determines whether the state of the counter is the idle state. If so, it modifies the state of the counter to the busy state, obtains the count value of the counter, and returns the count value of the counter to the first TA. At this time, if the second TA running in the second TEE sends a write request to the kernel. The kernel determines that the counter's status is busy and begins waiting for the counter's status to be idle. At the same time, the first TA uses the security key to perform hash calculation on the data to be stored and the count value to obtain the first authentication data. The first TA further obtains the first data packet based on the first authentication data, the count value and the data to be stored, and sends the first data packet to the kernel. After the kernel sends the first data packet to RPMB, the first TA reads the result written by the kernel into RPMB. If the RPMB has successfully written the data to be stored, the state of the counter is set to the idle state, and a successful writing message is returned to the first TA, where the successful writing message includes the updated count value (for example, Add one to the aforementioned count value to obtain the updated count value). Based on the returned message, the first TA determines that the data to be stored has been successfully written to RPMB. At this time, the status of the counter will be changed to the idle state, and the kernel will return the updated count value of the counter to the second TA.
应理解,计数器向第一TA返回计数值之后,通常会将计数器的状态设置为忙碌状态。在计数器的状态为忙碌状态的情况下,其他TEE上运行的TA不能获取计数值。这样能够使得第一TA向RPMB写入数据的过程中,其他TEE上运行的TA不能获取计数值,进而不能向RPMB写入数据的情况,也即是避免了其他TEE上运行的TA与第一TA同时向RPMB写入数据导致的计数值冲突的情况。It should be understood that after the counter returns the count value to the first TA, the status of the counter is usually set to the busy state. When the status of the counter is busy, TAs running on other TEEs cannot obtain the count value. In this way, during the process of the first TA writing data to RPMB, TAs running on other TEEs cannot obtain the count value, and thus cannot write data to RPMB, which means that the TAs running on other TEEs are prevented from interacting with the first TA. Count value conflicts caused by TA writing data to RPMB at the same time.
应理解,本申请实施例是以第一TA向RPMB存储数据为例说明的,当第二TA向RPMB存储数据时,与第一TA类似,也需要确定计数器当前处于空闲状态还是忙碌状态。It should be understood that the embodiment of the present application takes the first TA to store data in RPMB as an example. When the second TA stores data in RPMB, similar to the first TA, it also needs to determine whether the counter is currently in an idle state or a busy state.
示例性的,第二TA确定计数器处于空闲状态或者忙碌状态。若是空闲状态,则获取计数器在当前时刻的计数值;若是忙碌状态,则第二TA处于等待获取计数值的状态,直至计数器从忙碌状态变为空闲状态,例如第一TA完成向RPMB的数据存储。For example, the second TA determines that the counter is in an idle state or a busy state. If it is in the idle state, the count value of the counter at the current moment is obtained; if it is in the busy state, the second TA is in a state of waiting to obtain the count value until the counter changes from the busy state to the idle state, for example, the first TA completes data storage to RPMB .
S205、第一TA根据当前时刻的计数值、安全密钥和待存储数据得到第一数据包。S205. The first TA obtains the first data packet based on the current count value, the security key and the data to be stored.
在一种可能的情况下,第一TA可以采用安全密钥对待存储数据进行认证计算,得到第一认证数据,然后根据第一认证数据生成第一数据包。In one possible case, the first TA can use the security key to perform authentication calculation on the data to be stored, obtain the first authentication data, and then generate the first data packet based on the first authentication data.
示例性的,第一TA可以采用安全密钥对待存储数据和当前时刻的计数值进行认证计算,得到第一认证数据,然后将第一认证数据、待存储数据、当前时刻的计数值组包,得到第一数据包。For example, the first TA can use the security key to perform authentication calculations on the data to be stored and the count value at the current moment to obtain the first authentication data, and then package the first authentication data, the data to be stored, and the count value at the current moment. Get the first packet.
示例性的,第一TA可以采用安全密钥通过哈希运算消息认证码(Hash-basedMessage Authentication Code,HMAC)对待存储数据进行计算,得到第一认证数据。其中,HMAC是一种基于Hash函数和密钥进行消息认证的方法,是当前许多安全协议所选用的提供认证服务的方式,应用十分广泛,例如,在互联网安全协议(Internet Protocol Security,IPSec)和其他网络协议(例如SSL)中,HMAC都有广泛应用,并且经受住了多种形式攻击的考验。基于此,HMAC也可以被称为现有的Internet安全标准。For example, the first TA can use the security key to calculate the data to be stored through a Hash-based Message Authentication Code (HMAC) to obtain the first authentication data. Among them, HMAC is a message authentication method based on Hash function and key. It is the method selected by many current security protocols to provide authentication services. It is widely used. For example, in Internet Protocol Security (IPSec) and HMAC is widely used in other network protocols (such as SSL) and has withstood the test of various forms of attacks. Based on this, HMAC can also be called an existing Internet security standard.
在本申请的实施例中,第一TA采用安全密钥通过哈希运算对待存储数据进行认证计算,得到第一认证数据,由于哈希运算是目前被广泛应用的,且经受了多种形式攻击的加密算法,使得通过哈希运算得到的第一认证数据是更加可靠的加密数据,提高了根据第一认证数据和待存储数据得到的第一数据包的安全性。In the embodiment of this application, the first TA uses the security key to perform authentication calculation on the data to be stored through hash operation to obtain the first authentication data. Since hash operation is currently widely used and has withstood various forms of attacks, The encryption algorithm makes the first authentication data obtained through hash operation more reliable encrypted data, and improves the security of the first data packet obtained based on the first authentication data and the data to be stored.
示例性的,第一TA还可以采用安全密钥通过密码块链接消息验证码(CipherBlock Chaining-Message Authentication Code,CMAC)对待存储数据进行计算,得到第一认证数据。For example, the first TA can also use the security key to calculate the data to be stored through a CipherBlock Chaining-Message Authentication Code (CMAC) to obtain the first authentication data.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,然后,第一TA确定计数器是否处于空闲状态,并在计数器处于空闲状态时,获取计数器的计数值,在计数器处于忙碌状态时,等待获取计数值的状态,直至计数器处于空闲状态,获取到计数值。第一TA采用安全密钥对计数值和待存储数据进行认证计算得到第一认证数据,然后根据计数值、第一认证数据和待存储数据得到第一数据包,并向RPMB发送第一数据包。这样使得第一TA向RPMB发送的第一数据包中的第一认证数据采用的计数值,与RPMB进行校验得到的第二认证数据采用的计数值是相同的。避免了在RPMB存入第二TEE中运行的第二TA发送的数据的过程中,RPMB向第一TEE中运行第一TA发送计数值,进而导致RPMB存储第二TA发送的数据之后,采用更新后的计数值去校验第一TA发送的第一数据包的情况。也即是说,采用本申请实施例提供的数据存储方法,避免了第一TA得到第一认证数据所采用的计数值,与RPMB对第一数据进行校验所采用的计数值不同,进而导致的认证不通过,RPMB无法存储第一TA发送的待存储数据的情况。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA, and then the first TA determines whether the counter is in an idle state, and obtains the counter when the counter is in an idle state. When the counter is in a busy state, it waits to obtain the count value until the counter is in an idle state and obtains the count value. The first TA uses the security key to authenticate and calculate the count value and the data to be stored to obtain the first authentication data, and then obtains the first data packet based on the count value, the first authentication data and the data to be stored, and sends the first data packet to RPMB. . In this way, the count value adopted by the first authentication data in the first data packet sent by the first TA to the RPMB is the same as the count value adopted by the second authentication data obtained by verification by the RPMB. It avoids that during the process of RPMB storing the data sent by the second TA running in the second TEE, RPMB sends the count value to the first TA running in the first TEE, which in turn causes RPMB to store the data sent by the second TA and use the update method. The subsequent count value is used to verify the first data packet sent by the first TA. That is to say, by using the data storage method provided by the embodiment of the present application, it is avoided that the count value used by the first TA to obtain the first authentication data is different from the count value used by RPMB to verify the first data, thus causing The authentication fails and RPMB cannot store the data to be stored sent by the first TA.
S206、第一TA向RPMB发送第一数据包。S206. The first TA sends the first data packet to RPMB.
S207、RPMB采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据。S207. RPMB uses the security key to perform authentication calculation on the data to be stored in the first data packet to obtain the second authentication data.
应理解,RPMB中存储的安全密钥与第二TEE中存储的安全密钥相同。It should be understood that the security key stored in the RPMB is the same as the security key stored in the second TEE.
应理解,在RPMB向第一TA返回当前时刻的计数值之后,计数器并未更新计数值。因此,在RPMB接收到第一数据包时,计数器的计数值与返回第一TA的当前时刻的计数值相同。It should be understood that after RPMB returns the count value at the current time to the first TA, the counter does not update the count value. Therefore, when the RPMB receives the first data packet, the count value of the counter is the same as the count value at the current time when the first TA is returned.
RPMB采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据可以是指RPMB采用安全密钥对第一数据包中的待存储数据和当前时刻的计数值进行认证计算,得到的第二认证数值。RPMB uses the security key to perform authentication calculations on the data to be stored in the first data packet. Obtaining the second authentication data may mean that RPMB uses the security key to authenticate the data to be stored in the first data packet and the count value at the current moment. Calculate and obtain the second authentication value.
由于第一TA在进行认证计算时,可以采用哈希运算消息认证码(Hash-basedMessage Authentication Code,HMAC)对待存储数据进行计算,也可以采用密码块链接消息验证码(Cipher Block Chaining-Message Authentication Code,CMAC)对待存储数据进行计算。因此,RPMB在采用安全密钥对第一数据包中的待存储数据进行认证计算,通常采用与第一TA相同的认证计算。When the first TA performs authentication calculations, it can use the Hash-based Message Authentication Code (HMAC) to calculate the data to be stored, or it can also use the Cipher Block Chaining-Message Authentication Code (Cipher Block Chaining-Message Authentication Code). , CMAC) is calculated on the data to be stored. Therefore, RPMB uses the security key to perform authentication calculation on the data to be stored in the first data packet, and usually uses the same authentication calculation as the first TA.
示例性的,第一TA采用哈希运算消息认证码对待存储数据进行计算,得到第一认证数据,则RPMB也采用哈希运算消息认证码对待存储数据进行计算,得到第二认证数据。For example, the first TA uses the hash operation message authentication code to calculate the data to be stored, and obtains the first authentication data. Then the RPMB also uses the hash operation message authentication code to calculate the data to be stored, and obtains the second authentication data.
示例性的,第一TA采用密码块链接消息验证码对待存储数据进行计算,得到第一认证数据,则RPMB也采用密码块链接消息验证码对待存储数据进行计算,得到第二认证数据。For example, the first TA uses the cipher block chain message verification code to calculate the data to be stored and obtains the first authentication data. Then RPMB also uses the cipher block chain message verification code to calculate the data to be stored and obtains the second authentication data.
S208、在第二认证数据与第一认证数据匹配的情况下,RPMB存储待存储数据。S208. If the second authentication data matches the first authentication data, RPMB stores the data to be stored.
由上述描述可知,第一认证数据和第二认证数据是采用了相同的认证计算,对相同的计数值和待存储数据进行认证计算得到的。因此在第一认证数据和第二认证数据匹配的情况下,则说明第一数据包是第一TA发送给RPMB存储的安全的数据包,而不是攻击RPMB的数据包。It can be seen from the above description that the first authentication data and the second authentication data are obtained by using the same authentication calculation and performing authentication calculation on the same count value and data to be stored. Therefore, when the first authentication data and the second authentication data match, it means that the first data packet is a safe data packet sent by the first TA to be stored in RPMB, rather than a data packet attacking RPMB.
应理解,第一认证数据和第二认证数据匹配可以是指第一认证数据和第二认证数据完全相同,也可以是指第一认证数据中部分数据和第二认证数据中的部分数据相同,其中,相同数据的占比大于预设阈值。It should be understood that matching the first authentication data and the second authentication data may mean that the first authentication data and the second authentication data are exactly the same, or it may mean that part of the data in the first authentication data and part of the data in the second authentication data are the same. Among them, the proportion of the same data is greater than the preset threshold.
本申请的实施例中提供的数据存储方法,应用于包括至少两个TEE的电子设备中,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,该方法包括:第二TA向第一TA发送安全密钥,然后,第一TA确定计数器是否处于空闲状态,并在计数器处于空闲状态时,获取计数器的计数值,在计数器处于忙碌状态时,等待获取计数值的状态,直至获取到计数值。第一TA采用安全密钥对返回的计数值和待存储数据进行认证计算得到第一认证数据,然后根据计数值、第一认证数据和待存储数据得到第一数据包,并向RPMB发送第一数据包。RPMB在接收到第一数据包之后,采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据,并在第二认证数据和第一认证数据匹配的情况下,存储待存储数据。这样使得存入RPMB的数据均是RPMB校验通过的数据,提高了存储RPMB中数据的安全性。The data storage method provided in the embodiment of the present application is applied to an electronic device including at least two TEEs. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to a TEE that does not store a security key. The second TEE refers to the TEE that stores the security key. The method includes: the second TA sends the security key to the first TA, and then the first TA determines whether the counter is in an idle state, and obtains the counter when the counter is in an idle state. When the counter is in a busy state, wait for the count value to be obtained until the count value is obtained. The first TA uses the security key to authenticate and calculate the returned count value and the data to be stored to obtain the first authentication data, and then obtains the first data packet based on the count value, the first authentication data and the data to be stored, and sends the first data packet to RPMB. data pack. After receiving the first data packet, RPMB uses the security key to perform authentication calculations on the data to be stored in the first data packet to obtain the second authentication data, and when the second authentication data matches the first authentication data, Store the data to be stored. In this way, the data stored in RPMB are all data that have passed the RPMB verification, which improves the security of data stored in RPMB.
在一种可能的情况下,待存储数据可以是指纹传感器采集的数据。In one possible case, the data to be stored may be data collected by a fingerprint sensor.
示例性的,运行在Android系统的中CA,在接收到用户发起的指纹注册请求的情况下,向第一TEE中的指纹TA(第一TA)发送指纹注册请求,指纹TA基于指纹注册请求,调用指纹传感器,采集指纹数据,并将采集的指纹数据发送给指纹TA。下面通过图9和图10来详细说明指纹TA如何将指纹传感器采集得到的指纹数据存储至RPMB中。For example, the CA running in the Android system, upon receiving a fingerprint registration request initiated by the user, sends a fingerprint registration request to the fingerprint TA (first TA) in the first TEE. The fingerprint TA is based on the fingerprint registration request. Call the fingerprint sensor, collect fingerprint data, and send the collected fingerprint data to the fingerprint TA. The following uses Figures 9 and 10 to explain in detail how the fingerprint TA stores the fingerprint data collected by the fingerprint sensor into the RPMB.
应理解,电子设备可以分为四种运行等级,分别为EL0、EL1、EL2和EL3。其中,应用程序的运行等级为EL0,驱动的运行等级为EL1,Hypervisor模块的运行等级为EL2,ATF模块的运行等级为EL3。It should be understood that electronic equipment can be divided into four operating levels, namely EL0, EL1, EL2 and EL3. Among them, the running level of the application is EL0, the running level of the driver is EL1, the running level of the hypervisor module is EL2, and the running level of the ATF module is EL3.
示例性的,本申请实施例所提供的数据存储方法可以应用在如图9所示的电子设备中。其中,Android系统(相当于REE)中有加密需求的应用程序,例如(指纹CA)。第一TEE(相当于第一TEE)中运行有指纹TA、第一代理TA和第一RPMB服务模块(相当于第一TA)。应理解,第一TA可以是多个应用程序,包括指纹TA、第一代理TA和第一RPMB服务模块。第二TEE(相当于第二TEE)中运行有第二代理TA和第二RPMB服务模块(相当于第二TA)。应理解,第二TA可以是多个应用程序,包括第二代理TA和第二RPMB服务模块。其中,第二RPMB服务模块中存储有安全密钥。应理解,指纹CA、指纹TA、第一RPMB服务模块、第一代理TA、第二代理TA和第二RPMB服务模块的运行等级为EL0。kernel中包括Hypervisor模块和ATF模块,其中,Hypervisor模块的运行等级为EL2,ATF模块的运行等级为EL3。如图9所示,电子设备中运行Android(REE)、第一TEE和第二TEE,第一TEE中未存储安全密钥,第二TEE存储安全密钥。第二TEE中运行的第一代理TA向第一TEE中运行的第一代理TA发送安全密钥。By way of example, the data storage method provided by the embodiment of the present application can be applied to the electronic device as shown in Figure 9. Among them, there are applications that require encryption in the Android system (equivalent to REE), such as (Fingerprint CA). The first TEE (equivalent to the first TEE) runs the fingerprint TA, the first agent TA and the first RPMB service module (equivalent to the first TA). It should be understood that the first TA may be multiple applications, including a fingerprint TA, a first proxy TA, and a first RPMB service module. The second agent TA and the second RPMB service module (equivalent to the second TA) run in the second TEE (equivalent to the second TEE). It should be understood that the second TA may be multiple applications, including a second proxy TA and a second RPMB service module. Among them, the security key is stored in the second RPMB service module. It should be understood that the running level of the fingerprint CA, the fingerprint TA, the first RPMB service module, the first agent TA, the second agent TA and the second RPMB service module is ELO. The kernel includes the Hypervisor module and the ATF module. The running level of the Hypervisor module is EL2 and the running level of the ATF module is EL3. As shown in Figure 9, the electronic device runs Android (REE), a first TEE, and a second TEE. The first TEE does not store the security key, and the second TEE stores the security key. The first agent TA running in the second TEE sends the security key to the first agent TA running in the first TEE.
下面结合图10对应用在图9所示的电子设备中的数据存储方法进行详细描述。The data storage method applied in the electronic device shown in FIG. 9 will be described in detail below with reference to FIG. 10 .
图10为本申请实施例提供的另一种数据存储方法的流程示意图,该方法应用于如图9所述的电子设备中,包括:Figure 10 is a schematic flowchart of another data storage method provided by an embodiment of the present application. This method is applied to the electronic device as shown in Figure 9 and includes:
S301、第二TEE(第二TEE)中运行的第二RPMB服务模块(相当于一个第二TA)向第二代理TA(相当于一个第二TA)发送安全密钥。S301. The second RPMB service module (equivalent to a second TA) running in the second TEE (second TEE) sends the security key to the second agent TA (equivalent to a second TA).
S302、第二代理TA向kernel中的ATF模块发送安全密钥。S302. The second agent TA sends the security key to the ATF module in the kernel.
S303、kernel中的ATF模块向第一TEE中运行的第一代理TA发送安全密钥。S303. The ATF module in the kernel sends the security key to the first agent TA running in the first TEE.
S304、运行在Android(REE)中的指纹CA响应指纹注册操作。S304. The fingerprint CA running in Android (REE) responds to the fingerprint registration operation.
S305、指纹CA向kernel中第一TEE tz驱动模块发送指纹注册请求。S305. The fingerprint CA sends a fingerprint registration request to the first TEE tz driver module in the kernel.
S306、第一TEE tz驱动模块向hypervisor模块发送指纹注册请求。S306. The first TEE tz driver module sends a fingerprint registration request to the hypervisor module.
S307、hypervisor模块向第一TEE(第一TEE)中运行的指纹TA(第一TA)发送指纹注册请求。S307. The hypervisor module sends a fingerprint registration request to the fingerprint TA (first TA) running in the first TEE (first TEE).
S308、指纹TA响应于指纹注册请求,调用指纹传感器,采集指纹数据(待存储数据)。S308. The fingerprint TA responds to the fingerprint registration request, calls the fingerprint sensor, and collects fingerprint data (data to be stored).
S309、指纹TA将指纹数据和RPMB写入请求类型发送给第一TEE中的第一RPMB服务模块。S309. The fingerprint TA sends the fingerprint data and the RPMB write request type to the first RPMB service module in the first TEE.
S310、第一TEE中的第一RPMB服务模块调用第一代理TA中的安全密钥对指纹数据和RPMB写入请求进行认证计算,得到第一认证数据。S310. The first RPMB service module in the first TEE calls the security key in the first agent TA to perform authentication calculations on the fingerprint data and the RPMB write request to obtain the first authentication data.
S311、第一RPMB服务模块根据第一认证数据,计数器的计数值及指纹数据生成第一数据包。S311. The first RPMB service module generates a first data packet based on the first authentication data, the count value of the counter and the fingerprint data.
S312、第一RPMB服务模块将第一数据包发送给kernel中的hypervisor模块。S312. The first RPMB service module sends the first data packet to the hypervisor module in the kernel.
S313、hypervisor模块将第一数据包发送给kernel中的第一TEE tz驱动。S313. The hypervisor module sends the first data packet to the first TEE tz driver in the kernel.
S314、kernel中的第一TEE tz驱动模块将第一数据包发送给Android中的存储设备驱动模块。S314. The first TEE tz driver module in the kernel sends the first data packet to the storage device driver module in Android.
示例性的,存储设备驱动模块是指eMMC驱动模块。For example, the storage device driver module refers to the eMMC driver module.
示例性的,存储设备驱动模块是指UFS驱动模块。For example, the storage device driver module refers to the UFS driver module.
S315、存储设备驱动模块将第一数据包发送给RPMB。S315. The storage device driver module sends the first data packet to RPMB.
本申请的实施例中,运行在第二TEE中第二代理TA向运行在第一TEE中的第一代理TA发送安全密钥,使得运行在第一TEE中的指纹TA可以将指纹数据发送给第一RPMB服务模块,以使第一RPMB服务模块调用第一代理TA中的安全密钥对指纹数据进行认证计算,得到第一认证数据,并根据第一认证数据和指纹数据生成第一数据包,进而向RPMB发送第一数据包,这样使得未存储安全密钥的第一TEE也可以将指纹数据存储在RPMB中,也即是说,采用本申请实施例提供的数据存储方法,实现了多TEE架构中每个TEE中运行的应用程序均能向RPMB写入数据的功能。In the embodiment of the present application, the second agent TA running in the second TEE sends the security key to the first agent TA running in the first TEE, so that the fingerprint TA running in the first TEE can send fingerprint data to The first RPMB service module is so that the first RPMB service module calls the security key in the first agent TA to perform authentication calculation on the fingerprint data, obtains the first authentication data, and generates the first data packet based on the first authentication data and the fingerprint data. , and then sends the first data packet to RPMB, so that the first TEE that does not store the security key can also store fingerprint data in RPMB. That is to say, using the data storage method provided by the embodiment of the present application, multiple In the TEE architecture, each application running in the TEE can write data to RPMB.
应该理解的是,虽然上述实施例中的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although each step in the flow chart in the above embodiment is shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flow chart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily sequential, but may be performed in turn or alternately with other steps or sub-steps of other steps or at least part of the stages.
图11为本申请实施例提供的电子设备的一种结构示意图。FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
应理解,电子设备可以执行图6至图10所示的数据存储方法,电子设备包括至少两个可信执行环境TEE,至少两个TEE包括第一TEE和第二TEE,第一TEE是指未存储安全密钥的TEE,第二TEE是指存储安全密钥的TEE,安全密钥是指重放保护内存块RPMB对存入数据进行校验的密钥;电子设备包括:获取单元610和处理单元620。It should be understood that the electronic device can execute the data storage methods shown in Figures 6 to 10. The electronic device includes at least two trusted execution environments TEE. The at least two TEEs include a first TEE and a second TEE. The first TEE refers to the untrusted execution environment TEE. The TEE that stores the security key, the second TEE refers to the TEE that stores the security key, and the security key refers to the key used by the replay protection memory block RPMB to verify the stored data; the electronic device includes: an acquisition unit 610 and a processing unit Unit 620.
处理单元620用于控制第二可信应用程序TA向第一可信应用程序TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序;The processing unit 620 is used to control the second trusted application TA to send the security key to the first trusted application TA. The first TA refers to the trusted application running on the first TEE, and the second TA refers to the trusted application running on the first TEE. Trusted applications in the second TEE;
处理单元620用于控制第一TA根据安全密钥和待存储数据,得到第一数据包;The processing unit 620 is used to control the first TA to obtain the first data packet according to the security key and the data to be stored;
处理单元620用于控制第一TA向RPMB发送第一数据包;The processing unit 620 is used to control the first TA to send the first data packet to RPMB;
处理单元620用于控制RPMB基于第一数据包存储待存储数据。The processing unit 620 is used to control RPMB to store the data to be stored based on the first data packet.
可选地,作为一个实施例,处理单元620用于控制第一TA在计数器处于空闲状态时,第一TA获取第一计数值,第一计数值是指计数器在当前时刻的计数值;第一TA根据第一计数值、安全密钥和待存储数据得到第一数据包。Optionally, as an embodiment, the processing unit 620 is configured to control the first TA to obtain a first count value when the counter is in an idle state. The first count value refers to the count value of the counter at the current moment; the first The TA obtains the first data packet according to the first count value, the security key and the data to be stored.
可选地,作为一个实施例,上述计数器处于空闲状态包括RPMB当前处于未存储数据的状态。Optionally, as an embodiment, the idle state of the above counter includes that the RPMB is currently in a state of not storing data.
可选地,作为一个实施例,处理单元620用于在计数器处于忙碌状态时,控制第一TA处于等待获取第一计数值的状态,忙碌状态包括RPMB当前处于存储第二TA的数据的状态。Optionally, as an embodiment, the processing unit 620 is configured to control the first TA to be in a state of waiting to obtain the first count value when the counter is in a busy state. The busy state includes that the RPMB is currently in a state of storing data of the second TA.
可选地,作为一个实施例,处理单元620用于上述第一数据包还包括第一认证数据,第一认证数据为第一TA采用安全密钥对待存储数据进行认证计算得到的数据,处理单元620具体用于控制RPMB采用安全密钥对第一数据包中的待存储数据进行认证计算,得到第二认证数据;在第二认证数据与第一认证数据匹配的情况下,RPMB存储待存储数据。Optionally, as an embodiment, the processing unit 620 is configured for the above-mentioned first data packet to also include first authentication data. The first authentication data is data obtained by the first TA using the security key to authenticate and calculate the data to be stored. The processing unit 620 620 is specifically used to control RPMB to use the security key to perform authentication calculations on the data to be stored in the first data packet to obtain the second authentication data; when the second authentication data matches the first authentication data, RPMB stores the data to be stored. .
可选地,作为一个实施例,上述认证计算包括哈希HMAC计算。Optionally, as an embodiment, the above authentication calculation includes hash HMAC calculation.
在本申请的实施例中,第一TA采用安全密钥通过哈希运算对待存储数据进行认证计算,得到第一认证数据,由于哈希运算是目前被广泛应用的,且经受了多种形式攻击的加密算法,使得通过哈希运算得到的第一认证数据是更加可靠的加密数据,提高了根据第一认证数据和待存储数据得到的第一数据包的安全性。In the embodiment of this application, the first TA uses the security key to perform authentication calculation on the data to be stored through hash operation to obtain the first authentication data. Since hash operation is currently widely used and has withstood various forms of attacks, The encryption algorithm makes the first authentication data obtained through hash operation more reliable encrypted data, and improves the security of the first data packet obtained based on the first authentication data and the data to be stored.
可选地,作为一个实施例,上述待存储数据为第一TA调用第一传感器采集得到的数据。Optionally, as an embodiment, the above-mentioned data to be stored is data collected by the first TA by calling the first sensor.
可选地,作为一个实施例,上述第一传感器包括指纹采集器。Optionally, as an embodiment, the above-mentioned first sensor includes a fingerprint collector.
本实施例提供的数据存储装置,用于执行上述实施例的数据存储方法,技术原理和技术效果相似,此处不再赘述。The data storage device provided in this embodiment is used to execute the data storage method of the above embodiment. The technical principles and technical effects are similar and will not be described again here.
需要说明的是,上述电子设备以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件形式实现,对此不作具体限定。It should be noted that the above electronic equipment is embodied in the form of functional units. The term "unit" here can be implemented in the form of software and/or hardware, and is not specifically limited.
例如,“单元”可以是实现上述功能的软件程序、硬件电路或二者结合。所述硬件电路可能包括应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。For example, a "unit" may be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuitry may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor) for executing one or more software or firmware programs. etc.) and memory, merged logic circuitry, and/or other suitable components to support the described functionality.
因此,在本申请的实施例中描述的各示例的单元,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the electronic device includes corresponding hardware and/or software modules that perform each function. In conjunction with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions in conjunction with the embodiments for each specific application, but such implementations should not be considered to be beyond the scope of this application.
本申请实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。需要说明的是,本申请实施例中模块的名称是示意性的,实际实现时对模块的名称不做限定。Embodiments of the present application can divide the electronic device into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods. It should be noted that the names of the modules in the embodiments of this application are schematic, and there are no restrictions on the names of the modules during actual implementation.
图12示出了本申请提供的一种电子设备的结构示意图。图12中的虚线表示该单元或该模块为可选的。电子设备700可用于实现上述方法实施例中描述的数据存储方法。Figure 12 shows a schematic structural diagram of an electronic device provided by this application. The dashed line in Figure 12 indicates that the unit or module is optional. The electronic device 700 may be used to implement the data storage method described in the above method embodiment.
电子设备700包括一个或多个处理器701,该一个或多个处理器701可支持电子设备700实现方法实施例中的数据存储方法。处理器701可以是通用处理器或者专用处理器。例如,处理器701可以是中央处理器(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integratedcircuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其它可编程逻辑器件,如分立门、晶体管逻辑器件或分立硬件组件。The electronic device 700 includes one or more processors 701, which can support the electronic device 700 to implement the data storage method in the method embodiment. Processor 701 may be a general-purpose processor or a special-purpose processor. For example, the processor 701 may be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), or a field programmable gate array. array, FPGA) or other programmable logic devices such as discrete gates, transistor logic devices or discrete hardware components.
处理器701可以用于对电子设备700进行控制,执行软件程序,处理软件程序的数据。电子设备700还可以包括通信单元705,用以实现信号的输入(接收)和输出(发送)。The processor 701 can be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit 705 to implement input (reception) and output (transmission) of signals.
例如,电子设备700可以是芯片,通信单元705可以是该芯片的输入和/或输出电路,或者,通信单元705可以是该芯片的通信接口,该芯片可以作为终端设备或其它电子设备的组成部分。For example, the electronic device 700 may be a chip, and the communication unit 705 may be an input and/or output circuit of the chip, or the communication unit 705 may be a communication interface of the chip, and the chip may be used as a component of a terminal device or other electronic device. .
又例如,电子设备700可以是终端设备,通信单元705可以是该终端设备的收发器,或者,通信单元705可以是该终端设备的收发电路。For another example, the electronic device 700 may be a terminal device, and the communication unit 705 may be a transceiver of the terminal device, or the communication unit 705 may be a transceiver circuit of the terminal device.
电子设备700中可以包括一个或多个存储器702,其上存有程序704,程序704可被处理器701运行,生成指令703,使得处理器701根据指令703执行上述方法实施例中描述的阻抗匹配方法。The electronic device 700 may include one or more memories 702 on which a program 704 is stored. The program 704 may be run by the processor 701 to generate an instruction 703, so that the processor 701 performs the impedance matching described in the above method embodiment according to the instruction 703. method.
可选地,存储器702中还可以存储有数据。可选地,处理器701还可以读取存储器702中存储的数据,该数据可以与程序704存储在相同的存储地址,该数据也可以与程序704存储在不同的存储地址。Optionally, data may also be stored in the memory 702 . Optionally, the processor 701 can also read the data stored in the memory 702. The data may be stored at the same storage address as the program 704, or the data may be stored at a different storage address than the program 704.
处理器701和存储器702可以单独设置,也可以集成在一起;例如,集成在终端设备的系统级芯片(system on chip,SOC)上。The processor 701 and the memory 702 can be provided separately or integrated together; for example, integrated on a system on chip (SOC) of the terminal device.
示例性地,存储器702可以用于存储本申请实施例中提供的数据存储方法的相关程序704,处理器701可以用于在进行数据存储时调用存储器702中存储的数据存储方法的相关程序704,执行本申请实施例的数据存储方法;包括:第二可信应用程序TA向第一可信应用程序TA发送安全密钥,第一TA是指运行在第一TEE上的可信应用程序,第二TA是指运行在第二TEE中的可信应用程序;第一TA根据安全密钥和待存储数据,得到第一数据包;第一TA向RPMB发送第一数据包;RPMB基于第一数据包存储待存储数据。For example, the memory 702 can be used to store the related program 704 of the data storage method provided in the embodiment of the present application, and the processor 701 can be used to call the related program 704 of the data storage method stored in the memory 702 when performing data storage. Executing the data storage method of the embodiment of the present application includes: the second trusted application TA sends a security key to the first trusted application TA. The first TA refers to the trusted application running on the first TEE. The second TA refers to the trusted application running in the second TEE; the first TA obtains the first data packet based on the security key and the data to be stored; the first TA sends the first data packet to RPMB; RPMB based on the first data The package stores the data to be stored.
本申请还提供了一种计算机程序产品,该计算机程序产品被处理器701执行时实现本申请中任一方法实施例所述的数据存储方法。This application also provides a computer program product, which when executed by the processor 701 implements the data storage method described in any method embodiment of this application.
该计算机程序产品可以存储在存储器702中,例如是程序704,程序704经过预处理、编译、汇编和链接等处理过程最终被转换为能够被处理器701执行的可执行目标文件。The computer program product may be stored in the memory 702, such as a program 704. The program 704 is finally converted into an executable object file that can be executed by the processor 701 through processes such as preprocessing, compilation, assembly, and linking.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机执行时实现本申请中任一方法实施例所述的数据存储方法。该计算机程序可以是高级语言程序,也可以是可执行目标程序。This application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a computer, the data storage method described in any method embodiment of this application is implemented. The computer program may be a high-level language program or an executable object program.
该计算机可读存储介质例如是存储器702。存储器702可以是易失性存储器或非易失性存储器,或者,存储器702可以同时包括易失性存储器和非易失性存储器。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmableROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(randomaccess memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamicRAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The computer-readable storage medium is memory 702, for example. Memory 702 may be volatile memory or non-volatile memory, or memory 702 may include both volatile memory and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable memory Except programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM) ), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In this application, "at least one" refers to one or more, and "plurality" refers to two or more. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple .
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的;例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式;例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative; for example, the division of the units is only a logical function division, and there may be other division methods during actual implementation; for example, multiple units or components may be combined Either it can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210878228.5ACN117492634A (en) | 2022-07-25 | 2022-07-25 | Data storage methods and electronic devices |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210878228.5ACN117492634A (en) | 2022-07-25 | 2022-07-25 | Data storage methods and electronic devices |
| Publication Number | Publication Date |
|---|---|
| CN117492634Atrue CN117492634A (en) | 2024-02-02 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210878228.5APendingCN117492634A (en) | 2022-07-25 | 2022-07-25 | Data storage methods and electronic devices |
| Country | Link |
|---|---|
| CN (1) | CN117492634A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140143534A1 (en)* | 2012-11-19 | 2014-05-22 | At&T Mobility Ii, Llc | Systems for provisioning universal integrated circuit cards |
| CN108108631A (en)* | 2017-11-29 | 2018-06-01 | 晨星半导体股份有限公司 | Root key processing method and related device |
| WO2019084908A1 (en)* | 2017-11-03 | 2019-05-09 | Nokia Technologies Oy | Method and apparatus for trusted computing |
| CN112287399A (en)* | 2019-07-22 | 2021-01-29 | 科大国盾量子技术股份有限公司 | Digital signature method, system and device |
| WO2021025482A1 (en)* | 2019-08-06 | 2021-02-11 | Samsung Electronics Co., Ltd. | Electronic device and method for generating attestation certificate based on fused key |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140143534A1 (en)* | 2012-11-19 | 2014-05-22 | At&T Mobility Ii, Llc | Systems for provisioning universal integrated circuit cards |
| WO2019084908A1 (en)* | 2017-11-03 | 2019-05-09 | Nokia Technologies Oy | Method and apparatus for trusted computing |
| CN108108631A (en)* | 2017-11-29 | 2018-06-01 | 晨星半导体股份有限公司 | Root key processing method and related device |
| CN112287399A (en)* | 2019-07-22 | 2021-01-29 | 科大国盾量子技术股份有限公司 | Digital signature method, system and device |
| WO2021025482A1 (en)* | 2019-08-06 | 2021-02-11 | Samsung Electronics Co., Ltd. | Electronic device and method for generating attestation certificate based on fused key |
| Publication | Publication Date | Title |
|---|---|---|
| US10951424B2 (en) | Method, apparatus, and electronic device for communication between blockchain nodes, and method, apparatus, and electronic device for blockchain-based certificate management | |
| WO2020192447A1 (en) | File access authority authentication method and electronic device | |
| WO2021036706A1 (en) | Trusted application operation method and information processing and memory allocation method and apparatus | |
| CN108595970A (en) | Configuration method and device of processing assembly, terminal and storage medium | |
| US20170201378A1 (en) | Electronic device and method for authenticating identification information thereof | |
| JP2016512407A (en) | Trusted Service Manager Trusted Security Zone Container for data protection and confidentiality | |
| KR20240152300A (en) | Verified presentation of non-fungible tokens | |
| CN113836538B (en) | Data model processing method, device, server and storage medium | |
| WO2020187008A1 (en) | Service invocation control method, service invocation method, device, and terminal | |
| WO2023024900A1 (en) | Method for secure boot checking and electronic device | |
| CN117668933B (en) | Data storage method and electronic device | |
| CN117131481A (en) | User login method and electronic equipment | |
| KR20140112399A (en) | Application access control method and electronic device implementing the same | |
| WO2021098823A1 (en) | Memory isolation apparatus, memory isolation method, and related device | |
| KR20170059082A (en) | File operation processing method and electronic device supporting the same | |
| WO2023051355A1 (en) | Permission check method and electronic device | |
| CN116049812B (en) | Methods and electronic devices for accessing hardware resources | |
| CN117492636A (en) | Data storage method and electronic equipment | |
| CN110602689B (en) | Method and device for safely operating equipment | |
| CN115544586B (en) | Safe storage method for user data, electronic device and storage medium | |
| CN113468606A (en) | Application program access method and electronic equipment | |
| CN117492634A (en) | Data storage methods and electronic devices | |
| CN116860157A (en) | Data processing method and device and electronic equipment | |
| CN117492635A (en) | Data storage method and electronic equipment | |
| CN115146253A (en) | A mobile App login method, mobile device and system |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information | Country or region after:China Address after:Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after:Honor Terminal Co.,Ltd. Address before:3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before:Honor Device Co.,Ltd. Country or region before:China |