Mobile terminal and access method of embedded security module based on mobile terminal
Technical Field
The invention relates to the technical field of secure communication, in particular to a mobile terminal and an access method of an embedded security module based on the mobile terminal.
Background
With the rapid development of mobile terminals such as smart phones, mobile phones are no longer simple communication tools, mobile payment is due to new requirements of mobile phones, and gradually becomes a hot problem for research of mobile operators, mobile phone manufacturers and SIM card manufacturers, and with the popularization and application of mobile payment, the security problem of mobile payment is also more and more emphasized.
At present, one part of mobile payment is non-contact micropayment based on near field communication technology NFC, such as a one-card, and the other part of mobile internet-based bank payment, such as various wallets. The scheme based on the near field communication technology NFC mainly comprises an SIM card, a single-wire protocol SWP card, an information encryption security chip SD card, an embedded security module eSE and the like, and represents different interest groups such as operators, banks, mobile phone manufacturers and the like behind the SIM card, the SWP card, the information encryption security chip SD card and the embedded security module eSE. From the handset side implementation, various schemes based on HCE (host card emulation) and eSE are included. In contrast, the HCE-based solution is simple to implement, has the disadvantages of being completely software-based and having an unavoidable security problem, and the eSE-based full-terminal solution is also advantageous and is motivated by many smart phone manufacturers.
Fig. 1 shows a schematic structural diagram of an internal structure of a Mobile phone of a current full-terminal solution based on an eSE, where an operating system architecture in a Mobile Processor of a Mobile main Processor of the Mobile phone includes two major parts, a first part is a REE end (Rich executive environment, which generally refers to a general-purpose operating system) and includes a user-side application CA, and a second part is a trusted execution environment TEE end and includes a trusted application TA, and for access to an eSE, the Mobile phone can interact with external data (such as a trusted service management platform TSM) through an application installation package APK, establish communication with the eSE through an openmobileiapi based on a SWP interface, support remote content management of the eSE by the TSM, or can interact with an external non-connected device (such as a POS) through an NFC Controller (based on an NFC control interface specification NCI), complete interaction between the external non-connected device and the eSE based on the SWP interface, and in order to ensure security of access to the eSE, access to the eSE is generally completed under control of the TEE operating environment of the Mobile phone, security mechanisms inherent to the TEE can prohibit illegal access to the eSE. It can be seen that, at present, the access mode for the embedded security module eSE is single, and is finally completed between the NFC controller and the eSE based on the SWP interface.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a novel mobile terminal capable of realizing the secure access to an embedded security module eSE and an embedded security module access method based on the terminal.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
the utility model provides a mobile terminal, possess trusted operation environment module TEE among the mobile terminal, built-in embedded safe module eSE that has among the mobile terminal, trusted operation environment module TEE passes through the SPI interface and communicates with embedded safe module eSE, and trusted operation environment module TEE is the master equipment of SPI communication, and embedded safe module eSE is slave unit.
Further, according to the mobile terminal as described above, data transmission is performed between the trusted operating environment module TEE and the embedded security module eSE according to a preset data transmission protocol.
Further, as for the mobile terminal described above, the DATA frame of the preset DATA transmission protocol includes an address information byte NAD, a protocol control byte PCB, a DATA length LEN, a DATA block DATA, and a check code CRC; the address information byte NAD is directly used to identify the transmission direction of the data.
Further, a mobile terminal as above, the mobile terminal comprises a smart phone.
The embodiment of the invention also provides an access method of the embedded security module based on any one mobile terminal, which comprises the following steps:
the trusted operating environment module TEE sends request data to the embedded security module eSE based on the SPI interface, and receives response data returned by the embedded security module eSE according to the request data through the SPI interface.
Further, according to the access method of the embedded security module as described above, the request data includes a security application request or a content management request of the embedded security module eSE.
Further, according to the access method of the embedded security module, the security application request includes a security application request sent by the general execution environment module REE of the mobile terminal to the trusted execution environment module TEE and a security application request of the trusted execution environment module TEE itself.
Further, according to the access method of the embedded security module, data transmission is performed between the trusted operating environment module TEE and the embedded security module eSE according to a preset data transmission protocol.
Further, in the above access method for an embedded security module, the DATA frame of the preset DATA transmission protocol includes an address information byte NAD, a protocol control byte PCB, a DATA length LEN, a DATA block DATA, and a check code CRC; the address information byte NAD is directly used to identify the transmission direction of the data.
Further, according to the access method of the embedded security module, the trusted operating environment module TEE receives response data returned by the embedded security module eSE in a polling receiving mode or an interrupt receiving mode;
the polling receiving mode is as follows: after the trusted operating environment module TEE sends request data to the embedded security module eSE, the trusted operating environment module TEE actively acquires data from the embedded security module at set intervals until response data are received;
the interrupt receiving mode is as follows: and after the trusted operating environment module TEE sends the request data to the embedded security module eSE, exiting the communication process with the embedded security module eSE, and when monitoring an interrupt signal waiting for receiving data from the embedded security module eSE, entering the communication process again to receive response data sent by the embedded security module eSE.
The invention has the beneficial effects that: the mobile terminal and the access method of the embedded security module eSE based on the mobile terminal realize a new scheme for accessing the embedded security module eSE through the SPI under the trusted operating environment module TEE, and provide more choices for the application in the field of mobile security payment.
Drawings
Fig. 1 is a schematic structural diagram of modules in a conventional mobile phone;
fig. 2 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and the detailed description.
Fig. 2 shows a schematic structural diagram of a mobile terminal according to an embodiment of the present invention, and it can be seen from the diagram that the mobile terminal includes a trusted operating environment module TEE, an embedded security module eSE is built in the mobile terminal, the trusted operating environment module TEE communicates with the embedded security module eSE through an SPI interface, the trusted operating environment module TEE is a master device of SPI communication, and the embedded security module eSE is a slave device.
The SPI interface generally uses four lines including a serial clock signal line SCK, a master input/slave output data line MISO, a master output/slave input data line MOSI, and a slave enable signal CS line, and has four operation modes, i.e., mode0/1/2/3, according to the difference of the polarity and phase of the serial clock signal. However, the SPI does not define a transmission control protocol for data, and in order to solve this problem, in this embodiment, data transmission is performed between the trusted operating environment module TEE and the embedded security module eSE according to a preset data transmission protocol, so as to ensure completeness, accuracy, and stability of data transmission.
In an embodiment of the present invention, a structure of the DATA frame of the preset DATA transmission protocol is shown in the following table, and includes an address information byte NAD, a protocol control byte PCB, a DATA length LEN, a DATA block DATA, and a check code CRC.
NAD(1B) |
PCB(1B) |
LEN(2B) |
DATA |
CRC(2B) |
Wherein,
NAD: the data transmission method is used for distinguishing the transmission direction of data, and the transmission direction comprises two types, namely Master to Slave and Slave to Master, namely Master < - > Slave.
PCB: to define different frame formats. Such as Normal Frame, Reject Frame, timeutframe.
LEN length of data transmitted
DATA: transmitting data
CRC: frame check, checking correctness of data transmission
The mobile terminal provided by the invention realizes a new data transmission mode between the mobile terminal and the embedded security module thereof, and the scheme is completed under the control of the trusted operating environment module TEE, thereby ensuring the security access to the eSE, such as the security authentication of content management, keys and the like, and data access and the like of the mobile terminal to the eSE. It should be noted that, in addition to the trusted execution environment module TEE and the embedded security module eSE, the mobile terminal may further include various functional modules common to other terminal devices, such as a universal execution environment module REE, an NFC controller, and the like shown in fig. 2, which will be apparent to those skilled in the art. In this embodiment, the mobile terminal includes but is not limited to a smart phone, and may also be a smart band, a smart watch, and the like.
Based on the mobile terminal shown in fig. 2, the invention also provides an embedded security module access method, which mainly comprises the following steps:
the trusted operating environment module TEE sends request data to the embedded security module eSE based on the SPI interface, and receives response data returned by the embedded security module eSE according to the request data through the SPI interface.
Wherein the request data comprises a security application request or a content management request of an embedded security module eSE. The security application request includes, but is not limited to, a security application request sent by a general execution environment module REE of the mobile terminal to a trusted execution environment module TEE and a security application request of the trusted execution environment module TEE itself, for example, a client application CA in the general execution environment module REE needs the eSE to perform security processing on application data thereof, the general execution environment module REE sends the processing request and an interface API between the processing request and the trusted execution environment module TEE to the TEE, and the TEE sends the processing request and the interface API to the eSE through the SPI interface; or when the application data of the trusted application TA of the trusted operating environment module TEE itself needs the eSE to perform security processing, the TEE sends the security application request to the eSE. Of course, it will be clear to those skilled in the art that the completion of all operations in the mobile terminal is done by running in the terminal processor.
In this embodiment, data transmission is performed between the trusted operating environment module TEE and the embedded security module eSE according to a preset data transmission protocol. The DATA frame of the preset DATA transmission protocol comprises an address information byte NAD, a protocol control byte PCB, a DATA length LEN, a DATA block DATA and a check code CRC; the address information byte NAD is directly used to identify the transmission direction of the data.
In this embodiment, when the trusted operating environment module TEE receives response data returned by the embedded security module eSE according to the request data through the SPI interface, the trusted operating environment module TEE may receive the response data returned by the embedded security module eSE in a polling manner or an interrupt receiving manner. The polling receiving mode is specifically realized as follows: after the trusted operating environment module TEE, i.e. the master device master, sends out command data, the embedded security module eSE, i.e. the data transmitted from the slave device, is continuously delayed and polled (received) according to a set interval, and if the command data is not valid data, the receiving is continuously delayed until the valid data is received. The scheme is simple, and hardware and software expenses except for an SPI data line are not required to be increased by a master device. However, the CPU resources on the handset side are occupied during the polling phase.
The specific implementation of the interrupt receiving mode is as follows: and after the trusted operating environment module TEE sends the request data to the embedded security module eSE, exiting the communication process with the embedded security module eSE, and when monitoring an interrupt signal waiting for receiving data from the embedded security module eSE, entering the communication process again to receive response data sent by the embedded security module eSE. The interrupt scheme is that after the main device sends command data, the main device does not need to poll, the processing program can exit, when the eSE finishes processing and is ready to respond to the data, an interrupt signal is sent to the TEE, and when the TEE hardware (a main processor CPU of the mobile terminal) monitors the interrupt signal, the corresponding interrupt service program is triggered to enter to receive response information from the eSE. This solution would reduce the CPU occupation, but would place some extra demands on hardware and software (the master needs to implement the monitoring of the slave).
The mobile terminal and the embedded security module access method realize a mechanism for accessing the eSE through the SPI under the TEE trusted operation environment, increase an eSE security access mechanism, and can be popularized and applied in the field of mobile security payment. For example, the eSE may store sensitive data (such as a key) inside, the user data is transmitted to the eSE through the TEE and based on the SPI, the eSE performs data encryption or key distribution, and returns the result to the terminal, which is not known outside due to the data stored in the eSE and the operation performed by the eSE, thereby implementing a higher security level for mobile payment or other related mobile applications.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is intended to include such modifications and variations.