lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[M] Change in pysim[master]: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlat...
by laforge 04 Feb '24

04 Feb '24
laforge has abandoned this change. ( https://gerrit.osmocom.org/c/pysim/+/35769?usp=email ) Change subject: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlatform ...................................................................... Abandoned merged into I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35769?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: Ieda75c865a6ff2725fc3c8772bb274d96b8a5a43 Gerrit-Change-Number: 35769 Gerrit-PatchSet: 7 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: abandon
1 0
0 0
[M] Change in pysim[master]: Add global_platform shell command establish_scp02 and release_scp
by laforge 04 Feb '24

04 Feb '24
laforge has abandoned this change. ( https://gerrit.osmocom.org/c/pysim/+/35764?usp=email ) Change subject: Add global_platform shell command establish_scp02 and release_scp ...................................................................... Abandoned merged into I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35764?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: Ib2f3c8f0563f81a941dd55b97c9836e3a6856407 Gerrit-Change-Number: 35764 Gerrit-PatchSet: 11 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: abandon
1 0
0 0
[L] Change in pysim[master]: Introduce GlobalPlatform SCP02 implementation
by laforge 04 Feb '24

04 Feb '24
Attention is currently required from: dexter, fixeria, laforge. Hello Jenkins Builder, dexter, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/35462?usp=email to look at the new patch set (#10). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: Introduce GlobalPlatform SCP02 implementation ...................................................................... Introduce GlobalPlatform SCP02 implementation This implementation of GlobalPlatform SCP02 currently only supports C-MAC and C-ENC, but no R-MAC or R-ENC yet. The patch also introduces the notion of having a SCP instance associated with a SimCardCommands instance. It also adds the establish_scp0w and release_scp shell commands to all GlobalPlatform Security Domains. Change-Id: I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 --- M docs/shell.rst M pySim-shell.py M pySim/commands.py M pySim/global_platform/__init__.py A pySim/global_platform/scp02.py A pySim/secure_channel.py A tests/test_globalplatform.py 7 files changed, 453 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/35462/10 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35462?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: I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 Gerrit-Change-Number: 35462 Gerrit-PatchSet: 10 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: global_platform: Fix --key-id argument
by laforge 04 Feb '24

04 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35800?usp=email ) Change subject: global_platform: Fix --key-id argument ...................................................................... global_platform: Fix --key-id argument The key-id is actually a 7-bit integer and on the wire the 8th bit has a special meaning which can be derived automatically. Let's unburden the user from explicitly encoding that 8th bit and instead set it automatically. Change-Id: I8da37aa8fd064e6d35ed29a70f5d7a0e9060be3a --- M pySim/global_platform/__init__.py 1 file changed, 21 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/00/35800/1 diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index e32b47e..848adba 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -522,12 +522,12 @@ See GlobalPlatform CardSpecification v2.3 Section 11.8 for details. Example (SCP80 KIC/KID/KIK): - put_key --key-version-nr 1 --key-id 0x81 --key-type aes --key-data 000102030405060708090a0b0c0d0e0f + put_key --key-version-nr 1 --key-id 0x01 --key-type aes --key-data 000102030405060708090a0b0c0d0e0f --key-type aes --key-data 101112131415161718191a1b1c1d1e1f --key-type aes --key-data 202122232425262728292a2b2c2d2e2f Example (SCP81 TLS-PSK/KEK): - put_key --key-version-nr 0x40 --key-id 0x81 --key-type tls_psk --key-data 303132333435363738393a3b3c3d3e3f + put_key --key-version-nr 0x40 --key-id 0x01 --key-type tls_psk --key-data 303132333435363738393a3b3c3d3e3f --key-type des --key-data 404142434445464748494a4b4c4d4e4f """ @@ -540,7 +540,10 @@ else: kcv = '' kdb.append({'key_type': opts.key_type[i], 'kcb': opts.key_data[i], 'kcv': kcv}) - self.put_key(opts.old_key_version_nr, opts.key_version_nr, opts.key_id, kdb) + p2 = opts.key_id + if len(opts.key_type) > 1: + p2 |= 0x80 + self.put_key(opts.old_key_version_nr, opts.key_version_nr, p2, kdb) # Table 11-68: Key Data Field - Format 1 (Basic Format) KeyDataBasic = GreedyRange(Struct('key_type'/KeyType, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35800?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: I8da37aa8fd064e6d35ed29a70f5d7a0e9060be3a Gerrit-Change-Number: 35800 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: rename global_platform.scp02 to global_platform.scp
by laforge 04 Feb '24

04 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35801?usp=email ) Change subject: rename global_platform.scp02 to global_platform.scp ...................................................................... rename global_platform.scp02 to global_platform.scp This is in preparation of extending it to cover SCP03 in a follow-up patch. Change-Id: Idc0afac6e95f89ddaf277a89f9c95607e70a471c --- M pySim/global_platform/__init__.py R pySim/global_platform/scp.py M tests/test_globalplatform.py 3 files changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/01/35801/1 diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index 848adba..3ca22af 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -22,7 +22,7 @@ from construct import * from bidict import bidict from Cryptodome.Random import get_random_bytes -from pySim.global_platform.scp02 import SCP02 +from pySim.global_platform.scp import SCP02 from pySim.construct import * from pySim.utils import * from pySim.filesystem import * diff --git a/pySim/global_platform/scp02.py b/pySim/global_platform/scp.py similarity index 100% rename from pySim/global_platform/scp02.py rename to pySim/global_platform/scp.py diff --git a/tests/test_globalplatform.py b/tests/test_globalplatform.py index 280199f..d50948f 100644 --- a/tests/test_globalplatform.py +++ b/tests/test_globalplatform.py @@ -19,7 +19,7 @@ import logging from pySim.global_platform import * -from pySim.global_platform.scp02 import SCP02 +from pySim.global_platform.scp import SCP02 from pySim.utils import b2h, h2b KIC = h2b('100102030405060708090a0b0c0d0e0f') # enc -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35801?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: Idc0afac6e95f89ddaf277a89f9c95607e70a471c Gerrit-Change-Number: 35801 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in pysim[master]: Introduce GlobalPlatform SCP02 implementation
by laforge 04 Feb '24

04 Feb '24
Attention is currently required from: dexter, fixeria, laforge. Hello Jenkins Builder, dexter, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/35462?usp=email to look at the new patch set (#9). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: Introduce GlobalPlatform SCP02 implementation ...................................................................... Introduce GlobalPlatform SCP02 implementation This implementation of GlobalPlatform SCP02 currently only supports C-MAC and C-ENC, but no R-MAC or R-ENC yet. The patch also introduces the notion of having a SCP instance associated with a SimCardCommands instance. No code is using this yet, it will be introduced in a separate patch. Change-Id: I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 --- M pySim/commands.py M pySim/global_platform/__init__.py A pySim/global_platform/scp02.py A pySim/secure_channel.py A tests/test_globalplatform.py 5 files changed, 335 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/35462/9 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35462?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: I56020382b9dfe8ba0f7c1c9f71eb1a9746bc5a27 Gerrit-Change-Number: 35462 Gerrit-PatchSet: 9 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-bsc[master]: abis_nm: fix -Wunused-but-set-variable (bug)
by laforge 03 Feb '24

03 Feb '24
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35791?usp=email ) Change subject: abis_nm: fix -Wunused-but-set-variable (bug) ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35791?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3ca8e761fdf99dd498a979ccc9d53c6c3e03e2cc Gerrit-Change-Number: 35791 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 03 Feb 2024 22:51:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: global_platform: Add install_for_personalization command
by laforge 03 Feb '24

03 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35771?usp=email ) Change subject: global_platform: Add install_for_personalization command ...................................................................... Patch Set 6: Code-Review-1 (1 comment) File docs/shell.rst: https://gerrit.osmocom.org/c/pysim/+/35771/comment/0962b456_7eef6999 PS6, Line 965: :module: pySim.global_platform inst_perso_parser -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35771?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: I2ce766b97bba42c64c4d4492b505be66c24f471e Gerrit-Change-Number: 35771 Gerrit-PatchSet: 6 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sat, 03 Feb 2024 22:48:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlat...
by laforge 03 Feb '24

