Change in osmo-ttcn3-hacks[master]: msc: add vec_keep to lock the AuthVector

neels gerrit-no-reply at
Tue Jun 29 20:48:16 UTC 2021

neels has submitted this change. ( )

Change subject: msc: add vec_keep to lock the AuthVector

msc: add vec_keep to lock the AuthVector

Next to AuthVector vec, add boolean vec_keep. When set to true,
as_GSUP_SAI() skips the vector regeneration.

An upcoming patch adds encryption to inter-BSC handover, which will use
vec_keep := true. (See I57e43c60d4389bd301d0195179321a34401bd1dc )


Usually, a random auth vector is generated during as_GSUP_SAI(). For
inter-BSC handover, there are two separate virt-BSC components running.
But to be able to verify that the correct key is passed on from the old
to the new BSS, both titan components need to have the same AuthVector
data. The easiest solution is to generate the AuthVector before
launching the components, and then prevent that it is changed by

Related: SYS#5324
Related: I57e43c60d4389bd301d0195179321a34401bd1dc
Change-Id: I4bca739c2aad8342915e00a218f90fc19be7eafe
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 10 insertions(+), 2 deletions(-)

  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 3fa5fac..cf4e846 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -93,6 +93,9 @@
 	BSSMAP_IE_ClassmarkInformationType2 cm2,
 	BSSMAP_IE_ClassmarkInformationType3 cm3 optional,
 	AuthVector vec optional,
+	/* BSC_ConnectionHandler generates an auth vector in as_GSUP_SAI(). For tests that want control over which
+	 * vector is used, pass vec_keep := true to not regenerate a new auth vector in as_GSUP_SAI(). */
+	boolean vec_keep,
 	BSC_ConnHdlrNetworkPars net,
 	boolean send_early_cm,
 	charstring ipa_ctrl_ip,
@@ -426,7 +429,9 @@
 var GSUP_IE auth_tuple;
 [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)) {
 	if (g_pars.use_umts_aka) {
-		g_pars.vec := f_gen_auth_vec_3g();
+		if (not g_pars.vec_keep) {
+			g_pars.vec := f_gen_auth_vec_3g();
+		}
 		auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G3G(g_pars.vec.rand,
@@ -436,7 +441,9 @@
 		GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple));
 	} else {
-		g_pars.vec := f_gen_auth_vec_2g();
+		if (not g_pars.vec_keep) {
+			g_pars.vec := f_gen_auth_vec_2g();
+		}
 		auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand,
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index e37bc52..46a368e 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -387,6 +387,7 @@
 		cm2 := valueof(ts_CM2_default),
 		cm3 := omit,
 		vec := omit,
+		vec_keep := false,
 		net := net_pars,
 		send_early_cm := true,
 		ipa_ctrl_ip := mp_msc_ip,

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4bca739c2aad8342915e00a218f90fc19be7eafe
Gerrit-Change-Number: 24760
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: neels <nhofmeyr at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list