neels has uploaded this change for review.

View Change

bsc: add TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg

Report: in inter-BSC incoming handover, when the MSC omits the Chosen
Encryption Algorithm IE in the Handover Request message, then osmo-bsc
starts an unencrypted lchan even if A5/0 is not permitted.

This test verifies that the Encryption Information is present in the
Channel Activation when the Chosen Enc Alg is omitted.

Related: SYS#5839
Change-Id: Ia94cc29bf66339ed782cb5101f3640f69cf73131
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
2 files changed, 26 insertions(+), 8 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/33/27233/1
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index dadd5bf..43236b3 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1674,9 +1674,11 @@
if (ispresent(enc)) {
var TestHdlrEncrParams v_enc := valueof(enc);
encryptionInformation := valueof(ts_BSSMAP_IE_EncrInfo(v_enc.enc_key, v_enc.enc_alg));
- chosenEncryptionAlgorithm := valueof(
- ts_BSSMAP_IE_ChosenEncryptionAlgorithm(int2oct(enum2int(
- f_cipher_mode_bssmap_to_rsl(v_enc.enc_alg)), 1)));
+ if (v_enc.msc_sends_chosen_encr_alg_ie) {
+ chosenEncryptionAlgorithm := valueof(
+ ts_BSSMAP_IE_ChosenEncryptionAlgorithm(int2oct(enum2int(
+ f_cipher_mode_bssmap_to_rsl(v_enc.enc_alg)), 1)));
+ }
if (ispresent(v_enc.enc_kc128)) {
kc128 := ts_BSSMAP_IE_Kc128(v_enc.enc_kc128);
}
@@ -6108,9 +6110,10 @@
f_shutdown_helper();
}

-function f_tc_ho_into_this_bsc_a5(OCT1 encr_alg) runs on test_CT {
+function f_tc_ho_into_this_bsc_a5(OCT1 encr_alg, boolean msc_sends_chosen_encr_alg_ie := true) runs on test_CT {
var TestHdlrParams pars := f_gen_test_hdlr_pars();
- pars.encr := valueof(t_EncrParams(encr_alg, f_rnd_octstring(8), f_rnd_octstring(16)));
+ pars.encr := valueof(t_EncrParams(encr_alg, f_rnd_octstring(8), f_rnd_octstring(16),
+ msc_sends_chosen_encr_alg_ie));
f_tc_ho_into_this_bsc_main(pars);
f_shutdown_helper();
}
@@ -6131,6 +6134,18 @@
f_tc_ho_into_this_bsc_a5('10'O);
}

+/* Report: in inter-BSC incoming handover, when the MSC omits the Chosen Encryption Algorithm IE in the Handover Request
+ * message, then osmo-bsc starts an unencrypted lchan even if A5/0 is not permitted.
+ *
+ * This test verifies that the Encryption Information is present in the Channel Activation when the Chosen Enc Alg is
+ * omitted.
+ *
+ * Related: SYS#5839
+ */
+testcase TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg() runs on test_CT {
+ f_tc_ho_into_this_bsc_a5('0a'O, false);
+}
+
testcase TC_ho_into_this_bsc_tla_v6() runs on test_CT {
var TestHdlrParams pars := f_gen_test_hdlr_pars();
pars.host_aoip_tla := "::6";
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 109194b..df84d93 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -552,13 +552,16 @@
type record TestHdlrEncrParams {
OCT1 enc_alg,
octetstring enc_key,
- octetstring enc_kc128 optional
+ octetstring enc_kc128 optional,
+ boolean msc_sends_chosen_encr_alg_ie
};

-template (value) TestHdlrEncrParams t_EncrParams(OCT1 alg, octetstring key, template (omit) octetstring kc128 := omit) := {
+template (value) TestHdlrEncrParams t_EncrParams(OCT1 alg, octetstring key, template (omit) octetstring kc128 := omit,
+ boolean msc_sends_chosen_encr_alg_ie := true) := {
enc_alg := alg,
enc_key := key,
- enc_kc128 := kc128
+ enc_kc128 := kc128,
+ msc_sends_chosen_encr_alg_ie := msc_sends_chosen_encr_alg_ie
}

type record TestHdlrParamsLcls {

To view, visit change 27233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia94cc29bf66339ed782cb5101f3640f69cf73131
Gerrit-Change-Number: 27233
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange