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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Wed Jun 23 21:53:49 UTC 2021


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


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 )

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
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 10 insertions(+), 2 deletions(-)



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

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 68a370d..456b5f5 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));
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 https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24760
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: I4bca739c2aad8342915e00a218f90fc19be7eafe
Gerrit-Change-Number: 24760
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/20210623/c3c7a93e/attachment.htm>


More information about the gerrit-log mailing list