03 Feb '24
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/35769?usp=email to look at the new patch set (#6). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlatform ...................................................................... SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlatform I'm not entirely sure if this is the right thing to do. For sure I do have cards which don't like SELECT with C-MAC appended... and GlobalPlatform clearly states SELECT is coded with CLA value that has the MSB not set (i.e. not a GlobalPlatform command). Change-Id: Ieda75c865a6ff2725fc3c8772bb274d96b8a5a43 --- M pySim/global_platform/scp02.py M tests/test_globalplatform.py 2 files changed, 47 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/35769/6 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35769?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: Ieda75c865a6ff2725fc3c8772bb274d96b8a5a43 Gerrit-Change-Number: 35769 Gerrit-PatchSet: 6 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in pysim[master]: Contstrain argparse integers to permitted range
by laforge 03 Feb '24

03 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35799?usp=email ) Change subject: Contstrain argparse integers to permitted range ...................................................................... Contstrain argparse integers to permitted range In many casese we used type=int permitting any integer value, positive or negative without a constratint in size. However, in reality often we're constrained to unsigned 8 or 16 bit ranges. Let's use the auto_uint{8,16} functions to enforce this within argparse before we even try to encode something that won't work. Change-Id: I35c81230bc18e2174ec1930aa81463f03bcd69c8 --- M pySim/filesystem.py M pySim/ts_102_222.py M pySim/utils.py 3 files changed, 35 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/99/35799/1 diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 2bc5f01..47bdb57 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -38,7 +38,7 @@ from smartcard.util import toBytes -from pySim.utils import sw_match, h2b, b2h, i2h, is_hex, auto_int, Hexstr, is_hexstr +from pySim.utils import sw_match, h2b, b2h, i2h, is_hex, auto_int, auto_uint8, auto_uint16, Hexstr, is_hexstr from pySim.construct import filter_dict, parse_construct, build_construct from pySim.exceptions import * from pySim.jsonpath import js_path_find, js_path_modify @@ -589,9 +589,9 @@ read_bin_parser = argparse.ArgumentParser() read_bin_parser.add_argument( - '--offset', type=int, default=0, help='Byte offset for start of read') + '--offset', type=auto_uint16, default=0, help='Byte offset for start of read') read_bin_parser.add_argument( - '--length', type=int, help='Number of bytes to read') + '--length', type=auto_uint16, help='Number of bytes to read') @cmd2.with_argparser(read_bin_parser) def do_read_binary(self, opts): @@ -611,7 +611,7 @@ upd_bin_parser = argparse.ArgumentParser() upd_bin_parser.add_argument( - '--offset', type=int, default=0, help='Byte offset for start of read') + '--offset', type=auto_uint16, default=0, help='Byte offset for start of read') upd_bin_parser.add_argument('data', type=is_hexstr, help='Data bytes (hex format) to write') @cmd2.with_argparser(upd_bin_parser) @@ -810,9 +810,9 @@ read_rec_parser = argparse.ArgumentParser() read_rec_parser.add_argument( - 'record_nr', type=int, help='Number of record to be read') + 'record_nr', type=auto_uint8, help='Number of record to be read') read_rec_parser.add_argument( - '--count', type=int, default=1, help='Number of records to be read, beginning at record_nr') + '--count', type=auto_uint8, default=1, help='Number of records to be read, beginning at record_nr') @cmd2.with_argparser(read_rec_parser) def do_read_record(self, opts): @@ -828,7 +828,7 @@ read_rec_dec_parser = argparse.ArgumentParser() read_rec_dec_parser.add_argument( - 'record_nr', type=int, help='Number of record to be read') + 'record_nr', type=auto_uint8, help='Number of record to be read') read_rec_dec_parser.add_argument('--oneline', action='store_true', help='No JSON pretty-printing, dump as a single line') @@ -869,7 +869,7 @@ upd_rec_parser = argparse.ArgumentParser() upd_rec_parser.add_argument( - 'record_nr', type=int, help='Number of record to be read') + 'record_nr', type=auto_uint8, help='Number of record to be read') upd_rec_parser.add_argument('data', type=is_hexstr, help='Data bytes (hex format) to write') @cmd2.with_argparser(upd_rec_parser) @@ -881,7 +881,7 @@ upd_rec_dec_parser = argparse.ArgumentParser() upd_rec_dec_parser.add_argument( - 'record_nr', type=int, help='Number of record to be read') + 'record_nr', type=auto_uint8, help='Number of record to be read') upd_rec_dec_parser.add_argument('data', help='Abstract data (JSON format) to write') upd_rec_dec_parser.add_argument('--json-path', type=str, help='JSON path to modify specific element of record only') @@ -902,7 +902,7 @@ edit_rec_dec_parser = argparse.ArgumentParser() edit_rec_dec_parser.add_argument( - 'record_nr', type=int, help='Number of record to be edited') + 'record_nr', type=auto_uint8, help='Number of record to be edited') @cmd2.with_argparser(edit_rec_dec_parser) def do_edit_record_decoded(self, opts): diff --git a/pySim/ts_102_222.py b/pySim/ts_102_222.py index bf5e29f..ef6f69d 100644 --- a/pySim/ts_102_222.py +++ b/pySim/ts_102_222.py @@ -24,7 +24,7 @@ import argparse from pySim.exceptions import * -from pySim.utils import h2b, swap_nibbles, b2h, JsonEncoder +from pySim.utils import h2b, swap_nibbles, b2h, JsonEncoder, auto_uint8, auto_uint16 from pySim.ts_102_221 import * @@ -112,13 +112,13 @@ create_required = create_parser.add_argument_group('required arguments') create_optional = create_parser.add_argument_group('optional arguments') create_required.add_argument('--ef-arr-file-id', required=True, type=str, help='Referenced Security: File Identifier of EF.ARR') - create_required.add_argument('--ef-arr-record-nr', required=True, type=int, help='Referenced Security: Record Number within EF.ARR') - create_required.add_argument('--file-size', required=True, type=int, help='Size of file in octets') + create_required.add_argument('--ef-arr-record-nr', required=True, type=auto_uint8, help='Referenced Security: Record Number within EF.ARR') + create_required.add_argument('--file-size', required=True, type=auto_uint16, help='Size of file in octets') create_required.add_argument('--structure', required=True, type=str, choices=['transparent', 'linear_fixed', 'ber_tlv'], help='Structure of the to-be-created EF') create_optional.add_argument('--short-file-id', type=str, help='Short File Identifier as 2-digit hex string') create_optional.add_argument('--shareable', action='store_true', help='Should the file be shareable?') - create_optional.add_argument('--record-length', type=int, help='Length of each record in octets') + create_optional.add_argument('--record-length', type=auto_uint16, help='Length of each record in octets') @cmd2.with_argparser(create_parser) def do_create_ef(self, opts): @@ -160,11 +160,11 @@ createdf_optional = createdf_parser.add_argument_group('optional arguments') createdf_sja_optional = createdf_parser.add_argument_group('sysmoISIM-SJA optional arguments') createdf_required.add_argument('--ef-arr-file-id', required=True, type=str, help='Referenced Security: File Identifier of EF.ARR') - createdf_required.add_argument('--ef-arr-record-nr', required=True, type=int, help='Referenced Security: Record Number within EF.ARR') + createdf_required.add_argument('--ef-arr-record-nr', required=True, type=auto_uint8, help='Referenced Security: Record Number within EF.ARR') createdf_optional.add_argument('--shareable', action='store_true', help='Should the file be shareable?') createdf_optional.add_argument('--aid', type=is_hexstr, help='Application ID (creates an ADF, instead of a DF)') # mandatory by spec, but ignored by several OS, so don't force the user - createdf_optional.add_argument('--total-file-size', type=int, help='Physical memory allocated for DF/ADi in octets') + createdf_optional.add_argument('--total-file-size', type=auto_uint16, help='Physical memory allocated for DF/ADi in octets') createdf_sja_optional.add_argument('--permit-rfm-create', action='store_true') createdf_sja_optional.add_argument('--permit-rfm-delete-terminate', action='store_true') createdf_sja_optional.add_argument('--permit-other-applet-create', action='store_true') @@ -208,7 +208,7 @@ resize_ef_parser.add_argument('NAME', type=str, help='Name or FID of file to be resized') resize_ef_parser._action_groups.pop() resize_ef_required = resize_ef_parser.add_argument_group('required arguments') - resize_ef_required.add_argument('--file-size', required=True, type=int, help='Size of file in octets') + resize_ef_required.add_argument('--file-size', required=True, type=auto_uint16, help='Size of file in octets') @cmd2.with_argparser(resize_ef_parser) def do_resize_ef(self, opts): diff --git a/pySim/utils.py b/pySim/utils.py index a31fbe0..73e5040 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -927,6 +927,9 @@ def auto_uint8(x): return _auto_uint(x, 255) +def auto_uint16(x): + return _auto_uint(x, 65535) + def expand_hex(hexstring, length): """Expand a given hexstring to a specified length by replacing "." or ".." with a filler that is derived from the neighboring nibbles respective -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35799?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: I35c81230bc18e2174ec1930aa81463f03bcd69c8 Gerrit-Change-Number: 35799 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.