laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35721?usp=email )
Change subject: ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules
......................................................................
ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules
Encoding an empty AID-REF-DO (4F) is neccessary to achieve the meaning
described in "Secure Element Access Control - Public Release v1.0"
Table 6-1: "Empty: Indicates that the rules to be stored or retrieved
are associated with all SE applications not covered by a specific rule".
Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
---
M pySim/ara_m.py
1 file changed, 15 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index 68244d1..f05109b 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -348,7 +348,7 @@
"""Perform STORE DATA [Command-Store-REF-AR-DO] to store a (new) access rule."""
# REF
ref_do_content = []
- if opts.aid:
+ if opts.aid != None:
ref_do_content += [{'aid_ref_do': opts.aid}]
elif opts.aid_empty:
ref_do_content += [{'aid_ref_empty_do': None}]
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35721?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
Gerrit-Change-Number: 35721
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35722?usp=email )
Change subject: ara_m: Use GlobalPlatform SELECT decoding
......................................................................
ara_m: Use GlobalPlatform SELECT decoding
As the ARA-M applet is a GlobalPlatform applet, its SELECT response
decoding should be used, not the ETSI EUICC TS 102 221 fall-back.
Change-Id: I1a30b88a385f6de663aa837483dd32c0d104856f
---
M pySim/ara_m.py
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index f05109b..a2eaa33 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -31,6 +31,7 @@
from pySim.construct import *
from pySim.filesystem import *
from pySim.tlv import *
+import pySim.global_platform
# various BER-TLV encoded Data Objects (DOs)
@@ -259,6 +260,9 @@
files = []
self.add_files(files)
+ def decode_select_response(self, data_hex):
+ return pySim.global_platform.decode_select_response(data_hex)
+
@staticmethod
def xceive_apdu_tlv(tp, hdr: Hexstr, cmd_do, resp_cls, exp_sw='9000'):
"""Transceive an APDU with the card, transparently encoding the command data from TLV
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35722?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1a30b88a385f6de663aa837483dd32c0d104856f
Gerrit-Change-Number: 35722
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35723?usp=email )
Change subject: runtime: Reset selected_file_fcp[_hex] if SELECT returns no data
......................................................................
runtime: Reset selected_file_fcp[_hex] if SELECT returns no data
In case SELECT doesn't return any response data, we must reset
the lchan.selected_file_fcp* members to None to prevent pySim-shell
preventing stale data from the previously selected file.
Change-Id: Ia04b8634e328e604e8df7e8d59b7fd532242d2ca
---
M pySim/runtime.py
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/runtime.py b/pySim/runtime.py
index f836ec8..3aeaab1 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -304,6 +304,9 @@
if select_resp_data:
self.selected_file_fcp_hex = select_resp_data
self.selected_file_fcp = self.selected_file.decode_select_response(select_resp_data)
+ else:
+ self.selected_file_fcp_hex = None
+ self.selected_file_fcp = None
# register commands of new file
if cmd_app and self.selected_file.shell_commands:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35723?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia04b8634e328e604e8df7e8d59b7fd532242d2ca
Gerrit-Change-Number: 35723
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35724?usp=email )
Change subject: [cosmetic] ara_m: Give a spec reference for the PERM-AR-DO
......................................................................
[cosmetic] ara_m: Give a spec reference for the PERM-AR-DO
PERM-AR-DO actually originates in a different spec than all other parts
of the ara_m.py, so let's explicitly mention that.
Change-Id: I6e0014c323f605860d0f70cd0c04d7e461e8a9de
---
M pySim/ara_m.py
1 file changed, 13 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index a2eaa33..d137dcf 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -116,6 +116,7 @@
class PermArDO(BER_TLV_IE, tag=0xdb):
# Android UICC Carrier Privileges specific extension, see https://source.android.com/devices/tech/config/uicc
+ # based on Table 6-8 of GlobalPlatform Device API Access Control v1.0
_construct = Struct('permissions'/HexAdapter(Bytes(8)))
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35724?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6e0014c323f605860d0f70cd0c04d7e461e8a9de
Gerrit-Change-Number: 35724
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35723?usp=email )
Change subject: runtime: Reset selected_file_fcp[_hex] if SELECT returns no data
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35723?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia04b8634e328e604e8df7e8d59b7fd532242d2ca
Gerrit-Change-Number: 35723
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Sat, 27 Jan 2024 20:50:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35721?usp=email )
Change subject: ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35721?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
Gerrit-Change-Number: 35721
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Sat, 27 Jan 2024 20:50:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35724?usp=email )
Change subject: [cosmetic] ara_m: Give a spec reference for the PERM-AR-DO
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35724?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6e0014c323f605860d0f70cd0c04d7e461e8a9de
Gerrit-Change-Number: 35724
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Sat, 27 Jan 2024 20:50:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35721?usp=email )
Change subject: ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules
......................................................................
ara_m: Permit encoding of empty AID (--aid '') in ARA-M rules
Encoding an empty AID-REF-DO (4F) is neccessary to achieve the meaning
described in "Secure Element Access Control - Public Release v1.0"
Table 6-1: "Empty: Indicates that the rules to be stored or retrieved
are associated with all SE applications not covered by a specific rule".
Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
---
M pySim/ara_m.py
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/21/35721/1
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index 68244d1..f05109b 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -348,7 +348,7 @@
"""Perform STORE DATA [Command-Store-REF-AR-DO] to store a (new) access rule."""
# REF
ref_do_content = []
- if opts.aid:
+ if opts.aid != None:
ref_do_content += [{'aid_ref_do': opts.aid}]
elif opts.aid_empty:
ref_do_content += [{'aid_ref_empty_do': None}]
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35721?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iac6c3d78bc9ce36bac47589e5f7a0cc78e2efc38
Gerrit-Change-Number: 35721
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35722?usp=email )
Change subject: ara_m: Use GlobalPlatform SELECT decoding
......................................................................
ara_m: Use GlobalPlatform SELECT decoding
As the ARA-M applet is a GlobalPlatform applet, its SELECT response
decoding should be used, not the ETSI EUICC TS 102 221 fall-back.
Change-Id: I1a30b88a385f6de663aa837483dd32c0d104856f
---
M pySim/ara_m.py
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/22/35722/1
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index f05109b..a2eaa33 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -31,6 +31,7 @@
from pySim.construct import *
from pySim.filesystem import *
from pySim.tlv import *
+import pySim.global_platform
# various BER-TLV encoded Data Objects (DOs)
@@ -259,6 +260,9 @@
files = []
self.add_files(files)
+ def decode_select_response(self, data_hex):
+ return pySim.global_platform.decode_select_response(data_hex)
+
@staticmethod
def xceive_apdu_tlv(tp, hdr: Hexstr, cmd_do, resp_cls, exp_sw='9000'):
"""Transceive an APDU with the card, transparently encoding the command data from TLV
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35722?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1a30b88a385f6de663aa837483dd32c0d104856f
Gerrit-Change-Number: 35722
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange