msc_a,vlr: rename ciphering_required to try_ciphering
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
This commit is contained in:
parent
bb624162ea
commit
0ba6d24678
|
@ -180,7 +180,7 @@ struct msc_a *msc_a_for_vsub(const struct vlr_subscr *vsub, bool valid_conn_only
|
|||
void msc_a_pending_cm_service_req_add(struct msc_a *msc_a, enum osmo_cm_service_type type);
|
||||
unsigned int msc_a_pending_cm_service_req_count(struct msc_a *msc_a, enum osmo_cm_service_type type);
|
||||
void msc_a_pending_cm_service_req_del(struct msc_a *msc_a, enum osmo_cm_service_type type);
|
||||
bool msc_a_require_ciphering(const struct msc_a *msc_a);
|
||||
bool msc_a_try_ciphering(const struct msc_a *msc_a);
|
||||
|
||||
#define msc_a_ran_down(A,B,C) \
|
||||
_msc_a_ran_down(A,B,C, __FILE__, __LINE__)
|
||||
|
|
|
@ -299,7 +299,7 @@ vlr_loc_update(struct osmo_fsm_inst *parent,
|
|||
const struct osmo_location_area_id *old_lai,
|
||||
const struct osmo_location_area_id *new_lai,
|
||||
bool authentication_required,
|
||||
bool ciphering_required,
|
||||
bool try_ciphering,
|
||||
uint8_t key_seq,
|
||||
bool is_r99, bool is_utran,
|
||||
bool assign_tmsi);
|
||||
|
@ -463,7 +463,7 @@ vlr_proc_acc_req(struct osmo_fsm_inst *parent,
|
|||
const struct osmo_mobile_identity *mi,
|
||||
const struct osmo_location_area_id *lai,
|
||||
bool authentication_required,
|
||||
bool ciphering_required,
|
||||
bool try_ciphering,
|
||||
uint8_t key_seq,
|
||||
bool is_r99, bool is_utran);
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ static int mm_rx_loc_upd_req(struct msc_a *msc_a, struct msgb *msg)
|
|||
net->vlr, msc_a, vlr_lu_type, tmsi, imsi,
|
||||
&old_lai, &msc_a->via_cell.lai,
|
||||
is_utran || net->authentication_required,
|
||||
msc_a_require_ciphering(msc_a),
|
||||
msc_a_try_ciphering(msc_a),
|
||||
lu->key_seq,
|
||||
osmo_gsm48_classmark1_is_r99(&lu->classmark1),
|
||||
is_utran,
|
||||
|
@ -818,7 +818,7 @@ int gsm48_rx_mm_serv_req(struct msc_a *msc_a, struct msgb *msg)
|
|||
req->cm_service_type,
|
||||
&mi, &msc_a->via_cell.lai,
|
||||
is_utran || net->authentication_required,
|
||||
msc_a_require_ciphering(msc_a),
|
||||
msc_a_try_ciphering(msc_a),
|
||||
req->cipher_key_seq,
|
||||
osmo_gsm48_classmark2_is_r99(cm2, cm2_len),
|
||||
is_utran);
|
||||
|
@ -944,7 +944,7 @@ static int gsm48_rx_cm_reest_req(struct msc_a *msc_a, struct msgb *msg)
|
|||
VLR_PR_ARQ_T_CM_RE_ESTABLISH_REQ, 0,
|
||||
&mi, &msc_a->via_cell.lai,
|
||||
is_utran || net->authentication_required,
|
||||
msc_a_require_ciphering(msc_a),
|
||||
msc_a_try_ciphering(msc_a),
|
||||
req->cipher_key_seq,
|
||||
osmo_gsm48_classmark2_is_r99(cm2, cm2_len),
|
||||
is_utran);
|
||||
|
@ -1306,7 +1306,7 @@ static int gsm48_rx_rr_pag_resp(struct msc_a *msc_a, struct msgb *msg)
|
|||
net->vlr, msc_a,
|
||||
VLR_PR_ARQ_T_PAGING_RESP, 0, &mi, &msc_a->via_cell.lai,
|
||||
is_utran || net->authentication_required,
|
||||
msc_a_require_ciphering(msc_a),
|
||||
msc_a_try_ciphering(msc_a),
|
||||
pr->key_seq,
|
||||
osmo_gsm48_classmark2_is_r99(cm2, classmark2_len),
|
||||
is_utran);
|
||||
|
|
|
@ -106,7 +106,7 @@ struct msc_a *msc_a_fi_priv(struct osmo_fsm_inst *fi)
|
|||
return fi->priv;
|
||||
}
|
||||
|
||||
bool msc_a_require_ciphering(const struct msc_a *msc_a)
|
||||
bool msc_a_try_ciphering(const struct msc_a *msc_a)
|
||||
{
|
||||
struct gsm_network *net = msc_a_net(msc_a);
|
||||
bool is_utran = (msc_a->c.ran->type == OSMO_RAT_UTRAN_IU);
|
||||
|
|
|
@ -67,7 +67,7 @@ struct proc_arq_priv {
|
|||
uint32_t tmsi;
|
||||
struct osmo_location_area_id lai;
|
||||
bool authentication_required;
|
||||
bool ciphering_required;
|
||||
bool try_ciphering;
|
||||
uint8_t key_seq;
|
||||
bool is_r99;
|
||||
bool is_utran;
|
||||
|
@ -272,7 +272,7 @@ static bool is_cmc_smc_required(struct proc_arq_priv *par)
|
|||
{
|
||||
/* 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->try_ciphering;
|
||||
}
|
||||
|
||||
static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi)
|
||||
|
@ -320,7 +320,7 @@ static bool is_auth_required(struct proc_arq_priv *par)
|
|||
* 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->try_ciphering && !auth_try_reuse_tuple(par->vsub, par->key_seq));
|
||||
}
|
||||
|
||||
/* after the IMSI is known */
|
||||
|
@ -634,7 +634,7 @@ vlr_proc_acc_req(struct osmo_fsm_inst *parent,
|
|||
const struct osmo_mobile_identity *mi,
|
||||
const struct osmo_location_area_id *lai,
|
||||
bool authentication_required,
|
||||
bool ciphering_required,
|
||||
bool try_ciphering,
|
||||
uint8_t key_seq,
|
||||
bool is_r99, bool is_utran)
|
||||
{
|
||||
|
@ -657,7 +657,7 @@ vlr_proc_acc_req(struct osmo_fsm_inst *parent,
|
|||
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->try_ciphering = try_ciphering;
|
||||
par->key_seq = key_seq;
|
||||
par->is_r99 = is_r99;
|
||||
par->is_utran = is_utran;
|
||||
|
@ -665,10 +665,10 @@ vlr_proc_acc_req(struct osmo_fsm_inst *parent,
|
|||
LOGPFSM(fi, "rev=%s net=%s%s%s\n",
|
||||
is_r99 ? "R99" : "GSM",
|
||||
is_utran ? "UTRAN" : "GERAN",
|
||||
(authentication_required || ciphering_required)?
|
||||
(authentication_required || try_ciphering) ?
|
||||
" Auth" : " (no Auth)",
|
||||
(authentication_required || ciphering_required)?
|
||||
(ciphering_required? "+Ciph" : " (no Ciph)")
|
||||
(authentication_required || try_ciphering) ?
|
||||
(try_ciphering ? "+Ciph" : " (no Ciph)")
|
||||
: "");
|
||||
|
||||
if (is_utran && !authentication_required)
|
||||
|
|
|
@ -676,7 +676,7 @@ struct lu_fsm_priv {
|
|||
struct osmo_location_area_id old_lai;
|
||||
struct osmo_location_area_id new_lai;
|
||||
bool authentication_required;
|
||||
bool ciphering_required;
|
||||
bool try_ciphering;
|
||||
uint8_t key_seq;
|
||||
bool is_r99;
|
||||
bool is_utran;
|
||||
|
@ -699,7 +699,7 @@ static bool is_auth_required(struct lu_fsm_priv *lfp)
|
|||
* 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->try_ciphering && !auth_try_reuse_tuple(lfp->vsub, lfp->key_seq));
|
||||
}
|
||||
|
||||
/* Determine if sending of CMC/SMC is required */
|
||||
|
@ -707,7 +707,7 @@ static bool is_cmc_smc_required(struct lu_fsm_priv *lfp)
|
|||
{
|
||||
/* 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->try_ciphering;
|
||||
}
|
||||
|
||||
/* Determine if a HLR Update is required */
|
||||
|
@ -1475,7 +1475,7 @@ vlr_loc_update(struct osmo_fsm_inst *parent,
|
|||
const struct osmo_location_area_id *old_lai,
|
||||
const struct osmo_location_area_id *new_lai,
|
||||
bool authentication_required,
|
||||
bool ciphering_required,
|
||||
bool try_ciphering,
|
||||
uint8_t key_seq,
|
||||
bool is_r99, bool is_utran,
|
||||
bool assign_tmsi)
|
||||
|
@ -1499,7 +1499,7 @@ vlr_loc_update(struct osmo_fsm_inst *parent,
|
|||
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->try_ciphering = try_ciphering;
|
||||
lfp->key_seq = key_seq;
|
||||
lfp->is_r99 = is_r99;
|
||||
lfp->is_utran = is_utran;
|
||||
|
@ -1514,10 +1514,10 @@ vlr_loc_update(struct osmo_fsm_inst *parent,
|
|||
LOGPFSM(fi, "rev=%s net=%s%s%s\n",
|
||||
is_r99 ? "R99" : "GSM",
|
||||
is_utran ? "UTRAN" : "GERAN",
|
||||
(authentication_required || ciphering_required)?
|
||||
(authentication_required || try_ciphering) ?
|
||||
" Auth" : " (no Auth)",
|
||||
(authentication_required || ciphering_required)?
|
||||
(ciphering_required? "+Ciph" : " (no Ciph)")
|
||||
(authentication_required || try_ciphering) ?
|
||||
(try_ciphering ? "+Ciph" : " (no Ciph)")
|
||||
: "");
|
||||
|
||||
if (is_utran && !authentication_required)
|
||||
|
|
Loading…
Reference in New Issue