msc_a,vlr: rename ciphering_required to is_ciphering_to_be_attempted
Clarify the name to avoid confusion in upcoming patches.
This function actually returns whether any ciphering mode besides A5/0
is enabled, and does not imply that ciphering is mandatory. A5/0 may
well be allowed when this function returns true.
Related: OS#4830
Change-Id: Ia55085e3b36feb275bcf92fc91a4be7d1c24a6b9
diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c
index 8daaaad..ce7c2af 100644
--- a/src/libvlr/vlr_access_req_fsm.c
+++ b/src/libvlr/vlr_access_req_fsm.c
@@ -67,7 +67,7 @@
uint32_t tmsi;
struct osmo_location_area_id lai;
bool authentication_required;
- bool ciphering_required;
+ bool is_ciphering_to_be_attempted;
uint8_t key_seq;
bool is_r99;
bool is_utran;
@@ -272,7 +272,7 @@
{
/* UTRAN: always send SecModeCmd, even if ciphering is not required.
* GERAN: avoid sending CiphModeCmd if ciphering is not required. */
- return par->is_utran || par->ciphering_required;
+ return par->is_utran || par->is_ciphering_to_be_attempted;
}
static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi)
@@ -320,7 +320,7 @@
* are defined in 3GPP TS 33.102 */
/* For now we use a default value passed in to vlr_lu_fsm(). */
return par->authentication_required ||
- (par->ciphering_required && !auth_try_reuse_tuple(par->vsub, par->key_seq));
+ (par->is_ciphering_to_be_attempted && !auth_try_reuse_tuple(par->vsub, par->key_seq));
}
/* after the IMSI is known */
@@ -634,7 +634,7 @@
const struct osmo_mobile_identity *mi,
const struct osmo_location_area_id *lai,
bool authentication_required,
- bool ciphering_required,
+ bool is_ciphering_to_be_attempted,
uint8_t key_seq,
bool is_r99, bool is_utran)
{
@@ -657,7 +657,7 @@
par->parent_event_failure = parent_event_failure;
par->parent_event_data = parent_event_data;
par->authentication_required = authentication_required;
- par->ciphering_required = ciphering_required;
+ par->is_ciphering_to_be_attempted = is_ciphering_to_be_attempted;
par->key_seq = key_seq;
par->is_r99 = is_r99;
par->is_utran = is_utran;
@@ -665,10 +665,10 @@
LOGPFSM(fi, "rev=%s net=%s%s%s\n",
is_r99 ? "R99" : "GSM",
is_utran ? "UTRAN" : "GERAN",
- (authentication_required || ciphering_required)?
+ (authentication_required || is_ciphering_to_be_attempted) ?
" Auth" : " (no Auth)",
- (authentication_required || ciphering_required)?
- (ciphering_required? "+Ciph" : " (no Ciph)")
+ (authentication_required || is_ciphering_to_be_attempted) ?
+ (is_ciphering_to_be_attempted ? "+Ciph" : " (no Ciph)")
: "");
if (is_utran && !authentication_required)
diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c
index 4f603b3..e8ceefd 100644
--- a/src/libvlr/vlr_lu_fsm.c
+++ b/src/libvlr/vlr_lu_fsm.c
@@ -676,7 +676,7 @@
struct osmo_location_area_id old_lai;
struct osmo_location_area_id new_lai;
bool authentication_required;
- bool ciphering_required;
+ bool is_ciphering_to_be_attempted;
uint8_t key_seq;
bool is_r99;
bool is_utran;
@@ -699,7 +699,7 @@
* are defined in 3GPP TS 33.102 */
/* For now we use a default value passed in to vlr_lu_fsm(). */
return lfp->authentication_required ||
- (lfp->ciphering_required && !auth_try_reuse_tuple(lfp->vsub, lfp->key_seq));
+ (lfp->is_ciphering_to_be_attempted && !auth_try_reuse_tuple(lfp->vsub, lfp->key_seq));
}
/* Determine if sending of CMC/SMC is required */
@@ -707,7 +707,7 @@
{
/* UTRAN: always send SecModeCmd, even if ciphering is not required.
* GERAN: avoid sending CiphModeCmd if ciphering is not required. */
- return lfp->is_utran || lfp->ciphering_required;
+ return lfp->is_utran || lfp->is_ciphering_to_be_attempted;
}
/* Determine if a HLR Update is required */
@@ -1475,7 +1475,7 @@
const struct osmo_location_area_id *old_lai,
const struct osmo_location_area_id *new_lai,
bool authentication_required,
- bool ciphering_required,
+ bool is_ciphering_to_be_attempted,
uint8_t key_seq,
bool is_r99, bool is_utran,
bool assign_tmsi)
@@ -1499,7 +1499,7 @@
lfp->parent_event_failure = parent_event_failure;
lfp->parent_event_data = parent_event_data;
lfp->authentication_required = authentication_required;
- lfp->ciphering_required = ciphering_required;
+ lfp->is_ciphering_to_be_attempted = is_ciphering_to_be_attempted;
lfp->key_seq = key_seq;
lfp->is_r99 = is_r99;
lfp->is_utran = is_utran;
@@ -1514,10 +1514,10 @@
LOGPFSM(fi, "rev=%s net=%s%s%s\n",
is_r99 ? "R99" : "GSM",
is_utran ? "UTRAN" : "GERAN",
- (authentication_required || ciphering_required)?
+ (authentication_required || is_ciphering_to_be_attempted) ?
" Auth" : " (no Auth)",
- (authentication_required || ciphering_required)?
- (ciphering_required? "+Ciph" : " (no Ciph)")
+ (authentication_required || is_ciphering_to_be_attempted) ?
+ (is_ciphering_to_be_attempted ? "+Ciph" : " (no Ciph)")
: "");
if (is_utran && !authentication_required)