Change in osmo-ttcn3-hacks[master]: msc: f_auth3g_kc(): take vec as argument, drop "runs on"

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


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


Change subject: msc: f_auth3g_kc(): take vec as argument, drop "runs on"
......................................................................

msc: f_auth3g_kc(): take vec as argument, drop "runs on"

It is more elegant to have one arg and not require a "runs on".

Related: SYS#5324
Change-Id: Iec21710edaa6ad3d20e23c7ee055909c642e8220
---
M msc/BSC_ConnectionHandler.ttcn
1 file changed, 5 insertions(+), 4 deletions(-)



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

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 8eb3f73..01db3d0 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -435,7 +435,7 @@
 								g_pars.vec.autn,
 								g_pars.vec.res));
 		GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple));
-		g_pars.vec.kc := f_auth3g_kc();
+		g_pars.vec.kc := f_auth3g_kc(g_pars.vec);
 	} else {
 		g_pars.vec := f_gen_auth_vec_2g();
 		auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand,
@@ -548,11 +548,12 @@
 	}
 }
 
-function f_auth3g_kc() runs on BSC_ConnHdlr return OCT8 {
+/* For UMTS AKA on GERAN, calculate the specific kc from the UMTS AKA ck and ik vectors. */
+function f_auth3g_kc(AuthVector vec) return OCT8 {
 	var integer i;
-	var octetstring res := g_pars.vec.ck[0] xor4b g_pars.vec.ck[0 + 8] xor4b g_pars.vec.ik[0] xor4b g_pars.vec.ik[0 + 8];
+	var octetstring res := vec.ck[0] xor4b vec.ck[0 + 8] xor4b vec.ik[0] xor4b vec.ik[0 + 8];
 	for (i := 1; i < 8; i := i + 1) {
-		var octetstring a := g_pars.vec.ck[i] xor4b g_pars.vec.ck[i + 8] xor4b g_pars.vec.ik[i] xor4b g_pars.vec.ik[i + 8];
+		var octetstring a := vec.ck[i] xor4b vec.ck[i + 8] xor4b vec.ik[i] xor4b vec.ik[i + 8];
 		res := res & a;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24757
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: Iec21710edaa6ad3d20e23c7ee055909c642e8220
Gerrit-Change-Number: 24757
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/6a7de515/attachment.htm>


More information about the gerrit-log mailing list