Project

General

Profile

Actions

Bug #6055

closed

ust_service_activate failed for the MF/ADF.USIM/EF.UST parameter

Added by ls11j 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
06/07/2023
Due date:
% Done:

100%

Spec Reference:

Description

With the latest pySim code in use, the ust_service_activate command failed for the MF/ADF.USIM/EF.UST parameter.

pySIM-shell (MF/ADF.USIM/EF.UST)> ust_service_activate 130
EXCEPTION of type 'AttributeError' occurred with message: ''SimCard' object has no attribute 'update_ust''
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (MF/ADF.USIM/EF.UST)> set debug true
debug - was: False
now: True
pySIM-shell (MF/ADF.USIM/EF.UST)> ust_service_activate 130
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/cmd2/cmd2.py", line 2129, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/usr/local/lib/python3.8/dist-packages/cmd2/cmd2.py", line 2559, in onecmd
    stop = func(statement)
  File "/root/pysim/pySim/ts_31_102.py", line 560, in do_ust_service_activate
    self._cmd.card.update_ust(int(arg), 1)
AttributeError: 'SimCard' object has no attribute 'update_ust'
EXCEPTION of type 'AttributeError' occurred with message: ''SimCard' object has no attribute 'update_ust''

Here is the Ubuntu version:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

Actions #1

Updated by laforge 11 months ago

On Wed, Jun 07, 2023 at 05:36:59PM +0000, ls11j wrote:

With the latest pySim code in use, the ust_service_activate command failed for the MF/ADF.USIM/EF.UST parameter.

what kind of card are you using? This is clearly not a sysmoUSIM/sysmoISIM card, as it
is using the SimCard and not the UsimCard class (can be seen from your error messages).

Actions #2

Updated by laforge 11 months ago

  • Status changed from New to Feedback
  • Assignee set to ls11j
Actions #3

Updated by laforge 11 months ago

  • Description updated (diff)
Actions #4

Updated by ls11j 11 months ago

It's an eSIM from https://esim.me/ with an activated eSIM profile on it.
The other functions of reading and editing sim card parameters seem to be working fine.

Actions #5

Updated by laforge 11 months ago

Can you please apply the following patch

diff --git a/pySim-shell.py b/pySim-shell.py
index e07d899..91f8dd3 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -168,7 +168,7 @@ class PysimApp(cmd2.Cmd):
         self.numeric_path = False
         self.conserve_write = True
         self.json_pretty_print = True
-        self.apdu_trace = False
+        self.apdu_trace = True

         if version.parse(cmd2.__version__) < version.parse("2.0.0"):
             # pylint: disable=no-value-for-parameter

and then
  • provide the console output of starting pySim-shell with this card inserted
  • the binary content of EF.DIR (select EF.DIR; read_records)

Using this data it should be easier to understand what's going on.

In any case, even after fixing pySim-shell, any normal eSIM profile will of course not permit you to writ to EF.UST so you will get rejected by the card with a related SW at that point. I suppose the latter is what you wanted to test?

Actions #6

Updated by ls11j 11 months ago

Here are the outputs:

# ./pySim-shell.py -p0
Using PC/SC reader interface
Waiting for card...
Autodetection failed
Warning: Could not detect card type - assuming a generic card type...
Info: Card is of type: UICC-SIM
AIDs on card:
 USIM: a0000000871002ffffffff8907090000 (EF.DIR)
 ARA-M: a00000015141434c00
Card initialization failed with an exception:
---------------------8<---------------------
Traceback (most recent call last):
  File "./pySim-shell.py", line 973, in <module>
    app = PysimApp(card, rs, sl, ch, opts.script)
  File "./pySim-shell.py", line 160, in __init__
    self.equip(card, rs)
  File "./pySim-shell.py", line 188, in equip
    self._onchange_apdu_trace('apdu_trace', False, self.apdu_trace)
  File "./pySim-shell.py", line 219, in _onchange_apdu_trace
    self.card._scc._tp.apdu_tracer = self.Cmd2ApduTracer(self)
  File "./pySim-shell.py", line 225, in __init__
    self.cmd2 = app
NameError: name 'app' is not defined
---------------------8<---------------------
(you may still try to recover from this manually by using the 'equip' command.)
 it should also be noted that some readers may behave strangely when no card
 is inserted.)

pySim-shell not equipped!
Welcome to pySim-shell!
pySIM-shell (no card profile)>

pySIM-shell (MF/EF.DIR)> read_record_decoded 1
{
    "application_template": [
        {
            "application_id": "a0000000871002ffffffff8907090000" 
        },
        {
            "application_label": "USim1" 
        }
    ]
}

Once the ust_service_activate function works I will explore further into the possibilities.

Actions #7

Updated by laforge 10 months ago

  • Status changed from Feedback to In Progress

ls11j wrote in #note-4:

It's an eSIM from https://esim.me/ with an activated eSIM profile on it.

I've meanwhile obtained such a card and can indeed reproduce the problem.

Actions #8

Updated by laforge 10 months ago

  • Assignee changed from ls11j to laforge
  • % Done changed from 0 to 80

https://gerrit.osmocom.org/c/pysim/+/33569 is the proposed fix for this.

Actions #9

Updated by laforge 10 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

resolving manually; there was some issue with the pysim redmine repo configuration preventing auto-close

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)