osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/27253 )
Change subject: lint: checkpatch: ignore MISSING_SPACE
......................................................................
lint: checkpatch: ignore MISSING_SPACE
Don't require breaking strings at spaces. This is not useful for strings
of hex characters, e.g.:
{ 123, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
Change-Id: Ib6be7744418530ae3ddbf373e67d1d7f25a60508
---
M lint/checkpatch/checkpatch_osmo.sh
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/53/27253/1
diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh
index 93b601b..faf0fca 100755
--- a/lint/checkpatch/checkpatch_osmo.sh
+++ b/lint/checkpatch/checkpatch_osmo.sh
@@ -64,6 +64,7 @@
# * LINE_CONTINUATIONS: false positives
# * LINE_SPACING: we don't always put a blank line after declarations
# * LONG_LINE*: should be 120 chars, but exceptions are done often so don't fail here
+# * MISSING_SPACE: warns about breaking strings at space characters, not useful for long strings of hex chars
# * PREFER_DEFINED_ATTRIBUTE_MACRO: macros like __packed not defined in libosmocore
# * PREFER_FALLTHROUGH: pseudo keyword macro "fallthrough" is not defined in libosmocore
# * REPEATED_WORD: false positives in doxygen descriptions (e.g. '\param[in] data Data passed through...')
@@ -103,6 +104,7 @@
--ignore LONG_LINE \
--ignore LONG_LINE_COMMENT \
--ignore LONG_LINE_STRING \
+ --ignore MISSING_SPACE \
--ignore PREFER_DEFINED_ATTRIBUTE_MACRO \
--ignore PREFER_FALLTHROUGH \
--ignore REPEATED_WORD \
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/27253
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ib6be7744418530ae3ddbf373e67d1d7f25a60508
Gerrit-Change-Number: 27253
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/27217 )
Change subject: libosmo-tlv: add versatile TLV de- and encoder
......................................................................
Patch Set 1:
(3 comments)
File include/osmocom/tlv/tlv.h:
https://gerrit.osmocom.org/c/osmo-upf/+/27217/comment/d4989161_ba027bf6
PS1, Line 102: unsigned int tag;
> Isn't this duplicated in load_tl callback?
I added the struct osmo_tlv_load parameter later, to add flexibility. At first the intention was to limit the scope of this function to straight direct pointers.
Let me see whether we should neutralize that argument... yes, just passing a tlv pointer works, thanks
File src/libosmo-tlv/tlv.c:
https://gerrit.osmocom.org/c/osmo-upf/+/27217/comment/20b76ce0_6f579fe4
PS1, Line 266: static int t16l16v_store_tl(uint8_t *dst_data, size_t dst_data_avail, unsigned int tag, size_t len,
> From my experience after looking at open5gs TLV parser, these callbacks can avoided. […]
the point of the callbacks is that i do not want to load this API with a representation of what kinds of headers are possible. This function is merely a simple example for the caller. If more complex TL are needed, the caller plugs a corresponding implementation.
In particular, if a protocol is mixed TLV with TV, we need some lookup for which T are TLV and which are TV. If a protocol has a variable L or T depending on T or even the value of L ... seen all of this, and it is cumbersome to invent data structures that abstractly represent all of these cases. IIUC, the Open5gs TLV parser is unable to deal with older GSM TLV because of this, where half the staff tended to nip off single bytes of protocol wherever they could, including T or L bytes. (while the other half of staff spammed the protocols with weird duplications, I guess)
Using these callbacks is a very simple way to be completely flexible in what the TL part looks like, because the caller defines that. In fact, that makes this an arbitrary XYZV parser, because the headers need not be TL at all.
The way how i could agree to avoid callbacks would be if we generate all of the TLV parsing code and put the header parsing implementations as static function in the generated code -- but they should still be provided by the caller.
But why avoid these callbacks? Have you profiled that this causes substantial load? Have you seen that -O3 is not able to neutralize these far jmps?
I am infinitely more concerned about top-down list iterations. Which we do, *a lot*. Seems to work out fine though so far. (This is the point i always make, remember)
https://gerrit.osmocom.org/c/osmo-upf/+/27217/comment/c4cf1cf0_c1aa3c1c
PS1, Line 275: osmo_store16be(tag, dst_data);
> You may want to also support setting instance in the API, to avoid API breakage in the future when w […]
not sure what you mean by "instance".
Maybe the answer is, this function is just an example for one specific TL encoder?
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27217
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ib0fd00d9f288ffe13b7e67701f3e47073587404a
Gerrit-Change-Number: 27217
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 18 Feb 2022 13:05:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27249 )
Change subject: fix inter-BSC-in handover encryption
......................................................................
Patch Set 3:
(1 comment)
File src/osmo-bsc/handover_fsm.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27249/comment/4852d059_c2f1994e
PS3, Line 743: if (chosen_a5_n > 0) {
> What about checking if chosen_a5_n is in the intersection of bsc+msc. […]
The Chosen Enc Alg is not mandating that we should choose it. It is not an error to use another cipher that is in the intersection of permitted algos.
The effect would be that if one BSC supports only A5/2, then we would carry on this limitation across all future BSCs of that call being handed over. Worse, if the source BSC supports only A5/2, and the target supports A5/1 and A5/3, we would error instead of simply using A5/3.
It makes more sense to use the best availale cipher in each BSC. This is what I did not understand when I wrote this code back in the days.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27249
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
Gerrit-Change-Number: 27249
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 18 Feb 2022 12:28:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/27248
to look at the new patch set (#3).
Change subject: rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
......................................................................
rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
The naming confused me so that I wrote buggy code again. Hopefully this
clarifies which representations the code paths are using.
In the macro code, highlight the error case of n <= -1 explicitly.
Also add ALG_A5_NR_TO_PERM_ALG_BITS. I need the 1<<n case in an
upcoming patch.
Related: SYS#5839
Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/osmo_bsc_bssap.c
4 files changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/27248/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27248
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
Gerrit-Change-Number: 27248
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27248 )
Change subject: rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
......................................................................
Patch Set 2:
(2 comments)
File include/osmocom/bsc/gsm_data.h:
https://gerrit.osmocom.org/c/osmo-bsc/+/27248/comment/c592e448_e6a342ea
PS2, Line 542: none = -1
here, negative
https://gerrit.osmocom.org/c/osmo-bsc/+/27248/comment/523c31c7_f1beb164
PS2, Line 546: (A5_N) >= 0
> Why this check? Do we really use negative numbers in this context?
true, that for -1 the condition would not be needed. But since we're in a habit of passing -ERRNO we might as well rather interpret all negatives as "no algo found"
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27248
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
Gerrit-Change-Number: 27248
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 18 Feb 2022 12:17:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27246 )
Change subject: bsc: fix TC_ho_into_this_bsc_a5_4
......................................................................
bsc: fix TC_ho_into_this_bsc_a5_4
This test should be failing as it is, because A5/4 is not permitted in
the BSC's configuration! It only passed all this time because osmo-bsc
is/was/is going to have been flawed and just takes the Chosen Encryption
Algorithm IE as the basis for choosing an encryption algorithm. Instead
it should intersect the pemitted algos with the BSC config. It will soon
do that, and then this test would fail as it should have. After fixing
the BSC config for the test with this patch, we'll not see it failing in
the transition.
Related: SYS#5839
Change-Id: Ic6bbbeea36e6ea26d16bbb510fd08f5c0defb955
---
M bsc/BSC_Tests.ttcn
1 file changed, 10 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, approved
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 5b7243b..45c3239 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3743,9 +3743,11 @@
f_vty_transceive(BSCVTY, "exit");
}
+const charstring VTY_A5_DEFAULT := "0 1 3";
+
private function f_vty_encryption_a5_reset() runs on test_CT {
/* keep in sync with docker-playground.git ttcn3-bsc-test/osmo-bsc.cfg */
- f_vty_encryption_a5("0 1 3");
+ f_vty_encryption_a5(VTY_A5_DEFAULT);
}
/* Establish signalling channel (non-assignment case) followed by cipher mode */
@@ -6087,12 +6089,13 @@
f_perform_clear(exp_rr_rel_tmpl := exp_rr_rel_tmpl);
setverdict(pass);
}
-function f_tc_ho_into_this_bsc_main(TestHdlrParams pars) runs on test_CT {
+function f_tc_ho_into_this_bsc_main(TestHdlrParams pars, charstring vty_a5_cfg := VTY_A5_DEFAULT) runs on test_CT {
var MSC_ConnHdlr vc_conn;
f_init(1, true);
f_sleep(1.0);
+ f_vty_encryption_a5(vty_a5_cfg);
f_ctrs_bsc_and_bts_handover_init();
pars.sccp_addr_msc := g_bssap[0].sccp_addr_own;
@@ -6106,6 +6109,8 @@
f_ctrs_bsc_and_bts_add(0, "interbsc_ho_in:attempted");
f_ctrs_bsc_and_bts_add(0, "interbsc_ho_in:completed");
f_ctrs_bsc_and_bts_verify();
+
+ f_vty_encryption_a5_reset();
}
testcase TC_ho_into_this_bsc() runs on test_CT {
@@ -6114,10 +6119,10 @@
f_shutdown_helper();
}
-function f_tc_ho_into_this_bsc_a5(TestHdlrEncrParams encr) runs on test_CT {
+function f_tc_ho_into_this_bsc_a5(TestHdlrEncrParams encr, charstring vty_a5_cfg := VTY_A5_DEFAULT) runs on test_CT {
var TestHdlrParams pars := f_gen_test_hdlr_pars();
pars.encr := encr;
- f_tc_ho_into_this_bsc_main(pars);
+ f_tc_ho_into_this_bsc_main(pars, vty_a5_cfg);
f_shutdown_helper();
}
@@ -6134,7 +6139,7 @@
}
testcase TC_ho_into_this_bsc_a5_4() runs on test_CT {
- f_tc_ho_into_this_bsc_a5(f_encr_params('10'O, kc128 := true));
+ f_tc_ho_into_this_bsc_a5(f_encr_params('10'O, kc128 := true), "3 4");
}
/* Report: in inter-BSC incoming handover, when the MSC omits the Chosen Encryption Algorithm IE in the Handover Request
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27246
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: Ic6bbbeea36e6ea26d16bbb510fd08f5c0defb955
Gerrit-Change-Number: 27246
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27247 )
Change subject: bsc: add TC_ho_into_this_bsc_a5_mismatch
......................................................................
Patch Set 2:
(1 comment)
File bsc/BSC_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27247/comment/079cdda8_2d81…
PS2, Line 6032: BSSAP.receive(tr_BSSMAP_HandoverRequestAcknowledge(?)) -> value rx_bssap;
> I suggest to wrap this 'receive' into an 'alt' statement, move your 'receive' from the above: […]
to me it looks more noisy...
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27247
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: I44b464a0bedbff09c467c4bccd7c985480fb883a
Gerrit-Change-Number: 27247
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 18 Feb 2022 12:14:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/27238 )
Change subject: Add scripts/deacivate-5g.script
......................................................................
Add scripts/deacivate-5g.script
This script can be used to deactivate all 5G related services and files.
Change-Id: I5dc3e9f0ae76a7ae57484e5a3369e11ff02c7eca
---
A scripts/deactivate-5g.script
1 file changed, 69 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/scripts/deactivate-5g.script b/scripts/deactivate-5g.script
new file mode 100644
index 0000000..13206fa
--- /dev/null
+++ b/scripts/deactivate-5g.script
@@ -0,0 +1,69 @@
+# script to be used with pySim-shell.py which is part of the Osmocom pysim package,
+# found at https://osmocom.org/projects/pysim/wiki
+set echo true
+
+# this script will deactivate all 5G related services and files. This can be used
+# in case you do not wish to use any 5G services, or you do not wish to configure
+# the 5G specific files on the USIM card. The card will then behave like a 3G USIM
+# without any 5G capability, using the default fall-back mechanisms specified by 3GPP.
+
+# TODO: add your card-specific ADM pin at the end of the verify_adm line below
+verify_adm
+
+# deactivate any 5G related services in EF.UST
+select ADF.USIM
+select EF.UST
+ust_service_deactivate 122
+ust_service_deactivate 123
+ust_service_deactivate 124
+ust_service_deactivate 125
+ust_service_deactivate 127
+ust_service_deactivate 129
+ust_service_deactivate 130
+ust_service_deactivate 132
+ust_service_deactivate 133
+ust_service_deactivate 134
+ust_service_deactivate 135
+
+# deactivate all files in EF.5GS
+select ADF.USIM
+select DF.5GS
+
+select EF.5GAUTHKEYS
+deactivate_file
+
+select EF.5GS3GPPLOCI
+deactivate_file
+
+select EF.5GSN3GPPNSC
+deactivate_file
+
+select EF.5GSN3GPPLOCI
+deactivate_file
+
+select EF.5GS3GPPNSC
+deactivate_file
+
+# only exists on sysmoISIM-SJA2v2
+select EF.OPL5G
+deactivate_file
+
+select EF.Routing_Indicator
+deactivate_file
+
+select EF.SUCI_Calc_Info
+deactivate_file
+
+select EF.SUPI_NAI
+deactivate_file
+
+# only exists on sysmoISIM-SJA2v2
+select EF.TN3GPPSNN
+deactivate_file
+
+select EF.UAC_AIC
+deactivate_file
+
+# only exists on sysmoISIM-SJA2v2
+select EF.URSP
+deactivate_file
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/27238
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5dc3e9f0ae76a7ae57484e5a3369e11ff02c7eca
Gerrit-Change-Number: 27238
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/27235 )
Change subject: shell: Proper argparser (for help + manual) activate_file
......................................................................
shell: Proper argparser (for help + manual) activate_file
Change-Id: I5929ae3deff4d15b5db4a1d866576271c57a955f
---
M docs/shell.rst
M pySim-shell.py
2 files changed, 11 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/docs/shell.rst b/docs/shell.rst
index 58588a2..fcc171b 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -143,7 +143,12 @@
activate_file
~~~~~~~~~~~~~
-Activate the currently selected file. This used to be called REHABILITATE in TS 11.11.
+Activate the specified file. This used to be called REHABILITATE in TS 11.11.
+You need to specify the name or FID of the file to activate.
+
+.. argparse::
+ :module: pySim-shell
+ :func: Iso7816Commands.activate_file_parser
open_channel
~~~~~~~~~~~~
diff --git a/pySim-shell.py b/pySim-shell.py
index ad76ba0..ec417c7 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -805,13 +805,15 @@
self._cmd.poutput("CHV enable successful")
def do_deactivate_file(self, opts):
- """Deactivate the current EF"""
+ """Deactivate the currently selected EF"""
(data, sw) = self._cmd.card._scc.deactivate_file()
+ activate_file_parser = argparse.ArgumentParser()
+ activate_file_parser.add_argument('NAME', type=str, help='File name or FID of file to activate')
+ @cmd2.with_argparser(activate_file_parser)
def do_activate_file(self, opts):
"""Activate the specified EF"""
- path = opts.arg_list[0]
- (data, sw) = self._cmd.rs.activate_file(path)
+ (data, sw) = self._cmd.rs.activate_file(opts.NAME)
def complete_activate_file(self, text, line, begidx, endidx) -> List[str]:
"""Command Line tab completion for ACTIVATE FILE"""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/27235
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5929ae3deff4d15b5db4a1d866576271c57a955f
Gerrit-Change-Number: 27235
Gerrit-PatchSet: 1
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-MessageType: merged