laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33124 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Switch from pycryptodome to pycryptodomex
......................................................................
Switch from pycryptodome to pycryptodomex
So for some weird historical reasons, the same python module is
available as pycryptodome (Crypto.* namespace) and pycryptodomex
(Cryptodome.* namespace). See the following information on the project
homepage: https://www.pycryptodome.org/src/installation
To make things extra-weird, Debian choose to package pycryptodomex as
python3-pycryptodome
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886291).
So in order to support both Debian-packaged and differently-installed
packages, let's switch to pycryotodomex on all platforms/installers.
Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62
---
M README.md
M pySim/ota.py
M pySim/utils.py
M requirements.txt
M setup.py
5 files changed, 29 insertions(+), 7 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
dexter: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/README.md b/README.md
index 025b518..db13a52 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@
- termcolor
- colorlog
- packaging
- - pycryptodome
+ - pycryptodomex
Example for Debian:
```sh
@@ -54,6 +54,7 @@
pcscd libpcsclite-dev \
python3 \
python3-setuptools \
+ python3-pycryptodome \
python3-pyscard \
python3-pip
pip3 install --user -r requirements.txt
diff --git a/pySim/ota.py b/pySim/ota.py
index 83303a6..5955a08 100644
--- a/pySim/ota.py
+++ b/pySim/ota.py
@@ -150,8 +150,8 @@
pass
-from Crypto.Cipher import DES, DES3, AES
-from Crypto.Hash import CMAC
+from Cryptodome.Cipher import DES, DES3, AES
+from Cryptodome.Hash import CMAC
class OtaAlgo(abc.ABC):
iv = property(lambda self: bytes([0] * self.blocksize))
diff --git a/pySim/utils.py b/pySim/utils.py
index 6b8ee37..537014f 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -616,9 +616,9 @@
"""
Run the milenage algorithm to calculate OPC from Ki and OP
"""
- from Crypto.Cipher import AES
+ from Cryptodome.Cipher import AES
# pylint: disable=no-name-in-module
- from Crypto.Util.strxor import strxor
+ from Cryptodome.Util.strxor import strxor
from pySim.utils import b2h
# We pass in hex string and now need to work on bytes
diff --git a/requirements.txt b/requirements.txt
index fb94472..b12cb4d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,5 +9,5 @@
pyyaml>=5.1
termcolor
colorlog
-pycryptodome
+pycryptodomex
packaging
diff --git a/setup.py b/setup.py
index d14ebc6..d4fb15f 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
"pyyaml >= 5.1",
"termcolor",
"colorlog",
- "pycryptodome",
+ "pycryptodomex",
"packaging",
],
scripts=[
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33124
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62
Gerrit-Change-Number: 33124
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/83/33183/1
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..4473462
--- /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_isim = {
+ 'Security management': {
+ '9862': 'Authentication error, incorrect MAC',
+ }
+}
+
+
+class CardApplicationHPSIM(CardApplication):
+ def __init__(self):
+ super().__init__('HPSIM', adf=ADF_HPSIM(), sw=sw_isim)
--
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: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
jolly has abandoned this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33147 )
Change subject: Add more parameters for ASCI tests to TestHdlrParams
......................................................................
Abandoned
Content of this patch has moved.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33147
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5aaea5a92fcfa737624ef46b56dcfefb74266758
Gerrit-Change-Number: 33147
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: abandon
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33095 )
Change subject: rlcmac: Implement UL TBF Countdown procedure
......................................................................
Patch Set 4:
(2 comments)
Patchset:
PS4:
i don't understand much of this but looks sane to me =)
File include/osmocom/gprs/rlcmac/tbf_ul.h:
https://gerrit.osmocom.org/c/libosmo-gprs/+/33095/comment/01976675_5bebb99e
PS4, Line 45: countdown_procedure
drop this name? appears to not be used anywhere and looks odd here.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33095
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: If043c86a0c2b89d0ac0b8174de39fbcb22bed8cb
Gerrit-Change-Number: 33095
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jun 2023 00:22:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/33098 )
Change subject: db: extend database schema to support 256bit K and/or OP[c] values
......................................................................
Patch Set 4:
(3 comments)
File src/db.c:
https://gerrit.osmocom.org/c/osmo-hlr/+/33098/comment/fb60d742_5e9d6495
PS4, Line 550: 6
7
(last time i worked on this i considered having a LOGP("%d", version) because it's easy to make this copy paste mistake and not notice; i guess i decided against it)
File src/hlr_vty_subscr.c:
https://gerrit.osmocom.org/c/osmo-hlr/+/33098/comment/c50ae12f_57ba031a
PS4, Line 479: * below for real 3G AKA algorithms. */
(120 line width)
https://gerrit.osmocom.org/c/osmo-hlr/+/33098/comment/9dab5afa_6aa1c6ac
PS4, Line 510: *maxlen_opc = MILENAGE_KEY_LEN;
will there ever be minlen_opc < maxlen_opc?
--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/33098
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ibbde68484c904507a15c35cbfdf88cd47d0c7039
Gerrit-Change-Number: 33098
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 05 Jun 2023 22:39:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment