dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39862?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: saip-tool: allow removing of profile elements by type
......................................................................
saip-tool: allow removing of profile elements by type
At the moment it is only possible to remove profile elements by their identification
number. However, there may be cases where we want to remove all profile elements of
a certain type at once (e.g. when removing all applications).
Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
---
M contrib/saip-tool.py
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index c2115a6..64aba93 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -54,7 +54,8 @@
parser_rpe = subparsers.add_parser('remove-pe', help='Remove specified PEs from PE-Sequence')
parser_rpe.add_argument('--output-file', required=True, help='Output file name')
-parser_rpe.add_argument('--identification', type=int, action='append', help='Remove PEs matching specified identification')
+parser_rpe.add_argument('--identification', default=[], type=int, action='append', help='Remove PEs matching specified identification')
+parser_rpe.add_argument('--type', default=[], action='append', help='Remove PEs matching specified type')
parser_rn = subparsers.add_parser('remove-naa', help='Remove speciifed NAAs from PE-Sequence')
parser_rn.add_argument('--output-file', required=True, help='Output file name')
@@ -146,6 +147,9 @@
if identification in opts.identification:
print("Removing PE %s (id=%u) from Sequence..." % (pe, identification))
continue
+ if pe.type in opts.type:
+ print("Removing PE %s (type=%s) from Sequence..." % (pe, pe.type))
+ continue
new_pe_list.append(pe)
pes.pe_list = new_pe_list
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39862?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
Gerrit-Change-Number: 39862
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39861?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: saip-tool: add option to extact profile elements to file
......................................................................
saip-tool: add option to extact profile elements to file
In some cases it may be helpful to extract a single profile element
from the sequence to a dedicated file.
Change-Id: I77a80bfaf8970660a84fa61f7e08f404ffc4c2da
---
M contrib/saip-tool.py
1 file changed, 14 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index b7282bd..c2115a6 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -48,6 +48,10 @@
parser_check = subparsers.add_parser('check', help='Run constraint checkers on PE-Sequence')
+parser_rpe = subparsers.add_parser('extract-pe', help='Extract specified PE to (DER encoded) file')
+parser_rpe.add_argument('--pe-file', required=True, help='PE file name')
+parser_rpe.add_argument('--identification', type=int, help='Extract PE matching specified identification')
+
parser_rpe = subparsers.add_parser('remove-pe', help='Remove specified PEs from PE-Sequence')
parser_rpe.add_argument('--output-file', required=True, help='Output file name')
parser_rpe.add_argument('--identification', type=int, action='append', help='Remove PEs matching specified identification')
@@ -126,6 +130,14 @@
checker.check(pes)
print("All good!")
+def do_extract_pe(pes: ProfileElementSequence, opts):
+ new_pe_list = []
+ for pe in pes.pe_list:
+ if pe.identification == opts.identification:
+ print("Extracting PE %s (id=%u) to file %s..." % (pe, pe.identification, opts.pe_file))
+ with open(opts.pe_file, 'wb') as f:
+ f.write(pe.to_der())
+
def do_remove_pe(pes: ProfileElementSequence, opts):
new_pe_list = []
for pe in pes.pe_list:
@@ -248,6 +260,8 @@
do_dump(pes, opts)
elif opts.command == 'check':
do_check(pes, opts)
+ elif opts.command == 'extract-pe':
+ do_extract_pe(pes, opts)
elif opts.command == 'remove-pe':
do_remove_pe(pes, opts)
elif opts.command == 'remove-naa':
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39861?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I77a80bfaf8970660a84fa61f7e08f404ffc4c2da
Gerrit-Change-Number: 39861
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: dexter.
Hello Jenkins Builder, fixeria, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/39862?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: saip-tool: allow removing of profile elements by type
......................................................................
saip-tool: allow removing of profile elements by type
At the moment it is only possible to remove profile elements by their identification
number. However, there may be cases where we want to remove all profile elements of
a certain type at once (e.g. when removing all applications).
Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
---
M contrib/saip-tool.py
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/39862/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39862?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
Gerrit-Change-Number: 39862
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter.
Hello Jenkins Builder, fixeria, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/39861?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: saip-tool: add option to extact profile elements to file
......................................................................
saip-tool: add option to extact profile elements to file
In some cases it may be helpful to extract a single profile element
from the sequence to a dedicated file.
Change-Id: I77a80bfaf8970660a84fa61f7e08f404ffc4c2da
---
M contrib/saip-tool.py
1 file changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/39861/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39861?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I77a80bfaf8970660a84fa61f7e08f404ffc4c2da
Gerrit-Change-Number: 39861
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39859?usp=email )
Change subject: saip-tool: add function to write PE sequence
......................................................................
saip-tool: add function to write PE sequence
To prevent code duplication and to make the implementation simpler,
let's add a function that takes care of writing the PE sequnece
to an output file.
Change-Id: I38733422270f5b9c18187b7f247b84bf21f9121b
---
M contrib/saip-tool.py
1 file changed, 8 insertions(+), 6 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index 763e18d..b7282bd 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -65,6 +65,12 @@
parser_info = subparsers.add_parser('tree', help='Display the filesystem tree')
+def write_pes(pes: ProfileElementSequence, output_file:str):
+ """write the PE sequence to a file"""
+ print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), output_file))
+ with open(output_file, 'wb') as f:
+ f.write(pes.to_der())
+
def do_split(pes: ProfileElementSequence, opts):
i = 0
for pe in pes.pe_list:
@@ -132,9 +138,7 @@
pes.pe_list = new_pe_list
pes._process_pelist()
- print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), opts.output_file))
- with open(opts.output_file, 'wb') as f:
- f.write(pes.to_der())
+ write_pes(pes, opts.output_file)
def do_remove_naa(pes: ProfileElementSequence, opts):
if not opts.naa_type in NAAs:
@@ -142,9 +146,7 @@
naa = NAAs[opts.naa_type]
print("Removing NAAs of type '%s' from Sequence..." % opts.naa_type)
pes.remove_naas_of_type(naa)
- print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), opts.output_file))
- with open(opts.output_file, 'wb') as f:
- f.write(pes.to_der())
+ write_pes(pes, opts.output_file)
def do_info(pes: ProfileElementSequence, opts):
def get_naa_count(pes: ProfileElementSequence) -> dict:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39859?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I38733422270f5b9c18187b7f247b84bf21f9121b
Gerrit-Change-Number: 39859
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/39868?usp=email )
Change subject: gsm0911_gsup_rx(): invalidate vsub pointer
......................................................................
gsm0911_gsup_rx(): invalidate vsub pointer
Calling vlr_subscr_put() in gsm0911_gsup_rx() may result in free()ing
the memory pointed by vsub, so let's set it to NULL to prevent
potential use-after-free.
Change-Id: If81df71a52e4fa972b48c61d1ed1361c6629ae94
---
M src/libmsc/gsm_09_11.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 0b85cbd..442995e 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -503,6 +503,7 @@
/* We don't need subscriber info anymore */
vlr_subscr_put(vsub, __func__);
+ vsub = NULL;
/* (Re)schedule the inactivity timer */
if (net->ncss_guard_timeout > 0) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/39868?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: If81df71a52e4fa972b48c61d1ed1361c6629ae94
Gerrit-Change-Number: 39868
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
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>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39867?usp=email )
Change subject: [cosmetic] pySim.transport: Fix spelling/typos in comment
......................................................................
[cosmetic] pySim.transport: Fix spelling/typos in comment
Change-Id: Ia20cc2439bf00c1b6479f36c05514945ac4faf71
---
M pySim/transport/__init__.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 5b0ee07..767691c 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -164,8 +164,8 @@
if self.apdu_tracer:
self.apdu_tracer.trace_response(apdu, sw, data)
- # The APDU case (See aso ISO/IEC 7816-3, table 12) dictates if we should receive a response or not. If we
- # receive a response in an APDU case that does not allow the reception of a respnse we print a warning to
+ # The APDU case (See also ISO/IEC 7816-3, table 12) dictates if we should receive a response or not. If we
+ # receive a response in an APDU case that does not allow the reception of a response we print a warning to
# make the user/caller aware of the problem. Since the transaction is over at this point and data was received
# we count it as a successful transaction anyway, even though the spec was violated. The problem is most likely
# caused by a missing Le field in the APDU. This is an error that the caller/user should correct to avoid
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39867?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia20cc2439bf00c1b6479f36c05514945ac4faf71
Gerrit-Change-Number: 39867
Gerrit-PatchSet: 1
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>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39866?usp=email )
Change subject: pySim/commands: Fix envelope command APDU case after T=1 support
......................................................................
pySim/commands: Fix envelope command APDU case after T=1 support
When we merged I8b56d7804a2b4c392f43f8540e0b6e70001a8970 for T=1
support, the ENVELOPE C-APDU was not adjusted to reflect the correct
case. ENVELOPE expects a response and hence needs a Le byte present.
This avoids below related message when performing e.g. OTA via SMS
Warning: received unexpected response data, incorrect APDU-case (3, should be 4, missing Le field?)!
Change-Id: Ice12675e02aa5438cf9f069f8fcc296c64aabc5a
Related: OS#6367
---
M pySim/commands.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/commands.py b/pySim/commands.py
index af9f247..dd58109 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -735,7 +735,7 @@
Args:
payload : payload as hex string
"""
- return self.send_apdu_checksw('80c20000%02x%s' % (len(payload)//2, payload), apply_lchan = False)
+ return self.send_apdu_checksw('80c20000%02x%s' % (len(payload)//2, payload) + "00", apply_lchan = False)
def terminal_profile(self, payload: Hexstr) -> ResTuple:
"""Send TERMINAL PROFILE to card
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39866?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ice12675e02aa5438cf9f069f8fcc296c64aabc5a
Gerrit-Change-Number: 39866
Gerrit-PatchSet: 1
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>