CN114756443B - Method for testing remote file operation of USIM card - Google Patents
Method for testing remote file operation of USIM card Download PDFInfo
- Publication number
- CN114756443B CN114756443B CN202110024871.7A CN202110024871A CN114756443B CN 114756443 B CN114756443 B CN 114756443B CN 202110024871 A CN202110024871 A CN 202110024871A CN 114756443 B CN114756443 B CN 114756443B
- Authority
- CN
- China
- Prior art keywords
- usim card
- file
- remote
- file operation
- file system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3612—Software analysis for verifying properties of programs by runtime analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
- H04W4/14—Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Abstract
The invention relates to a method for testing remote file operation of a USIM card, which is used for testing the remote file operation of the USIM card and ensuring the correctness of a file system of the USIM card operated by the remote file, and comprises the following steps: the method comprises the steps of assembling SMS-PP short messages, sending SMS-PP short messages with a random adjustment sequence to a USIM card, detecting information returned by the USIM card, checking whether remote file operation is successful or not, and initializing the file state of a USIM card file system and recovering the USIM card file system. The invention provides a set of complete and correct USIM card remote file operation test method, which realizes effective verification of the result of USIM card remote file operation in the development process of USIM card remote file operation, reduces the complexity of the USIM card remote file operation test process, and ensures the quality of USIM card products so as to reduce the development operation cost.
Description
Technical Field
The invention relates to the technical field of mobile communication, in particular to a method for testing remote file operation of a USIM card.
Background
With the technological progress, operators generally encounter the problem that a file system in a USIM card of a user is upgraded according to special requirements, but the USIM card is sent to a user hand, and the USIM card of the USIM card cannot be upgraded locally on site, and the USIM card of a remote file operation user is adopted to be upgraded under the condition that the user does not need to return to an operator business hall for upgrading, however, whether the USIM card file system of the remote file operation user succeeds or not needs to be tested and verified, and the USIM card file system of the remote file operation user is ensured to be correct.
Disclosure of Invention
The invention mainly solves the technical problem of providing a method for testing the remote file operation of the USIM card, which can test and verify the result of the remote file operation of the USIM card file system and ensure the correctness of the remote file operation of the USIM card file system.
In order to solve the technical problems, the technical scheme provided by the invention is as follows: a method for testing remote file operation of a USIM card comprises the following steps: assembling SMS-PP short messages; the USIM card is remotely operated by sending SMS-PP short messages to the USIM card randomly; detecting information returned by the USIM card; checking whether the remote file operation is successful;
further, assembling the SMS-PP message includes:
acquiring a USIM card file system, a remote file operation type of the USIM card file system, a security protocol configuration parameter of the remote file operation type of the USIM card file system and the maximum number of short messages which are sent to the USIM card between the USIM card and a server from a USIM card required configuration file; the remote file operation types of the USIM card file system include, but are not limited to: reading, updating, activating and deactivating; the security protocol configuration parameters of the remote file operation of the USIM card file system comprise TAR parameters, security indication SPI parameters, encryption indication KIC parameters and security message indication KID parameters which are indicated by application;
sending an USIM card file operation APDU instruction to the USIM card through the card reader to acquire the file information of a USIM card file system, wherein the method comprises the following steps: reading the ICCID of the USIM card through the USIM card file operation APDU instruction; acquiring a security Key of the USIM card from the USIM card personalized data file according to the ICCID, wherein the security Key comprises PIN, ADM, KIC Key and KID Key; sending a verification APDU instruction to a USIM card through a card reader to verify a security key of the USIM card to acquire the operation authority of a USIM card file system, wherein the operation authority of the USIM card file system comprises reading, updating, activating and deactivating; sending an APDU command to the USIM card through a card reader according to the operation authority of the USIM card file system to acquire the file information of the USIM card; wherein the file information includes: the file header information comprises file type, file state, security level of file operation, file size, record and circulation files, and the record and circulation files comprise: recording the number of files and the recording size of the files, wherein the file states comprise activation, invalidation and termination, and the security level of file operation comprises SPI, KIC and KID; the file header information is obtained by sending a file selection APDU command to the USIM card through the card reader; the file content value is obtained by sending a file reading APDU command to a USIM card through a card reader;
organizing APDU instruction set data of remote file operation according to the acquired information, wherein the maximum length calculation mode supported by the APDU instruction set data of the remote file operation is as follows: the maximum number of short messages sent to the USIM card between the USIM card and the server is multiplied by 140 bytes, 18 bytes of security protocol configuration data is subtracted, then cascade short message header information data is subtracted (wherein the cascade short message header information is more than 1, each cascade short message header information data is 6 bytes, the cascade short message header information is not more than 1, and then the cascade short message header information data is in a stepless connection way), and then security message data is subtracted (wherein no security message is 0 byte, CRC32 security message is 4 bytes, DES MAC security message is 8 bytes), and then the maximum integral multiple of 8 bytes is obtained;
obtaining SMS-PP short message data, wherein the format of the SMS-PP short message data is as follows: CPL + CHL + SPI + KIC + KID + TAR + APDU instruction set data of remote file operation are encrypted; the APDU instruction set data of the encrypted remote file operation is obtained by taking a security message of the APDU instruction set data of the Counter + Padding Counter + remote file operation + APDU instruction set data of the remote file operation + padding data of integral multiple of 8 bytes as encrypted input data, taking a security configuration parameter KIC as an encryption method and taking a KIC Key as an encryption Key; the safety message of the APDU instruction set data of the remote file operation is obtained by taking CPL + CHL + SPI + KIC + KID + TAR + Counter + Padding Counter + APDU instruction set data of the remote file operation + the completion data of integral multiple of 8 bytes as input data, taking a safety configuration parameter KID as a calculation method and taking KID Key as a scattered Key;
cutting SMS-PP short message data, wherein the SMS-PP short message data is not more than 140 bytes, and cutting the SMS-PP short message data into a single SMS-PP short message; the SMS-PP short message data is larger than 140 bytes, the SMS-PP short message data is cut into a plurality of SMS-PP short messages, and safety header data (such as 2 bytes) is added to the first cut SMS-PP short message;
further, detecting the information returned by the USIM card includes:
remote file operation is activated, the USIM card returns a state value, the state value is 9000, and the USIM card opens the remote file operation activation authority; the state value is 6982, and the USIM card does not open the remote file operation activation authority;
the remote file operation is invalid, the USIM card returns a state value, the state value is 9000, and the USIM card opens the remote file operation invalidation authority; the state value is 6982, the USIM card does not open the remote file operation failure authority;
remote file operation updating, wherein the USIM card returns a state value, the state value is 9000, the USIM card opens the remote file operation updating authority, the state value is 6982, and the USIM card does not open the remote file operation updating authority;
remote file operation reading, wherein the USIM card returns a state value, the state value is 9000, the USIM card opens a remote file operation reading authority and returns a response value, and the response value is a file content value of the USIM card; the state value is 6982, the USIM card does not open the remote file operation reading authority, and the return response value is null;
further, verifying whether the remote file operation is successful comprises:
checking the activation or the failure of remote file operation, comparing the file state of the USIM card file system after the remote file operation with the file state of the initialized USIM card file system or the file state of the USIM card file system before the remote file operation is updated, if the file state of the USIM card file system after the remote file operation is opposite to the file state of the initialized USIM card file system or the file state of the USIM card file system before the remote file operation is updated, the remote file operation of the USIM card file system is successful, otherwise, the remote file operation of the USIM card file system is failed;
checking remote file operation updating operation, updating the file content value of a USIM card before the USIM card file system through comparison between the file content value of the USIM card before the USIM card file system is updated through remote file operation and the file content value obtained by sending an APDU instruction to the USIM card through a card reader after the USIM card file system is updated through remote file operation, and if the file content value obtained by sending the APDU instruction to the USIM card through the card reader after the USIM card file system is updated through remote file operation is the inverse value of the file content value of the USIM card before the USIM card file system is updated through remote file operation, successfully updating the USIM card file system through remote file operation; otherwise, the USIM card file system updating by remote file operation fails;
checking remote file operation reading operation, comparing a file content value obtained by sending an APDU instruction to a USIM card through a card reader before reading the USIM card file system by remote file operation with a response value returned by the USIM card after reading the USIM card file system by remote file operation, if the file content value is consistent with the response value, the USIM card file system is successfully read by remote file operation, otherwise, the USIM card file system is failed to be read by remote file operation;
further, initializing the file state of the USIM card file system according to remote file operation of the USIM card file system, and sending an APDU instruction to the USIM card through the card reader to modify the file state of the USIM card, wherein the type of the remote file operation of the USIM card file system is opposite to that of the file state of the USIM card;
further, the method for testing the remote file operation of the USIM card further comprises the following steps of recovering a USIM card file system:
judging whether the file information of the USIM card file system before remote file operation and the file information after the USIM card file system is operated by remote files are changed or not, and if so, sending an APDU instruction to the USIM card through a card reader to recover the file information of the USIM card file system; the sending of the APDU instruction to the USIM card through the card reader to recover the file information of the USIM card file system by sending the corresponding APDU instruction to the USIM card according to the file information of the USIM card file system before the remote file operation includes:
the file state of the USIM card file system before remote file operation is activated, the file state after the USIM card file system is operated by remote files is invalid, and an APDU activating instruction is sent to the USIM card by the card reader to activate the file state after the USIM card file system is operated by remote files;
the file state of the USIM card file system before remote file operation is invalid, the file state after the USIM card file system is operated by remote files is activated, and the card reader sends an invalid APDU instruction to the USIM card to invalidate the file state after the USIM card file system is operated by remote files;
and sending an updating APDU command to the USIM card through the card reader to update the file content value to be the file content value before the USIM card file system is updated by the remote file operation.
The invention provides a method for testing remote file operation of a USIM card, which can accurately test and verify the result of remotely operating a USIM card file system by the remote file, and can realize comprehensive test on the robustness of the USIM card and ensure the correctness of remotely operating the USIM card file system by assembling SMS-PP short messages and randomly sending the SMS-PP short messages to the USIM card to operate the USIM card by the remote file.
Drawings
Fig. 1 is a schematic diagram illustrating a method for testing remote file operation of a USIM card according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for testing remote file operation renewal of a USIM card according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating a method for testing remote file operation reading of a USIM card according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for testing remote file operation activation of a USIM card according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for testing remote file operation failure of a USIM card according to an embodiment of the present invention.
Detailed Description
For the purpose of illustrating the invention in detail, the invention will be described in detail with reference to the accompanying drawings and examples, which are given by way of illustration only and are not to be construed as limiting the invention.
As shown in fig. 1, the method for testing remote file operation renewal of USIM card of the present invention not only includes the method of assembling SMS-PP messages, sending randomly adjusted SMS-PP messages to USIM card, detecting the information returned by USIM card, and checking whether remote file operation is successful, but also includes the method of initializing the file state of USIM card file system and recovering USIM card file system.
As shown in fig. 2, the present invention provides a method for testing remote file operation and update of a USIM card, which includes:
before remotely updating the file operation of the USIM card file system, sending an APDU instruction to the USIM card through a card reader to acquire the file information of the USIM card file system, specifically, sending the APDU instruction to the USIM card to read the ICCID of the USIM card, acquiring the security key of the USIM card from the personalized data file of the USIM card according to the ICCID, then sending the APDU instruction to the USIM card to verify the security key of the USIM card to acquire the operation authority of the USIM card file system, and sending the APDU instruction to the USIM card according to the operation authority of the USIM card file system to acquire the file information of the USIM card, thereby acquiring the file content value of the USIM card file system before remotely updating the file operation;
the security Key comprises PIN, ADM, KIC Key and KID Key, the operation authority of USIM card file system comprises reading, updating, activating and deactivating, the file information comprises file header information and file content value, the file header information comprises file type, file state, security level of file operation, file size, recording and circulating file, wherein the recording and circulating file comprises: the method comprises the steps of recording the number of files and the recording size of the files, activating, deactivating and terminating the file states, obtaining the security level of file operation by using SPI, KIC and KID, sending a file selection APDU command to a USIM card to obtain file header information, and sending a file reading APDU command to the USIM card to obtain file content values.
Remote file operation updating is carried out on a USIM card file system, SMS-PP short messages are assembled, the SMS-PP short message sequence is randomly adjusted, and SMS-PP short messages with the randomly adjusted sequence are sent to a USIM card, USIM card return information is detected, if the state value in the USIM card return information is 6980, it is indicated that the USIM card does not open the remote file operation updating authority, if the state value in the USIM card return information is 9000, it is indicated that the USIM card opens the remote file operation updating authority, and then an APDU instruction is sent to the USIM card through a card reader to obtain the file information of the USIM card, so that the file content value of the USIM card file system after remote file operation updating is obtained;
comparing the file content value of the USIM card file system after the remote file operation is updated with the file content value of the USIM card file system before the remote file operation is updated, wherein the file content value of the USIM card file system after the remote file operation is updated is the inverse value of the file content value of the USIM card file system before the remote file operation is updated, the USIM card remote file operation is updated successfully, and otherwise, the USIM card remote file operation is updated unsuccessfully.
The maximum length calculation of the APDU instruction set data support of the USIM card remote file operation update with the maximum short message number of 10 sent to the USIM card between the USIM card and the server for the USIM card file system 7F106F3A file is embodied in the following table:
the embodiment of the invention obtains 10 SMS-PP short messages as the following table:
and randomly adjusting the sequence of the 10 SMS-PP short messages, and sending the SMS-PP short messages to the USIM card for remote file operation and updating of the USIM card.
And comparing the file content value of the USIM card file system after the remote file operation is updated with the file content value of the USIM card file system before the remote file operation is updated, and quickly checking whether the USIM card remote file operation is updated successfully or not, such as the following table.
Original file content value | Successful file content value | Failed file content value |
00…00 | FF...FF | 00…00 |
00…00 | FF...FF | 00…00 |
00…00 | FF...FF | 00…00 |
00…00 | FF...FF | 00…00 |
00…00 | FF...FF | 00…00 |
FF...FF | 00…00 | FF...FF |
FF...FF | 00…00 | FF...FF |
FF...FF | 00…00 | FF...FF |
FF...FF | 00…00 | FF...FF |
FF...FF | 00…00 | FF...FF |
As shown in fig. 3, the present invention provides a method for testing remote file operation reading of a USIM card, which includes:
before a USIM card file system is subjected to remote file operation reading, an APDU instruction is sent to a USIM card through a card reader to obtain file information of the USIM card file system, specifically, the APDU instruction is sent to the USIM card to read the ICCID of the USIM card, a security key of the USIM card is obtained from a personalized data file of the USIM card according to the ICCID, an APDU instruction is sent to the USIM card to verify the security key of the USIM card to obtain the operation authority of the USIM card file system, the APDU instruction is sent to the USIM card according to the operation authority of the USIM card file system to obtain the file information of the USIM card, and therefore the file content value of the USIM card file system before the remote file operation reading is obtained;
the method comprises the steps of performing remote file operation reading on a USIM card file system, assembling SMS-PP short messages, randomly adjusting the sequence of the SMS-PP short messages, sending the SMS-PP short messages to the USIM card, detecting USIM card return information, if the state value in the USIM card return information is 6980, indicating that the USIM card does not open the remote file operation reading authority, and if the USIM card return state value is 9000, indicating that the USIM card opens the remote file operation reading authority, and returning a response value;
and after the remote file operation is read, acquiring a response value returned by the USIM card and the file content value of the USIM card file system before the remote file operation is read, wherein the USIM card remote file operation is successfully read, and otherwise, the USIM card remote file operation is failed to read.
The maximum length calculation of the APDU instruction set data support of the USIM card remote file operation reading of the USIM card with the maximum short message number of 10 sent to the USIM card between the USIM card and the server for the USIM card file system 7F106F3A file is embodied in the following table:
the remote file operation reading of the embodiment of the invention only supports sending 1 SMS-PP short message once, and the SMS-PP short messages are exemplified by the following table:
and reading the USIM card file system through remote file operation, comparing a response value returned by the USIM card with a file content value obtained by sending an APDU instruction to the USIM card before the remote file operation is read, and quickly checking whether the USIM card remote file operation reading USIM card file system succeeds, such as the following table.
Original file content value | Successful file value | Failed file value |
FF...FF | FF...FF | Air conditioner |
As shown in fig. 4, the present invention provides a method for testing remote file operation activation of a USIM card, which includes:
sending an APDU (application protocol data Unit) instruction to a USIM card to acquire the file information of the USIM card file system through a card reader in the file state of the USIM card file system before remote file operation activation is carried out on the USIM card file system, specifically, sending a reading APDU instruction to the USIM card to read the ICCID of the USIM card, acquiring the security key of the USIM card from the personalized data file of the USIM card according to the ICCID, then acquiring the operation authority of the USIM card file system through sending a verification APDU instruction to the USIM card to verify the security key of the USIM card, and sending a selection APDU instruction to the USIM card according to the operation authority of the USIM card file system to acquire the file information of the USIM card so as to acquire the file state of the USIM card file system before remote file operation activation;
if the file state of the USIM card file system is consistent with the remote file operation type before the remote file operation is activated, initializing the file state of the USIM card file system to obtain the initialized file state of the USIM card file system, wherein the initialized file state of the USIM card file system is opposite to the remote file operation type by sending an APDU instruction to the USIM card through a card reader to modify the file state of the USIM card file system; specifically, before the USIM card file system is activated for remote file operation, if the file state of the USIM card file system is activated, the file state of the USIM card file system needs to be initialized, an APDU instruction is sent to the USIM card through a card reader to modify the file state of the USIM card file system, the type of the remote file operation of the USIM card file system is opposite to that of the USIM card file system, the file state of the USIM card file system is modified to be invalid, and the initialized file state of the USIM card file system is invalid;
if the file state of the USIM card file system before the remote file operation is activated is inconsistent with the remote file operation type, namely the file state of the USIM card file system before the remote file operation is activated is invalid, the file state initialization of the USIM card file system is not needed;
remote file operation activation is carried out on a USIM card file system, SMS-PP short messages are assembled, the SMS-PP short message sequence is randomly adjusted, the SMS-PP short messages with the randomly adjusted sequence are sent to a USIM card, USIM card return information is detected, if the state value in the USIM card return information is 698, it is indicated that the USIM card does not open the remote file operation activation authority, and if the USIM card return state value is 9000, it is indicated that the USIM card opens the remote file operation activation authority;
if the file state of the USIM card file system before the remote file operation is activated is consistent with the remote file operation type, comparing the file state of the USIM card file system obtained after the remote file operation is activated with the file state of the initialized USIM card file system, and if the file state of the USIM card file system obtained after the remote file operation is activated is opposite to the file state of the initialized USIM card file system, the remote file operation of the USIM card file system is successful, otherwise, the remote file operation of the USIM card file system fails.
If the file state of the USIM card file system before the remote file operation activation is inconsistent with the remote file operation type, comparing the file state of the USIM card file system after the remote file operation with the file state of the USIM card file system before the remote file operation activation, and if the file state of the USIM card file system after the remote file operation is opposite to the file state of the USIM card file system before the remote file operation activation, the USIM card file system is successfully operated by the remote file, otherwise, the USIM card file system fails to be operated by the remote file.
The maximum length calculation of the APDU instruction set data support of the USIM card remote file operation activation, which supports the maximum short message number of 10 sent to the USIM card between the USIM card and the server, for the USIM card file system 7F106F3A file is embodied in the following table:
the remote file operation activation of the embodiment of the invention can be executed by sending 1 SMS-PP short message, and the SMS-PP short message is exemplified by the following table:
the result of checking whether the remote file operation activates the USIM card file system is successful is shown in the following table, for example.
As shown in fig. 5, the present invention provides a method for testing remote file operation failure of a USIM card, which includes:
sending an APDU instruction to a USIM card through a card reader to obtain the file information of the USIM card file system in the file state of the USIM card file system before remote file operation invalidation is carried out on the USIM card file system, specifically, sending the APDU instruction to the USIM card to read the ICCID of the USIM card, obtaining a security key of the USIM card from a personalized data file of the USIM card according to the ICCID, then sending the APDU instruction to the USIM card to verify the security key of the USIM card to obtain the operation authority of the USIM card file system, sending the APDU instruction to the USIM card according to the operation authority of the USIM card file system to obtain the file information of the USIM card, thereby obtaining the file state of the USIM card file system before remote file operation invalidation;
if the file state of the USIM card file system is consistent with the remote file operation type before the remote file operation fails, initializing the file state of the USIM card file system to obtain the initialized file state of the USIM card file system, and sending an APDU instruction to the USIM card through a card reader to modify the file state of the USIM card file system to be opposite to the remote file operation type; before the USIM card file system performs remote file operation invalidation, if the file state of the USIM card file system is invalid, the file state of the USIM card file system is required to be initialized, an APDU instruction is sent to a USIM card through a card reader to modify the file state of the USIM card file system to be opposite to the remote file operation type of the USIM card file system, the file state of the USIM card file system is modified to be activated, and the file state of the initialized USIM card file system is activated;
if the file state of the USIM card file system before the remote file operation is invalid is not consistent with the remote file operation type, namely the file state of the USIM card file system before the remote file operation is invalid is activated, and the file state initialization of the USIM card file system is not required;
carrying out remote file operation invalidation on a USIM card file system, assembling SMS-PP short messages, randomly adjusting the SMS-PP short message sequence and sending the SMS-PP short messages with the randomly adjusted sequence to the USIM card, detecting USIM card return information, if the state value in the USIM card return information is 6980, indicating that the USIM card does not open the remote file operation invalidation right, and if the USIM card return state value is 9000, indicating that the USIM card opens the remote file operation invalidation right;
if the file state of the USIM card file system before the remote file operation is invalid is consistent with the remote file operation type, comparing the file state of the USIM card file system obtained after the remote file operation is invalid with the file state of the initialized USIM card file system, and if the file state of the USIM card file system obtained after the remote file operation is invalid is opposite to the file state of the initialized USIM card file system, the remote file operation of the USIM card file system is successful, otherwise, the remote file operation of the USIM card file system is failed.
If the file state of the USIM card file system before the remote file operation fails is not consistent with the remote file operation type, comparing the file state of the USIM card file system after the remote file operation with the file state of the USIM card file system before the remote file operation fails, and if the file state of the USIM card file system after the remote file operation is opposite to the file state of the USIM card file system before the remote file operation fails, the USIM card file system is successfully operated by the remote file, otherwise, the USIM card file system fails to be operated by the remote file.
The maximum length calculation of the APDU instruction set data support of the USIM card remote file operation failure, which supports the maximum short message number of 10 sent to the USIM card between the USIM card and the server, for the USIM card file system 7F106F3A file is embodied in the following table:
the remote file operation invalidation of the embodiment of the invention only supports sending 1 SMS-PP short message once, and the SMS-PP short messages are exemplified by the following table:
the result of checking whether the remote file operation fails the USIM card file system is shown in the following table, for example.
In addition, the USIM card remote file operation test method also comprises a USIM card file system recovery step, wherein the USIM card file system recovery step judges whether the file information of the USIM card file system before remote file operation and the file information after the USIM card file system is operated by remote files are changed, and if the file information is changed, an APDU instruction is sent to the USIM card through the card reader to recover the file information of the USIM card file system; the sending of the APDU instruction to the USIM card through the card reader to recover the file information of the USIM card file system by sending the corresponding APDU instruction to the USIM card according to the file information of the USIM card file system before the remote file operation includes:
the file state of the USIM card file system before remote file operation is activated, the file state after the USIM card file system is operated by remote files is invalid, and an APDU activating instruction is sent to the USIM card by the card reader to activate the file state after the USIM card file system is operated by remote files;
the file state of the USIM card file system before remote file operation is invalid, the file state after the USIM card file system is operated by remote files is activated, and the file state after the USIM card system is operated by remote files is invalid by sending an invalid APDU command to the USIM card through a card reader;
the file content value after the USIM card file system is remotely operated is the inverse value of the file content value of the USIM card file system before the remote file operation, and the card reader sends an updating APDU command to the USIM card to update the file content value to be the file content value before the USIM card file system is remotely operated, namely the inverse value of the file content value after the USIM card file system is remotely operated.
Furthermore, the APDU instruction set data of the remote file operation can be organized according to the instruction sequence of the USIM card operation, such as a selection instruction (e.g. 9 bytes 00A40804047F106F 3A) + a read instruction (e.g. 5 bytes: 0044000000).
The invention discloses a SMS-PP short message assembled by USIM card file operation APDU instructions and sends the SMS-PP short message with randomly adjusted sequence to a USIM card remote file operation mode of a USIM card, aiming at solving the problem that a communication operator can upgrade a USIM card file system due to special requirements but cannot upgrade the USIM card on the USIM card site when the USIM card is sent to a user hand.
The method for testing the remote file operation of the USIM card is also suitable for adding, modifying, deleting, creating and terminating the remote file operation and the SIM card.
The embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiment. All equivalent substitutions made by the contents of the description and the drawings of the invention, or the direct or indirect application in other related technical fields, are included in the protection scope of the invention.
Claims (8)
1. A method for testing remote file operation of a USIM card is characterized by comprising the following steps: the method comprises the following steps:
assembling SMS-PP short messages;
sending SMS-PP short messages with randomly adjusted sequence to the USIM card;
detecting information returned by the USIM card;
checking whether the remote file operation is successful;
the assembling SMS-PP short message comprises the following steps:
acquiring security protocol configuration parameters of a USIM card file system, a remote file operation type of the USIM card file system and a remote file operation type of the USIM card file system from a USIM card requirement configuration file; the remote file operation types of the USIM card file system include, but are not limited to: reading, updating, activating and deactivating; the security protocol configuration parameters of the remote file operation type of the USIM card file system comprise the maximum number of short messages which are sent to the USIM card between the USIM card and the server, TAR parameters of application indication, security indication SPI parameters, encryption indication KIC parameters and security message indication KID parameters;
sending a USIM card file operation APDU instruction through a card reader to acquire the file information of a USIM card file system;
organizing APDU instruction set data of remote file operation according to the acquired information;
obtaining SMS-PP short message data, wherein the format of the SMS-PP short message data is as follows: CPL + CHL + SPI + KIC + KID + TAR + APDU instruction set data of remote file operation are encrypted;
cutting SMS-PP short message data;
the SMS-PP short message data is not more than 140 bytes, and the cut SMS-PP short message data is a single SMS-PP short message; and the SMS-PP short message data is larger than 140 bytes, the SMS-PP short message data is cut into a plurality of SMS-PP short messages, and the safety head 2 bytes of data are added to the first cut SMS-PP short message.
2. The method for testing the remote file operation of the USIM card of claim 1, wherein: the method for acquiring the file information of the USIM card file system by sending the APDU instruction to the USIM card through the card reader comprises the following steps:
sending an APDU reading instruction through a card reader to read the ICCID of the USIM card;
acquiring a security Key of the USIM card from the USIM card personalized data file according to the ICCID, wherein the security Key comprises PIN, ADM, KIC Key and KID Key;
sending an APDU (authentication protocol data Unit) verification instruction to a USIM card through a card reader to verify a security key of the USIM card to acquire the operation authority of a USIM card file system, wherein the operation authority of the USIM card file system comprises reading, updating, activating and deactivating;
directly sending an APDU instruction to the USIM card according to the operation authority of the USIM card file system to acquire the file information of the USIM card, wherein the file information comprises: header information and file content values.
3. The method for testing the remote file operation of the USIM card of claim 2, wherein:
the file header information comprises a file type, a file state, a security level of file operation, a file size, and a recording and circulating file, wherein the recording and circulating file comprises: recording the number of files and the recording size of the files, wherein the file states comprise activation, invalidation and termination, and the security level of the file operation comprises SPI, KIC and KID;
the file header information is obtained by sending a file selection APDU command to the USIM card through the card reader;
and the file content value is obtained by sending a file reading APDU instruction to the USIM card through the card reader.
4. The method for testing the remote file operation of the USIM card of claim 1, wherein:
the maximum length calculation mode supported by the APDU instruction set data of the remote file operation is as follows:
the maximum number of short messages sent to the USIM card between the USIM card and the server is multiplied by 140 bytes, 18 bytes of security protocol configuration data are subtracted, then cascade short message header information data are subtracted, and then security message data are subtracted, and the maximum integral multiple of 8 bytes is obtained;
the APDU instruction set data of the encrypted remote file operation is obtained by taking a safe message of the COUNTER + PCOUNTER + APDU instruction set data of the remote file operation, the APDU instruction set data of the remote management and the completion data of integral multiple of 8 bytes as encrypted input data, taking a safety configuration parameter KIC as an encryption method and taking a KIC Key as an encryption Key;
the safety message of the APDU instruction set data of the remote file operation is obtained by taking CPL + CHL + SPI + KIC + KID + TAR + COUNTER + PCOUNTER + APDU instruction set data of the remote file operation + the completion data of integral multiple of 8 bytes as input data, taking a safety configuration parameter KID as a calculation method and taking KID Key as a scattered Key.
5. The method for testing the remote file operation of the USIM card of claim 1, wherein: the detecting the information returned by the USIM card comprises the following steps:
remote file operation is activated, the USIM card returns to a state value, the state value is 9000, and the USIM card opens the remote file operation activation authority; the state value is 6982, and the USIM card does not open the remote file operation activation authority;
the remote file operation is invalid, the USIM card returns a state value, the state value is 9000, and the USIM card opens the remote file operation invalidation authority; the state value is 6982, the USIM card does not open the remote file operation failure authority;
remote file operation updating, wherein the USIM card returns a state value, the state value is 9000, the USIM card opens the remote file operation updating authority, the state value is 6982, and the USIM card does not open the remote file operation updating authority;
remote file operation reading, namely returning a state value to the USIM card, wherein the state value is 9000, the USIM card opens the remote file operation reading permission and returns a response value, and the response value is the file content value of the USIM card; the state value is 6982, the USIM card does not open the remote file operation reading authority, and the return response value is null.
6. The method for testing the remote file operation of the USIM card of claim 1, wherein: the checking whether the remote file operation is successful comprises the following steps:
checking the remote file operation activation or failure, comparing the file state of the USIM card file system after the remote file operation with the file state of the initialized USIM card file system or the file state of the USIM card file system before the remote file operation is updated, if the file state of the USIM card file system after the remote file operation is opposite to the file state of the initialized USIM card file system or the file state of the USIM card file system before the remote file operation is updated, the remote file operation of the USIM card file system is successful, otherwise, the remote file operation of the USIM card file system fails;
checking remote file operation updating, namely comparing a file content value of a USIM card before updating the USIM card file system through remote file operation with a file content value obtained by sending an APDU instruction to the USIM card through a card reader after updating the USIM card file system through remote file operation, if the file content value obtained by sending the APDU instruction to the USIM card through the card reader after updating the USIM card file system through remote file operation is the inverse value of the file content value of the USIM card before updating the USIM card file system through remote file operation, the USIM card file system is successfully updated through remote file operation, and if not, the USIM card file system is failed through remote file operation;
and checking remote file operation reading operation, comparing a file content value obtained by sending an APDU command to a USIM card through a card reader before the USIM card file system is read by remote file operation with a response value returned by the USIM card after the USIM card file system is read by remote file operation, if the file content value is consistent with the response value, the USIM card file system is successfully read by remote file operation, otherwise, the USIM card file system is failed to be read by remote file operation.
7. The method for testing the remote file operation of the USIM card of claim 1, wherein:
the test method further comprises the following steps: and initializing the file state of the USIM card file system, wherein the file state initialization of the USIM card file system is opposite to the remote file operation type of the USIM card file system by sending an APDU instruction to the USIM card through a card reader to modify the file state of the USIM card.
8. The method for testing the remote file operation of the USIM card of claim 1, wherein: the method for testing the USIM card remote file operation further comprises the following steps of: the USIM card file recovery system recovers the file information of the USIM card file system by judging whether the file information of the USIM card file system before remote file operation and the file information of the USIM card file system after remote file operation change, and if the file information of the USIM card file system before remote file operation and the file information of the USIM card file system after remote file operation change, sending an APDU instruction to the USIM card through the card reader: the sending of the APDU instruction to the USIM card through the card reader to recover the file information of the USIM card file system by sending the corresponding APDU instruction to the USIM card according to the file information of the USIM card file system before the remote file operation includes:
the file state of the USIM card file system before remote file operation is activated, the file state after the USIM card file system is operated by remote files is invalid, and the card reader sends an APDU activating instruction to the USIM card to activate the file state after the USIM card file system is operated by remote files;
the file state of the USIM card file system before remote file operation is invalid, the file state after the USIM card file system is operated by remote files is activated, and the file state after the USIM card system is operated by remote files is sent to the USIM card through a card reader and a failure APDU command is sent to the USIM card to disable the USIM card;
the file content value after the USIM card file system is remotely operated is the inverse value of the file content value of the USIM card file system before the remote file operation, and the card reader sends an APDU updating command to the USIM card to update the file content value to the USIM card, so that the file content value before the USIM card file system is remotely operated and updated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110024871.7A CN114756443B (en) | 2021-01-08 | 2021-01-08 | Method for testing remote file operation of USIM card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110024871.7A CN114756443B (en) | 2021-01-08 | 2021-01-08 | Method for testing remote file operation of USIM card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114756443A CN114756443A (en) | 2022-07-15 |
CN114756443B true CN114756443B (en) | 2023-04-14 |
Family
ID=82325010
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110024871.7A Active CN114756443B (en) | 2021-01-08 | 2021-01-08 | Method for testing remote file operation of USIM card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114756443B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104144405A (en) * | 2013-05-10 | 2014-11-12 | 中国电信股份有限公司 | Remote user card file managing method and system |
CN104982044A (en) * | 2013-02-05 | 2015-10-14 | 高通股份有限公司 | Optimal scheduling of envelope updates to SIM card |
CN110366183A (en) * | 2019-08-02 | 2019-10-22 | 中国工商银行股份有限公司 | Short message safety protecting method and device |
CN111367476A (en) * | 2020-03-11 | 2020-07-03 | 楚天龙股份有限公司 | Data reading method and device for SIM card |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101964932B1 (en) * | 2013-01-03 | 2019-08-08 | 삼성전자주식회사 | Mobile terminal comprising sim card and battery managing method thereof |
-
2021
- 2021-01-08 CN CN202110024871.7A patent/CN114756443B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104982044A (en) * | 2013-02-05 | 2015-10-14 | 高通股份有限公司 | Optimal scheduling of envelope updates to SIM card |
CN104144405A (en) * | 2013-05-10 | 2014-11-12 | 中国电信股份有限公司 | Remote user card file managing method and system |
CN110366183A (en) * | 2019-08-02 | 2019-10-22 | 中国工商银行股份有限公司 | Short message safety protecting method and device |
CN111367476A (en) * | 2020-03-11 | 2020-07-03 | 楚天龙股份有限公司 | Data reading method and device for SIM card |
Non-Patent Citations (1)
Title |
---|
基于Windows Mobile的短信平台在移动办公中的设计与实现;张轶;《中国优秀硕士论文电子期刊网(信息科技)》;20091115(第11期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114756443A (en) | 2022-07-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6033832B2 (en) | Apparatus and method for managing firmware verification on a wireless device | |
WO2020050474A1 (en) | Security certification server for smart contracts | |
US8863290B2 (en) | Methods and devices for improving the reliability of communication between an aircraft and a remote system | |
CN100432932C (en) | Updating data in a mobile terminal | |
JP2015092374A5 (en) | ||
US8555060B2 (en) | Managing method, device and terminal for application program | |
CN109829294B (en) | Firmware verification method, system, server and electronic equipment | |
US10268845B2 (en) | Securing of the loading of data into a nonvolatile memory of a secure element | |
CN107484152B (en) | Management method and device for terminal application | |
CN110688653A (en) | Client security protection method and device and terminal equipment | |
CN114756443B (en) | Method for testing remote file operation of USIM card | |
KR101436404B1 (en) | User authenticating method and apparatus | |
CN107635218B (en) | Method and device for generating and injecting SIMLOCK password | |
JP4588991B2 (en) | File management system | |
KR20230019032A (en) | Pre-personalized secure element and embedded personalization | |
CN115857986A (en) | Control method, system and storage medium for off-line upgrading | |
CN112306563B (en) | Method, device, equipment and storage medium for resetting IOS screen using time password | |
CN110704849B (en) | Client information processing method and device | |
CN110677483B (en) | Information processing system and trusted security management system | |
CN112416407A (en) | Software upgrading method, device, equipment and computer readable storage medium | |
CN106997430B (en) | Method and device for preventing linux service equipment from being copied | |
CN114244705B (en) | Switch data safety read-write method and safety read-write system | |
RU2780029C1 (en) | Method for identification of an online user and his device | |
CN117473560B (en) | Method and device for realizing work of online OTP (one time programmable) equipment | |
CN114327657B (en) | Large mirror image division downloading and signature verification method based on Fastboot and storage medium thereof |
Legal Events
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |