laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33183 )
Change subject: HPSIM application support
......................................................................
HPSIM application support
Support HPSIM as specified in 3GPP TS 31.104
Change-Id: I2729fd2b88cd13c36d7128753ad8d3e3d08a9b52
---
M pySim-shell.py
A pySim/ts_31_104.py
2 files changed, 73 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/pySim-shell.py b/pySim-shell.py
index 2b8c0be..fc825ef 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -61,6 +61,7 @@
from pySim.ts_102_222 import Ts102222Commands
from pySim.ts_31_102 import CardApplicationUSIM
from pySim.ts_31_103 import CardApplicationISIM
+from pySim.ts_31_104 import CardApplicationHPSIM
from pySim.ara_m import CardApplicationARAM
from pySim.global_platform import CardApplicationISD
from pySim.gsm_r import DF_EIRENE
@@ -123,6 +124,7 @@
if isinstance(profile, CardProfileUICC):
profile.add_application(CardApplicationUSIM())
profile.add_application(CardApplicationISIM())
+ profile.add_application(CardApplicationHPSIM())
profile.add_application(CardApplicationARAM())
profile.add_application(CardApplicationISD())
diff --git a/pySim/ts_31_104.py b/pySim/ts_31_104.py
new file mode 100644
index 0000000..0adafba
--- /dev/null
+++ b/pySim/ts_31_104.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+
+"""
+Support for 3GPP TS 31.104 V17.0.0
+"""
+
+# Copyright (C) 2023 Harald Welte <laforge(a)osmocom.org>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from pySim.filesystem import *
+from pySim.utils import *
+from pySim.tlv import *
+from pySim.ts_31_102 import ADF_USIM
+from pySim.ts_51_011 import EF_IMSI, EF_AD
+import pySim.ts_102_221
+from pySim.ts_102_221 import EF_ARR
+
+
+class ADF_HPSIM(CardADF):
+ def __init__(self, aid='a000000087100A', name='ADF.HPSIM', fid=None, sfid=None,
+ desc='HPSIM Application'):
+ super().__init__(aid=aid, fid=fid, sfid=sfid, name=name, desc=desc)
+
+ files = [
+ EF_ARR(fid='6f06', sfid=0x06),
+ EF_IMSI(fid='6f07', sfid=0x07),
+ EF_AD(fid='6fad', sfid=0x03),
+ ]
+ self.add_files(files)
+ # add those commands to the general commands of a TransparentEF
+ self.shell_commands += [ADF_USIM.AddlShellCommands()]
+
+ def decode_select_response(self, data_hex):
+ return pySim.ts_102_221.CardProfileUICC.decode_select_response(data_hex)
+
+
+# TS 31.104 Section 7.1
+sw_hpsim = {
+ 'Security management': {
+ '9862': 'Authentication error, incorrect MAC',
+ }
+}
+
+
+class CardApplicationHPSIM(CardApplication):
+ def __init__(self):
+ super().__init__('HPSIM', adf=ADF_HPSIM(), sw=sw_hpsim)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33183
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2729fd2b88cd13c36d7128753ad8d3e3d08a9b52
Gerrit-Change-Number: 33183
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33209 )
Change subject: Move "suspend_uicc" command from pySim-shell to ts_102_221.py
......................................................................
Patch Set 2:
(1 comment)
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/33209/comment/d8eec187_7bfffe4e
PS1, Line 291: print
> `self. […]
sorry, that's a left-over debug statement that should be removed.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33209
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I574348951f06b749aeff986589186110580328bc
Gerrit-Change-Number: 33209
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jun 2023 16:24:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge.
Hello Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/33209
to look at the new patch set (#2).
Change subject: Move "suspend_uicc" command from pySim-shell to ts_102_221.py
......................................................................
Move "suspend_uicc" command from pySim-shell to ts_102_221.py
The SUSPEND UICC command is a TS 102 221 (UICC) command, so move
it to the UICC Card Profile.
Also, make sure that any shell command sets specified in the
CardProfile are actually installed during equip().
Change-Id: I574348951f06b749aeff986589186110580328bc
---
M docs/shell.rst
M pySim-shell.py
M pySim/ts_102_221.py
3 files changed, 47 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/33209/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33209
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I574348951f06b749aeff986589186110580328bc
Gerrit-Change-Number: 33209
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter.
Hello Jenkins Builder, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/33210
to look at the new patch set (#2).
Change subject: ts_102221: Add "resume_uicc" command
......................................................................
ts_102221: Add "resume_uicc" command
We've had a "suspend_uicc" command since commit
ec95053249bc7f9308ca1f659d8ef6ac97a6e393 in 2021, but didn't yet
have the corresponding "resume" pair.
Note that you cannot really execute this in a reasonable way from
within pySim, as it is issuing other commands than those permitted
between SUSPEND and RESUME by TS 102 221 Section 11.1.22.3.2
Change-Id: I3322fde74f680e77954e1d3e18a32ef5662759f2
---
M docs/shell.rst
M pySim/commands.py
M pySim/ts_102_221.py
3 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/10/33210/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33210
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3322fde74f680e77954e1d3e18a32ef5662759f2
Gerrit-Change-Number: 33210
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
laforge has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/pysim/+/33212 )
Change subject: ts_31_102: Add shell command for GET IDENTITY
......................................................................
ts_31_102: Add shell command for GET IDENTITY
GET IDENTITY is used in the "SUCI computation on USIM" feature.
Change-Id: I619d397900dbd6565f8f46acdabcee511903830c
---
M docs/shell.rst
M pySim/commands.py
M pySim/ts_31_102.py
3 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/12/33212/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33212
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I619d397900dbd6565f8f46acdabcee511903830c
Gerrit-Change-Number: 33212
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
Hello Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-pcu/+/32339
to look at the new patch set (#5).
Change subject: Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK
......................................................................
Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK
Dispatching TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS means the UL TBF is
able to be used to assign DL TBFs over PACCH.
However, there's an extra implicit restriction: if the PCU already sent
the final UL ACK/NACK to that UL TBF, then whatever message sent
after it cannot be reliably answered, since the MS will go back to idle
state after issues the PKT CTRL ACK for that final UL ACK/NACK.
This condition is already being checked in
contention_resolution_success():
"""
if (ms_need_dl_tbf(ms()) && !tbf_ul_ack_waiting_cnf_final_ack(this))
ms_new_dl_tbf_assigned_on_pacch(ms(), this);
"""
Since we are considering the UL TBF to have done contention resolution
when we transmit the *first* UL ACK/NACK, it mans we are doing both things
on the same code path iif the *first* UL ACK/NACK is at the same time
the *final* UL ACK for that UL TBF. This can happen if the UL TBF is
only sending 1 block, which will have CV=0. This can usually happen
during GMM Attach Request.
In this scenario, with current code goes into a situation where first
the TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS is triggered and *afterwards*
the UL_ACK/NACK state is updated. As a result, the code snippet check
above (!tbf_ul_ack_waiting_cnf_final_ack()) will be true and the DL TBF
be assigned, but afterwards in the same code path it figures out the
final ack happens.
In order to fix this, first update the ACK/NACK state and only
afterwards trigger the Contention Resolution Success event.
Change-Id: I62ae91b494e4fd0ade3f4a3ba3817bcaedbdebf5
---
M src/tbf_ul_ack_fsm.c
M tests/tbf/TbfTest.err
2 files changed, 64 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/39/32339/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32339
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I62ae91b494e4fd0ade3f4a3ba3817bcaedbdebf5
Gerrit-Change-Number: 32339
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/32339 )
Change subject: Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK
......................................................................
Patch Set 4: Code-Review+1
(2 comments)
Commit Message:
https://gerrit.osmocom.org/c/osmo-pcu/+/32339/comment/784848ee_509b708e
PS4, Line 16: ()
redundant `()`
https://gerrit.osmocom.org/c/osmo-pcu/+/32339/comment/d0f4a3e3_fa678820
PS4, Line 37: he
the
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32339
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I62ae91b494e4fd0ade3f4a3ba3817bcaedbdebf5
Gerrit-Change-Number: 32339
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jun 2023 15:54:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment