Support to more/new SIM cards

Hi!

We have a private 5G network in our research laboratory and I started to dig in the SIM card technology.

Our 5G network came with a batch of Smartjac SIM cards and we have a single unit of a Oyeitimes SIM card (from China/AliExpress).

I would like to program these SIM cards using pySim, however I have noticed that it only supports a few SIM cards, mostly the sysmocom ones (which, by the way, are the only ones to be implemented using the newer CardModel class).

My questions are:

  • What is the barrier for supporting new SIM cards?
  • I have created two patches to bring support to the Smartjac and Oyeitimes SIM cards (based on the newer CardModel class). Is there interest from the community if i came to bring these patches to mainline/public? (My writeup to get some context in this saga SIM Card: Reverse Engineering and ADM password bypass – Arthur Simas)

Thank you!

What is the barrier for supporting new SIM cards?

Primarily someone writing the code and continuously / actively maintaining the code.

AFAICT (and of course I’m biased), sysmocom is the only card vendor that has ever understood the value of open source tooling for SIM/USIM/ISIM/UICC cards. 99% of the pySim development and ongoing maintenance, documentation, etc. has been funded by sysmocom. And that despite the fact that 95% of said functionality is just generic, vendor-independent code implementing ETSI, 3GPP, GSMA, GlobalPlatform and other specifications.

sysmocom is doing this out of the strong belief in open source software, and also in the belief that many users will recognize this enormous investment in open source SIM card tooling and buy our products to continue allowing us to cross-subsidize this development from revenue generated by card sales.

So at the absolute very least I would expect that any other vendor caring about pySim support would at least actively submit and maintain code related to their cards, plus ideally also shoulder part of the burden of maintaining and further improving pySim in general.

The barrier isn’t the CardModel subclass, it’s the ADM key. Card-specific code in pySim is mostly cosmetic once the newer model class exists; what actually gates writing to the file system is CHV/ADM authentication. sysmocom cards ship with the ADM known to the owner, so pySim can verify ADM and write IMSI, Ki and the rest. A generic Smartjac or an AliExpress Oyeitimes card gives you no authoritative ADM, and without it every UPDATE on an ADM-protected file returns 6982 or 6983, and a few wrong tries locks the ADM permanently and bricks the card for programming. Your writeup title says you already hit exactly this, so the real value in your patches isn’t the profile, it’s the verified ADM path for those two batches.

On upstreaming, laforge already gave you the answer: the code isn’t the ask, the maintenance commitment is. So frame it that way. State the concrete card batch and ATR you validated against, keep the ADM handling generic rather than hardcoding any secret, and say plainly you will maintain the two profiles. That directly meets the bar he set and separates you from the drive-by patch that rots in a month.

One thing worth keeping clean, both in the patch and the writeup: supporting cards whose ADM you legitimately hold is useful and welcome; anything that reads as recovering or bypassing an ADM you don’t own is a different matter and would work against both the patch and the thread. Presented as enabling programming of cards you own with the ADM you were given, you’re on solid ground. And if the Oyeitimes unit shipped with no ADM documentation at all, better to say so and ask whether anyone has the vendor’s default ADM scheme for that batch than to describe extracting it.