Change in osmo-ttcn3-hacks[master]: gbproxy: Move away from random TLLI

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/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Jan 16 22:00:54 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22226 )

Change subject: gbproxy: Move away from random TLLI
......................................................................

gbproxy: Move away from random TLLI

We used to generate a random TLLI for each ConnHldr.  Instead, use a
deterministic function to generate the P-TMSI (just like we do for the
IMSI) and derive a local TLLI from that P-TMSI.

Related: OS#4472, SYS#5002
Change-Id: Ic1eaa1d298fe998ca97432769953bfc5a5333ae4
---
M gbproxy/GBProxy_Tests.ttcn
M library/Osmocom_Gb_Types.ttcn
2 files changed, 22 insertions(+), 2 deletions(-)

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



diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 44b2ac9..6daad53 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -597,14 +597,15 @@
 			 float t_guard := 30.0)
 runs on test_CT return BSSGP_ConnHdlr {
 	var BSSGP_ConnHdlr vc_conn;
+	var OCT4 p_tmsi := f_gen_tmsi(imsi_suffix);
 
 	var BSSGP_ConnHdlrPars pars := {
 		imei := f_gen_imei(imsi_suffix),
 		imsi := f_gen_imsi(imsi_suffix),
 		msisdn := f_gen_msisdn(imsi_suffix),
-		p_tmsi := omit,
+		p_tmsi := p_tmsi,
 		p_tmsi_sig := omit,
-		tlli := f_gprs_tlli_random(),
+		tlli := f_gprs_tlli_from_tmsi(p_tmsi, TLLI_LOCAL),
 		tlli_old := omit,
 		ra := omit,
 		pcu := g_pcu,
diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index 518d619..8ca0cd5 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -3252,6 +3252,25 @@
 		}
 	}
 
+	/* build a TLLI of specified type from the given (P)TMSI */
+	function f_gprs_tlli_from_tmsi(OCT4 tmsi, TlliType tlli_type) return OCT4 {
+		var bitstring tmsi_bits := oct2bit(tmsi);
+		var bitstring prefix;
+		select (tlli_type) {
+		case (TLLI_LOCAL)	{ prefix := '11'B }
+		case (TLLI_FOREIGN)	{ prefix := '01111'B }
+		case (TLLI_RANDOM)	{ prefix := '0110'B }
+		case (TLLI_RESERVED)	{ prefix := '010'B }
+		case (TLLI_G_RNTI)	{ prefix := '0000'B }
+		case (TLLI_RAND_G_RNTI)	{ prefix := '0001'B }
+		case else {
+			setverdict(fail, "Unknonw TLLI Type ", tlli_type);
+			mtc.stop;
+			}
+		}
+		return bit2oct(prefix & substr(tmsi_bits, lengthof(prefix), 32-lengthof(prefix)));
+	}
+
 	function f_gprs_tlli_random() return OCT4 {
 		var OCT4 tlli := f_rnd_octstring(4);
 		return tlli or4b 'c0000000'O;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22226
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: Ic1eaa1d298fe998ca97432769953bfc5a5333ae4
Gerrit-Change-Number: 22226
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210116/d3f7f316/attachment.htm>


More information about the gerrit-log mailing list