Project

General

Profile

Actions

Feature #5235

open

import / export as eUICC profile package ASN.1

Added by laforge over 2 years ago. Updated 11 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
09/22/2021
Due date:
% Done:

0%

Spec Reference:

Description

There is an interoperable file format for SIM profiles whihc is mainly used in the eSIM/eUICC context.

The specs and the ASN.1 syntax can be found at
https://trustedconnectivityalliance.org/wp-content/uploads/2021/05/eUICC-Profile-Package-v3.1.zip

It would be an interesting idea to add support to pySim to
  1. read such a profile and program a card (e.g. sysmoISIM-SJA2) with its contents
  2. read a physical card and generate such a profile. For the standard file contents, this is possible in a generic way, but for the non-standard bits like storage of PIN/PUK/ADM/K/OP and OTA keys this would need support from the card specific part of the code base
Actions #1

Updated by laforge over 1 year ago

I recently did a bit of toying around with the profile packages in DER and ASN.1 value notation syntax and pycrate.

  • pycrate can parse the DER format
  • pycrate cannot parse the ASN.1 value notation text files with value0..value23 in them, but one has to first manually split every 'value' and call the parser on it individually
    • alternative is to compile the asn.1 syntax together with the value notation files using `pycrate_asn1compile.py`

Once parsed, one can navigate around the tree of asn.1 elements such as the individual files, etc.

Given the format of the profile packages, one would have to do quite a bit of post-processing of the data and then generate a series of CREATE FILE / UPDATE BINARY etc. commands to actually write the profile to a card. 90% would be standard TS 102 221 / 102 223 commands, while some bits like MILENAGE config etc. would be proprietary commands.

Actions #2

Updated by laforge 11 months ago

laforge wrote in #note-1:

  • pycrate cannot parse the ASN.1 value notation text files with value0..value23 in them, but one has to first manually split every 'value' and call the parser on it individually
    • alternative is to compile the asn.1 syntax together with the value notation files using `pycrate_asn1compile.py`

benoit, are the above statements still true? Just asking since my original testing was done almost one year ago.

I would love to have some code that can parse (and operate on the parsed data) interoperable eSIM profiles. As result, we could add code to pySim that programs a physical USIM/ISIM with the data from such a profile.

Actions #3

Updated by benoit 11 months ago

laforge wrote in #note-2:

laforge wrote in #note-1:

  • pycrate cannot parse the ASN.1 value notation text files with value0..value23 in them, but one has to first manually split every 'value' and call the parser on it individually
    • alternative is to compile the asn.1 syntax together with the value notation files using `pycrate_asn1compile.py`

benoit, are the above statements still true? Just asking since my original testing was done almost one year ago.

Yes, still true, and probably won't change.

I would love to have some code that can parse (and operate on the parsed data) interoperable eSIM profiles. As result, we could add code to pySim that programs a physical USIM/ISIM with the data from such a profile.

There is still the possibility to properly compile the ASN.1 module with the eSIM profiles with `pycrate_asn1compile.py` and use the generated Python file. It's also possible to do the compilation programmatically, by calling `compile_text()` then `generate_modules()` (as in https://github.com/P1sec/pycrate/blob/master/tools/pycrate_asn1compile.py#L215) and then loading the generated module.
Or maybe just using the intermediate representation produced by `compile_text()` could be sufficient for your purpose ? Maybe if you elaborate a bit more on what you would like to do with the values from the ASN.1 definitions, I could propose some code to embed on your side ?

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)