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 )

Rationale:

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
as_GSUP_SAI().

Related: SYS#5324
Related: I57e43c60d4389bd301d0195179321a34401bd1dc
Change-Id: I4bca739c2aad8342915e00a218f90fc19be7eafe
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,
 								g_pars.vec.sres,
 								g_pars.vec.kc,
@@ -436,7 +441,9 @@
 								g_pars.vec.res));
 		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,
 								g_pars.vec.sres,
 								g_pars.vec.kc));