[MERGED] osmo-msc[master]: cosmetic prep: publish vlr_use_umts_aka() decision

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Dec 18 09:51:18 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic prep: publish vlr_use_umts_aka() decision
......................................................................


cosmetic prep: publish vlr_use_umts_aka() decision

During Set Ciphering Mode on GERAN, it is required to know whether UMTS AKA is
used to decide which Kc to pick. Change static function is_umts_auth() into
public vlr_use_umts_aka(), so future patches can re-use it.

Prepares: If04e405426c55a81341747a9b450a69188525d5c
Change-Id: I85d784c62ecbabdb6186a3dae4dcd554e7921041
---
M include/osmocom/msc/vlr.h
M src/libvlr/vlr.c
M src/libvlr/vlr_auth_fsm.c
3 files changed, 20 insertions(+), 11 deletions(-)

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



diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index 640d35b..df7d354 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -435,5 +435,7 @@
 		      enum vlr_ciph ciph_mode,
 		      bool retrieve_imeisv);
 
+bool vlr_use_umts_aka(struct osmo_auth_vector *vec, bool is_r99);
+
 void log_set_filter_vlr_subscr(struct log_target *target,
 			       struct vlr_subscr *vlr_subscr);
diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c
index 16f365e..55b8de0 100644
--- a/src/libvlr/vlr.c
+++ b/src/libvlr/vlr.c
@@ -1122,6 +1122,23 @@
 	}
 }
 
+/* Decide whether UMTS AKA should be used.
+ * UTRAN networks are by definition R99 capable, and the auth vector is required to contain UMTS AKA
+ * tokens. This is expected to be verified by the caller. On GERAN, UMTS AKA must be used iff MS and
+ * GERAN are R99 capable and UMTS AKA tokens are available.
+ * \param[in] vec  Auth tokens (received from the HLR).
+ * \param[in] is_r99  True when BTS and GERAN are R99 capable.
+ * \returns true to use UMTS AKA, false to use pre-R99 GSM AKA.
+ */
+bool vlr_use_umts_aka(struct osmo_auth_vector *vec, bool is_r99)
+{
+	if (!is_r99)
+		return false;
+	if (!(vec->auth_types & OSMO_AUTH_TYPE_UMTS))
+		return false;
+	return true;
+}
+
 void log_set_filter_vlr_subscr(struct log_target *target,
 			       struct vlr_subscr *vlr_subscr)
 {
diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c
index 1376c82..d14ae8e 100644
--- a/src/libvlr/vlr_auth_fsm.c
+++ b/src/libvlr/vlr_auth_fsm.c
@@ -211,16 +211,6 @@
 		vlr_subscr_tx_auth_fail_rep(vsub);
 }
 
-static bool is_umts_auth(struct auth_fsm_priv *afp,
-			 uint32_t auth_types)
-{
-	if (!afp->is_r99)
-		return false;
-	if (!(auth_types & OSMO_AUTH_TYPE_UMTS))
-		return false;
-	return true;
-}
-
 /* Terminate the Auth FSM Instance and notify parent */
 static void auth_fsm_term(struct osmo_fsm_inst *fi, enum vlr_auth_fsm_result res)
 {
@@ -268,7 +258,7 @@
 	afp->auth_requested = true;
 	vsub->last_tuple = at;
 	vsub->vlr->ops.tx_auth_req(vsub->msc_conn_ref, at,
-				   is_umts_auth(afp, at->vec.auth_types));
+				   vlr_use_umts_aka(&at->vec, afp->is_r99));
 	return 0;
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85d784c62ecbabdb6186a3dae4dcd554e7921041
Gerrit-PatchSet: 4
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list