From 731ddc558f8c5cf2dd7f82abed2026bea92928db Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 17 Feb 2022 21:56:15 +0100 Subject: [PATCH] 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 --- bsc/BSC_Tests.ttcn | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 5b7243be8..45c32391b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -3743,9 +3743,11 @@ private function f_vty_encryption_a5(charstring options) runs on test_CT { 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 @@ private function f_tc_ho_into_this_bsc(charstring id) runs on MSC_ConnHdlr { 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 @@ function f_tc_ho_into_this_bsc_main(TestHdlrParams pars) runs on test_CT { 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 @@ testcase TC_ho_into_this_bsc() runs on test_CT { 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_3() runs on test_CT { } 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