Change in osmo-ttcn3-hacks[master]: msc: f_mm_auth(): Add support for UMTS AKA

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 25 20:06:50 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13736 )

Change subject: msc: f_mm_auth(): Add support for UMTS AKA
......................................................................

msc: f_mm_auth(): Add support for UMTS AKA

Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 30 insertions(+), 9 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 4534a9b..e408f82 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -75,7 +75,8 @@
 	boolean mm_info,
 	boolean sgsap_enable,
 	boolean gsup_enable,
-	integer ran_idx
+	integer ran_idx,
+	boolean use_umts_aka
 };
 
 /* get a one-octet bitmaks of supported algorithms based on Classmark information */
@@ -293,15 +294,34 @@
 function f_mm_auth() runs on BSC_ConnHdlr
 {
 	if (g_pars.net.expect_auth) {
-		g_pars.vec := f_gen_auth_vec_2g();
-		var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand,
-									 g_pars.vec.sres,
-									 g_pars.vec.kc));
+		var GSUP_IE auth_tuple;
 		GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi));
-		GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple));
 
-		BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand)));
-		BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres)));
+		if (g_pars.use_umts_aka) {
+			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,
+									g_pars.vec.ik,
+									g_pars.vec.ck,
+									g_pars.vec.autn,
+									g_pars.vec.res));
+			GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple));
+
+			BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ_3G(g_pars.vec.rand, g_pars.vec.autn)));
+			var OCT4 res := substr(g_pars.vec.res, 0, 4);
+			var OCT4 xres := substr(g_pars.vec.res, 4, 4);
+			BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_3G(res, xres)));
+		} else {
+			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));
+			GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple));
+
+			BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand)));
+			BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres)));
+		}
 	}
 }
 
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 8c221dc..7d9c098 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -513,7 +513,8 @@
 		mm_info := mp_mm_info,
 		sgsap_enable := sgsap,
 		gsup_enable := gsup,
-		ran_idx := ran_idx
+		ran_idx := ran_idx,
+		use_umts_aka := false
 	};
 	return pars;
 }

-- 
To view, visit https://gerrit.osmocom.org/13736
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d
Gerrit-Change-Number: 13736
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190425/33c9cc5a/attachment.html>


More information about the gerrit-log mailing list