Home

Awesome

Onomondo software SIM/USIM implementation

This repository contains a pure software implementation/emulation of the most relevant SIM/UICC/USIM functionalities.

You can run the code contained in this repository to implement the functionality normally done in a phsical SIM/USIM, covering:

Supported Features

Unsupported Features

License

License: GPL v3

The Onomondo UICC Repository is provided under:

Being under the terms of the GNU General Public License version 3 only, according with:

For files licensed under BSD license, refer to BSD-3-Clause file in the root directory of this source tree.

External Dependencies

We try to not create any external dependencies. This has both technical and licensing reasons: We cannot expect to cross-compile most external dependencies to the deep embedded "close to bare iron" environments of a cellular modem or microcontroller.

If we reuse existing code, it must be under a permissive license (e.g. BSD, MIT), such as for example the MILENAGE implementation, which we can take from wpa_supplicant, which is BSD/GPL dual-licensed.

Testing

We expect to have both

Getting Started

Building from source

Install cmake, make and a c compiler. (on debian: apt install build-essential cmake), then run:

$ cmake -S . -B build -DCONFIG_USE_SYSTEM_HEAP=y -DCONFIG_USE_LOGS=y -DBUILD_TESTING=y
$ cmake --build build

Installing run time dependencies

Running smartsim

Wake up PC/SC, by briefly (or even permanently) running pcsc_scan, or a brief run of socat - /run/pcscd/pcscd.comm.

$ ./src/softsim/softsim
    VPCD     INFO softsim!
    VPCD     INFO connected.
      FS     INFO no file selected
 STORAGE     INFO requested file definition for 3f00 rom host file system: ./files/3f00.def
      FS     INFO no file selected
 STORAGE     INFO requested file definition for 3f00 rom host file system: ./files/3f00.def
...

When the program is running, pcsc_scan should show the presence of a card in the Virtual PCD reader:

 Reader 0: Virtual PCD 00 00
  Event number: 19
  Card state: Card inserted, Shared Mode,
  ATR: 3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 4C 75 30 34 05 4B A9
[...]

With gscriptor, selecting the Virtual PCD enables running the test scripts in ./gscriptor/.

pySim offers interaction with the running softsim card:

$ pySim-shell.py -p 0
Using PC/SC reader interface
Waiting for card...
Autodetected card type: sysmoISIM-SJA2
Info: Card is of type: UICC-SIM
[...]
pySIM-shell (MF)>

Operation compared to ETSI specifications

The SoftSIM largely operates as described by the relevant specifications (ETSI TS 102 series and ISO 7816) to the extent implemented and necessary.

Aspects of its operation that the specifications do not describe are outlined here, with details in the code's in-line documentation: