Attention is currently required from: fixeria, laforge, lynxis lazus, pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41456?usp=email )
Change subject: bssgp: Fix non-uniqe rate_ctr ids
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
> I now see this was already proposed here: https://gerrit.osmocom.org/c/libosmocore/+/13206 […]
At least from the view of osmo-gbproxy we absolutely have the same BVCI on multiple NSEs so I would say this fix is fine.
I still think having a string identifier might be a better option in the future. Then the "index" could be something like "NSE00101-BVC00023".
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41456?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I782e11a75a8adc10292238fde46bf9c3975d970d
Gerrit-Change-Number: 41456
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Wed, 19 Nov 2025 15:46:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41468?usp=email )
Change subject: pySim-shell: re-organize Card Key Provider related options
......................................................................
pySim-shell: re-organize Card Key Provider related options
As we plan to support other formats as data source for the
Card Key Provider soon, the more commandline options may be added
and it makes sense to group the Card Key Provider options in a
dedicated group.
Let's also rename the option "--csv-column-key" to just "--column-key".
The column encryption is a generic concept and not CSV format specific.
(let's silently keep the "--csv-column-key" argument so maintain backward
compatibility)
Related: SYS#7725
Change-Id: I5093f8383551f8c9b84342ca6674c1ebdbbfc19c
---
M pySim-shell.py
1 file changed, 13 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/41468/1
diff --git a/pySim-shell.py b/pySim-shell.py
index b933a03..72e988c 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -1124,10 +1124,6 @@
global_group = option_parser.add_argument_group('General Options')
global_group.add_argument('--script', metavar='PATH', default=None,
help='script with pySim-shell commands to be executed automatically at start-up')
-global_group.add_argument('--csv', metavar='FILE',
- default=None, help='Read card data from CSV file')
-global_group.add_argument('--csv-column-key', metavar='FIELD:AES_KEY_HEX', default=[], action='append',
- help='per-CSV-column AES transport key')
global_group.add_argument("--card_handler", dest="card_handler_config", metavar="FILE",
help="Use automatic card handling machine")
global_group.add_argument("--noprompt", help="Run in non interactive mode",
@@ -1137,6 +1133,14 @@
global_group.add_argument("--verbose", help="Enable verbose logging",
action='store_true', default=False)
+card_key_group = option_parser.add_argument_group('Card Key Provider Options')
+card_key_group.add_argument('--csv', metavar='FILE',
+ default=None, help='Read card data from CSV file')
+card_key_group.add_argument('--csv-column-key', metavar='FIELD:AES_KEY_HEX', default=[], action='append',
+ help=argparse.SUPPRESS, dest='column_key')
+card_key_group.add_argument('--column-key', metavar='FIELD:AES_KEY_HEX', default=[], action='append',
+ help='per-column AES transport key', dest='column_key')
+
adm_group = global_group.add_mutually_exclusive_group()
adm_group.add_argument('-a', '--pin-adm', metavar='PIN_ADM1', dest='pin_adm', default=None,
help='ADM PIN used for provisioning (overwrites default)')
@@ -1162,15 +1166,15 @@
# Register csv-file as card data provider, either from specified CSV
# or from CSV file in home directory
- csv_column_keys = {}
- for par in opts.csv_column_key:
+ column_keys = {}
+ for par in opts.column_key:
name, key = par.split(':')
- csv_column_keys[name] = key
+ column_keys[name] = key
csv_default = str(Path.home()) + "/.osmocom/pysim/card_data.csv"
if opts.csv:
- card_key_provider_register(CardKeyProviderCsv(opts.csv, csv_column_keys))
+ card_key_provider_register(CardKeyProviderCsv(opts.csv, column_keys))
if os.path.isfile(csv_default):
- card_key_provider_register(CardKeyProviderCsv(csv_default, csv_column_keys))
+ card_key_provider_register(CardKeyProviderCsv(csv_default, column_keys))
# Init card reader driver
sl = init_reader(opts, proactive_handler = Proact())
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41468?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5093f8383551f8c9b84342ca6674c1ebdbbfc19c
Gerrit-Change-Number: 41468
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41467?usp=email )
Change subject: pySim-shell: add command to manually query the Card Key Provider
......................................................................
pySim-shell: add command to manually query the Card Key Provider
The Card Key Provider is a built in mechanism of pySim-shell which
allows the user to read key material from a CSV file in order to
avoid having to lookup and enter the key material himself. The
lookup normally done by the pySim-shell commands automatically.
However, in some cases it may also be useful to be able to query the
CSV file manually in order to get certain fields displayed. Such a
command is in particular helpful to check and diagnose the CSV data
source.
Related: SYS#7725
Change-Id: I76e0f883572a029bdca65a5a6b3eef306db1c221
---
M pySim-shell.py
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/67/41467/1
diff --git a/pySim-shell.py b/pySim-shell.py
index 8b0b58e..b933a03 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -498,6 +498,21 @@
"""Echo (print) a string on the console"""
self.poutput(' '.join(opts.STRING))
+ query_card_key_parser = argparse.ArgumentParser()
+ query_card_key_parser.add_argument('FIELDS', help="fields to query", type=str, nargs='+')
+ query_card_key_parser.add_argument('--key', help='lookup key (typically \'ICCID\' or \'EID\')',
+ type=str, required=True)
+ query_card_key_parser.add_argument('--value', help='lookup key match value (e.g \'8988211000000123456\')',
+ type=str, required=True)
+ @cmd2.with_argparser(query_card_key_parser)
+ @cmd2.with_category(CUSTOM_CATEGORY)
+ def do_query_card_key(self, opts):
+ """Manually query the Card Key Provider"""
+ result = card_key_provider_get(opts.FIELDS, opts.key, opts.value)
+ self.poutput("Result:")
+ for k in result.keys():
+ self.poutput(" %s: %s" % (str(k), str(result.get(k))))
+
@cmd2.with_category(CUSTOM_CATEGORY)
def do_version(self, opts):
"""Print the pySim software version."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41467?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I76e0f883572a029bdca65a5a6b3eef306db1c221
Gerrit-Change-Number: 41467
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41466?usp=email )
Change subject: card_key_provider: remove unnecessary class property definitions
......................................................................
card_key_provider: remove unnecessary class property definitions
The two properties csv_file and csv_filename are defined by the
constructor anyway, let's remove the declaration in the class body
because it is not needed.
Change-Id: Ibbe8e17b03a4ba0041c0e9990a5e9614388d9c03
---
M pySim/card_key_provider.py
1 file changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/66/41466/1
diff --git a/pySim/card_key_provider.py b/pySim/card_key_provider.py
index 16403ff..f98f06e 100644
--- a/pySim/card_key_provider.py
+++ b/pySim/card_key_provider.py
@@ -173,9 +173,6 @@
class CardKeyProviderCsv(CardKeyProvider):
"""Card key provider implementation that allows to query against a specified CSV file."""
- csv_file = None
- filename = None
-
def __init__(self, csv_filename: str, transport_keys: dict):
"""
Args:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41466?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ibbe8e17b03a4ba0041c0e9990a5e9614388d9c03
Gerrit-Change-Number: 41466
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41464?usp=email )
Change subject: card_key_provider: use case-insensitive field names
......................................................................
card_key_provider: use case-insensitive field names
It is common in CSV files that the columns have uppercase names, so we
have adopted this scheme when we started using the card_key_provider.
This also means that the API of the card_key_provider_get() and
card_key_provider_get_field() function now implicitly requires
uppercase field names like 'ICCID', 'ADM1', etc.
Unfortunately this may be unreliable, so let's convert the field
names to uppercase as soon as we receive them. This makes the API
case-insensitive and gives us the assurance that all field names
we ever work with are in uppercase.
Related: SYS#7725
Change-Id: I9d80752587e2ccff0963c10abd5a2f42f5868d79
---
M pySim/card_key_provider.py
M tests/unittests/test_card_key_provider.py
2 files changed, 13 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/64/41464/1
diff --git a/pySim/card_key_provider.py b/pySim/card_key_provider.py
index 76c1fd6..6292f93 100644
--- a/pySim/card_key_provider.py
+++ b/pySim/card_key_provider.py
@@ -231,6 +231,8 @@
Returns:
dictionary of {field, value} strings for each requested field from 'fields'
"""
+ key = key.upper()
+ fields = [f.upper() for f in fields]
for p in provider_list:
if not isinstance(p, CardKeyProvider):
raise ValueError(
@@ -252,6 +254,8 @@
Returns:
dictionary of {field, value} strings for the requested field
"""
+ key = key.upper()
+ field = field.upper()
for p in provider_list:
if not isinstance(p, CardKeyProvider):
raise ValueError(
diff --git a/tests/unittests/test_card_key_provider.py b/tests/unittests/test_card_key_provider.py
index bbe76e8..121998c 100644
--- a/tests/unittests/test_card_key_provider.py
+++ b/tests/unittests/test_card_key_provider.py
@@ -66,6 +66,11 @@
"KIC2","KIC3","KID1","KID2","KID3","KIK1","KIK2","KIK3","OPC"],
"ICCID", t.get('ICCID'))
self.assertEqual(result, t.get('EXPECTED'))
+ result = card_key_provider_get(["PIN1","puk1","PIN2","PUK2","KI","adm1","ADM2","KIC1",
+ "KIC2","kic3","KID1","KID2","KID3","kik1","KIK2","KIK3","OPC"],
+ "iccid", t.get('ICCID'))
+ self.assertEqual(result, t.get('EXPECTED'))
+
def test_card_key_provider_get_field(self):
test_data = [{'EXPECTED' : "3eb8567fa0b4b1e63bcab13bff5f2702", 'ICCID' :"8988211000000000001"},
@@ -75,6 +80,10 @@
for t in test_data:
result = card_key_provider_get_field("KIC1", "ICCID", t.get('ICCID'))
self.assertEqual(result, t.get('EXPECTED'))
+ for t in test_data:
+ result = card_key_provider_get_field("kic1", "iccid", t.get('ICCID'))
+ self.assertEqual(result, t.get('EXPECTED'))
+
class TestCardKeyFieldCryptor(unittest.TestCase):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41464?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I9d80752587e2ccff0963c10abd5a2f42f5868d79
Gerrit-Change-Number: 41464
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>