Project

General

Profile

Actions

Bug #6453

open

Encoding problem with aram_store_ref_ar_do

Added by dWall 12 days ago. Updated about 19 hours ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/15/2024
Due date:
% Done:

0%

Spec Reference:

Description

I have tried to store an access rule in a SIM with aram applet and I get this error:

pySIM-shell (00:MF/ADF.ARA-M)> aram_store_ref_ar_do --aid ffffffffffff --device-app-id E849B63A7B96E571F788FC5845C4AA3C520D18E8 --android-permissions 0000000000000001

ValueError: Dict [{'ref_ar_do': [{'ref_do': [{'aid_ref_do': 'ffffffffffff'}, {'dev_app_id_ref_do': 'E849B63A7B96E571F788FC5845C4AA3C520D18E8'}]}, {'ar_do': [{'perm_ar_do': {'permissions': '0000000000000001'}}]}]}] doesn't contain expected key command_store_ref_ar_do
EXCEPTION of type 'ValueError' occurred with message: Dict [{'ref_ar_do': [{'ref_do': [{'aid_ref_do': 'ffffffffffff'}, {'dev_app_id_ref_do': 'E849B63A7B96E571F788FC5845C4AA3C520D18E8'}]}, {'ar_do': [{'perm_ar_do': {'permissions': '0000000000000001'}}]}]}] doesn't contain expected key command_store_ref_ar_do

Looking at the code (tlv.py) I have found that encoding "from_dict" recursive method is not working properly and I haven't been able to fix it.

Actions #1

Updated by laforge 12 days ago

  • Assignee set to laforge

Will look at it, but currently very overloaded, it might take a week or two.

Actions #2

Updated by laforge 12 days ago

  • Description updated (diff)
Actions #3

Updated by Zed66 3 days ago

dWall wrote:

I have tried to store an access rule in a SIM with aram applet and I get this error:

[...]

Looking at the code (tlv.py) I have found that encoding "from_dict" recursive method is not working properly and I haven't been able to fix it.

Just remove or comment out the line "csrado.from_dict(d)" in ara_m.py. This is an erroneous call.

Actions #4

Updated by zdzym 1 day ago

Zed66 wrote in #note-3:

dWall wrote:

I have tried to store an access rule in a SIM with aram applet and I get this error:

[...]

Looking at the code (tlv.py) I have found that encoding "from_dict" recursive method is not working properly and I haven't been able to fix it.

Just remove or comment out the line "csrado.from_dict(d)" in ara_m.py. This is an erroneous call.

Unfortunately this is not working on my side. "ADF_ARAM.store_data(self._cmd.lchan.scc._tp, csrado)" needs contents in csrado and, since "csrado.from_dict(d)" was removed, it actually passed an empty content which will cause SW6984 and not working in a correct way.

Actions #5

Updated by Zed66 about 19 hours ago

zdzym wrote in #note-4:

Zed66 wrote in #note-3:

dWall wrote:

I have tried to store an access rule in a SIM with aram applet and I get this error:

[...]

Looking at the code (tlv.py) I have found that encoding "from_dict" recursive method is not working properly and I haven't been able to fix it.

Just remove or comment out the line "csrado.from_dict(d)" in ara_m.py. This is an erroneous call.

Unfortunately this is not working on my side. "ADF_ARAM.store_data(self._cmd.lchan.scc._tp, csrado)" needs contents in csrado and, since "csrado.from_dict(d)" was removed, it actually passed an empty content which will cause SW6984 and not working in a correct way.

Try to send a raw APDU command. In your case it will look like
apdu 80e2900022e1184f00c114E849B63A7B96E571F788FC5845C4AA3C520D18E8e306d00101d10101

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)