Change in osmo-ttcn3-hacks[master]: bsc: reduce args to f_cipher_mode()

neels gerrit-no-reply at lists.osmocom.org
Tue Jun 15 13:19:06 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24668 )


Change subject: bsc: reduce args to f_cipher_mode()
......................................................................

bsc: reduce args to f_cipher_mode()

Instead of passing each part individually, simply pass the entire
TestHdlrEncrParams to f_cipher_mode().

Preparation for A5/4.

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



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/24668/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 845869a..e3720e5 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3452,7 +3452,7 @@
 	}
 
 	/* Start ciphering, expect Cipher Mode Reject */
-	f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key, exp_fail := true);
+	f_cipher_mode(g_pars.encr, exp_fail := true);
 }
 testcase TC_assignment_fr_a5_not_sup() runs on test_CT {
 	var TestHdlrParams pars := f_gen_test_hdlr_pars();
@@ -6726,7 +6726,7 @@
 		/* start ciphering, if requested */
 		if (ispresent(g_pars.encr)) {
 			f_logp(BSCVTY, "start ciphering");
-			f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key);
+			f_cipher_mode(g_pars.encr);
 		}
 	}
 
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index c29ccd4..c266c19 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -709,21 +709,21 @@
 	}
 }
 
-function f_cipher_mode(OCT1 alg, OCT8 key, template OCT16 kc128 := omit, boolean exp_fail := false)
+function f_cipher_mode(TestHdlrEncrParams enc, boolean exp_fail := false)
 runs on MSC_ConnHdlr {
 	var PDU_BSSAP bssap;
 	var RSL_Message rsl;
 	var RSL_AlgId alg_rsl;
 
-	if (isvalue(kc128)) {
-		BSSAP.send(ts_BSSMAP_CipherModeCmdKc128(alg, key, valueof(kc128)));
+	if (isvalue(enc.enc_kc128)) {
+		BSSAP.send(ts_BSSMAP_CipherModeCmdKc128(enc.enc_alg, enc.enc_key, valueof(enc.enc_kc128)));
 	} else {
-		BSSAP.send(ts_BSSMAP_CipherModeCmd(alg, key));
+		BSSAP.send(ts_BSSMAP_CipherModeCmd(enc.enc_alg, enc.enc_key));
 	}
 
 	/* RSL uses a different representation of the encryption algorithm,
 	 * so we need to convert first */
-	alg_rsl := f_chipher_mode_bssmap_to_rsl(alg);
+	alg_rsl := f_chipher_mode_bssmap_to_rsl(enc.enc_alg);
 
 	alt {
 	/* RSL/UE Side */
@@ -1145,7 +1145,7 @@
 
 	/* start ciphering, if requested */
 	if (ispresent(g_pars.encr)) {
-		f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key);
+		f_cipher_mode(g_pars.encr);
 	}
 
 	/* bail out early if no assignment requested */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24668
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: I2cb8282e55436da5ae64ab569df87d5d5a0dd2f0
Gerrit-Change-Number: 24668
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210615/c901df6f/attachment.htm>


More information about the gerrit-log mailing list