Project

General

Profile

Actions

Bug #6453

open

Encoding problem with aram_store_ref_ar_do

Added by dWall about 1 month ago. Updated 24 days 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 about 1 month 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 about 1 month ago

  • Description updated (diff)
Actions #3

Updated by Zed66 27 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 26 days 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 25 days 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)