[PATCH] openbsc[master]: GPRS/IuPS: remove all 3G authentication dev hacks

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed May 10 12:16:53 UTC 2017


Review at  https://gerrit.osmocom.org/2557

GPRS/IuPS: remove all 3G authentication dev hacks

UMTS auth works now with the external OsmoHLR.

Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
---
M openbsc/src/gprs/gprs_gmm.c
M openbsc/src/libiu/iu.c
2 files changed, 2 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/57/2557/1

diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index aa03891..eb4cb1a 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -1356,33 +1356,6 @@
 	ctx->ra = ra_id;
 	if (ctx->ran_type == MM_CTX_T_GERAN_Gb)
 		ctx->gb.cell_id = cid;
-	else if (ctx->ran_type == MM_CTX_T_UTRAN_Iu) {
-		/* DEVELOPMENT HACK: Our current HLR does not support 3G
-		 * authentication tokens. A new HLR/VLR implementation is being
-		 * developed. Until it is ready and actual milenage
-		 * authentication is properly supported, we are hardcoding a
-		 * fixed Ki and use 2G auth. */
-		unsigned char tmp_rand[16];
-		/* Ki 000102030405060708090a0b0c0d0e0f */
-		struct osmo_sub_auth_data auth = {
-			.type	= OSMO_AUTH_TYPE_GSM,
-			.algo	= OSMO_AUTH_ALG_COMP128v1,
-			.u.gsm.ki = {
-				0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
-				0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
-				0x0e, 0x0f
-			},
-		};
-		/* XXX: Hack to make 3G auth work with special SIM card */
-		ctx->auth_state = SGSN_AUTH_AUTHENTICATE;
-
-		RAND_bytes(tmp_rand, 16);
-
-		memset(&ctx->auth_triplet.vec, 0, sizeof(ctx->auth_triplet.vec));
-		osmo_auth_gen_vec(&ctx->auth_triplet.vec, &auth, tmp_rand);
-
-		ctx->auth_triplet.key_seq = 0;
-	}
 
 	/* Update MM Context with other data */
 	ctx->drx_parms = drx_par;
diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c
index 8ba6fa4..932b217 100644
--- a/openbsc/src/libiu/iu.c
+++ b/openbsc/src/libiu/iu.c
@@ -225,25 +225,10 @@
 {
 	struct osmo_scu_prim *prim;
 	struct msgb *msg;
-	uint8_t ik[16];
-	uint8_t ck[16];
-	unsigned int i;
-
-	/* C5 function to derive IK from Kc */
-	for (i = 0; i < 4; i++)
-		ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4];
-	memcpy(ik+4, tp->vec.kc, 8);
-	for (i = 12; i < 16; i++)
-		ik[i] = ik[i-12];
-
-	if (send_ck) {
-		/* C4 function to derive CK from Kc */
-		memcpy(ck, tp->vec.kc, 8);
-		memcpy(ck+8, tp->vec.kc, 8);
-	}
 
 	/* create RANAP message */
-	msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old);
+	msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL,
+			new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old);
 	msg->l2h = msg->data;
 	/* wrap RANAP message in SCCP N-DATA.req */
 	prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim));

-- 
To view, visit https://gerrit.osmocom.org/2557
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list